annotate lib-autoconf-1/acspecific.m4 @ 58:8b0bdfdf0cf0 r19-16-pre4

Import from CVS: tag r19-16-pre4
author cvs
date Mon, 13 Aug 2007 08:58:37 +0200
parents 56c54cf7c5b6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
48
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1 dnl Macros that test for specific features.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
2 dnl This file is part of Autoconf.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
3 dnl Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
4 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
5 dnl This program is free software; you can redistribute it and/or modify
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
6 dnl it under the terms of the GNU General Public License as published by
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
7 dnl the Free Software Foundation; either version 2, or (at your option)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
8 dnl any later version.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
9 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
10 dnl This program is distributed in the hope that it will be useful,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
11 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
12 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
13 dnl GNU General Public License for more details.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
14 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
15 dnl You should have received a copy of the GNU General Public License
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
16 dnl along with this program; if not, write to the Free Software
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
17 dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
18 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
19 dnl Written by David MacKenzie, with help from
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
20 dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
21 dnl Roland McGrath, and Noah Friedman.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
22 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
23 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
24 dnl checks for programs
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
25 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
26 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
27 define(AC_PROG_CC,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
28 [AC_BEFORE([$0], [AC_PROG_CPP])AC_PROVIDE([$0])AC_PROGRAM_CHECK(CC, gcc, gcc, cc)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
29 # Find out if we are using GNU C, under whatever name.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
30 cat > conftest.c <<EOF
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
31 #ifdef __GNUC__
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
32 yes
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
33 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
34 EOF
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
35 ${CC-cc} -E conftest.c > conftest.out 2>&1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
36 if egrep yes conftest.out >/dev/null 2>&1; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
37 GCC=1 # For later tests.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
38 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
39 rm -f conftest*
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
40 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
41 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
42 define(AC_PROG_CXX,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
43 [AC_BEFORE([$0], [AC_PROG_CXXCPP])AC_PROVIDE([$0])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
44 AC_PROGRAMS_CHECK(CXX, $CCC c++ g++ gcc CC cxx, gcc)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
45 # Find out if we are using GNU C++, under whatever name.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
46 cat > conftest.C <<EOF
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
47 #ifdef __GNUC__
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
48 yes
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
49 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
50 EOF
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
51 ${CXX-gcc} -E conftest.C > conftest.out 2>&1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
52 if egrep yes conftest.out >/dev/null 2>&1; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
53 GXX=1 # For later tests.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
54 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
55 rm -f conftest*
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
56 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
57 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
58 define(AC_GCC_TRADITIONAL,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
59 [AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])if test -n "$GCC"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
60 AC_CHECKING(whether -traditional is needed)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
61 changequote(,)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
62 ac_pattern="Autoconf.*'x'"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
63 changequote([,])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
64 ac_prog='#include <sgtty.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
65 Autoconf TIOCGETP'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
66 AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_need_trad=1)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
67
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
68 if test -z "$ac_need_trad"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
69 ac_prog='#include <termio.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
70 Autoconf TCGETA'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
71 AC_PROGRAM_EGREP($ac_pattern, $ac_prog, ac_need_trad=1)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
72 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
73 test -n "$ac_need_trad" && CC="$CC -traditional"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
74 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
75 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
76 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
77 define(AC_MINUS_C_MINUS_O,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
78 [AC_CHECKING(whether $CC and cc understand -c and -o together)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
79 echo 'foo(){}' > conftest.c
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
80 # Make sure it works both with $CC and with simple cc.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
81 # We do the test twice because some compilers refuse to overwrite an
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
82 # existing .o file with -o, though they will create one.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
83 if ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
84 && test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o >/dev/null 2>&1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
85 then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
86 # Test first that cc exists at all.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
87 if cc -c conftest.c >/dev/null 2>&1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
88 then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
89 if cc -c conftest.c -o conftest2.o >/dev/null 2>&1 && \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
90 test -f conftest2.o && cc -c conftest.c -o conftest2.o >/dev/null 2>&1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
91 then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
92 :
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
93 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
94 AC_DEFINE(NO_MINUS_C_MINUS_O)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
95 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
96 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
97 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
98 AC_DEFINE(NO_MINUS_C_MINUS_O)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
99 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
100 rm -f conftest*
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
101 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
102 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
103 dnl Define SET_MAKE to set ${MAKE} if make doesn't.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
104 define(AC_SET_MAKE,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
105 [cat > conftestmake <<'EOF'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
106 all:
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
107 @echo 'ac_maketemp="${MAKE}"'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
108 EOF
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
109 changequote(,)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
110 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
111 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
112 changequote([,])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
113 if test -n "$ac_maketemp"; then SET_MAKE=
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
114 else SET_MAKE="MAKE=${MAKE-make}"; fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
115 rm -f conftestmake
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
116 AC_SUBST([SET_MAKE])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
117 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
118 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
119 define(AC_PROG_RANLIB, [AC_PROGRAM_CHECK(RANLIB, ranlib, ranlib, :)])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
120 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
121 define(AC_PROG_AWK, [AC_PROGRAMS_CHECK(AWK, mawk gawk nawk awk,)])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
122 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
123 define(AC_PROG_YACC,[AC_PROGRAMS_CHECK(YACC, 'bison -y' byacc, yacc)])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
124 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
125 define(AC_PROG_CPP,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
126 [AC_PROVIDE([$0])AC_CHECKING(how to run the C preprocessor)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
127 if test -z "$CPP"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
128 # This must be in double quotes, not single quotes, because CPP may get
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
129 # substituted into the Makefile and ``${CC-cc}'' will simply confuse
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
130 # make. It must be expanded now.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
131 CPP="${CC-cc} -E"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
132 dnl On the NeXT, cc -E runs the code through the compiler's parser,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
133 dnl not just through cpp.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
134 AC_TEST_CPP([#include <stdio.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
135 Syntax Error], ,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
136 CPP="${CC-cc} -E -traditional-cpp"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
137 AC_TEST_CPP([#include <stdio.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
138 Syntax Error], ,CPP=/lib/cpp))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
139 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
140 AC_VERBOSE(setting CPP to $CPP)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
141 AC_SUBST(CPP)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
142 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
143 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
144 define(AC_PROG_CXXCPP,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
145 [AC_PROVIDE([$0])AC_CHECKING(how to run the C++ preprocessor)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
146 AC_LANG_SAVE[]dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
147 AC_LANG_CPLUSPLUS[]dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
148 if test -z "$CXXCPP"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
149 CXXCPP="${CXX-c++} -E"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
150 AC_TEST_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
151 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
152 AC_VERBOSE(setting CXXCPP to $CXXCPP)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
153 AC_LANG_RESTORE[]dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
154 AC_SUBST(CXXCPP)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
155 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
156 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
157 dnl Require finding the C or C++ preprocessor, whichever is the
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
158 dnl current language.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
159 define(AC_REQUIRE_CPP,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
160 [ifelse(AC_LANG,C,[AC_REQUIRE([AC_PROG_CPP])],[AC_REQUIRE([AC_PROG_CXXCPP])])])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
161 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
162 define(AC_PROG_LEX,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
163 [AC_PROVIDE([$0])AC_PROGRAM_CHECK(LEX, flex, flex, lex)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
164 if test -z "$LEXLIB"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
165 then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
166 case "$LEX" in
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
167 flex*) AC_HAVE_LIBRARY(fl, LEXLIB="-lfl") ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
168 *) LEXLIB="-ll" ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
169 esac
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
170 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
171 AC_VERBOSE(setting LEXLIB to $LEXLIB)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
172 AC_SUBST(LEXLIB)])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
173 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
174 define(AC_YYTEXT_POINTER,[dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
175 AC_REQUIRE_CPP()AC_REQUIRE([AC_PROG_LEX])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
176 AC_CHECKING(for yytext declaration)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
177 # POSIX says lex can declare yytext either as a pointer or an array; the
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
178 # default is implementation-dependent. Figure out which it is, since
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
179 # not all implementations provide the %pointer and %array declarations.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
180 #
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
181 # The minimal lex program is just a single line: %%. But some broken lexes
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
182 # (Solaris, I think it was) want two %% lines, so accommodate them.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
183 echo '%%
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
184 %%' | ${LEX}
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
185 if test -f lex.yy.c; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
186 LEX_OUTPUT_ROOT=lex.yy
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
187 elif test -f lexyy.c; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
188 LEX_OUTPUT_ROOT=lexyy
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
189 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
190 # Don't know what to do here.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
191 AC_ERROR(cannot find output from $LEX, giving up on yytext declaration)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
192 LEX_OUTPUT_ROOT=
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
193 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
194 if test -n "$LEX_OUTPUT_ROOT"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
195 echo 'extern char *yytext; main () { exit (0); }' >>$LEX_OUTPUT_ROOT.c
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
196 ac_save_LIBS="$LIBS"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
197 LIBS="$LIBS $LEXLIB"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
198 AC_TEST_PROGRAM(`cat $LEX_OUTPUT_ROOT.c`, AC_DEFINE(YYTEXT_POINTER))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
199 LIBS="$ac_save_LIBS"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
200 rm -f "${LEX_OUTPUT_ROOT}.c"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
201 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
202 AC_SUBST(LEX_OUTPUT_ROOT)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
203 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
204 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
205 define(AC_PROG_INSTALL,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
206 [# Make sure to not get the incompatible SysV /etc/install and
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
207 # /usr/sbin/install, which might be in PATH before a BSD-like install,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
208 # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
209 # or the AFS install, which mishandles nonexistent args, or
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
210 # /usr/ucb/install on SVR4, which tries to use the nonexistent group
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
211 # `staff', or /sbin/install on IRIX which has incompatible command-line
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
212 # syntax. Sigh.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
213 #
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
214 # On most BSDish systems install is in /usr/bin, not /usr/ucb
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
215 # anyway.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
216 # This turns out not to be true, so the mere pathname isn't an indication
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
217 # of whether the program works. What we really need is a set of tests for
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
218 # the install program to see if it actually works in all the required ways.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
219 #
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
220 # Avoid using ./install, which might have been erroneously created
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
221 # by make from ./install.sh.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
222 if test -z "${INSTALL}"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
223 AC_CHECKING(for a BSD compatible install)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
224 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
225 for ac_dir in $PATH; do
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
226 case "$ac_dir" in
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
227 ''|.|/etc|/sbin|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
228 *)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
229 # OSF1 and SCO ODT 3.0 have their own names for install.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
230 for ac_prog in installbsd scoinst install; do
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
231 if test -f $ac_dir/$ac_prog; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
232 if test $ac_prog = install &&
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
233 grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
234 # AIX install. It has an incompatible calling convention.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
235 # OSF/1 installbsd also uses dspmsg, but is usable.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
236 :
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
237 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
238 INSTALL="$ac_dir/$ac_prog -c"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
239 break 2
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
240 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
241 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
242 done
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
243 ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
244 esac
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
245 done
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
246 IFS="$ac_save_ifs"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
247 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
248
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
249 if test -z "$INSTALL"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
250 # As a last resort, use the slow shell script.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
251 for ac_dir in ${srcdir} ${srcdir}/.. ${srcdir}/../..; do
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
252 if test -f $ac_dir/install.sh; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
253 INSTALL="$ac_dir/install.sh -c"; break
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
254 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
255 done
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
256 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
257 if test -z "$INSTALL"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
258 AC_ERROR([can not find install.sh in ${srcdir} or ${srcdir}/.. or ${srcdir}/../..])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
259 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
260 AC_SUBST(INSTALL)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
261 AC_VERBOSE(setting INSTALL to $INSTALL)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
262
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
263 # Use test -z because SunOS4 sh mishandles ${INSTALL_PROGRAM-'${INSTALL}'}.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
264 # It thinks the first close brace ends the variable substitution.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
265 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
266 AC_SUBST(INSTALL_PROGRAM)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
267 AC_VERBOSE(setting INSTALL_PROGRAM to $INSTALL_PROGRAM)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
268
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
269 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
270 AC_SUBST(INSTALL_DATA)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
271 AC_VERBOSE(setting INSTALL_DATA to $INSTALL_DATA)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
272 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
273 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
274 define(AC_LN_S,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
275 [AC_CHECKING(for ln -s)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
276 rm -f conftestdata
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
277 if ln -s X conftestdata 2>/dev/null
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
278 then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
279 rm -f conftestdata
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
280 LN_S="ln -s"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
281 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
282 LN_S=ln
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
283 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
284 AC_SUBST(LN_S)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
285 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
286 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
287 define(AC_RSH,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
288 [AC_CHECKING(for remote shell)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
289 if test -f /usr/ucb/rsh || test -f /usr/bin/remsh || test -f /usr/bin/rsh ||
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
290 test -f /usr/bsd/rsh || test -f /usr/bin/nsh; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
291 RTAPELIB=rtapelib.o
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
292 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
293 AC_HEADER_CHECK(netdb.h, AC_DEFINE(HAVE_NETDB_H) RTAPELIB=rtapelib.o,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
294 AC_DEFINE(NO_REMOTE))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
295 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
296 AC_SUBST(RTAPELIB)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
297 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
298 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
299 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
300 dnl checks for header files
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
301 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
302 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
303 define(AC_STDC_HEADERS,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
304 [AC_REQUIRE_CPP()dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
305 AC_CHECKING(for ANSI C header files)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
306 AC_TEST_CPP([#include <stdlib.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
307 #include <stdarg.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
308 #include <string.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
309 #include <float.h>],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
310 [# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
311 AC_HEADER_EGREP(memchr, string.h,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
312 # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
313 AC_TEST_PROGRAM([#include <ctype.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
314 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
315 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
316 #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
317 int main () { int i; for (i = 0; i < 256; i++)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
318 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
319 exit (0); }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
320 ],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
321 [# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
322 AC_HEADER_EGREP(free, stdlib.h, AC_DEFINE(STDC_HEADERS))]))])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
323 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
324 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
325 define(AC_UNISTD_H, [AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(unistd.h)])AC_HEADER_CHECK(unistd.h,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
326 AC_DEFINE(HAVE_UNISTD_H))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
327 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
328 define(AC_USG,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
329 [AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(string.h) and HAVE_STRING_H])AC_COMPILE_CHECK([BSD string and memory functions],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
330 [#include <strings.h>], [rindex(0, 0); bzero(0, 0);], , AC_DEFINE(USG))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
331 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
332 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
333 dnl If memchr and the like aren't declared in <string.h>, include <memory.h>.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
334 dnl To avoid problems, don't check for gcc2 built-ins.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
335 define(AC_MEMORY_H,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
336 [AC_OBSOLETE([$0], [; instead use AC_HAVE_HEADERS(memory.h) and HAVE_MEMORY_H])AC_CHECKING(whether string.h declares mem functions)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
337 AC_HEADER_EGREP(memchr, string.h, ,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
338 AC_HEADER_CHECK(memory.h, AC_DEFINE(NEED_MEMORY_H)))]
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
339 )dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
340 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
341 define(AC_MAJOR_HEADER,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
342 [AC_COMPILE_CHECK([major, minor and makedev header],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
343 [#include <sys/types.h>],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
344 [return makedev(0, 0);], ac_makedev=1)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
345 if test -z "$ac_makedev"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
346 AC_HEADER_CHECK(sys/mkdev.h, AC_DEFINE(MAJOR_IN_MKDEV) ac_makedev=1)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
347 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
348 if test -z "$ac_makedev"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
349 AC_HEADER_CHECK(sys/sysmacros.h, AC_DEFINE(MAJOR_IN_SYSMACROS))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
350 fi]
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
351 )dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
352 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
353 define(AC_DIR_HEADER,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
354 [AC_PROVIDE([$0])AC_CHECKING(for directory library header)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
355 ac_dir_header=
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
356 AC_DIR_HEADER_CHECK(dirent.h, DIRENT)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
357 AC_DIR_HEADER_CHECK(sys/ndir.h, SYSNDIR)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
358 AC_DIR_HEADER_CHECK(sys/dir.h, SYSDIR)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
359 AC_DIR_HEADER_CHECK(ndir.h, NDIR)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
360
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
361 AC_CHECKING(for closedir return value)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
362 AC_TEST_PROGRAM([#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
363 #include <$ac_dir_header>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
364 int closedir(); main() { exit(closedir(opendir(".")) != 0); }], ,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
365 AC_DEFINE(VOID_CLOSEDIR))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
366 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
367 dnl Subroutine of AC_DIR_HEADER.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
368 dnl ??? I tried to put this define inside AC_DIR_HEADER, but when I did
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
369 dnl that, $1 and $2 did not get expanded. --roland
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
370 dnl Check if $1 is the winning directory library header file.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
371 dnl It must not only exist, but also correctly define the `DIR' type.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
372 dnl If it is really winning, define $2 and set shell var `ac_dir_header' to $1.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
373 define(AC_DIR_HEADER_CHECK, [dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
374 if test -z "$ac_dir_header"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
375 AC_COMPILE_CHECK($1, [#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
376 #include <]$1[>],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
377 [DIR *dirp = 0;],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
378 AC_DEFINE($2) ac_dir_header=$1)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
379 fi])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
380 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
381 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
382 dnl checks for typedefs
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
383 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
384 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
385 define(AC_GETGROUPS_T,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
386 [AC_REQUIRE([AC_UID_T])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
387 AC_CHECKING(for type of array argument to getgroups)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
388 changequote(,)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
389 dnl Do not put single quotes in the C program text!!
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
390 ac_prog='/* Thanks to Mike Rendell for this test. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
391 #include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
392 #define NGID 256
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
393 #undef MAX
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
394 #define MAX(x,y) ((x) > (y) ? (x) : (y))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
395 main()
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
396 {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
397 gid_t gidset[NGID];
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
398 int i, n;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
399 union { gid_t gval; long lval; } val;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
400
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
401 val.lval = -1;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
402 for (i = 0; i < NGID; i++)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
403 gidset[i] = val.gval;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
404 n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
405 gidset);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
406 /* Exit non-zero if getgroups seems to require an array of ints. This
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
407 happens when gid_t is short but getgroups modifies an array of ints. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
408 exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
409 }'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
410 changequote([,])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
411 AC_TEST_PROGRAM([$ac_prog],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
412 AC_DEFINE(GETGROUPS_T, gid_t),
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
413 AC_DEFINE(GETGROUPS_T, int))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
414 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
415 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
416 define(AC_UID_T,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
417 [AC_PROVIDE([$0])AC_CHECKING(for uid_t in sys/types.h)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
418 AC_HEADER_EGREP(uid_t, sys/types.h, ,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
419 AC_DEFINE(uid_t, int) AC_DEFINE(gid_t, int))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
420 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
421 define(AC_SIZE_T,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
422 [AC_CHECKING(for size_t in sys/types.h)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
423 AC_HEADER_EGREP(size_t, sys/types.h, , AC_DEFINE(size_t, unsigned))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
424 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
425 define(AC_PID_T,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
426 [AC_PROVIDE([$0])AC_CHECKING(for pid_t in sys/types.h)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
427 AC_HEADER_EGREP(pid_t, sys/types.h, , AC_DEFINE(pid_t, int))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
428 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
429 define(AC_OFF_T,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
430 [AC_PROVIDE([$0])AC_CHECKING(for off_t in sys/types.h)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
431 AC_HEADER_EGREP(off_t, sys/types.h, , AC_DEFINE(off_t, long))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
432 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
433 define(AC_MODE_T,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
434 [AC_CHECKING(for mode_t in sys/types.h)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
435 AC_HEADER_EGREP(mode_t, sys/types.h, , AC_DEFINE(mode_t, int))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
436 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
437 define(AC_RETSIGTYPE,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
438 [AC_PROVIDE([$0])AC_COMPILE_CHECK([return type of signal handlers],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
439 [#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
440 #include <signal.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
441 #ifdef signal
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
442 #undef signal
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
443 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
444 extern void (*signal ()) ();],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
445 [int i;],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
446 [AC_DEFINE(RETSIGTYPE, void)],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
447 [AC_DEFINE(RETSIGTYPE, int)])]
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
448 )dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
449 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
450 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
451 dnl checks for functions
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
452 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
453 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
454 define(AC_MMAP, [
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
455 AC_CHECKING(for working mmap)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
456 AC_TEST_PROGRAM([/* Thanks to Mike Haertel and Jim Avera for this test. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
457 #include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
458 #include <fcntl.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
459 #include <sys/mman.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
460
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
461 #ifdef BSD
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
462 #ifndef BSD4_1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
463 #define HAVE_GETPAGESIZE
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
464 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
465 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
466 #ifndef HAVE_GETPAGESIZE
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
467 #include <sys/param.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
468 #ifdef EXEC_PAGESIZE
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
469 #define getpagesize() EXEC_PAGESIZE
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
470 #else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
471 #ifdef NBPG
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
472 #define getpagesize() NBPG * CLSIZE
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
473 #ifndef CLSIZE
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
474 #define CLSIZE 1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
475 #endif /* no CLSIZE */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
476 #else /* no NBPG */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
477 #ifdef NBPC
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
478 #define getpagesize() NBPC
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
479 #else /* no NBPC */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
480 #define getpagesize() PAGESIZE /* SVR4 */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
481 #endif /* no NBPC */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
482 #endif /* no NBPG */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
483 #endif /* no EXEC_PAGESIZE */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
484 #endif /* not HAVE_GETPAGESIZE */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
485
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
486 #ifdef __osf__
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
487 #define valloc malloc
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
488 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
489
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
490 extern char *valloc();
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
491 extern char *malloc();
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
492
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
493 int
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
494 main()
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
495 {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
496 char *buf1, *buf2, *buf3;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
497 int i = getpagesize(), j;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
498 int i2 = getpagesize()*2;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
499 int fd;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
500
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
501 buf1 = valloc(i2);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
502 buf2 = valloc(i);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
503 buf3 = malloc(i2);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
504 for (j = 0; j < i2; ++j)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
505 *(buf1 + j) = rand();
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
506 fd = open("conftestmmap", O_CREAT | O_RDWR, 0666);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
507 write(fd, buf1, i2);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
508 mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
509 for (j = 0; j < i; ++j)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
510 if (*(buf1 + j) != *(buf2 + j))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
511 exit(1);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
512 lseek(fd, (long)i, 0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
513 read(fd, buf2, i); /* read into mapped memory -- file should not change */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
514 /* (it does in i386 SVR4.0 - Jim Avera) */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
515 lseek(fd, (long)0, 0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
516 read(fd, buf3, i2);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
517 for (j = 0; j < i2; ++j)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
518 if (*(buf1 + j) != *(buf3 + j))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
519 exit(1);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
520 exit(0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
521 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
522 ], AC_DEFINE(HAVE_MMAP))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
523 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
524 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
525 define(AC_VPRINTF,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
526 [AC_COMPILE_CHECK([vprintf], , [vprintf();], AC_DEFINE(HAVE_VPRINTF),
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
527 ac_vprintf_missing=1)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
528 if test -n "$ac_vprintf_missing"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
529 AC_COMPILE_CHECK([_doprnt], , [_doprnt();], AC_DEFINE(HAVE_DOPRNT))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
530 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
531 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
532 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
533 define(AC_VFORK,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
534 [AC_REQUIRE([AC_PID_T])AC_HEADER_CHECK(vfork.h, AC_DEFINE(HAVE_VFORK_H))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
535 AC_CHECKING(for working vfork)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
536 AC_REQUIRE([AC_RETSIGTYPE])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
537 AC_TEST_PROGRAM([/* Thanks to Paul Eggert for this test. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
538 #include <stdio.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
539 #include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
540 #include <sys/stat.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
541 #include <signal.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
542 #ifdef HAVE_UNISTD_H
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
543 #include <unistd.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
544 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
545 #ifdef HAVE_VFORK_H
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
546 #include <vfork.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
547 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
548 static int signalled;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
549 static RETSIGTYPE catch (s) int s; { signalled = 1; }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
550 main() {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
551 pid_t parent = getpid ();
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
552 pid_t child;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
553
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
554 signal (SIGINT, catch);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
555
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
556 child = vfork ();
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
557
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
558 if (child == 0) {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
559 /* On sparc systems, changes by the child to local and incoming
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
560 argument registers are propagated back to the parent.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
561 The compiler is told about this with #include <vfork.h>,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
562 but some compilers (e.g. gcc -O) don't grok <vfork.h>.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
563 Test for this by using lots of local variables, at least
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
564 as many local variables as main has allocated so far
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
565 including compiler temporaries. 4 locals are enough for
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
566 gcc 1.40.3 on a sparc, but we use 8 to be safe.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
567 A buggy compiler should reuse the register of parent
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
568 for one of the local variables, since it will think that
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
569 parent can't possibly be used any more in this routine.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
570 Assigning to the local variable will thus munge parent
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
571 in the parent process. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
572 pid_t
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
573 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
574 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
575 /* Convince the compiler that p..p7 are live; otherwise, it might
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
576 use the same hardware register for all 8 local variables. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
577 if (p != p1 || p != p2 || p != p3 || p != p4
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
578 || p != p5 || p != p6 || p != p7)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
579 _exit(1);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
580
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
581 /* On some systems (e.g. SunOS 5.2), if the parent is catching
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
582 a signal, the child ignores the signal before execing,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
583 and the parent later receives that signal, the parent dumps core.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
584 Test for this by ignoring SIGINT in the child. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
585 signal (SIGINT, SIG_IGN);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
586
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
587 /* On some systems (e.g. IRIX 3.3),
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
588 vfork doesn't separate parent from child file descriptors.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
589 If the child closes a descriptor before it execs or exits,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
590 this munges the parent's descriptor as well.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
591 Test for this by closing stdout in the child. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
592 _exit(close(fileno(stdout)) != 0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
593 } else {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
594 int status;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
595 struct stat st;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
596
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
597 while (wait(&status) != child)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
598 ;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
599 exit(
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
600 /* Was there some problem with vforking? */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
601 child < 0
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
602
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
603 /* Did the child fail? (This shouldn't happen.) */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
604 || status
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
605
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
606 /* Did the vfork/compiler bug occur? */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
607 || parent != getpid()
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
608
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
609 /* Did the signal handling bug occur? */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
610 || kill(parent, SIGINT) != 0
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
611 || signalled != 1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
612
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
613 /* Did the file descriptor bug occur? */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
614 || fstat(fileno(stdout), &st) != 0
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
615 );
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
616 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
617 }], , AC_DEFINE(vfork, fork))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
618 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
619 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
620 define(AC_WAIT3,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
621 [AC_CHECKING(for wait3 that fills in rusage)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
622 AC_TEST_PROGRAM([#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
623 #include <sys/time.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
624 #include <sys/resource.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
625 #include <stdio.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
626 /* HP-UX has wait3 but does not fill in rusage at all. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
627 main() {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
628 struct rusage r;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
629 int i;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
630 /* Use a field that we can force nonzero --
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
631 voluntary context switches.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
632 For systems like NeXT and OSF/1 that don't set it,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
633 also use the system CPU time. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
634 r.ru_nvcsw = 0;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
635 r.ru_stime.tv_sec = 0;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
636 r.ru_stime.tv_usec = 0;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
637 switch (fork()) {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
638 case 0: /* Child. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
639 sleep(1); /* Give up the CPU. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
640 _exit(0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
641 case -1: _exit(0); /* What can we do? */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
642 default: /* Parent. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
643 wait3(&i, 0, &r);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
644 sleep(1); /* Avoid "text file busy" from rm on fast HP-UX machines. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
645 exit(r.ru_nvcsw == 0
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
646 && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
647 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
648 }], AC_DEFINE(HAVE_WAIT3))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
649 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
650 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
651 define(AC_ALLOCA,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
652 [# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
653 # for constant arguments. Useless!
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
654 AC_COMPILE_CHECK(working alloca.h, [#include <alloca.h>],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
655 [char *p = alloca(2 * sizeof(int));], AC_DEFINE(HAVE_ALLOCA_H))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
656 ac_decl="#ifdef __GNUC__
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
657 #define alloca __builtin_alloca
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
658 #else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
659 #if HAVE_ALLOCA_H
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
660 #include <alloca.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
661 #else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
662 #ifdef _AIX
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
663 #pragma alloca
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
664 #else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
665 char *alloca ();
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
666 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
667 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
668 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
669 "
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
670 AC_COMPILE_CHECK([alloca], $ac_decl,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
671 [char *p = (char *) alloca(1);], [AC_DEFINE([HAVE_ALLOCA])], [dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
672 ac_alloca_missing=1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
673 AC_PROGRAM_EGREP(winnitude, [
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
674 #if defined(CRAY) && ! defined(CRAY2)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
675 winnitude
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
676 #else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
677 lossage
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
678 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
679 ],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
680 AC_FUNC_CHECK([_getb67],AC_DEFINE([CRAY_STACKSEG_END],[_getb67]),
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
681 AC_FUNC_CHECK([GETB67],AC_DEFINE([CRAY_STACKSEG_END],[GETB67]),
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
682 AC_FUNC_CHECK([getb67],AC_DEFINE([CRAY_STACKSEG_END],[getb67])))))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
683 ])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
684 if test -n "$ac_alloca_missing"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
685 # The SVR3 libPW and SVR4 libucb both contain incompatible functions
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
686 # that cause trouble. Some versions do not even contain alloca or
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
687 # contain a buggy version. If you still want to use their alloca,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
688 # use ar to extract alloca.o from them instead of compiling alloca.c.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
689 ALLOCA=alloca.o
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
690 AC_DEFINE(C_ALLOCA)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
691
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
692 AC_CHECKING(stack direction for C alloca)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
693 AC_TEST_PROGRAM([find_stack_direction ()
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
694 {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
695 static char *addr = 0;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
696 auto char dummy;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
697 if (addr == 0)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
698 {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
699 addr = &dummy;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
700 return find_stack_direction ();
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
701 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
702 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
703 return (&dummy > addr) ? 1 : -1;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
704 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
705 main ()
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
706 {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
707 exit (find_stack_direction() < 0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
708 }], dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
709 AC_DEFINE(STACK_DIRECTION,1), AC_DEFINE(STACK_DIRECTION,-1), dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
710 AC_DEFINE(STACK_DIRECTION,0))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
711 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
712 AC_SUBST(ALLOCA)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
713 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
714 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
715 define(AC_GETLOADAVG,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
716 [# Some definitions of getloadavg require that the program be installed setgid.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
717 AC_SUBST(NEED_SETGID)NEED_SETGID=false
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
718 ac_need_func=true
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
719
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
720 # Check for the 4.4BSD definition of getloadavg.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
721 AC_HAVE_LIBRARY(util, LIBS="$LIBS -lutil" ac_need_func=false)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
722 # Some systems with -lutil have (and need) -lkvm as well, some do not.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
723 AC_HAVE_LIBRARY(kvm, LIBS="$LIBS -lkvm")
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
724
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
725 if $ac_need_func; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
726 # There is a commonly available library for RS/6000 AIX.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
727 # Since it is not a standard part of AIX, it might be installed locally.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
728 LIBS_old="$LIBS"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
729 LIBS="-L/usr/local/lib $LIBS"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
730 AC_HAVE_LIBRARY(getloadavg, LIBS="$LIBS -lgetloadavg" ac_need_func=false,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
731 LIBS="$LIBS_old")
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
732 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
733
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
734 # Make sure it is really in the library, if we think we found it at all.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
735 AC_REPLACE_FUNCS(getloadavg)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
736
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
737 case "$LIBOBJS" in
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
738 *getloadavg*)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
739 ac_need_func=true
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
740 AC_HEADER_CHECK(sys/dg_sys_info.h, [dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
741 AC_DEFINE(DGUX) ac_need_func=false
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
742 # Some versions of DGUX need -ldgc for dg_sys_info.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
743 AC_HAVE_LIBRARY(dgc)])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
744 if $ac_need_func; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
745 # We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
746 # uses stabs), but it's still SVR4. We cannot check for <elf.h> because
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
747 # Irix 4.0.5F has the header but not the library.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
748 AC_HAVE_LIBRARY(elf, AC_DEFINE(SVR4) LIBS="$LIBS -lelf" ac_need_func=false
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
749 AC_HAVE_LIBRARY(kvm, LIBS="$LIBS -lkvm"))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
750 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
751 if $ac_need_func; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
752 AC_HEADER_CHECK(inq_stats/cpustats.h, AC_DEFINE(UMAX4_3) AC_DEFINE(UMAX)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
753 ac_need_func=false)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
754 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
755 if $ac_need_func; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
756 AC_HEADER_CHECK(sys/cpustats.h, AC_DEFINE(UMAX) ac_need_func=false)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
757 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
758 if $ac_need_func; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
759 AC_HAVE_HEADERS(mach/mach.h)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
760 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
761
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
762 AC_HEADER_CHECK(nlist.h,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
763 [AC_DEFINE(NLIST_STRUCT)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
764 AC_COMPILE_CHECK(n_un in struct nlist, [#include <nlist.h>],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
765 [struct nlist n; n.n_un.n_name = 0;],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
766 AC_DEFINE(NLIST_NAME_UNION))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
767
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
768 # Figure out whether we will need to install setgid.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
769 AC_PROGRAM_EGREP([Yowza Am I SETGID yet], [dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
770 #include "${srcdir}/getloadavg.c"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
771 #ifdef LDAV_PRIVILEGED
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
772 Yowza Am I SETGID yet
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
773 #endif], [AC_DEFINE(GETLOADAVG_PRIVILEGED) NEED_SETGID=true])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
774 ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
775
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
776 *) AC_DEFINE(HAVE_GETLOADAVG) ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
777 esac
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
778
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
779 if $NEED_SETGID; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
780 AC_SUBST(KMEM_GROUP)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
781 # Figure out what group owns /dev/kmem.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
782 # The installed program will need to be setgid and owned by that group.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
783 changequote(,)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
784 # On Solaris, /dev/kmem is a symlink. Get info on the real file.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
785 ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
786 # If we got an error (system does not support symlinks), try without -L.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
787 test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
788 KMEM_GROUP=`echo $ac_ls_output \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
789 | sed -ne 's/[ ][ ]*/ /g;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
790 s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
791 / /s/.* //;p;'`
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
792 changequote([,])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
793 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
794 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
795 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
796 define(AC_UTIME_NULL,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
797 [AC_CHECKING(utime with null argument)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
798 rm -f conftestdata; > conftestdata
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
799 # Sequent interprets utime(file, 0) to mean use start of epoch. Wrong.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
800 AC_TEST_PROGRAM([#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
801 #include <sys/stat.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
802 main() {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
803 struct stat s, t;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
804 exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
805 && stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
806 && t.st_mtime - s.st_mtime < 120));
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
807 }], AC_DEFINE(HAVE_UTIME_NULL))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
808 rm -f core
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
809 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
810 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
811 define(AC_STRCOLL, [AC_CHECKING(for strcoll)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
812 AC_TEST_PROGRAM([#include <string.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
813 main ()
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
814 {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
815 exit (strcoll ("abc", "def") >= 0 ||
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
816 strcoll ("ABC", "DEF") >= 0 ||
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
817 strcoll ("123", "456") >= 0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
818 }], AC_DEFINE(HAVE_STRCOLL))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
819 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
820 define(AC_SETVBUF_REVERSED,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
821 [AC_TEST_PROGRAM([#include <stdio.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
822 /* If setvbuf has the reversed format, exit 0. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
823 main () {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
824 /* This call has the arguments reversed.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
825 A reversed system may check and see that the address of main
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
826 is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
827 if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
828 exit(1);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
829 putc('\r', stdout);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
830 exit(0); /* Non-reversed systems segv here. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
831 }], AC_DEFINE(SETVBUF_REVERSED))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
832 rm -f core
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
833 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
834 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
835 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
836 dnl checks for structure members
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
837 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
838 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
839 define(AC_STRUCT_TM,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
840 [AC_PROVIDE([$0])AC_COMPILE_CHECK([struct tm in time.h],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
841 [#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
842 #include <time.h>],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
843 [struct tm *tp; tp->tm_sec;], , AC_DEFINE(TM_IN_SYS_TIME))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
844 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
845 define(AC_TIME_WITH_SYS_TIME,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
846 [AC_COMPILE_CHECK([whether time.h and sys/time.h may both be included],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
847 [#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
848 #include <sys/time.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
849 #include <time.h>],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
850 [struct tm *tp;], AC_DEFINE(TIME_WITH_SYS_TIME))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
851 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
852 define(AC_TIMEZONE,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
853 [AC_REQUIRE([AC_STRUCT_TM])ac_decl='#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
854 '
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
855 case "$DEFS" in
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
856 *TM_IN_SYS_TIME*) ac_decl="$ac_decl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
857 #include <sys/time.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
858 " ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
859 *) ac_decl="$ac_decl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
860 #include <time.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
861 " ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
862 esac
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
863 AC_COMPILE_CHECK([tm_zone in struct tm], $ac_decl,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
864 [struct tm tm; tm.tm_zone;], AC_DEFINE(HAVE_TM_ZONE), ac_no_tm_zone=1)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
865 if test -n "$ac_no_tm_zone"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
866 AC_COMPILE_CHECK(tzname, changequote(<<,>>)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
867 <<#include <time.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
868 #ifndef tzname /* For SGI. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
869 extern char *tzname[]; /* RS6000 and others want it this way. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
870 #endif>>, changequote([,])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
871 [atoi(*tzname);], AC_DEFINE(HAVE_TZNAME))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
872 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
873 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
874 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
875 define(AC_ST_BLOCKS,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
876 [AC_COMPILE_CHECK([st_blocks in struct stat],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
877 [#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
878 #include <sys/stat.h>], [struct stat s; s.st_blocks;],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
879 AC_DEFINE(HAVE_ST_BLOCKS), LIBOBJS="$LIBOBJS fileblocks.o")dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
880 AC_SUBST(LIBOBJS)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
881 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
882 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
883 define(AC_ST_BLKSIZE,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
884 [AC_COMPILE_CHECK([st_blksize in struct stat],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
885 [#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
886 #include <sys/stat.h>], [struct stat s; s.st_blksize;],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
887 AC_DEFINE(HAVE_ST_BLKSIZE))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
888 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
889 define(AC_ST_RDEV,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
890 [AC_COMPILE_CHECK([st_rdev in struct stat],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
891 [#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
892 #include <sys/stat.h>], [struct stat s; s.st_rdev;],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
893 AC_DEFINE(HAVE_ST_RDEV))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
894 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
895 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
896 dnl checks for compiler characteristics
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
897 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
898 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
899 define(AC_CROSS_CHECK,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
900 [AC_PROVIDE([$0])AC_CHECKING(whether cross-compiling)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
901 # If we cannot run a trivial program, we must be cross compiling.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
902 AC_TEST_PROGRAM([main(){exit(0);}], , cross_compiling=1)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
903 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
904 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
905 define(AC_CHAR_UNSIGNED,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
906 [AC_CHECKING(for unsigned characters)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
907 AC_TEST_PROGRAM(
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
908 [/* volatile prevents gcc2 from optimizing the test away on sparcs. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
909 #if !__STDC__
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
910 #define volatile
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
911 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
912 main() {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
913 #ifdef __CHAR_UNSIGNED__
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
914 exit(1); /* No need to redefine it. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
915 #else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
916 volatile char c = 255; exit(c < 0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
917 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
918 }], AC_DEFINE(__CHAR_UNSIGNED__))]
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
919 )dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
920 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
921 define(AC_LONG_DOUBLE,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
922 [AC_REQUIRE([AC_PROG_CC])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
923 AC_CHECKING(for long double)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
924 if test -n "$GCC"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
925 AC_DEFINE(HAVE_LONG_DOUBLE)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
926 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
927 AC_TEST_PROGRAM([int main() {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
928 /* The Stardent Vistra knows sizeof(long double), but does not support it. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
929 long double foo = 0.0;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
930 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
931 exit(sizeof(long double) < sizeof(double)); }],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
932 AC_DEFINE(HAVE_LONG_DOUBLE))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
933 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
934 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
935 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
936 define(AC_INT_16_BITS,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
937 [AC_OBSOLETE([$0], [; instead use AC_SIZEOF_TYPE(int)])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
938 AC_CHECKING(integer size)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
939 AC_TEST_PROGRAM([main() { exit(sizeof(int) != 2); }],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
940 AC_DEFINE(INT_16_BITS))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
941 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
942 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
943 define(AC_LONG_64_BITS,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
944 [AC_OBSOLETE([$0], [; instead use AC_SIZEOF_TYPE(long)])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
945 AC_CHECKING(for 64-bit long ints)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
946 AC_TEST_PROGRAM([main() { exit(sizeof(long int) != 8); }],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
947 AC_DEFINE(LONG_64_BITS))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
948 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
949 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
950 define(AC_WORDS_BIGENDIAN,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
951 [AC_CHECKING(byte ordering)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
952 AC_TEST_PROGRAM([main () {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
953 /* Are we little or big endian? From Harbison&Steele. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
954 union
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
955 {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
956 long l;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
957 char c[sizeof (long)];
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
958 } u;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
959 u.l = 1;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
960 exit (u.c[sizeof (long) - 1] == 1);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
961 }], , AC_DEFINE(WORDS_BIGENDIAN))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
962 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
963 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
964 define(AC_ARG_ARRAY,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
965 [AC_CHECKING(whether the address of an argument can be used as an array)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
966 AC_TEST_PROGRAM([main() {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
967 /* Return 0 iff arg arrays are ok. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
968 exit(!x(1, 2, 3, 4));
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
969 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
970 x(a, b, c, d) {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
971 return y(a, &b);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
972 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
973 /* Return 1 iff arg arrays are ok. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
974 y(a, b) int *b; {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
975 return a == 1 && b[0] == 2 && b[1] == 3 && b[2] == 4;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
976 }], , AC_DEFINE(NO_ARG_ARRAY))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
977 rm -f core
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
978 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
979 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
980 define(AC_INLINE,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
981 [AC_REQUIRE([AC_PROG_CC])if test -n "$GCC"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
982 AC_COMPILE_CHECK([inline], , [} inline foo() {], , AC_DEFINE(inline, __inline))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
983 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
984 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
985 define(AC_CONST,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
986 [changequote(,)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
987 dnl Do not put single quotes in the C program text!!
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
988 ac_prog='/* Ultrix mips cc rejects this. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
989 typedef int charset[2]; const charset x;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
990 /* SunOS 4.1.1 cc rejects this. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
991 char const *const *ccp;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
992 char **p;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
993 /* AIX XL C 1.02.0.0 rejects this.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
994 It does not let you subtract one const X* pointer from another in an arm
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
995 of an if-expression whose if-part is not a constant expression */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
996 const char *g = "string";
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
997 ccp = &g + (g ? g-g : 0);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
998 /* HPUX 7.0 cc rejects these. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
999 ++ccp;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1000 p = (char**) ccp;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1001 ccp = (char const *const *) p;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1002 { /* SCO 3.2v4 cc rejects this. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1003 char *t;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1004 char const *s = 0 ? (char *) 0 : (char const *) 0;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1005
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1006 *t++ = 0;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1007 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1008 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1009 int x[] = {25,17};
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1010 const int *foo = &x[0];
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1011 ++foo;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1012 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1013 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1014 typedef const int *iptr;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1015 iptr p = 0;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1016 ++p;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1017 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1018 { /* AIX XL C 1.02.0.0 rejects this saying
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1019 "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1020 struct s { int j; const int *ap[3]; };
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1021 struct s *b; b->j = 5;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1022 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1023 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1024 const int foo = 10;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1025 }'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1026 changequote([,])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1027 AC_COMPILE_CHECK([dnl Do not "break" this again.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1028 lack of working const], , [$ac_prog], , AC_DEFINE(const,))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1029 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1030 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1031 dnl checks for operating system services
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1032 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1033 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1034 define(AC_HAVE_POUNDBANG, [dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1035 AC_CHECKING(whether \`[#]!' works in shell scripts)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1036 echo '#!/bin/cat
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1037 exit 69
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1038 ' > conftest
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1039 chmod u+x conftest
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1040 (SHELL=/bin/sh; export SHELL; ./conftest > /dev/null)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1041 if test $? -ne 69; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1042 :; $1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1043 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1044 :; $2
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1045 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1046 rm -f conftest
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1047 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1048 define(AC_REMOTE_TAPE,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1049 [AC_CHECKING(for remote tape and socket header files)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1050 AC_HEADER_CHECK(sys/mtio.h, AC_DEFINE(HAVE_SYS_MTIO_H) ac_have_mtio_h=1)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1051 if test -n "$ac_have_mtio_h"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1052 AC_TEST_CPP([#include <sgtty.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1053 #include <sys/socket.h>], PROGS="$PROGS rmt")
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1054 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1055 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1056 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1057 define(AC_LONG_FILE_NAMES,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1058 [AC_CHECKING(for long file names)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1059 ac_some_dir_failed=false
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1060 # Test for long file names in all the places we know might matter:
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1061 # . the current directory, where building will happen
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1062 # /tmp where it might want to write temporary files
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1063 # /var/tmp likewise
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1064 # /usr/tmp likewise
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1065 # $prefix/lib where we will be installing things
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1066 # $exec_prefix/lib likewise
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1067 # eval it to expand exec_prefix.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1068 for ac_dir in `eval echo . /tmp /var/tmp /usr/tmp $prefix/lib $exec_prefix/lib` ; do
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1069 test -d $ac_dir || continue
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1070 test -w $ac_dir || continue # It's less confusing to not echo anything here.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1071 (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1072 (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1073 val=`cat $ac_dir/conftest9012345 2>/dev/null`
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1074 test -f $ac_dir/conftest9012345 && test "$val" = 1 || ac_some_dir_failed=true
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1075 rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2> /dev/null
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1076 done
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1077 $ac_some_dir_failed || AC_DEFINE(HAVE_LONG_FILE_NAMES)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1078 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1079 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1080 define(AC_RESTARTABLE_SYSCALLS,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1081 [AC_CHECKING(for restartable system calls)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1082 AC_TEST_PROGRAM(
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1083 [/* Exit 0 (true) if wait returns something other than -1,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1084 i.e. the pid of the child, which means that wait was restarted
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1085 after getting the signal. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1086 #include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1087 #include <signal.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1088 ucatch (isig) { }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1089 main () {
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1090 int i = fork (), status;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1091 if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1092 signal (SIGINT, ucatch);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1093 status = wait(&i);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1094 if (status == -1) wait(&i);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1095 exit (status == -1);
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1096 }
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1097 ], AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1098 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1099 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1100 define(AC_FIND_X,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1101 [AC_REQUIRE_CPP()dnl Set CPP; we run AC_FIND_X_DIRECT conditionally.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1102 AC_PROVIDE([$0])# If we find X, set shell vars x_includes and x_libraries to the paths.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1103 no_x=true
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1104 if test "x$with_x" != xno; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1105 AC_FIND_X_XMKMF
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1106 if test -z "$ac_im_usrlibdir"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1107 AC_FIND_X_DIRECT
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1108 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1109 test -n "$x_includes" && AC_VERBOSE(X11 headers are in $x_includes)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1110 test -n "$x_libraries" && AC_VERBOSE(X11 libraries are in $x_libraries)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1111 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1112 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1113 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1114 dnl Internal subroutine of AC_FIND_X.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1115 define(AC_FIND_X_XMKMF,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1116 [AC_CHECKING(for X include and library files with xmkmf)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1117 rm -fr conftestdir
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1118 if mkdir conftestdir; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1119 cd conftestdir
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1120 # Make sure to not put "make" in the Imakefile rules, since we grep it out.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1121 cat > Imakefile <<'EOF'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1122 acfindx:
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1123 @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1124 EOF
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1125 if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1126 no_x=
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1127 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1128 eval `make acfindx 2>/dev/null | grep -v make`
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1129 # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1130 if test ! -f $ac_im_usrlibdir/libX11.a && test -f $ac_im_libdir/libX11.a
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1131 then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1132 ac_im_usrlibdir=$ac_im_libdir
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1133 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1134 case "$ac_im_incroot" in
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1135 /usr/include) ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1136 *) test -z "$x_includes" && x_includes="$ac_im_incroot" ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1137 esac
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1138 case "$ac_im_usrlibdir" in
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1139 /usr/lib | /lib) ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1140 *) test -z "$x_libraries" && x_libraries="$ac_im_usrlibdir" ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1141 esac
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1142 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1143 cd ..
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1144 rm -fr conftestdir
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1145 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1146 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1147 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1148 dnl Internal subroutine of AC_FIND_X.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1149 define(AC_FIND_X_DIRECT,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1150 [AC_CHECKING(for X include and library files directly)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1151 if test ".$x_direct_test_library" = . ; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1152 x_direct_test_library='Xt'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1153 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1154 if test ".$x_direct_test_include" = . ; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1155 x_direct_test_include='X11/Intrinsic.h'
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1156 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1157 AC_TEST_CPP([#include <$x_direct_test_include>], no_x=,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1158 for ac_dir in \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1159 /usr/X11R6/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1160 /usr/X11R5/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1161 /usr/X11R4/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1162 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1163 /usr/include/X11R6 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1164 /usr/include/X11R5 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1165 /usr/include/X11R4 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1166 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1167 /usr/local/X11R6/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1168 /usr/local/X11R5/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1169 /usr/local/X11R4/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1170 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1171 /usr/local/include/X11R6 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1172 /usr/local/include/X11R5 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1173 /usr/local/include/X11R4 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1174 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1175 /usr/X11/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1176 /usr/include/X11 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1177 /usr/local/X11/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1178 /usr/local/include/X11 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1179 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1180 /usr/X386/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1181 /usr/x386/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1182 /usr/XFree86/include/X11 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1183 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1184 /usr/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1185 /usr/local/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1186 /usr/unsupported/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1187 /usr/athena/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1188 /usr/local/x11r5/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1189 /usr/lpp/Xamples/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1190 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1191 /usr/openwin/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1192 /usr/openwin/share/include \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1193 ; \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1194 do
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1195 if test -r "$ac_dir/$x_direct_test_include"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1196 test -z "$x_includes" && x_includes=$ac_dir
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1197 no_x=
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1198 break
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1199 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1200 done)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1201
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1202 # Check for the libraries. First see if replacing the `include' by
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1203 # `lib' works.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1204 AC_HAVE_LIBRARY("$x_direct_test_library", no_x=,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1205 for ac_dir in `echo "$x_includes" | sed s/include/lib/` \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1206 /usr/X11R6/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1207 /usr/X11R5/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1208 /usr/X11R4/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1209 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1210 /usr/lib/X11R6 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1211 /usr/lib/X11R5 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1212 /usr/lib/X11R4 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1213 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1214 /usr/local/X11R6/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1215 /usr/local/X11R5/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1216 /usr/local/X11R4/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1217 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1218 /usr/local/lib/X11R6 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1219 /usr/local/lib/X11R5 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1220 /usr/local/lib/X11R4 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1221 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1222 /usr/X11/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1223 /usr/lib/X11 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1224 /usr/local/X11/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1225 /usr/local/lib/X11 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1226 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1227 /usr/X386/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1228 /usr/x386/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1229 /usr/XFree86/lib/X11 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1230 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1231 /usr/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1232 /usr/local/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1233 /usr/unsupported/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1234 /usr/athena/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1235 /usr/local/x11r5/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1236 /usr/lpp/Xamples/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1237 \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1238 /usr/openwin/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1239 /usr/openwin/share/lib \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1240 ; \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1241 do
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1242 for ac_extension in a so sl; do
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1243 if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1244 test -z "$x_libraries" && x_libraries=$ac_dir
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1245 no_x=
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1246 break 2
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1247 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1248 done
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1249 done)])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1250 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1251 dnl Find additional X libraries, magic flags, etc.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1252 define(AC_FIND_XTRA, [AC_REQUIRE([AC_ISC_POSIX])AC_REQUIRE([AC_FIND_X])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1253 AC_CHECKING(for additional X libraries and flags)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1254 if test -n "$x_includes"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1255 X_CFLAGS="$X_CFLAGS -I$x_includes"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1256 elif test -n "$no_x"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1257 # Not all programs may use this symbol, but it won't hurt to define it.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1258 X_CFLAGS="$X_CFLAGS -DX_DISPLAY_MISSING"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1259 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1260
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1261 # It would be nice to have a more robust check for the -R ld option than
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1262 # just checking for Solaris.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1263 # It would also be nice to do this for all -L options, not just this one.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1264 if test -n "$x_libraries"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1265 X_LIBS="$X_LIBS -L$x_libraries"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1266 if test "`(uname) 2>/dev/null`" = SunOS \
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1267 && uname -r | grep '^5' >/dev/null; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1268 X_LIBS="$X_LIBS -R$x_libraries"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1269 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1270 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1271
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1272 # Check for additional X libraries.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1273
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1274 if test -n "$ISC"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1275 X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1276 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1277 # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1278 # libraries were built with DECnet support. And karl@cs.umb.edu's Alpha
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1279 # needs dnet_stub (dnet doesn't exist).
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1280 AC_HAVE_LIBRARY(dnet,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1281 [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1282 ac_have_dnet=t])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1283 if test -z "$ac_have_dnet"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1284 AC_HAVE_LIBRARY(dnet_stub, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1285 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1286 # lieder@skyler.mavd.honeywell.com says without -lsocket,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1287 # socket/setsockopt and other routines are undefined under SCO ODT 2.0.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1288 # But -lsocket is broken on IRIX, according to simon@lia.di.epfl.ch.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1289 if test "`(uname) 2>/dev/null`" != IRIX; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1290 AC_HAVE_LIBRARY(socket, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lsocket"])
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1291 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1292 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1293 #
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1294 AC_VERBOSE(X compiler flags: $X_CFLAGS)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1295 AC_VERBOSE(X library flags: $X_LIBS)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1296 AC_VERBOSE(extra X libraries: $X_EXTRA_LIBS)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1297 AC_SUBST(X_CFLAGS)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1298 AC_SUBST(X_LIBS)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1299 AC_SUBST(X_EXTRA_LIBS)dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1300 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1301 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1302 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1303 dnl checks for UNIX variants
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1304 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1305 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1306 define(AC_AIX,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1307 [AC_CHECKING(for AIX)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1308 AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_PROGRAM_EGREP(yes,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1309 [#ifdef _AIX
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1310 yes
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1311 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1312 ], AC_DEFINE(_ALL_SOURCE))
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1313 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1314 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1315 define(AC_MINIX,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1316 [AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_HEADER_CHECK(minix/config.h, MINIX=1)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1317 # The Minix shell can't assign to the same variable on the same line!
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1318 if test -n "$MINIX"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1319 AC_DEFINE(_POSIX_SOURCE)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1320 AC_DEFINE(_POSIX_1_SOURCE, 2)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1321 AC_DEFINE(_MINIX)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1322 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1323 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1324 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1325 define(AC_ISC_POSIX,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1326 [AC_PROVIDE([$0])AC_BEFORE([$0], [AC_COMPILE_CHECK])AC_BEFORE([$0], [AC_TEST_PROGRAM])AC_BEFORE([$0], [AC_HEADER_EGREP])AC_BEFORE([$0], [AC_TEST_CPP])AC_CHECKING(for POSIXized ISC)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1327 if test -d /etc/conf/kconfig.d &&
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1328 grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1329 then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1330 ISC=1 # If later tests want to check for ISC.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1331 AC_DEFINE(_POSIX_SOURCE)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1332 if test -n "$GCC"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1333 CC="$CC -posix"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1334 else
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1335 CC="$CC -Xp"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1336 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1337 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1338 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1339 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1340 define(AC_XENIX_DIR,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1341 [AC_REQUIRE([AC_DIR_HEADER])AC_CHECKING(for Xenix)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1342 AC_PROGRAM_EGREP(yes,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1343 [#if defined(M_XENIX) && !defined(M_UNIX)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1344 yes
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1345 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1346 ], XENIX=1)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1347 if test -n "$XENIX"; then
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1348 LIBS="$LIBS -lx"
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1349 case "$DEFS" in
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1350 *SYSNDIR*) ;;
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1351 *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1352 esac
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1353 fi
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1354 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1355 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1356 define(AC_SCO_INTL,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1357 [AC_HAVE_LIBRARY(intl, LIBS="$LIBS -lintl")
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1358 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1359 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1360 define(AC_IRIX_SUN,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1361 [AC_HAVE_LIBRARY(sun, LIBS="$LIBS -lsun")
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1362 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1363 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1364 define(AC_DYNIX_SEQ,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1365 [AC_HAVE_LIBRARY(seq, LIBS="$LIBS -lseq")
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1366 ])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1367 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1368 define(AC_STAT_MACROS_BROKEN,[AC_CHECKING(for broken stat file mode macros)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1369 AC_PROGRAM_EGREP([You lose], [#include <sys/types.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1370 #include <sys/stat.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1371 #ifdef S_ISBLK
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1372 #if S_ISBLK (S_IFDIR)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1373 You lose.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1374 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1375 #ifdef S_IFCHR
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1376 #if S_ISBLK (S_IFCHR)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1377 You lose.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1378 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1379 #endif /* S_IFCHR */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1380 #endif /* S_ISBLK */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1381 #ifdef S_ISLNK
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1382 #if S_ISLNK (S_IFREG)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1383 You lose.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1384 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1385 #endif /* S_ISLNK */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1386 #ifdef S_ISSOCK
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1387 #if S_ISSOCK (S_IFREG)
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1388 You lose.
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1389 #endif
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1390 #endif /* S_ISSOCK */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1391 ], AC_DEFINE(STAT_MACROS_BROKEN))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1392 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1393 dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1394 define(AC_SYS_SIGLIST_DECLARED,[dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1395 AC_COMPILE_CHECK(sys_siglist declaration in signal.h or unistd.h,
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1396 [#include <signal.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1397 /* NetBSD declares sys_siglist in <unistd.h>. */
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1398 #ifdef HAVE_UNISTD_H
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1399 #include <unistd.h>
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1400 #endif], [char *msg = *(sys_siglist + 1);],
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1401 AC_DEFINE(SYS_SIGLIST_DECLARED))])dnl
56c54cf7c5b6 Import from CVS: tag r19-16b90
cvs
parents:
diff changeset
1402 dnl