Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | usage () { |
| 4 | cat <<EOF |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 5 | Usage: $0 [OPTION]... [VAR=VALUE]... [TARGET] |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 6 | |
| 7 | To assign environment variables (e.g., CC, CFLAGS...), specify them as |
| 8 | VAR=VALUE. See below for descriptions of some of the useful variables. |
| 9 | |
| 10 | Defaults for the options are specified in brackets. |
| 11 | |
| 12 | Installation directories: |
| 13 | --prefix=PREFIX main installation prefix [/usr/local/musl] |
| 14 | --exec-prefix=EPREFIX installation prefix for executable files [PREFIX] |
| 15 | |
| 16 | Fine tuning of the installation directories: |
| 17 | --bindir=DIR user executables [EPREFIX/bin] |
| 18 | --libdir=DIR library files for the linker [PREFIX/lib] |
| 19 | --includedir=DIR include files for the C compiler [PREFIX/include] |
| 20 | --syslibdir=DIR location for the dynamic linker [/lib] |
| 21 | |
| 22 | System types: |
| 23 | --target=TARGET configure to run on target TARGET [detected] |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 24 | --host=HOST same as --target |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 25 | |
| 26 | Optional features: |
Rich Felker | a80847d | 2013-07-22 21:22:04 -0400 | [diff] [blame] | 27 | --enable-optimize=... optimize listed components for speed over size [auto] |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 28 | --enable-debug build with debugging information [disabled] |
| 29 | --enable-warnings build with recommended warnings flags [disabled] |
Rich Felker | de2b67f | 2015-04-19 22:05:29 -0400 | [diff] [blame] | 30 | --enable-visibility use global visibility options to optimize PIC [auto] |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 31 | --enable-wrapper=... build given musl toolchain wrapper [auto] |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 32 | --disable-shared inhibit building shared library [enabled] |
| 33 | --disable-static inhibit building static library [enabled] |
| 34 | |
| 35 | Some influential environment variables: |
| 36 | CC C compiler command [detected] |
| 37 | CFLAGS C compiler flags [-Os -pipe ...] |
Rich Felker | 94e920d | 2012-08-14 22:50:16 -0400 | [diff] [blame] | 38 | CROSS_COMPILE prefix for cross compiler and tools [none] |
Rich Felker | 2c1cd23 | 2012-09-10 15:30:52 -0400 | [diff] [blame] | 39 | LIBCC compiler runtime library [detected] |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 40 | |
| 41 | Use these variables to override the choices made by configure. |
| 42 | |
| 43 | EOF |
| 44 | exit 0 |
| 45 | } |
| 46 | |
| 47 | # Helper functions |
| 48 | |
Rich Felker | 453f462 | 2013-08-16 18:19:47 -0400 | [diff] [blame] | 49 | quote () { |
| 50 | tr '\n' ' ' <<EOF | grep '^[-[:alnum:]_=,./:]* $' >/dev/null 2>&1 && { echo "$1" ; return 0 ; } |
| 51 | $1 |
| 52 | EOF |
Rich Felker | e449974 | 2013-08-20 13:51:46 -0400 | [diff] [blame] | 53 | printf %s\\n "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/'/" -e "s#^'\([-[:alnum:]_,./:]*\)=\(.*\)\$#\1='\2#" |
Rich Felker | 453f462 | 2013-08-16 18:19:47 -0400 | [diff] [blame] | 54 | } |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 55 | echo () { printf "%s\n" "$*" ; } |
| 56 | fail () { echo "$*" ; exit 1 ; } |
| 57 | fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; } |
| 58 | cmdexists () { type "$1" >/dev/null 2>&1 ; } |
| 59 | trycc () { test -z "$CC" && cmdexists "$1" && CC=$1 ; } |
| 60 | |
Rich Felker | 3d9e3a3 | 2012-11-08 17:20:50 -0500 | [diff] [blame] | 61 | stripdir () { |
| 62 | while eval "fnmatch '*/' \"\${$1}\"" ; do eval "$1=\${$1%/}" ; done |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 63 | } |
| 64 | |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame] | 65 | trycppif () { |
| 66 | printf "checking preprocessor condition %s... " "$1" |
Rich Felker | df06578 | 2013-07-18 20:37:19 -0400 | [diff] [blame] | 67 | echo "typedef int x;" > "$tmpc" |
| 68 | echo "#if $1" >> "$tmpc" |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame] | 69 | echo "#error yes" >> "$tmpc" |
| 70 | echo "#endif" >> "$tmpc" |
| 71 | if $CC $2 -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
| 72 | printf "false\n" |
| 73 | return 1 |
| 74 | else |
| 75 | printf "true\n" |
| 76 | return 0 |
| 77 | fi |
| 78 | } |
| 79 | |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 80 | tryflag () { |
| 81 | printf "checking whether compiler accepts %s... " "$2" |
| 82 | echo "typedef int x;" > "$tmpc" |
Shiz | fc431d3 | 2015-05-28 05:52:22 +0200 | [diff] [blame] | 83 | if $CC $CFLAGS_TRY $2 -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 84 | printf "yes\n" |
| 85 | eval "$1=\"\${$1} \$2\"" |
| 86 | eval "$1=\${$1# }" |
| 87 | return 0 |
| 88 | else |
| 89 | printf "no\n" |
| 90 | return 1 |
| 91 | fi |
| 92 | } |
| 93 | |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 94 | tryldflag () { |
| 95 | printf "checking whether linker accepts %s... " "$2" |
Rich Felker | 67a0383 | 2012-06-07 00:23:58 -0400 | [diff] [blame] | 96 | echo "typedef int x;" > "$tmpc" |
Shiz | fc431d3 | 2015-05-28 05:52:22 +0200 | [diff] [blame] | 97 | if $CC $LDFLAGS_TRY -nostdlib -shared "$2" -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 98 | printf "yes\n" |
| 99 | eval "$1=\"\${$1} \$2\"" |
| 100 | eval "$1=\${$1# }" |
| 101 | return 0 |
| 102 | else |
| 103 | printf "no\n" |
| 104 | return 1 |
| 105 | fi |
| 106 | } |
| 107 | |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 108 | |
| 109 | |
| 110 | # Beginning of actual script |
| 111 | |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 112 | CFLAGS_C99FSE= |
| 113 | CFLAGS_AUTO= |
Rich Felker | 4a1f55e | 2013-08-01 17:12:23 -0400 | [diff] [blame] | 114 | CFLAGS_MEMOPS= |
Rich Felker | 1ef849c | 2015-04-13 20:13:10 -0400 | [diff] [blame] | 115 | CFLAGS_NOSSP= |
Shiz | fc431d3 | 2015-05-28 05:52:22 +0200 | [diff] [blame] | 116 | CFLAGS_TRY= |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 117 | LDFLAGS_AUTO= |
Shiz | fc431d3 | 2015-05-28 05:52:22 +0200 | [diff] [blame] | 118 | LDFLAGS_TRY= |
Rich Felker | a80847d | 2013-07-22 21:22:04 -0400 | [diff] [blame] | 119 | OPTIMIZE_GLOBS= |
Rich Felker | 3d9e3a3 | 2012-11-08 17:20:50 -0500 | [diff] [blame] | 120 | prefix=/usr/local/musl |
| 121 | exec_prefix='$(prefix)' |
| 122 | bindir='$(exec_prefix)/bin' |
| 123 | libdir='$(prefix)/lib' |
| 124 | includedir='$(prefix)/include' |
| 125 | syslibdir='/lib' |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 126 | tools= |
| 127 | tool_libs= |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 128 | target= |
Rich Felker | a80847d | 2013-07-22 21:22:04 -0400 | [diff] [blame] | 129 | optimize=auto |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 130 | debug=no |
Rich Felker | 3d9e3a3 | 2012-11-08 17:20:50 -0500 | [diff] [blame] | 131 | warnings=no |
Rich Felker | de2b67f | 2015-04-19 22:05:29 -0400 | [diff] [blame] | 132 | visibility=auto |
Rich Felker | d79b277 | 2014-06-10 12:11:12 -0400 | [diff] [blame] | 133 | shared=auto |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 134 | static=yes |
Rich Felker | 9ca4dae | 2014-05-19 10:33:28 -0400 | [diff] [blame] | 135 | wrapper=auto |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 136 | gcc_wrapper=no |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 137 | |
| 138 | for arg ; do |
| 139 | case "$arg" in |
| 140 | --help) usage ;; |
| 141 | --prefix=*) prefix=${arg#*=} ;; |
| 142 | --exec-prefix=*) exec_prefix=${arg#*=} ;; |
| 143 | --bindir=*) bindir=${arg#*=} ;; |
| 144 | --libdir=*) libdir=${arg#*=} ;; |
| 145 | --includedir=*) includedir=${arg#*=} ;; |
| 146 | --syslibdir=*) syslibdir=${arg#*=} ;; |
| 147 | --enable-shared|--enable-shared=yes) shared=yes ;; |
| 148 | --disable-shared|--enable-shared=no) shared=no ;; |
| 149 | --enable-static|--enable-static=yes) static=yes ;; |
| 150 | --disable-static|--enable-static=no) static=no ;; |
Rich Felker | a80847d | 2013-07-22 21:22:04 -0400 | [diff] [blame] | 151 | --enable-optimize) optimize=yes ;; |
| 152 | --enable-optimize=*) optimize=${arg#*=} ;; |
| 153 | --disable-optimize) optimize=no ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 154 | --enable-debug|--enable-debug=yes) debug=yes ;; |
| 155 | --disable-debug|--enable-debug=no) debug=no ;; |
| 156 | --enable-warnings|--enable-warnings=yes) warnings=yes ;; |
| 157 | --disable-warnings|--enable-warnings=no) warnings=no ;; |
Rich Felker | de2b67f | 2015-04-19 22:05:29 -0400 | [diff] [blame] | 158 | --enable-visibility|--enable-visibility=yes) visibility=yes ;; |
| 159 | --disable-visibility|--enable-visibility=no) visibility=no ;; |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 160 | --enable-wrapper|--enable-wrapper=yes) wrapper=detect ;; |
| 161 | --enable-wrapper=all) wrapper=yes ; gcc_wrapper=yes ;; |
| 162 | --enable-wrapper=gcc) wrapper=yes ; gcc_wrapper=yes ;; |
| 163 | --disable-wrapper|--enable-wrapper=no) wrapper=no ;; |
| 164 | --enable-gcc-wrapper|--enable-gcc-wrapper=yes) wrapper=yes ; gcc_wrapper=yes ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 165 | --disable-gcc-wrapper|--enable-gcc-wrapper=no) wrapper=no ;; |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 166 | --enable-*|--disable-*|--with-*|--without-*|--*dir=*|--build=*) ;; |
| 167 | --host=*|--target=*) target=${arg#*=} ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 168 | -* ) echo "$0: unknown option $arg" ;; |
| 169 | CC=*) CC=${arg#*=} ;; |
| 170 | CFLAGS=*) CFLAGS=${arg#*=} ;; |
| 171 | CPPFLAGS=*) CPPFLAGS=${arg#*=} ;; |
| 172 | LDFLAGS=*) LDFLAGS=${arg#*=} ;; |
Rich Felker | 94e920d | 2012-08-14 22:50:16 -0400 | [diff] [blame] | 173 | CROSS_COMPILE=*) CROSS_COMPILE=${arg#*=} ;; |
Rich Felker | 2c1cd23 | 2012-09-10 15:30:52 -0400 | [diff] [blame] | 174 | LIBCC=*) LIBCC=${arg#*=} ;; |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 175 | *=*) ;; |
| 176 | *) target=$arg ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 177 | esac |
| 178 | done |
| 179 | |
Rich Felker | 3d9e3a3 | 2012-11-08 17:20:50 -0500 | [diff] [blame] | 180 | for i in prefix exec_prefix bindir libdir includedir syslibdir ; do |
| 181 | stripdir $i |
| 182 | done |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 183 | |
| 184 | # |
| 185 | # Get a temp filename we can use |
| 186 | # |
| 187 | i=0 |
| 188 | set -C |
| 189 | while : ; do i=$(($i+1)) |
| 190 | tmpc="./conf$$-$PPID-$i.c" |
Rich Felker | 6c0cba8 | 2012-11-18 23:15:47 -0500 | [diff] [blame] | 191 | 2>|/dev/null > "$tmpc" && break |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 192 | test "$i" -gt 50 && fail "$0: cannot create temporary file $tmpc" |
| 193 | done |
| 194 | set +C |
| 195 | trap 'rm "$tmpc"' EXIT INT QUIT TERM HUP |
| 196 | |
| 197 | # |
| 198 | # Find a C compiler to use |
| 199 | # |
| 200 | printf "checking for C compiler... " |
Rich Felker | 94e920d | 2012-08-14 22:50:16 -0400 | [diff] [blame] | 201 | trycc ${CROSS_COMPILE}gcc |
| 202 | trycc ${CROSS_COMPILE}c99 |
| 203 | trycc ${CROSS_COMPILE}cc |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 204 | printf "%s\n" "$CC" |
| 205 | test -n "$CC" || { echo "$0: cannot find a C compiler" ; exit 1 ; } |
| 206 | |
Rich Felker | 8945667 | 2014-05-12 14:22:57 -0400 | [diff] [blame] | 207 | printf "checking whether C compiler works... " |
| 208 | echo "typedef int x;" > "$tmpc" |
| 209 | if output=$($CC $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" 2>&1) ; then |
| 210 | printf "yes\n" |
| 211 | else |
| 212 | printf "no; compiler output follows:\n%s\n" "$output" |
| 213 | exit 1 |
| 214 | fi |
| 215 | |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 216 | # |
Shiz | fc431d3 | 2015-05-28 05:52:22 +0200 | [diff] [blame] | 217 | # Figure out options to force errors on unknown flags. |
| 218 | # |
| 219 | tryflag CFLAGS_TRY -Werror=unknown-warning-option |
| 220 | tryflag CFLAGS_TRY -Werror=unused-command-line-argument |
| 221 | tryldflag LDFLAGS_TRY -Werror=unknown-warning-option |
| 222 | tryldflag LDFLAGS_TRY -Werror=unused-command-line-argument |
| 223 | |
| 224 | # |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 225 | # Need to know if the compiler is gcc or clang to decide which toolchain |
| 226 | # wrappers to build. |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 227 | # |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 228 | printf "checking for C compiler family... " |
| 229 | cc_ver="$(LC_ALL=C $CC -v 2>&1)" |
| 230 | cc_family=unknown |
| 231 | if fnmatch '*gcc\ version*' "$cc_ver" ; then |
| 232 | cc_family=gcc |
Rich Felker | 9ca4dae | 2014-05-19 10:33:28 -0400 | [diff] [blame] | 233 | fi |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 234 | echo "$cc_family" |
Rich Felker | 9ca4dae | 2014-05-19 10:33:28 -0400 | [diff] [blame] | 235 | |
| 236 | # |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 237 | # Figure out toolchain wrapper to build |
Rich Felker | 9ca4dae | 2014-05-19 10:33:28 -0400 | [diff] [blame] | 238 | # |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 239 | if test "$wrapper" = auto -o "$wrapper" = detect ; then |
Shiz | f8db6f7 | 2015-06-28 23:08:20 +0200 | [diff] [blame^] | 240 | echo "#include <stdlib.h>" > "$tmpc" |
| 241 | echo "#if ! __GLIBC__" >> "$tmpc" |
| 242 | echo "#error no" >> "$tmpc" |
| 243 | echo "#endif" >> "$tmpc" |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 244 | printf "checking for toolchain wrapper to build... " |
Shiz | f8db6f7 | 2015-06-28 23:08:20 +0200 | [diff] [blame^] | 245 | if test "$wrapper" = auto && ! $CC -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
| 246 | echo "none" |
| 247 | elif test "$cc_family" = gcc ; then |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 248 | gcc_wrapper=yes |
Shiz | f8db6f7 | 2015-06-28 23:08:20 +0200 | [diff] [blame^] | 249 | echo "gcc" |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 250 | else |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 251 | echo "none" |
| 252 | if test "$wrapper" = detect ; then |
| 253 | fail "$0: could not find an appropriate toolchain wrapper" |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 254 | fi |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 255 | fi |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 256 | fi |
| 257 | |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 258 | if test "$gcc_wrapper" = yes ; then |
| 259 | tools="$tools tools/musl-gcc" |
| 260 | tool_libs="$tool_libs lib/musl-gcc.specs" |
| 261 | fi |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 262 | |
| 263 | # |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 264 | # Find the target architecture |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 265 | # |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 266 | printf "checking target system type... " |
Rich Felker | 01e5a1b | 2012-10-18 23:02:53 -0400 | [diff] [blame] | 267 | test -n "$target" || target=$($CC -dumpmachine 2>/dev/null) || target=unknown |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 268 | printf "%s\n" "$target" |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 269 | |
| 270 | # |
| 271 | # Convert to just ARCH |
| 272 | # |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 273 | case "$target" in |
Rich Felker | 0b8f0c5 | 2014-02-28 13:12:40 -0500 | [diff] [blame] | 274 | # Catch these early to simplify matching for 32-bit archs |
| 275 | mips64*|powerpc64*) fail "$0: unsupported target \"$target\"" ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 276 | arm*) ARCH=arm ;; |
Szabolcs Nagy | 01ef3dd | 2015-03-10 21:18:41 +0000 | [diff] [blame] | 277 | aarch64*) ARCH=aarch64 ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 278 | i?86*) ARCH=i386 ;; |
Rich Felker | f162c06 | 2014-03-17 17:38:22 -0400 | [diff] [blame] | 279 | x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 280 | x86_64*) ARCH=x86_64 ;; |
Rich Felker | 0b8f0c5 | 2014-02-28 13:12:40 -0500 | [diff] [blame] | 281 | mips*) ARCH=mips ;; |
| 282 | microblaze*) ARCH=microblaze ;; |
Stefan Kristiansson | 200d154 | 2014-07-17 22:09:10 +0300 | [diff] [blame] | 283 | or1k*) ARCH=or1k ;; |
Rich Felker | 0b8f0c5 | 2014-02-28 13:12:40 -0500 | [diff] [blame] | 284 | powerpc*) ARCH=powerpc ;; |
| 285 | sh[1-9bel-]*|sh|superh*) ARCH=sh ;; |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 286 | unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;; |
| 287 | *) fail "$0: unknown or unsupported target \"$target\"" ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 288 | esac |
| 289 | |
| 290 | # |
| 291 | # Try to get a conforming C99 freestanding environment |
| 292 | # |
| 293 | tryflag CFLAGS_C99FSE -std=c99 |
| 294 | tryflag CFLAGS_C99FSE -nostdinc |
| 295 | tryflag CFLAGS_C99FSE -ffreestanding \ |
| 296 | || tryflag CFLAGS_C99FSE -fno-builtin |
| 297 | tryflag CFLAGS_C99FSE -fexcess-precision=standard \ |
Rich Felker | 2121b8a | 2012-07-03 23:53:05 -0400 | [diff] [blame] | 298 | || { test "$ARCH" = i386 && tryflag CFLAGS_C99FSE -ffloat-store ; } |
Rich Felker | b4ccc3c | 2012-05-05 17:18:31 -0400 | [diff] [blame] | 299 | tryflag CFLAGS_C99FSE -frounding-math |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 300 | |
Rich Felker | 4a1f55e | 2013-08-01 17:12:23 -0400 | [diff] [blame] | 301 | # |
Rich Felker | 06ceee8 | 2013-08-27 17:33:47 -0400 | [diff] [blame] | 302 | # We may use the may_alias attribute if __GNUC__ is defined, so |
| 303 | # if the compiler defines __GNUC__ but does not provide it, |
| 304 | # it must be defined away as part of the CFLAGS. |
| 305 | # |
| 306 | printf "checking whether compiler needs attribute((may_alias)) suppression... " |
| 307 | cat > "$tmpc" <<EOF |
| 308 | typedef int |
| 309 | #ifdef __GNUC__ |
| 310 | __attribute__((__may_alias__)) |
| 311 | #endif |
| 312 | x; |
| 313 | EOF |
| 314 | if $CC $CFLAGS_C99FSE -I./arch/$ARCH -I./include $CPPFLAGS $CFLAGS \ |
| 315 | -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
| 316 | printf "no\n" |
| 317 | else |
| 318 | printf "yes\n" |
| 319 | CFLAGS_C99FSE="$CFLAGS_C99FSE -D__may_alias__=" |
| 320 | fi |
| 321 | |
| 322 | # |
Rich Felker | 1ef849c | 2015-04-13 20:13:10 -0400 | [diff] [blame] | 323 | # Check for options to disable stack protector, which needs to be |
| 324 | # disabled for a few early-bootstrap translation units. If not found, |
| 325 | # this is not an error; we assume the toolchain does not do ssp. |
| 326 | # |
| 327 | tryflag CFLAGS_NOSSP -fno-stack-protector |
| 328 | |
| 329 | # |
Rich Felker | 4a1f55e | 2013-08-01 17:12:23 -0400 | [diff] [blame] | 330 | # Check for options that may be needed to prevent the compiler from |
| 331 | # generating self-referential versions of memcpy,, memmove, memcmp, |
| 332 | # and memset. Really, we should add a check to determine if this |
| 333 | # option is sufficient, and if not, add a macro to cripple these |
| 334 | # functions with volatile... |
| 335 | # |
| 336 | tryflag CFLAGS_MEMOPS -fno-tree-loop-distribute-patterns |
Rich Felker | a80847d | 2013-07-22 21:22:04 -0400 | [diff] [blame] | 337 | |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 338 | # |
Rich Felker | 4ad3588 | 2014-06-20 16:10:48 -0400 | [diff] [blame] | 339 | # Enable debugging if requessted. |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 340 | # |
Rich Felker | 4ad3588 | 2014-06-20 16:10:48 -0400 | [diff] [blame] | 341 | test "$debug" = yes && CFLAGS_AUTO=-g |
Rich Felker | a80847d | 2013-07-22 21:22:04 -0400 | [diff] [blame] | 342 | |
| 343 | # |
| 344 | # Possibly add a -O option to CFLAGS and select modules to optimize with |
| 345 | # -O3 based on the status of --enable-optimize and provided CFLAGS. |
| 346 | # |
| 347 | printf "checking for optimization settings... " |
| 348 | case "x$optimize" in |
| 349 | xauto) |
| 350 | if fnmatch '-O*|*\ -O*' "$CFLAGS_AUTO $CFLAGS" ; then |
| 351 | printf "using provided CFLAGS\n" ;optimize=no |
| 352 | else |
| 353 | printf "using defaults\n" ; optimize=yes |
| 354 | fi |
| 355 | ;; |
| 356 | xsize|xnone) printf "minimize size\n" ; optimize=size ;; |
| 357 | xno|x) printf "disabled\n" ; optimize=no ;; |
| 358 | *) printf "custom\n" ;; |
| 359 | esac |
| 360 | |
| 361 | test "$optimize" = no || tryflag CFLAGS_AUTO -Os || tryflag CFLAGS_AUTO -O2 |
Rich Felker | 43d2531 | 2013-07-24 23:21:45 -0400 | [diff] [blame] | 362 | test "$optimize" = yes && optimize="internal,malloc,string" |
Rich Felker | a80847d | 2013-07-22 21:22:04 -0400 | [diff] [blame] | 363 | |
| 364 | if fnmatch 'no|size' "$optimize" ; then : |
| 365 | else |
| 366 | printf "components to be optimized for speed:" |
| 367 | while test "$optimize" ; do |
| 368 | case "$optimize" in |
| 369 | *,*) this=${optimize%%,*} optimize=${optimize#*,} ;; |
| 370 | *) this=$optimize optimize= |
| 371 | esac |
| 372 | printf " $this" |
| 373 | case "$this" in |
| 374 | */*.c) ;; |
| 375 | */*) this=$this*.c ;; |
| 376 | *) this=$this/*.c ;; |
| 377 | esac |
| 378 | OPTIMIZE_GLOBS="$OPTIMIZE_GLOBS $this" |
| 379 | done |
| 380 | OPTIMIZE_GLOBS=${OPTIMIZE_GLOBS# } |
| 381 | printf "\n" |
| 382 | fi |
| 383 | |
| 384 | # Always try -pipe |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 385 | tryflag CFLAGS_AUTO -pipe |
| 386 | |
| 387 | # |
Rich Felker | b439c05 | 2012-08-29 09:36:02 -0400 | [diff] [blame] | 388 | # If debugging is disabled, omit frame pointer. Modern GCC does this |
| 389 | # anyway on most archs even when debugging is enabled since the frame |
| 390 | # pointer is no longer needed for debugging. |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 391 | # |
| 392 | if fnmatch '-g*|*\ -g*' "$CFLAGS_AUTO $CFLAGS" ; then : |
| 393 | else |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 394 | tryflag CFLAGS_AUTO -fomit-frame-pointer |
| 395 | fi |
| 396 | |
| 397 | # |
Rich Felker | b439c05 | 2012-08-29 09:36:02 -0400 | [diff] [blame] | 398 | # Modern GCC wants to put DWARF tables (used for debugging and |
| 399 | # unwinding) in the loaded part of the program where they are |
| 400 | # unstrippable. These options force them back to debug sections (and |
| 401 | # cause them not to get generated at all if debugging is off). |
| 402 | # |
| 403 | tryflag CFLAGS_AUTO -fno-unwind-tables |
| 404 | tryflag CFLAGS_AUTO -fno-asynchronous-unwind-tables |
| 405 | |
| 406 | # |
Rich Felker | adefe83 | 2012-10-03 11:49:58 -0400 | [diff] [blame] | 407 | # The GNU toolchain defaults to assuming unmarked files need an |
| 408 | # executable stack, potentially exposing vulnerabilities in programs |
| 409 | # linked with such object files. Fix this. |
| 410 | # |
| 411 | tryflag CFLAGS_AUTO -Wa,--noexecstack |
| 412 | |
| 413 | # |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 414 | # On x86, make sure we don't have incompatible instruction set |
| 415 | # extensions enabled by default. This is bad for making static binaries. |
| 416 | # We cheat and use i486 rather than i386 because i386 really does not |
| 417 | # work anyway (issues with atomic ops). |
Andre McCurdy | a6274a1 | 2015-04-21 10:34:05 -0700 | [diff] [blame] | 418 | # Some build environments pass -march and -mtune options via CC, so |
| 419 | # check both CC and CFLAGS. |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 420 | # |
| 421 | if test "$ARCH" = "i386" ; then |
Andre McCurdy | a6274a1 | 2015-04-21 10:34:05 -0700 | [diff] [blame] | 422 | fnmatch '-march=*|*\ -march=*' "$CC $CFLAGS" || tryldflag CFLAGS_AUTO -march=i486 |
| 423 | fnmatch '-mtune=*|*\ -mtune=*' "$CC $CFLAGS" || tryldflag CFLAGS_AUTO -mtune=generic |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 424 | fi |
| 425 | |
Rich Felker | 2384f27 | 2012-12-11 23:28:31 -0500 | [diff] [blame] | 426 | # |
| 427 | # Even with -std=c99, gcc accepts some constructs which are constraint |
| 428 | # violations. We want to treat these as errors regardless of whether |
| 429 | # other purely stylistic warnings are enabled -- especially implicit |
| 430 | # function declarations, which are a dangerous programming error. |
| 431 | # |
| 432 | tryflag CFLAGS_AUTO -Werror=implicit-function-declaration |
| 433 | tryflag CFLAGS_AUTO -Werror=implicit-int |
| 434 | tryflag CFLAGS_AUTO -Werror=pointer-sign |
| 435 | tryflag CFLAGS_AUTO -Werror=pointer-arith |
| 436 | |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 437 | if test "x$warnings" = xyes ; then |
| 438 | tryflag CFLAGS_AUTO -Wall |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 439 | tryflag CFLAGS_AUTO -Wno-parentheses |
| 440 | tryflag CFLAGS_AUTO -Wno-uninitialized |
| 441 | tryflag CFLAGS_AUTO -Wno-missing-braces |
| 442 | tryflag CFLAGS_AUTO -Wno-unused-value |
| 443 | tryflag CFLAGS_AUTO -Wno-unused-but-set-variable |
| 444 | tryflag CFLAGS_AUTO -Wno-unknown-pragmas |
rofl0r | adbeefb | 2014-01-08 03:11:46 +0100 | [diff] [blame] | 445 | tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 446 | fi |
| 447 | |
Rich Felker | 3aacb54 | 2015-04-22 22:11:48 -0400 | [diff] [blame] | 448 | if test "x$visibility" = xauto ; then |
Rich Felker | de2b67f | 2015-04-19 22:05:29 -0400 | [diff] [blame] | 449 | # This test checks toolchain support for several things: |
| 450 | # - the -include option |
| 451 | # - the attributes/pragmas used in vis.h |
| 452 | # - linking code that takes the address of protected symbols |
| 453 | printf "checking whether global visibility preinclude works... " |
| 454 | echo 'int (*fp)(void);' > "$tmpc" |
| 455 | echo 'int foo(void) { }' >> "$tmpc" |
| 456 | echo 'int bar(void) { fp = foo; return foo(); }' >> "$tmpc" |
Rich Felker | 60ed988 | 2015-04-20 18:14:19 -0400 | [diff] [blame] | 457 | if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS \ |
Rich Felker | 428462a | 2015-04-22 01:41:00 -0400 | [diff] [blame] | 458 | -DSHARED -fPIC -I./src/internal -include vis.h \ |
Rich Felker | de2b67f | 2015-04-19 22:05:29 -0400 | [diff] [blame] | 459 | -nostdlib -shared -Wl,-Bsymbolic-functions \ |
| 460 | -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
| 461 | visibility=yes |
| 462 | else |
| 463 | visibility=no |
| 464 | fi |
| 465 | printf "%s\n" "$visibility" |
| 466 | fi |
| 467 | |
Rich Felker | 3aacb54 | 2015-04-22 22:11:48 -0400 | [diff] [blame] | 468 | if test "x$visibility" = xyes ; then |
Rich Felker | 428462a | 2015-04-22 01:41:00 -0400 | [diff] [blame] | 469 | CFLAGS_AUTO="$CFLAGS_AUTO -include vis.h" |
Rich Felker | de2b67f | 2015-04-19 22:05:29 -0400 | [diff] [blame] | 470 | CFLAGS_AUTO="${CFLAGS_AUTO# }" |
| 471 | fi |
| 472 | |
Rich Felker | 0c5efde | 2012-06-06 22:00:08 -0400 | [diff] [blame] | 473 | # Some patched GCC builds have these defaults messed up... |
Rich Felker | 2bd05a4 | 2012-08-25 17:13:28 -0400 | [diff] [blame] | 474 | tryldflag LDFLAGS_AUTO -Wl,--hash-style=both |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 475 | |
Rich Felker | d79b277 | 2014-06-10 12:11:12 -0400 | [diff] [blame] | 476 | test "$shared" = "no" || { |
Rich Felker | 498a100 | 2012-06-07 00:32:22 -0400 | [diff] [blame] | 477 | # Disable dynamic linking if ld is broken and can't do -Bsymbolic-functions |
| 478 | LDFLAGS_DUMMY= |
| 479 | tryldflag LDFLAGS_DUMMY -Wl,-Bsymbolic-functions || { |
Rich Felker | d79b277 | 2014-06-10 12:11:12 -0400 | [diff] [blame] | 480 | test "$shared" = "yes" && fail "$0: error: linker cannot build shared library" |
Rich Felker | 498a100 | 2012-06-07 00:32:22 -0400 | [diff] [blame] | 481 | printf "warning: disabling dynamic linking support\n" |
| 482 | shared=no |
| 483 | } |
Rich Felker | d79b277 | 2014-06-10 12:11:12 -0400 | [diff] [blame] | 484 | } |
Rich Felker | 498a100 | 2012-06-07 00:32:22 -0400 | [diff] [blame] | 485 | |
Rich Felker | 2c1cd23 | 2012-09-10 15:30:52 -0400 | [diff] [blame] | 486 | # Find compiler runtime library |
| 487 | test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh |
| 488 | test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt |
Rich Felker | cd31a1f | 2012-10-26 18:15:51 -0400 | [diff] [blame] | 489 | test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \ |
| 490 | && tryldflag LIBCC "$try_libcc" |
Rich Felker | 2c1cd23 | 2012-09-10 15:30:52 -0400 | [diff] [blame] | 491 | printf "using compiler runtime libraries: %s\n" "$LIBCC" |
Rich Felker | a1546e8 | 2012-07-12 14:24:10 -0400 | [diff] [blame] | 492 | |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame] | 493 | # Figure out arch variants for archs with variants |
| 494 | SUBARCH= |
Rich Felker | 428462a | 2015-04-22 01:41:00 -0400 | [diff] [blame] | 495 | t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS" |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame] | 496 | |
rofl0r | 8c82023 | 2014-03-19 22:31:00 +0100 | [diff] [blame] | 497 | if test "$ARCH" = "x86_64" ; then |
| 498 | trycppif __ILP32__ "$t" && ARCH=x32 |
| 499 | fi |
| 500 | |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame] | 501 | if test "$ARCH" = "arm" ; then |
| 502 | trycppif __ARMEB__ "$t" && SUBARCH=${SUBARCH}eb |
Rich Felker | 4918c2b | 2013-08-16 17:09:07 -0400 | [diff] [blame] | 503 | trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame] | 504 | fi |
| 505 | |
Szabolcs Nagy | 01ef3dd | 2015-03-10 21:18:41 +0000 | [diff] [blame] | 506 | if test "$ARCH" = "aarch64" ; then |
| 507 | trycppif __AARCH64EB__ "$t" && SUBARCH=${SUBARCH}_be |
| 508 | fi |
| 509 | |
Szabolcs Nagy | e5bb165 | 2014-02-24 23:16:29 +0100 | [diff] [blame] | 510 | if test "$ARCH" = "mips" ; then |
| 511 | trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el |
| 512 | trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf |
| 513 | fi |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame] | 514 | |
| 515 | test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \ |
| 516 | && SUBARCH=${SUBARCH}el |
| 517 | |
Rich Felker | b1683a1 | 2014-02-27 23:18:42 -0500 | [diff] [blame] | 518 | if test "$ARCH" = "sh" ; then |
| 519 | trycppif __BIG_ENDIAN__ "$t" && SUBARCH=${SUBARCH}eb |
Bobby Bingham | 23d6418 | 2014-04-27 21:13:59 -0500 | [diff] [blame] | 520 | if trycppif "__SH_FPU_ANY__ || __SH4__" "$t" ; then |
Rich Felker | b1683a1 | 2014-02-27 23:18:42 -0500 | [diff] [blame] | 521 | # Some sh configurations are broken and replace double with float |
| 522 | # rather than using softfloat when the fpu is present but only |
| 523 | # supports single precision. Reject them. |
| 524 | printf "checking whether compiler's double type is IEEE double... " |
Rich Felker | 946b9fa | 2014-02-27 23:55:04 -0500 | [diff] [blame] | 525 | echo 'typedef char dblcheck[(int)sizeof(double)-5];' > "$tmpc" |
Rich Felker | b1683a1 | 2014-02-27 23:18:42 -0500 | [diff] [blame] | 526 | if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
| 527 | printf "yes\n" |
| 528 | else |
| 529 | printf "no\n" |
| 530 | fail "$0: error: compiler's floating point configuration is unsupported" |
| 531 | fi |
| 532 | else |
| 533 | SUBARCH=${SUBARCH}-nofpu |
| 534 | fi |
| 535 | fi |
Bobby Bingham | 3a3c813 | 2013-10-05 05:13:18 -0500 | [diff] [blame] | 536 | |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame] | 537 | test "$SUBARCH" \ |
| 538 | && printf "configured for %s variant: %s\n" "$ARCH" "$ARCH$SUBARCH" |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 539 | |
Rich Felker | 90d7772 | 2013-08-11 03:27:35 -0400 | [diff] [blame] | 540 | case "$ARCH$SUBARCH" in |
| 541 | arm) ASMSUBARCH=el ;; |
| 542 | *) ASMSUBARCH=$SUBARCH ;; |
| 543 | esac |
| 544 | |
Rich Felker | 86cc54b | 2013-08-02 19:34:22 -0400 | [diff] [blame] | 545 | # |
| 546 | # Some archs (powerpc) have different possible long double formats |
| 547 | # that the compiler can be configured for. The logic for whether this |
| 548 | # is supported is in bits/float.h; in general, it is not. We need to |
| 549 | # check for mismatches here or code in printf, strotd, and scanf will |
| 550 | # be dangerously incorrect because it depends on (1) the macros being |
| 551 | # correct, and (2) IEEE semantics. |
| 552 | # |
| 553 | printf "checking whether compiler's long double definition matches float.h... " |
| 554 | echo '#include <float.h>' > "$tmpc" |
| 555 | echo '#if LDBL_MANT_DIG == 53' >> "$tmpc" |
| 556 | echo 'typedef char ldcheck[9-(int)sizeof(long double)];' >> "$tmpc" |
| 557 | echo '#endif' >> "$tmpc" |
| 558 | if $CC $CFLAGS_C99FSE -I./arch/$ARCH -I./include $CPPFLAGS $CFLAGS \ |
| 559 | -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
| 560 | printf "yes\n" |
| 561 | else |
| 562 | printf "no\n" |
| 563 | fail "$0: error: unsupported long double type" |
| 564 | fi |
| 565 | |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 566 | printf "creating config.mak... " |
| 567 | |
Rich Felker | 453f462 | 2013-08-16 18:19:47 -0400 | [diff] [blame] | 568 | cmdline=$(quote "$0") |
| 569 | for i ; do cmdline="$cmdline $(quote "$i")" ; done |
| 570 | |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 571 | exec 3>&1 1>config.mak |
| 572 | |
| 573 | |
| 574 | cat << EOF |
Rich Felker | 453f462 | 2013-08-16 18:19:47 -0400 | [diff] [blame] | 575 | # This version of config.mak was generated by: |
| 576 | # $cmdline |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 577 | # Any changes made here will be lost if configure is re-run |
| 578 | ARCH = $ARCH |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame] | 579 | SUBARCH = $SUBARCH |
Rich Felker | 90d7772 | 2013-08-11 03:27:35 -0400 | [diff] [blame] | 580 | ASMSUBARCH = $ASMSUBARCH |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 581 | prefix = $prefix |
| 582 | exec_prefix = $exec_prefix |
| 583 | bindir = $bindir |
| 584 | libdir = $libdir |
| 585 | includedir = $includedir |
| 586 | syslibdir = $syslibdir |
| 587 | CC = $CC |
Rich Felker | 7c6db37 | 2014-05-20 15:49:21 -0400 | [diff] [blame] | 588 | CFLAGS = $CFLAGS_AUTO $CFLAGS |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 589 | CFLAGS_C99FSE = $CFLAGS_C99FSE |
Rich Felker | 4a1f55e | 2013-08-01 17:12:23 -0400 | [diff] [blame] | 590 | CFLAGS_MEMOPS = $CFLAGS_MEMOPS |
Rich Felker | 1ef849c | 2015-04-13 20:13:10 -0400 | [diff] [blame] | 591 | CFLAGS_NOSSP = $CFLAGS_NOSSP |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 592 | CPPFLAGS = $CPPFLAGS |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 593 | LDFLAGS = $LDFLAGS_AUTO $LDFLAGS |
Rich Felker | 94e920d | 2012-08-14 22:50:16 -0400 | [diff] [blame] | 594 | CROSS_COMPILE = $CROSS_COMPILE |
Rich Felker | 2c1cd23 | 2012-09-10 15:30:52 -0400 | [diff] [blame] | 595 | LIBCC = $LIBCC |
Rich Felker | a80847d | 2013-07-22 21:22:04 -0400 | [diff] [blame] | 596 | OPTIMIZE_GLOBS = $OPTIMIZE_GLOBS |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 597 | ALL_TOOLS = $tools |
| 598 | TOOL_LIBS = $tool_libs |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 599 | EOF |
| 600 | test "x$static" = xno && echo "STATIC_LIBS =" |
| 601 | test "x$shared" = xno && echo "SHARED_LIBS =" |
Shiz | b3cd7d1 | 2015-06-28 23:08:19 +0200 | [diff] [blame] | 602 | test "x$cc_family" = xgcc && echo 'WRAPCC_GCC = $(CC)' |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 603 | exec 1>&3 3>&- |
| 604 | |
| 605 | printf "done\n" |