📄 aclocal.m4
字号:
dnl aclocal.m4 generated automatically by aclocal 1.4-p4dnl Copyright (C) 1994, 1995-8, 1999 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.3 2001/04/16 04:07:48 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 Check for declarationsdnlAC_DEFUN(SFS_CHECK_DECL,[AC_CACHE_CHECK(for a declaration of $1, sfs_cv_$1_decl, for hdr in [patsubst(builtin(shift, $@), [,], [ ])]; do if test -z "${sfs_cv_$1_decl}"; then AC_HEADER_EGREP($1, $hdr, 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.) AC_CHECK_HEADERS(util.h libutil.h))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)fidnl See if the resolv functions are actually declaredSFS_CHECK_DECL(res_init, resolv.h)SFS_CHECK_DECL(res_mkquery, resolv.h)SFS_CHECK_DECL(dn_skipname, resolv.h)SFS_CHECK_DECL(dn_expand, resolv.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 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); 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 typednlAC_DEFUN(SFS_CHECK_TYPE,[AC_CACHE_CHECK(for $1, sfs_cv_type_$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],[sizeof($1);], sfs_cv_type_$1=yes, sfs_cv_type_$1=no))if test $sfs_cv_type_$1 = yes; then AC_DEFINE(HAVE_[]translit($1, [a-z], [A-Z]), 1, Define if system headers declare a $1 type.)fi])dnldnl Check for struct cmsghdr (for passing file descriptors)dnlAC_DEFUN(SFS_CHECK_FDPASS,[AC_CACHE_CHECK(for fd passing with msg_accrights in msghdr, sfs_cv_accrights,AC_TRY_COMPILE([#include <sys/types.h>#include <sys/socket.h>],[struct msghdr mh;mh.msg_accrights = 0;], sfs_cv_accrights=yes, sfs_cv_accrights=no))AC_CACHE_CHECK(for fd passing with struct cmsghdr, sfs_cv_cmsghdr,if test "$sfs_cv_accrights" != "yes"; thenAC_TRY_COMPILE([#include <sys/types.h>#include <sys/socket.h>],[struct msghdr mh;struct cmsghdr cmh;mh.msg_control = (void *) &cmh;], sfs_cv_cmsghdr=yes, sfs_cv_cmsghdr=no)else sfs_cv_cmsghdr=nofi)if test $sfs_cv_accrights = yes; then AC_DEFINE(HAVE_ACCRIGHTS, 1, Define if msghdr has msg_accrights field for passing file descriptors.)fiif test $sfs_cv_cmsghdr = yes; then AC_DEFINE(HAVE_CMSGHDR, 1, Define if system has cmsghdr structure for passing file descriptors.)fi])dnldnl Check for sa_len in struct sockaddrsdnlAC_DEFUN(SFS_CHECK_SA_LEN,[AC_CACHE_CHECK(for sa_len in struct sockaddr, sfs_cv_sa_len,AC_TRY_COMPILE([#include <sys/types.h>#include <sys/socket.h>],[struct sockaddr sa;sa.sa_len = 0;], sfs_cv_sa_len=yes, sfs_cv_sa_len=no))if test $sfs_cv_sa_len = yes; then AC_DEFINE(HAVE_SA_LEN, 1, Define if struct sockaddr has sa_len field.)fi])dnldnl Check something about the nfs_args fielddnlAC_DEFUN(SFS_TRY_NFSARG_FIELD,[AC_TRY_COMPILE([#include "${srcdir}/nfsconf.h"],[struct nfs_args na;$1;], $2, $3)])dnldnl Check a particular field in nfs_argsdnlAC_DEFUN(SFS_CHECK_NFSMNT_FIELD,[AC_CACHE_CHECK(for $1 in nfs_args structure, sfs_cv_nfsmnt_$1,SFS_TRY_NFSARG_FIELD(na.$1, sfs_cv_nfsmnt_$1=yes, sfs_cv_nfsmnt_$1=no))if test $sfs_cv_nfsmnt_$1 = yes; then AC_DEFINE(HAVE_NFSMNT_[]translit($1, [a-z], [A-Z]), 1, Define if the nfs_args structure has a $1 field.)fi])dnldnl Check if nfs_args hostname field is an arraydnlAC_DEFUN(SFS_CHECK_NFSARG_HOSTNAME_ARRAY,[AC_CACHE_CHECK(if nfs_args hostname field is an array, sfs_cv_nfs_hostarray, SFS_TRY_NFSARG_FIELD(na.hostname = 0, sfs_cv_nfs_hostarray=no, sfs_cv_nfs_hostarray=yes))if test $sfs_cv_nfs_hostarray = yes; then AC_DEFINE(HAVE_NFSARG_HOSTNAME_ARRAY)fi])dnldnl Check if addr field is a pointer or notdnlAC_DEFUN(SFS_CHECK_NFSARG_ADDR_PTR,[AC_CHECK_HEADERS(tiuser.h)AC_CACHE_CHECK(if nfs_args addr field is a pointer, sfs_cv_nfsmnt_addr_ptr, SFS_TRY_NFSARG_FIELD(na.addr = (void *) 0, sfs_cv_nfsmnt_addr_ptr=yes, sfs_cv_nfsmnt_addr_ptr=no))if test $sfs_cv_nfsmnt_addr_ptr = yes; then AC_DEFINE(HAVE_NFSARG_ADDR_PTR) AC_CACHE_CHECK(if nfs_args addr is a netbuf *, sfs_cv_nfsmnt_addr_netbuf, SFS_TRY_NFSARG_FIELD(struct netbuf nb; *na.addr = nb, sfs_cv_nfsmnt_addr_netbuf=yes, sfs_cv_nfsmnt_addr_netbuf=no)) if test $sfs_cv_nfsmnt_addr_netbuf = yes; then AC_DEFINE(HAVE_NFSARG_ADDR_NETBUF) fi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -