📄 configure.in
字号:
dnl use autoconf 2.12 or higher (2.14 preferred) to generate the configure scriptdnl ============================================================================dnl First of all, definitions of our headers and lookups of generic programs...dnl ============================================================================AC_INIT(src/ftpd.c)divert(0)dnl## Copyright (c) 1999,2000,2001 WU-FTPD Development Group. # All rights reserved.# # Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994 # The Regents of the University of California. # Portions Copyright (c) 1993, 1994 Washington University in Saint Louis. # Portions Copyright (c) 1996, 1998 Berkeley Software Design, Inc. # Portions Copyright (c) 1989 Massachusetts Institute of Technology. # Portions Copyright (c) 1998 Sendmail, Inc. # Portions Copyright (c) 1983, 1995, 1996, 1997 Eric P. Allman. # Portions Copyright (c) 1997 by Stan Barber. # Portions Copyright (c) 1997 by Kent Landfield. # Portions Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997 # Free Software Foundation, Inc. # # Use and distribution of this software and its source code are governed # by the terms and conditions of the WU-FTPD Software License ("LICENSE"). # # If you did not receive a copy of the license, it may be obtained online # at http://www.wu-ftpd.org/license.html. ## $Id: configure.in,v 1.50.2.1 2001/11/29 17:10:58 wuftpd Exp $#undivert(0)AC_CONFIG_HEADER(config.h src/config.h)AC_PREFIX_DEFAULT(/usr)AC_CANONICAL_SYSTEMAC_PROG_CCAC_ISC_POSIXAC_PROG_RANLIBAC_PROG_YACCAC_PROG_INSTALLAC_CHECK_PROGS(AR, ar gar, NO)if test $AR = NO; then AC_MSG_ERROR(Can\'t find ar or gar.)fiAC_SUBST(AR)AC_HEADER_STDCAC_HEADER_TIMEdnl Quick hack: Let the source know we don't want stuff likednl #ifdef LINUX...AC_DEFINE(AUTOCONF)dnl see if we support links...AC_MSG_CHECKING(if we can do hard links)ln configure src/link.tst 2>&5if test -x src/link.tst; then CPLN="ln" rm -f src/link.tst AC_MSG_RESULT(yes - using ln)else CPLN="cp" AC_MSG_RESULT(no - using cp)fiAC_SUBST(CPLN)dnl ===========================================================================dnl Accepted arguments to ./configure...dnl ============================================================================AC_ARG_WITH(etc-dir, [ --with-etc-dir=PATH read-only single-machine data in DIR [/etc]], ETCDIR=$with_etc_dir, ETCDIR=/etc)AC_SUBST(ETCDIR)AC_ARG_WITH(pid-dir, [ --with-pid-dir=PATH run/pid files [/var/run]], PIDDIR=$with_pid_dir, PIDDIR=/var/run)AC_SUBST(PIDDIR)AC_ARG_WITH(log-dir, [ --with-log-dir=PATH log files [/var/log]], LOGDIR=$with_log_dir, LOGDIR=/var/log)AC_SUBST(LOGDIR)AC_ARG_ENABLE(upload, [ --disable-upload disable the UPLOAD keyword in ftpaccess], [ upload=$enableval ], [ upload=yes ])AC_ARG_ENABLE(overwrite, [ --disable-overwrite disable the OVERWRITE keyword in ftpaccess], [ overwrite=$enableval ], [ overwrite=yes ])AC_ARG_ENABLE(hostxs, [ --disable-hostxs don't allow ALLOW/DENY keywords in ftpaccess], [ hostxs=$enableval ], [ hostxs=yes ])AC_ARG_ENABLE(logfailed, [ --disable-logfailed don't log failed login attempts], [ logfailed=$enableval ], [ logfailed=yes ])AC_ARG_ENABLE(logtoomany, [ --disable-logtoomany don't log login attempts that failed because of limits], [ logtoomany=$enableval ], [ logtoomany=yes ])AC_ARG_ENABLE(private, [ --disable-private don't support private files (SITE GROUP/SITE GPASS)], [ private=$enableval ], [ private=yes ])AC_ARG_ENABLE(dnsretry, [ --disable-dnsretry don't retry failed DNS lookups], [ dnsretry=$enableval ], [ dnsretry=yes ])AC_ARG_ENABLE(anononly, [ --enable-anononly allow only anonymous ftp connections], [ anononly=$enableval ], [ anononly=no ])AC_ARG_ENABLE(paranoid, [ --enable-paranoid disable some "questionable" features], [ paranoid=$enableval ], [ paranoid=no ])AC_ARG_ENABLE(quota, [ --enable-quota add QUOTA support (if your OS supports it)], [ quota=$enableval ], [ quota=no ])AC_ARG_ENABLE(pam, [ --enable-pam add PAM support (needs PAM library)], [ pam=$enableval ], [ pam=no ])AC_ARG_ENABLE(skey, [ --enable-skey add S/KEY support (needs SKEY libraries)], [ skey=$enableval ], [ skey=no ])AC_ARG_ENABLE(opie, [ --enable-opie add OPIE support (needs OPIE libraries)], [ opie=$enableval ], [ opie=no ])if test $skey = "yes" -o $skey = "y"then if test $opie = "yes" -o $skey = "y" then AC_MSG_ERROR([*** YOU SHOULD NOT HAVE BOTH SKEY AND OPIE DEFINED!!!!!]) fifiAC_ARG_ENABLE(new-cd, [ --disable-new-cd new-cd causes \"cd ~\" to return to chroot-relative dir], [ newcd=$enableval ], [ newcd=yes ])AC_ARG_ENABLE(chmod, [ --enable-chmod allow ftp users to set SETUID/SETGID/STICKY bits], [ chmod=$enableval ], [ chmod=no ])AC_ARG_ENABLE(rfc931, [ --enable-rfc931 do RFC931 lookups (more log information, but slower)], [ rfc931=$enableval ], [ rfc931=no ])AC_ARG_ENABLE(ratios, [ --enable-ratios compile in support for upload-download ratios ], [ ratio=$enableval ], [ ratio=no ])AC_ARG_ENABLE(passwd, [ --enable-passwd support alternative passwd/shadow files ], [ passwd=$enableval ], [ passwd=no ])AC_ARG_ENABLE(daemon, [ --disable-daemon don't allow running as standalone daemon], [ daemon=$enableval ], [ daemon=yes ])AC_ARG_ENABLE(map-chdir, [ --disable-map-chdir don't keep track of user's path changes], [ mapchdir=$enableval ], [ mapchdir=yes ])AC_ARG_ENABLE(throughput,[ --disable-throughput don't keep track of user's throughput], [ throughput=$enableval ], [ throughput=yes ])AC_ARG_ENABLE(count, [ --disable-count don't keep track of bytes for statistics], [ count=$enableval ], [ count=yes ])AC_ARG_ENABLE(newlines, [ --disable-newlines suppress some extra blank lines], [ newlines=$enableval ], [ newlines=yes ])AC_ARG_ENABLE(crackers, [ --enable-crackers don't wait for password if the username doesn't exist], [ crackers=$enableval ], [ crackers=no ])AC_ARG_ENABLE(verbose, [ --disable-verbose disable verbose error logging], [ verbose=$enableval ], [ verbose=yes ])AC_ARG_ENABLE(noop, [ --enable-noop NOOP command resets idle timeout], [ noop=$enableval ], [ noop=no ])AC_ARG_ENABLE(log-rp, [ --disable-log-rp log the relative path rather than the real one], [ logrp=$enableval ], [ logrp=yes ])AC_ARG_ENABLE(virtual, [ --disable-virtual don't support virtual servers], [ virtual=$enableval ], [ virtual=yes ])AC_ARG_ENABLE(closedvirt,[ --disable-closedvirt allow guests to log in to a virtual server], [ closedvirt=$enableval ], [ closedvirt=yes ])AC_ARG_ENABLE(dns, [ --disable-dns skip all DNS lookups], [ dns=$enableval ], [ dns=yes ])AC_ARG_ENABLE(port, [ --disable-port don't allow port mode], [ port=$enableval ], [ port=yes ])AC_ARG_ENABLE(pasv, [ --disable-pasv don't allow passive mode], [ pasv=$enableval ], [ pasv=yes ])AC_ARG_ENABLE(plsm, [ --disable-plsm disable PID lock sleep messages (for busy sites)], [ plsm=$enableval ], [ plsm=yes ])AC_ARG_ENABLE(pasvip, [ --disable-pasvip don't require require same IP for passive connections], [ pasvip=$enableval ], [ pasvip=yes ])AC_ARG_ENABLE(anonymous, [ --disable-anonymous don't allow anonymous ftp access], [ anonymous=$enableval ], [ anonymous=yes ])AC_ARG_ENABLE(ls, [ --enable-ls use the internal ls (EXPERIMENTAL)], [ ls=$enableval ], [ ls=no ])AC_ARG_ENABLE(numericuid,[ --disable-numericuid internal ls displays UID instead of username (faster)], [ numericuid=$enableval ], [ numericuid=yes ])AC_ARG_ENABLE(hidesetuid,[ --disable-hidesetuid show setuid/setgid bits in internal ls], [ hidesetuid=$enableval ], [ hidesetuid=yes ])AC_ARG_ENABLE(mail, [ --disable-mail don't allow mail on upload], [ mail=$enableval ], [ mail=yes ])AC_ARG_ENABLE(badclients,[ --enable-badclients support broken clients (see CHANGES)], [ badclients=$enableval ], [ badclients=no ])AC_ARG_WITH(bufsize, [ --with-bufsize=x set buffer size to x], [ bufsize=$withval ], [ bufsize=no ])AC_ARG_WITH(backlog, [ --with-backlog=x number of incoming processes to backlog in daemon mode], [ backlog=$withval ], [ backlog=100 ])AC_ARG_ENABLE(nlst-dirs, [ --enable-nlst-dirs allow NLST to show directories, can break mget], [ nlstdirs=$enableval ], [ nlstdirs=no ])LIBS=""dnl ===========================================================================dnl Checks for some system calls/headers...dnl ============================================================================AC_CHECK_HEADERS(dirent.h regex.h shadow.h security/pam_appl.h opie.h skey.h \ syslog.h sys/syslog.h fcntl.h mntent.h stdlib.h unistd.h glob.h grp.h \ ndir.h sys/dir.h sys/ndir.h string.h vmsdir.h sys/systeminfo.h \ bsd/bsd.h sys/param.h values.h limits.h sys/types.h sys/mntent.h \ sys/mnttab.h paths.h)AC_CHECK_FUNCS(dirfd fchdir flock ftw getcwd getdtablesize pstat lstat \ vprintf snprintf regexec regex fgetspent usercmp getusershell setuid vsnprintf \ snprintf strcasestr strdup strerror strsep strstr syslog glob strcasecmp \ strncasecmp sigprocmask quotactl getrlimit sysconf setsid memmove \ strtoul)AC_CHECK_FUNCS(seteuid setreuid setresuid, break)AC_CHECK_FUNCS(setegid setregid setresgid, break)AC_CHECK_LIB(crypt, crypt, result=yes, result=no)if test $result = yes; then LIBS="$LIBS -lcrypt"fiUSENSL=noAC_CHECK_LIB(socket,socket,result=yes,result=no)if test $result = yes; then LIBS="$LIBS -lsocket"else AC_CHECK_LIB(socket,socket,result=yes,result=no,-lnsl) if test $result = yes; then LIBS = "$LIBS -lsocket -lnsl" USENSL=yes else AC_CHECK_LIB(socket,connect,result=yes,result=no) if test $result = yes; then LIBS="$LIBS -lsocket" else AC_CHECK_LIB(socket,connect,result=yes,result=no,-lnsl) if test $result = yes; then LIBS="$LIBS -lsocket -lnsl" USENSL=yes fi fi fifiif test $USENSL != yes; then AC_CHECK_LIB(nsl,inet_addr,result=yes,result=no) if test $result = yes; then LIBS="$LIBS -lnsl" fifiAC_MSG_CHECKING(for sys_siglist)AC_TRY_COMPILE([#include <signal.h>#include <stdio.h>],[ puts(sys_siglist[0]); ], result=yes, result=no)AC_MSG_RESULT($result)if test "$result" = "yes"; then AC_DEFINE(HAVE_SIGLIST)fiAC_MSG_CHECKING(type of qsort)AC_TRY_COMPILE([#include <stdlib.h>extern void qsort();],[ ], result=void, result=int)AC_MSG_RESULT($result)if test "$result" = "void"; then AC_DEFINE(QSORT_IS_VOID)fiAC_MSG_CHECKING(how to determine bytesize)if test "$ac_cv_header_bsd_bsd_h" = "yes"; then AC_TRY_COMPILE([ #include <bsd/bsd.h> ],[ int i=NBBY ], NBBY=NBBY, NBBY=8)else AC_TRY_COMPILE([ #include <sys/param.h> ],[ int i=NBBY ], NBBY=NBBY, NBBY=8)fiif test "$NBBY" = "8"; then AC_TRY_COMPILE([ #include <values.h> ],[ int i=BITSPERBYTE ], NBBY=BITSPERBYTE, NBBY=8) if test "$NBBY" = "8"; then AC_TRY_COMPILE([ #include <limits.h> ],[ int i=CHAR_BIT ], NBBY=CHAR_BIT, NBBY=8) if test "$NBBY" != "8"; then AC_DEFINE(NEED_LIMITS_H) else AC_TRY_COMPILE([ #include <sys/types.h> ],[ int i=NBBY ], NBBY=NBBY, NBBY=8) fi else AC_DEFINE(NEED_VALUES_H) fielse if test "$ac_cv_header_bsd_bsd_h" = "yes"; then AC_DEFINE(NEED_BSD_BSD_H) else AC_DEFINE(NEED_SYS_PARAM_H) fifiif test "$NBBY" = "8"; then AC_MSG_RESULT(can't be determined - assuming 8)else AC_MSG_RESULT($NBBY)fiif test "$NBBY" != "NBBY"; then AC_DEFINE_UNQUOTED(NBBY,$NBBY)fiAC_MSG_CHECKING(if openlog requires 3 arguments)AC_TRY_COMPILE([#ifdef HAVE_SYSLOG_H#include <syslog.h>#endif#ifdef HAVE_SYS_SYSLOG_H#include <sys/syslog.h>#endif],[ openlog("",0,0) ], result=yes, result=no)AC_MSG_RESULT($result)if test "$result" = "yes"; then AC_MSG_CHECKING(which facility openlog understands) AC_TRY_COMPILE([#ifdef HAVE_SYSLOG_H#include <syslog.h>#endif#ifdef HAVE_SYS_SYSLOG_H#include <sys/syslog.h>#endif],[ openlog("",0,LOG_FTP) ], result=yes, result=no) if test "$result" = "yes"; then FACILITY="LOG_FTP" else AC_TRY_COMPILE([#ifdef HAVE_SYSLOG_H#include <syslog.h>#endif#ifdef HAVE_SYS_SYSLOG_H#include <sys/syslog.h>#endif],[ openlog("",0,LOG_DAEMON) ], result=yes, result=no) if test "$result" = "yes"; then FACILITY="LOG_DAEMON" else AC_TRY_COMPILE([#ifdef HAVE_SYSLOG_H#include <syslog.h>#endif#ifdef HAVE_SYS_SYSLOG_H#include <sys/syslog.h>#endif], [ openlog("",0,LOG_LOCAL7)], result=yes, result=no) if test "$result" = "yes"; then FACILITY="LOG_LOCAL7" fi fi fi AC_MSG_RESULT($FACILITY) AC_DEFINE_UNQUOTED(FACILITY, $FACILITY)fiAC_MSG_CHECKING(type of getmntent function)AC_TRY_COMPILE([#include <stdio.h>#include <unistd.h>#ifdef HAVE_MNTENT_H#include <mntent.h>#endif#ifdef HAVE_SYS_MNTENT_H#include <sys/mntent.h>#endif#ifdef HAVE_SYS_MNTTAB_H#include <sys/mnttab.h>#endif#include <unistd.h>],[ (void) getmntent(0) ], result=new-style, result=old-style)AC_MSG_RESULT($result)if test "$result" = "old-style"; then AC_DEFINE(HAS_OLDSTYLE_GETMNTENT)fidnl some systems (FreeBSD 3) require time.h to be included before utmp.h :/AC_MSG_CHECKING(if there is a ut_host field in the utmp structure)AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME#include <sys/time.h>#include <time.h>#else#ifdef HAVE_SYS_TIME_H#include <sys/time.h>#else#include <time.h>#endif#endif#include <utmp.h>],[struct utmp ut; puts(ut.ut_host);],result=yes,result=no)if test "$result" = "yes"; then AC_DEFINE(HAVE_UT_UT_HOST)fiAC_MSG_RESULT($result)AC_MSG_CHECKING(if there is a ut_exit.e_termination field in the utmp structure)AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME#include <sys/time.h>#include <time.h>#else#ifdef HAVE_SYS_TIME_H#include <sys/time.h>#else#include <time.h>#endif#endif#include <utmp.h>],[struct utmp ut; ut.ut_exit.e_termination=0;],result=yes,result=no)if test "$result" = "yes"; then AC_DEFINE(HAVE_UT_UT_EXIT_E_TERMINATION)fiAC_MSG_RESULT($result)AC_MSG_CHECKING(if there is a pw_expire field in the pw structure)AC_TRY_COMPILE([#include <pwd.h>],[ struct passwd *p; void *a=(void *)p->pw_expire; ],result=yes,result=no)if test "$result" = "yes"; then AC_DEFINE(HAS_PW_EXPIRE)fiAC_MSG_RESULT($result)AC_MSG_CHECKING(if there is a st_blksize field in the stat structure)AC_TRY_COMPILE([#include <sys/stat.h>],[ struct stat *s; int a=(int)s->st_blksize; ],result=yes,result=no)if test "$result" = "yes"; then AC_DEFINE(HAVE_ST_BLKSIZE)fiAC_MSG_RESULT($result)AC_CHECK_FUNC(res_query, result=yes, result=no)if test "$result" = "yes"; then AC_DEFINE(HAVE_LIBRESOLV)else AC_CHECK_LIB(bind, res_query, result=yes, result=no) if test "$result" = "yes"; then AC_DEFINE(HAVE_LIBRESOLV) LIBS="$LIBS -lbind" else AC_CHECK_LIB(resolv, res_query, result=yes, result=no) if test "$result" = "yes"; then AC_DEFINE(HAVE_LIBRESOLV) LIBS="$LIBS -lresolv" fi fifiAC_MSG_CHECKING(how to printf gr_gid)AC_TRY_RUN([#include <sys/types.h>#include <grp.h>int main(int argc, char **argv) { struct group *grent; if(sizeof(grent->gr_gid)<=4) return 0; return 1;}],[ result="u"AC_DEFINE_UNQUOTED(GR_GID_FORMAT, "$result")AC_MSG_RESULT(gr_gid is just a long - using %u)], [ result="no" ], [ result="no" ])if test $result = "no"; then AC_TRY_RUN([#include <stdio.h> int main(int argc, char **argv) { if(printf("%qd",(long long) 1)==1) return 0; return 1; }],[ result="qd" ],[ result="no" ], [ result="no"]) if test $result = "no"; then AC_TRY_RUN([#include <stdio.h> int main(int argc, char **argv) { if(printf("Ld",(long long) 1)==1) return 0; return 1; }],[ result="Ld" ],[ result="no" ], [ result="no" ]) if test $result = "no"; then AC_TRY_RUN([#include <stdio.h> int main(int argc, char **argv) { if(printf("lld",(long long) 1)==1) return 0; return 1; }],[ result="lld" ],[ result="no" ], [ result="no" ]) if test $result = "no"; then AC_TRY_RUN([#include <stdio.h> int main(int argc, char **argv) { if(printf("ld",(long long) 1)==1) return 0; return 1; }],[ result="ld" ],[ result="d" ], [ result="d" ]) fi fi fi AC_DEFINE_UNQUOTED(GR_GID_FORMAT,"$result") AC_MSG_RESULT(%$result)fiAC_MSG_CHECKING(how to printf pw_uid)AC_TRY_RUN([#include <sys/types.h>#include <pwd.h>int main(int argc, char **argv) { struct passwd *pwent; if(sizeof(pwent->pw_uid)<=4) return 0; return 1;}],[ result="u"AC_DEFINE_UNQUOTED(PW_UID_FORMAT, "$result")AC_MSG_RESULT(uid_t is just a long - using %u)],[ result="no" ], [ result="no" ])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -