Attempting to build Quake and Doom for ARM. Let's see what happens.
[AROS-Contrib.git] / gc / aclocal.m4
blobc9c981fd737027b47ae33d05fd2be40d44d6cc2c
1 dnl aclocal.m4 generated automatically by aclocal 1.4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 # Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved.
14
15 # THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
16 # OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
17
18 # Permission is hereby granted to use or copy this program
19 # for any purpose,  provided the above notices are retained on all copies.
20 # Permission to modify the code and to distribute modified code is granted,
21 # provided the above notices are retained, and a notice that the code was
22 # modified is included with the above copyright notice.
24 # Original author: Tom Tromey
26 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
27 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
28 # are probably using a cross compiler, which will not be able to fully
29 # link an executable.  This should really be fixed in autoconf
30 # itself.
32 AC_DEFUN(GC_CONFIGURE,
34 dnl Default to --enable-multilib
35 AC_ARG_ENABLE(multilib,
36 [  --enable-multilib       build many library versions (default)],
37 [case "${enableval}" in
38   yes) multilib=yes ;;
39   no)  multilib=no ;;
40   *)   AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
41  esac], [multilib=yes])dnl
43 dnl We may get other options which we don't document:
44 dnl --with-target-subdir, --with-multisrctop, --with-multisubdir
46 dnl I needed to add the -n test to allow configuration in src directory - HB
47 if test "[$]{srcdir}" = "."; then
48   if test "[$]{with_target_subdir}" != "." -a -n "[$]{with_target_subdir}"; then
49     gc_basedir="[$]{srcdir}/[$]{with_multisrctop}../$1"
50   else
51     gc_basedir="[$]{srcdir}/[$]{with_multisrctop}$1"
52   fi
53 else
54   gc_basedir="[$]{srcdir}/$1"
56 AC_SUBST(gc_basedir)
57 AC_CONFIG_AUX_DIR($gc_basedir)
59 AC_CANONICAL_SYSTEM
61 AM_INIT_AUTOMAKE(gc, 6.0, no-define)
63 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
64 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
65 # are probably using a cross compiler, which will not be able to fully
66 # link an executable.  This should really be fixed in autoconf
67 # itself.
69 AC_DEFUN(LIB_AC_PROG_CC,
70 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
71 dnl Fool anybody using AC_PROG_CC.
72 AC_PROVIDE([AC_PROG_CC])
73 AC_CHECK_PROG(CC, gcc, gcc)
74 if test -z "$CC"; then
75   AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
76   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
79 AC_PROG_CC_GNU
81 if test $ac_cv_prog_gcc = yes; then
82   GCC=yes
83 dnl Check whether -g works, even if CFLAGS is set, in case the package
84 dnl plays around with CFLAGS (such as to build both debugging and
85 dnl normal versions of a library), tasteless as that idea is.
86   ac_test_CFLAGS="${CFLAGS+set}"
87   ac_save_CFLAGS="$CFLAGS"
88   CFLAGS=
89   AC_PROG_CC_G
90   if test "$ac_test_CFLAGS" = set; then
91     CFLAGS="$ac_save_CFLAGS"
92   elif test $ac_cv_prog_cc_g = yes; then
93     CFLAGS="-g -O2"
94   else
95     CFLAGS="-O2"
96   fi
97 else
98   GCC=
99   test "${CFLAGS+set}" = set || CFLAGS="-g"
103 LIB_AC_PROG_CC
105 # Likewise for AC_PROG_CXX.
106 AC_DEFUN(LIB_AC_PROG_CXX,
107 [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
108 dnl Fool anybody using AC_PROG_CXX.
109 AC_PROVIDE([AC_PROG_CXX])
110 AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
111 test -z "$CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
113 AC_PROG_CXX_GNU
115 if test $ac_cv_prog_gxx = yes; then
116   GXX=yes
117 dnl Check whether -g works, even if CXXFLAGS is set, in case the package
118 dnl plays around with CXXFLAGS (such as to build both debugging and
119 dnl normal versions of a library), tasteless as that idea is.
120   ac_test_CXXFLAGS="${CXXFLAGS+set}"
121   ac_save_CXXFLAGS="$CXXFLAGS"
122   CXXFLAGS=
123   AC_PROG_CXX_G
124   if test "$ac_test_CXXFLAGS" = set; then
125     CXXFLAGS="$ac_save_CXXFLAGS"
126   elif test $ac_cv_prog_cxx_g = yes; then
127     CXXFLAGS="-g -O2"
128   else
129     CXXFLAGS="-O2"
130   fi
131 else
132   GXX=
133   test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
137 LIB_AC_PROG_CXX
139 # AC_CHECK_TOOL does AC_REQUIRE (AC_CANONICAL_BUILD).  If we don't
140 # run it explicitly here, it will be run implicitly before
141 # NEWLIB_CONFIGURE, which doesn't work because that means that it will
142 # be run before AC_CANONICAL_HOST.
143 AC_CANONICAL_BUILD
145 AC_CHECK_TOOL(AS, as)
146 AC_CHECK_TOOL(AR, ar)
147 AC_CHECK_TOOL(RANLIB, ranlib, :)
149 AC_PROG_INSTALL
151 AM_MAINTAINER_MODE
153 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
154 # at least currently, we never actually build a program, so we never
155 # need to use $(EXEEXT).  Moreover, the test for EXEEXT normally
156 # fails, because we are probably configuring with a cross compiler
157 # which can't create executables.  So we include AC_EXEEXT to keep
158 # automake happy, but we don't execute it, since we don't care about
159 # the result.
160 if false; then
161   # autoconf 2.50 runs AC_EXEEXT by default, and the macro expands
162   # to nothing, so nothing would remain between `then' and `fi' if it
163   # were not for the `:' below.
164   :
165   AC_EXEEXT
168 . [$]{srcdir}/configure.host
170 case [$]{gc_basedir} in
171 /* | [A-Za-z]:[/\\]*) gc_flagbasedir=[$]{gc_basedir} ;;
172 *) gc_flagbasedir='[$](top_builddir)/'[$]{gc_basedir} ;;
173 esac
175 gc_cflags="[$]{gc_cflags} -I"'[$](top_builddir)'"/$1/targ-include -I[$]{gc_flagbasedir}/libc/include"
176 case "${host}" in
177   *-*-cygwin32*)
178     gc_cflags="[$]{gc_cflags} -I[$]{gc_flagbasedir}/../winsup/include"
179     ;;
180 esac
182 dnl gc_cflags="[$]{gc_cflags} -fno-builtin"
184 GC_CFLAGS=${gc_cflags}
185 AC_SUBST(GC_CFLAGS)
188 ))))
190 sinclude(libtool.m4)
191 dnl The line below arranges for aclocal not to bring a definition of
192 dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
193 dnl to add a definition of LIBTOOL to Makefile.in.
194 ifelse(yes,no,[AC_DEFUN([AM_PROG_LIBTOOL],[AC_SUBST(LIBTOOL)])])
196 # Do all the work for Automake.  This macro actually does too much --
197 # some checks are only needed if your package does certain things.
198 # But this isn't really a big deal.
200 # serial 1
202 dnl Usage:
203 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
205 AC_DEFUN(AM_INIT_AUTOMAKE,
206 [AC_REQUIRE([AC_PROG_INSTALL])
207 PACKAGE=[$1]
208 AC_SUBST(PACKAGE)
209 VERSION=[$2]
210 AC_SUBST(VERSION)
211 dnl test to see if srcdir already configured
212 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
213   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
215 ifelse([$3],,
216 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
217 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
218 AC_REQUIRE([AM_SANITY_CHECK])
219 AC_REQUIRE([AC_ARG_PROGRAM])
220 dnl FIXME This is truly gross.
221 missing_dir=`cd $ac_aux_dir && pwd`
222 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
223 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
224 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
225 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
226 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
227 AC_REQUIRE([AC_PROG_MAKE_SET])])
230 # Check to make sure that the build environment is sane.
233 AC_DEFUN(AM_SANITY_CHECK,
234 [AC_MSG_CHECKING([whether build environment is sane])
235 # Just in case
236 sleep 1
237 echo timestamp > conftestfile
238 # Do `set' in a subshell so we don't clobber the current shell's
239 # arguments.  Must try -L first in case configure is actually a
240 # symlink; some systems play weird games with the mod time of symlinks
241 # (eg FreeBSD returns the mod time of the symlink's containing
242 # directory).
243 if (
244    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
245    if test "[$]*" = "X"; then
246       # -L didn't work.
247       set X `ls -t $srcdir/configure conftestfile`
248    fi
249    if test "[$]*" != "X $srcdir/configure conftestfile" \
250       && test "[$]*" != "X conftestfile $srcdir/configure"; then
252       # If neither matched, then we have a broken ls.  This can happen
253       # if, for instance, CONFIG_SHELL is bash and it inherits a
254       # broken ls alias from the environment.  This has actually
255       # happened.  Such a system could not be considered "sane".
256       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
257 alias in your environment])
258    fi
260    test "[$]2" = conftestfile
261    )
262 then
263    # Ok.
264    :
265 else
266    AC_MSG_ERROR([newly created file is older than distributed files!
267 Check your system clock])
269 rm -f conftest*
270 AC_MSG_RESULT(yes)])
272 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
273 dnl The program must properly implement --version.
274 AC_DEFUN(AM_MISSING_PROG,
275 [AC_MSG_CHECKING(for working $2)
276 # Run test in a subshell; some versions of sh will print an error if
277 # an executable is not found, even if stderr is redirected.
278 # Redirect stdin to placate older versions of autoconf.  Sigh.
279 if ($2 --version) < /dev/null > /dev/null 2>&1; then
280    $1=$2
281    AC_MSG_RESULT(found)
282 else
283    $1="$3/missing $2"
284    AC_MSG_RESULT(missing)
286 AC_SUBST($1)])
288 # Add --enable-maintainer-mode option to configure.
289 # From Jim Meyering
291 # serial 1
293 AC_DEFUN(AM_MAINTAINER_MODE,
294 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
295   dnl maintainer-mode is disabled by default
296   AC_ARG_ENABLE(maintainer-mode,
297 [  --enable-maintainer-mode enable make rules and dependencies not useful
298                           (and sometimes confusing) to the casual installer],
299       USE_MAINTAINER_MODE=$enableval,
300       USE_MAINTAINER_MODE=no)
301   AC_MSG_RESULT($USE_MAINTAINER_MODE)
302   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
303   MAINT=$MAINTAINER_MODE_TRUE
304   AC_SUBST(MAINT)dnl
308 # Define a conditional.
310 AC_DEFUN(AM_CONDITIONAL,
311 [AC_SUBST($1_TRUE)
312 AC_SUBST($1_FALSE)
313 if $2; then
314   $1_TRUE=
315   $1_FALSE='#'
316 else
317   $1_TRUE='#'
318   $1_FALSE=
319 fi])