]>
Commit | Line | Data |
---|---|---|
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 | 20 | AC_DEFUN(GC_CONFIGURE, |
1530be84 | 21 | [ |
57b74bf9 | 22 | |
4c7726b1 | 23 | AM_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 | ||
31 | AC_DEFUN(LIB_AC_PROG_CC, | |
32 | [AC_BEFORE([$0], [AC_PROG_CPP])dnl | |
54ce7452 TT |
33 | dnl Fool anybody using AC_PROG_CC. |
34 | AC_PROVIDE([AC_PROG_CC]) | |
1530be84 TT |
35 | AC_CHECK_PROG(CC, gcc, gcc) |
36 | if 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]) | |
39 | fi | |
40 | ||
41 | AC_PROG_CC_GNU | |
42 | ||
43 | if test $ac_cv_prog_gcc = yes; then | |
44 | GCC=yes | |
45 | dnl Check whether -g works, even if CFLAGS is set, in case the package | |
46 | dnl plays around with CFLAGS (such as to build both debugging and | |
47 | dnl 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 | |
59 | else | |
60 | GCC= | |
61 | test "${CFLAGS+set}" = set || CFLAGS="-g" | |
62 | fi | |
63 | ]) | |
64 | ||
65 | LIB_AC_PROG_CC | |
66 | ||
67 | # Likewise for AC_PROG_CXX. | |
68 | AC_DEFUN(LIB_AC_PROG_CXX, | |
69 | [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl | |
54ce7452 TT |
70 | dnl Fool anybody using AC_PROG_CXX. |
71 | AC_PROVIDE([AC_PROG_CXX]) | |
1530be84 TT |
72 | AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc) |
73 | test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH]) | |
74 | ||
75 | AC_PROG_CXX_GNU | |
76 | ||
77 | if test $ac_cv_prog_gxx = yes; then | |
78 | GXX=yes | |
79 | dnl Check whether -g works, even if CXXFLAGS is set, in case the package | |
80 | dnl plays around with CXXFLAGS (such as to build both debugging and | |
81 | dnl 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 | |
93 | else | |
94 | GXX= | |
95 | test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" | |
96 | fi | |
97 | ]) | |
98 | ||
99 | LIB_AC_PROG_CXX | |
100 | ||
1530be84 TT |
101 | AC_CHECK_TOOL(AS, as) |
102 | AC_CHECK_TOOL(AR, ar) | |
103 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
104 | ||
105 | AC_PROG_INSTALL | |
106 | ||
107 | AM_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. | |
116 | if 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 |
122 | fi | |
123 | ||
c3b48847 | 124 | . [$]{srcdir}/configure.host |
1530be84 | 125 | |
5a2586cf TT |
126 | case [$]{gc_basedir} in |
127 | /* | [A-Za-z]:[/\\]*) gc_flagbasedir=[$]{gc_basedir} ;; | |
128 | *) gc_flagbasedir='[$](top_builddir)/'[$]{gc_basedir} ;; | |
1530be84 TT |
129 | esac |
130 | ||
5a2586cf | 131 | gc_cflags="[$]{gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{gc_flagbasedir}/libc/include" |
1530be84 TT |
132 | case "${host}" in |
133 | *-*-cygwin32*) | |
5a2586cf | 134 | gc_cflags="[$]{gc_cflags} -I[$]{gc_flagbasedir}/../winsup/include" |
1530be84 TT |
135 | ;; |
136 | esac | |
137 | ||
5a2586cf | 138 | dnl gc_cflags="[$]{gc_cflags} -fno-builtin" |
1530be84 | 139 | |
5a2586cf TT |
140 | GC_CFLAGS=${gc_cflags} |
141 | AC_SUBST(GC_CFLAGS) | |
1530be84 TT |
142 | ])) |
143 | ||
144 | )))) | |
2f7bf5b7 AO |
145 | |
146 | sinclude(../libtool.m4) | |
147 | dnl The line below arranges for aclocal not to bring a definition of | |
148 | dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake | |
149 | dnl to add a definition of LIBTOOL to Makefile.in. | |
150 | ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])]) |