OSDN Git Service

2000-10-11 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / configure.in
1 # Process this file with autoconf to produce a configure script, like so:
2 # aclocal, autoconf, autoheader, automake
3
4 AC_PREREQ(2.13)
5 AC_INIT(src/complex.cc)
6 AC_CONFIG_AUX_DIR(..)
7
8 # Gets and sets build, host, target, *_vendor, *_cpu, *_os, etc.
9 AC_CANONICAL_SYSTEM
10
11 # We use these options to decide which functions to include.
12 AC_ARG_WITH(target-subdir,
13 [  --with-target-subdir=SUBDIR
14                            configuring in a subdirectory])
15 AC_ARG_WITH(cross-host,
16 [  --with-cross-host=HOST  configuring with a cross compiler])
17
18 GLIBCPP_CONFIGURE(.)
19 AC_LIBTOOL_DLOPEN
20 AM_PROG_LIBTOOL
21 GLIBCPP_CHECK_GNU_MAKE
22   if test "x$_cv_gnu_make_command" = "x"; then
23     AC_MSG_ERROR([GNU make not found. Please install it or correct your path.])
24   fi
25 AM_CONFIG_HEADER(config.h)
26
27 # Check for c++ or library specific bits that don't require linking.
28 GLIBCPP_CHECK_COMPILER_VERSION
29 GLIBCPP_CHECK_CPU
30 GLIBCPP_CHECK_OS
31
32 AC_CACHE_SAVE
33
34 # Enable all the crazy c++ stuff.
35 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
36 GLIBCPP_ENABLE_CSTDIO
37 GLIBCPP_ENABLE_LONG_LONG(yes)
38 GLIBCPP_ENABLE_SHADOW(no)
39 GLIBCPP_ENABLE_THREADS
40 GLIBCPP_ENABLE_ATOMICITY
41 #GLIBCPP_ENABLE_RELIBGCC([../..])
42 GLIBCPP_ENABLE_CXX_FLAGS([none])
43
44
45 if test -n "$with_cross_host"; then
46
47   # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
48   # may not work correctly, because the compiler may not be able to
49   # link executables.
50
51   xcompiling=1
52   NATIVE=no
53   # If Canadian cross, then don't pick up tools from the build
54   # directory.
55   if test "$build" != "$with_cross_host"; then
56     CANADIAN=yes
57     NULL_TARGET=yes
58   else
59     CANADIAN=no
60     NULL_TARGET=no
61   fi
62
63   case "$target_alias" in
64     *-wince-*)
65         # Configure for Microsoft Windows CE, or whatever they are
66         # currently calling it.
67         AC_DEFINE(HAVE_FLOAT_H)
68
69         AC_DEFINE(HAVE__FINITE)
70         AC_DEFINE(HAVE__ISNAN)
71         AC_DEFINE(HAVE__COPYSIGN)
72         AC_DEFINE(HAVE__FPCLASS)
73         AC_DEFINE(HAVE_MODF)
74
75         ctype_include_dir="config/os/wince"
76         AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h, bits/ctype_base.h)
77         AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \
78         bits/ctype_inline.h)
79         AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
80         bits/ctype_noninline.h)
81
82
83         AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
84
85         AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
86         AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
87         ;;
88     *)
89         # We assume newlib.  This lets us hard-code the functions we know
90         # we'll have.
91         AC_DEFINE(HAVE_FINITE)
92         AC_DEFINE(HAVE_ISNAN)
93         AC_DEFINE(HAVE_ISNANF)
94         AC_DEFINE(HAVE_ISINF)
95         AC_DEFINE(HAVE_ISINFF)
96
97         ctype_include_dir="config/os/newlib"
98         AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h, bits/ctype_base.h)
99         AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \
100         bits/ctype_inline.h)
101         AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
102         bits/ctype_noninline.h)
103
104         AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
105
106         AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
107         AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
108         # need to ceck for faster f versions of math functions, ie sinf?
109         ;;
110   esac
111 else
112
113   # We are being configured natively. We can do more elaborate tests
114   # that include AC_TRY_COMPILE now, as the linker is assumed to be
115   # working.
116
117   xcompiling=0
118   NATIVE=yes
119   CANADIAN=no
120   NULL_TARGET=no
121
122   # Check for available headers.
123   AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
124   machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h])
125
126   GLIBCPP_CHECK_COMPILER_FEATURES
127   GLIBCPP_CHECK_LINKER_FEATURES
128   GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
129   GLIBCPP_CHECK_MATH_SUPPORT
130   GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
131   GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
132   AC_CACHE_SAVE
133   GLIBCPP_CHECK_WCHAR_T_SUPPORT
134   GLIBCPP_CHECK_CTYPE
135
136   AC_FUNC_MMAP
137 fi
138
139 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
140 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
141 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
142 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
143
144 AC_LC_MESSAGES
145
146 if test "${multilib}" = "yes"; then
147   multilib_arg="--enable-multilib"
148 else
149   multilib_arg=
150 fi
151
152
153 # Generate the various Makefiles, include files, and scripts.
154
155 # Export all the include and flag information to makefiles.
156 GLIBCPP_EXPORT_INCLUDES
157 GLIBCPP_EXPORT_FLAGS
158
159 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
160 # so that multilib installs will end up installed in the correct
161 # place. To work around this not being passed down from config-ml.in
162 # -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
163 # append it here.
164 AC_OUTPUT(mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile,
165 [if test -n "$CONFIG_FILES"; then
166   ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
167   grep '^MULTISUBDIR =' Makefile >> src/Makefile
168 fi],
169 srcdir=${srcdir}
170 host=${host}
171 target=${target}
172 with_multisubdir=${with_multisubdir}
173 ac_configure_args="${multilib_arg} ${ac_configure_args}"
174 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
175 glibcpp_basedir=${glibcpp_basedir}
176 CC="${CC}"
177 CXX="${CXX}"
178 )
179
180
181 blddir=`pwd`
182 # Generate bits/c++config.h
183 # NB: This must be the first generated file as others include it. . .
184 AC_OUTPUT_COMMANDS([$srcdir/mkc++config $blddir $srcdir])
185
186 # Generate bits/std_limits.h and src/limitsMEMBERS.cc
187 AC_OUTPUT_COMMANDS([$srcdir/mknumeric_limits $blddir $srcdir $xcompiling])
188
189
190 # Sanity checking & User-visible messages.
191 # Checks down here, otherwise they get scrolled off before
192 # the user will notice.
193 if test "$enable_namespaces" = "yes" && test "$enable_libgcc_rebuild" = "no"
194 then
195   AC_MSG_WARN([libgcc.a will not match mangled symbols unless it is rebuilt])
196 fi
197 if test "$enable_namespaces" = "no" && test "$enable_libgcc_rebuild" != "no"
198 then
199   # Other things besides namespaces can make this true as well, but none
200   # of them are done automatically... yet
201   AC_MSG_WARN([no point in rebuilding libgcc.a if namespaces aren't used])
202 fi
203
204 # Trying to get more people to read documentation.  Possibly remove
205 # check and warn all the time. There is no "informational" AC_MSG_
206 # macro, so these are going to be printed even when --quiet/--silent
207 # is given.
208 if test ! -f stamp-sanity-warned; then
209   touch stamp-sanity-warned
210   echo ""
211   echo "Please make certain that you read the installation information here:"
212   echo "  faster => ${srcdir}/docs/install.html"
213   echo "  slower => <URL:http://sources.redhat.com/libstdc++/install.html>"
214   echo ""
215   echo "and the configuration information here:"
216   echo "  faster => ${srcdir}/docs/configopts.html"
217   echo "  slower => <URL:http://sources.redhat.com/libstdc++/configopts.html>"
218   echo ""
219   echo "before proceeding with ${_cv_gnu_make_command}."
220   echo ""
221 fi
222
223