| 1 | # FIXME: We temporarily define our own version of AC_PROG_CC. This is
|
|---|
| 2 | # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
|
|---|
| 3 | # are probably using a cross compiler, which will not be able to fully
|
|---|
| 4 | # link an executable. This should really be fixed in autoconf
|
|---|
| 5 | # itself.
|
|---|
| 6 |
|
|---|
| 7 | AC_DEFUN(LIB_AC_PROG_CC,
|
|---|
| 8 | [AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
|---|
| 9 | dnl Fool anybody using AC_PROG_CC.
|
|---|
| 10 | AC_PROVIDE([AC_PROG_CC])
|
|---|
| 11 | AC_CHECK_PROG(CC, gcc, gcc)
|
|---|
| 12 | if test -z "$CC"; then
|
|---|
| 13 | AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
|
|---|
| 14 | test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
|
|---|
| 15 | fi
|
|---|
| 16 |
|
|---|
| 17 | AC_PROG_CC_GNU
|
|---|
| 18 |
|
|---|
| 19 | if test $ac_cv_prog_gcc = yes; then
|
|---|
| 20 | GCC=yes
|
|---|
| 21 | dnl Check whether -g works, even if CFLAGS is set, in case the package
|
|---|
| 22 | dnl plays around with CFLAGS (such as to build both debugging and
|
|---|
| 23 | dnl normal versions of a library), tasteless as that idea is.
|
|---|
| 24 | ac_test_CFLAGS="${CFLAGS+set}"
|
|---|
| 25 | ac_save_CFLAGS="$CFLAGS"
|
|---|
| 26 | CFLAGS=
|
|---|
| 27 | AC_PROG_CC_G
|
|---|
| 28 | if test "$ac_test_CFLAGS" = set; then
|
|---|
| 29 | CFLAGS="$ac_save_CFLAGS"
|
|---|
| 30 | elif test $ac_cv_prog_cc_g = yes; then
|
|---|
| 31 | CFLAGS="-g -O2"
|
|---|
| 32 | else
|
|---|
| 33 | CFLAGS="-O2"
|
|---|
| 34 | fi
|
|---|
| 35 | else
|
|---|
| 36 | GCC=
|
|---|
| 37 | test "${CFLAGS+set}" = set || CFLAGS="-g"
|
|---|
| 38 | fi
|
|---|
| 39 | ])
|
|---|
| 40 |
|
|---|
| 41 | sinclude(../libtool.m4)
|
|---|
| 42 | dnl The lines below arrange for aclocal not to bring libtool.m4
|
|---|
| 43 | dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
|
|---|
| 44 | dnl to add a definition of LIBTOOL to Makefile.in.
|
|---|
| 45 | ifelse(yes,no,[
|
|---|
| 46 | AC_DEFUN([AM_PROG_LIBTOOL],)
|
|---|
| 47 | AC_SUBST(LIBTOOL)
|
|---|
| 48 | ])
|
|---|