Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 1 | # Process this file with autoconf to produce a configure script, like so: |
| 2 | # aclocal && autoconf && autoheader && automake |
| 3 | |
| 4 | AC_PREREQ(2.64) |
| 5 | AC_INIT([GCC Quad-precision Math Library], 0.1,,[libquadmath]) |
| 6 | AC_CONFIG_HEADER(config.h) |
| 7 | |
| 8 | # Gets build, host, target, *_vendor, *_cpu, *_os, etc. |
| 9 | # |
| 10 | # You will slowly go insane if you do not grok the following fact: when |
| 11 | # building this library, the top-level /target/ becomes the library's /host/. |
| 12 | # |
| 13 | # configure then causes --target to default to --host, exactly like any |
| 14 | # other package using autoconf. Therefore, 'target' and 'host' will |
| 15 | # always be the same. This makes sense both for native and cross compilers |
| 16 | # just think about it for a little while. :-) |
| 17 | # |
| 18 | # Also, if this library is being configured as part of a cross compiler, the |
| 19 | # top-level configure script will pass the "real" host as $with_cross_host. |
| 20 | # |
| 21 | # Do not delete or change the following two lines. For why, see |
| 22 | # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html |
| 23 | AC_CANONICAL_SYSTEM |
Kai Tietz | fabfcf5 | 2010-11-29 17:52:24 +0000 | [diff] [blame] | 24 | ACX_NONCANONICAL_TARGET |
| 25 | |
Matthias Klose | ee5f052 | 2015-01-26 14:57:41 +0000 | [diff] [blame] | 26 | AM_ENABLE_MULTILIB(, ..) |
| 27 | |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 28 | target_alias=${target_alias-$host_alias} |
Kai Tietz | fabfcf5 | 2010-11-29 17:52:24 +0000 | [diff] [blame] | 29 | AC_SUBST(target_alias) |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 30 | |
Ralf Wildenhues | a6098a2 | 2011-01-06 22:09:41 +0000 | [diff] [blame] | 31 | AM_INIT_AUTOMAKE([1.9.0 foreign subdir-objects no-dist -Wall -Wno-override -Werror]) |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 32 | |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 33 | AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) |
| 34 | AC_ARG_ENABLE(version-specific-runtime-libs, |
Tobias Burnus | 4c993c4 | 2010-12-08 09:06:49 +0100 | [diff] [blame] | 35 | AS_HELP_STRING([--enable-version-specific-runtime-libs], |
| 36 | [specify that runtime libraries should be installed in a compiler-specific directory]), |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 37 | [case "$enableval" in |
| 38 | yes) version_specific_libs=yes ;; |
| 39 | no) version_specific_libs=no ;; |
| 40 | *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; |
| 41 | esac], |
| 42 | [version_specific_libs=no]) |
| 43 | AC_MSG_RESULT($version_specific_libs) |
| 44 | |
Kai Tietz | fabfcf5 | 2010-11-29 17:52:24 +0000 | [diff] [blame] | 45 | GCC_NO_EXECUTABLES |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 46 | |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 47 | AC_USE_SYSTEM_EXTENSIONS |
| 48 | |
Tobias Burnus | 4c993c4 | 2010-12-08 09:06:49 +0100 | [diff] [blame] | 49 | # See if makeinfo has been installed and is modern enough |
| 50 | # that we can use it. |
| 51 | ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version], |
| 52 | [GNU texinfo.* \([0-9][0-9.]*\)], |
| 53 | [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*]) |
| 54 | AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes") |
| 55 | |
Gerald Pfeifer | 19e3011 | 2017-02-09 10:56:08 +0000 | [diff] [blame] | 56 | ACX_BUGURL([https://gcc.gnu.org/bugs/]) |
Tobias Burnus | 4c993c4 | 2010-12-08 09:06:49 +0100 | [diff] [blame] | 57 | |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 58 | # Configure libtool |
| 59 | AM_PROG_LIBTOOL |
Dave Korn | 7de6ba7 | 2010-12-06 00:50:04 +0000 | [diff] [blame] | 60 | ACX_LT_HOST_FLAGS |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 61 | AC_SUBST(enable_shared) |
| 62 | AC_SUBST(enable_static) |
| 63 | |
| 64 | AM_MAINTAINER_MODE |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 65 | |
Kai Tietz | fabfcf5 | 2010-11-29 17:52:24 +0000 | [diff] [blame] | 66 | AC_LANG_C |
| 67 | # The same as in boehm-gc and libstdc++. Have to borrow it from there. |
| 68 | # We must force CC to /not/ be precious variables; otherwise |
| 69 | # the wrong, non-multilib-adjusted value will be used in multilibs. |
| 70 | # As a side effect, we have to subst CFLAGS ourselves. |
| 71 | |
| 72 | m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS]) |
| 73 | m4_define([_AC_ARG_VAR_PRECIOUS],[]) |
| 74 | AC_PROG_CC |
| 75 | m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) |
| 76 | |
| 77 | AC_SUBST(CFLAGS) |
| 78 | |
| 79 | AM_PROG_CC_C_O |
| 80 | |
| 81 | if test "x$GCC" != "xyes"; then |
| 82 | AC_MSG_ERROR([libquadmath must be built with GCC]) |
| 83 | fi |
| 84 | AC_PROG_CPP |
| 85 | |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 86 | # Calculate toolexeclibdir |
| 87 | # Also toolexecdir, though it's only used in toolexeclibdir |
| 88 | case ${version_specific_libs} in |
| 89 | yes) |
| 90 | # Need the gcc compiler version to know where to install libraries |
| 91 | # and header files if --enable-version-specific-runtime-libs option |
| 92 | # is selected. |
| 93 | toolexecdir='$(libdir)/gcc/$(target_alias)' |
| 94 | toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' |
| 95 | ;; |
| 96 | no) |
| 97 | if test -n "$with_cross_host" && |
| 98 | test x"$with_cross_host" != x"no"; then |
| 99 | # Install a library built with a cross compiler in tooldir, not libdir. |
| 100 | toolexecdir='$(exec_prefix)/$(target_alias)' |
| 101 | toolexeclibdir='$(toolexecdir)/lib' |
| 102 | else |
| 103 | toolexecdir='$(libdir)/gcc-lib/$(target_alias)' |
| 104 | toolexeclibdir='$(libdir)' |
| 105 | fi |
| 106 | multi_os_directory=`$CC -print-multi-os-directory` |
| 107 | case $multi_os_directory in |
| 108 | .) ;; # Avoid trailing /. |
| 109 | *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; |
| 110 | esac |
| 111 | ;; |
| 112 | esac |
| 113 | AC_SUBST(toolexecdir) |
| 114 | AC_SUBST(toolexeclibdir) |
| 115 | |
Jakub Jelinek | d2995f2 | 2011-02-16 14:54:30 +0100 | [diff] [blame] | 116 | AC_CHECK_HEADERS(fenv.h langinfo.h locale.h wchar.h wctype.h limits.h ctype.h printf.h errno.h) |
Tobias Burnus | 5a09d90 | 2012-11-21 14:46:34 +0100 | [diff] [blame] | 117 | LIBQUAD_CHECK_MATH_H_SIGNGAM |
Jakub Jelinek | e8d42d2 | 2011-01-16 17:40:05 +0100 | [diff] [blame] | 118 | |
Tobias Burnus | 6f46898 | 2010-12-19 20:01:38 +0100 | [diff] [blame] | 119 | # If available, sqrtl and cbrtl speed up the calculation - |
| 120 | # but they are not required |
| 121 | if test x$gcc_no_link != xyes; then |
| 122 | AC_CHECK_LIB([m],[sqrtl],[AC_DEFINE([HAVE_SQRTL],[1],[libm includes sqrtl])]) |
| 123 | AC_CHECK_LIB([m],[cbrtl],[AC_DEFINE([HAVE_CBRTL],[1],[libm includes cbrtl])]) |
Jakub Jelinek | e8d42d2 | 2011-01-16 17:40:05 +0100 | [diff] [blame] | 124 | AC_CHECK_LIB([m],[feholdexcept],[AC_DEFINE([HAVE_FEHOLDEXCEPT],[1],[libm includes feholdexcept])]) |
| 125 | AC_CHECK_LIB([m],[fesetround],[AC_DEFINE([HAVE_FESETROUND],[1],[libm includes fesetround])]) |
| 126 | AC_CHECK_LIB([m],[feupdateenv],[AC_DEFINE([HAVE_FEUPDATEENV],[1],[libm includes feupdateenv])]) |
| 127 | AC_CHECK_LIB([m],[fesetenv],[AC_DEFINE([HAVE_FESETENV],[1],[libm includes fesetenv])]) |
| 128 | AC_CHECK_LIB([m],[fetestexcept],[AC_DEFINE([HAVE_FETESTEXCEPT],[1],[libm includes fetestexcept])]) |
Jakub Jelinek | a855deb | 2011-02-17 20:57:18 +0100 | [diff] [blame] | 129 | AC_CHECK_FUNCS(strtoull) |
Tobias Burnus | 6f46898 | 2010-12-19 20:01:38 +0100 | [diff] [blame] | 130 | else |
| 131 | if test "x$ac_cv_lib_m_sqrtl" = x""yes; then |
| 132 | AC_DEFINE([HAVE_SQRTL],[1],[libm includes sqrtl]) |
| 133 | fi |
| 134 | if test "x$ac_cv_lib_m_cbrtl" = x""yes; then |
| 135 | AC_DEFINE([HAVE_CBRTL],[1],[libm includes cbrtl]) |
| 136 | fi |
Jakub Jelinek | e8d42d2 | 2011-01-16 17:40:05 +0100 | [diff] [blame] | 137 | if test "x$ac_cv_lib_m_feholdexcept" = x""yes; then |
| 138 | AC_DEFINE([HAVE_FEHOLDEXCEPT],[1],[libm includes feholdexcept]) |
| 139 | fi |
| 140 | if test "x$ac_cv_lib_m_fesetround" = x""yes; then |
| 141 | AC_DEFINE([HAVE_FESETROUND],[1],[libm includes fesetround]) |
| 142 | fi |
| 143 | if test "x$ac_cv_lib_m_feupdateenv" = x""yes; then |
| 144 | AC_DEFINE([HAVE_FEUPDATEENV],[1],[libm includes feupdateenv]) |
| 145 | fi |
| 146 | if test "x$ac_cv_lib_m_fesetenv" = x""yes; then |
| 147 | AC_DEFINE([HAVE_FESETENV],[1],[libm includes fesetenv]) |
| 148 | fi |
| 149 | if test "x$ac_cv_lib_m_fetestexcept" = x""yes; then |
| 150 | AC_DEFINE([HAVE_FETESTEXCEPT],[1],[libm includes fetestexcept]) |
| 151 | fi |
Tobias Burnus | 6f46898 | 2010-12-19 20:01:38 +0100 | [diff] [blame] | 152 | fi |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 153 | |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 154 | # Check for hidden visibility (copied from libssp). |
Jakub Jelinek | 49f0e1b | 2011-02-14 17:40:38 +0100 | [diff] [blame] | 155 | saved_CFLAGS="$CFLAGS" |
| 156 | CFLAGS="$CFLAGS -Werror" |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 157 | AC_MSG_CHECKING([whether hidden visibility is supported]) |
| 158 | AC_TRY_COMPILE([ |
| 159 | void __attribute__((visibility ("hidden"))) bar (void) {}],, |
| 160 | [quadmath_hidden=yes],[quadmath_hidden=no]) |
| 161 | AC_MSG_RESULT($quadmath_hidden) |
| 162 | if test x$quadmath_hidden = xyes; then |
| 163 | AC_DEFINE([HAVE_HIDDEN_VISIBILITY],[1],[__attribute__((visibility ("hidden"))) supported]) |
| 164 | fi |
Jakub Jelinek | 49f0e1b | 2011-02-14 17:40:38 +0100 | [diff] [blame] | 165 | CFLAGS="$saved_CFLAGS" |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 166 | |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 167 | # Check for symbol versioning (copied from libssp). |
| 168 | AC_MSG_CHECKING([whether symbol versioning is supported]) |
Rainer Orth | bf382f5 | 2011-03-21 12:24:17 +0000 | [diff] [blame] | 169 | AC_ARG_ENABLE(symvers, |
| 170 | AS_HELP_STRING([--disable-symvers], |
| 171 | [disable symbol versioning for libquadmath]), |
| 172 | quadmath_use_symver=$enableval, |
| 173 | quadmath_use_symver=yes) |
Benjamin Kosnik | 19af62d | 2012-05-31 18:51:27 +0000 | [diff] [blame] | 174 | if test "x$quadmath_use_symver" != xno; then |
Rainer Orth | bf382f5 | 2011-03-21 12:24:17 +0000 | [diff] [blame] | 175 | if test x$gcc_no_link = xyes; then |
| 176 | # If we cannot link, we cannot build shared libraries, so do not use |
| 177 | # symbol versioning. |
| 178 | quadmath_use_symver=no |
| 179 | else |
| 180 | save_LDFLAGS="$LDFLAGS" |
| 181 | LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map" |
| 182 | cat > conftest.map <<EOF |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 183 | FOO_1.0 { |
| 184 | global: *foo*; bar; local: *; |
| 185 | }; |
| 186 | EOF |
Rainer Orth | bf382f5 | 2011-03-21 12:24:17 +0000 | [diff] [blame] | 187 | AC_TRY_LINK([int foo;],[],[quadmath_use_symver=gnu],[quadmath_use_symver=no]) |
| 188 | if test x$quadmath_use_symver = xno; then |
| 189 | case "$target_os" in |
| 190 | solaris2*) |
| 191 | LDFLAGS="$save_LDFLAGS" |
| 192 | LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map" |
| 193 | # Sun ld cannot handle wildcards and treats all entries as undefined. |
| 194 | cat > conftest.map <<EOF |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 195 | FOO_1.0 { |
| 196 | global: foo; local: *; |
| 197 | }; |
| 198 | EOF |
Rainer Orth | bf382f5 | 2011-03-21 12:24:17 +0000 | [diff] [blame] | 199 | AC_TRY_LINK([int foo;],[],[quadmath_use_symver=sun],[quadmath_use_symver=no]) |
| 200 | ;; |
| 201 | esac |
| 202 | fi |
| 203 | LDFLAGS="$save_LDFLAGS" |
Kai Tietz | fabfcf5 | 2010-11-29 17:52:24 +0000 | [diff] [blame] | 204 | fi |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 205 | fi |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 206 | AC_MSG_RESULT($quadmath_use_symver) |
| 207 | AM_CONDITIONAL(LIBQUAD_USE_SYMVER, [test "x$quadmath_use_symver" != xno]) |
| 208 | AM_CONDITIONAL(LIBQUAD_USE_SYMVER_GNU, [test "x$quadmath_use_symver" = xgnu]) |
| 209 | AM_CONDITIONAL(LIBQUAD_USE_SYMVER_SUN, [test "x$quadmath_use_symver" = xsun]) |
| 210 | |
Tobias Burnus | abccc9a | 2010-12-08 22:04:45 +0100 | [diff] [blame] | 211 | AC_CACHE_CHECK([whether __float128 is supported], [libquad_cv_have_float128], |
| 212 | [GCC_TRY_COMPILE_OR_LINK([ |
Michael Meissner | 0c949f0 | 2017-09-01 22:10:57 +0000 | [diff] [blame] | 213 | #if (!defined(_ARCH_PPC)) || defined(__LONG_DOUBLE_IEEE128__) |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 214 | typedef _Complex float __attribute__((mode(TC))) __complex128; |
Michael Meissner | 0c949f0 | 2017-09-01 22:10:57 +0000 | [diff] [blame] | 215 | #else |
| 216 | typedef _Complex float __attribute__((mode(KC))) __complex128; |
| 217 | #endif |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 218 | |
| 219 | __float128 foo (__float128 x) |
| 220 | { |
| 221 | |
| 222 | __complex128 z1, z2; |
| 223 | |
| 224 | z1 = x; |
| 225 | z2 = x / 7.Q; |
| 226 | z2 /= z1; |
| 227 | |
| 228 | return (__float128) z2; |
| 229 | } |
| 230 | |
| 231 | __float128 bar (__float128 x) |
| 232 | { |
| 233 | return x * __builtin_huge_valq (); |
| 234 | } |
| 235 | ],[ |
| 236 | foo (1.2Q); |
| 237 | bar (1.2Q); |
| 238 | ],[ |
Tobias Burnus | abccc9a | 2010-12-08 22:04:45 +0100 | [diff] [blame] | 239 | libquad_cv_have_float128=yes |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 240 | ],[ |
Tobias Burnus | abccc9a | 2010-12-08 22:04:45 +0100 | [diff] [blame] | 241 | libquad_cv_have_float128=no |
| 242 | ])]) |
| 243 | AM_CONDITIONAL(BUILD_LIBQUADMATH, [test "x$libquad_cv_have_float128" = xyes]) |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 244 | |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 245 | # Check for printf hook support. |
| 246 | AC_MSG_CHECKING([whether printf hooks are supported]) |
| 247 | AC_TRY_COMPILE([ |
| 248 | #include <printf.h> |
| 249 | #include <stdarg.h> |
| 250 | #include <stdlib.h> |
| 251 | extern void flt128_va (void *, va_list *); |
| 252 | extern int flt128_ais (const struct printf_info *, size_t, int *, int *); |
| 253 | extern int flt128_printf_fp (FILE *, const struct printf_info *, const void *const *); |
| 254 | ],[ |
| 255 | int pa_flt128 = register_printf_type (flt128_va); |
| 256 | int mod_Q = register_printf_modifier (L"Q"); |
| 257 | int res = register_printf_specifier ('f', flt128_printf_fp, flt128_ais); |
Jakub Jelinek | 1296787 | 2011-02-14 19:49:07 +0100 | [diff] [blame] | 258 | struct printf_info info = { .user = -1 }; |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 259 | ], |
| 260 | [quadmath_printf_hooks=yes],[quadmath_printf_hooks=no]) |
| 261 | AC_MSG_RESULT($quadmath_printf_hooks) |
| 262 | if test x$quadmath_printf_hooks = xyes; then |
| 263 | AC_DEFINE([HAVE_PRINTF_HOOKS],[1],[GNU C Library stype printf hooks supported]) |
| 264 | fi |
| 265 | |
| 266 | # Check for whether locale support for quadmath_snprintf or Q printf hooks |
| 267 | # should be provided. |
Jakub Jelinek | d2995f2 | 2011-02-16 14:54:30 +0100 | [diff] [blame] | 268 | AC_MSG_CHECKING([whether nl_langinfo should be used]) |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 269 | AC_TRY_COMPILE([#include <langinfo.h>],[ |
| 270 | const char *s; |
| 271 | s = nl_langinfo (DECIMAL_POINT); |
| 272 | s = nl_langinfo (MON_DECIMAL_POINT); |
| 273 | s = nl_langinfo (GROUPING); |
| 274 | s = nl_langinfo (MON_GROUPING); |
| 275 | s = nl_langinfo (THOUSANDS_SEP); |
| 276 | s = nl_langinfo (MON_THOUSANDS_SEP); |
Jakub Jelinek | d2995f2 | 2011-02-16 14:54:30 +0100 | [diff] [blame] | 277 | (void) s; |
| 278 | ], |
| 279 | [quadmath_use_nl_langinfo=yes],[quadmath_use_nl_langinfo=no]) |
| 280 | AC_MSG_RESULT($quadmath_use_nl_langinfo) |
| 281 | if test x$quadmath_use_nl_langinfo = xyes; then |
| 282 | AC_DEFINE([USE_NL_LANGINFO],[1],[whether nl_langinfo should be used]) |
| 283 | fi |
| 284 | |
| 285 | AC_MSG_CHECKING([whether nl_langinfo should be used for wide char locale info]) |
| 286 | AC_TRY_COMPILE([#include <langinfo.h>],[ |
| 287 | const char *s; |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 288 | s = nl_langinfo (_NL_NUMERIC_DECIMAL_POINT_WC); |
| 289 | s = nl_langinfo (_NL_MONETARY_DECIMAL_POINT_WC); |
| 290 | s = nl_langinfo (_NL_NUMERIC_THOUSANDS_SEP_WC); |
| 291 | s = nl_langinfo (_NL_MONETARY_THOUSANDS_SEP_WC); |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 292 | (void) s; |
| 293 | ], |
Jakub Jelinek | d2995f2 | 2011-02-16 14:54:30 +0100 | [diff] [blame] | 294 | [quadmath_use_nl_langinfo_wc=yes],[quadmath_use_nl_langinfo_wc=no]) |
| 295 | AC_MSG_RESULT($quadmath_use_nl_langinfo_wc) |
| 296 | if test x$quadmath_use_nl_langinfo_wc = xyes; then |
| 297 | AC_DEFINE([USE_NL_LANGINFO_WC],[1],[whether nl_langinfo should be used for wide char locale info]) |
| 298 | fi |
| 299 | |
| 300 | AC_MSG_CHECKING([whether localeconv should be used]) |
| 301 | AC_TRY_COMPILE([#include <locale.h>],[ |
| 302 | const struct lconv *l = localeconv (); |
| 303 | const char *s; |
| 304 | s = l->decimal_point; |
| 305 | s = l->mon_decimal_point; |
| 306 | s = l->grouping; |
| 307 | s = l->mon_grouping; |
| 308 | s = l->thousands_sep; |
| 309 | s = l->mon_thousands_sep; |
| 310 | (void) s; |
| 311 | ], |
| 312 | [quadmath_use_localeconv=yes],[quadmath_use_localeconv=no]) |
| 313 | AC_MSG_RESULT($quadmath_use_localeconv) |
| 314 | if test x$quadmath_use_localeconv = xyes; then |
| 315 | AC_DEFINE([USE_LOCALECONV],[1],[whether localeconv should be used]) |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 316 | fi |
| 317 | |
| 318 | # Check for whether i18n number rewriting support for quadmath_snprintf |
| 319 | # or Q printf hooks should be provided. |
| 320 | AC_MSG_CHECKING([whether i18n number rewriting support for quadmath_snprintf should be added]) |
| 321 | AC_TRY_COMPILE([#include <langinfo.h> |
| 322 | #include <limits.h> |
| 323 | #include <string.h> |
| 324 | #include <wchar.h> |
| 325 | #include <wctype.h>],[ |
| 326 | const char *s; |
| 327 | char decimal[MB_LEN_MAX]; |
| 328 | wctrans_t map = wctrans ("to_outpunct"); |
| 329 | wint_t wdecimal = towctrans (L'.', map); |
| 330 | mbstate_t state; |
| 331 | memset (&state, '\0', sizeof (state)); |
| 332 | wcrtomb (decimal, wdecimal, &state); |
| 333 | s = nl_langinfo (_NL_CTYPE_OUTDIGIT0_MB); |
| 334 | s = nl_langinfo (_NL_CTYPE_OUTDIGIT0_WC); |
Jakub Jelinek | d2995f2 | 2011-02-16 14:54:30 +0100 | [diff] [blame] | 335 | s = nl_langinfo (_NL_CTYPE_MB_CUR_MAX); |
Jakub Jelinek | 1d92226 | 2011-02-14 16:34:44 +0100 | [diff] [blame] | 336 | (void) s; |
| 337 | ], |
| 338 | [quadmath_use_i18n_number_h=yes],[quadmath_use_i18n_number_h=no]) |
| 339 | AC_MSG_RESULT($quadmath_use_i18n_number_h) |
| 340 | if test x$quadmath_use_i18n_number_h = xyes; then |
| 341 | AC_DEFINE([USE_I18N_NUMBER_H],[1],[whether i18n number rewriting can be supported]) |
| 342 | fi |
| 343 | |
Igor Tsimbalist | fda26abe | 2017-11-17 23:36:50 +0100 | [diff] [blame] | 344 | # Add CET specific flags if CET is enabled |
| 345 | GCC_CET_FLAGS(CET_FLAGS) |
| 346 | XCFLAGS="$XCFLAGS $CET_FLAGS" |
| 347 | AC_SUBST(XCFLAGS) |
| 348 | |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 349 | AC_CACHE_SAVE |
| 350 | |
| 351 | if test ${multilib} = yes; then |
| 352 | multilib_arg="--enable-multilib" |
| 353 | else |
| 354 | multilib_arg= |
| 355 | fi |
| 356 | |
Tobias Burnus | 4c993c4 | 2010-12-08 09:06:49 +0100 | [diff] [blame] | 357 | |
| 358 | # We would like our source tree to be readonly. However when releases or |
| 359 | # pre-releases are generated, the flex/bison generated files as well as the |
| 360 | # various formats of manuals need to be included along with the rest of the |
| 361 | # sources. Therefore we have --enable-generated-files-in-srcdir to do |
| 362 | # just that. |
| 363 | AC_MSG_CHECKING(generated-files-in-srcdir) |
| 364 | AC_ARG_ENABLE(generated-files-in-srcdir, |
| 365 | AS_HELP_STRING([--enable-generated-files-in-srcdir], |
| 366 | [put copies of generated files in source dir intended for creating source tarballs for users without texinfo bison or flex]), |
| 367 | [case "$enableval" in |
| 368 | yes) enable_generated_files_in_srcdir=yes ;; |
| 369 | no) enable_generated_files_in_srcdir=no ;; |
| 370 | *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; |
| 371 | esac], |
| 372 | [enable_generated_files_in_srcdir=no]) |
| 373 | AC_MSG_RESULT($enable_generated_files_in_srcdir) |
| 374 | AM_CONDITIONAL(GENINSRC, test "$enable_generated_files_in_srcdir" = yes) |
| 375 | |
Jakub Jelinek | 3c36aa6 | 2017-01-17 10:38:48 +0100 | [diff] [blame] | 376 | # Determine what GCC version number to use in filesystem paths. |
| 377 | GCC_BASE_VER |
Tobias Burnus | 4c993c4 | 2010-12-08 09:06:49 +0100 | [diff] [blame] | 378 | |
Francois-Xavier Coudert | 1ec601b | 2010-11-16 21:23:19 +0000 | [diff] [blame] | 379 | AC_CONFIG_FILES(Makefile) |
| 380 | AC_OUTPUT |