📄 configure.in
字号:
dnl Process this file with autoconf to produce a configure script.AC_INIT()AC_CONFIG_SRCDIR([byteorder.h])AC_CONFIG_HEADER(config.h)AC_PREREQ(2.59)RSYNC_VERSION=3.0.5AC_SUBST(RSYNC_VERSION)AC_MSG_NOTICE([Configuring rsync $RSYNC_VERSION])AC_DEFINE_UNQUOTED(RSYNC_VERSION, ["$RSYNC_VERSION"], [rsync release version])LDFLAGS=${LDFLAGS-""}AC_CANONICAL_TARGET([])dnl Checks for programs.AC_PROG_CCAC_PROG_CPPAC_PROG_EGREPAC_PROG_INSTALLAC_PROG_CC_STDCAC_SUBST(SHELL)AC_DEFINE([_GNU_SOURCE], 1, [Define _GNU_SOURCE so that we get all necessary prototypes])if test x"$ac_cv_prog_cc_stdc" = x"no"; then AC_MSG_WARN([rsync requires an ANSI C compiler and you don't seem to have one])fi# We must decide this before testing the compiler.# Please allow this to default to yes, so that your users have more# chance of getting a useful stack trace if problems occur.AC_MSG_CHECKING([whether to include debugging symbols])AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug], [disable debugging symbols and features]))if test x"$enable_debug" = x"no"; then AC_MSG_RESULT(no) CFLAGS=${CFLAGS-"-O"}else AC_MSG_RESULT([yes]) # leave CFLAGS alone; AC_PROG_CC will try to include -g if it can dnl AC_DEFINE(DEBUG, 1, [Define to turn on debugging code that may slow normal operation]) dnl CFLAGS=${CFLAGS-"-g"}fiAC_ARG_ENABLE(profile, AC_HELP_STRING([--enable-profile], [turn on CPU profiling]))if test x"$enable_profile" = x"yes"; then CFLAGS="$CFLAGS -pg"fi# Specifically, this turns on panic_action handling.AC_ARG_ENABLE(maintainer-mode, AC_HELP_STRING([--enable-maintainer-mode], [turn on extra debug features]))if test x"$enable_maintainer_mode" = x"yes"; then CFLAGS="$CFLAGS -DMAINTAINER_MODE"fi# This is needed for our included version of popt. Kind of silly, but# I don't want our version too far out of sync.CFLAGS="$CFLAGS -DHAVE_CONFIG_H"# If GCC, turn on warnings.if test x"$GCC" = x"yes"; then CFLAGS="$CFLAGS -Wall -W"fiAC_ARG_WITH(included-popt, AC_HELP_STRING([--with-included-popt], [use bundled popt library, not from system]))AC_ARG_WITH(rsync-path, AC_HELP_STRING([--with-rsync-path=PATH], [set default --rsync-path to PATH (default: rsync)]), [ RSYNC_PATH="$with_rsync_path" ], [ RSYNC_PATH="rsync" ])AC_DEFINE_UNQUOTED(RSYNC_PATH, "$RSYNC_PATH", [location of rsync on remote machine])AC_ARG_WITH(rsyncd-conf, AC_HELP_STRING([--with-rsyncd-conf=PATH], [set configuration file for rsync server to PATH (default: /etc/rsyncd.conf)]), [ if test ! -z "$with_rsyncd_conf" ; then case $with_rsyncd_conf in yes|no) RSYNCD_SYSCONF="/etc/rsyncd.conf" ;; /*) RSYNCD_SYSCONF="$with_rsyncd_conf" ;; *) AC_MSG_ERROR(You must specify an absolute path to --with-rsyncd-conf=PATH) ;; esac else RSYNCD_SYSCONF="/etc/rsyncd.conf" fi ], [ RSYNCD_SYSCONF="/etc/rsyncd.conf" ])AC_DEFINE_UNQUOTED(RSYNCD_SYSCONF, "$RSYNCD_SYSCONF", [location of configuration file for rsync server])AC_ARG_WITH(rsh, AC_HELP_STRING([--with-rsh=CMD], [set remote shell command to CMD (default: ssh)]))AC_CHECK_PROG(HAVE_REMSH, remsh, 1, 0)if test x$HAVE_REMSH = x1; then AC_DEFINE(HAVE_REMSH, 1, [Define to 1 if remote shell is remsh, not rsh])fiif test x"$with_rsh" != x; then RSYNC_RSH="$with_rsh"else RSYNC_RSH="ssh"fiAC_DEFINE_UNQUOTED(RSYNC_RSH, "$RSYNC_RSH", [default -e command])AC_CHECK_PROG(HAVE_YODL2MAN, yodl2man, 1, 0)if test x$HAVE_YODL2MAN = x1; then MAKE_MAN=manfiAC_ARG_WITH(nobody-group, AC_HELP_STRING([--with-nobody-group=GROUP], [set the default unprivileged group (default nobody or nogroup)]), [ NOBODY_GROUP="$with_nobody_group" ])if test x"$with_nobody_group" = x; then AC_MSG_CHECKING([the group for user "nobody"]) if grep '^nobody:' /etc/group >/dev/null 2>&1; then NOBODY_GROUP=nobody elif grep '^nogroup:' /etc/group >/dev/null 2>&1; then NOBODY_GROUP=nogroup else NOBODY_GROUP=nobody # test for others? fi AC_MSG_RESULT($NOBODY_GROUP)fiAC_DEFINE_UNQUOTED(NOBODY_USER, "nobody", [unprivileged user--e.g. nobody])AC_DEFINE_UNQUOTED(NOBODY_GROUP, "$NOBODY_GROUP", [unprivileged group for unprivileged user])# arrgh. libc in some old debian version screwed up the largefile# stuff, getting byte range locking wrongAC_CACHE_CHECK([for broken largefile support],rsync_cv_HAVE_BROKEN_LARGEFILE,[AC_TRY_RUN([#define _FILE_OFFSET_BITS 64#include <stdio.h>#include <fcntl.h>#include <sys/types.h>#include <sys/wait.h>int main(void){ struct flock lock; int status; char tpl[32] = "/tmp/locktest.XXXXXX"; int fd = mkstemp(tpl); if (fd < 0) { strcpy(tpl, "conftest.dat"); fd = open(tpl, O_CREAT|O_RDWR, 0600); } lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 1; lock.l_pid = 0; fcntl(fd,F_SETLK,&lock); if (fork() == 0) { lock.l_start = 1; _exit(fcntl(fd,F_SETLK,&lock) == 0); } wait(&status); unlink(tpl); exit(WEXITSTATUS(status));}],rsync_cv_HAVE_BROKEN_LARGEFILE=yes,rsync_cv_HAVE_BROKEN_LARGEFILE=no,rsync_cv_HAVE_BROKEN_LARGEFILE=cross)])if test x"$rsync_cv_HAVE_BROKEN_LARGEFILE" != x"yes"; then AC_SYS_LARGEFILEfiipv6type=unknownipv6lib=noneipv6trylibc=yesAC_ARG_ENABLE(ipv6, AC_HELP_STRING([--disable-ipv6], [don't even try to use IPv6]))if test x"$enable_ipv6" != x"no"; then AC_MSG_CHECKING([ipv6 stack type]) for i in inria kame linux-glibc linux-inet6 toshiba v6d zeta; do case $i in inria) # http://www.kame.net/ AC_EGREP_CPP(yes, [#include <netinet/in.h>#ifdef IPV6_INRIA_VERSIONyes#endif], [ipv6type=$i; AC_DEFINE(INET6, 1, [true if you have IPv6]) ]) ;; kame) # http://www.kame.net/ AC_EGREP_CPP(yes, [#include <netinet/in.h>#ifdef __KAME__yes#endif], [ipv6type=$i; AC_DEFINE(INET6, 1, [true if you have IPv6])]) ;; linux-glibc) # http://www.v6.linux.or.jp/ AC_EGREP_CPP(yes, [#include <features.h>#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1yes#endif], [ipv6type=$i;AC_DEFINE(INET6, 1, [true if you have IPv6])]) ;; linux-inet6) # http://www.v6.linux.or.jp/ if test -d /usr/inet6 -o -f /usr/inet6/lib/libinet6.a; then ipv6type=$i ipv6lib=inet6 ipv6libdir=/usr/inet6/lib ipv6trylibc=yes; AC_DEFINE(INET6, 1, [true if you have IPv6]) CFLAGS="-I/usr/inet6/include $CFLAGS" fi ;; toshiba) AC_EGREP_CPP(yes, [#include <sys/param.h>#ifdef _TOSHIBA_INET6yes#endif], [ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib; AC_DEFINE(INET6, 1, [true if you have IPv6])]) ;; v6d) AC_EGREP_CPP(yes, [#include </usr/local/v6/include/sys/v6config.h>#ifdef __V6D__yes#endif], [ipv6type=$i; ipv6lib=v6; ipv6libdir=/usr/local/v6/lib; AC_DEFINE(INET6, 1, [true if you have IPv6])]) ;; zeta) AC_EGREP_CPP(yes, [#include <sys/param.h>#ifdef _ZETA_MINAMI_INET6yes#endif], [ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib; AC_DEFINE(INET6, 1, [true if you have IPv6])]) ;; esac if test "$ipv6type" != "unknown"; then break fi done AC_MSG_RESULT($ipv6type) AC_SEARCH_LIBS(getaddrinfo, inet6)fidnl Do you want to disable use of locale functionsAC_ARG_ENABLE([locale], AC_HELP_STRING([--disable-locale], [disable locale features]))AH_TEMPLATE([CONFIG_LOCALE],[Undefine if you don't want locale features. By default this is defined.])if test x"$enable_locale" != x"no"; then AC_DEFINE(CONFIG_LOCALE)fiAC_MSG_CHECKING([whether to call shutdown on all sockets])case $host_os in *cygwin* ) AC_MSG_RESULT(yes) AC_DEFINE(SHUTDOWN_ALL_SOCKETS, 1, [Define to 1 if sockets need to be shutdown]) ;; * ) AC_MSG_RESULT(no);;esacAC_C_BIGENDIANAC_HEADER_DIRENTAC_HEADER_TIMEAC_HEADER_SYS_WAITAC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \ unistd.h utime.h grp.h compat.h sys/param.h ctype.h sys/wait.h \ sys/ioctl.h sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h \ sys/un.h sys/attr.h mcheck.h arpa/inet.h arpa/nameser.h locale.h \ netdb.h malloc.h float.h limits.h iconv.h libcharset.h langinfo.h \ sys/acl.h acl/libacl.h attr/xattr.h sys/xattr.h sys/extattr.h \ popt.h popt/popt.h)AC_HEADER_MAJORAC_CACHE_CHECK([if makedev takes 3 args],rsync_cv_MAKEDEV_TAKES_3_ARGS,[AC_TRY_RUN([#include <sys/types.h>#ifdef MAJOR_IN_MKDEV#include <sys/mkdev.h># if !defined makedev && (defined mkdev || defined _WIN32 || defined __WIN32__)# define makedev mkdev# endif#elif defined MAJOR_IN_SYSMACROS#include <sys/sysmacros.h>#endifint main(void){ dev_t dev = makedev(0, 5, 7); if (major(dev) != 5 || minor(dev) != 7) exit(1); return 0;}],rsync_cv_MAKEDEV_TAKES_3_ARGS=yes,rsync_cv_MAKEDEV_TAKES_3_ARGS=no,rsync_cv_MAKEDEV_TAKES_3_ARGS=no)])if test x"$rsync_cv_MAKEDEV_TAKES_3_ARGS" = x"yes"; then AC_DEFINE(MAKEDEV_TAKES_3_ARGS, 1, [Define to 1 if makedev() takes 3 args])fiAC_CHECK_SIZEOF(int)AC_CHECK_SIZEOF(long)AC_CHECK_SIZEOF(long long)AC_CHECK_SIZEOF(short)AC_CHECK_SIZEOF(int16_t)AC_CHECK_SIZEOF(uint16_t)AC_CHECK_SIZEOF(int32_t)AC_CHECK_SIZEOF(uint32_t)AC_CHECK_SIZEOF(int64_t)AC_CHECK_SIZEOF(off_t)AC_CHECK_SIZEOF(off64_t)AC_CHECK_SIZEOF(time_t)AC_C_INLINEAC_C_LONG_DOUBLEAC_TYPE_SIGNALAC_TYPE_UID_TAC_CHECK_TYPES([mode_t,off_t,size_t,pid_t,id_t])AC_TYPE_GETGROUPSAC_CHECK_MEMBERS([struct stat.st_rdev])TYPE_SOCKLEN_TAC_CACHE_CHECK([for errno in errno.h],rsync_cv_errno, [ AC_TRY_COMPILE([#include <errno.h>],[int i = errno], rsync_cv_errno=yes,rsync_cv_have_errno_decl=no)])if test x"$rsync_cv_errno" = x"yes"; then AC_DEFINE(HAVE_ERRNO_DECL, 1, [Define to 1 if errno is declared in errno.h])fi# The following test taken from the cvs sources# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.# These need checks to be before checks for any other functions that# might be in the same libraries.# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has# libsocket.so which has a bad implementation of gethostbyname (it# only looks in /etc/hosts), so we only look for -lsocket if we need# it.AC_CHECK_FUNCS(connect)if test x"$ac_cv_func_connect" = x"no"; then case "$LIBS" in *-lnsl*) ;; *) AC_CHECK_LIB(nsl_s, printf) ;; esac case "$LIBS" in *-lnsl*) ;; *) AC_CHECK_LIB(nsl, printf) ;; esac case "$LIBS" in *-lsocket*) ;; *) AC_CHECK_LIB(socket, connect) ;; esac case "$LIBS" in *-linet*) ;; *) AC_CHECK_LIB(inet, connect) ;; esac dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value dnl has been cached. if test x"$ac_cv_lib_socket_connect" = x"yes" || test x"$ac_cv_lib_inet_connect" = x"yes"; then # ac_cv_func_connect=yes # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run AC_DEFINE(HAVE_CONNECT, 1, [Define to 1 if you have the "connect" function]) fifiAC_SEARCH_LIBS(inet_ntop, resolv)# Solaris and HP-UX weirdness:# Search for libiconv_open (not iconv_open) to discover if -liconv is needed!AC_SEARCH_LIBS(libiconv_open, iconv)AC_MSG_CHECKING([for iconv declaration])AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([#include <stdlib.h>#include <iconv.h>extern#ifdef __cplusplus"C"#endif#if defined(__STDC__) || defined(__cplusplus)size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);#elsesize_t iconv();#endif], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv)AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.])dnl AC_MSG_NOTICE([Looking in libraries: $LIBS])AC_CHECK_FUNCS(inet_ntop, , [AC_LIBOBJ(lib/inet_ntop)])AC_CHECK_FUNCS(inet_pton, , [AC_LIBOBJ(lib/inet_pton)])AC_HAVE_TYPE([struct addrinfo], [#include <netdb.h>])AC_HAVE_TYPE([struct sockaddr_storage], [#include <sys/types.h>#include <sys/socket.h>])# Irix 6.5 has getaddrinfo but not the corresponding defines, so use# builtin getaddrinfo if one of the defines don't existAC_CACHE_CHECK([whether defines needed by getaddrinfo exist], rsync_cv_HAVE_GETADDR_DEFINES,[ AC_EGREP_CPP(yes, [ #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #ifdef AI_PASSIVE yes #endif], rsync_cv_HAVE_GETADDR_DEFINES=yes, rsync_cv_HAVE_GETADDR_DEFINES=no)])if test x"$rsync_cv_HAVE_GETADDR_DEFINES" = x"yes" -a x"$ac_cv_type_struct_addrinfo" = x"yes"; then # Tru64 UNIX has getaddrinfo() but has it renamed in libc as # something else so we must include <netdb.h> to get the # redefinition. AC_CHECK_FUNCS(getaddrinfo, , [AC_MSG_CHECKING([for getaddrinfo by including <netdb.h>]) AC_TRY_LINK([#include <sys/types.h> #include <sys/socket.h> #include <netdb.h>],[getaddrinfo(NULL, NULL, NULL, NULL);], [AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_GETADDRINFO, 1, [Define to 1 if you have the "getaddrinfo" function and required types.])], [AC_MSG_RESULT([no]) AC_LIBOBJ(lib/getaddrinfo)])])else AC_LIBOBJ(lib/getaddrinfo)fiAC_CHECK_MEMBER([struct sockaddr.sa_len], [ AC_DEFINE(HAVE_SOCKADDR_LEN, 1, [Do we have sockaddr.sa_len?]) ], [], [#include <sys/types.h>#include <sys/socket.h>])AC_CHECK_MEMBER([struct sockaddr_in.sin_len], [ AC_DEFINE(HAVE_SOCKADDR_IN_LEN, 1, [Do we have sockaddr_in.sin_len?]) ], [], [#include <sys/types.h>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -