OSDN Git Service

Initial checkin of text Corinna sent to cygwin-announce.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / acinclude.m4
1 dnl This provides configure definitions used by all the winsup
2 dnl configure.in files.
3
4 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
5 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
6 # are probably using a cross compiler, which will not be able to fully
7 # link an executable.  This should really be fixed in autoconf
8 # itself.
9
10 AC_DEFUN([LIB_AC_PROG_CC_GNU],
11 [AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
12 [dnl The semicolon is to pacify NeXT's syntax-checking cpp.
13 cat > conftest.c <<EOF
14 #ifdef __GNUC__
15   yes;
16 #endif
17 EOF
18 if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
19   ac_cv_prog_gcc=yes
20 else
21   ac_cv_prog_gcc=no
22 fi])])
23
24 AC_DEFUN([LIB_AC_PROG_CC],
25 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
26 AC_CHECK_TOOL(CC, gcc, gcc)
27 : ${CC:=gcc}
28 AC_PROG_CC
29 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
30 ])
31
32 AC_DEFUN([LIB_AC_PROG_CXX],
33 [AC_BEFORE([$0], [AC_PROG_CPP])dnl
34 AC_CHECK_TOOL(CXX, g++, g++)
35 if test -z "$CXX"; then
36   AC_CHECK_TOOL(CXX, g++, c++, , , )
37   : ${CXX:=g++}
38   AC_PROG_CXX
39   test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
40 fi
41
42 CXXFLAGS='$(CFLAGS)'
43 ])