]> git.ipfire.org Git - thirdparty/gcc.git/blame - libquadmath/configure.ac
config.gcc [...]: Ignore --with-dwarf2 option.
[thirdparty/gcc.git] / libquadmath / configure.ac
CommitLineData
1ec601bf
FXC
1# Process this file with autoconf to produce a configure script, like so:
2# aclocal && autoconf && autoheader && automake
3
4AC_PREREQ(2.64)
5AC_INIT([GCC Quad-precision Math Library], 0.1,,[libquadmath])
6AC_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
23AC_CANONICAL_SYSTEM
fabfcf5e
KT
24ACX_NONCANONICAL_TARGET
25
1ec601bf 26target_alias=${target_alias-$host_alias}
fabfcf5e 27AC_SUBST(target_alias)
1ec601bf
FXC
28
29AM_INIT_AUTOMAKE([1.9.0 foreign subdir-objects no-dist -Wall -Werror])
30
1ec601bf
FXC
31AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
32AC_ARG_ENABLE(version-specific-runtime-libs,
33[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
34[case "$enableval" in
35 yes) version_specific_libs=yes ;;
36 no) version_specific_libs=no ;;
37 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
38 esac],
39[version_specific_libs=no])
40AC_MSG_RESULT($version_specific_libs)
41
fabfcf5e 42GCC_NO_EXECUTABLES
1ec601bf
FXC
43
44# Configure libtool
45AM_PROG_LIBTOOL
46AC_SUBST(enable_shared)
47AC_SUBST(enable_static)
48
49AM_MAINTAINER_MODE
50AM_ENABLE_MULTILIB(, ..)
51
fabfcf5e
KT
52AC_LANG_C
53# The same as in boehm-gc and libstdc++. Have to borrow it from there.
54# We must force CC to /not/ be precious variables; otherwise
55# the wrong, non-multilib-adjusted value will be used in multilibs.
56# As a side effect, we have to subst CFLAGS ourselves.
57
58m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
59m4_define([_AC_ARG_VAR_PRECIOUS],[])
60AC_PROG_CC
61m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
62
63AC_SUBST(CFLAGS)
64
65AM_PROG_CC_C_O
66
67if test "x$GCC" != "xyes"; then
68 AC_MSG_ERROR([libquadmath must be built with GCC])
69fi
70AC_PROG_CPP
71
1ec601bf
FXC
72# Calculate toolexeclibdir
73# Also toolexecdir, though it's only used in toolexeclibdir
74case ${version_specific_libs} in
75 yes)
76 # Need the gcc compiler version to know where to install libraries
77 # and header files if --enable-version-specific-runtime-libs option
78 # is selected.
79 toolexecdir='$(libdir)/gcc/$(target_alias)'
80 toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
81 ;;
82 no)
83 if test -n "$with_cross_host" &&
84 test x"$with_cross_host" != x"no"; then
85 # Install a library built with a cross compiler in tooldir, not libdir.
86 toolexecdir='$(exec_prefix)/$(target_alias)'
87 toolexeclibdir='$(toolexecdir)/lib'
88 else
89 toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
90 toolexeclibdir='$(libdir)'
91 fi
92 multi_os_directory=`$CC -print-multi-os-directory`
93 case $multi_os_directory in
94 .) ;; # Avoid trailing /.
95 *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
96 esac
97 ;;
98esac
99AC_SUBST(toolexecdir)
100AC_SUBST(toolexeclibdir)
101
102AC_CHECK_LIB([m],[sqrtl],[AC_DEFINE([HAVE_SQRTL],[1],[libm includes sqrtl])])
103AC_CHECK_LIB([m],[cbrtl],[AC_DEFINE([HAVE_CBRTL],[1],[libm includes cbrtl])])
104
105# Check for symbol versioning (copied from libssp).
106AC_MSG_CHECKING([whether symbol versioning is supported])
fabfcf5e
KT
107if test x$gcc_no_link = xyes; then
108 # If we cannot link, we cannot build shared libraries, so do not use
109 # symbol versioning.
110 quadmath_use_symver=no
111else
112 save_LDFLAGS="$LDFLAGS"
113 LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
114 cat > conftest.map <<EOF
1ec601bf
FXC
115FOO_1.0 {
116 global: *foo*; bar; local: *;
117};
118EOF
fabfcf5e
KT
119 AC_TRY_LINK([int foo;],[],[quadmath_use_symver=gnu],[quadmath_use_symver=no])
120 if test x$quadmath_use_symver = xno; then
121 case "$target_os" in
122 solaris2*)
123 LDFLAGS="$save_LDFLAGS"
124 LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
125 # Sun ld cannot handle wildcards and treats all entries as undefined.
126 cat > conftest.map <<EOF
1ec601bf
FXC
127FOO_1.0 {
128 global: foo; local: *;
129};
130EOF
fabfcf5e
KT
131 AC_TRY_LINK([int foo;],[],[quadmath_use_symver=sun],[quadmath_use_symver=no])
132 ;;
133 esac
134 fi
135 LDFLAGS="$save_LDFLAGS"
1ec601bf 136fi
1ec601bf
FXC
137AC_MSG_RESULT($quadmath_use_symver)
138AM_CONDITIONAL(LIBQUAD_USE_SYMVER, [test "x$quadmath_use_symver" != xno])
139AM_CONDITIONAL(LIBQUAD_USE_SYMVER_GNU, [test "x$quadmath_use_symver" = xgnu])
140AM_CONDITIONAL(LIBQUAD_USE_SYMVER_SUN, [test "x$quadmath_use_symver" = xsun])
141
142AC_MSG_CHECKING([whether __float128 is supported])
143 AC_TRY_LINK([
144 typedef _Complex float __attribute__((mode(TC))) __complex128;
145
146 __float128 foo (__float128 x)
147 {
148
149 __complex128 z1, z2;
150
151 z1 = x;
152 z2 = x / 7.Q;
153 z2 /= z1;
154
155 return (__float128) z2;
156 }
157
158 __float128 bar (__float128 x)
159 {
160 return x * __builtin_huge_valq ();
161 }
162 ],[
163 foo (1.2Q);
164 bar (1.2Q);
165 ],[
166 libquad_have_float128=yes
167 ],[
168 libquad_have_float128=no
169])
170AC_MSG_RESULT([$libquad_have_float128])
171
172dnl
173dnl Enable the following for a stand-alone library:
174dnl
175dnl if test $libquad_have_float128 = no; then
176dnl AC_MSG_ERROR([__float128 support is required to build this library.])
177dnl fi
178
179AM_CONDITIONAL(BUILD_LIBQUADMATH, [test "x$libquad_have_float128" = xyes])
180
181AC_CACHE_SAVE
182
183if test ${multilib} = yes; then
184 multilib_arg="--enable-multilib"
185else
186 multilib_arg=
187fi
188
189AC_CONFIG_FILES(Makefile)
190AC_OUTPUT