]> git.ipfire.org Git - thirdparty/gcc.git/blame - boehm-gc/acinclude.m4
acinclude.m4: Remove bogus duplicate call to AC_CANONICAL_BUILD.
[thirdparty/gcc.git] / boehm-gc / acinclude.m4
CommitLineData
1e6347d8 1# Copyright (c) 1999-2001, 2002 by Red Hat, Inc. All rights reserved.
5a2586cf
TT
2#
3# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4# OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
5#
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.
11#
12# Original author: Tom Tromey
13
1530be84
TT
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
18# itself.
19
5a2586cf 20AC_DEFUN(GC_CONFIGURE,
1530be84 21[
57b74bf9 22
4c7726b1 23AM_INIT_AUTOMAKE(gc, 6.1a1, no-define)
1530be84
TT
24
25# FIXME: We temporarily define our own version of AC_PROG_CC. This is
26# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
27# are probably using a cross compiler, which will not be able to fully
28# link an executable. This should really be fixed in autoconf
29# itself.
30
31AC_DEFUN(LIB_AC_PROG_CC,
32[AC_BEFORE([$0], [AC_PROG_CPP])dnl
54ce7452
TT
33dnl Fool anybody using AC_PROG_CC.
34AC_PROVIDE([AC_PROG_CC])
1530be84
TT
35AC_CHECK_PROG(CC, gcc, gcc)
36if test -z "$CC"; then
37 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
38 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
39fi
40
41AC_PROG_CC_GNU
42
43if test $ac_cv_prog_gcc = yes; then
44 GCC=yes
45dnl Check whether -g works, even if CFLAGS is set, in case the package
46dnl plays around with CFLAGS (such as to build both debugging and
47dnl normal versions of a library), tasteless as that idea is.
48 ac_test_CFLAGS="${CFLAGS+set}"
49 ac_save_CFLAGS="$CFLAGS"
50 CFLAGS=
51 AC_PROG_CC_G
52 if test "$ac_test_CFLAGS" = set; then
53 CFLAGS="$ac_save_CFLAGS"
54 elif test $ac_cv_prog_cc_g = yes; then
55 CFLAGS="-g -O2"
56 else
57 CFLAGS="-O2"
58 fi
59else
60 GCC=
61 test "${CFLAGS+set}" = set || CFLAGS="-g"
62fi
63])
64
65LIB_AC_PROG_CC
66
67# Likewise for AC_PROG_CXX.
68AC_DEFUN(LIB_AC_PROG_CXX,
69[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
54ce7452
TT
70dnl Fool anybody using AC_PROG_CXX.
71AC_PROVIDE([AC_PROG_CXX])
1530be84
TT
72AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
73test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
74
75AC_PROG_CXX_GNU
76
77if test $ac_cv_prog_gxx = yes; then
78 GXX=yes
79dnl Check whether -g works, even if CXXFLAGS is set, in case the package
80dnl plays around with CXXFLAGS (such as to build both debugging and
81dnl normal versions of a library), tasteless as that idea is.
82 ac_test_CXXFLAGS="${CXXFLAGS+set}"
83 ac_save_CXXFLAGS="$CXXFLAGS"
84 CXXFLAGS=
85 AC_PROG_CXX_G
86 if test "$ac_test_CXXFLAGS" = set; then
87 CXXFLAGS="$ac_save_CXXFLAGS"
88 elif test $ac_cv_prog_cxx_g = yes; then
89 CXXFLAGS="-g -O2"
90 else
91 CXXFLAGS="-O2"
92 fi
93else
94 GXX=
95 test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
96fi
97])
98
99LIB_AC_PROG_CXX
100
1530be84
TT
101AC_CHECK_TOOL(AS, as)
102AC_CHECK_TOOL(AR, ar)
103AC_CHECK_TOOL(RANLIB, ranlib, :)
104
105AC_PROG_INSTALL
106
107AM_MAINTAINER_MODE
108
109# We need AC_EXEEXT to keep automake happy in cygnus mode. However,
110# at least currently, we never actually build a program, so we never
111# need to use $(EXEEXT). Moreover, the test for EXEEXT normally
112# fails, because we are probably configuring with a cross compiler
113# which can't create executables. So we include AC_EXEEXT to keep
114# automake happy, but we don't execute it, since we don't care about
115# the result.
116if false; then
01ef8751
AO
117 # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
118 # to nothing, so nothing would remain between `then' and `fi' if it
119 # were not for the `:' below.
120 :
1530be84
TT
121 AC_EXEEXT
122fi
123
c3b48847 124. [$]{srcdir}/configure.host
1530be84 125
5a2586cf
TT
126case [$]{gc_basedir} in
127/* | [A-Za-z]:[/\\]*) gc_flagbasedir=[$]{gc_basedir} ;;
128*) gc_flagbasedir='[$](top_builddir)/'[$]{gc_basedir} ;;
1530be84
TT
129esac
130
5a2586cf 131gc_cflags="[$]{gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{gc_flagbasedir}/libc/include"
1530be84
TT
132case "${host}" in
133 *-*-cygwin32*)
5a2586cf 134 gc_cflags="[$]{gc_cflags} -I[$]{gc_flagbasedir}/../winsup/include"
1530be84
TT
135 ;;
136esac
137
5a2586cf 138dnl gc_cflags="[$]{gc_cflags} -fno-builtin"
1530be84 139
5a2586cf
TT
140GC_CFLAGS=${gc_cflags}
141AC_SUBST(GC_CFLAGS)
1530be84
TT
142]))
143
144))))
2f7bf5b7
AO
145
146sinclude(../libtool.m4)
147dnl The line below arranges for aclocal not to bring a definition of
148dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
149dnl to add a definition of LIBTOOL to Makefile.in.
150ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])