1 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
2 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
3 # are probably using a cross compiler, which will not be able to fully
4 # link an executable. This should really be fixed in autoconf
7 AC_DEFUN(BOEHM_CONFIGURE,
9 dnl Default to --enable-multilib
10 AC_ARG_ENABLE(multilib,
11 [ --enable-multilib build many library versions (default)],
12 [case "${enableval}" in
15 *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
16 esac], [multilib=yes])dnl
18 dnl We may get other options which we don't document:
19 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
21 if test "[$]{srcdir}" = "."; then
22 if test "[$]{with_target_subdir}" != "."; then
23 boehm_gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
25 boehm_gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
28 boehm_gc_basedir="[$]{srcdir}/$1"
30 AC_SUBST(boehm_gc_basedir)
34 AM_INIT_AUTOMAKE(boehm-gc, 5.0a4, no-define)
36 # FIXME: We temporarily define our own version of AC_PROG_CC. This is
37 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
38 # are probably using a cross compiler, which will not be able to fully
39 # link an executable. This should really be fixed in autoconf
42 AC_DEFUN(LIB_AC_PROG_CC,
43 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
44 dnl Fool anybody using AC_PROG_CC.
45 AC_PROVIDE([AC_PROG_CC])
46 AC_CHECK_PROG(CC, gcc, gcc)
47 if test -z "$CC"; then
48 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
49 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
54 if test $ac_cv_prog_gcc = yes; then
56 dnl Check whether -g works, even if CFLAGS is set, in case the package
57 dnl plays around with CFLAGS (such as to build both debugging and
58 dnl normal versions of a library), tasteless as that idea is.
59 ac_test_CFLAGS="${CFLAGS+set}"
60 ac_save_CFLAGS="$CFLAGS"
63 if test "$ac_test_CFLAGS" = set; then
64 CFLAGS="$ac_save_CFLAGS"
65 elif test $ac_cv_prog_cc_g = yes; then
72 test "${CFLAGS+set}" = set || CFLAGS="-g"
78 # Likewise for AC_PROG_CXX.
79 AC_DEFUN(LIB_AC_PROG_CXX,
80 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
81 dnl Fool anybody using AC_PROG_CXX.
82 AC_PROVIDE([AC_PROG_CXX])
83 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
84 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
88 if test $ac_cv_prog_gxx = yes; then
90 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
91 dnl plays around with CXXFLAGS (such as to build both debugging and
92 dnl normal versions of a library), tasteless as that idea is.
93 ac_test_CXXFLAGS="${CXXFLAGS+set}"
94 ac_save_CXXFLAGS="$CXXFLAGS"
97 if test "$ac_test_CXXFLAGS" = set; then
98 CXXFLAGS="$ac_save_CXXFLAGS"
99 elif test $ac_cv_prog_cxx_g = yes; then
106 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
112 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD). If we don't
113 # run it explicitly here, it will be run implicitly before
114 # NEWLIB_CONFIGURE, which doesn't work because that means that it will
115 # be run before AC_CANONICAL_HOST.
118 AC_CHECK_TOOL(AS, as)
119 AC_CHECK_TOOL(AR, ar)
120 AC_CHECK_TOOL(RANLIB, ranlib, :)
126 # We need AC_EXEEXT to keep automake happy in cygnus mode. However,
127 # at least currently, we never actually build a program, so we never
128 # need to use $(EXEEXT). Moreover, the test for EXEEXT normally
129 # fails, because we are probably configuring with a cross compiler
130 # which can't create executables. So we include AC_EXEEXT to keep
131 # automake happy, but we don't execute it, since we don't care about
137 . [$]{boehm_gc_basedir}/configure.host
139 case [$]{boehm_gc_basedir} in
140 /* | [A-Za-z]:[/\\]*) boehm_gc_flagbasedir=[$]{boehm_gc_basedir} ;;
141 *) boehm_gc_flagbasedir='[$](top_builddir)/'[$]{boehm_gc_basedir} ;;
144 boehm_gc_cflags="[$]{boehm_gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{boehm_gc_flagbasedir}/libc/include"
147 boehm_gc_cflags="[$]{boehm_gc_cflags} -I[$]{boehm_gc_flagbasedir}/../winsup/include"
151 boehm_gc_cflags="[$]{boehm_gc_cflags} -fno-builtin"
153 BOEHM_GC_CFLAGS=${boehm_gc_cflags}
154 AC_SUBST(BOEHM_GC_CFLAGS)