1
0

configure 17 KB

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