📄 configure.ac
字号:
dnl AM_ACLOCAL_INCLUDE(m4)AC_PREREQ(2.57)AC_INIT(pure-ftpd, 1.0.17a, bugs@pureftpd.org)AC_CONFIG_SRCDIR(src/ftpd.c)AM_CONFIG_HEADER(config.h)AM_INIT_AUTOMAKE([1.6 dist-bzip2])AC_SUBST(VERSION)ISODATE=`date +%Y-%m-%d`AC_SUBST(ISODATE)dnl Checks for programs.AC_PROG_INSTALLAC_PROG_RANLIBAC_PROG_CCAC_AIXAC_ISC_POSIXAC_PROG_CC_STDCAC_ARG_VAR(PERL,local path to the perl interpreter)perl_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/perl/bin:/opt/perl/usr/bin:/opt/perl/usr/local/bin"AC_PATH_PROG(PERL,perl,/usr/bin/env perl,$perl_possible_path)AC_ARG_VAR(PYTHON,local path to the python interpreter)python_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/python/bin:/opt/python/usr/bin:/opt/python/usr/local/bin"AC_PATH_PROG(PYTHON,python,/usr/bin/env python,$python_possible_path)CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE=1"if test -d /usr/local/include; then CPPFLAGS="$CPPFLAGS -I/usr/local/include"fiif test -d /usr/kerberos/include; then CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include"fiif test -d /usr/local/lib; then LDFLAGS="$LDFLAGS -L/usr/local/lib"fiif uname | fgrep SunOS > /dev/null 2> /dev/null ; then CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__=1 -D_XPG4_2=1"fidnl Checks for header filesAC_HEADER_STDCAC_HEADER_STATAC_HEADER_TIMEAC_HEADER_DIRENTAC_HEADER_SYS_WAITAC_CHECK_HEADERS(unistd.h string.h strings.h sys/param.h ioctl.h sys/ioctl.h)AC_CHECK_HEADERS(sys/vfs.h sys/statvfs.h sys/sendfile.h sys/uio.h sys/fsuid.h)AC_CHECK_HEADERS(sys/time.h sys/resource.h sys/capability.h)AC_CHECK_HEADERS(shadow.h getopt.h stddef.h)AC_CHECK_HEADERS(netinet/in_systm.h netinet/in.h sys/pstat.h)AC_CHECK_HEADERS(sys/mount.h, [], [],[#ifdef HAVE_SYS_PARAM_H# include <sys/param.h>#endif])AC_CHECK_HEADERS(fcntl.h sys/fcntl.h sys/loadavg.h sys/ptrace.h)AC_CHECK_HEADERS(security/pam_appl.h security/pam_misc.h security/pam_filter.h)AC_CHECK_HEADERS(sgtty.h termio.h)AC_CHECK_HEADERS(locale.h)AC_CHECK_HEADERS(stdarg.h varargs.h)AC_CHECK_HEADERS(windows.h io.h)AC_CHECK_HEADERS(crypt.h)AC_CHECK_HEADERS(utime.h)AC_CHECK_HEADERS(openssl/ssl.h)AC_SYS_POSIX_TERMIOSif test "x$ac_cv_sys_posix_termios" = "xyes"; thenAC_DEFINE(HAVE_POSIX_TERMIOS,,[Define if you have POSIX termios])fidnl Check for endiannessAC_C_BIGENDIANdnl Checks for typesAC_TYPE_SIGNALAC_TYPE_SIZE_TAC_TYPE_UID_TAC_TYPE_PID_TAC_TYPE_OFF_TAC_TYPE_MODE_TAC_STRUCT_TIMEZONEAC_CHECK_MEMBER(struct tm.tm_gmtoff, [AC_DEFINE(STRUCT_TM_TM_GMTOFF,,[Define if you have struct tm/tm_gmtoff])],,[#include <sys/types.h>#include <$ac_cv_struct_tm>])AC_MSG_CHECKING([whether timezone is scalar])AC_TRY_COMPILE([#include <sys/types.h>#include <$ac_cv_struct_tm> ], [timezone = 42L], [ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SCALAR_TIMEZONE,,[Define if your timezone is a scalar number]) ], [ AC_MSG_RESULT(no) ]) AC_CHECK_TYPE(nlink_t, , [AC_DEFINE(nlink_t, int, [nlink_t type])],[#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/stat.h>])AC_CHECK_TYPE(dev_t, , [AC_DEFINE(dev_t, unsigned int, [dev_t type])],[#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/stat.h>])AC_CHECK_TYPE(ino_t, , [AC_DEFINE(ino_t, unsigned long, [ino_t type])],[#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/stat.h>])dnl Check for sizesAC_CHECK_SIZEOF(short)AC_CHECK_SIZEOF(int)AC_CHECK_SIZEOF(long)AC_CHECK_SIZEOF(long long)AC_CHECK_SIZEOF(mode_t)dnl Socket thingsAC_CHECK_FUNC(connect, , [AC_CHECK_LIB(socket, connect)])AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(resolv, gethostbyname)])AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname)])if test "x$ac_cv_lib_nsl_gethostbyname" != "xyes" && test "x$ac_cv_func_gethostbyname" != "xyes" ; then AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(socket, gethostbyname)])fiif test "$ac_cv_lib_nsl_gethostbyname" = "$ac_cv_func_gethostbyname" ; then AC_MSG_CHECKING([if we can include libnsl + libsocket]) LIBS="-lnsl -lsocket $LIBS" AC_TRY_LINK( , [(void) gethostbyname], my_ac_link_result=yes, my_ac_link_result=no ) if test "$my_ac_link_result" = "no" ; then AC_MSG_RESULT([failure]) AC_MSG_ERROR([unable to use gethostbyname()]) else AC_MSG_RESULT([success]) fifiAC_CHECK_LIB(sendfile, sendfile)dnl Types - continuedAC_CHECK_TYPE(socklen_t, , [AC_DEFINE(socklen_t, int, [socklen_t type])],[#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/socket.h>])AC_CHECK_TYPE(ssize_t, , [AC_DEFINE(ssize_t, long int, [ssize_t type])],[#include <stdio.h>#ifdef STDC_HEADERS# include <stdlib.h># include <stddef.h>#else# if HAVE_STDLIB_H# include <stdlib.h># endif#endif#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>])AC_CHECK_TYPE(sig_atomic_t, , [AC_DEFINE(sig_atomic_t, signed char, [sig_atomic_t type])],[#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <signal.h>])dnl Compiler characteristicsAC_PROG_GCC_TRADITIONALAC_C_CONSTAC_C_INLINEdnl OptionsAM_WITH_DMALLOCAC_ARG_WITH(standalone,[AC_HELP_STRING([--without-standalone],[Don't compile the standalone server code])],[ if test "x$withval" = "xno" ; then AC_DEFINE(NO_STANDALONE,,[without standalone]) no_standalone=yes fi ])AC_ARG_WITH(inetd,[AC_HELP_STRING([--without-inetd],[Don't support super-servers (like inetd)])],[ if test "x$withval" = "xno" ; then AC_DEFINE(NO_INETD,,[without inetd]) no_inetd=yes fi ])if test "x$no_standalone" = "xyes" && test "x$no_inetd" = "xyes" ; then AC_MSG_ERROR(You can't disable both standalone and inetd mode.)fiAC_ARG_WITH(capabilities,[AC_HELP_STRING([--without-capabilities],[Don't use Linux capabilities (default=detect)])],[ if test "x$withval" = "xno" ; then no_capabilities=1 fi ]) if test -z "$no_capabilities" ; then AC_CHECK_LIB(cap, cap_init, , ) if test "x$ac_cv_lib_cap_cap_init" = "xyes"; then if test "x$ac_cv_header_sys_capability_h" = "xyes"; then AC_DEFINE(USE_CAPABILITIES,,[use capabilities]) fi fifiAC_ARG_WITH(shadow,[AC_HELP_STRING([--without-shadow],[Don't use shadow passwords (default=detect)])],[ if test "x$withval" = "xno" ; then no_shadow=1 fi ]) if test -z "$no_shadow" && test "x$ac_cv_header_shadow_h" = "xyes" ; then AC_CHECK_FUNC(getspnam, AC_DEFINE(USE_SHADOW,,[use shadow passwords]), AC_CHECK_LIB(shadow, getspnam, AC_DEFINE(USE_SHADOW), AC_MSG_WARN(shadow.h was found, but getspnam() isn't available) ) )fiAC_ARG_WITH(usernames,[AC_HELP_STRING([--without-usernames],[Use only numerical UIDs/GIDs])],[ if test "x$withval" = "xno" ; then AC_DEFINE(NO_FTP_USERS,,[without usernames]) fi ])AC_ARG_WITH(iplogging,[AC_HELP_STRING([--without-iplogging],[Never log remote IP addresses (privacy)])],[ if test "x$withval" = "xno" ; then AC_DEFINE(DONT_LOG_IP,,[without iplogging]) fi ])AC_ARG_WITH(humor,[AC_HELP_STRING([--without-humor],[Disable humor (enabled by default)])],[ if test "x$withval" = "xno" ; then AC_DEFINE(DISABLE_HUMOR,,[without humor]) fi ])AC_ARG_WITH(longoptions,[AC_HELP_STRING([--without-longoptions],[Ignored - just for backward compatibility])],[ if test "x$withval" = "xno" ; then AC_DEFINE(NO_GETOPT_LONG,,[without longoptions]) fi ])AC_ARG_WITH(ascii,[AC_HELP_STRING([--without-ascii],[Don't support 7-bits (ASCII) transfers])],[ if test "x$withval" = "xno" ; then AC_DEFINE(WITHOUT_ASCII,,[without ascii]) fi ])AC_ARG_WITH(banner,[AC_HELP_STRING([--without-banner],[Don't display any initial banner])],[ if test "x$withval" = "xno" ; then AC_DEFINE(NO_BANNER,,[without banner]) fi ])AC_ARG_WITH(globbing,[AC_HELP_STRING([--without-globbing],[Don't include globbing code])],[ if test "x$withval" = "xno" ; then AC_DEFINE(DISABLE_GLOBBING,,[without globbing]) fi ])AC_ARG_WITH(nonalnum,[AC_HELP_STRING([--without-nonalnum],[Only allow basic alphanumeric characters in file names])],[ if test "x$withval" = "xno" ; then AC_DEFINE(PARANOID_FILE_NAMES,,[disallow non-alphanumeric characters]) fi ])AC_ARG_WITH(sendfile,[AC_HELP_STRING([--without-sendfile],[Don't use zero-copy optimizations (for network FS)])],[ if test "x$withval" = "xno" ; then AC_DEFINE(DISABLE_SENDFILE,,[without sendfile]) fi ])AC_ARG_WITH(boring,[AC_HELP_STRING([--with-boring],[Display only boring messages])],[ if test "x$withval" = "xyes" ; then AC_DEFINE(BORING_MODE,,[display only boring messages]) AC_DEFINE(DISABLE_HUMOR) fi ])AC_ARG_WITH(brokenrealpath,[AC_HELP_STRING([--with-brokenrealpath],[If your libc has a broken realpath() call])],[ if test "x$withval" = "xyes" ; then AC_DEFINE(USE_BUILTIN_REALPATH,,[realpath() is broken]) fi ])AC_ARG_WITH(probe-random-dev,[AC_HELP_STRING([--with-probe-random-dev],[If you want to probe for /dev/*random at run-time])],[ if test "x$withval" = "xyes" ; then AC_DEFINE(PROBE_RANDOM_AT_RUNTIME,,[probe for /dev/Xrandom at run-time]) fi ])AC_ARG_WITH(minimal,[AC_HELP_STRING([--with-minimal],[Build only a small minimal server])],[ if test "x$withval" = "xyes" ; then AC_DEFINE(MINIMAL,,[with minimal]) AC_DEFINE(NO_GETOPT_LONG) AC_DEFINE(DISABLE_HUMOR) AC_DEFINE(NO_FTP_USERS) AC_DEFINE(WITHOUT_ASCII) AC_DEFINE(NO_BANNER) AC_DEFINE(BORING_MODE) CFLAGS="$CFLAGS -Os -ftracer -fomit-frame-pointer -fssa -fgcse -falign-functions=2 -falign-jumps=2 -fno-unroll-loops " LDFLAGS="$LDFLAGS -s " fi ])AC_ARG_WITH(paranoidmsg,[AC_HELP_STRING([--with-paranoidmsg],[Use paranoid, but not admin-friendly messages])],[ if test "x$withval" = "xyes" ; then AC_DEFINE(PARANOID_MESSAGES,,[with paranoidmsg]) fi ])AC_ARG_WITH(sysquotas,[AC_HELP_STRING([--with-sysquotas],[Use system (not virtual) quotas])],[ if test "x$withval" = "xyes" ; then AC_DEFINE(SYSTEM_QUOTAS,,[with sysquotas]) fi ])AC_ARG_WITH(altlog,[AC_HELP_STRING([--with-altlog],[Support alternative log format (Apache-like)])],[ if test "x$withval" = "xyes" ; then AC_DEFINE(WITH_ALTLOG,,[with altlog]) fi ])AC_ARG_WITH(puredb,[AC_HELP_STRING([--with-puredb],[Support virtual (FTP-only) users])],[ if test "x$withval" = "xyes" ; then AC_DEFINE(WITH_PUREDB,,[with puredb]) fi ])AC_ARG_WITH(extauth,[AC_HELP_STRING([--with-extauth],[Support external authentication modules])],[ if test "x$withval" = "xyes" ; then AC_DEFINE(WITH_EXTAUTH,,[with extauth (*BETA*)]) fi ])AC_ARG_WITH(pam,[AC_HELP_STRING([--with-pam],[Enable PAM support (default=disabled)])],[ if test "x$withval" = "xyes" ; then with_pam="yes" fi ])if test "x$with_pam" = "xyes" ; then if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then AC_MSG_ERROR(PAM headers not found.) else AC_CHECK_LIB(dl, dlopen, , ) LIBS="$LIBS -lpam" AC_DEFINE(USE_PAM,,[use pam]) AC_CHECK_FUNCS(pam_getenvlist) AC_MSG_CHECKING([whether pam_strerror takes only one argument]) AC_TRY_COMPILE([#include <stdio.h>#ifdef STDC_HEADERS# include <stdlib.h># include <stddef.h>#else# if HAVE_STDLIB_H# include <stdlib.h># endif#endif#include <security/pam_appl.h> ], [(void)pam_strerror((pam_handle_t *)NULL, -1)], [AC_MSG_RESULT(no)], [ AC_DEFINE(HAVE_OLD_PAM,,[obsolete pam]) AC_MSG_RESULT(yes) ]) fifi AC_MSG_CHECKING([whether syslog names are available])AC_TRY_COMPILE([#define SYSLOG_NAMES 1#include <stdio.h>#include <syslog.h>],[ (void) facilitynames],[ AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SYSLOG_NAMES,,[define if syslog names are available])],[ AC_MSG_RESULT(no)]) AC_MSG_CHECKING([whether struct addrinfo is defined])AC_TRY_COMPILE([#include <stdio.h>#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/socket.h>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -