| 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 |  | 
|---|
| 20 | AC_DEFUN(GC_CONFIGURE, | 
|---|
| 21 | [ | 
|---|
| 22 | dnl Default to --enable-multilib | 
|---|
| 23 | AC_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 |  | 
|---|
| 31 | dnl We may get other options which we don't document: | 
|---|
| 32 | dnl --with-target-subdir, --with-multisrctop, --with-multisubdir | 
|---|
| 33 |  | 
|---|
| 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" | 
|---|
| 38 | else | 
|---|
| 39 | gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1" | 
|---|
| 40 | fi | 
|---|
| 41 | else | 
|---|
| 42 | gc_basedir="[$]{srcdir}/$1" | 
|---|
| 43 | fi | 
|---|
| 44 | AC_SUBST(gc_basedir) | 
|---|
| 45 | AC_CONFIG_AUX_DIR($gc_basedir/..) | 
|---|
| 46 | if :; 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(..) | 
|---|
| 50 | fi | 
|---|
| 51 |  | 
|---|
| 52 | AC_CANONICAL_SYSTEM | 
|---|
| 53 |  | 
|---|
| 54 | # This works around an automake problem. | 
|---|
| 55 | mkinstalldirs="`cd $ac_aux_dir && pwd`/mkinstalldirs" | 
|---|
| 56 | AC_SUBST(mkinstalldirs) | 
|---|
| 57 |  | 
|---|
| 58 | AM_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 |  | 
|---|
| 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]) | 
|---|
| 74 | fi | 
|---|
| 75 |  | 
|---|
| 76 | AC_PROG_CC_GNU | 
|---|
| 77 |  | 
|---|
| 78 | if test $ac_cv_prog_gcc = yes; then | 
|---|
| 79 | GCC=yes | 
|---|
| 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" | 
|---|
| 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 | 
|---|
| 94 | else | 
|---|
| 95 | GCC= | 
|---|
| 96 | test "${CFLAGS+set}" = set || CFLAGS="-g" | 
|---|
| 97 | fi | 
|---|
| 98 | ]) | 
|---|
| 99 |  | 
|---|
| 100 | LIB_AC_PROG_CC | 
|---|
| 101 |  | 
|---|
| 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]) | 
|---|
| 109 |  | 
|---|
| 110 | AC_PROG_CXX_GNU | 
|---|
| 111 |  | 
|---|
| 112 | if test $ac_cv_prog_gxx = yes; then | 
|---|
| 113 | GXX=yes | 
|---|
| 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" | 
|---|
| 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 | 
|---|
| 128 | else | 
|---|
| 129 | GXX= | 
|---|
| 130 | test "${CXXFLAGS+set}" = set || CXXFLAGS="-g" | 
|---|
| 131 | fi | 
|---|
| 132 | ]) | 
|---|
| 133 |  | 
|---|
| 134 | LIB_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. | 
|---|
| 140 | AC_CANONICAL_BUILD | 
|---|
| 141 |  | 
|---|
| 142 | AC_CHECK_TOOL(AS, as) | 
|---|
| 143 | AC_CHECK_TOOL(AR, ar) | 
|---|
| 144 | AC_CHECK_TOOL(RANLIB, ranlib, :) | 
|---|
| 145 |  | 
|---|
| 146 | AC_PROG_INSTALL | 
|---|
| 147 |  | 
|---|
| 148 | AM_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. | 
|---|
| 157 | if 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 | 
|---|
| 163 | fi | 
|---|
| 164 |  | 
|---|
| 165 | . [$]{srcdir}/configure.host | 
|---|
| 166 |  | 
|---|
| 167 | case [$]{gc_basedir} in | 
|---|
| 168 | /* | [A-Za-z]:[/\\]*) gc_flagbasedir=[$]{gc_basedir} ;; | 
|---|
| 169 | *) gc_flagbasedir='[$](top_builddir)/'[$]{gc_basedir} ;; | 
|---|
| 170 | esac | 
|---|
| 171 |  | 
|---|
| 172 | gc_cflags="[$]{gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{gc_flagbasedir}/libc/include" | 
|---|
| 173 | case "${host}" in | 
|---|
| 174 | *-*-cygwin32*) | 
|---|
| 175 | gc_cflags="[$]{gc_cflags} -I[$]{gc_flagbasedir}/../winsup/include" | 
|---|
| 176 | ;; | 
|---|
| 177 | esac | 
|---|
| 178 |  | 
|---|
| 179 | dnl gc_cflags="[$]{gc_cflags} -fno-builtin" | 
|---|
| 180 |  | 
|---|
| 181 | GC_CFLAGS=${gc_cflags} | 
|---|
| 182 | AC_SUBST(GC_CFLAGS) | 
|---|
| 183 | ])) | 
|---|
| 184 |  | 
|---|
| 185 | )))) | 
|---|
| 186 |  | 
|---|
| 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)])]) | 
|---|