📄 aclocal.m4
字号:
dnl aclocal.m4 generated automatically by aclocal 1.4-p6dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.dnl This file is free software; the Free Software Foundationdnl gives unlimited permission to copy and/or distribute it,dnl with or without modifications, as long as this notice is preserved.dnl This program is distributed in the hope that it will be useful,dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; withoutdnl even the implied warranty of MERCHANTABILITY or FITNESS FOR Adnl PARTICULAR PURPOSE.dnl $Id: acinclude.m4,v 1.2 2004/02/20 14:26:09 dm Exp $dnldnl Find full path to programdnlAC_DEFUN(SFS_PATH_PROG,[AC_PATH_PROG(PATH_[]translit($1, [a-z], [A-Z]), $1,,$2[]ifelse($2,,,:)/usr/bin:/bin:/sbin:/usr/sbin:/usr/etc:/usr/libexec:/usr/ucb:/usr/bsd:/usr/5bin:$PATH:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin)if test "$PATH_[]translit($1, [a-z], [A-Z])"; then AC_DEFINE_UNQUOTED(PATH_[]translit($1, [a-z], [A-Z]), "$PATH_[]translit($1, [a-z], [A-Z])", Full path of $1 command)fi])dnldnl File path to cppdnlAC_DEFUN(SFS_PATH_CPP,[AC_PATH_PROG(_PATH_CPP, cpp,,/usr/ccs/bin:/usr/bin:/bin:/sbin:/usr/sbin:/usr/etc:/usr/libexec:/lib:/usr/lib:/usr/ucb:/usr/bsd:/usr/5bin:$PATH:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin)if test -z "$_PATH_CPP"; then if test "$GCC" = yes; then _PATH_CPP=`$CC -print-prog-name=cpp` else _PATH_CPP=`gcc -print-prog-name=cpp 2> /dev/null` fifitest -x "$_PATH_CPP" || unset _PATH_CPPif test -z "$_PATH_CPP"; then AC_MSG_ERROR(Cannot find path for cpp)fiAC_DEFINE_UNQUOTED(PATH_CPP, "$_PATH_CPP", Path for the C preprocessor command)])dnldnl How to get BSD-like df outputdnlAC_DEFUN(SFS_PATH_DF,[SFS_PATH_PROG(df, /usr/ucb:/usr/bsd:/usr/local/bin)AC_CACHE_CHECK(if [$PATH_DF] needs -k for BSD-formatted output, sfs_cv_df_dash_k,sfs_cv_df_dash_k=no[test "`$PATH_DF . | sed -e '2,$d;/Mounted on/d'`" \ && test "`$PATH_DF -k . | sed -ne '2,$d;/Mounted on/p'`" \ && sfs_cv_df_dash_k=yes])if test $sfs_cv_df_dash_k = yes; then AC_DEFINE(DF_NEEDS_DASH_K, 1, Define if you must run \"df -k\" to get BSD-formatted output)fi])dnldnl Check for declarationsdnl SFS_CHECK_DECL(symbol, headers-to-try, headers-to-include)dnlAC_DEFUN(SFS_CHECK_DECL,[AC_CACHE_CHECK(for a declaration of $1, sfs_cv_$1_decl,dnl for hdr in [patsubst(builtin(shift, $@), [,], [ ])]; do for hdr in $2; do if test -z "${sfs_cv_$1_decl}"; thendnl AC_HEADER_EGREP($1, $hdr, sfs_cv_$1_decl=yes) AC_TRY_COMPILE(patsubst($3, [\([^ ]+\) *], [#include <\1>])[#include <$hdr>], &$1;, sfs_cv_$1_decl=yes) fi done test -z "${sfs_cv_$1_decl+set}" && sfs_cv_$1_decl=no)if test "$sfs_cv_$1_decl" = no; then AC_DEFINE_UNQUOTED(NEED_[]translit($1, [a-z], [A-Z])_DECL, 1, Define if system headers do not declare $1.)fi])dnldnl Check if lsof keeps a device cachednlAC_DEFUN(SFS_LSOF_DEVCACHE,[if test "$PATH_LSOF"; then AC_CACHE_CHECK(if lsof supports a device cache, sfs_cv_lsof_devcache, if $PATH_LSOF -h 2>&1 | fgrep -e -D > /dev/null; then sfs_cv_lsof_devcache=yes else sfs_cv_lsof_devcache=no fi) if test "$sfs_cv_lsof_devcache" = yes; then AC_DEFINE(LSOF_DEVCACHE, 1, Define is lsof supports the -D option) fifi])dnldnl Posix time subroutinednlAC_DEFUN(SFS_TIME_CHECK,[AC_CACHE_CHECK($3, sfs_cv_time_check_$1,AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME# include <sys/time.h># include <time.h>#elif defined (HAVE_SYS_TIME_H)# include <sys/time.h>#else /* !TIME_WITH_SYS_TIME && !HAVE_SYS_TIME_H */# include <time.h>#endif /* !TIME_WITH_SYS_TIME && !HAVE_SYS_TIME_H */], $2, sfs_cv_time_check_$1=yes, sfs_cv_time_check_$1=no))if test "$sfs_cv_time_check_$1" = yes; then AC_DEFINE($1, 1, $4)fi])dnldnl Posix time stuffdnlAC_DEFUN(SFS_TIMESPEC,[AC_CHECK_HEADERS(sys/time.h)AC_HEADER_TIMEAC_CHECK_FUNCS(clock_gettime)SFS_TIME_CHECK(HAVE_CLOCK_GETTIME_DECL, int (*x) () = &clock_gettime;, for a declaration of clock_gettime, Define if system headers declare clock_gettime.)SFS_TIME_CHECK(HAVE_TIMESPEC, int x = sizeof (struct timespec), for struct timespec, Define if sys/time.h defines a struct timespec.)dnl AC_EGREP_HEADER(clock_gettime, sys/time.h,dnl AC_DEFINE(HAVE_CLOCK_GETTIME_DECL, 1,dnl Define if system header files declare clock_gettime.))dnl AC_EGREP_HEADER(timespec, sys/time.h,dnl AC_DEFINE(HAVE_TIMESPEC, 1,dnl Define if sys/time.h defines a struct timespec.))])dnldnl Find the crypt functiondnlAC_DEFUN(SFS_FIND_CRYPT,[AC_SUBST(LIBCRYPT)AC_CHECK_FUNC(crypt)if test $ac_cv_func_crypt = no; then AC_CHECK_LIB(crypt, crypt, LIBCRYPT="-lcrypt")fi])dnldnl Find pty functionsdnlAC_DEFUN(SFS_PTYLIB,[AC_SUBST(PTYLIB)AC_CHECK_FUNCS(_getpty)AC_CHECK_FUNCS(openpty)if test $ac_cv_func_openpty = no; then AC_CHECK_LIB(util, openpty, PTYLIB="-lutil" AC_DEFINE(HAVE_OPENPTY, 1, Define if you have the openpty function.))fiif test "$ac_cv_func_openpty" = yes -o "$ac_cv_lib_util_openpty" = yes; then AC_CHECK_HEADERS(util.h libutil.h)fiAC_CHECK_HEADERS(pty.h)AC_CACHE_CHECK(for BSD-style utmp slots, ac_cv_have_ttyent, AC_EGREP_HEADER(getttyent, ttyent.h, ac_cv_have_ttyent=yes, ac_cv_have_ttyent=no))if test "$ac_cv_have_ttyent" = yes; then AC_DEFINE(USE_TTYENT, 1, Define if utmp must be managed with BSD-style ttyent functions)fiAC_MSG_CHECKING(for pseudo ttys)if test -c /dev/ptmx && test -c /dev/pts/0then AC_DEFINE(HAVE_DEV_PTMX, 1, Define if you have SYSV-style /dev/ptmx and /dev/pts/.) AC_MSG_RESULT(streams ptys)elseif test -c /dev/pts && test -c /dev/ptcthen AC_DEFINE(HAVE_DEV_PTS_AND_PTC, 1, Define if you have /dev/pts and /dev/ptc devices (as in AIX).) AC_MSG_RESULT(/dev/pts and /dev/ptc)else AC_MSG_RESULT(bsd-style ptys)fifi])dnldnl Use -lresolv only if we need itdnlAC_DEFUN(SFS_FIND_RESOLV,[AC_CHECK_FUNC(res_mkquery)if test "$ac_cv_func_res_mkquery" != yes; then AC_CHECK_LIB(resolv, res_mkquery) if test "$ac_cv_lib_resolv_res_mkquery" = no; then AC_CHECK_LIB(resolv, __res_mkquery) fifidnl See if the resolv functions are actually declaredSFS_CHECK_DECL(res_init, resolv.h, sys/types.h sys/socket.h netinet/in.h arpa/nameser.h)SFS_CHECK_DECL(res_mkquery, resolv.h, sys/types.h sys/socket.h netinet/in.h arpa/nameser.h)SFS_CHECK_DECL(dn_skipname, resolv.h, sys/types.h sys/socket.h netinet/in.h arpa/nameser.h)SFS_CHECK_DECL(dn_expand, resolv.h, sys/types.h sys/socket.h netinet/in.h arpa/nameser.h)])dnldnl Check if first element in grouplist is egiddnlAC_DEFUN(SFS_CHECK_EGID_IN_GROUPLIST,[AC_TYPE_GETGROUPSAC_CACHE_CHECK(if egid is first element of grouplist, sfs_cv_egid_in_grouplist,AC_TRY_RUN([changequote changequote([[,]])#include <sys/types.h>#include <unistd.h>#include <netinet/in.h>#include <rpc/rpc.h>#include "confdefs.h"static intgetint (void *_p){ unsigned char *p = _p; return p[0]<<24 | p[1]<<16 | p[2]<<8 | p[3];}intmain (int argc, char **argv){ AUTH *a; GETGROUPS_T gids[24]; int n, xn; char buf[408]; char *p; XDR x; /* Must hard-code OSes with egid in grouplist *and* broken RPC lib */#if __FreeBSD__ return 0;#endif n = getgroups (24, gids); if (n <= 0) return 1; a = authunix_create_default (); xdrmem_create (&x, buf, sizeof (buf), XDR_ENCODE); if (!auth_marshall (a, &x)) return 1; if (getint (buf) != AUTH_UNIX) return 1; p = buf + 12; /* Skip auth flavor, length, timestamp */ p += getint (p) + 7 & ~3; /* Skip machine name */ p += 8; /* Skip uid & gid */ xn = getint (p); /* Length of grouplist in auth_unix */ return n != xn + 1;}changequote([,])], sfs_cv_egid_in_grouplist=yes, sfs_cv_egid_in_grouplist=no))if test $sfs_cv_egid_in_grouplist = yes; then AC_DEFINE(HAVE_EGID_IN_GROUPLIST, 1, Define if the first element of a grouplist is the effective gid)fi])dnldnl Check for struct passwd fieldsdnlAC_DEFUN(SFS_PASSWD_FIELD,[AC_CACHE_CHECK(for $1 in struct passwd, sfs_cv_passwd_$1,AC_TRY_COMPILE([#include <sys/types.h>#include <pwd.h>], [ struct passwd *pw; pw->$1;], sfs_cv_passwd_$1=yes, sfs_cv_passwd_$1=no))if test "$sfs_cv_passwd_$1" = yes; then AC_DEFINE(HAVE_PASSWD_[]translit($1, [a-z ], [A-Z_]), 1, Define if struct passwd has $1 field)fi])dnldnl Check if putenv copies argumentsdnlAC_DEFUN(SFS_PUTENV_COPY,[AC_CACHE_CHECK(if putenv() copies its argument, sfs_cv_putenv_copy,AC_TRY_RUN([changequote`'changequote([[,]])#include <stdlib.h>char var[] = "V=0";intmain (int argc, char **argv){ char *v; putenv (var); var[2] = '1'; v = getenv (var); return *v != '0';}changequote([,])], sfs_cv_putenv_copy=yes, sfs_cv_putenv_copy=no, sfs_cv_putenv_copy=no))if test $sfs_cv_putenv_copy = yes; then AC_DEFINE(PUTENV_COPIES_ARGUMENT, 1, Define if putenv makes a copy of its argument)fi])dnldnl Check for wide selectdnlAC_DEFUN(SFS_CHECK_WIDE_SELECT,[AC_CACHE_CHECK(for wide select, sfs_cv_wideselect,fdlim_h=${srcdir}/fdlim.htest -f ${srcdir}/async/fdlim.h && fdlim_h=${srcdir}/async/fdlim.htest -f ${srcdir}/libasync/fdlim.h && fdlim_h=${srcdir}/libasync/fdlim.hAC_TRY_RUN([changequote changequote([[,]])#include <stdio.h>#include <fcntl.h>#include <stdlib.h>#include "${fdlim_h}"struct timeval ztv;intmain (){ int pfd[2]; int rfd, wfd; int maxfd; int i; fd_set *rfdsp, *wfdsp; maxfd = fdlim_get (1); fdlim_set (maxfd, 1); maxfd = fdlim_get (0); if (maxfd <= FD_SETSIZE) { printf ("[small fd limit anyway] "); exit (1); } if (pipe (pfd) < 0) exit (1);#ifdef F_DUPFD if ((rfd = fcntl (pfd[0], F_DUPFD, maxfd - 2)) < 0) exit (1); if ((wfd = fcntl (pfd[1], F_DUPFD, maxfd - 1)) < 0) exit (1);#else /* !F_DUPFD */ if ((rfd = dup2 (pfd[0], maxfd - 2)) < 0) exit (1); if ((wfd = dup2 (pfd[1], maxfd - 1)) < 0) exit (1);#endif /* !F_DUPFD */ rfdsp = malloc (1 + (maxfd/8)); for (i = 0; i < 1 + (maxfd/8); i++) ((char *) rfdsp)[i] = '\0'; wfdsp = malloc (1 + (maxfd/8)); for (i = 0; i < 1 + (maxfd/8); i++) ((char *) wfdsp)[i] = '\0'; FD_SET (rfd, rfdsp); FD_SET (wfd, wfdsp); if (select (maxfd, rfdsp, wfdsp, NULL, &ztv) < 0) exit (1); if (FD_ISSET (wfd, wfdsp) && !FD_ISSET (rfd, rfdsp)) exit (0); else exit (1);}changequote([,])],sfs_cv_wideselect=yes, sfs_cv_wideselect=no, sfs_cv_wideselect=no))if test $sfs_cv_wideselect = yes; then AC_DEFINE(HAVE_WIDE_SELECT, 1, Define if select can take file descriptors >= FD_SETSIZE)fi])dnldnl Check for 64-bit off_tdnlAC_DEFUN(SFS_CHECK_OFF_T_64,[AC_CACHE_CHECK(for 64-bit off_t, sfs_cv_off_t_64,AC_TRY_COMPILE([#include <unistd.h>#include <sys/types.h>],[switch (0) case 0: case (sizeof (off_t) <= 4):;], sfs_cv_off_t_64=no, sfs_cv_off_t_64=yes))if test $sfs_cv_off_t_64 = yes; then AC_DEFINE(HAVE_OFF_T_64, 1, Define if off_t is 64 bits wide.)fi])dnldnl Check for typednldnl [AC_CACHE_CHECK(for $1, sfs_cv_type_$1,dnl ], sfs_cv_type_$1=yes, sfs_cv_type_$1=no))dnl ], sfs_cv_type_[]translit($1, [ ], [_])=yes, sfs_cv_type_[]translit($1, [ ], [_])=no))AC_DEFUN(SFS_CHECK_TYPE,[AC_CACHE_CHECK(for $1, sfs_cv_type_[]translit($1, [ ], [_]),AC_TRY_COMPILE([#include <stddef.h>#include <stdlib.h>#include <sys/types.h>#include <sys/socket.h>#ifdef HAVE_RPC_RPC_H#include <rpc/rpc.h>#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -