1 # Copyright (c) 1999-2001, 2002 by Red Hat, Inc. All rights reserved.
3 # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4 # OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
6 # Permission is hereby granted to use or copy this program
7 # for any purpose, provided the above notices are retained on all copies.
8 # Permission to modify the code and to distribute modified code is granted,
9 # provided the above notices are retained, and a notice that the code was
10 # modified is included with the above copyright notice.
12 # Original author: Tom Tromey
14 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
15 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
16 # are probably using a cross compiler, which will not be able to fully
17 # link an executable. This should really be fixed in autoconf
20 AC_DEFUN(GC_CONFIGURE,
22 dnl Default to --enable-multilib
23 AC_ARG_ENABLE(multilib,
24 [ --enable-multilib build many library versions (default)],
25 [case "${enableval}" in
28 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
29 esac], [multilib=yes])dnl
31 dnl We may get other options which we don't document:
32 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
34 dnl I needed to add the -n test to allow configuration in src directory - HB
35 if test "[$]{srcdir}" = "."; then
36 if test "[$]{with_target_subdir}" != "." -a -n "[$]{with_target_subdir}"; then
37 gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
39 gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
42 gc_basedir="[$]{srcdir}/$1"
45 AC_CONFIG_AUX_DIR($gc_basedir/..)
47 # This overrides the previous occurrence for automake, but not for
48 # autoconf, which is exactly what we want.
54 # This works around an automake problem.
55 mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
56 AC_SUBST(mkinstalldirs)
58 AM_INIT_AUTOMAKE(gc, 6.1a1, no-define)
60 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
61 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
62 # are probably using a cross compiler, which will not be able to fully
63 # link an executable. This should really be fixed in autoconf
66 AC_DEFUN(LIB_AC_PROG_CC,
67 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
68 dnl Fool anybody using AC_PROG_CC.
69 AC_PROVIDE([AC_PROG_CC])
70 AC_CHECK_PROG(CC, gcc, gcc)
71 if test -z "$CC"; then
72 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
73 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
78 if test $ac_cv_prog_gcc = yes; then
80 dnl Check whether -g works, even if CFLAGS is set, in case the package
81 dnl plays around with CFLAGS (such as to build both debugging and
82 dnl normal versions of a library), tasteless as that idea is.
83 ac_test_CFLAGS="${CFLAGS+set}"
84 ac_save_CFLAGS="$CFLAGS"
87 if test "$ac_test_CFLAGS" = set; then
88 CFLAGS="$ac_save_CFLAGS"
89 elif test $ac_cv_prog_cc_g = yes; then
96 test "${CFLAGS+set}" = set || CFLAGS="-g"
102 # Likewise for AC_PROG_CXX.
103 AC_DEFUN(LIB_AC_PROG_CXX,
104 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
105 dnl Fool anybody using AC_PROG_CXX.
106 AC_PROVIDE([AC_PROG_CXX])
107 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
108 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
112 if test $ac_cv_prog_gxx = yes; then
114 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
115 dnl plays around with CXXFLAGS (such as to build both debugging and
116 dnl normal versions of a library), tasteless as that idea is.
117 ac_test_CXXFLAGS="${CXXFLAGS+set}"
118 ac_save_CXXFLAGS="$CXXFLAGS"
121 if test "$ac_test_CXXFLAGS" = set; then
122 CXXFLAGS="$ac_save_CXXFLAGS"
123 elif test $ac_cv_prog_cxx_g = yes; then
130 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
136 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
137 # run it explicitly here, it will be run implicitly before
138 # NEWLIB_CONFIGURE, which doesn't work because that means that it will
139 # be run before AC_CANONICAL_HOST.
142 AC_CHECK_TOOL(AS, as)
143 AC_CHECK_TOOL(AR, ar)
144 AC_CHECK_TOOL(RANLIB, ranlib, :)
150 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
151 # at least currently, we never actually build a program, so we never
152 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
153 # fails, because we are probably configuring with a cross compiler
154 # which can't create executables. So we include AC_EXEEXT to keep
155 # automake happy, but we don't execute it, since we don't care about
158 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
159 # to nothing, so nothing would remain between `then' and `fi' if it
160 # were not for the `:' below.
165 . [$]{srcdir}/configure.host
167 case [$]{gc_basedir} in
168 /* | [A-Za-z]:[/\\]*) gc_flagbasedir=[$]{gc_basedir} ;;
169 *) gc_flagbasedir='[$](top_builddir)/'[$]{gc_basedir} ;;
172 gc_cflags="[$]{gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{gc_flagbasedir}/libc/include"
175 gc_cflags="[$]{gc_cflags} -I[$]{gc_flagbasedir}/../winsup/include"
179 dnl gc_cflags="[$]{gc_cflags} -fno-builtin"
181 GC_CFLAGS=${gc_cflags}
187 sinclude(../libtool.m4)
188 dnl The line below arranges for aclocal not to bring a definition of
189 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
190 dnl to add a definition of LIBTOOL to Makefile.in.
191 ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])