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
7 AC_DEFUN([LIB_AC_PROG_CC_GNU],
8 [AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
9 [dnl The semicolon is to pacify NeXT's syntax-checking cpp.
10 cat > conftest.c <<EOF
15 if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
21 AC_DEFUN([LIB_AM_PROG_AS],
22 [# By default we simply use the C compiler to build assembly code.
23 AC_REQUIRE([LIB_AC_PROG_CC])
24 test "${CCAS+set}" = set || CCAS=$CC
25 test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
26 AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)])
27 AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
30 AC_DEFUN([LIB_AC_PROG_CC],
31 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
32 AC_CHECK_PROG(CC, gcc, gcc)
34 if test -z "$CC"; then
35 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
36 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
41 if test $ac_cv_prog_gcc = yes; then
43 dnl Check whether -g works, even if CFLAGS is set, in case the package
44 dnl plays around with CFLAGS (such as to build both debugging and
45 dnl normal versions of a library), tasteless as that idea is.
46 ac_test_CFLAGS="${CFLAGS+set}"
47 ac_save_CFLAGS="$CFLAGS"
50 if test "$ac_test_CFLAGS" = set; then
51 CFLAGS="$ac_save_CFLAGS"
52 elif test $ac_cv_prog_cc_g = yes; then
59 test "${CFLAGS+set}" = set || CFLAGS="-g"