OSDN Git Service

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