home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
gnu
/
lib
/
autoconf
/
acspecific.m4
< prev
next >
Wrap
M4 Source File
|
1994-12-22
|
59KB
|
1,971 lines
dnl Macros that test for specific features.
dnl This file is part of Autoconf.
dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
dnl
dnl As a special exception, the Free Software Foundation gives unlimited
dnl permission to copy, distribute and modify the configure scripts that
dnl are the output of Autoconf. You need not follow the terms of the GNU
dnl General Public License when using or distributing such scripts, even
dnl though portions of the text of Autoconf appear in them. The GNU
dnl General Public License (GPL) does govern all other use of the material
dnl that constitutes the Autoconf program.
dnl
dnl Certain portions of the Autoconf source text are designed to be copied
dnl (in certain cases, depending on the input) into the output of
dnl Autoconf. We call these the "data" portions. The rest of the Autoconf
dnl source text consists of comments plus executable code that decides which
dnl of the data portions to output in any given case. We call these
dnl comments and executable code the "non-data" portions. Autoconf never
dnl copies any of the non-data portions into its output.
dnl
dnl This special exception to the GPL applies to versions of Autoconf
dnl released by the Free Software Foundation. When you make and
dnl distribute a modified version of Autoconf, you may extend this special
dnl exception to the GPL to apply to your modified version as well, *unless*
dnl your modified version has the potential to copy into its output some
dnl of the text that was the non-data portion of the version that you started
dnl with. (In other words, unless your change moves or copies text from
dnl the non-data portions to the data portions.) If your modification has
dnl such potential, you must delete any notice of this special exception
dnl to the GPL from your modified version.
dnl
dnl Written by David MacKenzie, with help from
dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
dnl ### Checks for programs
dnl Check whether to use -n, \c, or newline-tab to separate
dnl checking messages from result messages.
dnl Idea borrowed from dist 3.0.
dnl Internal use only.
AC_DEFUN(AC_PROG_ECHO_N,
[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
ac_n= ac_c='
' ac_t=' '
else
ac_n=-n ac_c= ac_t=
fi
else
ac_n= ac_c='\c' ac_t=
fi
])
AC_DEFUN(AC_PROG_CC,
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
AC_CHECK_PROG(CC, gcc, gcc, cc)
AC_MSG_CHECKING(whether we are using GNU C)
AC_CACHE_VAL(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 ${CC-cc} -E conftest.c 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
fi])dnl
AC_MSG_RESULT($ac_cv_prog_gcc)
if test $ac_cv_prog_gcc = yes; then
GCC=yes
if test "${CFLAGS+set}" != set; then
AC_MSG_CHECKING(whether ${CC-cc} accepts -g)
AC_CACHE_VAL(ac_cv_prog_gcc_g,
[echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
ac_cv_prog_gcc_g=yes
else
ac_cv_prog_gcc_g=no
fi
rm -f conftest*
])dnl
AC_MSG_RESULT($ac_cv_prog_gcc_g)
if test $ac_cv_prog_gcc_g = yes; then
# Amiga hack - suppress automatically using -g for now
# Also default to using -O2
CFLAGS="-O2"
else
CFLAGS="-O2"
fi
fi
else
GCC=
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
])
AC_DEFUN(AC_PROG_CXX,
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc)
AC_MSG_CHECKING(whether we are using GNU C++)
AC_CACHE_VAL(ac_cv_prog_gxx,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
cat > conftest.C <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
if ${CXX-g++} -E conftest.C 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
fi])dnl
AC_MSG_RESULT($ac_cv_prog_gxx)
if test $ac_cv_prog_gxx = yes; then
GXX=yes
if test "${CXXFLAGS+set}" != set; then
AC_MSG_CHECKING(whether ${CXX-g++} accepts -g)
AC_CACHE_VAL(ac_cv_prog_gxx_g,
[echo 'void f(){}' > conftest.cc
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
ac_cv_prog_gxx_g=yes
else
ac_cv_prog_gxx_g=no
fi
rm -f conftest*
])dnl
AC_MSG_RESULT($ac_cv_prog_gxx_g)
if test $ac_cv_prog_gxx_g = yes; then
# Amiga hack - suppress automatically using -g for now
# Also default to using -O2
CXXFLAGS="-O2"
else
CXXFLAGS="-O2"
fi
fi
else
GXX=
test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
fi
])
AC_DEFUN(AC_PROG_GCC_TRADITIONAL,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
if test $ac_cv_prog_gcc = yes; then
AC_MSG_CHECKING(whether ${CC-cc} needs -traditional)
AC_CACHE_VAL(ac_cv_prog_gcc_traditional,
[ ac_pattern="Autoconf.*'x'"
AC_EGREP_CPP($ac_pattern, [#include <sgtty.h>
Autoconf TIOCGETP],
ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no)
if test $ac_cv_prog_gcc_traditional = no; then
AC_EGREP_CPP($ac_pattern, [#include <termio.h>
Autoconf TCGETA],
ac_cv_prog_gcc_traditional=yes)
fi])dnl
AC_MSG_RESULT($ac_cv_prog_gcc_traditional)
if test $ac_cv_prog_gcc_traditional = yes; then
CC="$CC -traditional"
fi
fi
])
AC_DEFUN(AC_PROG_CC_C_O,
[if test "x$CC" != xcc; then
AC_MSG_CHECKING(whether $CC and cc understand -c and -o together)
else
AC_MSG_CHECKING(whether cc understands -c and -o together)
fi
set dummy $CC; ac_cc=[$]2
AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
[eval ac_cv_prog_cc_${ac_cc}_c_o=no
echo 'foo(){}' > conftest.c
# Make sure it works both with $CC and with simple cc.
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
if ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC &&
test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC
then
if test "x$CC" != xcc; then
# Test first that cc exists at all.
if cc -c conftest.c 1>&AC_FD_CC 2>&AC_FD_CC
then
if cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC &&
test -f conftest2.o && cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
fi
fi
fi
fi
rm -f conftest*
])dnl
if eval "test \"`/bin/echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_DEFINE(NO_MINUS_C_MINUS_O)
fi
])
dnl Define SET_MAKE to set ${MAKE} if make doesn't.
AC_DEFUN(AC_PROG_MAKE_SET,
[AC_MSG_CHECKING(whether ${MAKE-make} sets \$MAKE)
set dummy ${MAKE-make}; ac_make=[$]2
AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set,
[cat > conftestmake <<\EOF
all:
@/bin/echo 'ac_maketemp="${MAKE}"'
EOF
changequote(, )dnl
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
changequote([, ])dnl
if test -n "$ac_maketemp"; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
fi
rm -f conftestmake])dnl
if eval "test \"`/bin/echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
AC_MSG_RESULT(yes)
SET_MAKE=
else
AC_MSG_RESULT(no)
SET_MAKE="MAKE=${MAKE-make}"
fi
AC_SUBST([SET_MAKE])dnl
])
AC_DEFUN(AC_PROG_RANLIB,
[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])
dnl Check for mawk first since it's