OSDN Git Service

2000-10-17 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_CXX_FLAGS([none])
42
43
44 if test -n "$with_cross_host"; then
45
46   # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
47   # may not work correctly, because the compiler may not be able to
48   # link executables.
49
50   xcompiling=1
51   NATIVE=no
52   # If Canadian cross, then don't pick up tools from the build
53   # directory.
54   if test "$build" != "$with_cross_host"; then
55     CANADIAN=yes
56     NULL_TARGET=yes
57   else
58     CANADIAN=no
59     NULL_TARGET=no
60   fi
61
62   case "$target_alias" in
63     *-wince-*)
64         # Configure for Microsoft Windows CE, or whatever they are
65         # currently calling it.
66         AC_DEFINE(HAVE_FLOAT_H)
67
68         AC_DEFINE(HAVE__FINITE)
69         AC_DEFINE(HAVE__ISNAN)
70         AC_DEFINE(HAVE__COPYSIGN)
71         AC_DEFINE(HAVE__FPCLASS)
72         AC_DEFINE(HAVE_MODF)
73
74         ctype_include_dir="config/os/wince"
75         AC_LINK_FILES($ctype_include_dir/bits/ctype_base.h, bits/ctype_base.h)
76         AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \
77         bits/ctype_inline.h)
78         AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
79         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, bits/ctype_base.h)
98         AC_LINK_FILES($ctype_include_dir/bits/ctype_inline.h, \
99         bits/ctype_inline.h)
100         AC_LINK_FILES($ctype_include_dir/bits/ctype_noninline.h, \
101         bits/ctype_noninline.h)
102
103         AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
104
105         AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
106         AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
107         # need to ceck for faster f versions of math functions, ie sinf?
108         ;;
109   esac
110 else
111
112   # We are being configured natively. We can do more elaborate tests
113   # that include AC_TRY_COMPILE now, as the linker is assumed to be
114   # working.
115
116   xcompiling=0
117   NATIVE=yes
118   CANADIAN=no
119   NULL_TARGET=no
120
121   # Check for available headers.
122   AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
123   machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h])
124
125   GLIBCPP_CHECK_COMPILER_FEATURES
126   GLIBCPP_CHECK_LINKER_FEATURES
127   GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
128   GLIBCPP_CHECK_MATH_SUPPORT
129   GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
130   GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
131   AC_CACHE_SAVE
132   GLIBCPP_CHECK_WCHAR_T_SUPPORT
133   GLIBCPP_CHECK_CTYPE
134
135   AC_FUNC_MMAP
136 fi
137
138 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
139 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
140 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
141 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
142
143 AC_LC_MESSAGES
144
145 if test "${multilib}" = "yes"; then
146   multilib_arg="--enable-multilib"
147 else
148   multilib_arg=
149 fi
150
151
152 # Generate the various Makefiles, include files, and scripts.
153
154 # This helps subvert libstdcxx_interface, as calculated by devo/config.if
155 # Needed so that g++ can find the correct include subdir automatically.
156 INTERFACE=v3
157
158 # Check for the interface version number for specifying where header
159 # files are installed, if a version number is provided.
160 AC_MSG_CHECKING([for interface version number])
161 libstdcxx_interface=$INTERFACE
162 AC_MSG_RESULT($libstdcxx_interface)
163 AC_SUBST(libstdcxx_interface)
164
165 # Process the option --with-gxx-include-dir=<path to include-files directory>
166 AC_MSG_CHECKING([for --with-gxx-include-dir])
167 AC_ARG_WITH(gxx-include-dir,
168 [ --with-gxx-include-dir  the installation directory for include files],
169 [case "${withval}" in
170   yes)
171     AC_MSG_ERROR(Missing directory for --with-gxx-include-dir)
172     gxx_include_dir=no
173     ;;
174   no)
175     gxx_include_dir=no
176     ;;
177   *)
178     gxx_include_dir=${withval}
179     ;;
180 esac], [gxx_include_dir=no])
181 AC_MSG_RESULT($gxx_include_dir)
182 AC_SUBST(gxx_include_dir)
183 AM_CONDITIONAL(GXX_INCLUDE_DIR, test x${gxx_include_dir} != xno)
184
185 # Process the option "--enable-version-specific-runtime-libs"
186 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
187 AC_ARG_ENABLE(version-specific-runtime-libs,
188 [  --enable-version-specific-runtime-libs    Specify that runtime libraries should be installed in a compiler-specific directory ],
189 [  version_specific_libs=yes
190 # Need the gcc compiler version to know where to install libraries
191 # and header files if --enable-version-specific-runtime-libs option
192 # is selected.
193 changequote(,)dnl
194 gcc_tmp=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $6}'`
195 gcc_num=`echo ${gcc_tmp} | sed 's/\"//g'`
196 #gcc_date=`grep version_string ${srcdir}/../gcc/version.c | awk '{print $7}'`
197 #gcc_version=$gcc_num-$gcc_date
198 gcc_version=$gcc_num
199 changequote([,])dnl
200 AC_SUBST(gcc_version)
201 ],version_specific_libs=no)
202 AC_MSG_RESULT($version_specific_libs)
203 if test x${version_specific_libs} = xyes; then
204   AM_CONDITIONAL(VERSION_SPECIFIC_LIBS, test x${version_specific_libs} = xyes)
205   AC_MSG_WARN(version specific directory is: $gcc_version)
206 fi
207
208
209
210 # Export all the include and flag information to makefiles.
211 GLIBCPP_EXPORT_INCLUDES
212 GLIBCPP_EXPORT_FLAGS
213
214 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
215 # so that multilib installs will end up installed in the correct
216 # place. To work around this not being passed down from config-ml.in
217 # -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
218 # append it here.
219 AC_OUTPUT(mkcheck Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile,
220 [if test -n "$CONFIG_FILES"; then
221   ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
222   grep '^MULTISUBDIR =' Makefile >> src/Makefile
223 fi],
224 srcdir=${srcdir}
225 host=${host}
226 target=${target}
227 with_multisubdir=${with_multisubdir}
228 ac_configure_args="${multilib_arg} ${ac_configure_args}"
229 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
230 glibcpp_basedir=${glibcpp_basedir}
231 CC="${CC}"
232 CXX="${CXX}"
233 )
234
235
236 blddir=`pwd`
237 # Generate bits/c++config.h
238 # NB: This must be the first generated file as others include it. . .
239 AC_OUTPUT_COMMANDS([$srcdir/mkc++config $blddir $srcdir])
240
241 # Generate bits/std_limits.h and src/limitsMEMBERS.cc
242 if test ! -f stamp-limits; then
243   AC_OUTPUT_COMMANDS([$srcdir/mknumeric_limits $blddir $srcdir $xcompiling])
244   touch stamp-limits
245 fi
246
247
248 # Sanity checking & User-visible messages.
249 # Checks down here, otherwise they get scrolled off before
250 # the user will notice.
251
252 # Trying to get more people to read documentation.  Possibly remove
253 # check and warn all the time. There is no "informational" AC_MSG_
254 # macro, so these are going to be printed even when --quiet/--silent
255 # is given.
256 if test ! -f stamp-sanity-warned; then
257   touch stamp-sanity-warned
258   echo ""
259   echo "Please make certain that you read the installation information here:"
260   echo "  faster => ${srcdir}/docs/install.html"
261   echo "  slower => <URL:http://sources.redhat.com/libstdc++/install.html>"
262   echo ""
263   echo "and the configuration information here:"
264   echo "  faster => ${srcdir}/docs/configopts.html"
265   echo "  slower => <URL:http://sources.redhat.com/libstdc++/configopts.html>"
266   echo ""
267   echo "before proceeding with ${_cv_gnu_make_command}."
268   echo ""
269 fi
270
271