configure.ac 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. # Process this file with autoreconf to produce a configure script.
  2. AC_INIT(package-unused, version-unused,, libstdc++)
  3. AC_CONFIG_SRCDIR(src/shared/hashtable-aux.cc)
  4. AC_CONFIG_HEADER(config.h)
  5. # This works around the fact that libtool configuration may change LD
  6. # for this particular configuration, but some shells, instead of
  7. # keeping the changes in LD private, export them just because LD is
  8. # exported. Only used at the end of this file.
  9. ### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD
  10. # Find the rest of the source tree framework.
  11. AM_ENABLE_MULTILIB(, ..)
  12. # Gets build, host, target, *_vendor, *_cpu, *_os, etc.
  13. #
  14. # You will slowly go insane if you do not grok the following fact: when
  15. # building v3 as part of the compiler, the top-level /target/ becomes the
  16. # library's /host/. configure then causes --target to default to --host,
  17. # exactly like any other package using autoconf. Therefore, 'target' and
  18. # 'host' will always be the same. This makes sense both for native and
  19. # cross compilers, just think about it for a little while. :-)
  20. #
  21. # Also, if v3 is being configured as part of a cross compiler, the top-level
  22. # configure script will pass the "real" host as $with_cross_host.
  23. #
  24. # Do not delete or change the following two lines. For why, see
  25. # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
  26. AC_CANONICAL_SYSTEM
  27. target_alias=${target_alias-$host_alias}
  28. # Handy for debugging:
  29. #AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
  30. if test "$build" != "$host"; then
  31. # We are being configured with some form of cross compiler.
  32. GLIBCXX_IS_NATIVE=false
  33. case "$host","$target" in
  34. # Darwin crosses can use the host system's libraries and headers,
  35. # because of the fat library support. Of course, it must be the
  36. # same version of Darwin on both sides. Allow the user to
  37. # just say --target=foo-darwin without a version number to mean
  38. # "the version on this system".
  39. *-*-darwin*,*-*-darwin*)
  40. hostos=`echo $host | sed 's/.*-darwin/darwin/'`
  41. targetos=`echo $target | sed 's/.*-darwin/darwin/'`
  42. if test $hostos = $targetos -o $targetos = darwin ; then
  43. GLIBCXX_IS_NATIVE=true
  44. fi
  45. ;;
  46. *)
  47. GCC_NO_EXECUTABLES
  48. ;;
  49. esac
  50. else
  51. GLIBCXX_IS_NATIVE=true
  52. fi
  53. # Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
  54. # following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
  55. # 1.x: minimum required version
  56. # no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch
  57. # of other PACKAGE_* variables will, however, and there's nothing
  58. # we can do about that; they come from AC_INIT).
  59. # foreign: we don't follow the normal rules for GNU packages (no COPYING
  60. # file in the top srcdir, etc, etc), so stop complaining.
  61. # no-dependencies: turns off auto dependency generation (just for now)
  62. # no-dist: we don't want 'dist' and related rules.
  63. # -Wall: turns on all automake warnings...
  64. # -Wno-portability: ...except this one, since GNU make is now required.
  65. AM_INIT_AUTOMAKE([1.9.3 no-define foreign no-dependencies no-dist -Wall -Wno-portability -Wno-override])
  66. AH_TEMPLATE(PACKAGE, [Name of package])
  67. AH_TEMPLATE(VERSION, [Version number of package])
  68. # -fno-builtin must be present here so that a non-conflicting form of
  69. # std::exit can be guessed by AC_PROG_CXX, and used in later tests.
  70. save_CXXFLAGS="$CXXFLAGS"
  71. CXXFLAGS="$CXXFLAGS -fno-builtin"
  72. AC_PROG_CC
  73. AC_PROG_CXX
  74. CXXFLAGS="$save_CXXFLAGS"
  75. AC_SYS_LARGEFILE
  76. # Runs configure.host, and assorted other critical bits. Sets
  77. # up critical shell variables.
  78. GLIBCXX_CONFIGURE
  79. # Libtool setup.
  80. if test "x${with_newlib}" != "xyes" &&
  81. test "x${with_avrlibc}" != "xyes" &&
  82. test "x$with_headers" != "xno"; then
  83. AC_LIBTOOL_DLOPEN
  84. fi
  85. AM_PROG_LIBTOOL
  86. ACX_LT_HOST_FLAGS
  87. AC_SUBST(enable_shared)
  88. AC_SUBST(enable_static)
  89. if test "$enable_vtable_verify" = yes; then
  90. predep_objects_CXX="${predep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_start.o"
  91. postdep_objects_CXX="${postdep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_end.o"
  92. fi
  93. # libtool variables for C++ shared and position-independent compiles.
  94. #
  95. # Use glibcxx_lt_pic_flag to designate the automake variable
  96. # used to encapsulate the default libtool approach to creating objects
  97. # with position-independent code. Default: -prefer-pic.
  98. #
  99. # Use glibcxx_compiler_shared_flag to designate a compile-time flags for
  100. # creating shared objects. Default: -D_GLIBCXX_SHARED.
  101. #
  102. # Use glibcxx_compiler_pic_flag to designate a compile-time flags for
  103. # creating position-independent objects. This varies with the target
  104. # hardware and operating system, but is often: -DPIC -fPIC.
  105. if test "$enable_shared" = yes; then
  106. glibcxx_lt_pic_flag="-prefer-pic"
  107. glibcxx_compiler_pic_flag="$lt_prog_compiler_pic_CXX"
  108. glibcxx_compiler_shared_flag="-D_GLIBCXX_SHARED"
  109. else
  110. glibcxx_lt_pic_flag=
  111. glibcxx_compiler_pic_flag=
  112. glibcxx_compiler_shared_flag=
  113. fi
  114. AC_SUBST(glibcxx_lt_pic_flag)
  115. AC_SUBST(glibcxx_compiler_pic_flag)
  116. AC_SUBST(glibcxx_compiler_shared_flag)
  117. # Override the libtool's pic_flag and pic_mode.
  118. # Do this step after AM_PROG_LIBTOOL, but before AC_OUTPUT.
  119. # NB: this impacts --with-pic and --without-pic.
  120. lt_prog_compiler_pic_CXX="$glibcxx_compiler_pic_flag $glibcxx_compiler_shared_flag"
  121. pic_mode='default'
  122. # Eliminate -lstdc++ addition to postdeps for cross compiles.
  123. postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'`
  124. # Possibly disable most of the library.
  125. ## TODO: Consider skipping unncessary tests altogether in this case, rather
  126. ## than just ignoring the results. Faster /and/ more correct, win win.
  127. GLIBCXX_ENABLE_HOSTED
  128. # Enable descriptive messages to standard output on termination.
  129. GLIBCXX_ENABLE_VERBOSE
  130. # Enable compiler support that doesn't require linking.
  131. GLIBCXX_ENABLE_PCH($is_hosted)
  132. GLIBCXX_ENABLE_THREADS
  133. GLIBCXX_ENABLE_ATOMIC_BUILTINS
  134. GLIBCXX_ENABLE_LOCK_POLICY
  135. GLIBCXX_ENABLE_DECIMAL_FLOAT
  136. GLIBCXX_ENABLE_FLOAT128
  137. if test "$enable_float128" = yes; then
  138. port_specific_symbol_files="$port_specific_symbol_files \$(top_srcdir)/config/abi/pre/float128.ver"
  139. fi
  140. # Checks for compiler support that doesn't require linking.
  141. GLIBCXX_CHECK_COMPILER_FEATURES
  142. # Enable all the variable C++ runtime options that don't require linking.
  143. GLIBCXX_ENABLE_CSTDIO
  144. GLIBCXX_ENABLE_CLOCALE
  145. GLIBCXX_ENABLE_ALLOCATOR
  146. GLIBCXX_ENABLE_CHEADERS($c_model) dnl c_model from configure.host
  147. GLIBCXX_ENABLE_LONG_LONG([yes])
  148. GLIBCXX_ENABLE_WCHAR_T([yes])
  149. GLIBCXX_ENABLE_C99([yes])
  150. GLIBCXX_ENABLE_CONCEPT_CHECKS([no])
  151. GLIBCXX_ENABLE_DEBUG_FLAGS(["-g3 -O0 -D_GLIBCXX_ASSERTIONS"])
  152. GLIBCXX_ENABLE_DEBUG([no])
  153. GLIBCXX_ENABLE_PARALLEL([yes])
  154. GLIBCXX_ENABLE_CXX_FLAGS
  155. GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING([no])
  156. GLIBCXX_ENABLE_EXTERN_TEMPLATE([yes])
  157. GLIBCXX_ENABLE_PYTHON
  158. GLIBCXX_ENABLE_WERROR([no])
  159. GLIBCXX_ENABLE_VTABLE_VERIFY([no])
  160. # Checks for operating systems support that doesn't require linking.
  161. GLIBCXX_CHECK_STDIO_PROTO
  162. GLIBCXX_CHECK_MATH11_PROTO
  163. GLIBCXX_CHECK_UCHAR_H
  164. # For LFS support.
  165. GLIBCXX_CHECK_LFS
  166. # For showmanyc_helper().
  167. AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
  168. GLIBCXX_CHECK_POLL
  169. GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
  170. # For xsputn_2().
  171. AC_CHECK_HEADERS(sys/uio.h)
  172. GLIBCXX_CHECK_WRITEV
  173. # Check for fenv.h and complex.h before GLIBCXX_CHECK_C99_TR1
  174. # so that the check is done with the C compiler (not C++).
  175. # Checking with C++ can break a canadian cross build if either
  176. # file does not exist in C but does in C++.
  177. AC_CHECK_HEADERS(fenv.h complex.h)
  178. # For C99 support to TR1.
  179. GLIBCXX_CHECK_C99_TR1
  180. # For the EOF, SEEK_CUR, and SEEK_END integer constants.
  181. GLIBCXX_COMPUTE_STDIO_INTEGER_CONSTANTS
  182. # For gettimeofday support.
  183. GLIBCXX_CHECK_GETTIMEOFDAY
  184. # For clock_gettime, nanosleep and sched_yield support.
  185. GLIBCXX_ENABLE_LIBSTDCXX_TIME
  186. # Check for tmpnam which is obsolescent in POSIX.1-2008
  187. GLIBCXX_CHECK_TMPNAM
  188. # For pthread_cond_clockwait
  189. GLIBCXX_CHECK_PTHREAD_COND_CLOCKWAIT
  190. # For pthread_mutex_clocklock
  191. GLIBCXX_CHECK_PTHREAD_MUTEX_CLOCKLOCK
  192. # For pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock
  193. GLIBCXX_CHECK_PTHREAD_RWLOCK_CLOCKLOCK
  194. AC_LC_MESSAGES
  195. # For hardware_concurrency
  196. AC_CHECK_HEADERS(sys/sysinfo.h)
  197. GLIBCXX_CHECK_GET_NPROCS
  198. AC_CHECK_HEADERS(unistd.h)
  199. GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
  200. GLIBCXX_CHECK_SC_NPROC_ONLN
  201. GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
  202. GLIBCXX_CHECK_SYSCTL_HW_NCPU
  203. GLIBCXX_CHECK_SDT_H
  204. # Check for available headers.
  205. AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
  206. locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
  207. strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \
  208. sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
  209. wchar.h wctype.h linux/types.h])
  210. AC_CHECK_HEADERS([linux/random.h], [], [],
  211. [[#ifdef HAVE_LINUX_TYPES_H
  212. # include <linux/types.h>
  213. #endif
  214. ]])
  215. AC_CHECK_HEADERS([xlocale.h])
  216. # Only do link tests if native. Else, hardcode.
  217. if $GLIBCXX_IS_NATIVE; then
  218. # We can do more elaborate tests that assume a working linker.
  219. CANADIAN=no
  220. GLIBCXX_CHECK_LINKER_FEATURES
  221. GLIBCXX_CHECK_MATH_SUPPORT
  222. GLIBCXX_CHECK_STDLIB_SUPPORT
  223. # For /dev/random and /dev/urandom for std::random_device.
  224. GLIBCXX_CHECK_DEV_RANDOM
  225. # For TLS support.
  226. GCC_CHECK_TLS
  227. AC_CHECK_FUNCS(__cxa_thread_atexit_impl __cxa_thread_atexit)
  228. AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc)
  229. AC_CHECK_FUNCS(_wfopen)
  230. AC_CHECK_FUNCS(secure_getenv)
  231. # C11 functions for C++17 library
  232. AC_CHECK_FUNCS(timespec_get)
  233. # For Networking TS.
  234. AC_CHECK_FUNCS(sockatmark)
  235. # Non-standard functions used by C++17 std::from_chars
  236. AC_CHECK_FUNCS(uselocale)
  237. # For iconv support.
  238. AM_ICONV
  239. else
  240. # This lets us hard-code the functionality we know we'll have in the cross
  241. # target environment. "Let" is a sugar-coated word placed on an especially
  242. # dull and tedious hack, actually.
  243. #
  244. # Here's why GLIBCXX_CHECK_MATH_SUPPORT, and other autoconf macros
  245. # that involve linking, can't be used:
  246. # "cannot open sim-crt0.o"
  247. # "cannot open crt0.o"
  248. # etc. All this is because there currently exists no unified, consistent
  249. # way for top level CC information to be passed down to target directories:
  250. # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
  251. # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
  252. # crosses can be removed.
  253. # If Canadian cross, then don't pick up tools from the build directory.
  254. # Used only in GLIBCXX_EXPORT_INCLUDES.
  255. if test -n "$with_cross_host" &&
  256. test x"$build_alias" != x"$with_cross_host" &&
  257. test x"$build" != x"$target";
  258. then
  259. CANADIAN=yes
  260. else
  261. CANADIAN=no
  262. fi
  263. # Construct crosses by hand, eliminating bits that need ld...
  264. # GLIBCXX_CHECK_MATH_SUPPORT
  265. # First, test for "known" system libraries. We may be using newlib even
  266. # on a hosted environment.
  267. if test "x${with_newlib}" = "xyes"; then
  268. os_include_dir="os/newlib"
  269. AC_DEFINE(HAVE_HYPOT)
  270. # GLIBCXX_CHECK_STDLIB_SUPPORT
  271. AC_DEFINE(HAVE_STRTOF)
  272. AC_DEFINE(HAVE_ACOSF)
  273. AC_DEFINE(HAVE_ASINF)
  274. AC_DEFINE(HAVE_ATAN2F)
  275. AC_DEFINE(HAVE_ATANF)
  276. AC_DEFINE(HAVE_CEILF)
  277. AC_DEFINE(HAVE_COSF)
  278. AC_DEFINE(HAVE_COSHF)
  279. AC_DEFINE(HAVE_EXPF)
  280. AC_DEFINE(HAVE_FABSF)
  281. AC_DEFINE(HAVE_FLOORF)
  282. AC_DEFINE(HAVE_FMODF)
  283. AC_DEFINE(HAVE_FREXPF)
  284. AC_DEFINE(HAVE_LDEXPF)
  285. AC_DEFINE(HAVE_LOG10F)
  286. AC_DEFINE(HAVE_LOGF)
  287. AC_DEFINE(HAVE_MODFF)
  288. AC_DEFINE(HAVE_POWF)
  289. AC_DEFINE(HAVE_SINF)
  290. AC_DEFINE(HAVE_SINHF)
  291. AC_DEFINE(HAVE_SQRTF)
  292. AC_DEFINE(HAVE_TANF)
  293. AC_DEFINE(HAVE_TANHF)
  294. AC_DEFINE(HAVE_ICONV)
  295. AC_DEFINE(HAVE_MEMALIGN)
  296. elif test "x$with_headers" != "xno"; then
  297. GLIBCXX_CROSSCONFIG
  298. fi
  299. # At some point, we should differentiate between architectures
  300. # like x86, which have long double versions, and alpha/powerpc/etc.,
  301. # which don't. For the time being, punt.
  302. if test x"long_double_math_on_this_cpu" = x"yes"; then
  303. AC_DEFINE(HAVE_ACOSL)
  304. AC_DEFINE(HAVE_ASINL)
  305. AC_DEFINE(HAVE_ATAN2L)
  306. AC_DEFINE(HAVE_ATANL)
  307. AC_DEFINE(HAVE_CEILL)
  308. AC_DEFINE(HAVE_COSL)
  309. AC_DEFINE(HAVE_COSHL)
  310. AC_DEFINE(HAVE_EXPL)
  311. AC_DEFINE(HAVE_FABSL)
  312. AC_DEFINE(HAVE_FLOORL)
  313. AC_DEFINE(HAVE_FMODL)
  314. AC_DEFINE(HAVE_FREXPL)
  315. AC_DEFINE(HAVE_LDEXPL)
  316. AC_DEFINE(HAVE_LOG10L)
  317. AC_DEFINE(HAVE_LOGL)
  318. AC_DEFINE(HAVE_MODFL)
  319. AC_DEFINE(HAVE_POWL)
  320. AC_DEFINE(HAVE_SINCOSL)
  321. AC_DEFINE(HAVE_SINL)
  322. AC_DEFINE(HAVE_SINHL)
  323. AC_DEFINE(HAVE_SQRTL)
  324. AC_DEFINE(HAVE_TANL)
  325. AC_DEFINE(HAVE_TANHL)
  326. fi
  327. fi
  328. # Check for _Unwind_GetIPInfo.
  329. GCC_CHECK_UNWIND_GETIPINFO
  330. GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])])
  331. if test "$is_hosted" = yes; then
  332. # TODO: remove this and change src/c++11/compatibility-atomic-c++0x.cc to
  333. # use <stdint.h> instead of <gstdint.h>.
  334. GCC_HEADER_STDINT(include/gstdint.h)
  335. fi
  336. GLIBCXX_ENABLE_SYMVERS([yes])
  337. AC_SUBST(libtool_VERSION)
  338. GLIBCXX_ENABLE_LIBSTDCXX_VISIBILITY([yes])
  339. GLIBCXX_ENABLE_LIBSTDCXX_DUAL_ABI([yes])
  340. GLIBCXX_DEFAULT_ABI
  341. ac_ldbl_compat=no
  342. ac_ldbl_alt128_compat=no
  343. ac_ldbl_ieee128_default=no
  344. LONG_DOUBLE_COMPAT_FLAGS="-mlong-double-64"
  345. LONG_DOUBLE_128_FLAGS=
  346. LONG_DOUBLE_ALT128_COMPAT_FLAGS=
  347. case "$target" in
  348. powerpc*-*-linux* | \
  349. sparc*-*-linux* | \
  350. s390*-*-linux* | \
  351. alpha*-*-linux*)
  352. AC_TRY_COMPILE(, [
  353. #if !defined __LONG_DOUBLE_128__ || (defined(__sparc__) && defined(__arch64__))
  354. #error no need for long double compatibility
  355. #endif
  356. ], [ac_ldbl_compat=yes], [ac_ldbl_compat=no])
  357. if test "$ac_ldbl_compat" = yes; then
  358. AC_DEFINE([_GLIBCXX_LONG_DOUBLE_COMPAT],1,
  359. [Define if compatibility should be provided for -mlong-double-64.])
  360. port_specific_symbol_files="\$(top_srcdir)/config/os/gnu-linux/ldbl-extra.ver"
  361. case "$target" in
  362. powerpc*-*-linux*)
  363. LONG_DOUBLE_COMPAT_FLAGS="$LONG_DOUBLE_COMPAT_FLAGS -mno-gnu-attribute"
  364. # Check for IEEE128 support in libm:
  365. AC_CHECK_LIB(m, __frexpieee128,
  366. [ac_ldbl_ieee128_in_libc=yes],
  367. [ac_ldbl_ieee128_in_libc=no])
  368. if test $ac_ldbl_ieee128_in_libc = yes; then
  369. # Determine which long double format is the compiler's default:
  370. AC_TRY_COMPILE(, [
  371. #ifndef __LONG_DOUBLE_IEEE128__
  372. #error compiler defaults to ibm128
  373. #endif
  374. ], [ac_ldbl_ieee128_default=yes], [ac_ldbl_ieee128_default=no])
  375. # Library objects should use default long double format.
  376. if test "$ac_ldbl_ieee128_default" = yes; then
  377. LONG_DOUBLE_128_FLAGS="-mno-gnu-attribute"
  378. # Except for the ones that explicitly use these flags:
  379. LONG_DOUBLE_ALT128_COMPAT_FLAGS="-mabi=ibmlongdouble -mno-gnu-attribute -Wno-psabi"
  380. else
  381. LONG_DOUBLE_128_FLAGS="-mno-gnu-attribute"
  382. LONG_DOUBLE_ALT128_COMPAT_FLAGS="-mabi=ieeelongdouble -mno-gnu-attribute -Wno-psabi"
  383. fi
  384. AC_DEFINE([_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT],1,
  385. [Define if compatibility should be provided for alternative 128-bit long double formats.])
  386. port_specific_symbol_files="$port_specific_symbol_files \$(top_srcdir)/config/os/gnu-linux/ldbl-ieee128-extra.ver"
  387. ac_ldbl_alt128_compat=yes
  388. else
  389. ac_ldbl_alt128_compat=no
  390. fi
  391. ;;
  392. esac
  393. fi
  394. esac
  395. AC_SUBST(LONG_DOUBLE_COMPAT_FLAGS)
  396. AC_SUBST(LONG_DOUBLE_128_FLAGS)
  397. AC_SUBST(LONG_DOUBLE_ALT128_COMPAT_FLAGS)
  398. GLIBCXX_CONDITIONAL(GLIBCXX_LDBL_COMPAT, test $ac_ldbl_compat = yes)
  399. GLIBCXX_CONDITIONAL(GLIBCXX_LDBL_ALT128_COMPAT, test $ac_ldbl_alt128_compat = yes)
  400. # Check if assembler supports disabling hardware capability support.
  401. GCC_CHECK_ASSEMBLER_HWCAP
  402. # Check if assembler supports rdrand opcode.
  403. GLIBCXX_CHECK_X86_RDRAND
  404. # Check if assembler supports rdseed opcode.
  405. GLIBCXX_CHECK_X86_RDSEED
  406. # Check for other random number APIs
  407. GLIBCXX_CHECK_GETENTROPY
  408. GLIBCXX_CHECK_ARC4RANDOM
  409. # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE.
  410. GLIBCXX_CONFIGURE_TESTSUITE
  411. # For gthread support. Depends on GLIBCXX_ENABLE_SYMVERS.
  412. GLIBCXX_CHECK_GTHREADS
  413. # For Filesystem TS.
  414. AC_CHECK_HEADERS([fcntl.h dirent.h sys/statvfs.h utime.h])
  415. GLIBCXX_ENABLE_FILESYSTEM_TS
  416. GLIBCXX_CHECK_FILESYSTEM_DEPS
  417. GLIBCXX_ENABLE_BACKTRACE
  418. # For Networking TS.
  419. AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/socket.h sys/uio.h poll.h netdb.h arpa/inet.h netinet/in.h netinet/tcp.h])
  420. AC_CHECK_DECL(F_GETFL,,,[#include <fcntl.h>])
  421. AC_CHECK_DECL(F_SETFL,,,[#include <fcntl.h>])
  422. if test "$ac_cv_have_decl_F_GETFL$ac_cv_have_decl_F_SETFL" = yesyes ; then
  423. AC_CHECK_DECL(O_NONBLOCK,,,[#include <fcntl.h>])
  424. fi
  425. # For Transactional Memory TS
  426. GLIBCXX_CHECK_SIZE_T_MANGLING
  427. # Check which release added std::exception_ptr for the target
  428. GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER
  429. # Define documentation rules conditionally.
  430. # See if makeinfo has been installed and is modern enough
  431. # that we can use it.
  432. ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version],
  433. [GNU texinfo.* \([0-9][0-9.]*\)],
  434. [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
  435. AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes")
  436. # Check for doxygen
  437. AC_CHECK_PROG([DOXYGEN], doxygen, yes, no)
  438. AC_CHECK_PROG([DOT], dot, yes, no)
  439. # Check for docbook
  440. AC_CHECK_PROG([XMLCATALOG], xmlcatalog, yes, no)
  441. AC_CHECK_PROG([XSLTPROC], xsltproc, yes, no)
  442. AC_CHECK_PROG([XMLLINT], xmllint, yes, no)
  443. GLIBCXX_CONFIGURE_DOCBOOK
  444. # Check for xml/html dependencies.
  445. AM_CONDITIONAL(BUILD_XML,
  446. test $ac_cv_prog_DOXYGEN = "yes" &&
  447. test $ac_cv_prog_DOT = "yes" &&
  448. test $ac_cv_prog_XSLTPROC = "yes" &&
  449. test $ac_cv_prog_XMLLINT = "yes" &&
  450. test $glibcxx_stylesheets = "yes")
  451. AM_CONDITIONAL(BUILD_HTML,
  452. test $ac_cv_prog_DOXYGEN = "yes" &&
  453. test $ac_cv_prog_DOT = "yes" &&
  454. test $ac_cv_prog_XSLTPROC = "yes" &&
  455. test $ac_cv_prog_XMLLINT = "yes" &&
  456. test $glibcxx_stylesheets = "yes")
  457. # Check for man dependencies.
  458. AM_CONDITIONAL(BUILD_MAN,
  459. test $ac_cv_prog_DOXYGEN = "yes" &&
  460. test $ac_cv_prog_DOT = "yes")
  461. # Check for pdf dependencies.
  462. AC_CHECK_PROG([DBLATEX], dblatex, yes, no)
  463. AC_CHECK_PROG([PDFLATEX], pdflatex, yes, no)
  464. AM_CONDITIONAL(BUILD_PDF,
  465. test $ac_cv_prog_DOXYGEN = "yes" &&
  466. test $ac_cv_prog_DOT = "yes" &&
  467. test $ac_cv_prog_XSLTPROC = "yes" &&
  468. test $ac_cv_prog_XMLLINT = "yes" &&
  469. test $ac_cv_prog_DBLATEX = "yes" &&
  470. test $ac_cv_prog_PDFLATEX = "yes")
  471. case "$build" in
  472. *-*-darwin* ) glibcxx_include_dir_notparallel=yes ;;
  473. * ) glibcxx_include_dir_notparallel=no ;;
  474. esac
  475. AM_CONDITIONAL(INCLUDE_DIR_NOTPARALLEL,
  476. test $glibcxx_include_dir_notparallel = "yes")
  477. # Propagate the target-specific source directories through the build chain.
  478. ATOMICITY_SRCDIR=config/${atomicity_dir}
  479. ATOMIC_WORD_SRCDIR=config/${atomic_word_dir}
  480. ATOMIC_FLAGS=${atomic_flags}
  481. CPU_DEFINES_SRCDIR=config/${cpu_defines_dir}
  482. OS_INC_SRCDIR=config/${os_include_dir}
  483. ERROR_CONSTANTS_SRCDIR=config/${error_constants_dir}
  484. ABI_TWEAKS_SRCDIR=config/${abi_tweaks_dir}
  485. CPU_OPT_EXT_RANDOM=config/${cpu_opt_ext_random}
  486. CPU_OPT_BITS_RANDOM=config/${cpu_opt_bits_random}
  487. AC_SUBST(ATOMICITY_SRCDIR)
  488. AC_SUBST(ATOMIC_WORD_SRCDIR)
  489. AC_SUBST(ATOMIC_FLAGS)
  490. AC_SUBST(CPU_DEFINES_SRCDIR)
  491. AC_SUBST(ABI_TWEAKS_SRCDIR)
  492. AC_SUBST(OS_INC_SRCDIR)
  493. AC_SUBST(ERROR_CONSTANTS_SRCDIR)
  494. AC_SUBST(CPU_OPT_EXT_RANDOM)
  495. AC_SUBST(CPU_OPT_BITS_RANDOM)
  496. # Conditionalize the makefile for this target machine.
  497. tmake_file_=
  498. for f in ${tmake_file}
  499. do
  500. if test -f ${srcdir}/config/$f
  501. then
  502. tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
  503. fi
  504. done
  505. tmake_file="${tmake_file_}"
  506. AC_SUBST(tmake_file)
  507. # Add CET specific flags if Intel CET is enabled.
  508. GCC_CET_FLAGS(CET_FLAGS)
  509. EXTRA_CXX_FLAGS="$EXTRA_CXX_FLAGS $CET_FLAGS"
  510. EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS"
  511. AC_SUBST(EXTRA_CFLAGS)
  512. AC_SUBST(EXTRA_CXX_FLAGS)
  513. # Determine cross-compile flags and AM_CONDITIONALs.
  514. #AC_SUBST(GLIBCXX_IS_NATIVE)
  515. #AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
  516. GLIBCXX_EVALUATE_CONDITIONALS
  517. AC_CACHE_SAVE
  518. if test ${multilib} = yes; then
  519. multilib_arg="--enable-multilib"
  520. else
  521. multilib_arg=
  522. fi
  523. # Export all the install information.
  524. GLIBCXX_EXPORT_INSTALL_INFO
  525. # Export all the include and flag information to Makefiles.
  526. GLIBCXX_EXPORT_INCLUDES
  527. GLIBCXX_EXPORT_FLAGS
  528. # Determine what GCC version number to use in filesystem paths.
  529. GCC_BASE_VER
  530. dnl In autoconf 2.5x, AC_OUTPUT is replaced by four AC_CONFIG_* macros,
  531. dnl which can all be called multiple times as needed, plus one (different)
  532. dnl AC_OUTPUT macro. This one lists the files to be created:
  533. AC_CONFIG_FILES(Makefile)
  534. AC_CONFIG_FILES([scripts/testsuite_flags],[chmod +x scripts/testsuite_flags])
  535. AC_CONFIG_FILES([scripts/extract_symvers],[chmod +x scripts/extract_symvers])
  536. AC_CONFIG_FILES([doc/xsl/customization.xsl])
  537. AC_CONFIG_FILES([src/libbacktrace/backtrace-supported.h])
  538. # Multilibs need MULTISUBDIR defined correctly in certain makefiles so
  539. # that multilib installs will end up installed in the correct place.
  540. # The testsuite needs it for multilib-aware ABI baseline files.
  541. # To work around this not being passed down from config-ml.in ->
  542. # srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually
  543. # append it here. Only modify Makefiles that have just been created.
  544. #
  545. # Also, get rid of this simulated-VPATH thing that automake does.
  546. AC_CONFIG_FILES(AC_FOREACH([DIR], glibcxx_SUBDIRS, [DIR/Makefile ]),
  547. [cat > vpsed$$ << \_EOF
  548. s!`test -f '$<' || echo '$(srcdir)/'`!!
  549. _EOF
  550. sed -f vpsed$$ $ac_file > tmp$$
  551. mv tmp$$ $ac_file
  552. rm vpsed$$
  553. echo 'MULTISUBDIR =' >> $ac_file
  554. ml_norecursion=yes
  555. . ${multi_basedir}/config-ml.in
  556. AS_UNSET([ml_norecursion])
  557. ])
  558. AC_CONFIG_COMMANDS([generate-headers],
  559. [(cd include && ${MAKE-make} pch_build= )])
  560. dnl And this actually makes things happen:
  561. AC_OUTPUT