1dnl Process this file with autoconf to produce a configure script.
2AC_PREREQ(2.5)dnl
3AC_INIT(crt0.s)
4
5AC_CANONICAL_SYSTEM
6AC_ARG_PROGRAM
7
8if test "$srcdir" = "." ; then
9  mdir=`echo "${with_multisubdir}/" \
10    | sed -e 's,\([[^/]][[^/]]*\),..,g' -e 's,^/$,,'`
11  AC_CONFIG_AUX_DIR(${mdir}../../..)
12else
13  AC_CONFIG_AUX_DIR(${srcdir}/../..)
14fi
15
16AC_PROG_INSTALL
17
18# FIXME: We temporarily define our own version of AC_PROG_CC.  This is
19# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
20# are probably using a cross compiler, which will not be able to fully
21# link an executable.  This should really be fixed in autoconf
22# itself.
23
24AC_DEFUN(LIB_AC_PROG_CC,
25[AC_BEFORE([$0], [AC_PROG_CPP])dnl
26AC_CHECK_PROG(CC, gcc, gcc)
27if test -z "$CC"; then
28  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
29  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
30fi
31
32AC_PROG_CC_GNU
33
34if test $ac_cv_prog_gcc = yes; then
35  GCC=yes
36dnl Check whether -g works, even if CFLAGS is set, in case the package
37dnl plays around with CFLAGS (such as to build both debugging and
38dnl normal versions of a library), tasteless as that idea is.
39  ac_test_CFLAGS="${CFLAGS+set}"
40  ac_save_CFLAGS="$CFLAGS"
41  CFLAGS=
42  AC_PROG_CC_G
43  if test "$ac_test_CFLAGS" = set; then
44    CFLAGS="$ac_save_CFLAGS"
45  elif test $ac_cv_prog_cc_g = yes; then
46    CFLAGS="-g -O2"
47  else
48    CFLAGS="-O2"
49  fi
50else
51  GCC=
52  test "${CFLAGS+set}" = set || CFLAGS="-g"
53fi
54])
55
56LIB_AC_PROG_CC
57AS=${AS-as}
58AC_SUBST(AS)
59AR=${AR-ar}
60AC_SUBST(AR)
61LD=${LD-ld}
62AC_SUBST(LD)
63AC_PROG_RANLIB
64
65host_makefile_frag=${srcdir}/../config/default.mh
66
67dnl We have to assign the same value to other variables because autoconf
68dnl doesn't provide a mechanism to substitute a replacement keyword with
69dnl arbitrary data or pathnames.
70dnl
71host_makefile_frag_path=$host_makefile_frag
72AC_SUBST(host_makefile_frag_path)
73AC_SUBST_FILE(host_makefile_frag)
74
75AC_OUTPUT(Makefile)
76