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: |
| 27 | --enable-debug build with debugging information [disabled] |
| 28 | --enable-warnings build with recommended warnings flags [disabled] |
| 29 | --enable-gcc-wrapper build musl-gcc toolchain wrapper [auto] |
| 30 | --disable-shared inhibit building shared library [enabled] |
| 31 | --disable-static inhibit building static library [enabled] |
| 32 | |
| 33 | Some influential environment variables: |
| 34 | CC C compiler command [detected] |
| 35 | CFLAGS C compiler flags [-Os -pipe ...] |
Rich Felker | 94e920d | 2012-08-14 22:50:16 -0400 | [diff] [blame] | 36 | CROSS_COMPILE prefix for cross compiler and tools [none] |
Rich Felker | 2c1cd23 | 2012-09-10 15:30:52 -0400 | [diff] [blame] | 37 | LIBCC compiler runtime library [detected] |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 38 | |
| 39 | Use these variables to override the choices made by configure. |
| 40 | |
| 41 | EOF |
| 42 | exit 0 |
| 43 | } |
| 44 | |
| 45 | # Helper functions |
| 46 | |
| 47 | echo () { printf "%s\n" "$*" ; } |
| 48 | fail () { echo "$*" ; exit 1 ; } |
| 49 | fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; } |
| 50 | cmdexists () { type "$1" >/dev/null 2>&1 ; } |
| 51 | trycc () { test -z "$CC" && cmdexists "$1" && CC=$1 ; } |
| 52 | |
Rich Felker | 3d9e3a3 | 2012-11-08 17:20:50 -0500 | [diff] [blame] | 53 | stripdir () { |
| 54 | while eval "fnmatch '*/' \"\${$1}\"" ; do eval "$1=\${$1%/}" ; done |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 55 | } |
| 56 | |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame^] | 57 | trycppif () { |
| 58 | printf "checking preprocessor condition %s... " "$1" |
| 59 | echo "#if $1" > "$tmpc" |
| 60 | echo "#error yes" >> "$tmpc" |
| 61 | echo "#endif" >> "$tmpc" |
| 62 | if $CC $2 -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
| 63 | printf "false\n" |
| 64 | return 1 |
| 65 | else |
| 66 | printf "true\n" |
| 67 | return 0 |
| 68 | fi |
| 69 | } |
| 70 | |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 71 | tryflag () { |
| 72 | printf "checking whether compiler accepts %s... " "$2" |
| 73 | echo "typedef int x;" > "$tmpc" |
Rich Felker | cd31a1f | 2012-10-26 18:15:51 -0400 | [diff] [blame] | 74 | if $CC "$2" -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 75 | printf "yes\n" |
| 76 | eval "$1=\"\${$1} \$2\"" |
| 77 | eval "$1=\${$1# }" |
| 78 | return 0 |
| 79 | else |
| 80 | printf "no\n" |
| 81 | return 1 |
| 82 | fi |
| 83 | } |
| 84 | |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 85 | tryldflag () { |
| 86 | printf "checking whether linker accepts %s... " "$2" |
Rich Felker | 67a0383 | 2012-06-07 00:23:58 -0400 | [diff] [blame] | 87 | echo "typedef int x;" > "$tmpc" |
Rich Felker | cd31a1f | 2012-10-26 18:15:51 -0400 | [diff] [blame] | 88 | if $CC -nostdlib -shared "$2" -o /dev/null "$tmpc" >/dev/null 2>&1 ; then |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 89 | printf "yes\n" |
| 90 | eval "$1=\"\${$1} \$2\"" |
| 91 | eval "$1=\${$1# }" |
| 92 | return 0 |
| 93 | else |
| 94 | printf "no\n" |
| 95 | return 1 |
| 96 | fi |
| 97 | } |
| 98 | |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 99 | |
| 100 | |
| 101 | # Beginning of actual script |
| 102 | |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 103 | CFLAGS_C99FSE= |
| 104 | CFLAGS_AUTO= |
| 105 | LDFLAGS_AUTO= |
Rich Felker | 3d9e3a3 | 2012-11-08 17:20:50 -0500 | [diff] [blame] | 106 | prefix=/usr/local/musl |
| 107 | exec_prefix='$(prefix)' |
| 108 | bindir='$(exec_prefix)/bin' |
| 109 | libdir='$(prefix)/lib' |
| 110 | includedir='$(prefix)/include' |
| 111 | syslibdir='/lib' |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 112 | target= |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 113 | debug=no |
Rich Felker | 3d9e3a3 | 2012-11-08 17:20:50 -0500 | [diff] [blame] | 114 | warnings=no |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 115 | shared=yes |
| 116 | static=yes |
| 117 | |
| 118 | for arg ; do |
| 119 | case "$arg" in |
| 120 | --help) usage ;; |
| 121 | --prefix=*) prefix=${arg#*=} ;; |
| 122 | --exec-prefix=*) exec_prefix=${arg#*=} ;; |
| 123 | --bindir=*) bindir=${arg#*=} ;; |
| 124 | --libdir=*) libdir=${arg#*=} ;; |
| 125 | --includedir=*) includedir=${arg#*=} ;; |
| 126 | --syslibdir=*) syslibdir=${arg#*=} ;; |
| 127 | --enable-shared|--enable-shared=yes) shared=yes ;; |
| 128 | --disable-shared|--enable-shared=no) shared=no ;; |
| 129 | --enable-static|--enable-static=yes) static=yes ;; |
| 130 | --disable-static|--enable-static=no) static=no ;; |
| 131 | --enable-debug|--enable-debug=yes) debug=yes ;; |
| 132 | --disable-debug|--enable-debug=no) debug=no ;; |
| 133 | --enable-warnings|--enable-warnings=yes) warnings=yes ;; |
| 134 | --disable-warnings|--enable-warnings=no) warnings=no ;; |
| 135 | --enable-gcc-wrapper|--enable-gcc-wrapper=yes) wrapper=yes ;; |
| 136 | --disable-gcc-wrapper|--enable-gcc-wrapper=no) wrapper=no ;; |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 137 | --enable-*|--disable-*|--with-*|--without-*|--*dir=*|--build=*) ;; |
| 138 | --host=*|--target=*) target=${arg#*=} ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 139 | -* ) echo "$0: unknown option $arg" ;; |
| 140 | CC=*) CC=${arg#*=} ;; |
| 141 | CFLAGS=*) CFLAGS=${arg#*=} ;; |
| 142 | CPPFLAGS=*) CPPFLAGS=${arg#*=} ;; |
| 143 | LDFLAGS=*) LDFLAGS=${arg#*=} ;; |
Rich Felker | 94e920d | 2012-08-14 22:50:16 -0400 | [diff] [blame] | 144 | CROSS_COMPILE=*) CROSS_COMPILE=${arg#*=} ;; |
Rich Felker | 2c1cd23 | 2012-09-10 15:30:52 -0400 | [diff] [blame] | 145 | LIBCC=*) LIBCC=${arg#*=} ;; |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 146 | *=*) ;; |
| 147 | *) target=$arg ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 148 | esac |
| 149 | done |
| 150 | |
Rich Felker | 3d9e3a3 | 2012-11-08 17:20:50 -0500 | [diff] [blame] | 151 | for i in prefix exec_prefix bindir libdir includedir syslibdir ; do |
| 152 | stripdir $i |
| 153 | done |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 154 | |
| 155 | # |
| 156 | # Get a temp filename we can use |
| 157 | # |
| 158 | i=0 |
| 159 | set -C |
| 160 | while : ; do i=$(($i+1)) |
| 161 | tmpc="./conf$$-$PPID-$i.c" |
Rich Felker | 6c0cba8 | 2012-11-18 23:15:47 -0500 | [diff] [blame] | 162 | 2>|/dev/null > "$tmpc" && break |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 163 | test "$i" -gt 50 && fail "$0: cannot create temporary file $tmpc" |
| 164 | done |
| 165 | set +C |
| 166 | trap 'rm "$tmpc"' EXIT INT QUIT TERM HUP |
| 167 | |
| 168 | # |
| 169 | # Find a C compiler to use |
| 170 | # |
| 171 | printf "checking for C compiler... " |
Rich Felker | 94e920d | 2012-08-14 22:50:16 -0400 | [diff] [blame] | 172 | trycc ${CROSS_COMPILE}gcc |
| 173 | trycc ${CROSS_COMPILE}c99 |
| 174 | trycc ${CROSS_COMPILE}cc |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 175 | printf "%s\n" "$CC" |
| 176 | test -n "$CC" || { echo "$0: cannot find a C compiler" ; exit 1 ; } |
| 177 | |
| 178 | # |
| 179 | # Only build musl-gcc wrapper if toolchain does not already target musl |
| 180 | # |
| 181 | if test -z "$wrapper" ; then |
| 182 | printf "checking whether compiler is gcc... " |
Rich Felker | 01e5a1b | 2012-10-18 23:02:53 -0400 | [diff] [blame] | 183 | if fnmatch '*gcc\ version*' "$($CC -v 2>&1)" ; then |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 184 | echo yes |
| 185 | printf "checking whether to build musl-gcc wrapper... " |
| 186 | wrapper=yes |
| 187 | while read line ; do |
| 188 | case "$line" in */ld-musl-*) wrapper=no ;; esac |
| 189 | done <<EOF |
| 190 | $($CC -dumpspecs) |
| 191 | EOF |
| 192 | echo $wrapper |
| 193 | else |
| 194 | echo no |
| 195 | fi |
| 196 | fi |
| 197 | |
| 198 | |
| 199 | |
| 200 | # |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 201 | # Find the target architecture |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 202 | # |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 203 | printf "checking target system type... " |
Rich Felker | 01e5a1b | 2012-10-18 23:02:53 -0400 | [diff] [blame] | 204 | test -n "$target" || target=$($CC -dumpmachine 2>/dev/null) || target=unknown |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 205 | printf "%s\n" "$target" |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 206 | |
| 207 | # |
| 208 | # Convert to just ARCH |
| 209 | # |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 210 | case "$target" in |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 211 | arm*) ARCH=arm ;; |
| 212 | i?86*) ARCH=i386 ;; |
| 213 | x86_64*) ARCH=x86_64 ;; |
Rich Felker | 721564a | 2012-08-05 17:23:38 -0400 | [diff] [blame] | 214 | mips-*|mipsel-*) ARCH=mips ;; |
Rich Felker | 8c0a3d9 | 2012-09-29 01:05:31 -0400 | [diff] [blame] | 215 | microblaze-*) ARCH=microblaze ;; |
rofl0r | 1c8eb8b | 2012-11-09 23:36:55 +0100 | [diff] [blame] | 216 | powerpc-*) ARCH=powerpc ;; |
Rich Felker | 278883d | 2012-06-03 16:22:13 -0400 | [diff] [blame] | 217 | unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;; |
| 218 | *) fail "$0: unknown or unsupported target \"$target\"" ;; |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 219 | esac |
| 220 | |
| 221 | # |
| 222 | # Try to get a conforming C99 freestanding environment |
| 223 | # |
| 224 | tryflag CFLAGS_C99FSE -std=c99 |
| 225 | tryflag CFLAGS_C99FSE -nostdinc |
| 226 | tryflag CFLAGS_C99FSE -ffreestanding \ |
| 227 | || tryflag CFLAGS_C99FSE -fno-builtin |
| 228 | tryflag CFLAGS_C99FSE -fexcess-precision=standard \ |
Rich Felker | 2121b8a | 2012-07-03 23:53:05 -0400 | [diff] [blame] | 229 | || { test "$ARCH" = i386 && tryflag CFLAGS_C99FSE -ffloat-store ; } |
Rich Felker | b4ccc3c | 2012-05-05 17:18:31 -0400 | [diff] [blame] | 230 | tryflag CFLAGS_C99FSE -frounding-math |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 231 | |
| 232 | # |
| 233 | # Setup basic default CFLAGS: debug, optimization, and -pipe |
| 234 | # |
| 235 | if fnmatch '-O*|*\ -O*' "$CFLAGS_AUTO $CFLAGS" ; then : |
| 236 | else |
| 237 | tryflag CFLAGS_AUTO -Os || tryflag CFLAGS_AUTO -O2 |
| 238 | fi |
| 239 | test "x$debug" = xyes && CFLAGS_AUTO="-g" |
| 240 | tryflag CFLAGS_AUTO -pipe |
| 241 | |
| 242 | # |
Rich Felker | b439c05 | 2012-08-29 09:36:02 -0400 | [diff] [blame] | 243 | # If debugging is disabled, omit frame pointer. Modern GCC does this |
| 244 | # anyway on most archs even when debugging is enabled since the frame |
| 245 | # pointer is no longer needed for debugging. |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 246 | # |
| 247 | if fnmatch '-g*|*\ -g*' "$CFLAGS_AUTO $CFLAGS" ; then : |
| 248 | else |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 249 | tryflag CFLAGS_AUTO -fomit-frame-pointer |
| 250 | fi |
| 251 | |
| 252 | # |
Rich Felker | b439c05 | 2012-08-29 09:36:02 -0400 | [diff] [blame] | 253 | # Modern GCC wants to put DWARF tables (used for debugging and |
| 254 | # unwinding) in the loaded part of the program where they are |
| 255 | # unstrippable. These options force them back to debug sections (and |
| 256 | # cause them not to get generated at all if debugging is off). |
| 257 | # |
| 258 | tryflag CFLAGS_AUTO -fno-unwind-tables |
| 259 | tryflag CFLAGS_AUTO -fno-asynchronous-unwind-tables |
| 260 | |
| 261 | # |
Rich Felker | adefe83 | 2012-10-03 11:49:58 -0400 | [diff] [blame] | 262 | # The GNU toolchain defaults to assuming unmarked files need an |
| 263 | # executable stack, potentially exposing vulnerabilities in programs |
| 264 | # linked with such object files. Fix this. |
| 265 | # |
| 266 | tryflag CFLAGS_AUTO -Wa,--noexecstack |
| 267 | |
| 268 | # |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 269 | # Some optimization levels add bloated alignment that hurt performance |
| 270 | # |
| 271 | tryflag CFLAGS_AUTO -falign-functions=1 |
| 272 | tryflag CFLAGS_AUTO -falign-labels=1 |
| 273 | tryflag CFLAGS_AUTO -falign-loops=1 |
| 274 | tryflag CFLAGS_AUTO -falign-jumps=1 |
| 275 | |
| 276 | # |
| 277 | # On x86, make sure we don't have incompatible instruction set |
| 278 | # extensions enabled by default. This is bad for making static binaries. |
| 279 | # We cheat and use i486 rather than i386 because i386 really does not |
| 280 | # work anyway (issues with atomic ops). |
| 281 | # |
| 282 | if test "$ARCH" = "i386" ; then |
Rich Felker | 80a4545 | 2012-10-25 14:52:12 -0400 | [diff] [blame] | 283 | fnmatch '-march=*|*\ -march=*' "$CFLAGS" || tryldflag CFLAGS_AUTO -march=i486 |
| 284 | fnmatch '-mtune=*|*\ -mtune=*' "$CFLAGS" || tryldflag CFLAGS_AUTO -mtune=generic |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 285 | fi |
| 286 | |
Rich Felker | 2384f27 | 2012-12-11 23:28:31 -0500 | [diff] [blame] | 287 | # |
| 288 | # Even with -std=c99, gcc accepts some constructs which are constraint |
| 289 | # violations. We want to treat these as errors regardless of whether |
| 290 | # other purely stylistic warnings are enabled -- especially implicit |
| 291 | # function declarations, which are a dangerous programming error. |
| 292 | # |
| 293 | tryflag CFLAGS_AUTO -Werror=implicit-function-declaration |
| 294 | tryflag CFLAGS_AUTO -Werror=implicit-int |
| 295 | tryflag CFLAGS_AUTO -Werror=pointer-sign |
| 296 | tryflag CFLAGS_AUTO -Werror=pointer-arith |
| 297 | |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 298 | if test "x$warnings" = xyes ; then |
| 299 | tryflag CFLAGS_AUTO -Wall |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 300 | tryflag CFLAGS_AUTO -Wcast-align |
| 301 | tryflag CFLAGS_AUTO -Wno-parentheses |
| 302 | tryflag CFLAGS_AUTO -Wno-uninitialized |
| 303 | tryflag CFLAGS_AUTO -Wno-missing-braces |
| 304 | tryflag CFLAGS_AUTO -Wno-unused-value |
| 305 | tryflag CFLAGS_AUTO -Wno-unused-but-set-variable |
| 306 | tryflag CFLAGS_AUTO -Wno-unknown-pragmas |
| 307 | fi |
| 308 | |
Rich Felker | 0c5efde | 2012-06-06 22:00:08 -0400 | [diff] [blame] | 309 | # Some patched GCC builds have these defaults messed up... |
| 310 | tryflag CFLAGS_AUTO -fno-stack-protector |
Rich Felker | 2bd05a4 | 2012-08-25 17:13:28 -0400 | [diff] [blame] | 311 | tryldflag LDFLAGS_AUTO -Wl,--hash-style=both |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 312 | |
Rich Felker | 498a100 | 2012-06-07 00:32:22 -0400 | [diff] [blame] | 313 | # Disable dynamic linking if ld is broken and can't do -Bsymbolic-functions |
| 314 | LDFLAGS_DUMMY= |
| 315 | tryldflag LDFLAGS_DUMMY -Wl,-Bsymbolic-functions || { |
| 316 | printf "warning: disabling dynamic linking support\n" |
| 317 | shared=no |
| 318 | } |
| 319 | |
Rich Felker | 2c1cd23 | 2012-09-10 15:30:52 -0400 | [diff] [blame] | 320 | # Find compiler runtime library |
| 321 | test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh |
| 322 | test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt |
Rich Felker | cd31a1f | 2012-10-26 18:15:51 -0400 | [diff] [blame] | 323 | test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \ |
| 324 | && tryldflag LIBCC "$try_libcc" |
Rich Felker | 2c1cd23 | 2012-09-10 15:30:52 -0400 | [diff] [blame] | 325 | printf "using compiler runtime libraries: %s\n" "$LIBCC" |
Rich Felker | a1546e8 | 2012-07-12 14:24:10 -0400 | [diff] [blame] | 326 | |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame^] | 327 | # Figure out arch variants for archs with variants |
| 328 | SUBARCH= |
| 329 | t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS_AUTO $CFLAGS" |
| 330 | |
| 331 | if test "$ARCH" = "arm" ; then |
| 332 | trycppif __ARMEB__ "$t" && SUBARCH=${SUBARCH}eb |
| 333 | trycppif __SOFTFP__ "$t" || SUBARCH=${SUBARCH}hf |
| 334 | fi |
| 335 | |
| 336 | test "$ARCH" = "mips" && trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" \ |
| 337 | && SUBARCH=${SUBARCH}el |
| 338 | |
| 339 | test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \ |
| 340 | && SUBARCH=${SUBARCH}el |
| 341 | |
| 342 | test "$SUBARCH" \ |
| 343 | && printf "configured for %s variant: %s\n" "$ARCH" "$ARCH$SUBARCH" |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 344 | |
| 345 | printf "creating config.mak... " |
| 346 | |
| 347 | exec 3>&1 1>config.mak |
| 348 | |
| 349 | |
| 350 | cat << EOF |
| 351 | # This version of config.mak was generated by configure |
| 352 | # Any changes made here will be lost if configure is re-run |
| 353 | ARCH = $ARCH |
Rich Felker | 3e7f186 | 2013-07-18 20:30:58 -0400 | [diff] [blame^] | 354 | SUBARCH = $SUBARCH |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 355 | prefix = $prefix |
| 356 | exec_prefix = $exec_prefix |
| 357 | bindir = $bindir |
| 358 | libdir = $libdir |
| 359 | includedir = $includedir |
| 360 | syslibdir = $syslibdir |
| 361 | CC = $CC |
| 362 | CFLAGS= $CFLAGS_AUTO $CFLAGS |
| 363 | CFLAGS_C99FSE = $CFLAGS_C99FSE |
| 364 | CPPFLAGS = $CPPFLAGS |
Rich Felker | 08f70a3 | 2012-06-06 20:45:52 -0400 | [diff] [blame] | 365 | LDFLAGS = $LDFLAGS_AUTO $LDFLAGS |
Rich Felker | 94e920d | 2012-08-14 22:50:16 -0400 | [diff] [blame] | 366 | CROSS_COMPILE = $CROSS_COMPILE |
Rich Felker | 2c1cd23 | 2012-09-10 15:30:52 -0400 | [diff] [blame] | 367 | LIBCC = $LIBCC |
Rich Felker | 64d2f8e | 2012-05-04 23:24:51 -0400 | [diff] [blame] | 368 | EOF |
| 369 | test "x$static" = xno && echo "STATIC_LIBS =" |
| 370 | test "x$shared" = xno && echo "SHARED_LIBS =" |
| 371 | test "x$wrapper" = xno && echo "ALL_TOOLS =" |
| 372 | test "x$wrapper" = xno && echo "TOOL_LIBS =" |
| 373 | exec 1>&3 3>&- |
| 374 | |
| 375 | printf "done\n" |