📄 configure.ac
字号:
# -*- Autoconf -*-# Process this file with autoconf to produce a configure script.AC_PREREQ(2.53)AC_INIT([librsync],[0.9.7])AC_REVISION([$Revision: 1.12 $])AC_COPYRIGHT([Copyright (C) 1999, 2000, 01, 02, 04 by Martin Pool <mbp@samba.org>])AC_CONFIG_SRCDIR([trace.c])AM_CONFIG_HEADER(config.h)AM_INIT_AUTOMAKE# GNU library versioning: This is NOT the librsync release number.# See libversions.txt and the libtool manual for an explanation of the# library versioninglibrsync_libversion=1:2:0# Disable shared libs by default.AC_DISABLE_SHARED# Checks for programs.AC_GNU_SOURCEAC_PROG_CCAC_ISC_POSIXAC_PROG_CPPAC_PROG_INSTALLAC_PROG_MAKE_SETAC_PROG_LIBTOOL# Checks for libraries.AC_CHECK_LIB(z, deflate)AC_CHECK_LIB(bz2, BZ2_bzCompress)AC_CHECK_LIB(popt, poptGetContext,,[BUILD_POPT='popt/libpopt.a'; CFLAGS="$CFLAGS -I$srcdir/popt"])# Checks for header files.AC_FUNC_ALLOCAAC_HEADER_STDCAC_CHECK_HEADERS([mcheck.h bzlib.h zlib.h])AC_CHECK_HEADERS([fcntl.h inttypes.h libintl.h limits.h malloc.h stdint.h stdlib.h string.h sys/file.h unistd.h])# Checks for typedefs, structures, and compiler characteristics.AC_C_CONSTAC_C_BIGENDIANAC_TYPE_SIZE_TAC_TYPE_OFF_TAC_SYS_LARGEFILEAC_CHECK_SIZEOF([unsigned char], 1)if test "$ac_cv_sizeof_unsigned_char" -ne 1; then AC_MSG_WARN(unsigned char seems to be $ac_cv_sizeof_unsigned_char bytes. Expect trouble.)fiAC_CHECK_SIZEOF(short)AC_CHECK_SIZEOF([unsigned short])AC_CHECK_SIZEOF(int)AC_CHECK_SIZEOF([unsigned int])AC_CHECK_SIZEOF(long)AC_CHECK_SIZEOF([unsigned long])AC_CHECK_SIZEOF([long long])AC_CHECK_SIZEOF(off_t)AC_CHECK_SIZEOF(size_t)#XXX: is this really the best way to do it? I think the limitation on# rs_long_t is that we need to be able to seek to it, which relates to# long file support. With fseeko, rs_long_t should be off_t, otherwise # it should be long.AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[#include <sys/types.h>#ifndef LONG_LONG#error not defined#endif]], [;])], [ RS_LONG_T='LONG_LONG' ], [ case "$ac_cv_sizeof_long_long" in 0) RS_LONG_T='long' ;; *) RS_LONG_T='long long' ;; esac ])AC_SUBST(RS_LONG_T)# Checks for library functions.#AC_FUNC_MALLOC #XXX: needs malloc.c replacement #AC_FUNC_MEMCMP #XXX: needs memcmp.c replacement#AC_FUNC_REALLOC #XXX: needs realloc.c replacementAC_FUNC_FSEEKOAC_CHECK_FUNCS([memmove memset strchr strerror strtol])AC_CHECK_FUNCS([gettext dgettext])AC_CHECK_FUNC(setreuid, [], [ AC_CHECK_LIB(ucb, setreuid, [ if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb"; USEUCB=y;fi])])# supply a snprintf and vsnprintf if the system doesn't have one.# if missing, check MSVC _xxx varients, otherwise use snprintf.c# replacement.AC_CHECK_FUNCS(snprintf,,[AC_CHECK_FUNCS(_snprintf)])AC_CHECK_FUNCS(vsnprintf,,[AC_CHECK_FUNCS(_vsnprintf,,[AC_LIBOBJ(snprintf)])])# Test if the compiler has the GNU feature of putting argv[0] into a globalAC_MSG_CHECKING([for program_invocation_short_name])AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[#include <errno.h>]], [[strlen(program_invocation_short_name)]])], [ AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,, [GNU extension of saving argv[0] to program_invocation_short_name]) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ])# Test if the preprocessor understands vararg macrosAC_MSG_CHECKING([for vararg macro support])AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#define func(a, b...) do {} while (0)], [func("a", "b", "c");func("a")])], [ AC_DEFINE(HAVE_VARARG_MACROS, , [Define if your cpp has vararg macros]) AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) ])if test "$GCC" = "yes"; then # GCC CFLAGS="-Wall -Wshadow -Wundef -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align $CFLAGS"elif test "$CC" = "cl"; then # MSVC CFLAGS="-Z7 -Od -MD $CFLAGS"fi# TODO: Similar conditions for other known compilers. For SUNWspro, use `-v'.AC_ARG_ENABLE(ccmalloc, AC_HELP_STRING([--enable-ccmalloc],[use ccmalloc debugger (default no)]), [ LIBS="$LIBS -lccmalloc -ldl" ])AC_ARG_ENABLE(trace, AC_HELP_STRING([--disable-trace],[turn off library tracing]), [enable_trace=$enableval],[enable_trace=yes])if test "$enable_trace" = "yes"; then AC_DEFINE(DO_RS_TRACE,,[Define this to enable trace code])fiAC_DEFINE_UNQUOTED(RS_LIBVERSION, "$librsync_libversion",[Version of the libtool interface.])AC_DEFINE_UNQUOTED(RS_CANONICAL_HOST, "$host",[Canonical GNU hostname])AC_SUBST(librsync_libversion)AC_SUBST(BUILD_POPT)AC_CONFIG_FILES([ Makefile doc/Makefile doc/Doxyfile popt/Makefile testsuite/Makefile librsync-config.h])AC_OUTPUT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -