📄 aclocal.m4
字号:
/* These are needed if libwrap.a was compiled with
* PROCESS_OPTIONS defined.
*/
int allow_severity = 1; /* arbitrary for this test */
int deny_severity = 2; /* arbitrary for this test */
],[
/* function-body */
exit((allow_severity == deny_severity) ? 1 : 0);
],[
dnl ...Don't bother defining this symbol...
dnl ...Check for tcpd.h instead...
dnl AC_DEFINE(HAVE_LIBWRAP)
dnl
dnl ...Don't modify LIBS, instead set WRAPLIB...
dnl LIBS="-lwrap $LIBS"
dnl
WRAPLIB="-lwrap"
wi_cv_lib_wrap_hosts_access=yes
],[
WRAPLIB=""
wi_cv_lib_wrap_hosts_access=no
])
AC_MSG_RESULT($wi_cv_lib_wrap_hosts_access)
])
dnl
dnl
dnl
AC_DEFUN(wi_NET_LIBS, [
# Mostly for SunOS 4 -- needs to come first because other libs depend on it
wi_LIB_44BSD
wi_LIB_SOCKET
if test "$SYS" = unixware ; then
# So far, only UnixWare needs this.
AC_CHECK_LIB(gen,syslog)
case "$OS" in
unixware2*)
if test -f /usr/ucblib/libucb.a ; then
LDFLAGS="$LDFLAGS -L/usr/ucblib"
LIBS="$LIBS -lucb"
fi
if test -f /usr/include/unistd.h ; then
ac_cv_header_unistd_h=yes
fi
# UnixWare 2 needs both lsocket and lnsl, and configure
# script won't detect this condition properly because
# the libraries are interdependent.
#
LIBS="$LIBS -lsocket -lnsl"
# Now look for socket()
#
# AC_CHECK_FUNC(socket,[a=yes],[a=no])
#
AC_CHECK_FUNC(socket,[a=yes],[a=no])
;;
*)
;;
esac
fi
dnl AC_CHECK_LIB(inet,main)
wi_LIB_NSL
wi_LIB_RESOLV
if test "$SYS" = dynixptx ; then
LIBS="$LIBS -lsocket -lnsl"
fi
])
dnl
dnl
dnl
dnl
AC_DEFUN(wi_DEFINE_UNAME, [
# Get first 127 chars of all uname information. Some folks have
# way too much stuff there, so grab only the first 127.
unam=`uname -a 2>/dev/null | cut -c1-127`
if test "$unam" != "" ; then
AC_DEFINE_UNQUOTED(UNAME, "$unam")
fi
])
dnl
dnl
dnl
AC_DEFUN(wi_FUNC_SIGSETJMP, [
AC_MSG_CHECKING([for sigsetjmp and siglongjmp])
AC_TRY_LINK([
/* includes */
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/types.h>
#include <stdio.h>
#include <signal.h>
#include <setjmp.h>
],[
/* function-body */
sigjmp_buf sjb;
if (sigsetjmp(sjb, 1) != 0)
siglongjmp(sjb, 1); /* bogus code, of course. */
exit(0);
],[
AC_DEFINE(HAVE_SIGSETJMP)
wi_cv_func_sigsetjmp=yes
],[
wi_cv_func_sigsetjmp=no
])
AC_MSG_RESULT($wi_cv_func_sigsetjmp)
])
dnl
dnl
dnl
AC_DEFUN(wi_UTMP_UT_NAME, [
AC_MSG_CHECKING([for ut_name field in struct utmp])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <utmp.h>
],[
struct utmp u;
u.ut_name[0] = '\0';
exit(((int) &u.ut_name) & 0xff); /* bogus code, of course. */
],[
wi_cv_utmp_ut_name=yes
AC_DEFINE(HAVE_UTMP_UT_NAME)
],[
wi_cv_utmp_ut_name=no
])
AC_MSG_RESULT($wi_cv_utmp_ut_name)
])
dnl
dnl
dnl
AC_DEFUN(wi_UTMPX_UT_SYSLEN, [
AC_MSG_CHECKING([for ut_syslen field in struct utmpx])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <utmpx.h>
],[
struct utmpx u;
u.ut_syslen = 0;
exit(((int) &u.ut_syslen) & 0xff); /* bogus code, of course. */
],[
wi_cv_utmpx_ut_syslen=yes
AC_DEFINE(HAVE_UTMPX_UT_SYSLEN)
],[
wi_cv_utmpx_ut_syslen=no
])
AC_MSG_RESULT($wi_cv_utmpx_ut_syslen)
])
dnl
dnl
dnl
AC_DEFUN(wi_UTMP_UT_USER, [
AC_MSG_CHECKING([for ut_user field in struct utmp])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <utmp.h>
],[
struct utmp u;
u.ut_user[0] = '\0';
exit(((int) &u.ut_user) & 0xff); /* bogus code, of course. */
],[
wi_cv_utmp_ut_user=yes
AC_DEFINE(HAVE_UTMP_UT_USER)
],[
wi_cv_utmp_ut_user=no
])
AC_MSG_RESULT($wi_cv_utmp_ut_user)
])
dnl
dnl
dnl
AC_DEFUN(wi_UTMP_UT_PID, [
AC_MSG_CHECKING([for ut_pid field in struct utmp])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <utmp.h>
],[
struct utmp u;
u.ut_pid = 1;
exit(((int) &u.ut_pid) & 0xff); /* bogus code, of course. */
],[
wi_cv_utmp_ut_pid=yes
AC_DEFINE(HAVE_UTMP_UT_PID)
],[
wi_cv_utmp_ut_pid=no
])
AC_MSG_RESULT($wi_cv_utmp_ut_pid)
])
dnl
dnl
dnl
AC_DEFUN(wi_UTMP_UT_TIME, [
AC_MSG_CHECKING([for ut_time field in struct utmp])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <utmp.h>
],[
struct utmp u;
u.ut_time = 1;
exit(((int) &u.ut_time) & 0xff); /* bogus code, of course. */
],[
wi_cv_utmp_ut_time=yes
AC_DEFINE(HAVE_UTMP_UT_TIME)
],[
wi_cv_utmp_ut_time=no
])
AC_MSG_RESULT($wi_cv_utmp_ut_time)
])
dnl
dnl
dnl
AC_DEFUN(wi_UTMP_UT_HOST, [
AC_MSG_CHECKING([for ut_host field in struct utmp])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <utmp.h>
],[
struct utmp u;
u.ut_host[0] = '\0';
exit(((int) &u.ut_host) & 0xff); /* bogus code, of course. */
],[
wi_cv_utmp_ut_host=yes
AC_DEFINE(HAVE_UTMP_UT_HOST)
],[
wi_cv_utmp_ut_host=no
])
AC_MSG_RESULT($wi_cv_utmp_ut_host)
])
dnl
dnl
dnl
AC_DEFUN(wi_STRUCT_STAT64, [
AC_MSG_CHECKING([for struct stat64])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
],[
struct stat64 st;
st.st_size = 0;
exit(((int) &st.st_size) & 0xff); /* bogus code, of course. */
],[
wi_cv_struct_stat64=yes
AC_DEFINE(HAVE_STRUCT_STAT64)
],[
wi_cv_struct_stat64=no
])
AC_MSG_RESULT($wi_cv_struct_stat64)
])
dnl
dnl
dnl
AC_DEFUN(wi_STRUCT_CMSGHDR, [
AC_MSG_CHECKING([for struct cmsghdr])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <sys/un.h>
],[
struct cmsghdr cm;
cm.cmsg_len = 0;
cm.cmsg_level = 0;
cm.cmsg_type = 0;
exit(((int) &cm.cmsg_type) & 0xff); /* bogus code, of course. */
],[
wi_cv_struct_cmsghdr=yes
AC_DEFINE(HAVE_STRUCT_CMSGDHR)
],[
wi_cv_struct_cmsghdr=no
])
AC_MSG_RESULT($wi_cv_struct_cmsghdr)
])
dnl
dnl
dnl
AC_DEFUN(wi_MSGHDR_CONTROL, [
AC_MSG_CHECKING([for msg_control field in struct msghdr])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <sys/un.h>
],[
struct msghdr m;
m.msg_control = &m;
m.msg_controllen = sizeof(m);
exit(((int) &m.msg_control) & 0xff); /* bogus code, of course. */
],[
wi_cv_msghdr_control=yes
AC_DEFINE(HAVE_MSGHDR_CONTROL)
],[
wi_cv_msghdr_control=no
])
AC_MSG_RESULT($wi_cv_msghdr_control)
])
dnl
dnl
dnl
AC_DEFUN(wi_MSGHDR_ACCRIGHTS, [
AC_MSG_CHECKING([for msg_accrights field in struct msghdr])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <sys/un.h>
],[
struct msghdr m;
m.msg_accrights = &m;
m.msg_accrightslen = sizeof(m);
exit(((int) &m.msg_accrights) & 0xff); /* bogus code, of course. */
],[
wi_cv_msghdr_accrights=yes
AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS)
],[
wi_cv_msghdr_accrights=no
])
AC_MSG_RESULT($wi_cv_msghdr_accrights)
])
dnl
dnl
dnl
AC_DEFUN(wi_PR_PASSWD_FG_OLDCRYPT, [
AC_MSG_CHECKING([for fg_oldcrypt field in struct pr_passwd])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <pwd.h>
#include <grp.h>
#include <errno.h>
#if defined(HAVE_USERPW_H) && defined(HAVE_GETUSERPW) /* AIX */
# include <userpw.h>
#elif defined(HAVE_PWDADJ_H) && defined(HAVE_GETPWANAM) /* SunOS */
# include <sys/label.h>
# ifdef HAVE_SYS_AUDIT_H
# include <sys/audit.h>
# endif
# include <pwdadj.h>
#elif defined(HAVE_GETESPWNAM) /* Digital UNIX 4 */
# ifdef HAVE_SYS_SECDEFINES_H
# include <sys/secdefines.h>
# endif
# ifdef HAVE_SYS_SECURITY_H
# include <sys/security.h>
# endif
# ifdef HAVE_SYS_AUDIT_H
# include <sys/audit.h>
# endif
# ifdef HAVE_KRB_H
# include <krb.h>
# endif
# ifdef HAVE_PROT_H
# include <prot.h>
# endif
#elif defined(HAVE_GETPRPWNAM) /* SCO Open Server V, Digital UNIX 3, HP-UX 10 */
# ifdef HAVE_SYS_SECDEFINES_H
# include <sys/secdefines.h>
# endif
# ifdef HAVE_SYS_SECURITY_H
# include <sys/security.h>
# endif
# ifdef HAVE_SYS_AUDIT_H
# include <sys/audit.h>
# endif
# ifdef HAVE_HPSECURITY_H
# include <hpsecurity.h>
# endif
# ifdef HAVE_KRB_H
# include <krb.h>
# endif
# ifdef HAVE_PROT_H
# include <prot.h>
# endif
#endif
],[
struct pr_passwd xu;
memset(&xu, 0, sizeof(xu));
if (xu.uflg.fg_oldcrypt != 0)
xu.uflg.fg_oldcrypt++; /* bogus code, of course */
exit(0);
],[
wi_cv_pr_passwd_fg_oldcrypt=yes
AC_DEFINE(HAVE_PR_PASSWD_FG_OLDCRYPT)
],[
wi_cv_pr_passwd_fg_oldcrypt=no
])
AC_MSG_RESULT($wi_cv_pr_passwd_fg_oldcrypt)
])
dnl
dnl
dnl
AC_DEFUN(wi_SOCKADDR_UN_SUN_LEN, [
AC_MSG_CHECKING([for sun_len field in struct sockaddr_un])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <sys/un.h>
],[
struct sockaddr_un uaddr;
uaddr.sun_len = strlen("/tmp/test.sock");
exit(((int) uaddr.sun_len); /* bogus code, of course. */
],[
wi_cv_sockaddr_un_sun_len=yes
AC_DEFINE(HAVE_SOCKADDR_UN_SUN_LEN)
],[
wi_cv_sockaddr_un_sun_len=no
])
AC_MSG_RESULT($wi_cv_sockaddr_un_sun_len)
])
dnl
dnl
dnl
AC_DEFUN(wi_STATFS_F_BAVAIL, [
AC_MSG_CHECKING([for f_bavail field in struct statfs])
AC_TRY_LINK([
/* includes */
#include <unistd.h>
#include <sys/types.h>
#ifdef HAVE_SYS_STATFS_H
# include <sys/statfs.h>
#elif defined(HAVE_SYS_VFS_H)
# include <sys/vfs.h>
#endif
],[
struct statfs st;
st.f_bavail = 1;
exit((int) st.f_bavail); /* bogus code, of course. */
],[
wi_cv_statfs_f_bavail=yes
AC_DEFINE(HAVE_STATFS_F_BAVAIL)
],[
wi_cv_statfs_f_bavail=no
])
AC_MSG_RESULT($wi_cv_statfs_f_bavail)
])
dnl
dnl
dnl
AC_DEFUN(wi_SPRINTF_RETVAL, [
AC_MSG_CHECKING([what sprintf() returns])
AC_TRY_RUN([
/* program */
#include <stdio.h>
#include <string.h>
main()
{
int result;
char s[8];
result = (int) sprintf(s, "%d", 22);
if (result == 2)
exit(0);
exit(1);
}
],[
# action if true
wi_cv_sprintf_returns_ptr=no
x="length of data written";
],[
# action if false
wi_cv_sprintf_returns_ptr=yes
AC_DEFINE(SPRINTF_RETURNS_PTR)
x="pointer to data";
],[
# action if cross compiling
wi_cv_sprintf_returns_ptr=no
x="unknown";
])
AC_MSG_RESULT($x)
])
dnl
dnl
dnl
AC_DEFUN(wi_LIB_CRYPT, [
AC_MSG_CHECKING([which library has usable crypt() function])
ac_save_LIBS="$LIBS"
crypt_lib=NONE
for lib in "c" "crypt" "descrypt" "des"
do
if test "$lib" = "c" ; then
LIBS="$ac_save_LIBS"
else
LIBS="$ac_save_LIBS -l${lib}"
fi
AC_TRY_RUN([
/* program */
#include <stdio.h>
#include <string.h>
extern char *crypt(const char *key, const char *salt);
main()
{
char cleartext[256];
char *cp;
memset(cleartext, 0, sizeof(cleartext));
strcpy(cleartext, "password");
cp = crypt(cleartext, "xx");
if ((cp != NULL) && (strcmp(cp, "xxj31ZMTZzkVA") == 0)) {
/* printf("PASS\n"); */
exit(0);
}
/* printf("FAIL\n"); */
exit(1);
}
],[
# action if true
crypt_lib="$lib"
],[
# action if false
:
],[
# action if cross compiling
:
])
if test "$crypt_lib" != NONE ; then
break
fi
done
LIBS="$ac_save_LIBS"
if test "$crypt_lib" = NONE ; then
crypt_lib=c
AC_MSG_RESULT([none?])
else
AC_MSG_RESULT([lib${crypt_lib}])
fi
if test "$crypt_lib" != c ; then
AC_CHECK_LIB(${lib},crypt)
fi
])
dnl
dnl
dnl
AC_DEFUN(wi_TEST, [
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -