]> gcc.gnu.org Git - gcc.git/blame - libstdc++-v3/configure.in
acinclude.m4 (GLIBCPP_ENABLE_LONG_LONG): Check for lldiv_t.
[gcc.git] / libstdc++-v3 / configure.in
CommitLineData
b2dad0e3 1# Process this file with autoconf to produce a configure script, like so:
d94611f1 2# aclocal, autoconf, autoheader, automake
b2dad0e3
BK
3
4AC_PREREQ(2.13)
5AC_INIT(src/complex.cc)
6AC_CONFIG_AUX_DIR(..)
7
8# Gets and sets build, host, target, *_vendor, *_cpu, *_os, etc.
9AC_CANONICAL_SYSTEM
10
11# We use these options to decide which functions to include.
12AC_ARG_WITH(target-subdir,
13[ --with-target-subdir=SUBDIR
14 configuring in a subdirectory])
15AC_ARG_WITH(cross-host,
16[ --with-cross-host=HOST configuring with a cross compiler])
17
f4c79fef
BK
18# Runs configure.host and configure.target. Have to run this before
19# the GLIBCPP_ENABLE_* macros below.
b2dad0e3 20GLIBCPP_CONFIGURE(.)
f4c79fef 21
b2dad0e3 22AC_LIBTOOL_DLOPEN
5780a46b 23AM_PROG_LIBTOOL
34791641
PE
24AC_SUBST(enable_shared)
25AC_SUBST(enable_static)
29bd52c8
PE
26GLIBCPP_CHECK_GNU_MAKE
27 if test "x$_cv_gnu_make_command" = "x"; then
99b51359 28 AC_MSG_ERROR([GNU make not found. Please install it or correct your path.])
29bd52c8 29 fi
b2dad0e3
BK
30AM_CONFIG_HEADER(config.h)
31
32# Check for c++ or library specific bits that don't require linking.
33GLIBCPP_CHECK_COMPILER_VERSION
b2dad0e3 34
8b8ab21c 35# Enable all the crazy c++ stuff. C_MBCHAR must come early.
7f586614 36GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
b2dad0e3 37GLIBCPP_ENABLE_CSTDIO
e26cb7ab 38GLIBCPP_ENABLE_C_MBCHAR([yes])
34791641
PE
39GLIBCPP_ENABLE_LONG_LONG([yes])
40GLIBCPP_ENABLE_SHADOW([no])
b2dad0e3 41GLIBCPP_ENABLE_THREADS
e974e9cc 42GLIBCPP_ENABLE_ATOMICITY
32a4595e 43GLIBCPP_ENABLE_CXX_FLAGS([none])
b2dad0e3 44
cde28f0d 45
b2dad0e3
BK
46if test -n "$with_cross_host"; then
47
48 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
49 # may not work correctly, because the compiler may not be able to
50 # link executables.
51
52 xcompiling=1
53 NATIVE=no
54 # If Canadian cross, then don't pick up tools from the build
55 # directory.
56 if test "$build" != "$with_cross_host"; then
57 CANADIAN=yes
58 NULL_TARGET=yes
59 else
60 CANADIAN=no
61 NULL_TARGET=no
62 fi
63
64 case "$target_alias" in
65 *-wince-*)
66 # Configure for Microsoft Windows CE, or whatever they are
67 # currently calling it.
68 AC_DEFINE(HAVE_FLOAT_H)
69
1fd2f510
BK
70 AC_DEFINE(HAVE__FINITE)
71 AC_DEFINE(HAVE__ISNAN)
72 AC_DEFINE(HAVE__COPYSIGN)
73 AC_DEFINE(HAVE__FPCLASS)
74 AC_DEFINE(HAVE_MODF)
75
76 ctype_include_dir="config/os/wince"
5e53dba6
BK
77 AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h,
78 include/bits/ctype_base.h)
1fd2f510 79 AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \
5e53dba6 80 include/bits/ctype_inline.h)
1fd2f510 81 AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
5e53dba6 82 include/bits/ctype_noninline.h)
e974e9cc 83
b2dad0e3 84
1fd2f510 85 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
b2dad0e3 86
1fd2f510
BK
87 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
88 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
b2dad0e3
BK
89 ;;
90 *)
91 # We assume newlib. This lets us hard-code the functions we know
92 # we'll have.
1fd2f510
BK
93 AC_DEFINE(HAVE_FINITE)
94 AC_DEFINE(HAVE_ISNAN)
95 AC_DEFINE(HAVE_ISNANF)
96 AC_DEFINE(HAVE_ISINF)
97 AC_DEFINE(HAVE_ISINFF)
98
99 ctype_include_dir="config/os/newlib"
5e53dba6
BK
100 AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h,
101 include/bits/ctype_base.h)
1fd2f510 102 AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \
5e53dba6 103 include/bits/ctype_inline.h)
1fd2f510 104 AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
5e53dba6 105 include/bits/ctype_noninline.h)
b2dad0e3 106
1fd2f510 107 AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
b2dad0e3 108
1fd2f510
BK
109 AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
110 AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
34791641 111 # need to check for faster f versions of math functions, ie sinf?
b2dad0e3
BK
112 ;;
113 esac
114else
115
116 # We are being configured natively. We can do more elaborate tests
117 # that include AC_TRY_COMPILE now, as the linker is assumed to be
118 # working.
119
120 xcompiling=0
121 NATIVE=yes
122 CANADIAN=no
123 NULL_TARGET=no
124
125 # Check for available headers.
126 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
34791641 127 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h])
b2dad0e3 128
c470c17d
BK
129 GLIBCPP_CHECK_COMPILER_FEATURES
130 GLIBCPP_CHECK_LINKER_FEATURES
b2dad0e3
BK
131 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
132 GLIBCPP_CHECK_MATH_SUPPORT
2f103494
BK
133 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
134 GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
b2dad0e3 135 GLIBCPP_CHECK_WCHAR_T_SUPPORT
e7140677
BK
136 GLIBCPP_CHECK_CTYPE_SUPPORT
137 GLIBCPP_CHECK_STDLIB_SUPPORT
b2dad0e3
BK
138
139 AC_FUNC_MMAP
140fi
141
142AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
143AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
144AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
145AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
c4d3f801 146
5e53dba6 147AC_CACHE_SAVE
b2dad0e3
BK
148AC_LC_MESSAGES
149
b2dad0e3
BK
150if test "${multilib}" = "yes"; then
151 multilib_arg="--enable-multilib"
152else
153 multilib_arg=
154fi
155
156
157# Generate the various Makefiles, include files, and scripts.
158
1fd2f510
BK
159# This helps subvert libstdcxx_interface, as calculated by devo/config.if
160# Needed so that g++ can find the correct include subdir automatically.
161INTERFACE=v3
162
163# Check for the interface version number for specifying where header
164# files are installed, if a version number is provided.
165AC_MSG_CHECKING([for interface version number])
166libstdcxx_interface=$INTERFACE
167AC_MSG_RESULT($libstdcxx_interface)
168AC_SUBST(libstdcxx_interface)
169
170# Process the option --with-gxx-include-dir=<path to include-files directory>
171AC_MSG_CHECKING([for --with-gxx-include-dir])
172AC_ARG_WITH(gxx-include-dir,
173[ --with-gxx-include-dir the installation directory for include files],
174[case "${withval}" in
175 yes)
176 AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
177 gxx_include_dir=no
178 ;;
179 no)
180 gxx_include_dir=no
181 ;;
182 *)
183 gxx_include_dir=${withval}
184 ;;
185esac], [gxx_include_dir=no])
186AC_MSG_RESULT($gxx_include_dir)
187AC_SUBST(gxx_include_dir)
188AM_CONDITIONAL(GXX_INCLUDE_DIR, test x${gxx_include_dir} != xno)
189
190# Process the option "--enable-version-specific-runtime-libs"
191AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
192AC_ARG_ENABLE(version-specific-runtime-libs,
193[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
194[ version_specific_libs=yes
195# Need the gcc compiler version to know where to install libraries
196# and header files if --enable-version-specific-runtime-libs option
197# is selected.
198changequote(,)dnl
199gcc_tmp=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $6}'`
200gcc_num=`echo ${gcc_tmp} | sed 's/\"//g'`
201#gcc_date=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $7}'`
202#gcc_version=$gcc_num-$gcc_date
203gcc_version=$gcc_num
204changequote([,])dnl
205AC_SUBST(gcc_version)
206],version_specific_libs=no)
207AC_MSG_RESULT($version_specific_libs)
208if test x${version_specific_libs} = xyes; then
209 AM_CONDITIONAL(VERSION_SPECIFIC_LIBS, test x${version_specific_libs} = xyes)
210 AC_MSG_WARN(version specific directory is: $gcc_version)
211fi
212
213
214
e466dc8a
BK
215# Export all the include and flag information to makefiles.
216GLIBCPP_EXPORT_INCLUDES
217GLIBCPP_EXPORT_FLAGS
218
5e53dba6
BK
219# This should be done by mkincludedir, but hack around it now.
220blddir=`pwd`
221echo "checking for $blddir/include"
222
223if test ! -d "$blddir/include"; then
224 mkdir "$blddir/include"
225fi
226
b2dad0e3
BK
227# NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
228# so that multilib installs will end up installed in the correct
229# place. To work around this not being passed down from config-ml.in
230# -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
231# append it here.
b21218ce 232AC_OUTPUT(tests_flags mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile,
b2dad0e3
BK
233[if test -n "$CONFIG_FILES"; then
234 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
235 grep '^MULTISUBDIR =' Makefile >> src/Makefile
be5aeb60 236fi
b21218ce 237chmod +x tests_flags
be5aeb60
MM
238chmod +x mkcheck
239],
b2dad0e3
BK
240srcdir=${srcdir}
241host=${host}
242target=${target}
243with_multisubdir=${with_multisubdir}
244ac_configure_args="${multilib_arg} ${ac_configure_args}"
245CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
246glibcpp_basedir=${glibcpp_basedir}
247CC="${CC}"
248CXX="${CXX}"
249)
250
251
b2dad0e3
BK
252# Generate bits/c++config.h
253# NB: This must be the first generated file as others include it. . .
35a63b94 254$srcdir/mkc++config $blddir $srcdir
b2dad0e3
BK
255
256# Generate bits/std_limits.h and src/limitsMEMBERS.cc
1fd2f510 257if test ! -f stamp-limits; then
35a63b94 258 $srcdir/mknumeric_limits $blddir $srcdir $xcompiling
1fd2f510
BK
259 touch stamp-limits
260fi
29bd52c8 261
a9117427 262
29bd52c8
PE
263# Sanity checking & User-visible messages.
264# Checks down here, otherwise they get scrolled off before
265# the user will notice.
29bd52c8 266
5780a46b
BK
267# Trying to get more people to read documentation. Possibly remove
268# check and warn all the time. There is no "informational" AC_MSG_
269# macro, so these are going to be printed even when --quiet/--silent
270# is given.
99b51359
BK
271if test ! -f stamp-sanity-warned; then
272 touch stamp-sanity-warned
5780a46b
BK
273 echo ""
274 echo "Please make certain that you read the installation information here:"
29bd52c8 275 echo " faster => ${srcdir}/docs/install.html"
5780a46b
BK
276 echo " slower => <URL:http://sources.redhat.com/libstdc++/install.html>"
277 echo ""
278 echo "and the configuration information here:"
29bd52c8 279 echo " faster => ${srcdir}/docs/configopts.html"
5780a46b
BK
280 echo " slower => <URL:http://sources.redhat.com/libstdc++/configopts.html>"
281 echo ""
421173e6 282 echo "before proceeding with ${_cv_gnu_make_command}."
5780a46b 283 echo ""
29bd52c8 284fi
This page took 0.117678 seconds and 5 git commands to generate.