OSDN Git Service

2000-11-20 Benjamin Kosnik <bkoz@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 AC_SUBST(enable_shared)
22 AC_SUBST(enable_static)
23 GLIBCPP_CHECK_GNU_MAKE
24   if test "x$_cv_gnu_make_command" = "x"; then
25     AC_MSG_ERROR([GNU make not found. Please install it or correct your path.])
26   fi
27 AM_CONFIG_HEADER(config.h)
28
29 # Check for c++ or library specific bits that don't require linking.
30 GLIBCPP_CHECK_COMPILER_VERSION
31
32 # Enable all the crazy c++ stuff.  C_MBCHAR must come early.
33 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
34 GLIBCPP_ENABLE_CSTDIO
35 GLIBCPP_ENABLE_C_MBCHAR([yes])
36 GLIBCPP_ENABLE_LONG_LONG([yes])
37 GLIBCPP_ENABLE_SHADOW([no])
38 GLIBCPP_ENABLE_THREADS
39 GLIBCPP_ENABLE_ATOMICITY
40 GLIBCPP_ENABLE_CXX_FLAGS([none])
41
42
43 if test -n "$with_cross_host"; then
44
45   # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
46   # may not work correctly, because the compiler may not be able to
47   # link executables.
48
49   xcompiling=1
50   NATIVE=no
51   # If Canadian cross, then don't pick up tools from the build
52   # directory.
53   if test "$build" != "$with_cross_host"; then
54     CANADIAN=yes
55     NULL_TARGET=yes
56   else
57     CANADIAN=no
58     NULL_TARGET=no
59   fi
60
61   case "$target_alias" in
62     *-wince-*)
63         # Configure for Microsoft Windows CE, or whatever they are
64         # currently calling it.
65         AC_DEFINE(HAVE_FLOAT_H)
66
67         AC_DEFINE(HAVE__FINITE)
68         AC_DEFINE(HAVE__ISNAN)
69         AC_DEFINE(HAVE__COPYSIGN)
70         AC_DEFINE(HAVE__FPCLASS)
71         AC_DEFINE(HAVE_MODF)
72
73         ctype_include_dir="config/os/wince"
74         AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h, 
75         include/bits/ctype_base.h)
76         AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \
77         include/bits/ctype_inline.h)
78         AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
79         include/bits/ctype_noninline.h)
80
81
82         AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
83
84         AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
85         AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
86         ;;
87     *)
88         # We assume newlib.  This lets us hard-code the functions we know
89         # we'll have.
90         AC_DEFINE(HAVE_FINITE)
91         AC_DEFINE(HAVE_ISNAN)
92         AC_DEFINE(HAVE_ISNANF)
93         AC_DEFINE(HAVE_ISINF)
94         AC_DEFINE(HAVE_ISINFF)
95
96         ctype_include_dir="config/os/newlib"
97         AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h, 
98         include/bits/ctype_base.h)
99         AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \
100         include/bits/ctype_inline.h)
101         AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
102         include/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 check 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 gconv.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   GLIBCPP_CHECK_WCHAR_T_SUPPORT
133   GLIBCPP_CHECK_CTYPE_SUPPORT
134   GLIBCPP_CHECK_STDLIB_SUPPORT
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_CACHE_SAVE
145 AC_LC_MESSAGES
146
147 if test "${multilib}" = "yes"; then
148   multilib_arg="--enable-multilib"
149 else
150   multilib_arg=
151 fi
152
153
154 # Generate the various Makefiles, include files, and scripts.
155
156 # This helps subvert libstdcxx_interface, as calculated by devo/config.if
157 # Needed so that g++ can find the correct include subdir automatically.
158 INTERFACE=v3
159
160 # Check for the interface version number for specifying where header
161 # files are installed, if a version number is provided.
162 AC_MSG_CHECKING([for interface version number])
163 libstdcxx_interface=$INTERFACE
164 AC_MSG_RESULT($libstdcxx_interface)
165 AC_SUBST(libstdcxx_interface)
166
167 # Process the option --with-gxx-include-dir=<path to include-files directory>
168 AC_MSG_CHECKING([for --with-gxx-include-dir])
169 AC_ARG_WITH(gxx-include-dir,
170 [ --with-gxx-include-dir  the installation directory for include files],
171 [case "${withval}" in
172   yes)
173     AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
174     gxx_include_dir=no
175     ;;
176   no)
177     gxx_include_dir=no
178     ;;
179   *)
180     gxx_include_dir=${withval}
181     ;;
182 esac], [gxx_include_dir=no])
183 AC_MSG_RESULT($gxx_include_dir)
184 AC_SUBST(gxx_include_dir)
185 AM_CONDITIONAL(GXX_INCLUDE_DIR, test x${gxx_include_dir} != xno)
186
187 # Process the option "--enable-version-specific-runtime-libs"
188 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
189 AC_ARG_ENABLE(version-specific-runtime-libs,
190 [  --enable-version-specific-runtime-libs    Specify that runtime libraries should be installed in a compiler-specific directory ],
191 [  version_specific_libs=yes
192 # Need the gcc compiler version to know where to install libraries
193 # and header files if --enable-version-specific-runtime-libs option
194 # is selected.
195 changequote(,)dnl
196 gcc_tmp=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $6}'`
197 gcc_num=`echo ${gcc_tmp} | sed 's/\"//g'`
198 #gcc_date=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $7}'`
199 #gcc_version=$gcc_num-$gcc_date
200 gcc_version=$gcc_num
201 changequote([,])dnl
202 AC_SUBST(gcc_version)
203 ],version_specific_libs=no)
204 AC_MSG_RESULT($version_specific_libs)
205 if test x${version_specific_libs} = xyes; then
206   AM_CONDITIONAL(VERSION_SPECIFIC_LIBS, test x${version_specific_libs} = xyes)
207   AC_MSG_WARN(version specific directory is: $gcc_version)
208 fi
209
210
211
212 # Export all the include and flag information to makefiles.
213 GLIBCPP_EXPORT_INCLUDES
214 GLIBCPP_EXPORT_FLAGS
215
216 # This should be done by mkincludedir, but hack around it now.
217 blddir=`pwd`
218 echo "checking for $blddir/include"
219
220 if test ! -d "$blddir/include"; then
221   mkdir "$blddir/include"
222 fi
223
224 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
225 # so that multilib installs will end up installed in the correct
226 # place. To work around this not being passed down from config-ml.in
227 # -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
228 # append it here.
229 AC_OUTPUT(mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile,
230 [if test -n "$CONFIG_FILES"; then
231   ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
232   grep '^MULTISUBDIR =' Makefile >> src/Makefile
233 fi
234 chmod +x mkcheck
235 ],
236 srcdir=${srcdir}
237 host=${host}
238 target=${target}
239 with_multisubdir=${with_multisubdir}
240 ac_configure_args="${multilib_arg} ${ac_configure_args}"
241 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
242 glibcpp_basedir=${glibcpp_basedir}
243 CC="${CC}"
244 CXX="${CXX}"
245 )
246
247
248 # Generate bits/c++config.h
249 # NB: This must be the first generated file as others include it. . .
250 AC_OUTPUT_COMMANDS([$srcdir/mkc++config $blddir $srcdir])
251
252 # Generate bits/std_limits.h and src/limitsMEMBERS.cc
253 if test ! -f stamp-limits; then
254   AC_OUTPUT_COMMANDS([$srcdir/mknumeric_limits $blddir $srcdir $xcompiling])
255   touch stamp-limits
256 fi
257
258
259 # Sanity checking & User-visible messages.
260 # Checks down here, otherwise they get scrolled off before
261 # the user will notice.
262
263 # Trying to get more people to read documentation.  Possibly remove
264 # check and warn all the time. There is no "informational" AC_MSG_
265 # macro, so these are going to be printed even when --quiet/--silent
266 # is given.
267 if test ! -f stamp-sanity-warned; then
268   touch stamp-sanity-warned
269   echo ""
270   echo "Please make certain that you read the installation information here:"
271   echo "  faster => ${srcdir}/docs/install.html"
272   echo "  slower => <URL:http://sources.redhat.com/libstdc++/install.html>"
273   echo ""
274   echo "and the configuration information here:"
275   echo "  faster => ${srcdir}/docs/configopts.html"
276   echo "  slower => <URL:http://sources.redhat.com/libstdc++/configopts.html>"
277   echo ""
278   echo "before proceeding with ${_cv_gnu_make_command}."
279   echo ""
280 fi
281
282