1 # Process this file with autoconf to produce a configure script, like so:
2 # aclocal && autoconf && autoheader && automake
5 AC_INIT(libgcc-math, 1.0)
6 AC_CONFIG_SRCDIR(configure.ac)
11 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
12 AC_ARG_ENABLE(version-specific-runtime-libs,
13 [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
15 yes) version_specific_libs=yes ;;
16 no) version_specific_libs=no ;;
17 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
19 [version_specific_libs=no])
20 AC_MSG_RESULT($version_specific_libs)
25 AM_ENABLE_MULTILIB(, ..)
27 target_alias=${target_alias-$host_alias}
28 AC_SUBST(target_alias)
31 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
32 # We must force CC to /not/ be precious variables; otherwise
33 # the wrong, non-multilib-adjusted value will be used in multilibs.
34 # As a side effect, we have to subst CFLAGS ourselves.
36 m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
37 m4_define([_AC_ARG_VAR_PRECIOUS],[])
39 m4_rename([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
43 if test "x$GCC" != "xyes"; then
44 AC_MSG_ERROR([libgcc-math must be built with GCC])
49 AC_MSG_CHECKING([whether hidden visibility is supported])
51 void __attribute__((visibility ("hidden"))) bar (void) {}],,
52 [gccm_hidden=yes],[gccm_hidden=no])
53 AC_MSG_RESULT($gccm_hidden)
54 if test x$gccm_hidden = xyes; then
55 AC_DEFINE([HAVE_HIDDEN_VISIBILITY],[1],[__attribute__((visibility ("hidden"))) supported])
58 AC_MSG_CHECKING([whether symbol versioning is supported])
59 cat > conftest.map <<EOF
61 global: *foo*; bar; local: *;
64 save_LDFLAGS="$LDFLAGS"
65 LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
66 AC_TRY_LINK([int foo;],[],[gccm_use_symver=yes],[gccm_use_symver=no])
67 LDFLAGS="$save_LDFLAGS"
68 AC_MSG_RESULT($gccm_use_symver)
69 AM_CONDITIONAL(LIBGCCM_USE_SYMVER, [test "x$gccm_use_symver" = xyes])
71 AC_MSG_CHECKING([whether we are a 32bit target])
75 if (sizeof(int) == 4 && sizeof(long) == 4 && sizeof(void *) == 4)
78 undefined_function ();
83 AM_CONDITIONAL(TARGET_ILP32, [test "x$target_ilp32" = xyes])
87 AC_SUBST(enable_shared)
88 AC_SUBST(enable_static)
90 # Calculate toolexeclibdir
91 # Also toolexecdir, though it's only used in toolexeclibdir
92 case ${version_specific_libs} in
94 # Need the gcc compiler version to know where to install libraries
95 # and header files if --enable-version-specific-runtime-libs option
97 toolexecdir='$(libdir)/gcc/$(target_alias)'
98 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
101 if test -n "$with_cross_host" &&
102 test x"$with_cross_host" != x"no"; then
103 # Install a library built with a cross compiler in tooldir, not libdir.
104 toolexecdir='$(exec_prefix)/$(target_alias)'
105 toolexeclibdir='$(toolexecdir)/lib'
107 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
108 toolexeclibdir='$(libdir)'
110 multi_os_directory=`$CC -print-multi-os-directory`
111 case $multi_os_directory in
112 .) ;; # Avoid trailing /.
113 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
117 AC_SUBST(toolexecdir)
118 AC_SUBST(toolexeclibdir)
120 if test ${multilib} = yes; then
121 multilib_arg="--enable-multilib"
126 GCC_HEADER_STDINT(gstdint.h)
128 # Now check which parts we include in the library.
133 # Handle multilib cases
134 if test "x$target_ilp32" = xyes; then
136 arch_libraries="i386/libsse2.la"
137 arch_maps="i386/sse2.map"
142 AC_SUBST(arch_subdirs)
143 AC_SUBST(arch_libraries)
145 AM_CONDITIONAL(BUILD_LIBGCC_MATH, [test "x$arch_subdirs" != x])
148 AC_CONFIG_FILES([Makefile i386/Makefile])