source: trunk/third/gcc/boehm-gc/acinclude.m4 @ 18474

Revision 18474, 5.7 KB checked in by ghudson, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18473, which included commits to RCS files with non-trunk default branches.
Line 
1# Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved.
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
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
20AC_DEFUN(GC_CONFIGURE,
21[
22dnl Default to --enable-multilib
23AC_ARG_ENABLE(multilib,
24[  --enable-multilib       build many library versions (default)],
25[case "${enableval}" in
26  yes) multilib=yes ;;
27  no)  multilib=no ;;
28  *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
29 esac], [multilib=yes])dnl
30
31dnl We may get other options which we don't document:
32dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
33
34dnl I needed to add the -n test to allow configuration in src directory - HB
35if test "[$]{srcdir}" = "."; then
36  if test "[$]{with_target_subdir}" != "." -a -n "[$]{with_target_subdir}"; then
37    gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
38  else
39    gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
40  fi
41else
42  gc_basedir="[$]{srcdir}/$1"
43fi
44AC_SUBST(gc_basedir)
45AC_CONFIG_AUX_DIR($gc_basedir/..)
46if :; then :; else
47  # This overrides the previous occurrence for automake, but not for
48  # autoconf, which is exactly what we want.
49  AC_CONFIG_AUX_DIR(..)
50fi
51
52AC_CANONICAL_SYSTEM
53
54# This works around an automake problem.
55mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs"
56AC_SUBST(mkinstalldirs)
57
58AM_INIT_AUTOMAKE(gc, 6.1a1, no-define)
59
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
64# itself.
65
66AC_DEFUN(LIB_AC_PROG_CC,
67[AC_BEFORE([$0], [AC_PROG_CPP])dnl
68dnl Fool anybody using AC_PROG_CC.
69AC_PROVIDE([AC_PROG_CC])
70AC_CHECK_PROG(CC, gcc, gcc)
71if 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])
74fi
75
76AC_PROG_CC_GNU
77
78if test $ac_cv_prog_gcc = yes; then
79  GCC=yes
80dnl Check whether -g works, even if CFLAGS is set, in case the package
81dnl plays around with CFLAGS (such as to build both debugging and
82dnl normal versions of a library), tasteless as that idea is.
83  ac_test_CFLAGS="${CFLAGS+set}"
84  ac_save_CFLAGS="$CFLAGS"
85  CFLAGS=
86  AC_PROG_CC_G
87  if test "$ac_test_CFLAGS" = set; then
88    CFLAGS="$ac_save_CFLAGS"
89  elif test $ac_cv_prog_cc_g = yes; then
90    CFLAGS="-g -O2"
91  else
92    CFLAGS="-O2"
93  fi
94else
95  GCC=
96  test "${CFLAGS+set}" = set || CFLAGS="-g"
97fi
98])
99
100LIB_AC_PROG_CC
101
102# Likewise for AC_PROG_CXX.
103AC_DEFUN(LIB_AC_PROG_CXX,
104[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
105dnl Fool anybody using AC_PROG_CXX.
106AC_PROVIDE([AC_PROG_CXX])
107AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
108test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
109
110AC_PROG_CXX_GNU
111
112if test $ac_cv_prog_gxx = yes; then
113  GXX=yes
114dnl Check whether -g works, even if CXXFLAGS is set, in case the package
115dnl plays around with CXXFLAGS (such as to build both debugging and
116dnl normal versions of a library), tasteless as that idea is.
117  ac_test_CXXFLAGS="${CXXFLAGS+set}"
118  ac_save_CXXFLAGS="$CXXFLAGS"
119  CXXFLAGS=
120  AC_PROG_CXX_G
121  if test "$ac_test_CXXFLAGS" = set; then
122    CXXFLAGS="$ac_save_CXXFLAGS"
123  elif test $ac_cv_prog_cxx_g = yes; then
124    CXXFLAGS="-g -O2"
125  else
126    CXXFLAGS="-O2"
127  fi
128else
129  GXX=
130  test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
131fi
132])
133
134LIB_AC_PROG_CXX
135
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.
140AC_CANONICAL_BUILD
141
142AC_CHECK_TOOL(AS, as)
143AC_CHECK_TOOL(AR, ar)
144AC_CHECK_TOOL(RANLIB, ranlib, :)
145
146AC_PROG_INSTALL
147
148AM_MAINTAINER_MODE
149
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
156# the result.
157if false; then
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.
161  :
162  AC_EXEEXT
163fi
164
165. [$]{srcdir}/configure.host
166
167case [$]{gc_basedir} in
168/* | [A-Za-z]:[/\\]*) gc_flagbasedir=[$]{gc_basedir} ;;
169*) gc_flagbasedir='[$](top_builddir)/'[$]{gc_basedir} ;;
170esac
171
172gc_cflags="[$]{gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{gc_flagbasedir}/libc/include"
173case "${host}" in
174  *-*-cygwin32*)
175    gc_cflags="[$]{gc_cflags} -I[$]{gc_flagbasedir}/../winsup/include"
176    ;;
177esac
178
179dnl gc_cflags="[$]{gc_cflags} -fno-builtin"
180
181GC_CFLAGS=${gc_cflags}
182AC_SUBST(GC_CFLAGS)
183]))
184
185))))
186
187sinclude(../libtool.m4)
188dnl The line below arranges for aclocal not to bring a definition of
189dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
190dnl to add a definition of LIBTOOL to Makefile.in.
191ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])
Note: See TracBrowser for help on using the repository browser.