home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / CLISP-2.LHA / CLISP960530-ki.lha / ffcall / autoconf / acspecific.m4 < prev    next >
Encoding:
M4 Source File  |  1996-04-15  |  58.0 KB  |  1,971 lines

  1. dnl Macros that test for specific features.
  2. dnl This file is part of Autoconf.
  3. dnl Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
  4. dnl
  5. dnl This program is free software; you can redistribute it and/or modify
  6. dnl it under the terms of the GNU General Public License as published by
  7. dnl the Free Software Foundation; either version 2, or (at your option)
  8. dnl any later version.
  9. dnl
  10. dnl This program is distributed in the hope that it will be useful,
  11. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. dnl GNU General Public License for more details.
  14. dnl
  15. dnl You should have received a copy of the GNU General Public License
  16. dnl along with this program; if not, write to the Free Software
  17. dnl Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. dnl
  19. dnl As a special exception, the Free Software Foundation gives unlimited
  20. dnl permission to copy, distribute and modify the configure scripts that
  21. dnl are the output of Autoconf.  You need not follow the terms of the GNU
  22. dnl General Public License when using or distributing such scripts, even
  23. dnl though portions of the text of Autoconf appear in them.  The GNU
  24. dnl General Public License (GPL) does govern all other use of the material
  25. dnl that constitutes the Autoconf program.
  26. dnl
  27. dnl Certain portions of the Autoconf source text are designed to be copied
  28. dnl (in certain cases, depending on the input) into the output of
  29. dnl Autoconf.  We call these the "data" portions.  The rest of the Autoconf
  30. dnl source text consists of comments plus executable code that decides which
  31. dnl of the data portions to output in any given case.  We call these
  32. dnl comments and executable code the "non-data" portions.  Autoconf never
  33. dnl copies any of the non-data portions into its output.
  34. dnl
  35. dnl This special exception to the GPL applies to versions of Autoconf
  36. dnl released by the Free Software Foundation.  When you make and
  37. dnl distribute a modified version of Autoconf, you may extend this special
  38. dnl exception to the GPL to apply to your modified version as well, *unless*
  39. dnl your modified version has the potential to copy into its output some
  40. dnl of the text that was the non-data portion of the version that you started
  41. dnl with.  (In other words, unless your change moves or copies text from
  42. dnl the non-data portions to the data portions.)  If your modification has
  43. dnl such potential, you must delete any notice of this special exception
  44. dnl to the GPL from your modified version.
  45. dnl
  46. dnl Written by David MacKenzie, with help from
  47. dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
  48. dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
  49.  
  50.  
  51. dnl ### Checks for programs
  52.  
  53.  
  54. dnl Check whether to use -n, \c, or newline-tab to separate
  55. dnl checking messages from result messages.
  56. dnl Idea borrowed from dist 3.0.
  57. dnl Internal use only.
  58. AC_DEFUN(AC_PROG_ECHO_N,
  59. [if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  60.   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  61.   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  62.     ac_n= ac_c='
  63. ' ac_t='    '
  64.   else
  65.     ac_n=-n ac_c= ac_t=
  66.   fi
  67. else
  68.   ac_n= ac_c='\c' ac_t=
  69. fi
  70. ])
  71.  
  72. AC_DEFUN(AC_PROG_CC,
  73. [AC_BEFORE([$0], [AC_PROG_CPP])dnl
  74. AC_CHECK_PROG(CC, gcc, gcc, cc)
  75.  
  76. AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
  77. [dnl The semicolon is to pacify NeXT's syntax-checking cpp.
  78. cat > conftest.c <<EOF
  79. #ifdef __GNUC__
  80.   yes;
  81. #endif
  82. EOF
  83. if ${CC-cc} -E conftest.c 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then
  84.   ac_cv_prog_gcc=yes
  85. else
  86.   ac_cv_prog_gcc=no
  87. fi])
  88. if test $ac_cv_prog_gcc = yes; then
  89.   GCC=yes
  90.   if test "${CFLAGS+set}" != set; then
  91.     AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_gcc_g,
  92. [echo 'void f(){}' > conftest.c
  93. if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
  94.   ac_cv_prog_gcc_g=yes
  95. else
  96.   ac_cv_prog_gcc_g=no
  97. fi
  98. rm -f conftest*
  99. ])
  100.     if test $ac_cv_prog_gcc_g = yes; then
  101.       CFLAGS="-g -O"
  102.     else
  103.       CFLAGS="-O"
  104.     fi
  105.   fi
  106. else
  107.   GCC=
  108.   test "${CFLAGS+set}" = set || CFLAGS="-g"
  109. fi
  110. ])
  111.  
  112. AC_DEFUN(AC_PROG_CXX,
  113. [AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
  114. AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx, gcc)
  115.  
  116. AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx,
  117. [dnl The semicolon is to pacify NeXT's syntax-checking cpp.
  118. cat > conftest.C <<EOF
  119. #ifdef __GNUC__
  120.   yes;
  121. #endif
  122. EOF
  123. if ${CXX-g++} -E conftest.C 2>&AC_FD_CC | egrep yes >/dev/null 2>&1; then
  124.   ac_cv_prog_gxx=yes
  125. else
  126.   ac_cv_prog_gxx=no
  127. fi])
  128. if test $ac_cv_prog_gxx = yes; then
  129.   GXX=yes
  130.   if test "${CXXFLAGS+set}" != set; then
  131.     AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_gxx_g,
  132. [echo 'void f(){}' > conftest.cc
  133. if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
  134.   ac_cv_prog_gxx_g=yes
  135. else
  136.   ac_cv_prog_gxx_g=no
  137. fi
  138. rm -f conftest*
  139. ])
  140. dnl
  141.     if test $ac_cv_prog_gxx_g = yes; then
  142.       CXXFLAGS="-g -O"
  143.     else
  144.       CXXFLAGS="-O"
  145.     fi
  146.   fi
  147. else
  148.   GXX=
  149.   test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
  150. fi
  151. ])
  152.  
  153. AC_DEFUN(AC_PROG_GCC_TRADITIONAL,
  154. [AC_REQUIRE([AC_PROG_CC])dnl
  155. AC_REQUIRE([AC_PROG_CPP])dnl
  156. if test $ac_cv_prog_gcc = yes; then
  157.     AC_CACHE_CHECK(whether ${CC-cc} needs -traditional,
  158.       ac_cv_prog_gcc_traditional,
  159. [  ac_pattern="Autoconf.*'x'"
  160.   AC_EGREP_CPP($ac_pattern, [#include <sgtty.h>
  161. Autoconf TIOCGETP],
  162.   ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no)
  163.  
  164.   if test $ac_cv_prog_gcc_traditional = no; then
  165.     AC_EGREP_CPP($ac_pattern, [#include <termio.h>
  166. Autoconf TCGETA],
  167.     ac_cv_prog_gcc_traditional=yes)
  168.   fi])
  169.   if test $ac_cv_prog_gcc_traditional = yes; then
  170.     CC="$CC -traditional"
  171.   fi
  172. fi
  173. ])
  174.  
  175. AC_DEFUN(AC_PROG_CC_C_O,
  176. [if test "x$CC" != xcc; then
  177.   AC_MSG_CHECKING(whether $CC and cc understand -c and -o together)
  178. else
  179.   AC_MSG_CHECKING(whether cc understands -c and -o together)
  180. fi
  181. set dummy $CC; ac_cc="`echo [$]2 | 
  182. changequote(, )dnl
  183.                sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
  184. changequote([, ])dnl
  185. AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
  186. [eval ac_cv_prog_cc_${ac_cc}_c_o=no
  187. echo 'foo(){}' > conftest.c
  188. # Make sure it works both with $CC and with simple cc.
  189. # We do the test twice because some compilers refuse to overwrite an
  190. # existing .o file with -o, though they will create one.
  191. if ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC &&
  192.   test -f conftest.o && ${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC 2>&AC_FD_CC
  193. then
  194.   if test "x$CC" != xcc; then
  195.     # Test first that cc exists at all.
  196.     if cc -c conftest.c 1>&AC_FD_CC 2>&AC_FD_CC
  197.     then
  198.       if cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC &&
  199.         test -f conftest2.o && cc -c conftest.c -o conftest2.o 1>&AC_FD_CC 2>&AC_FD_CC
  200.       then
  201.         eval ac_cv_prog_cc_${ac_cc}_c_o=yes
  202.       fi
  203.     else
  204.       # There is no cc, so we don't care about it.
  205.       eval ac_cv_prog_cc_${ac_cc}_c_o=yes
  206.     fi
  207.   fi
  208. fi
  209. rm -f conftest*
  210. ])dnl
  211. if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
  212.   AC_MSG_RESULT(yes)
  213. else
  214.   AC_MSG_RESULT(no)
  215.   AC_DEFINE(NO_MINUS_C_MINUS_O)
  216. fi
  217. ])
  218.  
  219. dnl Define SET_MAKE to set ${MAKE} if make doesn't.
  220. AC_DEFUN(AC_PROG_MAKE_SET,
  221. [AC_MSG_CHECKING(whether ${MAKE-make} sets \${MAKE})
  222. set dummy ${MAKE-make}; ac_make=[$]2
  223. AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set,
  224. [cat > conftestmake <<\EOF
  225. all:
  226.     @echo 'ac_maketemp="${MAKE}"'
  227. EOF
  228. changequote(, )dnl
  229. # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
  230. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
  231. changequote([, ])dnl
  232. if test -n "$ac_maketemp"; then
  233.   eval ac_cv_prog_make_${ac_make}_set=yes
  234. else
  235.   eval ac_cv_prog_make_${ac_make}_set=no
  236. fi
  237. rm -f conftestmake])dnl
  238. if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
  239.   AC_MSG_RESULT(yes)
  240.   SET_MAKE=
  241. else
  242.   AC_MSG_RESULT(no)
  243.   SET_MAKE="MAKE=${MAKE-make}"
  244. fi
  245. AC_SUBST([SET_MAKE])dnl
  246. ])
  247.  
  248. AC_DEFUN(AC_PROG_RANLIB,
  249. [AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])
  250.  
  251. dnl Check for mawk first since it's generally faster.
  252. AC_DEFUN(AC_PROG_AWK,
  253. [AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])
  254.  
  255. AC_DEFUN(AC_PROG_YACC,
  256. [AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)])
  257.  
  258. AC_DEFUN(AC_PROG_CPP,
  259. [AC_MSG_CHECKING(how to run the C preprocessor)
  260. # On Suns, sometimes $CPP names a directory.
  261. if test -n "$CPP" && test -d "$CPP"; then
  262.   CPP=
  263. fi
  264. if test -z "$CPP"; then
  265. AC_CACHE_VAL(ac_cv_prog_CPP,
  266. [  # This must be in double quotes, not single quotes, because CPP may get
  267.   # substituted into the Makefile and "${CC-cc}" will confuse make.
  268.   CPP="${CC-cc} -E"
  269.   # On the NeXT, cc -E runs the code through the compiler's parser,
  270.   # not just through cpp.
  271. dnl Use a header file that comes with gcc, so configuring glibc
  272. dnl with a fresh cross-compiler works.
  273.   AC_TRY_CPP([#include <assert.h>
  274. Syntax Error], ,
  275.   CPP="${CC-cc} -E -traditional-cpp"
  276.   AC_TRY_CPP([#include <assert.h>
  277. Syntax Error], , CPP=/lib/cpp))
  278.   ac_cv_prog_CPP="$CPP"])dnl
  279.   CPP="$ac_cv_prog_CPP"
  280. else
  281.   ac_cv_prog_CPP="$CPP"
  282. fi
  283. AC_MSG_RESULT($CPP)
  284. AC_SUBST(CPP)dnl
  285. ])
  286.  
  287. AC_DEFUN(AC_PROG_CXXCPP,
  288. [AC_MSG_CHECKING(how to run the C++ preprocessor)
  289. if test -z "$CXXCPP"; then
  290. AC_CACHE_VAL(ac_cv_prog_CXXCPP,
  291. [AC_LANG_SAVE[]dnl
  292. AC_LANG_CPLUSPLUS[]dnl
  293.   CXXCPP="${CXX-g++} -E"
  294.   AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
  295.   ac_cv_prog_CXXCPP="$CXXCPP"
  296. AC_LANG_RESTORE[]dnl
  297. fi])dnl
  298. CXXCPP="$ac_cv_prog_CXXCPP"
  299. AC_MSG_RESULT($CXXCPP)
  300. AC_SUBST(CXXCPP)dnl
  301. ])
  302.  
  303. dnl Require finding the C or C++ preprocessor, whichever is the
  304. dnl current language.
  305. AC_DEFUN(AC_REQUIRE_CPP,
  306. [ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])])
  307.  
  308. AC_DEFUN(AC_PROG_LEX,
  309. [AC_CHECK_PROG(LEX, flex, flex, lex)
  310. if test -z "$LEXLIB"
  311. then
  312.   case "$LEX" in
  313.   flex*) ac_lib=fl ;;
  314.   *) ac_lib=l ;;
  315.   esac
  316.   AC_CHECK_LIB($ac_lib, yywrap, LEXLIB="-l$ac_lib")
  317. fi
  318. AC_SUBST(LEXLIB)])
  319.  
  320. dnl Check if lex declares yytext as a char * by default, not a char[].
  321. undefine([AC_DECL_YYTEXT])
  322. AC_DEFUN(AC_DECL_YYTEXT,
  323. [AC_REQUIRE_CPP()dnl
  324. AC_REQUIRE([AC_PROG_LEX])dnl
  325. AC_CACHE_CHECK(lex output file root, ac_cv_prog_lex_root,
  326. [# The minimal lex program is just a single line: %%.  But some broken lexes
  327. # (Solaris, I think it was) want two %% lines, so accommodate them.
  328. echo '%%
  329. %%' | $LEX
  330. if test -f lex.yy.c; then
  331.   ac_cv_prog_lex_root=lex.yy
  332. elif test -f lexyy.c; then
  333.   ac_cv_prog_lex_root=lexyy
  334. else
  335.   AC_MSG_ERROR(cannot find output from $LEX; giving up)
  336. fi])
  337. LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
  338. AC_SUBST(LEX_OUTPUT_ROOT)dnl
  339.  
  340. AC_CACHE_CHECK(whether yytext is a pointer, ac_cv_prog_lex_yytext_pointer,
  341. [# POSIX says lex can declare yytext either as a pointer or an array; the
  342. # default is implementation-dependent. Figure out which it is, since
  343. # not all implementations provide the %pointer and %array declarations.
  344. ac_cv_prog_lex_yytext_pointer=no
  345. echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
  346. ac_save_LIBS="$LIBS"
  347. LIBS="$LIBS $LEXLIB"
  348. AC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, , ac_cv_prog_lex_yytext_pointer=yes)
  349. LIBS="$ac_save_LIBS"
  350. rm -f "${LEX_OUTPUT_ROOT}.c"])
  351. dnl
  352. if test $ac_cv_prog_lex_yytext_pointer = yes; then
  353.   AC_DEFINE(YYTEXT_POINTER)
  354. fi
  355. ])
  356.  
  357. AC_DEFUN(AC_PROG_INSTALL,
  358. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  359. # Find a good install program.  We prefer a C program (faster),
  360. # so one script is as good as another.  But avoid the broken or
  361. # incompatible versions:
  362. # SysV /etc/install, /usr/sbin/install
  363. # SunOS /usr/etc/install
  364. # IRIX /sbin/install
  365. # AIX /bin/install
  366. # AFS /usr/afsws/bin/install, which mishandles nonexistent args
  367. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  368. # ./install, which can be erroneously created by make from ./install.sh.
  369. AC_MSG_CHECKING(for a BSD compatible install)
  370. if test -z "$INSTALL"; then
  371. AC_CACHE_VAL(ac_cv_path_install,
  372. [  IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  373.   for ac_dir in $PATH; do
  374.     # Account for people who put trailing slashes in PATH elements.
  375.     case "$ac_dir/" in
  376.     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
  377.     *)
  378.       # OSF1 and SCO ODT 3.0 have their own names for install.
  379.       for ac_prog in ginstall installbsd scoinst install; do
  380.         if test -f $ac_dir/$ac_prog; then
  381.       if test $ac_prog = install &&
  382.             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  383.         # AIX install.  It has an incompatible calling convention.
  384.         # OSF/1 installbsd also uses dspmsg, but is usable.
  385.         :
  386.       else
  387.         ac_cv_path_install="$ac_dir/$ac_prog -c"
  388.         break 2
  389.       fi
  390.     fi
  391.       done
  392.       ;;
  393.     esac
  394.   done
  395.   IFS="$ac_save_ifs"
  396. ])dnl
  397.   if test "${ac_cv_path_install+set}" = set; then
  398.     INSTALL="$ac_cv_path_install"
  399.   else
  400.     # As a last resort, use the slow shell script.  We don't cache a
  401.     # path for INSTALL within a source directory, because that will
  402.     # break other packages using the cache if that directory is
  403.     # removed, or if the path is relative.
  404.     INSTALL="$ac_install_sh"
  405.   fi
  406. fi
  407. dnl We do special magic for INSTALL instead of AC_SUBST, to get
  408. dnl relative paths right. 
  409. AC_MSG_RESULT($INSTALL)
  410.  
  411. # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
  412. # It thinks the first close brace ends the variable substitution.
  413. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
  414. AC_SUBST(INSTALL_PROGRAM)dnl
  415.  
  416. test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
  417. AC_SUBST(INSTALL_DATA)dnl
  418. ])
  419.  
  420. AC_DEFUN(AC_PROG_LN_S,
  421. [AC_MSG_CHECKING(whether ln -s works)
  422. AC_CACHE_VAL(ac_cv_prog_LN_S,
  423. [rm -f conftestdata
  424. if ln -s X conftestdata 2>/dev/null
  425. then
  426.   rm -f conftestdata
  427.   ac_cv_prog_LN_S="ln -s"
  428. else
  429.   ac_cv_prog_LN_S=ln
  430. fi])dnl
  431. LN_S="$ac_cv_prog_LN_S"
  432. if test "$ac_cv_prog_LN_S" = "ln -s"; then
  433.   AC_MSG_RESULT(yes)
  434. else
  435.   AC_MSG_RESULT(no)
  436. fi
  437. AC_SUBST(LN_S)dnl
  438. ])
  439.  
  440. define(AC_RSH,
  441. [errprint(__file__:__line__: [$0] has been removed; replace it with equivalent code
  442. )m4exit(4)])
  443.  
  444.  
  445. dnl ### Checks for header files
  446.  
  447.  
  448. AC_DEFUN(AC_HEADER_STDC,
  449. [AC_REQUIRE_CPP()dnl
  450. AC_CACHE_CHECK(for ANSI C header files, ac_cv_header_stdc,
  451. [AC_TRY_CPP([#include <stdlib.h>
  452. #include <stdarg.h>
  453. #include <string.h>
  454. #include <float.h>], ac_cv_header_stdc=yes, ac_cv_header_stdc=no)
  455.  
  456. if test $ac_cv_header_stdc = yes; then
  457.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  458. AC_EGREP_HEADER(memchr, string.h, , ac_cv_header_stdc=no)
  459. fi
  460.  
  461. if test $ac_cv_header_stdc = yes; then
  462.   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  463. AC_EGREP_HEADER(free, stdlib.h, , ac_cv_header_stdc=no)
  464. fi
  465.  
  466. if test $ac_cv_header_stdc = yes; then
  467.   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  468. AC_TRY_RUN([#include <ctype.h>
  469. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  470. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  471. #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
  472. int main () { int i; for (i = 0; i < 256; i++)
  473. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  474. exit (0); }
  475. ], , ac_cv_header_stdc=no, :)
  476. fi])
  477. if test $ac_cv_header_stdc = yes; then
  478.   AC_DEFINE(STDC_HEADERS)
  479. fi
  480. ])
  481.  
  482. AC_DEFUN(AC_UNISTD_H,
  483. [AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl
  484. AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))])
  485.  
  486. AC_DEFUN(AC_USG,
  487. [AC_OBSOLETE([$0],
  488.   [; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl
  489. AC_MSG_CHECKING([for BSD string and memory functions])
  490. AC_TRY_LINK([#include <strings.h>], [rindex(0, 0); bzero(0, 0);],
  491.   [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); AC_DEFINE(USG)])])
  492.  
  493.  
  494. dnl If memchr and the like aren't declared in <string.h>, include <memory.h>.
  495. dnl To avoid problems, don't check for gcc2 built-ins.
  496. AC_DEFUN(AC_MEMORY_H,
  497. [AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])dnl
  498. AC_MSG_CHECKING(whether string.h declares mem functions)
  499. AC_EGREP_HEADER(memchr, string.h, ac_found=yes, ac_found=no)
  500. AC_MSG_RESULT($ac_found)
  501. if test $ac_found = no; then
  502.   AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)])
  503. fi
  504. ])
  505.  
  506. AC_DEFUN(AC_HEADER_MAJOR,
  507. [AC_CACHE_CHECK(whether sys/types.h defines makedev, 
  508.   ac_cv_header_sys_types_h_makedev,
  509. [AC_TRY_LINK([#include <sys/types.h>], [return makedev(0, 0);],
  510.   ac_cv_header_sys_types_h_makedev=yes, ac_cv_header_sys_types_h_makedev=no)
  511. ])
  512.  
  513. if test $ac_cv_header_sys_types_h_makedev = no; then
  514. AC_CHECK_HEADER(sys/mkdev.h, [AC_DEFINE(MAJOR_IN_MKDEV)])
  515.  
  516.   if test $ac_cv_header_sys_mkdev_h = no; then
  517. AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS)])
  518.   fi
  519. fi
  520. ])
  521.  
  522. AC_DEFUN(AC_HEADER_DIRENT,
  523. [ac_header_dirent=no
  524. AC_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h,
  525.   [ac_header_dirent=$ac_hdr; break])
  526. # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
  527. if test $ac_header_dirent = dirent.h; then
  528. AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir")
  529. else
  530. AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx")
  531. fi
  532. ])
  533.  
  534. dnl Like AC_CHECK_HEADER, except also make sure that HEADER-FILE
  535. dnl defines the type `DIR'.  dirent.h on NextStep 3.2 doesn't.
  536. dnl AC_CHECK_HEADER_DIRENT(HEADER-FILE, ACTION-IF-FOUND)
  537. AC_DEFUN(AC_CHECK_HEADER_DIRENT,
  538. [ac_safe=`echo "$1" | tr './\055' '___'`
  539. AC_MSG_CHECKING([for $1 that defines DIR])
  540. AC_CACHE_VAL(ac_cv_header_dirent_$ac_safe,
  541. [AC_TRY_COMPILE([#include <sys/types.h>
  542. #include <$1>], [DIR *dirp = 0;],
  543.   eval "ac_cv_header_dirent_$ac_safe=yes",
  544.   eval "ac_cv_header_dirent_$ac_safe=no")])dnl
  545. if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
  546.   AC_MSG_RESULT(yes)
  547.   $2
  548. else
  549.   AC_MSG_RESULT(no)
  550. fi
  551. ])
  552.  
  553. dnl Like AC_CHECK_HEADERS, except succeed only for a HEADER-FILE that
  554. dnl defines `DIR'.
  555. dnl AC_CHECK_HEADERS_DIRENT(HEADER-FILE... [, ACTION])
  556. define(AC_CHECK_HEADERS_DIRENT,
  557. [for ac_hdr in $1
  558. do
  559. AC_CHECK_HEADER_DIRENT($ac_hdr,
  560. [changequote(, )dnl
  561.   ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdedfghijklmnopqrstuvwxyz./\055' 'ABCDEDFGHIJKLMNOPQRSTUVWXYZ___'`
  562. changequote([, ])dnl
  563.   AC_DEFINE_UNQUOTED($ac_tr_hdr) $2])dnl
  564. done])
  565.  
  566. AC_DEFUN(AC_DIR_HEADER,
  567. [AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl
  568. ac_header_dirent=no
  569. for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
  570.   AC_CHECK_HEADER_DIRENT($ac_hdr, [ac_header_dirent=$ac_hdr; break])
  571. done
  572.  
  573. case "$ac_header_dirent" in
  574. dirent.h) AC_DEFINE(DIRENT) ;;
  575. sys/ndir.h) AC_DEFINE(SYSNDIR) ;;
  576. sys/dir.h) AC_DEFINE(SYSDIR) ;;
  577. ndir.h) AC_DEFINE(NDIR) ;;
  578. esac
  579.  
  580. AC_CACHE_CHECK(whether closedir returns void, ac_cv_func_closedir_void,
  581. [AC_TRY_RUN([#include <sys/types.h>
  582. #include <$ac_header_dirent>
  583. int closedir(); main() { exit(closedir(opendir(".")) != 0); }],
  584.   ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes, ac_cv_func_closedir_void=yes)])
  585. if test $ac_cv_func_closedir_void = yes; then
  586.   AC_DEFINE(VOID_CLOSEDIR)
  587. fi
  588. ])
  589.  
  590. AC_DEFUN(AC_HEADER_STAT,
  591. [AC_CACHE_CHECK(whether stat file-mode macros are broken,
  592.   ac_cv_header_stat_broken,
  593. [AC_EGREP_CPP([You lose], [#include <sys/types.h>
  594. #include <sys/stat.h>
  595.  
  596. #if defined(S_ISBLK) && defined(S_IFDIR)
  597. # if S_ISBLK (S_IFDIR)
  598. You lose.
  599. # endif
  600. #endif
  601.  
  602. #if defined(S_ISBLK) && defined(S_IFCHR)
  603. # if S_ISBLK (S_IFCHR)
  604. You lose.
  605. # endif
  606. #endif
  607.  
  608. #if defined(S_ISLNK) && defined(S_IFREG)
  609. # if S_ISLNK (S_IFREG)
  610. You lose.
  611. # endif
  612. #endif
  613.  
  614. #if defined(S_ISSOCK) && defined(S_IFREG)
  615. # if S_ISSOCK (S_IFREG)
  616. You lose.
  617. # endif
  618. #endif
  619. ], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)])
  620. if test $ac_cv_header_stat_broken = yes; then
  621.   AC_DEFINE(STAT_MACROS_BROKEN)
  622. fi
  623. ])
  624.  
  625. AC_DEFUN(AC_DECL_SYS_SIGLIST,
  626. [AC_CACHE_CHECK([for sys_siglist declaration in signal.h or unistd.h],
  627.   ac_cv_decl_sys_siglist,
  628. [AC_TRY_COMPILE([#include <sys/types.h>
  629. #include <signal.h>
  630. /* NetBSD declares sys_siglist in unistd.h.  */
  631. #ifdef HAVE_UNISTD_H
  632. #include <unistd.h>
  633. #endif], [char *msg = *(sys_siglist + 1);],
  634.   ac_cv_decl_sys_siglist=yes, ac_cv_decl_sys_siglist=no)])
  635. if test $ac_cv_decl_sys_siglist = yes; then
  636.   AC_DEFINE(SYS_SIGLIST_DECLARED)
  637. fi
  638. ])
  639.  
  640. AC_DEFUN(AC_HEADER_SYS_WAIT,
  641. [AC_CACHE_CHECK([for sys/wait.h that is POSIX.1 compatible],
  642.   ac_cv_header_sys_wait_h,
  643. [AC_TRY_COMPILE([#include <sys/types.h>
  644. #include <sys/wait.h>
  645. #ifndef WEXITSTATUS
  646. #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
  647. #endif
  648. #ifndef WIFEXITED
  649. #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
  650. #endif], [int s;
  651. wait (&s);
  652. s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;],
  653. ac_cv_header_sys_wait_h=yes, ac_cv_header_sys_wait_h=no)])
  654. if test $ac_cv_header_sys_wait_h = yes; then
  655.   AC_DEFINE(HAVE_SYS_WAIT_H)
  656. fi
  657. ])
  658.  
  659.  
  660. dnl ### Checks for typedefs
  661.  
  662.  
  663. AC_DEFUN(AC_TYPE_GETGROUPS,
  664. [AC_REQUIRE([AC_TYPE_UID_T])dnl
  665. AC_CACHE_CHECK(type of array argument to getgroups, ac_cv_type_getgroups,
  666. [AC_TRY_RUN(
  667. changequote(<<, >>)dnl
  668. <<
  669. /* Thanks to Mike Rendell for this test.  */
  670. #include <sys/types.h>
  671. #define NGID 256
  672. #undef MAX
  673. #define MAX(x, y) ((x) > (y) ? (x) : (y))
  674. main()
  675. {
  676.   gid_t gidset[NGID];
  677.   int i, n;
  678.   union { gid_t gval; long lval; }  val;
  679.  
  680.   val.lval = -1;
  681.   for (i = 0; i < NGID; i++)
  682.     gidset[i] = val.gval;
  683.   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
  684.                  gidset);
  685.   /* Exit non-zero if getgroups seems to require an array of ints.  This
  686.      happens when gid_t is short but getgroups modifies an array of ints.  */
  687.   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
  688. }
  689. >>,
  690. changequote([, ])dnl
  691.   ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int,
  692.   ac_cv_type_getgroups=cross)
  693. if test $ac_cv_type_getgroups = cross; then
  694.   dnl When we can't run the test program (we are cross compiling), presume
  695.   dnl that <unistd.h> has either an accurate prototype for getgroups or none.
  696.   dnl Old systems without prototypes probably use int.
  697.   AC_EGREP_HEADER([getgroups.*int.*gid_t], unistd.h,
  698.           ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int)
  699. fi])
  700. AC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups)
  701. ])
  702.  
  703. AC_DEFUN(AC_TYPE_UID_T,
  704. [AC_CACHE_CHECK(for uid_t in sys/types.h, ac_cv_type_uid_t,
  705. [AC_EGREP_HEADER(uid_t, sys/types.h,
  706.   ac_cv_type_uid_t=yes, ac_cv_type_uid_t=no)])
  707. if test $ac_cv_type_uid_t = no; then
  708.   AC_DEFINE(uid_t, int)
  709.   AC_DEFINE(gid_t, int)
  710. fi
  711. ])
  712.  
  713. AC_DEFUN(AC_TYPE_SIZE_T,
  714. [AC_CHECK_TYPE(size_t, unsigned)])
  715.  
  716. AC_DEFUN(AC_TYPE_PID_T,
  717. [AC_CHECK_TYPE(pid_t, int)])
  718.  
  719. AC_DEFUN(AC_TYPE_OFF_T,
  720. [AC_CHECK_TYPE(off_t, long)])
  721.  
  722. AC_DEFUN(AC_TYPE_MODE_T,
  723. [AC_CHECK_TYPE(mode_t, int)])
  724.  
  725. dnl Note that identifiers starting with SIG are reserved by ANSI C.
  726. AC_DEFUN(AC_TYPE_SIGNAL,
  727. [AC_CACHE_CHECK([return type of signal handlers], ac_cv_type_signal,
  728. [AC_TRY_COMPILE([#include <sys/types.h>
  729. #include <signal.h>
  730. #ifdef signal
  731. #undef signal
  732. #endif
  733. #ifdef __cplusplus
  734. extern "C" void (*signal (int, void (*)(int)))(int);
  735. #else
  736. void (*signal ()) ();
  737. #endif
  738. ],
  739. [int i;], ac_cv_type_signal=void, ac_cv_type_signal=int)])
  740. AC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal)
  741. ])
  742.  
  743.  
  744. dnl ### Checks for functions
  745.  
  746.  
  747. AC_DEFUN(AC_FUNC_CLOSEDIR_VOID,
  748. [AC_REQUIRE([AC_HEADER_DIRENT])dnl
  749. AC_CACHE_CHECK(whether closedir returns void, ac_cv_func_closedir_void,
  750. [AC_TRY_RUN([#include <sys/types.h>
  751. #include <$ac_header_dirent>
  752. int closedir(); main() { exit(closedir(opendir(".")) != 0); }],
  753.   ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes, ac_cv_func_closedir_void=yes)])
  754. if test $ac_cv_func_closedir_void = yes; then
  755.   AC_DEFINE(CLOSEDIR_VOID)
  756. fi
  757. ])
  758.  
  759. AC_DEFUN(AC_FUNC_MMAP,
  760. [AC_CHECK_FUNCS(valloc getpagesize)
  761. AC_CACHE_CHECK(for working mmap, ac_cv_func_mmap,
  762. [AC_TRY_RUN([
  763. /* Thanks to Mike Haertel and Jim Avera for this test. */
  764. #include <sys/types.h>
  765. #include <fcntl.h>
  766. #include <sys/mman.h>
  767.  
  768. #ifndef HAVE_GETPAGESIZE
  769. # include <sys/param.h>
  770. # ifdef EXEC_PAGESIZE
  771. #  define getpagesize() EXEC_PAGESIZE
  772. # else
  773. #  ifdef NBPG
  774. #   define getpagesize() NBPG * CLSIZE
  775. #   ifndef CLSIZE
  776. #    define CLSIZE 1
  777. #   endif
  778. #  else
  779. #   ifdef NBPC
  780. #    define getpagesize() NBPC
  781. #   else
  782. #    define getpagesize() PAGESIZE /* SVR4 */
  783. #   endif
  784. #  endif
  785. # endif
  786. #endif
  787.  
  788. #ifndef HAVE_VALLOC
  789. # define valloc malloc
  790. #endif
  791.  
  792. #ifdef __cplusplus
  793. extern "C" { void *valloc(unsigned), *malloc(unsigned); }
  794. #else
  795. char *valloc(), *malloc();
  796. #endif
  797.  
  798. int
  799. main()
  800. {
  801.   char *buf1, *buf2, *buf3;
  802.   int i = getpagesize(), j;
  803.   int i2 = i * 2;
  804.   int fd;
  805.  
  806.   buf1 = (char *)valloc(i2);
  807.   buf2 = (char *)valloc(i);
  808.   buf3 = (char *)malloc(i2);
  809.   for (j = 0; j < i2; ++j)
  810.     *(buf1 + j) = rand();
  811.   fd = open("conftestmmap", O_CREAT | O_RDWR, 0666);
  812.   write(fd, buf1, i2);
  813.   mmap(buf2, i, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE, fd, 0);
  814.   for (j = 0; j < i; ++j)
  815.     if (*(buf1 + j) != *(buf2 + j))
  816.       exit(1);
  817.   lseek(fd, (long)i, 0);
  818.   read(fd, buf2, i); /* read into mapped memory -- file should not change */
  819.   /* (it does in i386 SVR4.0 - Jim Avera, jima@netcom.com) */
  820.   lseek(fd, (long)0, 0);
  821.   read(fd, buf3, i2);
  822.   for (j = 0; j < i2; ++j)
  823.     if (*(buf1 + j) != *(buf3 + j))
  824.       exit(1);
  825.   exit(0);
  826. }
  827. ], ac_cv_func_mmap=yes, ac_cv_func_mmap=no, ac_cv_func_mmap=no)])
  828. if test $ac_cv_func_mmap = yes; then
  829.   AC_DEFINE(HAVE_MMAP)
  830. fi
  831. ])
  832.  
  833. AC_DEFUN(AC_FUNC_GETPGRP,
  834. [AC_CACHE_CHECK(whether getpgrp takes no argument, ac_cv_func_getpgrp_void,
  835. [AC_TRY_RUN([
  836. /*
  837.  * If this system has a BSD-style getpgrp(),
  838.  * which takes a pid argument, exit unsuccessfully.
  839.  *
  840.  * Snarfed from Chet Ramey's bash pgrp.c test program
  841.  */
  842. #include <stdio.h>
  843. #include <sys/types.h>
  844.  
  845. int     pid;
  846. int     pg1, pg2, pg3, pg4;
  847. int     ng, np, s, child;
  848.  
  849. main()
  850. {
  851.         pid = getpid();
  852.         pg1 = getpgrp(0);
  853.         pg2 = getpgrp();
  854.         pg3 = getpgrp(pid);
  855.         pg4 = getpgrp(1);
  856.  
  857.         /*
  858.          * If all of these values are the same, it's pretty sure that
  859.          * we're on a system that ignores getpgrp's first argument.
  860.          */
  861.         if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
  862.                 exit(0);
  863.  
  864.         child = fork();
  865.         if (child < 0)
  866.                 exit(1);
  867.         else if (child == 0) {
  868.                 np = getpid();
  869.                 /*
  870.                  * If this is Sys V, this will not work; pgrp will be
  871.                  * set to np because setpgrp just changes a pgrp to be
  872.                  * the same as the pid.
  873.                  */
  874.                 setpgrp(np, pg1);
  875.                 ng = getpgrp(0);        /* Same result for Sys V and BSD */
  876.                 if (ng == pg1) {
  877.                         exit(1);
  878.                 } else {
  879.                         exit(0);
  880.                 }
  881.         } else {
  882.                 wait(&s);
  883.                 exit(s>>8);
  884.         }
  885. }
  886. ], ac_cv_func_getpgrp_void=yes, ac_cv_func_getpgrp_void=no,
  887.    AC_MSG_ERROR(cannot check getpgrp if cross compiling))
  888. ])
  889. if test $ac_cv_func_getpgrp_void = yes; then
  890.   AC_DEFINE(GETPGRP_VOID)
  891. fi
  892. ])
  893.  
  894. AC_DEFUN(AC_FUNC_VPRINTF,
  895. [AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
  896. if test "$ac_cv_func_vprintf" != yes; then
  897. AC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT))
  898. fi
  899. ])
  900.  
  901. AC_DEFUN(AC_FUNC_VFORK,
  902. [AC_REQUIRE([AC_TYPE_PID_T])dnl
  903. AC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H))
  904. AC_CACHE_CHECK(for working vfork, ac_cv_func_vfork,
  905. [AC_TRY_RUN([/* Thanks to Paul Eggert for this test.  */
  906. #include <stdio.h>
  907. #include <sys/types.h>
  908. #include <sys/stat.h>
  909. #ifdef HAVE_UNISTD_H
  910. #include <unistd.h>
  911. #endif
  912. #ifdef HAVE_VFORK_H
  913. #include <vfork.h>
  914. #endif
  915. /* On some sparc systems, changes by the child to local and incoming
  916.    argument registers are propagated back to the parent.
  917.    The compiler is told about this with #include <vfork.h>,
  918.    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
  919.    Test for this by using a static variable whose address
  920.    is put into a register that is clobbered by the vfork.  */
  921. static
  922. #ifdef __cplusplus
  923. sparc_address_test (int arg)
  924. #else
  925. sparc_address_test (arg) int arg;
  926. #endif
  927. {
  928.   static pid_t child;
  929.   if (!child) {
  930.     child = vfork ();
  931.     if (child < 0)
  932.       perror ("vfork");
  933.     if (!child) {
  934.       arg = getpid();
  935.       write(-1, "", 0);
  936.       _exit (arg);
  937.     }
  938.   }
  939. }
  940. main() {
  941.   pid_t parent = getpid ();
  942.   pid_t child;
  943.  
  944.   sparc_address_test ();
  945.  
  946.   child = vfork ();
  947.  
  948.   if (child == 0) {
  949.     /* Here is another test for sparc vfork register problems.
  950.        This test uses lots of local variables, at least
  951.        as many local variables as main has allocated so far
  952.        including compiler temporaries.  4 locals are enough for
  953.        gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe.
  954.        A buggy compiler should reuse the register of parent
  955.        for one of the local variables, since it will think that
  956.        parent can't possibly be used any more in this routine.
  957.        Assigning to the local variable will thus munge parent
  958.        in the parent process.  */
  959.     pid_t
  960.       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
  961.       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
  962.     /* Convince the compiler that p..p7 are live; otherwise, it might
  963.        use the same hardware register for all 8 local variables.  */
  964.     if (p != p1 || p != p2 || p != p3 || p != p4
  965.     || p != p5 || p != p6 || p != p7)
  966.       _exit(1);
  967.  
  968.     /* On some systems (e.g. IRIX 3.3),
  969.        vfork doesn't separate parent from child file descriptors.
  970.        If the child closes a descriptor before it execs or exits,
  971.        this munges the parent's descriptor as well.
  972.        Test for this by closing stdout in the child.  */
  973.     _exit(close(fileno(stdout)) != 0);
  974.   } else {
  975.     int status;
  976.     struct stat st;
  977.  
  978.     while (wait(&status) != child)
  979.       ;
  980.     exit(
  981.      /* Was there some problem with vforking?  */
  982.      child < 0
  983.  
  984.      /* Did the child fail?  (This shouldn't happen.)  */
  985.      || status
  986.  
  987.      /* Did the vfork/compiler bug occur?  */
  988.      || parent != getpid()
  989.  
  990.      /* Did the file descriptor bug occur?  */
  991.      || fstat(fileno(stdout), &st) != 0
  992.      );
  993.   }
  994. }],
  995. ac_cv_func_vfork=yes, ac_cv_func_vfork=no, AC_CHECK_FUNC(vfork))])
  996. if test $ac_cv_func_vfork = no; then
  997.   AC_DEFINE(vfork, fork)
  998. fi
  999. ])
  1000.  
  1001. AC_DEFUN(AC_FUNC_WAIT3,
  1002. [AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3,
  1003. [AC_TRY_RUN([#include <sys/types.h>
  1004. #include <sys/time.h>
  1005. #include <sys/resource.h>
  1006. #include <stdio.h>
  1007. /* HP-UX has wait3 but does not fill in rusage at all.  */
  1008. main() {
  1009.   struct rusage r;
  1010.   int i;
  1011.   /* Use a field that we can force nonzero --
  1012.      voluntary context switches.
  1013.      For systems like NeXT and OSF/1 that don't set it,
  1014.      also use the system CPU time.  And page faults (I/O) for Linux.  */
  1015.   r.ru_nvcsw = 0;
  1016.   r.ru_stime.tv_sec = 0;
  1017.   r.ru_stime.tv_usec = 0;
  1018.   r.ru_majflt = r.ru_minflt = 0;
  1019.   switch (fork()) {
  1020.   case 0: /* Child.  */
  1021.     sleep(1); /* Give up the CPU.  */
  1022.     _exit(0);
  1023.   case -1: _exit(0); /* What can we do?  */
  1024.   default: /* Parent.  */
  1025.     wait3(&i, 0, &r);
  1026.     sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines.  */
  1027.     exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
  1028.      && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
  1029.   }
  1030. }], ac_cv_func_wait3=yes, ac_cv_func_wait3=no, ac_cv_func_wait3=no)])
  1031. if test $ac_cv_func_wait3 = yes; then
  1032.   AC_DEFINE(HAVE_WAIT3)
  1033. fi
  1034. ])
  1035.  
  1036. AC_DEFUN(AC_FUNC_ALLOCA,
  1037. [AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally.
  1038. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  1039. # for constant arguments.  Useless!
  1040. AC_CACHE_CHECK([for working alloca.h], ac_cv_header_alloca_h,
  1041. [AC_TRY_LINK([#include <alloca.h>], [char *p = alloca(2 * sizeof(int));],
  1042.   ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)])
  1043. if test $ac_cv_header_alloca_h = yes; then
  1044.   AC_DEFINE(HAVE_ALLOCA_H)
  1045. fi
  1046.  
  1047. AC_CACHE_CHECK([for alloca], ac_cv_func_alloca,
  1048. [AC_TRY_LINK([
  1049. #ifdef __GNUC__
  1050. # define alloca __builtin_alloca
  1051. #else
  1052. # if HAVE_ALLOCA_H
  1053. #  include <alloca.h>
  1054. # else
  1055. #  ifdef _AIX
  1056.  #pragma alloca
  1057. #  else
  1058. #   ifndef alloca /* predefined by HP cc +Olibcalls */
  1059. char *alloca ();
  1060. #   endif
  1061. #  endif
  1062. # endif
  1063. #endif
  1064. ], [char *p = (char *) alloca(1);],
  1065.   ac_cv_func_alloca=yes, ac_cv_func_alloca=no)])
  1066. if test $ac_cv_func_alloca = yes; then
  1067.   AC_DEFINE(HAVE_ALLOCA)
  1068. fi
  1069.  
  1070. if test $ac_cv_func_alloca = no; then
  1071.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  1072.   # that cause trouble.  Some versions do not even contain alloca or
  1073.   # contain a buggy version.  If you still want to use their alloca,
  1074.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  1075.   ALLOCA=alloca.o
  1076.   AC_DEFINE(C_ALLOCA)
  1077.  
  1078. AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray,
  1079. [AC_EGREP_CPP(webecray,
  1080. [#if defined(CRAY) && ! defined(CRAY2)
  1081. webecray
  1082. #else
  1083. wenotbecray
  1084. #endif
  1085. ], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
  1086. if test $ac_cv_os_cray = yes; then
  1087. for ac_func in _getb67 GETB67 getb67; do
  1088.   AC_CHECK_FUNC($ac_func, [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func)
  1089.   break])
  1090. done
  1091. fi
  1092.  
  1093. AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
  1094. [AC_TRY_RUN([find_stack_direction ()
  1095. {
  1096.   static char *addr = 0;
  1097.   auto char dummy;
  1098.   if (addr == 0)
  1099.     {
  1100.       addr = &dummy;
  1101.       return find_stack_direction ();
  1102.     }
  1103.   else
  1104.     return (&dummy > addr) ? 1 : -1;
  1105. }
  1106. main ()
  1107. {
  1108.   exit (find_stack_direction() < 0);
  1109. }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
  1110.   ac_cv_c_stack_direction=0)])
  1111. AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
  1112. fi
  1113. AC_SUBST(ALLOCA)dnl
  1114. ])
  1115.  
  1116. AC_DEFUN(AC_FUNC_GETLOADAVG,
  1117. [ac_have_func=no # yes means we've found a way to get the load average.
  1118.  
  1119. # Some systems with -lutil have (and need) -lkvm as well, some do not.
  1120. # On Solaris, -lkvm requires nlist from -lelf, so check that first
  1121. # to get the right answer into the cache.
  1122. AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS")
  1123. AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS")
  1124. # Check for the 4.4BSD definition of getloadavg.
  1125. AC_CHECK_LIB(util, getloadavg,
  1126.   [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes])
  1127.  
  1128. if test $ac_have_func = no; then
  1129.   # There is a commonly available library for RS/6000 AIX.
  1130.   # Since it is not a standard part of AIX, it might be installed locally.
  1131.   ac_save_LIBS="$LIBS" LIBS="-L/usr/local/lib $LIBS"
  1132.   AC_CHECK_LIB(getloadavg, getloadavg,
  1133.     LIBS="-lgetloadavg $LIBS", LIBS="$ac_save_LIBS")
  1134. fi
  1135.  
  1136. # Make sure it is really in the library, if we think we found it.
  1137. AC_REPLACE_FUNCS(getloadavg)
  1138.  
  1139. if test $ac_cv_func_getloadavg = yes; then
  1140.   AC_DEFINE(HAVE_GETLOADAVG)
  1141.   ac_have_func=yes
  1142. else
  1143.   # Figure out what our getloadavg.c needs.
  1144.   ac_have_func=no
  1145.   AC_CHECK_HEADER(sys/dg_sys_info.h,
  1146.   [ac_have_func=yes; AC_DEFINE(DGUX)
  1147.   AC_CHECK_LIB(dgc, dg_sys_info)])
  1148.  
  1149.   # We cannot check for <dwarf.h>, because Solaris 2 does not use dwarf (it
  1150.   # uses stabs), but it is still SVR4.  We cannot check for <elf.h> because
  1151.   # Irix 4.0.5F has the header but not the library.
  1152.   if test $ac_have_func = no && test $ac_cv_lib_elf = yes; then
  1153.     ac_have_func=yes; AC_DEFINE(SVR4)
  1154.   fi
  1155.  
  1156.   if test $ac_have_func = no; then
  1157.     AC_CHECK_HEADER(inq_stats/cpustats.h,
  1158.     [ac_have_func=yes; AC_DEFINE(UMAX)
  1159.     AC_DEFINE(UMAX4_3)])
  1160.   fi
  1161.  
  1162.   if test $ac_have_func = no; then
  1163.     AC_CHECK_HEADER(sys/cpustats.h,
  1164.     [ac_have_func=yes; AC_DEFINE(UMAX)])
  1165.   fi
  1166.  
  1167.   if test $ac_have_func = no; then
  1168.     AC_CHECK_HEADERS(mach/mach.h)
  1169.   fi
  1170.  
  1171.   AC_CHECK_HEADER(nlist.h,
  1172.   [AC_DEFINE(NLIST_STRUCT)
  1173.   AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
  1174.   [AC_TRY_COMPILE([#include <nlist.h>],
  1175.   [struct nlist n; n.n_un.n_name = 0;],
  1176.   ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
  1177.   if test $ac_cv_struct_nlist_n_un = yes; then
  1178.     AC_DEFINE(NLIST_NAME_UNION)
  1179.   fi
  1180.   ])dnl
  1181. fi # Do not have getloadavg in system libraries.
  1182.  
  1183. # Some definitions of getloadavg require that the program be installed setgid.
  1184. dnl FIXME Don't hardwire the path of getloadavg.c in the top-level directory.
  1185. AC_CACHE_CHECK(whether getloadavg requires setgid,
  1186.   ac_cv_func_getloadavg_setgid,
  1187. [AC_EGREP_CPP([Yowza Am I SETGID yet],
  1188. [#include "$srcdir/getloadavg.c"
  1189. #ifdef LDAV_PRIVILEGED
  1190. Yowza Am I SETGID yet
  1191. #endif],
  1192.   ac_cv_func_getloadavg_setgid=yes, ac_cv_func_getloadavg_setgid=no)])
  1193. if test $ac_cv_func_getloadavg_setgid = yes; then
  1194.   NEED_SETGID=true; AC_DEFINE(GETLOADAVG_PRIVILEGED)
  1195. else
  1196.   NEED_SETGID=false
  1197. fi
  1198. AC_SUBST(NEED_SETGID)dnl
  1199.  
  1200. if test $ac_cv_func_getloadavg_setgid = yes; then
  1201.   AC_CACHE_CHECK(group of /dev/kmem, ac_cv_group_kmem,
  1202. [changequote(, )dnl
  1203.   # On Solaris, /dev/kmem is a symlink.  Get info on the real file.
  1204.   ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
  1205.   # If we got an error (system does not support symlinks), try without -L.
  1206.   test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
  1207.   ac_cv_group_kmem=`echo $ac_ls_output \
  1208.     | sed -ne 's/[     ][     ]*/ /g;
  1209.            s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\)  *.*/\1/;
  1210.            / /s/.* //;p;'`
  1211. changequote([, ])dnl
  1212. ])
  1213.   KMEM_GROUP=$ac_cv_group_kmem
  1214. fi
  1215. AC_SUBST(KMEM_GROUP)dnl
  1216. ])
  1217.  
  1218. AC_DEFUN(AC_FUNC_UTIME_NULL,
  1219. [AC_CACHE_CHECK(whether utime accepts a null argument, ac_cv_func_utime_null,
  1220. [rm -f conftestdata; > conftestdata
  1221. # Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
  1222. AC_TRY_RUN([#include <sys/types.h>
  1223. #include <sys/stat.h>
  1224. main() {
  1225. struct stat s, t;
  1226. exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0
  1227. && stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime
  1228. && t.st_mtime - s.st_mtime < 120));
  1229. }], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no,
  1230.   ac_cv_func_utime_null=no)
  1231. rm -f core core.* *.core])
  1232. if test $ac_cv_func_utime_null = yes; then
  1233.   AC_DEFINE(HAVE_UTIME_NULL)
  1234. fi
  1235. ])
  1236.  
  1237. AC_DEFUN(AC_FUNC_STRCOLL,
  1238. [AC_CACHE_CHECK(for strcoll, ac_cv_func_strcoll,
  1239. [AC_TRY_RUN([#include <string.h>
  1240. main ()
  1241. {
  1242.   exit (strcoll ("abc", "def") >= 0 ||
  1243.     strcoll ("ABC", "DEF") >= 0 ||
  1244.     strcoll ("123", "456") >= 0);
  1245. }], ac_cv_func_strcoll=yes, ac_cv_func_strcoll=no, ac_cv_func_strcoll=no)])
  1246. if test $ac_cv_func_strcoll = yes; then
  1247.   AC_DEFINE(HAVE_STRCOLL)
  1248. fi
  1249. ])
  1250.  
  1251. AC_DEFUN(AC_FUNC_SETVBUF_REVERSED,
  1252. [AC_CACHE_CHECK(whether setvbuf arguments are reversed,
  1253.   ac_cv_func_setvbuf_reversed,
  1254. [AC_TRY_RUN([#include <stdio.h>
  1255. /* If setvbuf has the reversed format, exit 0. */
  1256. main () {
  1257.   /* This call has the arguments reversed.
  1258.      A reversed system may check and see that the address of main
  1259.      is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
  1260.   if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
  1261.     exit(1);
  1262.   putc('\r', stdout);
  1263.   exit(0);            /* Non-reversed systems segv here.  */
  1264. }], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no)
  1265. rm -f core core.* *.core])
  1266. if test $ac_cv_func_setvbuf_reversed = yes; then
  1267.   AC_DEFINE(SETVBUF_REVERSED)
  1268. fi
  1269. ])
  1270.  
  1271. AC_DEFUN(AC_FUNC_GETMNTENT,
  1272. [# getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware.
  1273. AC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS",
  1274.   [AC_CHECK_LIB(seq, getmntent, LIBS="-lseq $LIBS",
  1275.     [AC_CHECK_LIB(gen, getmntent, LIBS="-lgen $LIBS")])])
  1276. AC_CHECK_FUNC(getmntent, [AC_DEFINE(HAVE_GETMNTENT)])])
  1277.  
  1278. AC_DEFUN(AC_FUNC_STRFTIME,
  1279. [# strftime is in -lintl on SCO UNIX.
  1280. AC_CHECK_LIB(intl, strftime, LIBS="-lintl $LIBS")
  1281. AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)])])
  1282.  
  1283. AC_DEFUN(AC_FUNC_MEMCMP,
  1284. [AC_CACHE_CHECK(for 8-bit clean memcmp, ac_cv_func_memcmp,
  1285. [AC_TRY_RUN([
  1286. main()
  1287. {
  1288.   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
  1289.   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
  1290. }
  1291. ], ac_cv_func_memcmp=yes, ac_cv_func_memcmp=no, ac_cv_func_memcmp=no)])
  1292. test $ac_cv_func_memcmp = no && LIBOBJS="$LIBOBJS memcmp.o"
  1293. AC_SUBST(LIBOBJS)dnl
  1294. ])
  1295.  
  1296.  
  1297. dnl ### Checks for structure members
  1298.  
  1299.  
  1300. AC_DEFUN(AC_HEADER_TIME,
  1301. [AC_CACHE_CHECK([whether time.h and sys/time.h may both be included],
  1302.   ac_cv_header_time,
  1303. [AC_TRY_COMPILE([#include <sys/types.h>
  1304. #include <sys/time.h>
  1305. #include <time.h>],
  1306. [struct tm *tp;], ac_cv_header_time=yes, ac_cv_header_time=no)])
  1307. if test $ac_cv_header_time = yes; then
  1308.   AC_DEFINE(TIME_WITH_SYS_TIME)
  1309. fi
  1310. ])
  1311.  
  1312. AC_DEFUN(AC_STRUCT_TM,
  1313. [AC_CACHE_CHECK([whether struct tm is in sys/time.h or time.h],
  1314.   ac_cv_struct_tm,
  1315. [AC_TRY_COMPILE([#include <sys/types.h>
  1316. #include <time.h>],
  1317. [struct tm *tp; tp->tm_sec;],
  1318.   ac_cv_struct_tm=time.h, ac_cv_struct_tm=sys/time.h)])
  1319. if test $ac_cv_struct_tm = sys/time.h; then
  1320.   AC_DEFINE(TM_IN_SYS_TIME)
  1321. fi
  1322. ])
  1323.  
  1324. AC_DEFUN(AC_STRUCT_TIMEZONE,
  1325. [AC_REQUIRE([AC_STRUCT_TM])dnl
  1326. AC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone,
  1327. [AC_TRY_COMPILE([#include <sys/types.h>
  1328. #include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;],
  1329.   ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)])
  1330. if test "$ac_cv_struct_tm_zone" = yes; then
  1331.   AC_DEFINE(HAVE_TM_ZONE)
  1332. else
  1333.   AC_CACHE_CHECK(for tzname, ac_cv_var_tzname,
  1334. [AC_TRY_LINK(
  1335. changequote(<<, >>)dnl
  1336. <<#include <time.h>
  1337. #ifndef tzname /* For SGI.  */
  1338. extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
  1339. #endif>>,
  1340. changequote([, ])dnl
  1341. [atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)])
  1342.   if test $ac_cv_var_tzname = yes; then
  1343.     AC_DEFINE(HAVE_TZNAME)
  1344.   fi
  1345. fi
  1346. ])
  1347.  
  1348. AC_DEFUN(AC_STRUCT_ST_BLOCKS,
  1349. [AC_CACHE_CHECK([for st_blocks in struct stat], ac_cv_struct_st_blocks,
  1350. [AC_TRY_COMPILE([#include <sys/types.h>
  1351. #include <sys/stat.h>], [struct stat s; s.st_blocks;],
  1352. ac_cv_struct_st_blocks=yes, ac_cv_struct_st_blocks=no)])
  1353. if test $ac_cv_struct_st_blocks = yes; then
  1354.   AC_DEFINE(HAVE_ST_BLOCKS)
  1355. else
  1356.   LIBOBJS="$LIBOBJS fileblocks.o"
  1357. fi
  1358. AC_SUBST(LIBOBJS)dnl
  1359. ])
  1360.  
  1361. AC_DEFUN(AC_STRUCT_ST_BLKSIZE,
  1362. [AC_CACHE_CHECK([for st_blksize in struct stat], ac_cv_struct_st_blksize,
  1363. [AC_TRY_COMPILE([#include <sys/types.h>
  1364. #include <sys/stat.h>], [struct stat s; s.st_blksize;],
  1365. ac_cv_struct_st_blksize=yes, ac_cv_struct_st_blksize=no)])
  1366. if test $ac_cv_struct_st_blksize = yes; then
  1367.   AC_DEFINE(HAVE_ST_BLKSIZE)
  1368. fi
  1369. ])
  1370.  
  1371. AC_DEFUN(AC_STRUCT_ST_RDEV,
  1372. [AC_CACHE_CHECK([for st_rdev in struct stat], ac_cv_struct_st_rdev,
  1373. [AC_TRY_COMPILE([#include <sys/types.h>
  1374. #include <sys/stat.h>], [struct stat s; s.st_rdev;],
  1375. ac_cv_struct_st_rdev=yes, ac_cv_struct_st_rdev=no)])
  1376. if test $ac_cv_struct_st_rdev = yes; then
  1377.   AC_DEFINE(HAVE_ST_RDEV)
  1378. fi
  1379. ])
  1380.  
  1381.  
  1382. dnl ### Checks for compiler characteristics
  1383.  
  1384.  
  1385. AC_DEFUN(AC_C_CROSS,
  1386. [# If we cannot run a trivial program, we must be cross compiling.
  1387. AC_CACHE_CHECK(whether cross-compiling, ac_cv_c_cross,
  1388. [AC_TRY_RUN([main(){return(0);}],
  1389.   ac_cv_c_cross=no, ac_cv_c_cross=yes, ac_cv_c_cross=yes)])
  1390. cross_compiling=$ac_cv_c_cross
  1391. ])
  1392.  
  1393. AC_DEFUN(AC_C_CHAR_UNSIGNED,
  1394. [AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
  1395. [if test "$GCC" = yes; then
  1396.   # GCC predefines this symbol on systems where it applies.
  1397. AC_EGREP_CPP(yes,
  1398. [#ifdef __CHAR_UNSIGNED__
  1399.   yes
  1400. #endif
  1401. ], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
  1402. else
  1403. AC_TRY_RUN(
  1404. [/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
  1405. #if !defined(__STDC__) || __STDC__ != 1
  1406. #define volatile
  1407. #endif
  1408. main() {
  1409.   volatile char c = 255; exit(c < 0);
  1410. }], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
  1411. fi])
  1412. if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
  1413.   AC_DEFINE(__CHAR_UNSIGNED__)
  1414. fi
  1415. ])
  1416.  
  1417. AC_DEFUN(AC_C_LONG_DOUBLE,
  1418. [AC_CACHE_CHECK(for long double, ac_cv_c_long_double,
  1419. [if test "$GCC" = yes; then
  1420.   ac_cv_c_long_double=yes
  1421. else
  1422. AC_TRY_RUN([int main() {
  1423. /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
  1424. long double foo = 0.0;
  1425. /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
  1426. exit(sizeof(long double) < sizeof(double)); }],
  1427. ac_cv_c_long_double=yes, ac_cv_c_long_double=no)
  1428. fi])
  1429. if test $ac_cv_c_long_double = yes; then
  1430.   AC_DEFINE(HAVE_LONG_DOUBLE)
  1431. fi
  1432. ])
  1433.  
  1434. AC_DEFUN(AC_INT_16_BITS,
  1435. [AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)])dnl
  1436. AC_MSG_CHECKING(whether int is 16 bits)
  1437. AC_TRY_RUN([main() { exit(sizeof(int) != 2); }],
  1438.  [AC_MSG_RESULT(yes)
  1439.  AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(no))
  1440. ])
  1441.  
  1442. AC_DEFUN(AC_LONG_64_BITS,
  1443. [AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)])dnl
  1444. AC_MSG_CHECKING(whether long int is 64 bits)
  1445. AC_TRY_RUN([main() { exit(sizeof(long int) != 8); }],
  1446.  [AC_MSG_RESULT(yes)
  1447.  AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(no))
  1448. ])
  1449.  
  1450. AC_DEFUN(AC_C_BIGENDIAN,
  1451. [AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian,
  1452. [ac_cv_c_bigendian=unknown
  1453. # See if sys/param.h defines the BYTE_ORDER macro.
  1454. AC_TRY_COMPILE([#include <sys/types.h>
  1455. #include <sys/param.h>], [
  1456. #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
  1457.  bogus endian macros
  1458. #endif], [# It does; now see whether it defined to BIG_ENDIAN or not.
  1459. AC_TRY_COMPILE([#include <sys/types.h>
  1460. #include <sys/param.h>], [
  1461. #if BYTE_ORDER != BIG_ENDIAN
  1462.  not big endian
  1463. #endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)])
  1464. if test $ac_cv_c_bigendian = unknown; then
  1465. AC_TRY_RUN([main () {
  1466.   /* Are we little or big endian?  From Harbison&Steele.  */
  1467.   union
  1468.   {
  1469.     long l;
  1470.     char c[sizeof (long)];
  1471.   } u;
  1472.   u.l = 1;
  1473.   exit (u.c[sizeof (long) - 1] == 1);
  1474. }], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes)
  1475. fi])
  1476. if test $ac_cv_c_bigendian = yes; then
  1477.   AC_DEFINE(WORDS_BIGENDIAN)
  1478. fi
  1479. ])
  1480.  
  1481. dnl Do nothing if the compiler accepts the inline keyword.
  1482. dnl Otherwise define inline to __inline__ or __inline if one of those work,
  1483. dnl otherwise define inline to be empty.
  1484. AC_DEFUN(AC_C_INLINE,
  1485. [AC_CACHE_CHECK([for inline], ac_cv_c_inline,
  1486. [ac_cv_c_inline=no
  1487. for ac_kw in inline __inline__ __inline; do
  1488.   AC_TRY_COMPILE(, [} $ac_kw foo() {], [ac_cv_c_inline=$ac_kw; break])
  1489. done
  1490. ])
  1491. case "$ac_cv_c_inline" in
  1492.   inline | yes) ;;
  1493.   no) AC_DEFINE(inline, ) ;;
  1494.   *)  AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline) ;;
  1495. esac
  1496. ])
  1497.  
  1498. AC_DEFUN(AC_C_CONST,
  1499. [dnl This message is consistent in form with the other checking messages,
  1500. dnl and with the result message.
  1501. AC_CACHE_CHECK([for working const], ac_cv_c_const,
  1502. [AC_TRY_COMPILE(,
  1503. changequote(<<, >>)dnl
  1504. <<
  1505. /* Ultrix mips cc rejects this.  */
  1506. typedef int charset[2]; const charset x;
  1507. /* SunOS 4.1.1 cc rejects this.  */
  1508. char const *const *ccp;
  1509. char **p;
  1510. /* NEC SVR4.0.2 mips cc rejects this.  */
  1511. struct point {int x, y;};
  1512. static struct point const zero = {0,0};
  1513. /* AIX XL C 1.02.0.0 rejects this.
  1514.    It does not let you subtract one const X* pointer from another in an arm
  1515.    of an if-expression whose if-part is not a constant expression */
  1516. const char *g = "string";
  1517. ccp = &g + (g ? g-g : 0);
  1518. /* HPUX 7.0 cc rejects these. */
  1519. ++ccp;
  1520. p = (char**) ccp;
  1521. ccp = (char const *const *) p;
  1522. { /* SCO 3.2v4 cc rejects this.  */
  1523.   char *t;
  1524.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  1525.  
  1526.   *t++ = 0;
  1527. }
  1528. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  1529.   int x[] = {25, 17};
  1530.   const int *foo = &x[0];
  1531.   ++foo;
  1532. }
  1533. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  1534.   typedef const int *iptr;
  1535.   iptr p = 0;
  1536.   ++p;
  1537. }
  1538. { /* AIX XL C 1.02.0.0 rejects this saying
  1539.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  1540.   struct s { int j; const int *ap[3]; };
  1541.   struct s *b; b->j = 5;
  1542. }
  1543. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  1544.   const int foo = 10;
  1545. }
  1546. >>,
  1547. changequote([, ])dnl
  1548. ac_cv_c_const=yes, ac_cv_c_const=no)])
  1549. if test $ac_cv_c_const = no; then
  1550.   AC_DEFINE(const, )
  1551. fi
  1552. ])
  1553.  
  1554. define(AC_ARG_ARRAY,
  1555. [errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments
  1556. )m4exit(4)])
  1557.  
  1558.  
  1559. dnl ### Checks for operating system services
  1560.  
  1561.  
  1562. AC_DEFUN(AC_SYS_INTERPRETER,
  1563. [# Pull the hash mark out of the macro call to avoid m4 problems.
  1564. ac_msg="whether #! works in shell scripts"
  1565. AC_CACHE_CHECK($ac_msg, ac_cv_sys_interpreter,
  1566. [echo '#! /bin/cat
  1567. exit 69
  1568. ' > conftest
  1569. chmod u+x conftest
  1570. (SHELL=/bin/sh; export SHELL; ./conftest >/dev/null)
  1571. if test $? -ne 69; then
  1572.    ac_cv_sys_interpreter=yes
  1573. else
  1574.    ac_cv_sys_interpreter=no
  1575. fi
  1576. rm -f conftest])
  1577. ])
  1578.  
  1579. define(AC_HAVE_POUNDBANG,
  1580. [errprint(__file__:__line__: [$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments
  1581. ])m4exit(4)])
  1582.  
  1583. AC_DEFUN(AC_SYS_LONG_FILE_NAMES,
  1584. [AC_CACHE_CHECK(for long file names, ac_cv_sys_long_file_names,
  1585. [ac_cv_sys_long_file_names=yes
  1586. # Test for long file names in all the places we know might matter:
  1587. #      .        the current directory, where building will happen
  1588. #      /tmp        where it might want to write temporary files
  1589. #      /var/tmp        likewise
  1590. #      /usr/tmp        likewise
  1591. #      $prefix/lib    where we will be installing things
  1592. #      $exec_prefix/lib    likewise
  1593. # eval it to expand exec_prefix.
  1594. for ac_dir in `eval echo . /tmp /var/tmp /usr/tmp $prefix/lib $exec_prefix/lib` ; do
  1595.   test -d $ac_dir || continue
  1596.   test -w $ac_dir || continue # It is less confusing to not echo anything here.
  1597.   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
  1598.   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
  1599.   val=`cat $ac_dir/conftest9012345 2>/dev/null`
  1600.   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
  1601.     ac_cv_sys_long_file_names=no
  1602.     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
  1603.     break
  1604.   fi
  1605.   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
  1606. done])
  1607. if test $ac_cv_sys_long_file_names = yes; then
  1608.   AC_DEFINE(HAVE_LONG_FILE_NAMES)
  1609. fi
  1610. ])
  1611.  
  1612. AC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS,
  1613. [AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls,
  1614. [AC_TRY_RUN(
  1615. [/* Exit 0 (true) if wait returns something other than -1,
  1616.    i.e. the pid of the child, which means that wait was restarted
  1617.    after getting the signal.  */
  1618. #include <sys/types.h>
  1619. #include <signal.h>
  1620. ucatch (isig) { }
  1621. main () {
  1622.   int i = fork (), status;
  1623.   if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
  1624.   signal (SIGINT, ucatch);
  1625.   status = wait(&i);
  1626.   if (status == -1) wait(&i);
  1627.   exit (status == -1);
  1628. }
  1629. ], ac_cv_sys_restartable_syscalls=yes, ac_cv_sys_restartable_syscalls=no)])
  1630. if test $ac_cv_sys_restartable_syscalls = yes; then
  1631.   AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
  1632. fi
  1633. ])
  1634.  
  1635. AC_DEFUN(AC_PATH_X,
  1636. [AC_REQUIRE_CPP()dnl Set CPP; we run AC_PATH_X_DIRECT conditionally.
  1637. # If we find X, set shell vars x_includes and x_libraries to the
  1638. # paths, otherwise set no_x=yes.
  1639. # Uses ac_ vars as temps to allow command line to override cache and checks.
  1640. # --without-x overrides everything else, but does not touch the cache.
  1641. AC_MSG_CHECKING(for X)
  1642.  
  1643. AC_ARG_WITH(x, [  --with-x                use the X Window System])
  1644. if test "x$with_x" = xno; then
  1645.   no_x=yes
  1646. else
  1647.   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
  1648.     no_x=
  1649.   else
  1650. AC_CACHE_VAL(ac_cv_path_x,
  1651. [# One or both of the vars are not set, and there is no cached value.
  1652. no_x=yes
  1653. AC_PATH_X_XMKMF
  1654. if test "$no_x" = yes; then
  1655. AC_PATH_X_DIRECT
  1656. fi
  1657. if test "$no_x" = yes; then
  1658.   ac_cv_path_x="no_x=yes"
  1659. else
  1660.   ac_cv_path_x="no_x= ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
  1661. fi])dnl
  1662.   fi
  1663.   eval "$ac_cv_path_x"
  1664. fi # $with_x != no
  1665.  
  1666. if test "$no_x" = yes; then
  1667.   AC_MSG_RESULT(no)
  1668. else
  1669.   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
  1670.   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
  1671.   ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
  1672.   AC_MSG_RESULT([libraries $x_libraries, headers $x_includes])
  1673. fi
  1674. ])
  1675.  
  1676. dnl Internal subroutine of AC_PATH_X.
  1677. dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes).
  1678. AC_DEFUN(AC_PATH_X_XMKMF,
  1679. [rm -fr conftestdir
  1680. if mkdir conftestdir; then
  1681.   cd conftestdir
  1682.   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
  1683.   cat > Imakefile <<'EOF'
  1684. acfindx:
  1685.     @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
  1686. EOF
  1687.   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
  1688.     no_x=
  1689.     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
  1690.     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
  1691.     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
  1692.     for ac_extension in a so sl; do
  1693.       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
  1694.         test -f $ac_im_libdir/libX11.$ac_extension; then
  1695.         ac_im_usrlibdir=$ac_im_libdir; break
  1696.       fi
  1697.     done
  1698.     # Screen out bogus values from the imake configuration.
  1699.     case "$ac_im_incroot" in
  1700.     /usr/include) ;;
  1701.     *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
  1702.     esac
  1703.     case "$ac_im_usrlibdir" in
  1704.     /usr/lib | /lib) ;;
  1705.     *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
  1706.     esac
  1707.   fi
  1708.   cd ..
  1709.   rm -fr conftestdir
  1710. fi
  1711. ])
  1712.  
  1713. dnl Internal subroutine of AC_PATH_X.
  1714. dnl Set ac_x_includes, ac_x_libraries, and no_x (initially yes).
  1715. AC_DEFUN(AC_PATH_X_DIRECT,
  1716. [test -z "$x_direct_test_library" && x_direct_test_library=Xt
  1717. test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
  1718. test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
  1719. AC_TRY_CPP([#include <$x_direct_test_include>],
  1720. [no_x= ac_x_includes=],
  1721. [  for ac_dir in               \
  1722.     /usr/X11R6/include        \
  1723.     /usr/X11R5/include        \
  1724.     /usr/X11R4/include        \
  1725.                               \
  1726.     /usr/include/X11R6        \
  1727.     /usr/include/X11R5        \
  1728.     /usr/include/X11R4        \
  1729.                               \
  1730.     /usr/local/X11R6/include  \
  1731.     /usr/local/X11R5/include  \
  1732.     /usr/local/X11R4/include  \
  1733.                               \
  1734.     /usr/local/include/X11R6  \
  1735.     /usr/local/include/X11R5  \
  1736.     /usr/local/include/X11R4  \
  1737.                               \
  1738.     /usr/X11/include          \
  1739.     /usr/include/X11          \
  1740.     /usr/local/X11/include    \
  1741.     /usr/local/include/X11    \
  1742.                               \
  1743.     /usr/X386/include         \
  1744.     /usr/x386/include         \
  1745.     /usr/XFree86/include/X11  \
  1746.                               \
  1747.     /usr/include              \
  1748.     /usr/local/include        \
  1749.     /usr/unsupported/include  \
  1750.     /usr/athena/include       \
  1751.     /usr/local/x11r5/include  \
  1752.     /usr/lpp/Xamples/include  \
  1753.                               \
  1754.     /usr/openwin/include      \
  1755.     /usr/openwin/share/include \
  1756.     ; \
  1757.   do
  1758.     if test -r "$ac_dir/$x_direct_test_include"; then
  1759.       no_x= ac_x_includes=$ac_dir
  1760.       break
  1761.     fi
  1762.   done])
  1763.  
  1764. # Check for the libraries.
  1765. # See if we find them without any special options.
  1766. # Don't add to $LIBS permanently.
  1767. ac_save_LIBS="$LIBS"
  1768. LIBS="-l$x_direct_test_library $LIBS"
  1769. AC_TRY_LINK(, [${x_direct_test_function}()],
  1770. [LIBS="$ac_save_LIBS" no_x= ac_x_libraries=],
  1771. [LIBS="$ac_save_LIBS"
  1772. # First see if replacing the include by lib works.
  1773. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
  1774.     /usr/X11R6/lib        \
  1775.     /usr/X11R5/lib        \
  1776.     /usr/X11R4/lib        \
  1777.                           \
  1778.     /usr/lib/X11R6        \
  1779.     /usr/lib/X11R5        \
  1780.     /usr/lib/X11R4        \
  1781.                           \
  1782.     /usr/local/X11R6/lib  \
  1783.     /usr/local/X11R5/lib  \
  1784.     /usr/local/X11R4/lib  \
  1785.                           \
  1786.     /usr/local/lib/X11R6  \
  1787.     /usr/local/lib/X11R5  \
  1788.     /usr/local/lib/X11R4  \
  1789.                           \
  1790.     /usr/X11/lib          \
  1791.     /usr/lib/X11          \
  1792.     /usr/local/X11/lib    \
  1793.     /usr/local/lib/X11    \
  1794.                           \
  1795.     /usr/X386/lib         \
  1796.     /usr/x386/lib         \
  1797.     /usr/XFree86/lib/X11  \
  1798.                           \
  1799.     /usr/lib              \
  1800.     /usr/local/lib        \
  1801.     /usr/unsupported/lib  \
  1802.     /usr/athena/lib       \
  1803.     /usr/local/x11r5/lib  \
  1804.     /usr/lpp/Xamples/lib  \
  1805.                           \
  1806.     /usr/openwin/lib      \
  1807.     /usr/openwin/share/lib \
  1808.     ; \
  1809. do
  1810.   for ac_extension in a so sl; do
  1811.     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
  1812.       no_x= ac_x_libraries=$ac_dir
  1813.       break 2
  1814.     fi
  1815.   done
  1816. done])])
  1817.  
  1818. dnl Find additional X libraries, magic flags, etc.
  1819. AC_DEFUN(AC_PATH_XTRA,
  1820. [AC_REQUIRE([AC_ISC_POSIX])dnl
  1821. AC_REQUIRE([AC_PATH_X])dnl
  1822. if test "$no_x" = yes; then 
  1823.   # Not all programs may use this symbol, but it does not hurt to define it.
  1824.   X_CFLAGS="$X_CFLAGS -DX_DISPLAY_MISSING"
  1825. else
  1826.   if test -n "$x_includes"; then
  1827.     X_CFLAGS="$X_CFLAGS -I$x_includes"
  1828.   fi
  1829.  
  1830.   # It would be nice to have a more robust check for the -R ld option than
  1831.   # just checking for Solaris.
  1832.   # It would also be nice to do this for all -L options, not just this one.
  1833.   if test -n "$x_libraries"; then
  1834.     X_LIBS="$X_LIBS -L$x_libraries"
  1835.     if test "`(uname) 2>/dev/null`" = SunOS &&
  1836.       uname -r | grep '^5' >/dev/null; then
  1837.       X_LIBS="$X_LIBS -R $x_libraries"
  1838.     fi
  1839.   fi
  1840.  
  1841.   # Check for libraries that X11R6 Xt/Xaw programs need.
  1842.  
  1843.   ac_save_LDFLAGS="$LDFLAGS"
  1844.   LDFLAGS="$LDFLAGS -L$x_libraries"
  1845.   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  1846.   # check for ICE first), but we must link in the order -lSM -lICE or
  1847.   # we get undefined symbols.  So assume we have SM if we have ICE.
  1848.   # These have to be linked with before -lX11, unlike the other
  1849.   # libraries we check for below, so use a different variable.
  1850.   #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  1851.   AC_CHECK_LIB(ICE, IceConnectionNumber,
  1852.     [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"])
  1853.   LDFLAGS="$ac_save_LDFLAGS"
  1854.  
  1855.   # Check for system-dependent libraries X programs must link with.
  1856.  
  1857.   if test "$ISC" = yes; then
  1858.     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
  1859.   else
  1860.     # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
  1861.     # libraries were built with DECnet support.  And karl@cs.umb.edu says
  1862.     # the Alpha needs dnet_stub (dnet does not exist).
  1863.     AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  1864.     if test $ac_cv_lib_dnet = no; then
  1865.       AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  1866.         [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  1867.     fi
  1868.  
  1869.     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
  1870.     # to get the SysV transport functions.
  1871.     # Not sure which flavor of 386 UNIX this is, but it seems harmless to
  1872.     # check for it.
  1873.     AC_CHECK_LIB(nsl, t_accept, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"])
  1874.  
  1875.     # lieder@skyler.mavd.honeywell.com says without -lsocket,
  1876.     # socket/setsockopt and other routines are undefined under SCO ODT 2.0.
  1877.     # But -lsocket is broken on IRIX, according to simon@lia.di.epfl.ch.
  1878.     if test "`(uname) 2>/dev/null`" != IRIX; then
  1879.       AC_CHECK_LIB(socket, socket, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lsocket"])
  1880.     fi
  1881.   fi
  1882. fi
  1883. AC_SUBST(X_CFLAGS)dnl
  1884. AC_SUBST(X_PRE_LIBS)dnl
  1885. AC_SUBST(X_LIBS)dnl
  1886. AC_SUBST(X_EXTRA_LIBS)dnl
  1887. ])
  1888.  
  1889.  
  1890. dnl ### Checks for UNIX variants
  1891. dnl These are kludges which should be replaced by a single POSIX check.
  1892. dnl They aren't cached, to discourage their use.
  1893.  
  1894.  
  1895. AC_DEFUN(AC_AIX,
  1896. [AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
  1897. AC_BEFORE([$0], [AC_TRY_LINK])dnl
  1898. AC_BEFORE([$0], [AC_TRY_RUN])dnl
  1899. AC_MSG_CHECKING(for AIX)
  1900. AC_EGREP_CPP(yes,
  1901. [#ifdef _AIX
  1902.   yes
  1903. #endif
  1904. ], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no))
  1905. ])
  1906.  
  1907. AC_DEFUN(AC_MINIX,
  1908. [AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
  1909. AC_BEFORE([$0], [AC_TRY_LINK])dnl
  1910. AC_BEFORE([$0], [AC_TRY_RUN])dnl
  1911. AC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=)
  1912. if test "$MINIX" = yes; then
  1913.   AC_DEFINE(_POSIX_SOURCE)
  1914.   AC_DEFINE(_POSIX_1_SOURCE, 2)
  1915.   AC_DEFINE(_MINIX)
  1916. fi
  1917. ])
  1918.  
  1919. AC_DEFUN(AC_ISC_POSIX,
  1920. [AC_BEFORE([$0], [AC_TRY_COMPILE])dnl
  1921. AC_BEFORE([$0], [AC_TRY_LINK])dnl
  1922. AC_BEFORE([$0], [AC_TRY_RUN])dnl
  1923. AC_MSG_CHECKING(for POSIXized ISC)
  1924. if test -d /etc/conf/kconfig.d &&
  1925.   grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1
  1926. then
  1927.   AC_MSG_RESULT(yes)
  1928.   ISC=yes # If later tests want to check for ISC.
  1929.   AC_DEFINE(_POSIX_SOURCE)
  1930.   if test "$GCC" = yes; then
  1931.     CC="$CC -posix"
  1932.   else
  1933.     CC="$CC -Xp"
  1934.   fi
  1935. else
  1936.   AC_MSG_RESULT(no)
  1937.   ISC=
  1938. fi
  1939. ])
  1940.  
  1941. AC_DEFUN(AC_XENIX_DIR,
  1942. [AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl
  1943. AC_REQUIRE([AC_DIR_HEADER])dnl
  1944. AC_MSG_CHECKING(for Xenix)
  1945. AC_EGREP_CPP(yes,
  1946. [#if defined(M_XENIX) && !defined(M_UNIX)
  1947.   yes
  1948. #endif
  1949. ], [AC_MSG_RESULT(yes); XENIX=yes], [AC_MSG_RESULT(no); XENIX=])
  1950. if test "$XENIX" = yes; then
  1951.   # Make sure -ldir precedes -lx.
  1952.   test $ac_header_dirent = dirent.h && LIBS="-ldir $LIBS"
  1953.   LIBS="$LIBS -lx"
  1954. fi
  1955. ])
  1956.  
  1957. AC_DEFUN(AC_DYNIX_SEQ,
  1958. [AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT])dnl
  1959. AC_CHECK_LIB(seq, getmntent, LIBS="-lseq $LIBS")
  1960. ])
  1961.  
  1962. AC_DEFUN(AC_IRIX_SUN,
  1963. [AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT or AC_CHECK_LIB(sun, getpwnam)])dnl
  1964. AC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS")
  1965. ])
  1966.  
  1967. AC_DEFUN(AC_SCO_INTL,
  1968. [AC_OBSOLETE([$0], [; instead use AC_FUNC_STRFTIME])dnl
  1969. AC_CHECK_LIB(intl, strftime, LIBS="-lintl $LIBS")
  1970. ])
  1971.