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_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 |
---|
11 | #ifdef __GNUC__ |
---|
12 | yes; |
---|
13 | #endif |
---|
14 | EOF |
---|
15 | if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then |
---|
16 | ac_cv_prog_gcc=yes |
---|
17 | else |
---|
18 | ac_cv_prog_gcc=no |
---|
19 | fi])]) |
---|
20 | |
---|
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)]) |
---|
28 | ]) |
---|
29 | |
---|
30 | AC_DEFUN([LIB_AC_PROG_CC], |
---|
31 | [AC_BEFORE([$0], [AC_PROG_CPP])dnl |
---|
32 | AC_CHECK_PROG(CC, gcc, gcc) |
---|
33 | _AM_DEPENDENCIES(CC) |
---|
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]) |
---|
37 | fi |
---|
38 | |
---|
39 | LIB_AC_PROG_CC_GNU |
---|
40 | |
---|
41 | if test $ac_cv_prog_gcc = yes; then |
---|
42 | GCC=yes |
---|
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" |
---|
48 | CFLAGS= |
---|
49 | _AC_PROG_CC_G |
---|
50 | if test "$ac_test_CFLAGS" = set; then |
---|
51 | CFLAGS="$ac_save_CFLAGS" |
---|
52 | elif test $ac_cv_prog_cc_g = yes; then |
---|
53 | CFLAGS="-g -O2" |
---|
54 | else |
---|
55 | CFLAGS="-O2" |
---|
56 | fi |
---|
57 | else |
---|
58 | GCC= |
---|
59 | test "${CFLAGS+set}" = set || CFLAGS="-g" |
---|
60 | fi |
---|
61 | ]) |
---|
62 | |
---|