OSDN Git Service

2000-07-07 Benjamin Kosnik <bkoz@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 AM_CONFIG_HEADER(config.h)
22
23 # Check for c++ or library specific bits that don't require linking.
24 GLIBCPP_CHECK_COMPILER_VERSION
25 GLIBCPP_CHECK_CPU
26
27 # Enable all the crazy c++ stuff.
28 GLIBCPP_ENABLE_DEBUG
29 GLIBCPP_ENABLE_CSTDIO
30 GLIBCPP_ENABLE_LONG_LONG(yes)
31 GLIBCPP_ENABLE_SHADOW(no)
32 GLIBCPP_ENABLE_THREADS
33 #GLIBCPP_ENABLE_RELIBGCC([../..])
34 GLIBCPP_ENABLE_CXX_FLAGS([none])
35
36
37 if test -n "$with_cross_host"; then
38
39   # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
40   # may not work correctly, because the compiler may not be able to
41   # link executables.
42
43   xcompiling=1
44   NATIVE=no
45   # If Canadian cross, then don't pick up tools from the build
46   # directory.
47   if test "$build" != "$with_cross_host"; then
48     CANADIAN=yes
49     NULL_TARGET=yes
50   else
51     CANADIAN=no
52     NULL_TARGET=no
53   fi
54
55   case "$target_alias" in
56     *-wince-*)
57         # Configure for Microsoft Windows CE, or whatever they are
58         # currently calling it.
59         AC_DEFINE(HAVE_FLOAT_H)
60
61         AC_DEFINE(HAVE__FINITE)
62         AC_DEFINE(HAVE__ISNAN)
63         AC_DEFINE(HAVE__COPYSIGN)
64         AC_DEFINE(HAVE__FPCLASS)
65         AC_DEFINE(HAVE_MODF)
66
67         ctype_include_dir="config/wince"
68         AC_SUBST(ctype_include_dir)
69
70         AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
71
72         AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
73         AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
74         ;;
75     *)
76         # We assume newlib.  This lets us hard-code the functions we know
77         # we'll have.
78         AC_DEFINE(HAVE_FINITE)
79         AC_DEFINE(HAVE_ISNAN)
80         AC_DEFINE(HAVE_ISNANF)
81         AC_DEFINE(HAVE_ISINF)
82         AC_DEFINE(HAVE_ISINFF)
83
84         ctype_include_dir="config/newlib"
85         AC_SUBST(ctype_include_dir)
86
87         AC_DEFINE(_GLIBCPP_NEED_MBSTATE_T)
88
89         AC_DEFINE(_GLIBCPP_BUGGY_FLOAT_COMPLEX)
90         AC_DEFINE(_GLIBCPP_BUGGY_COMPLEX)
91         # need to ceck for faster f versions of math functions, ie sinf?
92         ;;
93   esac
94 else
95
96   # We are being configured natively. We can do more elaborate tests
97   # that include AC_TRY_COMPILE now, as the linker is assumed to be
98   # working.
99
100   xcompiling=0
101   NATIVE=yes
102   CANADIAN=no
103   NULL_TARGET=no
104
105   # Check for available headers.
106   AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
107   machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h])
108
109   GLIBCPP_CHECK_COMPILER_FEATURES
110   GLIBCPP_CHECK_LINKER_FEATURES
111   GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
112   GLIBCPP_CHECK_MATH_SUPPORT
113   GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
114   GLIBCPP_CHECK_COMPLEX_MATH_COMPILER_SUPPORT
115   GLIBCPP_CHECK_WCHAR_T_SUPPORT
116   GLIBCPP_CHECK_CTYPE
117
118   AC_FUNC_MMAP
119 fi
120
121 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
122 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
123 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
124 AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host")
125
126 AC_LC_MESSAGES
127
128
129 # Sanity checking & User-visible messages.
130 # Checks down here, otherwise they get scrolled off before
131 # the user will notice.
132 if test "$enable_namespaces" = "yes" && test "$enable_libgcc_rebuild" = "no"
133 then
134   AC_MSG_WARN([libgcc.a will not match mangled symbols unless it is rebuilt])
135 fi
136 if test "$enable_namespaces" = "no" && test "$enable_libgcc_rebuild" != "no"
137 then
138   # Other things besides namespaces can make this true as well, but none
139   # of them are done automatically... yet
140   AC_MSG_WARN([no point in rebuilding libgcc.a if namespaces aren't used])
141 fi
142
143
144 if test "${multilib}" = "yes"; then
145   multilib_arg="--enable-multilib"
146 else
147   multilib_arg=
148 fi
149
150
151 # Generate the various Makefiles, include files, and scripts.
152
153 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
154 # so that multilib installs will end up installed in the correct
155 # place. To work around this not being passed down from config-ml.in
156 # -> top_srcdir/Makefile.am -> top_srcdir/src/Makefile.am, manually
157 # append it here.
158
159 AC_OUTPUT(mkcheck Makefile src/Makefile math/Makefile libio/Makefile,
160 [if test -n "$CONFIG_FILES"; then
161   ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
162   grep '^MULTISUBDIR =' Makefile >> src/Makefile
163 fi],
164 srcdir=${srcdir}
165 host=${host}
166 target=${target}
167 with_multisubdir=${with_multisubdir}
168 ac_configure_args="${multilib_arg} ${ac_configure_args}"
169 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
170 glibcpp_basedir=${glibcpp_basedir}
171 CC="${CC}"
172 CXX="${CXX}"
173 )
174
175
176 blddir=`pwd`
177 # Generate bits/c++config.h
178 # NB: This must be the first generated file as others include it. . .
179 AC_OUTPUT_COMMANDS([$srcdir/mkc++config $blddir $srcdir])
180
181 # Generate bits/std_limits.h and src/limitsMEMBERS.cc
182 AC_OUTPUT_COMMANDS([$srcdir/mknumeric_limits $blddir $srcdir $xcompiling])