Welcome to mirror list, hosted at ThFree Co, Russian Federation.

aclocal.m4 « riscv « libgloss - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dbce0d5cf8645911e509d27dd5a3e12c78502330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#=========================================================================
# aclocal.m4 for maven libgloss
#=========================================================================
# We cannot use the normal AC_PROG_CC since that macro will try and do a
# link with the found compiler. Since we don't have all the startup
# files setup yet (that's what we are compiling in libgloss!) we want to
# find a compiler without actually doing a link. So the LIB_AC_PROG_CC
# check is copied from xcc/src/libgloss/acinclude.m4
 
#-------------------------------------------------------------------------
# LIB_AC_PROG_CC_GNU
#-------------------------------------------------------------------------

AC_DEFUN([LIB_AC_PROG_CC_GNU],
[
  AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
  [dnl The semicolon is to pacify NeXT's syntax-checking cpp.

cat > conftest.c <<EOF
#ifdef __GNUC__
  yes;
#endif
EOF

if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
  ac_cv_prog_gcc=yes
else
  ac_cv_prog_gcc=no
fi

  ])
])

#-------------------------------------------------------------------------
# LIB_AC_PROG_CC
#-------------------------------------------------------------------------

AC_DEFUN([LIB_AC_PROG_CC],
[
  AC_BEFORE([$0],[AC_PROG_CPP])dnl
  AC_CHECK_PROG(CC, gcc, gcc)

if test -z "$CC"; then
  AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
fi

LIB_AC_PROG_CC_GNU

if test $ac_cv_prog_gcc = yes; then
  GCC=yes
  dnl Check whether -g works, even if CFLAGS is set, in case the package
  dnl plays around with CFLAGS (such as to build both debugging and
  dnl normal versions of a library), tasteless as that idea is.
  ac_test_CFLAGS="${CFLAGS+set}"
  ac_save_CFLAGS="$CFLAGS"
  CFLAGS=
  _AC_PROG_CC_G
  if test "$ac_test_CFLAGS" = set; then
    CFLAGS="$ac_save_CFLAGS"
  elif test $ac_cv_prog_cc_g = yes; then
    CFLAGS="-g -O2"
  else
    CFLAGS="-O2"
  fi
else
  GCC=
  test "${CFLAGS+set}" = set || CFLAGS="-g"
fi

])