configure.ac

来自「功能强大的ftp服务器源代码」· AC 代码 · 共 1,327 行 · 第 1/3 页

AC
1,327
字号
#include <netdb.h>],[do { struct addrinfo a; (void) a.ai_flags;} while(0)],[  AC_MSG_RESULT(yes)  AC_DEFINE(HAVE_STRUCT_ADDRINFO,,[define if you have struct addrinfo])],[  AC_MSG_RESULT(no)])  AC_MSG_CHECKING([whether sin_len is defined])AC_TRY_COMPILE([#include <stdio.h>#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>],[do { struct sockaddr_in a; (void) a.sin_len;} while(0)],[  AC_MSG_RESULT(yes)  AC_DEFINE(HAVE_SIN_LEN,,[define if you have sin_len])],[  AC_MSG_RESULT(no)])  AC_MSG_CHECKING([whether __ss_family is defined])AC_TRY_COMPILE([#include <stdio.h>#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/socket.h>],[do { struct sockaddr_storage a; (void) a.__ss_family;} while(0)],[  AC_MSG_RESULT(yes)  AC_DEFINE(HAVE___SS_FAMILY,,[define if you have __ss_family])],[  AC_MSG_RESULT(no)])  AC_MSG_CHECKING([whether ss_len is defined])AC_TRY_COMPILE([#include <stdio.h>#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/socket.h>],[do { struct sockaddr_storage a; (void) a.ss_len;} while(0)],[  AC_MSG_RESULT(yes)  AC_DEFINE(HAVE_SS_LEN,,[define if you have ss_len])],[  AC_MSG_RESULT(no)])  AC_MSG_CHECKING([whether __ss_len is defined])AC_TRY_COMPILE([#include <stdio.h>#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/socket.h>],[do { struct sockaddr_storage a; (void) a.__ss_len;} while(0)],[  AC_MSG_RESULT(yes)  AC_DEFINE(HAVE___SS_LEN,,[define if you have __ss_len])],[  AC_MSG_RESULT(no)])  AC_MSG_CHECKING([if a linuxish sendfile is available])AC_TRY_LINK([#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/socket.h>#ifdef HAVE_SYS_UIO_H# include <sys/uio.h>#endif#ifdef HAVE_SYS_SENDFILE_H# include <sys/sendfile.h>#endif],[do { int fd = 0; off_t *off = NULL; size_t cnt = (size_t) 0;  (void) sendfile(fd, fd, off, cnt);} while(0)],[  AC_MSG_RESULT(yes)  AC_DEFINE(SENDFILE_LINUX,,[define if you have a linuxish sendfile])],[  AC_MSG_RESULT(no)])  AC_MSG_CHECKING([if a freebsdish sendfile is available])AC_TRY_LINK([#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/socket.h>#ifdef HAVE_SYS_UIO_H# include <sys/uio.h>#endif#ifdef HAVE_SYS_SENDFILE_H# include <sys/sendfile.h>#endif],[do { int fd = 0; off_t off = (off_t) 0; size_t cnt = (size_t) 0; struct sf_hdtr *hdtr = NULL;  (void) sendfile(fd, fd, off, cnt, hdtr, &off, 42);} while(0)],[  AC_MSG_RESULT(yes)  AC_DEFINE(SENDFILE_FREEBSD,,[define if you have a freebsdish sendfile])],[  AC_MSG_RESULT(no)])AC_MSG_CHECKING([if a hpuxish sendfile is available])AC_TRY_LINK([#include <sys/socket.h>#include <stdio.h>],[do { int fd = 0; off_t off = (off_t) 0; bsize_t nbytes = (size_t) 0; const struct iovec *hdtrl = NULL;  (void) sendfile(fd, fd, off, nbytes, hdtrl, 42);} while(0)],[  AC_MSG_RESULT(yes)  AC_DEFINE(SENDFILE_HPUX,,[define if you have a hpuxish sendfile])],[  AC_MSG_RESULT(no)])AC_CHECK_FUNC(sendfilev, , [AC_CHECK_LIB(sendfile, sendfilev)])AC_MSG_CHECKING([if a solarisish sendfilev is available])AC_TRY_LINK([#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#include <sys/socket.h>#ifdef HAVE_SYS_UIO_H# include <sys/uio.h>#endif#ifdef HAVE_SYS_SENDFILE_H# include <sys/sendfile.h>#endif],[do { int fd = 0, sfvcnt = 0; const struct sendfilevec vec; size_t xferred;  (void) sendfilev(fd, &vec, sfvcnt, &xferred);} while(0)],[  AC_MSG_RESULT(yes)  AC_DEFINE(SENDFILEV_SOLARIS,,[define if you have a solarisish sendfilev])],[  AC_MSG_RESULT(no)])AC_ARG_WITH(cookie,[AC_HELP_STRING([--with-cookie],[Support 'fortune' cookies (-F option)])],[ if test "x$withval" = "xyes" ; then    AC_DEFINE(COOKIE,,[with cookie])  fi ])AC_ARG_WITH(throttling,[AC_HELP_STRING([--with-throttling],[Support bandwidth throttling (disabled by default)])],[ if test "x$withval" = "xyes" ; then    AC_DEFINE(THROTTLING,,[with throttling])  fi ])AC_ARG_WITH(ratios,[AC_HELP_STRING([--with-ratios],[Support for upload/download ratios])],[ if test "x$withval" = "xyes" ; then    AC_DEFINE(RATIOS,,[with ratios])  fi ])AC_ARG_WITH(quotas,[AC_HELP_STRING([--with-quotas],[Support .ftpquota files])],[ if test "x$withval" = "xyes" ; then    AC_DEFINE(QUOTAS,,[with quotas])  fi ])AC_ARG_WITH(ftpwho,[AC_HELP_STRING([--with-ftpwho],[Support for pure-ftpwho])],[ if test "x$withval" = "xyes" ; then    AC_DEFINE(FTPWHO,,[with ftpwho])  fi ])AC_ARG_WITH(largefile,[AC_HELP_STRING([--with-largefile],[Support for files > 2 Gb (may be slower)])],[ if test "x$withval" = "xyes" ; then    AC_SYS_LARGEFILE    AC_DEFINE(WITH_LARGE_FILES,,[with largefile])  fi ])AC_ARG_WITH(welcomemsg,[AC_HELP_STRING([--with-welcomemsg],[Support welcome.msg backward compatibility (deprecated)])],[ if test "x$withval" = "xyes" ; then      AC_DEFINE(WITH_WELCOME_MSG,,[with welcomemsg])  fi ])AC_ARG_WITH(uploadscript,[AC_HELP_STRING([--with-uploadscript],[Allow running an external script after an upload (experimental)])],[ if test "x$withval" = "xyes" ; then      AC_DEFINE(WITH_UPLOAD_SCRIPT,,[with uploadscript])  fi ])AC_ARG_WITH(virtualhosts,[AC_HELP_STRING([--with-virtualhosts],[Handle virtual servers on different IP addresses])],[ if test "x$withval" = "xyes" ; then      AC_DEFINE(WITH_VIRTUAL_HOSTS,,[with virtualhosts])  fi ])AC_ARG_WITH(virtualchroot,[AC_HELP_STRING([--with-virtualchroot],[Enable the ability to follow symlinks outside a chroot jail])],[ if test "x$withval" = "xyes" ; then      AC_DEFINE(WITH_VIRTUAL_CHROOT,,[with virtual chroot])  fi ])AC_ARG_WITH(diraliases,[AC_HELP_STRING([--with-diraliases],[Enable directory aliases])],[ if test "x$withval" = "xyes" ; then      AC_DEFINE(WITH_DIRALIASES,,[with directory aliases])  fi ])AC_ARG_WITH(nonroot,[AC_HELP_STRING([--with-nonroot],[Non-root FTP])],[ if test "x$withval" = "xyes" ; then      AC_DEFINE(NON_ROOT_FTP,,[with nonroot])      AC_DEFINE(WITH_VIRTUAL_CHROOT)      non_root_ftp=yes  fi ])AC_ARG_WITH(peruserlimits,[AC_HELP_STRING([--with-peruserlimits],[Support per-user concurrency limits])],[ if test "x$withval" = "xyes" ; then      AC_DEFINE(PER_USER_LIMITS,,[with per-user limits])      AC_DEFINE(FTPWHO)  fi ])AC_ARG_WITH(debug,[AC_HELP_STRING([--with-debug],[For maintainers only - please do not use])],[ if test "x$withval" = "xyes" ; then    CFLAGS="$CFLAGS -DDEBUG=1 -g -Wall -W -Wcast-align -Wbad-function-cast -Wstrict-prototypes -Wwrite-strings -Wreturn-type "  fi ])AC_ARG_WITH(everything,[AC_HELP_STRING([--with-everything],[Build a big server with almost everything])],[ if test "x$withval" = "xyes" ; then    AC_DEFINE(WITH_ALTLOG)    AC_DEFINE(COOKIE)    AC_DEFINE(THROTTLING)    AC_DEFINE(RATIOS)    AC_DEFINE(QUOTAS)        AC_DEFINE(WITH_UPLOAD_SCRIPT)    AC_DEFINE(WITH_VIRTUAL_HOSTS)    AC_DEFINE(WITH_PUREDB)    AC_DEFINE(WITH_EXTAUTH)    AC_DEFINE(FTPWHO)    AC_DEFINE(WITH_DIRALIASES)    AC_DEFINE(PER_USER_LIMITS)  fi ])AC_ARG_WITH(language,[AC_HELP_STRING([--with-language=],[< english | german | romanian | french |french-funny | polish | spanish | danish | dutch | italian |brazilian-portuguese | slovak | korean | swedish | norwegian | russian |traditional-chinese | simplified-chinese | czech | turkish >])],[ if test "x$withval" = "xenglish" ; then    AC_DEFINE(MESSAGES_EN,,[english])  elif test "x$withval" = "xgerman" ; then    AC_DEFINE(MESSAGES_DE,,[german])    elif test "x$withval" = "xromanian" ; then    AC_DEFINE(MESSAGES_RO,,[romanian])  elif test "x$withval" = "xfrench" ; then    AC_DEFINE(MESSAGES_FR,,[french])  elif test "x$withval" = "xfrench-funny" ; then    AC_DEFINE(MESSAGES_FR_FUNNY,,[french-funny])      elif test "x$withval" = "xpolish" ; then      AC_DEFINE(MESSAGES_PL,,[polish])  elif test "x$withval" = "xspanish" ; then    AC_DEFINE(MESSAGES_ES,,[spanish])  elif test "x$withval" = "xdanish" ; then    AC_DEFINE(MESSAGES_DA,,[danish])  elif test "x$withval" = "xdutch" ; then    AC_DEFINE(MESSAGES_NL,,[dutch])  elif test "x$withval" = "xitalian" ; then    AC_DEFINE(MESSAGES_IT,,[italian])  elif test "x$withval" = "xbrazilian-portuguese" ; then    AC_DEFINE(MESSAGES_PT_BR,,[brazilian portuguese])  elif test "x$withval" = "xslovak" ; then    AC_DEFINE(MESSAGES_SK,,[slovak])  elif test "x$withval" = "xkorean" ; then    AC_DEFINE(MESSAGES_KR,,[korean])  elif test "x$withval" = "xswedish" ; then    AC_DEFINE(MESSAGES_SV,,[swedish])  elif test "x$withval" = "xnorwegian" ; then    AC_DEFINE(MESSAGES_NO,,[norwegian])  elif test "x$withval" = "xrussian" ; then    AC_DEFINE(MESSAGES_RU,,[russian])  elif test "x$withval" = "xtraditional-chinese" ; then    AC_DEFINE(MESSAGES_ZH_TW,,[traditional chinese])  elif test "x$withval" = "xsimplified-chinese" ; then    AC_DEFINE(MESSAGES_ZH_CN,,[simplified chinese])  elif test "x$withval" = "xczech" ; then    AC_DEFINE(MESSAGES_CS_CZ,,[czech])  elif test "x$withval" = "xturkish" ; then    AC_DEFINE(MESSAGES_TR,,[turkish])  else     AC_MSG_WARN(--with-language=$withval is not recognized)  fi ])dnl Checks for libraries.AC_CHECK_LIB(crypt, crypt, , )dnl Checks for library functions.AC_FUNC_ALLOCAAC_FUNC_MMAPAC_FUNC_MEMCMPAC_FUNC_STRFTIMEAC_FUNC_STATAC_FUNC_VPRINTFAC_FUNC_GETLOADAVG(src)AC_FUNC_GETGROUPSAC_CHECK_FUNCS(initgroups setrlimit waitpid setproctitle getopt_long)AC_CHECK_FUNCS(seteuid setreuid setresuid setegid setregid setresgid)AC_CHECK_FUNCS(statvfs statfs putenv getpagesize realpath pread ptrace)AC_CHECK_FUNCS(strtoull strtoq)AC_CHECK_FUNCS(memset munmap strdup fileno mapviewoffile madvise)AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_ntop inet_pton)AC_CHECK_FUNCS(setusershell setgroups snprintf vsnprintf vfprintf gethostname)AC_CHECK_FUNCS(setlocale)AC_CHECK_FUNCS(utime utimes mknod mkfifo)AC_CHECK_FUNCS(random srandomdev)AC_MSG_CHECKING([whether statvfs64() is defined])AC_TRY_COMPILE([#include <stdio.h>#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include <sys/types.h>#ifdef HAVE_SYS_STATVFS_H# include <sys/statvfs.h>#endif],[for (;;) { struct statvfs64 a; if (statvfs64(".", &a) == 0 || a.f_bsize != 0) {   break; }} ],[  AC_MSG_RESULT(yes)  AC_DEFINE(HAVE_STATVFS64,,[define if you have statvfs64])],[  AC_MSG_RESULT(no)])  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?