diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -1,5 +1,10 @@ #!/bin/bash +CFLAGS=(-std=c11 -fPIC) +CPPFLAGS=() +LDLIBS=() +LDFLAGS=() + warnings=( -Wall -Wcast-align -Wcast-qual -Wextra -Wpedantic -Wformat=2 -Winit-self -Wmissing-prototypes -Wpointer-arith -Wshadow @@ -7,8 +12,6 @@ warnings=( -Wsuggest-attribute=noreturn ) -CFLAGS+=(-std=c11 -fPIC) - usage () { echo "Usage: $0 [-h|options...]"; } help () { @@ -28,7 +31,6 @@ Options: -w Enable warning flags Environment: CC C compiler - PKG_CONFIG pkg-config EOF } @@ -45,7 +47,6 @@ check() { return 1 } - CC=$(check '$CC, cc, gcc or clang' "$CC" cc gcc clang) || exit colour=auto @@ -75,11 +76,7 @@ fi { echo "# generated using $0 $@" - echo "CC=$CC" - echo "CFLAGS=(${CFLAGS[@]@Q})" - echo "CPPFLAGS=(${CPPFLAGS[@]@Q})" - echo "LDFLAGS=(${LDFLAGS[@]@Q})" - echo "LDLIBS=(${LDLIBS[@]@Q})" + declare -p CC CFLAGS CPPFLAGS LDFLAGS LDLIBS } >.config.rc [[ $verbose ]] && cat .config.rc [[ $gen_flags ]] && printf '%s\n' "${CFLAGS[@]}" "${CPPFLAGS[@]}" >compile_flags.txt |