OSDN Git Service

* configure.in: Update local install.html, configopts.html paths.
[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/ios.cc)
6
7 PACKAGE=libstdc++
8 AC_SUBST(PACKAGE)
9 # For typical GNU versioning info, format is MAJOR.MINOR.MICRO
10 release_VERSION=3.1.0
11 AC_SUBST(release_VERSION)
12 # For libtool versioning info, format is CURRENT:REVISION:AGE
13 libtool_VERSION=4:0:0
14 AC_SUBST(libtool_VERSION)
15
16 # Gets build, host, target, *_vendor, *_cpu, *_os, etc.
17 # AC 2.5x sets target_alias iff the user specified --target, but we use it
18 # everywhere, so we set it here just to be sure.  In AC 2.13
19 # AC_CANONICAL_TARGET was known as AC_CANONICAL_SYSTEM.
20 AC_CANONICAL_SYSTEM
21 target_alias=${target_alias-$target}
22 AC_SUBST(target_alias)
23
24 AM_INIT_AUTOMAKE($PACKAGE, $release_VERSION)
25 AM_CONFIG_HEADER(config.h)
26
27 # Runs configure.host and configure.target, as well as finds CC, CXX
28 # and assorted other critical bits.  Have to run this before the
29 # GLIBCPP_ENABLE_* macros below.
30 GLIBCPP_CONFIGURE(.)
31
32 AC_LIBTOOL_DLOPEN
33 AM_PROG_LIBTOOL
34 AC_SUBST(enable_shared)
35 AC_SUBST(enable_static)
36
37 # Check for c++ or library specific bits that don't require linking.
38 #GLIBCPP_CHECK_COMPILER_VERSION
39 GLIBCPP_CHECK_GNU_MAKE
40
41 # Enable all the variable C++ stuff.  C_MBCHAR must come early.
42 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
43 GLIBCPP_ENABLE_CSTDIO
44 GLIBCPP_ENABLE_CLOCALE
45 GLIBCPP_ENABLE_C_MBCHAR([yes])
46 GLIBCPP_ENABLE_C99([yes])
47 GLIBCPP_ENABLE_LONG_LONG([yes])
48 GLIBCPP_ENABLE_CHEADERS([c_std])
49 GLIBCPP_ENABLE_THREADS
50 GLIBCPP_ENABLE_CXX_FLAGS([none])
51 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
52 GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
53 GLIBCPP_ENABLE_CONCEPT_CHECKS
54
55
56 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
57
58   # This lets us hard-code the functionality we know
59   # we'll have in the cross target environment. "Let" is a
60   # sugar-coated word placed on an especially dull and tedious hack, actually.
61   # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
62   # that involve linking can't be used:
63   # "cannot open sim-crt0.o"
64   # "cannot open crt0.o"
65   # etc. All this is because there currently exists no unified,
66   # consistent way for top level CC information to be passed down
67   # to target directories: newlib includes, newlib linking info,
68   # libgloss versus newlib crt0.o, etc. When all of this is done, all
69   # of this hokey, excessive AC_DEFINE junk for crosses can be removed.
70
71   # We are being configured with some form of cross compiler.
72   GLIBCPP_IS_CROSS_COMPILING=1
73
74   # If Canadian cross, then don't pick up tools from the build
75   # directory.
76   if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
77     CANADIAN=yes
78   else
79     CANADIAN=no
80   fi
81
82   # Construct crosses by hand, eliminating bits that need ld...
83   # GLIBCPP_CHECK_COMPILER_FEATURES
84   # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
85   # GLIBCPP_CHECK_MATH_SUPPORT
86
87   case "$target_alias" in
88     *-linux*)
89       # Check for available headers.
90       AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
91         machine/endian.h machine/param.h sys/machine.h sys/types.h \
92         fp.h locale.h float.h inttypes.h])
93       SECTION_FLAGS='-ffunction-sections -fdata-sections'
94       AC_SUBST(SECTION_FLAGS)
95       GLIBCPP_CHECK_LINKER_FEATURES
96       GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
97       GLIBCPP_CHECK_WCHAR_T_SUPPORT
98       os_include_dir="config/os/gnu-linux"
99       AC_DEFINE(HAVE_COPYSIGN)
100       AC_DEFINE(HAVE_COPYSIGNF)
101       AC_DEFINE(HAVE_FINITEF)
102       AC_DEFINE(HAVE_FREXPF)
103       AC_DEFINE(HAVE_HYPOTF)
104       AC_DEFINE(HAVE_SINCOS)
105       AC_DEFINE(HAVE_SINCOSF)
106       if test x"long_double_math_on_this_cpu" = x"yes"; then
107         AC_DEFINE(HAVE_HYPOTL)
108       fi
109       ;;
110     *-hpux*)
111       # Check for available headers.
112       AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
113         machine/endian.h machine/param.h sys/machine.h sys/types.h \
114         fp.h locale.h float.h inttypes.h])
115       SECTION_FLAGS='-ffunction-sections -fdata-sections'
116       AC_SUBST(SECTION_FLAGS)
117       GLIBCPP_CHECK_LINKER_FEATURES
118       GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
119       GLIBCPP_CHECK_WCHAR_T_SUPPORT
120       os_include_dir="config/os/hpux"
121       AC_DEFINE(HAVE_COPYSIGN)
122       AC_DEFINE(HAVE_COPYSIGNF)
123       AC_DEFINE(HAVE_FINITEF)
124       AC_DEFINE(HAVE_FREXPF)
125       AC_DEFINE(HAVE_HYPOT)
126       AC_DEFINE(HAVE_SINCOS)
127       AC_DEFINE(HAVE_SINCOSF)
128       ;;
129     *-netbsd*)
130       # Check for available headers.
131       AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
132         machine/endian.h machine/param.h sys/machine.h sys/types.h \
133         fp.h locale.h float.h inttypes.h])
134       SECTION_FLAGS='-ffunction-sections -fdata-sections'
135       AC_SUBST(SECTION_FLAGS) 
136       GLIBCPP_CHECK_LINKER_FEATURES
137       GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
138       GLIBCPP_CHECK_WCHAR_T_SUPPORT
139       os_include_dir="config/os/bsd/netbsd"
140       AC_DEFINE(HAVE_COPYSIGN)
141       AC_DEFINE(HAVE_COPYSIGNF)
142       AC_DEFINE(HAVE_FINITEF)
143       AC_DEFINE(HAVE_FREXPF)
144       AC_DEFINE(HAVE_HYPOTF)
145       ;;
146     *-mingw32*)
147       AC_CHECK_HEADERS([sys/types.h locale.h float.h])
148       GLIBCPP_CHECK_LINKER_FEATURES
149       GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
150       GLIBCPP_CHECK_WCHAR_T_SUPPORT
151       os_include_dir="config/os/mingw32"
152       ;;
153     *)
154       os_include_dir="config/os/newlib"
155       AC_DEFINE(HAVE_HYPOT)
156       ;;
157   esac
158
159   case "$target_alias" in
160     *-mingw32*)
161       ;;
162     *)
163       # GLIBCPP_CHECK_STDLIB_SUPPORT
164       AC_DEFINE(HAVE_STRTOF)        
165       AC_DEFINE(HAVE_STRTOLD)        
166       # AC_FUNC_MMAP
167       AC_DEFINE(HAVE_MMAP)
168
169       AC_DEFINE(HAVE_ACOSF)
170       AC_DEFINE(HAVE_ASINF)
171       AC_DEFINE(HAVE_ATAN2F)
172       AC_DEFINE(HAVE_ATANF)
173       AC_DEFINE(HAVE_CEILF)
174       AC_DEFINE(HAVE_COPYSIGN)
175       AC_DEFINE(HAVE_COPYSIGNF)
176       AC_DEFINE(HAVE_COSF)
177       AC_DEFINE(HAVE_COSHF)
178       AC_DEFINE(HAVE_EXPF)
179       AC_DEFINE(HAVE_FABSF)
180       AC_DEFINE(HAVE_FINITE)
181       AC_DEFINE(HAVE_FINITEF)
182       AC_DEFINE(HAVE_FLOORF)
183       AC_DEFINE(HAVE_FMODF)
184       AC_DEFINE(HAVE_FREXPF)
185       AC_DEFINE(HAVE_ISINF)
186       AC_DEFINE(HAVE_ISINFF)
187       AC_DEFINE(HAVE_ISNAN)
188       AC_DEFINE(HAVE_ISNANF)
189       AC_DEFINE(HAVE_LDEXPF)
190       AC_DEFINE(HAVE_LOG10F)
191       AC_DEFINE(HAVE_LOGF)
192       AC_DEFINE(HAVE_MODFF)
193       AC_DEFINE(HAVE_POWF)
194       AC_DEFINE(HAVE_SINF)
195       AC_DEFINE(HAVE_SINHF)
196       AC_DEFINE(HAVE_SQRTF)
197       AC_DEFINE(HAVE_TANF)
198       AC_DEFINE(HAVE_TANHF)
199       ;;
200   esac
201
202   # At some point, we should differentiate between architectures
203   # like x86, which have long double versions, and alpha/powerpc/etc.,
204   # which don't. For the time being, punt.
205   if test x"long_double_math_on_this_cpu" = x"yes"; then
206     AC_DEFINE(HAVE_ACOSL)
207     AC_DEFINE(HAVE_ASINL)
208     AC_DEFINE(HAVE_ATAN2L)
209     AC_DEFINE(HAVE_ATANL)
210     AC_DEFINE(HAVE_CEILL)
211     AC_DEFINE(HAVE_COPYSIGNL)
212     AC_DEFINE(HAVE_COSL)
213     AC_DEFINE(HAVE_COSHL)
214     AC_DEFINE(HAVE_EXPL)
215     AC_DEFINE(HAVE_FABSL)
216     AC_DEFINE(HAVE_FINITEL)
217     AC_DEFINE(HAVE_FLOORL)
218     AC_DEFINE(HAVE_FMODL)
219     AC_DEFINE(HAVE_FREXPL)
220     AC_DEFINE(HAVE_ISINFL)
221     AC_DEFINE(HAVE_ISNANL)
222     AC_DEFINE(HAVE_LDEXPL)
223     AC_DEFINE(HAVE_LOG10L)
224     AC_DEFINE(HAVE_LOGL)
225     AC_DEFINE(HAVE_MODFL)
226     AC_DEFINE(HAVE_POWL)
227     AC_DEFINE(HAVE_SINCOSL)
228     AC_DEFINE(HAVE_SINL)
229     AC_DEFINE(HAVE_SINHL)
230     AC_DEFINE(HAVE_SQRTL)
231     AC_DEFINE(HAVE_TANL)
232     AC_DEFINE(HAVE_TANHL)
233   fi
234 else
235
236   # We are being configured natively. We can do more elaborate tests
237   # that include AC_TRY_COMPILE now, as the linker is assumed to be
238   # working.
239   GLIBCPP_IS_CROSS_COMPILING=0
240   CANADIAN=no
241
242   # Check for available headers.
243   AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
244   machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h])
245
246   GLIBCPP_CHECK_COMPILER_FEATURES
247   GLIBCPP_CHECK_LINKER_FEATURES
248   GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
249   GLIBCPP_CHECK_MATH_SUPPORT
250   GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
251   GLIBCPP_CHECK_WCHAR_T_SUPPORT
252   GLIBCPP_CHECK_STDLIB_SUPPORT
253   AC_LC_MESSAGES
254
255   AC_TRY_COMPILE([
256   #include <setjmp.h>
257   ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
258   [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.  ])
259   ])
260
261   AC_FUNC_MMAP
262
263   # Establish limits on memory usage during 'make check'
264   GLIBCPP_CONFIGURE_TESTSUITE
265 fi
266
267 # This depends on the possibly-skipped linker test above.
268 GLIBCPP_ENABLE_SYMVERS([yes])
269
270 # Propagate the target-specific source directories through the build chain.
271 OS_INC_SRCDIR=$os_include_dir/bits
272 ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
273 CPU_LIMITS_INC_SRCDIR=$CPULIMITSH/bits
274 AC_SUBST(OS_INC_SRCDIR)
275 AC_SUBST(ATOMICITY_INC_SRCDIR)
276 AC_SUBST(CPU_LIMITS_INC_SRCDIR)
277
278 # Set up cross-compile flags
279 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
280 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
281  
282 AC_CACHE_SAVE
283
284 if test "${multilib}" = "yes"; then
285   multilib_arg="--enable-multilib"
286 else
287   multilib_arg=
288 fi
289
290 # Needed so that g++ can find the correct include subdir automatically.
291 INTERFACE=v3
292
293 # Export all the install information
294 GLIBCPP_EXPORT_INSTALL_INFO
295
296 # Export all the include and flag information to makefiles.
297 GLIBCPP_EXPORT_INCLUDES
298 GLIBCPP_EXPORT_FLAGS
299
300 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
301    grep "enable shared" > /dev/null; then
302   LIBSUPCXX_PICFLAGS=-prefer-pic
303 else
304   LIBSUPCXX_PICFLAGS=
305 fi
306 AC_SUBST(LIBSUPCXX_PICFLAGS)
307
308 # Generate the various Makefiles, include files, and scripts.
309 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
310 # and libsupc++/Makefile.am so that multilib installs will end up
311 # installed in the correct place. To work around this not being passed
312 # down from config-ml.in -> top_srcdir/Makefile.am ->
313 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
314 AC_OUTPUT(Makefile \
315     include/Makefile src/Makefile \
316     libmath/Makefile libio/Makefile libsupc++/Makefile \
317     po/Makefile testsuite/Makefile mkcheck testsuite_flags,
318 [if test -n "$CONFIG_FILES"; then
319   ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
320   grep '^MULTISUBDIR =' Makefile >> src/Makefile
321   grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
322 fi
323 chmod +x mkcheck
324 chmod +x testsuite_flags
325 ],
326 srcdir=${srcdir}
327 host=${host}
328 target=${target}
329 with_multisubdir=${with_multisubdir}
330 ac_configure_args="${multilib_arg} ${ac_configure_args}"
331 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
332 glibcpp_basedir=${glibcpp_basedir}
333 CC="${CC}"
334 CXX="${CXX}"
335 )
336 dnl  In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
337 dnl  AC_CONFIG_FILES(Makefile \
338 dnl      include/Makefile src/Makefile \
339 dnl      libmath/Makefile libio/Makefile libsupc++/Makefile \
340 dnl      po/Makefile testsuite/Makefile mkcheck testsuite_flags)
341 dnl  AC_CONFIG_COMMANDS([default],
342 dnl  [if test -n "$CONFIG_FILES"; then
343 dnl    ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
344 dnl    grep '^MULTISUBDIR =' Makefile >> src/Makefile
345 dnl    grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
346 dnl  fi
347 dnl  chmod +x mkcheck
348 dnl  chmod +x testsuite_flags
349 dnl  ],
350 dnl  srcdir=${srcdir}
351 dnl  host=${host}
352 dnl  target=${target}
353 dnl  with_multisubdir=${with_multisubdir}
354 dnl  ac_configure_args="${multilib_arg} ${ac_configure_args}"
355 dnl  CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
356 dnl  glibcpp_basedir=${glibcpp_basedir}
357 dnl  CC="${CC}"
358 dnl  CXX="${CXX}"
359 dnl  )
360 dnl  AC_OUTPUT
361
362
363 # Sanity checking & User-visible messages.
364 # Checks down here, otherwise they get scrolled off before
365 # the user will notice.
366
367 # Trying to get more people to read documentation.  Possibly remove
368 # check and warn all the time. There is no "informational" AC_MSG_
369 # macro, so these are going to be printed even when --quiet/--silent
370 # is given.
371 if test ! -f stamp-sanity-warned; then
372   touch stamp-sanity-warned
373   echo ""
374   echo "Please make certain that you read the installation information here:"
375   echo "  faster => ${srcdir}/docs/html/install.html"
376   echo "  slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
377   echo ""
378   echo "and the configuration information here:"
379   echo "  faster => ${srcdir}/docs/html/configopts.html"
380   echo "  slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
381   echo ""
382   echo "before proceeding with ${_cv_gnu_make_command}."
383   echo ""
384 fi