1993-10-16 06:51:22 +08:00
|
|
|
dnl Macros that test for specific features.
|
|
|
|
dnl This file is part of Autoconf.
|
1995-02-07 13:23:22 +08:00
|
|
|
dnl Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
1993-10-16 06:51:22 +08:00
|
|
|
dnl
|
1994-10-19 08:30:26 +08:00
|
|
|
dnl This program is free software; you can redistribute it and/or modify
|
1993-10-16 06:51:22 +08:00
|
|
|
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
|
1994-10-19 08:30:26 +08:00
|
|
|
dnl This program is distributed in the hope that it will be useful,
|
1993-10-16 06:51:22 +08:00
|
|
|
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
|
1994-10-19 08:30:26 +08:00
|
|
|
dnl along with this program; if not, write to the Free Software
|
1993-10-16 06:51:22 +08:00
|
|
|
dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
dnl
|
1994-10-19 00:52:41 +08:00
|
|
|
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
|
1994-10-19 08:30:26 +08:00
|
|
|
dnl exception to the GPL to apply to your modified version as well, *unless*
|
1994-10-19 00:52:41 +08:00
|
|
|
dnl your modified version has the potential to copy into its output some
|
1994-10-19 13:42:23 +08:00
|
|
|
dnl of the text that was the non-data portion of the version that you started
|
1994-10-19 00:52:41 +08:00
|
|
|
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.
|
1994-09-28 06:05:22 +08:00
|
|
|
dnl
|
1993-10-16 06:51:22 +08:00
|
|
|
dnl Written by David MacKenzie, with help from
|
|
|
|
dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
|
1994-10-27 06:42:11 +08:00
|
|
|
dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
|
1994-09-01 12:59:32 +08:00
|
|
|
|
|
|
|
|
1994-05-08 10:29:55 +08:00
|
|
|
dnl ### Checks for programs
|
1994-09-01 12:59:32 +08:00
|
|
|
|
|
|
|
|
1994-08-11 07:54:30 +08:00
|
|
|
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.
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_ECHO_N,
|
|
|
|
[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
|
1994-08-24 14:41:01 +08:00
|
|
|
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
|
1994-08-26 09:15:45 +08:00
|
|
|
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
|
1994-08-11 07:54:30 +08:00
|
|
|
ac_n= ac_c='
|
|
|
|
' ac_t=' '
|
|
|
|
else
|
|
|
|
ac_n=-n ac_c= ac_t=
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
ac_n= ac_c='\c' ac_t=
|
1994-08-13 10:19:11 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_CC,
|
1994-05-06 19:57:01 +08:00
|
|
|
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_CHECK_PROG(CC, gcc, gcc, cc)
|
1994-06-23 02:22:34 +08:00
|
|
|
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_CHECKING(whether we are using GNU C)
|
1994-06-23 02:22:34 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_prog_gcc,
|
1994-10-18 12:19:58 +08:00
|
|
|
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
|
|
|
|
cat > conftest.c <<EOF
|
1993-10-16 06:51:22 +08:00
|
|
|
#ifdef __GNUC__
|
1994-10-18 12:19:58 +08:00
|
|
|
yes;
|
1993-10-16 06:51:22 +08:00
|
|
|
#endif
|
|
|
|
EOF
|
1994-08-23 23:04:53 +08:00
|
|
|
if ${CC-cc} -E conftest.c 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then
|
1994-06-23 02:22:34 +08:00
|
|
|
ac_cv_prog_gcc=yes
|
1994-05-05 20:48:28 +08:00
|
|
|
else
|
1994-06-23 02:22:34 +08:00
|
|
|
ac_cv_prog_gcc=no
|
|
|
|
fi])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_prog_gcc)
|
1994-08-27 06:27:25 +08:00
|
|
|
if test $ac_cv_prog_gcc = yes; then
|
|
|
|
GCC=yes
|
1994-09-07 11:06:34 +08:00
|
|
|
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
|
|
|
|
CFLAGS="-g -O"
|
|
|
|
else
|
|
|
|
CFLAGS="-O"
|
|
|
|
fi
|
|
|
|
fi
|
1994-08-27 06:27:25 +08:00
|
|
|
else
|
|
|
|
GCC=
|
1994-09-07 11:06:34 +08:00
|
|
|
test "${CFLAGS+set}" = set || CFLAGS="-g"
|
1994-08-27 06:27:25 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_CXX,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
|
|
|
|
AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc)
|
1994-06-23 02:22:34 +08:00
|
|
|
|
1994-11-04 03:52:24 +08:00
|
|
|
AC_MSG_CHECKING(whether we are using GNU C++)
|
1994-06-23 02:22:34 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_prog_gxx,
|
1994-11-04 03:52:24 +08:00
|
|
|
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
|
|
|
|
cat > conftest.C <<EOF
|
1994-03-20 05:49:18 +08:00
|
|
|
#ifdef __GNUC__
|
1994-11-04 03:52:24 +08:00
|
|
|
yes;
|
1994-03-20 05:49:18 +08:00
|
|
|
#endif
|
|
|
|
EOF
|
1994-11-04 03:52:24 +08:00
|
|
|
if ${CXX-g++} -E conftest.C 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then
|
1994-06-23 02:22:34 +08:00
|
|
|
ac_cv_prog_gxx=yes
|
1994-05-05 20:48:28 +08:00
|
|
|
else
|
1994-06-23 02:22:34 +08:00
|
|
|
ac_cv_prog_gxx=no
|
|
|
|
fi])dnl
|
1994-11-04 03:52:24 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_prog_gxx)
|
1994-08-27 06:27:25 +08:00
|
|
|
if test $ac_cv_prog_gxx = yes; then
|
|
|
|
GXX=yes
|
1994-09-07 11:06:34 +08:00
|
|
|
if test "${CXXFLAGS+set}" != set; then
|
1994-11-04 03:52:24 +08:00
|
|
|
AC_MSG_CHECKING(whether ${CXX-g++} accepts -g)
|
1994-09-07 11:06:34 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_prog_gxx_g,
|
|
|
|
[echo 'void f(){}' > conftest.cc
|
1994-11-04 03:52:24 +08:00
|
|
|
if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
|
1994-09-07 11:06:34 +08:00
|
|
|
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
|
|
|
|
CXXFLAGS="-g -O"
|
|
|
|
else
|
|
|
|
CXXFLAGS="-O"
|
|
|
|
fi
|
|
|
|
fi
|
1994-08-27 06:27:25 +08:00
|
|
|
else
|
|
|
|
GXX=
|
1994-09-07 11:06:34 +08:00
|
|
|
test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
|
1994-08-27 06:27:25 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_GCC_TRADITIONAL,
|
1994-05-06 19:57:01 +08:00
|
|
|
[AC_REQUIRE([AC_PROG_CC])dnl
|
|
|
|
AC_REQUIRE([AC_PROG_CPP])dnl
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_prog_gcc = yes; then
|
1994-09-07 11:06:34 +08:00
|
|
|
AC_MSG_CHECKING(whether ${CC-cc} needs -traditional)
|
1994-06-23 02:22:34 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_prog_gcc_traditional,
|
|
|
|
[ ac_pattern="Autoconf.*'x'"
|
1994-08-24 14:41:01 +08:00
|
|
|
AC_EGREP_CPP($ac_pattern, [#include <sgtty.h>
|
|
|
|
Autoconf TIOCGETP],
|
1994-06-23 02:22:34 +08:00
|
|
|
ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no)
|
1993-10-16 06:51:22 +08:00
|
|
|
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_prog_gcc_traditional = no; then
|
1994-08-24 14:41:01 +08:00
|
|
|
AC_EGREP_CPP($ac_pattern, [#include <termio.h>
|
|
|
|
Autoconf TCGETA],
|
|
|
|
ac_cv_prog_gcc_traditional=yes)
|
1994-06-23 02:22:34 +08:00
|
|
|
fi])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_prog_gcc_traditional)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_prog_gcc_traditional = yes; then
|
1994-05-04 22:44:23 +08:00
|
|
|
CC="$CC -traditional"
|
|
|
|
fi
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_CC_C_O,
|
1994-05-25 09:21:46 +08:00
|
|
|
[if test "x$CC" != xcc; then
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING(whether $CC and cc understand -c and -o together)
|
1994-05-25 09:21:46 +08:00
|
|
|
else
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING(whether cc understands -c and -o together)
|
1994-05-25 09:21:46 +08:00
|
|
|
fi
|
1994-07-19 22:44:16 +08:00
|
|
|
set dummy $CC; ac_cc=[$]2
|
|
|
|
AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
|
1994-07-20 06:14:03 +08:00
|
|
|
[eval ac_cv_prog_cc_${ac_cc}_c_o=no
|
1993-10-16 06:51:22 +08:00
|
|
|
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.
|
1994-08-23 23:04:53 +08:00
|
|
|
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
|
1993-10-16 06:51:22 +08:00
|
|
|
then
|
1994-05-25 09:21:46 +08:00
|
|
|
if test "x$CC" != xcc; then
|
|
|
|
# Test first that cc exists at all.
|
1994-08-23 23:04:53 +08:00
|
|
|
if cc -c conftest.c 1>&AC_FD_CC 2>&AC_FD_CC
|
1993-10-16 06:51:22 +08:00
|
|
|
then
|
1994-08-23 23:04:53 +08:00
|
|
|
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
|
1994-05-25 09:21:46 +08:00
|
|
|
then
|
1994-07-20 06:14:03 +08:00
|
|
|
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
|
1994-05-25 09:21:46 +08:00
|
|
|
fi
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
rm -f conftest*
|
|
|
|
])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_DEFINE(NO_MINUS_C_MINUS_O)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-03-27 06:34:32 +08:00
|
|
|
dnl Define SET_MAKE to set ${MAKE} if make doesn't.
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_MAKE_SET,
|
1994-11-08 07:17:49 +08:00
|
|
|
[AC_MSG_CHECKING(whether ${MAKE-make} sets \$\{MAKE\})
|
1994-07-19 22:44:16 +08:00
|
|
|
set dummy ${MAKE-make}; ac_make=[$]2
|
|
|
|
AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set,
|
1994-08-11 00:47:42 +08:00
|
|
|
[cat > conftestmake <<\EOF
|
1994-03-27 06:34:32 +08:00
|
|
|
all:
|
|
|
|
@echo 'ac_maketemp="${MAKE}"'
|
|
|
|
EOF
|
1994-08-01 21:44:22 +08:00
|
|
|
changequote(, )dnl
|
1994-03-27 06:34:32 +08:00
|
|
|
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
|
1994-04-14 10:59:11 +08:00
|
|
|
eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
|
1994-08-01 21:44:22 +08:00
|
|
|
changequote([, ])dnl
|
1994-05-04 22:44:23 +08:00
|
|
|
if test -n "$ac_maketemp"; then
|
1994-07-20 06:14:03 +08:00
|
|
|
eval ac_cv_prog_make_${ac_make}_set=yes
|
1994-07-19 22:44:16 +08:00
|
|
|
else
|
1994-07-20 06:14:03 +08:00
|
|
|
eval ac_cv_prog_make_${ac_make}_set=no
|
1994-07-19 22:44:16 +08:00
|
|
|
fi
|
|
|
|
rm -f conftestmake])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
1994-05-04 22:44:23 +08:00
|
|
|
SET_MAKE=
|
|
|
|
else
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1994-05-04 22:44:23 +08:00
|
|
|
SET_MAKE="MAKE=${MAKE-make}"
|
|
|
|
fi
|
1994-03-27 06:34:32 +08:00
|
|
|
AC_SUBST([SET_MAKE])dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_RANLIB,
|
1994-09-01 12:59:32 +08:00
|
|
|
[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])
|
|
|
|
|
1994-09-06 04:12:21 +08:00
|
|
|
dnl Check for mawk first since it's said to be faster.
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_AWK,
|
1994-09-01 12:59:32 +08:00
|
|
|
[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_YACC,
|
1994-09-01 12:59:32 +08:00
|
|
|
[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_CPP,
|
|
|
|
[AC_MSG_CHECKING(how to run the C preprocessor)
|
1994-08-26 12:59:56 +08:00
|
|
|
# On Suns, sometimes $CPP names a directory.
|
|
|
|
if test -n "$CPP" && test -d "$CPP"; then
|
|
|
|
CPP=
|
|
|
|
fi
|
1993-10-16 06:51:22 +08:00
|
|
|
if test -z "$CPP"; then
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_prog_CPP,
|
|
|
|
[ # This must be in double quotes, not single quotes, because CPP may get
|
|
|
|
# substituted into the Makefile and "${CC-cc}" will confuse make.
|
1993-10-16 06:51:22 +08:00
|
|
|
CPP="${CC-cc} -E"
|
1994-07-19 22:44:16 +08:00
|
|
|
# On the NeXT, cc -E runs the code through the compiler's parser,
|
|
|
|
# not just through cpp.
|
1994-10-18 06:27:03 +08:00
|
|
|
dnl Use a header file that comes with gcc, so configuring glibc
|
|
|
|
dnl with a fresh cross-compiler works.
|
|
|
|
AC_TRY_CPP([#include <assert.h>
|
1993-12-07 12:40:53 +08:00
|
|
|
Syntax Error], ,
|
|
|
|
CPP="${CC-cc} -E -traditional-cpp"
|
1994-10-18 06:27:03 +08:00
|
|
|
AC_TRY_CPP([#include <assert.h>
|
1994-08-01 21:44:22 +08:00
|
|
|
Syntax Error], , CPP=/lib/cpp))
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_prog_CPP="$CPP"])dnl
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-07-19 22:44:16 +08:00
|
|
|
CPP="$ac_cv_prog_CPP"
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($CPP)
|
1993-10-16 06:51:22 +08:00
|
|
|
AC_SUBST(CPP)dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_CXXCPP,
|
|
|
|
[AC_MSG_CHECKING(how to run the C++ preprocessor)
|
1994-03-20 05:49:18 +08:00
|
|
|
if test -z "$CXXCPP"; then
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_prog_CXXCPP,
|
|
|
|
[AC_LANG_SAVE[]dnl
|
|
|
|
AC_LANG_CPLUSPLUS[]dnl
|
1994-11-04 03:52:24 +08:00
|
|
|
CXXCPP="${CXX-g++} -E"
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_prog_CXXCPP="$CXXCPP"
|
1994-03-20 05:49:18 +08:00
|
|
|
AC_LANG_RESTORE[]dnl
|
1994-07-19 22:44:16 +08:00
|
|
|
fi])dnl
|
|
|
|
CXXCPP="$ac_cv_prog_CXXCPP"
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($CXXCPP)
|
1994-03-20 05:49:18 +08:00
|
|
|
AC_SUBST(CXXCPP)dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-03-20 05:49:18 +08:00
|
|
|
dnl Require finding the C or C++ preprocessor, whichever is the
|
|
|
|
dnl current language.
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_REQUIRE_CPP,
|
1994-09-01 12:59:32 +08:00
|
|
|
[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_LEX,
|
|
|
|
[AC_CHECK_PROG(LEX, flex, flex, lex)
|
1993-10-16 06:51:22 +08:00
|
|
|
if test -z "$LEXLIB"
|
|
|
|
then
|
|
|
|
case "$LEX" in
|
1994-10-23 10:08:04 +08:00
|
|
|
flex*) ac_lib=fl ;;
|
|
|
|
*) ac_lib=l ;;
|
1993-10-16 06:51:22 +08:00
|
|
|
esac
|
1994-10-23 10:08:04 +08:00
|
|
|
AC_CHECK_LIB($ac_lib, main, LEXLIB="-l$ac_lib")
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
AC_SUBST(LEXLIB)])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_DECL_YYTEXT,
|
1994-07-19 22:44:16 +08:00
|
|
|
[AC_REQUIRE_CPP()dnl
|
1994-05-06 19:57:01 +08:00
|
|
|
AC_REQUIRE([AC_PROG_LEX])dnl
|
1995-02-07 07:31:34 +08:00
|
|
|
AC_MSG_CHECKING(whether yytext is a pointer)
|
1994-07-20 06:14:03 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer,
|
1994-07-19 22:44:16 +08:00
|
|
|
[# POSIX says lex can declare yytext either as a pointer or an array; the
|
1994-04-21 01:17:01 +08:00
|
|
|
# default is implementation-dependent. Figure out which it is, since
|
|
|
|
# not all implementations provide the %pointer and %array declarations.
|
|
|
|
#
|
|
|
|
# The minimal lex program is just a single line: %%. But some broken lexes
|
|
|
|
# (Solaris, I think it was) want two %% lines, so accommodate them.
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_prog_lex_yytext_pointer=no
|
1993-10-16 06:51:22 +08:00
|
|
|
echo '%%
|
1994-09-13 23:20:48 +08:00
|
|
|
%%' | $LEX
|
1994-04-21 01:17:01 +08:00
|
|
|
if test -f lex.yy.c; then
|
|
|
|
LEX_OUTPUT_ROOT=lex.yy
|
|
|
|
elif test -f lexyy.c; then
|
|
|
|
LEX_OUTPUT_ROOT=lexyy
|
|
|
|
else
|
1995-02-07 07:31:34 +08:00
|
|
|
AC_MSG_ERROR([cannot find output from $LEX, giving up])
|
1994-04-21 01:17:01 +08:00
|
|
|
fi
|
1995-02-07 07:31:34 +08:00
|
|
|
echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_save_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS $LEXLIB"
|
1995-02-07 07:31:34 +08:00
|
|
|
AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, , ac_cv_prog_lex_yytext_pointer=yes)
|
1994-07-19 22:44:16 +08:00
|
|
|
LIBS="$ac_save_LIBS"
|
|
|
|
rm -f "${LEX_OUTPUT_ROOT}.c"])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_prog_lex_yytext_pointer)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_prog_lex_yytext_pointer = yes; then
|
|
|
|
AC_DEFINE(YYTEXT_POINTER)
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-03-18 16:00:54 +08:00
|
|
|
AC_SUBST(LEX_OUTPUT_ROOT)dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_INSTALL,
|
1994-06-23 02:22:34 +08:00
|
|
|
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
|
1994-09-07 11:06:34 +08:00
|
|
|
# Find a good install program. We prefer a C program (faster),
|
|
|
|
# so one script is as good as another. But avoid the broken or
|
|
|
|
# incompatible versions:
|
1994-08-23 14:01:14 +08:00
|
|
|
# SysV /etc/install, /usr/sbin/install
|
|
|
|
# SunOS /usr/etc/install
|
|
|
|
# IRIX /sbin/install
|
|
|
|
# AIX /bin/install
|
|
|
|
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
|
|
|
|
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
|
|
|
|
# ./install, which can be erroneously created by make from ./install.sh.
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING(for a BSD compatible install)
|
1994-09-13 23:20:48 +08:00
|
|
|
if test -z "$INSTALL"; then
|
1994-06-23 02:22:34 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_path_install,
|
1994-05-06 19:17:47 +08:00
|
|
|
[ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
1994-03-18 16:00:54 +08:00
|
|
|
for ac_dir in $PATH; do
|
|
|
|
case "$ac_dir" in
|
1994-08-23 14:01:14 +08:00
|
|
|
''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;;
|
1993-10-16 06:51:22 +08:00
|
|
|
*)
|
1994-09-07 23:07:09 +08:00
|
|
|
# OSF1 and SCO ODT 3.0 have their own names for install.
|
1994-09-07 11:06:34 +08:00
|
|
|
for ac_prog in ginstall installbsd scoinst install; do
|
1994-03-27 06:34:32 +08:00
|
|
|
if test -f $ac_dir/$ac_prog; then
|
1994-04-19 10:24:21 +08:00
|
|
|
if test $ac_prog = install &&
|
|
|
|
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
|
|
|
|
# AIX install. It has an incompatible calling convention.
|
|
|
|
# OSF/1 installbsd also uses dspmsg, but is usable.
|
|
|
|
:
|
1994-03-27 06:34:32 +08:00
|
|
|
else
|
1994-06-23 02:22:34 +08:00
|
|
|
ac_cv_path_install="$ac_dir/$ac_prog -c"
|
1994-03-27 06:34:32 +08:00
|
|
|
break 2
|
|
|
|
fi
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-03-27 06:34:32 +08:00
|
|
|
done
|
1993-10-16 06:51:22 +08:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
1994-03-18 16:00:54 +08:00
|
|
|
IFS="$ac_save_ifs"
|
1994-05-06 13:30:23 +08:00
|
|
|
# As a last resort, use the slow shell script.
|
1994-06-23 02:22:34 +08:00
|
|
|
test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"])dnl
|
|
|
|
INSTALL="$ac_cv_path_install"
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-08-25 11:45:07 +08:00
|
|
|
dnl We do special magic for INSTALL instead of AC_SUBST, to get
|
|
|
|
dnl relative paths right.
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($INSTALL)
|
1994-05-05 06:03:43 +08:00
|
|
|
|
1994-05-18 03:25:23 +08:00
|
|
|
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
|
1994-04-06 00:51:31 +08:00
|
|
|
# It thinks the first close brace ends the variable substitution.
|
|
|
|
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
|
1993-10-16 06:51:22 +08:00
|
|
|
AC_SUBST(INSTALL_PROGRAM)dnl
|
1994-05-05 06:03:43 +08:00
|
|
|
|
|
|
|
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
|
1993-10-16 06:51:22 +08:00
|
|
|
AC_SUBST(INSTALL_DATA)dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PROG_LN_S,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING(whether ln -s works)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_prog_LN_S,
|
|
|
|
[rm -f conftestdata
|
1993-10-16 06:51:22 +08:00
|
|
|
if ln -s X conftestdata 2>/dev/null
|
|
|
|
then
|
|
|
|
rm -f conftestdata
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_prog_LN_S="ln -s"
|
|
|
|
else
|
|
|
|
ac_cv_prog_LN_S=ln
|
|
|
|
fi])dnl
|
|
|
|
LN_S="$ac_cv_prog_LN_S"
|
|
|
|
if test "$ac_cv_prog_LN_S" = "ln -s"; then
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
1993-10-16 06:51:22 +08:00
|
|
|
else
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_SUBST(LN_S)dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-09-28 06:05:22 +08:00
|
|
|
define(AC_RSH,
|
1994-08-29 07:50:02 +08:00
|
|
|
[errprint(__file__:__line__: [$0] has been removed; replace it with equivalent code
|
1994-09-01 12:59:32 +08:00
|
|
|
)m4exit(4)])
|
|
|
|
|
|
|
|
|
1994-05-08 10:29:55 +08:00
|
|
|
dnl ### Checks for header files
|
1994-09-01 12:59:32 +08:00
|
|
|
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_HEADER_STDC,
|
1994-03-20 05:49:18 +08:00
|
|
|
[AC_REQUIRE_CPP()dnl
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING(for ANSI C header files)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_header_stdc,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_TRY_CPP([#include <stdlib.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <string.h>
|
1994-07-19 22:44:16 +08:00
|
|
|
#include <float.h>], ac_cv_header_stdc=yes, ac_cv_header_stdc=no)
|
1994-05-05 20:48:28 +08:00
|
|
|
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_header_stdc = yes; then
|
1994-05-05 20:48:28 +08:00
|
|
|
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_EGREP_HEADER(memchr, string.h, , ac_cv_header_stdc=no)
|
1994-05-05 20:48:28 +08:00
|
|
|
fi
|
|
|
|
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_header_stdc = yes; then
|
1994-05-05 20:48:28 +08:00
|
|
|
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_EGREP_HEADER(free, stdlib.h, , ac_cv_header_stdc=no)
|
1994-05-05 20:48:28 +08:00
|
|
|
fi
|
|
|
|
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_header_stdc = yes; then
|
1994-05-05 20:48:28 +08:00
|
|
|
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_TRY_RUN([#include <ctype.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
|
|
|
|
#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
|
1994-08-01 21:44:22 +08:00
|
|
|
#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
|
1993-10-16 06:51:22 +08:00
|
|
|
int main () { int i; for (i = 0; i < 256; i++)
|
|
|
|
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
|
|
|
|
exit (0); }
|
1994-09-01 12:59:32 +08:00
|
|
|
], , ac_cv_header_stdc=no, ac_cv_header_stdc=no)
|
1994-07-19 22:44:16 +08:00
|
|
|
fi])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_header_stdc)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_header_stdc = yes; then
|
1994-05-05 20:48:28 +08:00
|
|
|
AC_DEFINE(STDC_HEADERS)
|
1994-08-13 10:19:11 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_UNISTD_H,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_USG,
|
1994-05-06 19:57:01 +08:00
|
|
|
[AC_OBSOLETE([$0],
|
1994-08-01 21:44:22 +08:00
|
|
|
[; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl
|
|
|
|
AC_MSG_CHECKING([for BSD string and memory functions])
|
1994-09-09 04:42:23 +08:00
|
|
|
AC_TRY_LINK([#include <strings.h>], [rindex(0, 0); bzero(0, 0);],
|
1994-09-01 12:59:32 +08:00
|
|
|
[AC_MSG_RESULT(yes); AC_DEFINE(USG)], [AC_MSG_RESULT(no)])])
|
|
|
|
|
|
|
|
|
1993-10-16 06:51:22 +08:00
|
|
|
dnl If memchr and the like aren't declared in <string.h>, include <memory.h>.
|
|
|
|
dnl To avoid problems, don't check for gcc2 built-ins.
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_MEMORY_H,
|
1994-08-11 00:47:42 +08:00
|
|
|
[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])dnl
|
|
|
|
AC_MSG_CHECKING(whether string.h declares mem functions)
|
|
|
|
AC_EGREP_HEADER(memchr, string.h, ac_found=yes, ac_found=no)
|
|
|
|
AC_MSG_RESULT($ac_found)
|
|
|
|
if test $ac_found = no; then
|
|
|
|
AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)])
|
1994-08-13 10:19:11 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_HEADER_MAJOR,
|
1994-08-25 11:45:07 +08:00
|
|
|
[AC_MSG_CHECKING(whether sys/types.h defines makedev)
|
|
|
|
AC_CACHE_VAL(ac_cv_header_sys_types_h_makedev,
|
|
|
|
[AC_TRY_LINK([#include <sys/types.h>], [return makedev(0, 0);],
|
|
|
|
ac_cv_header_sys_types_h_makedev=yes, ac_cv_header_sys_types_h_makedev=no)
|
|
|
|
])dnl
|
|
|
|
AC_MSG_RESULT($ac_cv_header_sys_types_h_makedev)
|
|
|
|
|
|
|
|
if test $ac_cv_header_sys_types_h_makedev = no; then
|
|
|
|
AC_CHECK_HEADER(sys/mkdev.h, [AC_DEFINE(MAJOR_IN_MKDEV)])
|
|
|
|
|
|
|
|
if test $ac_cv_header_sys_mkdev_h = no; then
|
|
|
|
AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS)])
|
|
|
|
fi
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_HEADER_DIRENT,
|
1994-09-07 11:06:34 +08:00
|
|
|
[ac_header_dirent=no
|
|
|
|
AC_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h,
|
|
|
|
[ac_header_dirent=$ac_hdr; break])
|
1994-09-28 06:05:22 +08:00
|
|
|
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
|
1994-09-09 04:42:23 +08:00
|
|
|
if test $ac_header_dirent = dirent.h; then
|
|
|
|
AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir")
|
1994-09-28 06:05:22 +08:00
|
|
|
else
|
|
|
|
AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx")
|
1994-09-09 04:42:23 +08:00
|
|
|
fi
|
1994-09-06 04:12:21 +08:00
|
|
|
])
|
1994-08-09 21:44:55 +08:00
|
|
|
|
1994-09-07 11:06:34 +08:00
|
|
|
dnl Like AC_CHECK_HEADER, except also make sure that HEADER-FILE
|
|
|
|
dnl defines the type `DIR'. dirent.h on NextStep 3.2 doesn't.
|
|
|
|
dnl AC_CHECK_HEADER_DIRENT(HEADER-FILE, ACTION-IF-FOUND)
|
|
|
|
AC_DEFUN(AC_CHECK_HEADER_DIRENT,
|
1994-10-27 06:42:11 +08:00
|
|
|
[ac_safe=`echo "$1" | tr './\055' '___'`
|
1994-09-07 11:06:34 +08:00
|
|
|
AC_MSG_CHECKING([for $1 that defines DIR])
|
|
|
|
AC_CACHE_VAL(ac_cv_header_dirent_$ac_safe,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
1994-09-07 11:06:34 +08:00
|
|
|
#include <$1>], [DIR *dirp = 0;],
|
|
|
|
eval "ac_cv_header_dirent_$ac_safe=yes",
|
|
|
|
eval "ac_cv_header_dirent_$ac_safe=no")])dnl
|
|
|
|
if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
$2
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Like AC_CHECK_HEADERS, except succeed only for a HEADER-FILE that
|
|
|
|
dnl defines `DIR'.
|
|
|
|
dnl AC_CHECK_HEADERS_DIRENT(HEADER-FILE... [, ACTION])
|
1994-10-28 23:23:25 +08:00
|
|
|
define(AC_CHECK_HEADERS_DIRENT,
|
1994-09-07 11:06:34 +08:00
|
|
|
[for ac_hdr in $1
|
|
|
|
do
|
1994-09-13 23:20:48 +08:00
|
|
|
AC_CHECK_HEADER_DIRENT($ac_hdr,
|
1994-09-07 11:06:34 +08:00
|
|
|
[changequote(, )dnl
|
1994-10-27 06:42:11 +08:00
|
|
|
ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
|
1994-09-07 11:06:34 +08:00
|
|
|
changequote([, ])dnl
|
1994-09-13 23:20:48 +08:00
|
|
|
AC_DEFINE_UNQUOTED($ac_tr_hdr) $2])dnl
|
1994-09-07 11:06:34 +08:00
|
|
|
done])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_DIR_HEADER,
|
1994-09-10 04:13:30 +08:00
|
|
|
[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl
|
|
|
|
ac_header_dirent=no
|
1994-08-09 21:44:55 +08:00
|
|
|
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
|
1994-09-07 11:06:34 +08:00
|
|
|
AC_CHECK_HEADER_DIRENT($ac_hdr, [ac_header_dirent=$ac_hdr; break])
|
1994-08-13 11:28:38 +08:00
|
|
|
done
|
1994-08-09 21:44:55 +08:00
|
|
|
|
1994-09-07 11:06:34 +08:00
|
|
|
case "$ac_header_dirent" in
|
1994-08-09 21:44:55 +08:00
|
|
|
dirent.h) AC_DEFINE(DIRENT) ;;
|
|
|
|
sys/ndir.h) AC_DEFINE(SYSNDIR) ;;
|
|
|
|
sys/dir.h) AC_DEFINE(SYSDIR) ;;
|
|
|
|
ndir.h) AC_DEFINE(NDIR) ;;
|
1994-07-19 22:44:16 +08:00
|
|
|
esac
|
1993-10-16 06:51:22 +08:00
|
|
|
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_CHECKING(whether closedir returns void)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_func_closedir_void,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_TRY_RUN([#include <sys/types.h>
|
1994-09-07 11:06:34 +08:00
|
|
|
#include <$ac_header_dirent>
|
1994-07-19 22:44:16 +08:00
|
|
|
int closedir(); main() { exit(closedir(opendir(".")) != 0); }],
|
|
|
|
ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_func_closedir_void)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_closedir_void = yes; then
|
|
|
|
AC_DEFINE(VOID_CLOSEDIR)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_HEADER_STAT,
|
1994-08-23 23:04:53 +08:00
|
|
|
[AC_MSG_CHECKING(whether stat file-mode macros are broken)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_header_stat_broken,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_EGREP_CPP([You lose], [#include <sys/types.h>
|
1994-04-30 09:45:26 +08:00
|
|
|
#include <sys/stat.h>
|
|
|
|
#ifdef S_ISBLK
|
1994-08-26 10:47:25 +08:00
|
|
|
# if S_ISBLK (S_IFDIR)
|
1994-04-30 09:45:26 +08:00
|
|
|
You lose.
|
1994-08-26 10:47:25 +08:00
|
|
|
# endif
|
|
|
|
# ifdef S_IFCHR
|
|
|
|
# if S_ISBLK (S_IFCHR)
|
1994-04-30 09:45:26 +08:00
|
|
|
You lose.
|
1994-08-26 10:47:25 +08:00
|
|
|
# endif
|
|
|
|
# endif
|
1994-04-30 09:45:26 +08:00
|
|
|
#endif
|
1994-08-26 10:47:25 +08:00
|
|
|
|
1994-04-30 09:45:26 +08:00
|
|
|
#ifdef S_ISLNK
|
1994-08-26 10:47:25 +08:00
|
|
|
# if S_ISLNK (S_IFREG)
|
1994-04-30 09:45:26 +08:00
|
|
|
You lose.
|
1994-08-26 10:47:25 +08:00
|
|
|
# endif
|
1994-04-30 09:45:26 +08:00
|
|
|
#endif
|
1994-08-26 10:47:25 +08:00
|
|
|
|
1994-04-30 09:45:26 +08:00
|
|
|
#ifdef S_ISSOCK
|
1994-08-26 10:47:25 +08:00
|
|
|
# if S_ISSOCK (S_IFREG)
|
1994-04-30 09:45:26 +08:00
|
|
|
You lose.
|
1994-08-26 10:47:25 +08:00
|
|
|
# endif
|
1994-04-30 09:45:26 +08:00
|
|
|
#endif
|
1994-07-19 22:44:16 +08:00
|
|
|
], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_header_stat_broken)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_header_stat_broken = yes; then
|
|
|
|
AC_DEFINE(STAT_MACROS_BROKEN)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_DECL_SYS_SIGLIST,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING([for sys_siglist declaration in signal.h or unistd.h])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_decl_sys_siglist,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
1994-07-19 22:44:16 +08:00
|
|
|
#include <signal.h>
|
1994-05-04 22:44:23 +08:00
|
|
|
/* NetBSD declares sys_siglist in unistd.h. */
|
1994-04-30 09:45:26 +08:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif], [char *msg = *(sys_siglist + 1);],
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_decl_sys_siglist=yes, ac_cv_decl_sys_siglist=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_decl_sys_siglist)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_decl_sys_siglist = yes; then
|
|
|
|
AC_DEFINE(SYS_SIGLIST_DECLARED)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-10-02 07:13:28 +08:00
|
|
|
AC_DEFUN(AC_HEADER_SYS_WAIT,
|
|
|
|
[AC_MSG_CHECKING([for sys/wait.h that is POSIX.1 compatible])
|
|
|
|
AC_CACHE_VAL(ac_cv_header_sys_wait_h,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
1994-10-02 07:13:28 +08:00
|
|
|
#include <sys/wait.h>
|
|
|
|
#ifndef WEXITSTATUS
|
|
|
|
#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
|
|
|
|
#endif
|
|
|
|
#ifndef WIFEXITED
|
|
|
|
#define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
|
|
|
|
#endif], [int s;
|
|
|
|
wait (&s);
|
|
|
|
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;],
|
|
|
|
ac_cv_header_sys_wait_h=yes, ac_cv_header_sys_wait_h=no)])dnl
|
|
|
|
AC_MSG_RESULT($ac_cv_header_sys_wait_h)
|
|
|
|
if test $ac_cv_header_sys_wait_h = yes; then
|
|
|
|
AC_DEFINE(HAVE_SYS_WAIT_H)
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
1994-09-01 12:59:32 +08:00
|
|
|
|
1994-05-08 10:29:55 +08:00
|
|
|
dnl ### Checks for typedefs
|
1994-09-01 12:59:32 +08:00
|
|
|
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_TYPE_GETGROUPS,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_REQUIRE([AC_TYPE_UID_T])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_CHECKING(type of array argument to getgroups)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_type_getgroups,
|
1994-08-24 14:41:01 +08:00
|
|
|
[AC_TRY_RUN(
|
|
|
|
changequote(<<, >>)dnl
|
|
|
|
<<
|
|
|
|
/* Thanks to Mike Rendell for this test. */
|
1993-10-16 06:51:22 +08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#define NGID 256
|
|
|
|
#undef MAX
|
1994-08-01 21:44:22 +08:00
|
|
|
#define MAX(x, y) ((x) > (y) ? (x) : (y))
|
1993-10-16 06:51:22 +08:00
|
|
|
main()
|
|
|
|
{
|
|
|
|
gid_t gidset[NGID];
|
|
|
|
int i, n;
|
|
|
|
union { gid_t gval; long lval; } val;
|
|
|
|
|
|
|
|
val.lval = -1;
|
|
|
|
for (i = 0; i < NGID; i++)
|
|
|
|
gidset[i] = val.gval;
|
|
|
|
n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
|
|
|
|
gidset);
|
|
|
|
/* Exit non-zero if getgroups seems to require an array of ints. This
|
|
|
|
happens when gid_t is short but getgroups modifies an array of ints. */
|
|
|
|
exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
|
1994-08-24 14:41:01 +08:00
|
|
|
}
|
|
|
|
>>,
|
1994-08-01 21:44:22 +08:00
|
|
|
changequote([, ])dnl
|
1994-09-17 10:09:38 +08:00
|
|
|
ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int,
|
|
|
|
ac_cv_type_getgroups=cross)
|
|
|
|
if test $ac_cv_type_getgroups = cross; then
|
|
|
|
dnl When we can't run the test program (we are cross compiling), presume
|
|
|
|
dnl that <unistd.h> has either an accurate prototype for getgroups or none.
|
|
|
|
dnl Old systems without prototypes probably use int.
|
|
|
|
AC_EGREP_HEADER([getgroups.*int.*gid_t], unistd.h,
|
|
|
|
ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int)
|
|
|
|
fi])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_type_getgroups)
|
1994-07-25 11:33:46 +08:00
|
|
|
AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_TYPE_UID_T,
|
|
|
|
[AC_MSG_CHECKING(for uid_t in sys/types.h)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_type_uid_t,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_EGREP_HEADER(uid_t, sys/types.h,
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_type_uid_t=yes, ac_cv_type_uid_t=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_type_uid_t)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_type_uid_t = no; then
|
|
|
|
AC_DEFINE(uid_t, int)
|
|
|
|
AC_DEFINE(gid_t, int)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_TYPE_SIZE_T,
|
1994-10-02 07:13:28 +08:00
|
|
|
[AC_CHECK_TYPE(size_t, unsigned)])
|
1994-09-01 12:59:32 +08:00
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_TYPE_PID_T,
|
1994-10-02 07:13:28 +08:00
|
|
|
[AC_CHECK_TYPE(pid_t, int)])
|
1994-09-01 12:59:32 +08:00
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_TYPE_OFF_T,
|
1994-10-02 07:13:28 +08:00
|
|
|
[AC_CHECK_TYPE(off_t, long)])
|
1994-09-01 12:59:32 +08:00
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_TYPE_MODE_T,
|
1994-10-02 07:13:28 +08:00
|
|
|
[AC_CHECK_TYPE(mode_t, int)])
|
1994-09-01 12:59:32 +08:00
|
|
|
|
1994-05-04 22:44:23 +08:00
|
|
|
dnl Note that identifiers starting with SIG are reserved by ANSI C.
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_TYPE_SIGNAL,
|
|
|
|
[AC_MSG_CHECKING([return type of signal handlers])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_type_signal,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
#include <signal.h>
|
|
|
|
#ifdef signal
|
|
|
|
#undef signal
|
|
|
|
#endif
|
|
|
|
extern void (*signal ()) ();],
|
1994-07-19 22:44:16 +08:00
|
|
|
[int i;], ac_cv_type_signal=void, ac_cv_type_signal=int)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_type_signal)
|
1994-07-25 11:33:46 +08:00
|
|
|
AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal)
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
|
1994-05-08 10:29:55 +08:00
|
|
|
dnl ### Checks for functions
|
1994-09-01 12:59:32 +08:00
|
|
|
|
|
|
|
|
1994-09-09 04:42:23 +08:00
|
|
|
AC_DEFUN(AC_FUNC_CLOSEDIR_VOID,
|
|
|
|
[AC_REQUIRE([AC_HEADER_DIRENT])dnl
|
|
|
|
AC_MSG_CHECKING(whether closedir returns void)
|
|
|
|
AC_CACHE_VAL(ac_cv_func_closedir_void,
|
|
|
|
[AC_TRY_RUN([#include <sys/types.h>
|
|
|
|
#include <$ac_header_dirent>
|
|
|
|
int closedir(); main() { exit(closedir(opendir(".")) != 0); }],
|
|
|
|
ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes)])dnl
|
|
|
|
AC_MSG_RESULT($ac_cv_func_closedir_void)
|
|
|
|
if test $ac_cv_func_closedir_void = yes; then
|
|
|
|
AC_DEFINE(CLOSEDIR_VOID)
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_FUNC_MMAP,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING(for working mmap)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_func_mmap,
|
1994-09-06 22:36:45 +08:00
|
|
|
[AC_TRY_RUN([
|
|
|
|
/* Thanks to Mike Haertel and Jim Avera for this test. */
|
1994-03-20 05:49:18 +08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
|
|
|
|
#ifdef BSD
|
1994-08-26 10:47:25 +08:00
|
|
|
# ifndef BSD4_1
|
|
|
|
# define HAVE_GETPAGESIZE
|
|
|
|
# endif
|
1994-03-20 05:49:18 +08:00
|
|
|
#endif
|
1994-08-26 10:47:25 +08:00
|
|
|
|
1994-03-20 05:49:18 +08:00
|
|
|
#ifndef HAVE_GETPAGESIZE
|
1994-08-26 10:47:25 +08:00
|
|
|
# include <sys/param.h>
|
|
|
|
# ifdef EXEC_PAGESIZE
|
|
|
|
# define getpagesize() EXEC_PAGESIZE
|
|
|
|
# else
|
|
|
|
# ifdef NBPG
|
|
|
|
# define getpagesize() NBPG * CLSIZE
|
|
|
|
# ifndef CLSIZE
|
|
|
|
# define CLSIZE 1
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# ifdef NBPC
|
|
|
|
# define getpagesize() NBPC
|
|
|
|
# else
|
|
|
|
# define getpagesize() PAGESIZE /* SVR4 */
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
#endif
|
1994-03-20 05:49:18 +08:00
|
|
|
|
|
|
|
#ifdef __osf__
|
1994-08-26 10:47:25 +08:00
|
|
|
# define valloc malloc
|
1994-03-20 05:49:18 +08:00
|
|
|
#endif
|
|
|
|
|
1994-08-26 10:47:25 +08:00
|
|
|
#ifdef __cplusplus
|
1994-08-28 08:24:09 +08:00
|
|
|
extern "C" { void *valloc(unsigned), *malloc(unsigned); }
|
1994-08-26 10:47:25 +08:00
|
|
|
#else
|
|
|
|
char *valloc(), *malloc();
|
|
|
|
#endif
|
1994-03-20 05:49:18 +08:00
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
char *buf1, *buf2, *buf3;
|
|
|
|
int i = getpagesize(), j;
|
|
|
|
int i2 = getpagesize()*2;
|
|
|
|
int fd;
|
|
|
|
|
1994-08-28 08:24:09 +08:00
|
|
|
buf1 = (char *)valloc(i2);
|
|
|
|
buf2 = (char *)valloc(i);
|
|
|
|
buf3 = (char *)malloc(i2);
|
1994-03-20 05:49:18 +08:00
|
|
|
for (j = 0; j < i2; ++j)
|
|
|
|
*(buf1 + j) = rand();
|
|
|
|
fd = open("conftestmmap", O_CREAT | O_RDWR, 0666);
|
|
|
|
write(fd, buf1, i2);
|
|
|
|
mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0);
|
|
|
|
for (j = 0; j < i; ++j)
|
|
|
|
if (*(buf1 + j) != *(buf2 + j))
|
|
|
|
exit(1);
|
|
|
|
lseek(fd, (long)i, 0);
|
|
|
|
read(fd, buf2, i); /* read into mapped memory -- file should not change */
|
1994-09-06 22:36:45 +08:00
|
|
|
/* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */
|
1994-03-20 05:49:18 +08:00
|
|
|
lseek(fd, (long)0, 0);
|
|
|
|
read(fd, buf3, i2);
|
|
|
|
for (j = 0; j < i2; ++j)
|
|
|
|
if (*(buf1 + j) != *(buf3 + j))
|
|
|
|
exit(1);
|
|
|
|
exit(0);
|
|
|
|
}
|
1994-09-06 04:12:21 +08:00
|
|
|
], ac_cv_func_mmap=yes, ac_cv_func_mmap=no, ac_cv_func_mmap=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_func_mmap)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_mmap = yes; then
|
|
|
|
AC_DEFINE(HAVE_MMAP)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_FUNC_VPRINTF,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
|
1994-06-23 02:22:34 +08:00
|
|
|
if test "$ac_cv_func_vprintf" != yes; then
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_FUNC_VFORK,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_REQUIRE([AC_TYPE_PID_T])dnl
|
|
|
|
AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H))
|
|
|
|
AC_MSG_CHECKING(for working vfork)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_func_vfork,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_REQUIRE([AC_TYPE_SIGNAL])
|
|
|
|
AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */
|
1993-10-16 06:51:22 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_VFORK_H
|
|
|
|
#include <vfork.h>
|
|
|
|
#endif
|
1994-07-19 22:44:16 +08:00
|
|
|
/* On sparc systems, changes by the child to local and incoming
|
|
|
|
argument registers are propagated back to the parent.
|
|
|
|
The compiler is told about this with #include <vfork.h>,
|
|
|
|
but some compilers (e.g. gcc -O) don't grok <vfork.h>.
|
|
|
|
Test for this by using a static variable whose address
|
|
|
|
is put into a register that is clobbered by the vfork. */
|
|
|
|
static
|
1994-08-26 05:55:22 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
sparc_address_test (int arg)
|
|
|
|
#else
|
|
|
|
sparc_address_test (arg) int arg;
|
|
|
|
#endif
|
|
|
|
{
|
1994-07-19 22:44:16 +08:00
|
|
|
static pid_t child;
|
|
|
|
if (!child) {
|
|
|
|
child = vfork ();
|
|
|
|
if (child < 0)
|
|
|
|
perror ("vfork");
|
|
|
|
if (!child) {
|
|
|
|
arg = getpid();
|
|
|
|
write(-1, "", 0);
|
|
|
|
_exit (arg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1993-10-16 06:51:22 +08:00
|
|
|
static int signalled;
|
|
|
|
static RETSIGTYPE catch (s) int s; { signalled = 1; }
|
|
|
|
main() {
|
|
|
|
pid_t parent = getpid ();
|
|
|
|
pid_t child;
|
|
|
|
|
1994-07-19 22:44:16 +08:00
|
|
|
sparc_address_test ();
|
|
|
|
|
1993-10-16 06:51:22 +08:00
|
|
|
signal (SIGINT, catch);
|
|
|
|
|
|
|
|
child = vfork ();
|
|
|
|
|
|
|
|
if (child == 0) {
|
1994-07-19 22:44:16 +08:00
|
|
|
/* Here is another test for sparc vfork register problems.
|
|
|
|
This test uses lots of local variables, at least
|
1993-10-16 06:51:22 +08:00
|
|
|
as many local variables as main has allocated so far
|
|
|
|
including compiler temporaries. 4 locals are enough for
|
|
|
|
gcc 1.40.3 on a sparc, but we use 8 to be safe.
|
|
|
|
A buggy compiler should reuse the register of parent
|
|
|
|
for one of the local variables, since it will think that
|
|
|
|
parent can't possibly be used any more in this routine.
|
|
|
|
Assigning to the local variable will thus munge parent
|
|
|
|
in the parent process. */
|
|
|
|
pid_t
|
|
|
|
p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
|
|
|
|
p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
|
|
|
|
/* Convince the compiler that p..p7 are live; otherwise, it might
|
|
|
|
use the same hardware register for all 8 local variables. */
|
|
|
|
if (p != p1 || p != p2 || p != p3 || p != p4
|
|
|
|
|| p != p5 || p != p6 || p != p7)
|
|
|
|
_exit(1);
|
|
|
|
|
|
|
|
/* On some systems (e.g. SunOS 5.2), if the parent is catching
|
|
|
|
a signal, the child ignores the signal before execing,
|
|
|
|
and the parent later receives that signal, the parent dumps core.
|
|
|
|
Test for this by ignoring SIGINT in the child. */
|
|
|
|
signal (SIGINT, SIG_IGN);
|
|
|
|
|
|
|
|
/* On some systems (e.g. IRIX 3.3),
|
|
|
|
vfork doesn't separate parent from child file descriptors.
|
|
|
|
If the child closes a descriptor before it execs or exits,
|
|
|
|
this munges the parent's descriptor as well.
|
|
|
|
Test for this by closing stdout in the child. */
|
|
|
|
_exit(close(fileno(stdout)) != 0);
|
|
|
|
} else {
|
|
|
|
int status;
|
|
|
|
struct stat st;
|
|
|
|
|
|
|
|
while (wait(&status) != child)
|
|
|
|
;
|
|
|
|
exit(
|
|
|
|
/* Was there some problem with vforking? */
|
|
|
|
child < 0
|
|
|
|
|
|
|
|
/* Did the child fail? (This shouldn't happen.) */
|
|
|
|
|| status
|
|
|
|
|
|
|
|
/* Did the vfork/compiler bug occur? */
|
|
|
|
|| parent != getpid()
|
|
|
|
|
|
|
|
/* Did the signal handling bug occur? */
|
|
|
|
|| kill(parent, SIGINT) != 0
|
|
|
|
|| signalled != 1
|
|
|
|
|
|
|
|
/* Did the file descriptor bug occur? */
|
|
|
|
|| fstat(fileno(stdout), &st) != 0
|
|
|
|
);
|
|
|
|
}
|
1994-09-06 04:12:21 +08:00
|
|
|
}], ac_cv_func_vfork=yes, ac_cv_func_vfork=no, ac_cv_func_vfork=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_func_vfork)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_vfork = no; then
|
|
|
|
AC_DEFINE(vfork, fork)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_FUNC_WAIT3,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING(for wait3 that fills in rusage)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_func_wait3,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_TRY_RUN([#include <sys/types.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
#include <sys/time.h>
|
|
|
|
#include <sys/resource.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
/* HP-UX has wait3 but does not fill in rusage at all. */
|
|
|
|
main() {
|
|
|
|
struct rusage r;
|
|
|
|
int i;
|
|
|
|
/* Use a field that we can force nonzero --
|
|
|
|
voluntary context switches.
|
|
|
|
For systems like NeXT and OSF/1 that don't set it,
|
1995-02-07 07:31:34 +08:00
|
|
|
also use the system CPU time. And page faults (I/O) for Linux. */
|
1993-10-16 06:51:22 +08:00
|
|
|
r.ru_nvcsw = 0;
|
|
|
|
r.ru_stime.tv_sec = 0;
|
|
|
|
r.ru_stime.tv_usec = 0;
|
1995-02-07 07:31:34 +08:00
|
|
|
r.ru_majflt = r.ru_minflt = 0;
|
1993-10-16 06:51:22 +08:00
|
|
|
switch (fork()) {
|
|
|
|
case 0: /* Child. */
|
|
|
|
sleep(1); /* Give up the CPU. */
|
|
|
|
_exit(0);
|
|
|
|
case -1: _exit(0); /* What can we do? */
|
|
|
|
default: /* Parent. */
|
|
|
|
wait3(&i, 0, &r);
|
1994-05-08 10:29:55 +08:00
|
|
|
sleep(1); /* Avoid "text file busy" from rm on fast HP-UX machines. */
|
1995-02-07 07:31:34 +08:00
|
|
|
exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
|
1993-10-16 06:51:22 +08:00
|
|
|
&& r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
|
|
|
|
}
|
1994-09-06 04:12:21 +08:00
|
|
|
}], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_func_wait3)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_wait3 = yes; then
|
|
|
|
AC_DEFINE(HAVE_WAIT3)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_FUNC_ALLOCA,
|
1994-08-27 09:27:32 +08:00
|
|
|
[AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
|
|
|
|
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
|
1993-10-16 06:51:22 +08:00
|
|
|
# for constant arguments. Useless!
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING([for working alloca.h])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_header_alloca_h,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_TRY_LINK([#include <alloca.h>], [char *p = alloca(2 * sizeof(int));],
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_header_alloca_h)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_header_alloca_h = yes; then
|
|
|
|
AC_DEFINE(HAVE_ALLOCA_H)
|
|
|
|
fi
|
1994-05-05 20:48:28 +08:00
|
|
|
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING([for alloca])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_func_alloca,
|
1994-08-26 10:47:25 +08:00
|
|
|
[AC_TRY_LINK([
|
|
|
|
#ifdef __GNUC__
|
|
|
|
# define alloca __builtin_alloca
|
1993-10-16 06:51:22 +08:00
|
|
|
#else
|
1994-08-26 10:47:25 +08:00
|
|
|
# if HAVE_ALLOCA_H
|
|
|
|
# include <alloca.h>
|
|
|
|
# else
|
|
|
|
# ifdef _AIX
|
1993-10-16 06:51:22 +08:00
|
|
|
#pragma alloca
|
1994-08-26 10:47:25 +08:00
|
|
|
# else
|
|
|
|
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
1993-10-16 06:51:22 +08:00
|
|
|
char *alloca ();
|
1994-08-26 10:47:25 +08:00
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
# endif
|
1994-06-23 02:22:34 +08:00
|
|
|
#endif
|
1994-07-19 22:44:16 +08:00
|
|
|
], [char *p = (char *) alloca(1);],
|
|
|
|
ac_cv_func_alloca=yes, ac_cv_func_alloca=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_func_alloca)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_alloca = yes; then
|
|
|
|
AC_DEFINE(HAVE_ALLOCA)
|
|
|
|
fi
|
1994-05-05 20:48:28 +08:00
|
|
|
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_alloca = no; then
|
1993-10-16 06:51:22 +08:00
|
|
|
# The SVR3 libPW and SVR4 libucb both contain incompatible functions
|
|
|
|
# that cause trouble. Some versions do not even contain alloca or
|
|
|
|
# contain a buggy version. If you still want to use their alloca,
|
|
|
|
# use ar to extract alloca.o from them instead of compiling alloca.c.
|
|
|
|
ALLOCA=alloca.o
|
|
|
|
AC_DEFINE(C_ALLOCA)
|
|
|
|
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_CHECKING(whether alloca needs Cray hooks)
|
|
|
|
AC_CACHE_VAL(ac_cv_os_cray,
|
|
|
|
[AC_EGREP_CPP(webecray,
|
1994-05-05 20:48:28 +08:00
|
|
|
[#if defined(CRAY) && ! defined(CRAY2)
|
|
|
|
webecray
|
|
|
|
#else
|
|
|
|
wenotbecray
|
|
|
|
#endif
|
1994-08-11 00:47:42 +08:00
|
|
|
], ac_cv_os_cray=yes, ac_cv_os_cray=no)])dnl
|
|
|
|
AC_MSG_RESULT($ac_cv_os_cray)
|
|
|
|
if test $ac_cv_os_cray = yes; then
|
1994-08-23 23:04:53 +08:00
|
|
|
AC_CHECK_FUNC(_getb67, AC_DEFINE(CRAY_STACKSEG_END, _getb67),
|
|
|
|
AC_CHECK_FUNC(GETB67, AC_DEFINE(CRAY_STACKSEG_END, GETB67),
|
|
|
|
AC_CHECK_FUNC(getb67, AC_DEFINE(CRAY_STACKSEG_END, getb67))))
|
1994-08-11 00:47:42 +08:00
|
|
|
fi
|
1994-05-05 20:48:28 +08:00
|
|
|
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING(stack direction for C alloca)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_c_stack_direction,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_TRY_RUN([find_stack_direction ()
|
1993-10-16 06:51:22 +08:00
|
|
|
{
|
|
|
|
static char *addr = 0;
|
|
|
|
auto char dummy;
|
|
|
|
if (addr == 0)
|
|
|
|
{
|
|
|
|
addr = &dummy;
|
|
|
|
return find_stack_direction ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return (&dummy > addr) ? 1 : -1;
|
|
|
|
}
|
|
|
|
main ()
|
|
|
|
{
|
|
|
|
exit (find_stack_direction() < 0);
|
1994-07-19 22:44:16 +08:00
|
|
|
}], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
|
|
|
|
ac_cv_c_stack_direction=0)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_c_stack_direction)
|
1994-07-25 11:33:46 +08:00
|
|
|
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
|
|
|
AC_SUBST(ALLOCA)dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_FUNC_GETLOADAVG,
|
1993-10-16 06:51:22 +08:00
|
|
|
[# Some definitions of getloadavg require that the program be installed setgid.
|
1994-07-19 22:44:16 +08:00
|
|
|
NEED_SETGID=false
|
|
|
|
AC_SUBST(NEED_SETGID)dnl
|
|
|
|
ac_have_func=no
|
1993-10-16 06:51:22 +08:00
|
|
|
|
1994-02-06 02:35:44 +08:00
|
|
|
# Some systems with -lutil have (and need) -lkvm as well, some do not.
|
1995-02-07 13:23:22 +08:00
|
|
|
# If it is needed, it will be needed to detect getloadavg in -lutil.
|
|
|
|
ac_LIBS_before_kvm="$LIBS"
|
|
|
|
AC_CHECK_LIB(kvm, kvm_open, ac_LIBS_kvm=-lkvm, ac_LIBS_kvm=)
|
|
|
|
# Check for the 4.4BSD definition of getloadavg.
|
|
|
|
AC_CHECK_LIB(util, getloadavg, [
|
|
|
|
LIBS="$ac_LIBS_before_kvm -lutil $ac_LIBS_kvm" ac_have_func=yes])
|
1993-10-16 06:51:22 +08:00
|
|
|
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_have_func = no; then
|
1993-10-16 06:51:22 +08:00
|
|
|
# There is a commonly available library for RS/6000 AIX.
|
|
|
|
# Since it is not a standard part of AIX, it might be installed locally.
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS"
|
1994-08-11 07:54:30 +08:00
|
|
|
AC_CHECK_LIB(getloadavg, getloadavg, LIBS="$LIBS -lgetloadavg", LIBS="$ac_save_LIBS")
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
|
|
|
|
1994-07-19 22:44:16 +08:00
|
|
|
# Make sure it is really in the library, if we think we found it.
|
1993-10-16 06:51:22 +08:00
|
|
|
AC_REPLACE_FUNCS(getloadavg)
|
|
|
|
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_getloadavg = yes; then
|
|
|
|
AC_DEFINE(HAVE_GETLOADAVG)
|
|
|
|
else
|
|
|
|
ac_have_func=no
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_CHECK_HEADER(sys/dg_sys_info.h,
|
1994-07-19 22:44:16 +08:00
|
|
|
[ac_have_func=yes AC_DEFINE(DGUX)
|
1994-08-11 07:54:30 +08:00
|
|
|
AC_CHECK_LIB(dgc, dg_sys_info)])
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_have_func = no; then
|
1993-10-16 06:51:22 +08:00
|
|
|
# We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
|
1994-05-18 03:25:23 +08:00
|
|
|
# uses stabs), but it is still SVR4. We cannot check for <elf.h> because
|
1993-10-16 06:51:22 +08:00
|
|
|
# Irix 4.0.5F has the header but not the library.
|
1994-12-07 08:07:00 +08:00
|
|
|
AC_CHECK_LIB(elf, elf_begin,
|
1994-07-19 22:44:16 +08:00
|
|
|
[LIBS="$LIBS -lelf" ac_have_func=yes AC_DEFINE(SVR4)
|
1994-08-11 07:54:30 +08:00
|
|
|
AC_CHECK_LIB(kvm, kvm_open, LIBS="$LIBS -lkvm")])
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_have_func = no; then
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_CHECK_HEADER(inq_stats/cpustats.h,
|
1994-09-28 21:04:57 +08:00
|
|
|
[ac_have_func=yes AC_DEFINE(UMAX)
|
|
|
|
AC_DEFINE(UMAX4_3)])
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_have_func = no; then
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_CHECK_HEADER(sys/cpustats.h,
|
1994-07-19 22:44:16 +08:00
|
|
|
[ac_have_func=yes AC_DEFINE(UMAX)])
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_have_func = no; then
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_CHECK_HEADERS(mach/mach.h)
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
|
|
|
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_CHECK_HEADER(nlist.h,
|
1993-10-16 06:51:22 +08:00
|
|
|
[AC_DEFINE(NLIST_STRUCT)
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING([for n_un in struct nlist])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_struct_nlist_n_un,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <nlist.h>],
|
1993-10-16 06:51:22 +08:00
|
|
|
[struct nlist n; n.n_un.n_name = 0;],
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_struct_nlist_n_un)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_struct_nlist_n_un = yes; then
|
|
|
|
AC_DEFINE(NLIST_NAME_UNION)
|
|
|
|
fi
|
|
|
|
])dnl
|
1993-10-16 06:51:22 +08:00
|
|
|
|
1994-09-06 04:12:21 +08:00
|
|
|
dnl FIXME two bugs here:
|
|
|
|
dnl Hardwiring the path of getloadavg.c in the top-level directory,
|
|
|
|
dnl and not checking whether a getloadavg from a library needs privileges.
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING(whether getloadavg requires setgid)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_func_getloadavg_setgid,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_EGREP_CPP([Yowza Am I SETGID yet],
|
1994-09-13 23:20:48 +08:00
|
|
|
[#include "$srcdir/getloadavg.c"
|
1993-10-16 06:51:22 +08:00
|
|
|
#ifdef LDAV_PRIVILEGED
|
|
|
|
Yowza Am I SETGID yet
|
1994-07-19 22:44:16 +08:00
|
|
|
#endif],
|
|
|
|
ac_cv_func_getloadavg_setgid=yes, ac_cv_func_getloadavg_setgid=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_func_getloadavg_setgid)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_getloadavg_setgid = yes; then
|
|
|
|
NEED_SETGID=true AC_DEFINE(GETLOADAVG_PRIVILEGED)
|
|
|
|
fi
|
1993-10-16 06:51:22 +08:00
|
|
|
|
1994-07-19 22:44:16 +08:00
|
|
|
fi # Do not have getloadavg in system libraries.
|
1993-10-16 06:51:22 +08:00
|
|
|
|
1994-05-05 20:48:28 +08:00
|
|
|
if test "$NEED_SETGID" = true; then
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING(group of /dev/kmem)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_group_kmem,
|
1994-08-01 21:44:22 +08:00
|
|
|
[changequote(, )dnl
|
1993-10-16 06:51:22 +08:00
|
|
|
# On Solaris, /dev/kmem is a symlink. Get info on the real file.
|
1994-03-18 16:00:54 +08:00
|
|
|
ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
|
1993-10-16 06:51:22 +08:00
|
|
|
# If we got an error (system does not support symlinks), try without -L.
|
1994-03-18 16:00:54 +08:00
|
|
|
test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_group_kmem=`echo $ac_ls_output \
|
1993-10-16 06:51:22 +08:00
|
|
|
| sed -ne 's/[ ][ ]*/ /g;
|
|
|
|
s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/;
|
|
|
|
/ /s/.* //;p;'`
|
1994-08-01 21:44:22 +08:00
|
|
|
changequote([, ])dnl
|
1994-07-19 22:44:16 +08:00
|
|
|
])dnl
|
|
|
|
KMEM_GROUP=$ac_cv_group_kmem
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($KMEM_GROUP)
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_SUBST(KMEM_GROUP)dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_FUNC_UTIME_NULL,
|
1994-08-11 00:47:42 +08:00
|
|
|
[AC_MSG_CHECKING(whether utime accepts a null argument)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_func_utime_null,
|
|
|
|
[rm -f conftestdata; > conftestdata
|
1993-10-16 06:51:22 +08:00
|
|
|
# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong.
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_TRY_RUN([#include <sys/types.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
#include <sys/stat.h>
|
|
|
|
main() {
|
|
|
|
struct stat s, t;
|
|
|
|
exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
|
|
|
|
&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
|
|
|
|
&& t.st_mtime - s.st_mtime < 120));
|
1994-09-06 04:12:21 +08:00
|
|
|
}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no,
|
|
|
|
ac_cv_func_utime_null=no)
|
1995-02-07 07:31:34 +08:00
|
|
|
rm -f core core.* *.core])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_func_utime_null)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_utime_null = yes; then
|
|
|
|
AC_DEFINE(HAVE_UTIME_NULL)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_FUNC_STRCOLL,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING(for strcoll)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_func_strcoll,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_TRY_RUN([#include <string.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
main ()
|
|
|
|
{
|
|
|
|
exit (strcoll ("abc", "def") >= 0 ||
|
|
|
|
strcoll ("ABC", "DEF") >= 0 ||
|
|
|
|
strcoll ("123", "456") >= 0);
|
1994-09-06 04:12:21 +08:00
|
|
|
}], ac_cv_func_strcoll=yes, ac_cv_func_strcoll=no, ac_cv_func_strcoll=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_func_strcoll)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_strcoll = yes; then
|
|
|
|
AC_DEFINE(HAVE_STRCOLL)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_FUNC_SETVBUF_REVERSED,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING(whether setvbuf arguments are reversed)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_func_setvbuf_reversed,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_TRY_RUN([#include <stdio.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
/* If setvbuf has the reversed format, exit 0. */
|
|
|
|
main () {
|
|
|
|
/* This call has the arguments reversed.
|
|
|
|
A reversed system may check and see that the address of main
|
|
|
|
is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */
|
|
|
|
if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
|
|
|
|
exit(1);
|
|
|
|
putc('\r', stdout);
|
|
|
|
exit(0); /* Non-reversed systems segv here. */
|
1994-07-19 22:44:16 +08:00
|
|
|
}], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no)
|
1995-02-07 07:31:34 +08:00
|
|
|
rm -f core core.* *.core])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_func_setvbuf_reversed)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_func_setvbuf_reversed = yes; then
|
|
|
|
AC_DEFINE(SETVBUF_REVERSED)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-09-09 04:42:23 +08:00
|
|
|
AC_DEFUN(AC_FUNC_GETMNTENT,
|
1994-09-11 14:20:58 +08:00
|
|
|
[# getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX.
|
|
|
|
AC_CHECK_LIB(sun, getmntent, LIBS="$LIBS -lsun",
|
|
|
|
[AC_CHECK_LIB(seq, getmntent, LIBS="$LIBS -lseq")])
|
1994-09-09 04:42:23 +08:00
|
|
|
AC_CHECK_FUNC(getmntent, [AC_DEFINE(HAVE_GETMNTENT)])])
|
|
|
|
|
|
|
|
AC_DEFUN(AC_FUNC_STRFTIME,
|
|
|
|
[# strftime is in -lintl on SCO UNIX.
|
|
|
|
AC_CHECK_LIB(intl, strftime, LIBS="$LIBS -lintl")
|
|
|
|
AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)])])
|
|
|
|
|
1994-09-10 04:13:30 +08:00
|
|
|
AC_DEFUN(AC_FUNC_MEMCMP,
|
|
|
|
[AC_MSG_CHECKING(for 8-bit clean memcmp)
|
|
|
|
AC_CACHE_VAL(ac_cv_func_memcmp,
|
|
|
|
[AC_TRY_RUN([
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
char c0 = 0x40, c1 = 0x80, c2 = 0x81;
|
|
|
|
exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
|
|
|
|
}
|
|
|
|
], ac_cv_func_memcmp=yes, ac_cv_func_memcmp=no, ac_cv_func_memcmp=no)])dnl
|
|
|
|
AC_MSG_RESULT($ac_cv_func_memcmp)
|
|
|
|
test $ac_cv_func_memcmp = no && LIBOBJS="$LIBOBJS memcmp.o"
|
|
|
|
AC_SUBST(LIBOBJS)dnl
|
|
|
|
])
|
1994-09-01 12:59:32 +08:00
|
|
|
|
1994-09-10 04:16:17 +08:00
|
|
|
|
1994-05-08 10:29:55 +08:00
|
|
|
dnl ### Checks for structure members
|
1994-09-01 12:59:32 +08:00
|
|
|
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_HEADER_TIME,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING([whether time.h and sys/time.h may both be included])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_header_time,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
#include <sys/time.h>
|
|
|
|
#include <time.h>],
|
1994-07-19 22:44:16 +08:00
|
|
|
[struct tm *tp;], ac_cv_header_time=yes, ac_cv_header_time=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_header_time)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_header_time = yes; then
|
|
|
|
AC_DEFINE(TIME_WITH_SYS_TIME)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-29 08:08:38 +08:00
|
|
|
AC_DEFUN(AC_STRUCT_TM,
|
|
|
|
[AC_MSG_CHECKING([whether struct tm is in sys/time.h or time.h])
|
|
|
|
AC_CACHE_VAL(ac_cv_struct_tm,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
1994-08-29 08:08:38 +08:00
|
|
|
#include <time.h>],
|
|
|
|
[struct tm *tp; tp->tm_sec;],
|
|
|
|
ac_cv_struct_tm=time.h, ac_cv_struct_tm=sys/time.h)])dnl
|
|
|
|
AC_MSG_RESULT($ac_cv_struct_tm)
|
|
|
|
if test $ac_cv_struct_tm = sys/time.h; then
|
|
|
|
AC_DEFINE(TM_IN_SYS_TIME)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_STRUCT_TIMEZONE,
|
1994-05-06 19:57:01 +08:00
|
|
|
[AC_REQUIRE([AC_STRUCT_TM])dnl
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING([for tm_zone in struct tm])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_struct_tm_zone,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
1994-07-19 22:44:16 +08:00
|
|
|
#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
|
|
|
|
ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_struct_tm_zone)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test "$ac_cv_struct_tm_zone" = yes; then
|
|
|
|
AC_DEFINE(HAVE_TM_ZONE)
|
|
|
|
else
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING([for tzname])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_var_tzname,
|
1994-08-24 22:09:18 +08:00
|
|
|
[AC_TRY_LINK(
|
|
|
|
changequote(<<, >>)dnl
|
1993-10-16 06:51:22 +08:00
|
|
|
<<#include <time.h>
|
|
|
|
#ifndef tzname /* For SGI. */
|
1994-05-04 22:44:23 +08:00
|
|
|
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
|
1994-08-24 22:09:18 +08:00
|
|
|
#endif>>,
|
|
|
|
changequote([, ])dnl
|
1994-07-19 22:44:16 +08:00
|
|
|
[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_var_tzname)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_var_tzname = yes; then
|
|
|
|
AC_DEFINE(HAVE_TZNAME)
|
|
|
|
fi
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_STRUCT_ST_BLOCKS,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING([for st_blocks in struct stat])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_struct_st_blocks,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
#include <sys/stat.h>], [struct stat s; s.st_blocks;],
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_struct_st_blocks=yes, ac_cv_struct_st_blocks=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_struct_st_blocks)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_struct_st_blocks = yes; then
|
|
|
|
AC_DEFINE(HAVE_ST_BLOCKS)
|
|
|
|
else
|
|
|
|
LIBOBJS="$LIBOBJS fileblocks.o"
|
|
|
|
fi
|
1993-10-16 06:51:22 +08:00
|
|
|
AC_SUBST(LIBOBJS)dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING([for st_blksize in struct stat])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_struct_st_blksize,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
#include <sys/stat.h>], [struct stat s; s.st_blksize;],
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_struct_st_blksize=yes, ac_cv_struct_st_blksize=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_struct_st_blksize)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_struct_st_blksize = yes; then
|
|
|
|
AC_DEFINE(HAVE_ST_BLKSIZE)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_STRUCT_ST_RDEV,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING([for st_rdev in struct stat])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_struct_st_rdev,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
1993-10-16 06:51:22 +08:00
|
|
|
#include <sys/stat.h>], [struct stat s; s.st_rdev;],
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_struct_st_rdev=yes, ac_cv_struct_st_rdev=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_struct_st_rdev)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_struct_st_rdev = yes; then
|
|
|
|
AC_DEFINE(HAVE_ST_RDEV)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
|
1994-05-08 10:29:55 +08:00
|
|
|
dnl ### Checks for compiler characteristics
|
1994-09-01 12:59:32 +08:00
|
|
|
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_C_CROSS,
|
|
|
|
[# If we cannot run a trivial program, we must be cross compiling.
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING(whether cross-compiling)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_c_cross,
|
1994-09-07 11:06:34 +08:00
|
|
|
[AC_TRY_RUN([main(){return(0);}],
|
1995-02-07 07:31:34 +08:00
|
|
|
ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_c_cross=yes)])dnl
|
1994-07-19 22:44:16 +08:00
|
|
|
cross_compiling=$ac_cv_c_cross
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_c_cross)
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_C_CHAR_UNSIGNED,
|
1994-08-29 08:08:38 +08:00
|
|
|
[AC_MSG_CHECKING(whether char is unsigned)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_c_char_unsigned,
|
1994-09-10 04:13:30 +08:00
|
|
|
[if test "$GCC" = yes; then
|
|
|
|
# GCC predefines this symbol on systems where it applies.
|
|
|
|
AC_EGREP_CPP(yes,
|
|
|
|
[#ifdef __CHAR_UNSIGNED__
|
|
|
|
yes
|
|
|
|
#endif
|
|
|
|
], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
|
|
|
|
else
|
|
|
|
AC_TRY_RUN(
|
1993-10-16 06:51:22 +08:00
|
|
|
[/* volatile prevents gcc2 from optimizing the test away on sparcs. */
|
1994-09-10 04:13:30 +08:00
|
|
|
#if !defined(__STDC__) || __STDC__ != 1
|
1993-10-16 06:51:22 +08:00
|
|
|
#define volatile
|
|
|
|
#endif
|
|
|
|
main() {
|
|
|
|
volatile char c = 255; exit(c < 0);
|
1994-09-10 04:13:30 +08:00
|
|
|
}], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
|
|
|
|
fi])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_c_char_unsigned)
|
1994-08-11 08:36:21 +08:00
|
|
|
if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_DEFINE(__CHAR_UNSIGNED__)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_C_LONG_DOUBLE,
|
1994-08-29 08:08:38 +08:00
|
|
|
[AC_MSG_CHECKING(for long double)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_c_long_double,
|
|
|
|
[if test "$GCC" = yes; then
|
|
|
|
ac_cv_c_long_double=yes
|
1993-10-16 06:51:22 +08:00
|
|
|
else
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_TRY_RUN([int main() {
|
1993-12-07 12:40:53 +08:00
|
|
|
/* The Stardent Vistra knows sizeof(long double), but does not support it. */
|
1993-10-30 09:46:35 +08:00
|
|
|
long double foo = 0.0;
|
1993-10-16 06:51:22 +08:00
|
|
|
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
|
|
|
|
exit(sizeof(long double) < sizeof(double)); }],
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
|
|
|
|
fi])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_c_long_double)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_c_long_double = yes; then
|
|
|
|
AC_DEFINE(HAVE_LONG_DOUBLE)
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_INT_16_BITS,
|
1994-09-09 04:42:23 +08:00
|
|
|
[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)])dnl
|
1994-08-24 22:09:18 +08:00
|
|
|
AC_MSG_CHECKING(whether int is 16 bits)
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_TRY_RUN([main() { exit(sizeof(int) != 2); }],
|
1994-08-24 22:09:18 +08:00
|
|
|
[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(no))
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_LONG_64_BITS,
|
1994-09-09 04:42:23 +08:00
|
|
|
[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)])dnl
|
1994-08-24 22:09:18 +08:00
|
|
|
AC_MSG_CHECKING(whether long int is 64 bits)
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_TRY_RUN([main() { exit(sizeof(long int) != 8); }],
|
1994-08-24 22:09:18 +08:00
|
|
|
[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(no))
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_C_BIGENDIAN,
|
1994-08-11 00:47:42 +08:00
|
|
|
[AC_MSG_CHECKING(whether byte ordering is bigendian)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_c_bigendian,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_TRY_RUN([main () {
|
1993-10-16 06:51:22 +08:00
|
|
|
/* Are we little or big endian? From Harbison&Steele. */
|
|
|
|
union
|
|
|
|
{
|
|
|
|
long l;
|
|
|
|
char c[sizeof (long)];
|
|
|
|
} u;
|
|
|
|
u.l = 1;
|
|
|
|
exit (u.c[sizeof (long) - 1] == 1);
|
1994-07-19 22:44:16 +08:00
|
|
|
}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_c_bigendian)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_c_bigendian = yes; then
|
|
|
|
AC_DEFINE(WORDS_BIGENDIAN)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_C_INLINE,
|
1994-08-29 08:08:38 +08:00
|
|
|
[AC_MSG_CHECKING([for inline])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_c_inline,
|
|
|
|
[if test "$GCC" = yes; then
|
1994-10-23 10:08:04 +08:00
|
|
|
AC_TRY_COMPILE(, [} inline foo() {], ac_cv_c_inline=yes, ac_cv_c_inline=no)
|
1994-07-19 22:44:16 +08:00
|
|
|
else
|
|
|
|
ac_cv_c_inline=no
|
|
|
|
fi])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_c_inline)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_c_inline = no; then
|
|
|
|
AC_DEFINE(inline, __inline)
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_C_CONST,
|
1994-08-11 00:47:42 +08:00
|
|
|
[dnl This message is consistent in form with the other checking messages,
|
|
|
|
dnl and with the result message.
|
|
|
|
AC_MSG_CHECKING([for working const])
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_c_const,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_TRY_COMPILE(,
|
1994-08-24 14:41:01 +08:00
|
|
|
changequote(<<, >>)dnl
|
|
|
|
<<
|
|
|
|
/* Ultrix mips cc rejects this. */
|
1993-10-16 06:51:22 +08:00
|
|
|
typedef int charset[2]; const charset x;
|
|
|
|
/* SunOS 4.1.1 cc rejects this. */
|
|
|
|
char const *const *ccp;
|
|
|
|
char **p;
|
1994-10-02 12:34:40 +08:00
|
|
|
/* NEC SVR4.0.2 mips cc rejects this. */
|
|
|
|
struct point {int x, y;};
|
|
|
|
static struct point const zero;
|
1993-10-16 06:51:22 +08:00
|
|
|
/* AIX XL C 1.02.0.0 rejects this.
|
|
|
|
It does not let you subtract one const X* pointer from another in an arm
|
|
|
|
of an if-expression whose if-part is not a constant expression */
|
|
|
|
const char *g = "string";
|
|
|
|
ccp = &g + (g ? g-g : 0);
|
|
|
|
/* HPUX 7.0 cc rejects these. */
|
|
|
|
++ccp;
|
|
|
|
p = (char**) ccp;
|
|
|
|
ccp = (char const *const *) p;
|
|
|
|
{ /* SCO 3.2v4 cc rejects this. */
|
|
|
|
char *t;
|
|
|
|
char const *s = 0 ? (char *) 0 : (char const *) 0;
|
|
|
|
|
|
|
|
*t++ = 0;
|
|
|
|
}
|
|
|
|
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
|
1994-08-01 21:44:22 +08:00
|
|
|
int x[] = {25, 17};
|
1993-10-16 06:51:22 +08:00
|
|
|
const int *foo = &x[0];
|
|
|
|
++foo;
|
|
|
|
}
|
|
|
|
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
|
|
|
|
typedef const int *iptr;
|
|
|
|
iptr p = 0;
|
|
|
|
++p;
|
|
|
|
}
|
|
|
|
{ /* AIX XL C 1.02.0.0 rejects this saying
|
|
|
|
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
|
|
|
|
struct s { int j; const int *ap[3]; };
|
|
|
|
struct s *b; b->j = 5;
|
|
|
|
}
|
|
|
|
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
|
|
|
|
const int foo = 10;
|
1994-08-24 14:41:01 +08:00
|
|
|
}
|
|
|
|
>>,
|
1994-08-01 21:44:22 +08:00
|
|
|
changequote([, ])dnl
|
1994-08-24 14:41:01 +08:00
|
|
|
ac_cv_c_const=yes, ac_cv_c_const=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_c_const)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_c_const = no; then
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_DEFINE(const, )
|
1994-07-19 22:44:16 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-09-28 06:05:22 +08:00
|
|
|
define(AC_ARG_ARRAY,
|
1994-08-29 07:50:02 +08:00
|
|
|
[errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments
|
1994-09-01 12:59:32 +08:00
|
|
|
)m4exit(4)])
|
|
|
|
|
|
|
|
|
1994-05-08 10:29:55 +08:00
|
|
|
dnl ### Checks for operating system services
|
1994-09-01 12:59:32 +08:00
|
|
|
|
|
|
|
|
1994-08-24 22:09:18 +08:00
|
|
|
AC_DEFUN(AC_SYS_INTERPRETER,
|
1994-08-26 10:08:08 +08:00
|
|
|
[# Pull the hash mark out of the macro call to avoid m4 problems.
|
|
|
|
ac_msg="whether #! works in shell scripts"
|
|
|
|
AC_MSG_CHECKING($ac_msg)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_sys_interpreter,
|
1995-02-07 07:31:34 +08:00
|
|
|
[echo '#! /bin/cat
|
1993-10-16 06:51:22 +08:00
|
|
|
exit 69
|
|
|
|
' > conftest
|
|
|
|
chmod u+x conftest
|
1994-08-26 09:15:45 +08:00
|
|
|
(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null)
|
1993-10-16 06:51:22 +08:00
|
|
|
if test $? -ne 69; then
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_sys_interpreter=yes
|
1993-10-16 06:51:22 +08:00
|
|
|
else
|
1994-07-19 22:44:16 +08:00
|
|
|
ac_cv_sys_interpreter=no
|
|
|
|
fi
|
|
|
|
rm -f conftest])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_sys_interpreter)
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-09-28 06:05:22 +08:00
|
|
|
define(AC_HAVE_POUNDBANG,
|
1994-08-29 07:50:02 +08:00
|
|
|
[errprint(__file__:__line__: [$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments
|
1994-09-01 12:59:32 +08:00
|
|
|
])m4exit(4)])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_SYS_LONG_FILE_NAMES,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING(for long file names)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_sys_long_file_names,
|
|
|
|
[ac_cv_sys_long_file_names=yes
|
1993-10-16 06:51:22 +08:00
|
|
|
# Test for long file names in all the places we know might matter:
|
|
|
|
# . the current directory, where building will happen
|
|
|
|
# /tmp where it might want to write temporary files
|
|
|
|
# /var/tmp likewise
|
|
|
|
# /usr/tmp likewise
|
|
|
|
# $prefix/lib where we will be installing things
|
|
|
|
# $exec_prefix/lib likewise
|
|
|
|
# eval it to expand exec_prefix.
|
1994-03-18 16:00:54 +08:00
|
|
|
for ac_dir in `eval echo . /tmp /var/tmp /usr/tmp $prefix/lib $exec_prefix/lib` ; do
|
|
|
|
test -d $ac_dir || continue
|
1994-05-18 03:25:23 +08:00
|
|
|
test -w $ac_dir || continue # It is less confusing to not echo anything here.
|
1994-03-18 16:00:54 +08:00
|
|
|
(echo 1 > $ac_dir/conftest9012345) 2>/dev/null
|
|
|
|
(echo 2 > $ac_dir/conftest9012346) 2>/dev/null
|
|
|
|
val=`cat $ac_dir/conftest9012345 2>/dev/null`
|
1994-07-19 22:44:16 +08:00
|
|
|
if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
|
|
|
|
ac_cv_sys_long_file_names=no
|
1994-08-26 09:15:45 +08:00
|
|
|
rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
|
1994-07-19 22:44:16 +08:00
|
|
|
break
|
|
|
|
fi
|
1994-08-26 09:15:45 +08:00
|
|
|
rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
|
1994-07-19 22:44:16 +08:00
|
|
|
done])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_sys_long_file_names)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_sys_long_file_names = yes; then
|
|
|
|
AC_DEFINE(HAVE_LONG_FILE_NAMES)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_MSG_CHECKING(for restartable system calls)
|
1994-07-19 22:44:16 +08:00
|
|
|
AC_CACHE_VAL(ac_cv_sys_restartable_syscalls,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_TRY_RUN(
|
1993-10-16 06:51:22 +08:00
|
|
|
[/* Exit 0 (true) if wait returns something other than -1,
|
|
|
|
i.e. the pid of the child, which means that wait was restarted
|
|
|
|
after getting the signal. */
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <signal.h>
|
|
|
|
ucatch (isig) { }
|
|
|
|
main () {
|
|
|
|
int i = fork (), status;
|
|
|
|
if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
|
|
|
|
signal (SIGINT, ucatch);
|
|
|
|
status = wait(&i);
|
|
|
|
if (status == -1) wait(&i);
|
|
|
|
exit (status == -1);
|
|
|
|
}
|
1994-07-19 22:44:16 +08:00
|
|
|
], ac_cv_sys_restartable_syscalls=yes, ac_cv_sys_restartable_syscalls=no)])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT($ac_cv_sys_restartable_syscalls)
|
1994-07-19 22:44:16 +08:00
|
|
|
if test $ac_cv_sys_restartable_syscalls = yes; then
|
|
|
|
AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PATH_X,
|
1994-08-01 21:44:22 +08:00
|
|
|
[AC_REQUIRE_CPP()dnl Set CPP; we run AC_PATH_X_DIRECT conditionally.
|
1994-08-24 04:24:36 +08:00
|
|
|
# If we find X, set shell vars x_includes and x_libraries to the
|
|
|
|
# paths, otherwise set no_x=yes.
|
|
|
|
# Uses ac_ vars as temps to allow command line to override cache and checks.
|
|
|
|
# --without-x overrides everything else, but does not touch the cache.
|
|
|
|
AC_MSG_CHECKING(for X)
|
1994-07-19 22:44:16 +08:00
|
|
|
|
1994-09-06 04:12:21 +08:00
|
|
|
AC_ARG_WITH(x, [ --with-x use the X Window System])
|
1994-08-24 04:24:36 +08:00
|
|
|
if test "x$with_x" = xno; then
|
|
|
|
no_x=yes
|
1994-07-19 22:44:16 +08:00
|
|
|
else
|
1994-08-24 04:24:36 +08:00
|
|
|
if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
|
|
|
|
no_x=
|
|
|
|
else
|
|
|
|
AC_CACHE_VAL(ac_cv_path_x,
|
|
|
|
[# One or both of the vars are not set, and there is no cached value.
|
|
|
|
no_x=yes
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_PATH_X_XMKMF
|
1994-08-24 04:24:36 +08:00
|
|
|
if test "$no_x" = yes; then
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_PATH_X_DIRECT
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-08-24 04:24:36 +08:00
|
|
|
if test "$no_x" = yes; then
|
|
|
|
ac_cv_path_x="no_x=yes"
|
|
|
|
else
|
|
|
|
ac_cv_path_x="no_x= ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
|
|
|
|
fi])dnl
|
|
|
|
fi
|
|
|
|
eval "$ac_cv_path_x"
|
|
|
|
fi # $with_x != no
|
1994-07-19 22:44:16 +08:00
|
|
|
|
1994-08-24 04:24:36 +08:00
|
|
|
if test "$no_x" = yes; then
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
else
|
|
|
|
test "x$x_includes" = xNONE && x_includes=$ac_x_includes
|
|
|
|
test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
|
|
|
|
ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
|
|
|
|
AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
|
1994-07-19 22:44:16 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-01 21:44:22 +08:00
|
|
|
dnl Internal subroutine of AC_PATH_X.
|
1994-08-24 04:24:36 +08:00
|
|
|
dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes).
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PATH_X_XMKMF,
|
1994-08-24 04:24:36 +08:00
|
|
|
[rm -fr conftestdir
|
1993-10-16 06:51:22 +08:00
|
|
|
if mkdir conftestdir; then
|
|
|
|
cd conftestdir
|
1994-04-19 10:24:21 +08:00
|
|
|
# Make sure to not put "make" in the Imakefile rules, since we grep it out.
|
1993-11-06 12:31:14 +08:00
|
|
|
cat > Imakefile <<'EOF'
|
1993-10-16 06:51:22 +08:00
|
|
|
acfindx:
|
1994-04-19 10:24:21 +08:00
|
|
|
@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
|
1993-10-16 06:51:22 +08:00
|
|
|
EOF
|
|
|
|
if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
|
|
|
|
no_x=
|
|
|
|
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
|
1993-12-10 19:35:21 +08:00
|
|
|
eval `make acfindx 2>/dev/null | grep -v make`
|
1993-10-16 06:51:22 +08:00
|
|
|
# Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
|
1994-04-20 03:15:17 +08:00
|
|
|
if test ! -f $ac_im_usrlibdir/libX11.a && test -f $ac_im_libdir/libX11.a
|
|
|
|
then
|
1994-04-19 10:24:21 +08:00
|
|
|
ac_im_usrlibdir=$ac_im_libdir
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-04-19 10:24:21 +08:00
|
|
|
case "$ac_im_incroot" in
|
1993-10-16 06:51:22 +08:00
|
|
|
/usr/include) ;;
|
1994-08-24 04:24:36 +08:00
|
|
|
*) ac_x_includes="$ac_im_incroot" ;;
|
1993-10-16 06:51:22 +08:00
|
|
|
esac
|
1994-04-19 10:24:21 +08:00
|
|
|
case "$ac_im_usrlibdir" in
|
1993-10-16 06:51:22 +08:00
|
|
|
/usr/lib | /lib) ;;
|
1994-08-24 04:24:36 +08:00
|
|
|
*) ac_x_libraries="$ac_im_usrlibdir" ;;
|
1993-10-16 06:51:22 +08:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
cd ..
|
|
|
|
rm -fr conftestdir
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-08-01 21:44:22 +08:00
|
|
|
dnl Internal subroutine of AC_PATH_X.
|
1994-08-24 04:24:36 +08:00
|
|
|
dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes).
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PATH_X_DIRECT,
|
1994-08-24 04:24:36 +08:00
|
|
|
[test -z "$x_direct_test_library" && x_direct_test_library=Xt
|
1994-09-01 12:59:32 +08:00
|
|
|
test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
|
1994-08-11 07:54:30 +08:00
|
|
|
test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
|
1994-09-01 12:59:32 +08:00
|
|
|
AC_TRY_CPP([#include <$x_direct_test_include>],
|
|
|
|
[no_x= ac_x_includes=],
|
1994-08-24 04:24:36 +08:00
|
|
|
[ for ac_dir in \
|
1993-12-07 12:40:53 +08:00
|
|
|
/usr/X11R6/include \
|
|
|
|
/usr/X11R5/include \
|
|
|
|
/usr/X11R4/include \
|
|
|
|
\
|
|
|
|
/usr/include/X11R6 \
|
|
|
|
/usr/include/X11R5 \
|
|
|
|
/usr/include/X11R4 \
|
|
|
|
\
|
|
|
|
/usr/local/X11R6/include \
|
|
|
|
/usr/local/X11R5/include \
|
|
|
|
/usr/local/X11R4/include \
|
|
|
|
\
|
|
|
|
/usr/local/include/X11R6 \
|
|
|
|
/usr/local/include/X11R5 \
|
|
|
|
/usr/local/include/X11R4 \
|
|
|
|
\
|
|
|
|
/usr/X11/include \
|
|
|
|
/usr/include/X11 \
|
|
|
|
/usr/local/X11/include \
|
|
|
|
/usr/local/include/X11 \
|
|
|
|
\
|
|
|
|
/usr/X386/include \
|
|
|
|
/usr/x386/include \
|
|
|
|
/usr/XFree86/include/X11 \
|
|
|
|
\
|
|
|
|
/usr/include \
|
|
|
|
/usr/local/include \
|
|
|
|
/usr/unsupported/include \
|
|
|
|
/usr/athena/include \
|
|
|
|
/usr/local/x11r5/include \
|
|
|
|
/usr/lpp/Xamples/include \
|
1994-04-09 01:27:41 +08:00
|
|
|
\
|
|
|
|
/usr/openwin/include \
|
|
|
|
/usr/openwin/share/include \
|
1993-10-16 06:51:22 +08:00
|
|
|
; \
|
|
|
|
do
|
1994-08-11 07:54:30 +08:00
|
|
|
if test -r "$ac_dir/$x_direct_test_include"; then
|
1994-08-24 04:24:36 +08:00
|
|
|
no_x= ac_x_includes=$ac_dir
|
1993-10-16 06:51:22 +08:00
|
|
|
break
|
|
|
|
fi
|
1994-08-24 04:24:36 +08:00
|
|
|
done])
|
1993-10-16 06:51:22 +08:00
|
|
|
|
1994-09-01 12:59:32 +08:00
|
|
|
# Check for the libraries.
|
|
|
|
# See if we find them without any special options.
|
|
|
|
# Don't add to $LIBS permanently.
|
1994-09-13 23:20:48 +08:00
|
|
|
ac_save_LIBS="$LIBS"
|
|
|
|
LIBS="$LIBS -l$x_direct_test_library"
|
1994-09-01 12:59:32 +08:00
|
|
|
AC_TRY_LINK(, [${x_direct_test_function}()],
|
1994-09-13 23:20:48 +08:00
|
|
|
[LIBS="$ac_save_LIBS" no_x= ac_x_libraries=],
|
|
|
|
[LIBS="$ac_save_LIBS"
|
1994-09-01 12:59:32 +08:00
|
|
|
# First see if replacing the include by lib works.
|
|
|
|
for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
|
1993-12-07 12:40:53 +08:00
|
|
|
/usr/X11R6/lib \
|
|
|
|
/usr/X11R5/lib \
|
|
|
|
/usr/X11R4/lib \
|
|
|
|
\
|
|
|
|
/usr/lib/X11R6 \
|
|
|
|
/usr/lib/X11R5 \
|
|
|
|
/usr/lib/X11R4 \
|
|
|
|
\
|
|
|
|
/usr/local/X11R6/lib \
|
|
|
|
/usr/local/X11R5/lib \
|
|
|
|
/usr/local/X11R4/lib \
|
|
|
|
\
|
|
|
|
/usr/local/lib/X11R6 \
|
|
|
|
/usr/local/lib/X11R5 \
|
|
|
|
/usr/local/lib/X11R4 \
|
|
|
|
\
|
|
|
|
/usr/X11/lib \
|
|
|
|
/usr/lib/X11 \
|
|
|
|
/usr/local/X11/lib \
|
|
|
|
/usr/local/lib/X11 \
|
|
|
|
\
|
|
|
|
/usr/X386/lib \
|
|
|
|
/usr/x386/lib \
|
|
|
|
/usr/XFree86/lib/X11 \
|
|
|
|
\
|
|
|
|
/usr/lib \
|
|
|
|
/usr/local/lib \
|
|
|
|
/usr/unsupported/lib \
|
|
|
|
/usr/athena/lib \
|
|
|
|
/usr/local/x11r5/lib \
|
|
|
|
/usr/lpp/Xamples/lib \
|
1994-04-09 01:27:41 +08:00
|
|
|
\
|
|
|
|
/usr/openwin/lib \
|
|
|
|
/usr/openwin/share/lib \
|
1993-12-07 12:40:53 +08:00
|
|
|
; \
|
1993-10-16 06:51:22 +08:00
|
|
|
do
|
1994-03-18 16:00:54 +08:00
|
|
|
for ac_extension in a so sl; do
|
1994-08-11 07:54:30 +08:00
|
|
|
if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
|
1994-08-24 04:24:36 +08:00
|
|
|
no_x= ac_x_libraries=$ac_dir
|
1993-10-16 06:51:22 +08:00
|
|
|
break 2
|
|
|
|
fi
|
|
|
|
done
|
1994-09-01 12:59:32 +08:00
|
|
|
done])])
|
|
|
|
|
1994-03-18 16:00:54 +08:00
|
|
|
dnl Find additional X libraries, magic flags, etc.
|
1994-08-13 10:19:11 +08:00
|
|
|
AC_DEFUN(AC_PATH_XTRA,
|
1994-09-10 04:13:30 +08:00
|
|
|
[AC_REQUIRE([AC_ISC_POSIX])dnl
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_REQUIRE([AC_PATH_X])dnl
|
1994-08-24 04:24:36 +08:00
|
|
|
if test "$no_x" = yes; then
|
1994-05-18 03:25:23 +08:00
|
|
|
# Not all programs may use this symbol, but it does not hurt to define it.
|
1994-03-18 16:00:54 +08:00
|
|
|
X_CFLAGS="$X_CFLAGS -DX_DISPLAY_MISSING"
|
1994-08-24 04:24:36 +08:00
|
|
|
else
|
|
|
|
if test -n "$x_includes"; then
|
|
|
|
X_CFLAGS="$X_CFLAGS -I$x_includes"
|
|
|
|
fi
|
1994-03-18 16:00:54 +08:00
|
|
|
|
1994-08-24 04:24:36 +08:00
|
|
|
# It would be nice to have a more robust check for the -R ld option than
|
|
|
|
# just checking for Solaris.
|
|
|
|
# It would also be nice to do this for all -L options, not just this one.
|
|
|
|
if test -n "$x_libraries"; then
|
|
|
|
X_LIBS="$X_LIBS -L$x_libraries"
|
|
|
|
if test "`(uname) 2>/dev/null`" = SunOS &&
|
|
|
|
uname -r | grep '^5' >/dev/null; then
|
|
|
|
X_LIBS="$X_LIBS -R$x_libraries"
|
|
|
|
fi
|
1994-03-18 16:00:54 +08:00
|
|
|
fi
|
|
|
|
|
1994-10-12 01:23:26 +08:00
|
|
|
# Check for libraries that X11R6 Xt/Xaw programs need.
|
1994-08-26 05:55:22 +08:00
|
|
|
|
|
|
|
ac_save_LDFLAGS="$LDFLAGS"
|
|
|
|
LDFLAGS="$LDFLAGS -L$x_libraries"
|
1994-10-12 01:23:26 +08:00
|
|
|
# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
|
|
|
|
# check for ICE first), but we must link in the order -lSM -lICE or
|
|
|
|
# we get undefined symbols. So assume we have SM if we have ICE.
|
|
|
|
# These have to be linked with before -lX11, unlike the other
|
|
|
|
# libraries we check for below, so use a different variable.
|
|
|
|
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
|
1995-02-07 07:31:34 +08:00
|
|
|
AC_CHECK_LIB(ICE, IceConnectionNumber,
|
1994-10-12 01:23:26 +08:00
|
|
|
[X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"])
|
1994-08-26 05:55:22 +08:00
|
|
|
LDFLAGS="$ac_save_LDFLAGS"
|
|
|
|
|
|
|
|
# Check for system-dependent libraries X programs must link with.
|
1994-03-18 16:00:54 +08:00
|
|
|
|
1994-08-24 04:24:36 +08:00
|
|
|
if test "$ISC" = yes; then
|
|
|
|
X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
|
|
|
|
else
|
|
|
|
# Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
|
|
|
|
# libraries were built with DECnet support. And karl@cs.umb.edu says
|
|
|
|
# the Alpha needs dnet_stub (dnet does not exist).
|
1994-09-01 12:59:32 +08:00
|
|
|
AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
|
|
|
|
if test $ac_cv_lib_dnet = no; then
|
1994-08-24 04:24:36 +08:00
|
|
|
AC_CHECK_LIB(dnet_stub, dnet_ntoa,
|
|
|
|
[X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
|
|
|
|
fi
|
1994-08-26 05:55:22 +08:00
|
|
|
|
1994-08-28 08:24:09 +08:00
|
|
|
# msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
|
|
|
|
# to get the SysV transport functions.
|
1994-09-09 04:42:23 +08:00
|
|
|
# Not sure which flavor of 386 UNIX this is, but it seems harmless to
|
1994-08-26 05:55:22 +08:00
|
|
|
# check for it.
|
1994-08-28 08:24:09 +08:00
|
|
|
AC_CHECK_LIB(nsl, t_accept, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"])
|
1994-08-26 05:55:22 +08:00
|
|
|
|
1994-08-24 04:24:36 +08:00
|
|
|
# lieder@skyler.mavd.honeywell.com says without -lsocket,
|
|
|
|
# socket/setsockopt and other routines are undefined under SCO ODT 2.0.
|
|
|
|
# But -lsocket is broken on IRIX, according to simon@lia.di.epfl.ch.
|
|
|
|
if test "`(uname) 2>/dev/null`" != IRIX; then
|
|
|
|
AC_CHECK_LIB(socket, socket, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lsocket"])
|
|
|
|
fi
|
1994-04-09 01:27:41 +08:00
|
|
|
fi
|
1994-03-18 16:00:54 +08:00
|
|
|
fi
|
|
|
|
AC_SUBST(X_CFLAGS)dnl
|
1994-10-12 01:23:26 +08:00
|
|
|
AC_SUBST(X_PRE_LIBS)dnl
|
1994-03-18 16:00:54 +08:00
|
|
|
AC_SUBST(X_LIBS)dnl
|
1994-04-21 01:17:01 +08:00
|
|
|
AC_SUBST(X_EXTRA_LIBS)dnl
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
|
1994-05-08 10:29:55 +08:00
|
|
|
dnl ### Checks for UNIX variants
|
1994-09-10 04:13:30 +08:00
|
|
|
dnl These are kludges which should be replaced by a single POSIX check.
|
1994-09-01 12:59:32 +08:00
|
|
|
|
|
|
|
|
1994-09-10 04:13:30 +08:00
|
|
|
AC_DEFUN(AC_AIX,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
|
|
|
|
AC_BEFORE([$0], [AC_TRY_LINK])dnl
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_BEFORE([$0], [AC_TRY_RUN])dnl
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_CHECKING(for AIX)
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_EGREP_CPP(yes,
|
1993-10-16 06:51:22 +08:00
|
|
|
[#ifdef _AIX
|
|
|
|
yes
|
|
|
|
#endif
|
1994-08-11 00:47:42 +08:00
|
|
|
], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no))
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-09-10 04:13:30 +08:00
|
|
|
AC_DEFUN(AC_MINIX,
|
1994-10-23 10:08:04 +08:00
|
|
|
[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
|
|
|
|
AC_BEFORE([$0], [AC_TRY_LINK])dnl
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_BEFORE([$0], [AC_TRY_RUN])dnl
|
|
|
|
AC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=)
|
1994-05-05 20:48:28 +08:00
|
|
|
if test "$MINIX" = yes; then
|
1993-10-16 06:51:22 +08:00
|
|
|
AC_DEFINE(_POSIX_SOURCE)
|
|
|
|
AC_DEFINE(_POSIX_1_SOURCE, 2)
|
|
|
|
AC_DEFINE(_MINIX)
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-09-10 04:13:30 +08:00
|
|
|
AC_DEFUN(AC_ISC_POSIX,
|
1994-08-13 10:19:11 +08:00
|
|
|
[AC_BEFORE([$0], [AC_TRY_LINK])dnl
|
1994-10-23 10:08:04 +08:00
|
|
|
AC_BEFORE([$0], [AC_TRY_LINK])dnl
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_BEFORE([$0], [AC_TRY_RUN])dnl
|
|
|
|
AC_MSG_CHECKING(for POSIXized ISC)
|
1993-10-16 06:51:22 +08:00
|
|
|
if test -d /etc/conf/kconfig.d &&
|
|
|
|
grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1
|
|
|
|
then
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT(yes)
|
1994-05-05 20:48:28 +08:00
|
|
|
ISC=yes # If later tests want to check for ISC.
|
1993-10-16 06:51:22 +08:00
|
|
|
AC_DEFINE(_POSIX_SOURCE)
|
1994-06-23 02:22:34 +08:00
|
|
|
if test "$GCC" = yes; then
|
1993-10-16 06:51:22 +08:00
|
|
|
CC="$CC -posix"
|
|
|
|
else
|
|
|
|
CC="$CC -Xp"
|
|
|
|
fi
|
1994-05-05 20:48:28 +08:00
|
|
|
else
|
1994-08-11 00:47:42 +08:00
|
|
|
AC_MSG_RESULT(no)
|
1994-05-05 20:48:28 +08:00
|
|
|
ISC=
|
1993-10-16 06:51:22 +08:00
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-09-09 04:42:23 +08:00
|
|
|
AC_DEFUN(AC_XENIX_DIR,
|
|
|
|
[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl
|
|
|
|
AC_REQUIRE([AC_DIR_HEADER])dnl
|
1994-08-01 21:44:22 +08:00
|
|
|
AC_MSG_CHECKING(for Xenix)
|
|
|
|
AC_EGREP_CPP(yes,
|
1993-10-16 06:51:22 +08:00
|
|
|
[#if defined(M_XENIX) && !defined(M_UNIX)
|
|
|
|
yes
|
|
|
|
#endif
|
1994-08-13 10:19:11 +08:00
|
|
|
], [AC_MSG_RESULT(yes); XENIX=yes], [AC_MSG_RESULT(no); XENIX=])
|
1994-05-05 20:48:28 +08:00
|
|
|
if test "$XENIX" = yes; then
|
1994-09-09 04:42:23 +08:00
|
|
|
# Make sure -ldir precedes -lx.
|
|
|
|
test $ac_header_dirent = dirent.h && LIBS="$LIBS -ldir"
|
1993-10-16 06:51:22 +08:00
|
|
|
LIBS="$LIBS -lx"
|
|
|
|
fi
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-09-09 04:42:23 +08:00
|
|
|
AC_DEFUN(AC_DYNIX_SEQ,
|
|
|
|
[AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT])dnl
|
|
|
|
AC_CHECK_LIB(seq, getmntent, LIBS="$LIBS -lseq")
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-09-09 04:42:23 +08:00
|
|
|
AC_DEFUN(AC_IRIX_SUN,
|
1994-09-10 04:13:30 +08:00
|
|
|
[AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT or AC_CHECK_LIB(sun, getpwnam)])dnl
|
1994-09-09 04:42:23 +08:00
|
|
|
AC_CHECK_LIB(sun, getmntent, LIBS="$LIBS -lsun")
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|
|
|
|
|
1994-09-09 04:42:23 +08:00
|
|
|
AC_DEFUN(AC_SCO_INTL,
|
|
|
|
[AC_OBSOLETE([$0], [; instead use AC_FUNC_STRFTIME])dnl
|
|
|
|
AC_CHECK_LIB(intl, strftime, LIBS="$LIBS -lintl")
|
1994-09-01 12:59:32 +08:00
|
|
|
])
|