aclocal.m4

来自「监控软件rrdtools」· M4 代码 · 共 2,521 行 · 第 1/5 页

M4
2,521 行
字号
choke me#endif],[have_broken_glibc_fopen_append=yes],[have_broken_glibc_fopen_append=no ]))])  if test "$have_broken_glibc_fopen_append" = "yes"; then	AC_MSG_RESULT(yes)	AC_DEFINE(HAVE_BROKEN_GLIBC_FOPEN_APPEND,1, [Define if your glibc borks on fopen with mode a+])  else	AC_MSG_RESULT(no)  fi])AC_DEFUN([PHP_FOPENCOOKIE],[	AC_CHECK_FUNC(fopencookie, [ have_glibc_fopencookie=yes ])	if test "$have_glibc_fopencookie" = "yes" ; then	  	dnl this comes in two flavors:      dnl newer glibcs (since 2.1.2 ? )      dnl have a type called cookie_io_functions_t		  AC_TRY_COMPILE([ #define _GNU_SOURCE                       #include <stdio.h>									   ],	                   [ cookie_io_functions_t cookie; ],                     [ have_cookie_io_functions_t=yes ],										 [] )      if test "$have_cookie_io_functions_t" = "yes" ; then        cookie_io_functions_t=cookie_io_functions_t        have_fopen_cookie=yes		dnl even newer glibcs have a different seeker definition...		AC_TRY_RUN([#define _GNU_SOURCE#include <stdio.h>struct cookiedata {	__off64_t pos;};__ssize_t reader(void *cookie, char *buffer, size_t size){ return size; }__ssize_t writer(void *cookie, const char *buffer, size_t size){ return size; }int closer(void *cookie){ return 0; }int seeker(void *cookie, __off64_t *position, int whence){ ((struct cookiedata*)cookie)->pos = *position; return 0; }cookie_io_functions_t funcs = {reader, writer, seeker, closer};main() {  struct cookiedata g = { 0 };  FILE *fp = fopencookie(&g, "r", funcs);  if (fp && fseek(fp, 8192, SEEK_SET) == 0 && g.pos == 8192)	  exit(0);  exit(1);}					   ],					   [ cookie_io_functions_use_off64_t=yes ],					   [ ] )		      else  	    dnl older glibc versions (up to 2.1.2 ?)        dnl call it _IO_cookie_io_functions_t		    AC_TRY_COMPILE([ #define _GNU_SOURCE                       #include <stdio.h>									   ],	                   [ _IO_cookie_io_functions_t cookie; ],                     [ have_IO_cookie_io_functions_t=yes ],										 [] )		    if test "$have_cookie_io_functions_t" = "yes" ; then              cookie_io_functions_t=_IO_cookie_io_functions_t              have_fopen_cookie=yes		    fi      fi      if test "$have_fopen_cookie" = "yes" ; then        AC_DEFINE(HAVE_FOPENCOOKIE, 1, [ ])        AC_DEFINE_UNQUOTED(COOKIE_IO_FUNCTIONS_T, $cookie_io_functions_t, [ ])		if test "$cookie_io_functions_use_off64_t" = "yes" ; then          AC_DEFINE(COOKIE_SEEKER_USES_OFF64_T, 1, [ ])		fi      fi        	fi])dnldnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-ldflags]]])dnldnl Wrapper for AC_CHECK_LIBdnlAC_DEFUN([PHP_CHECK_LIBRARY], [  save_old_LDFLAGS=$LDFLAGS  ac_stuff="$5"    save_ext_shared=$ext_shared  ext_shared=yes  PHP_EVAL_LIBLINE([$]ac_stuff, LDFLAGS)  AC_CHECK_LIB([$1],[$2],[    LDFLAGS=$save_old_LDFLAGS    ext_shared=$save_ext_shared    $3  ],[    LDFLAGS=$save_old_LDFLAGS    ext_shared=$save_ext_shared    unset ac_cv_func_$1    $4  ])dnl])dnldnl PHP_CHECK_FRAMEWORK(framework, function [, action-found [, action-not-found ]])dnldnl El cheapo wrapper for AC_CHECK_LIBdnlAC_DEFUN([PHP_CHECK_FRAMEWORK], [  save_old_LDFLAGS=$LDFLAGS  LDFLAGS="-framework $1 $LDFLAGS"  dnl supplying "c" to AC_CHECK_LIB is technically cheating, but  dnl rewriting AC_CHECK_LIB is overkill and this only affects  dnl the "checking.." output anyway.  AC_CHECK_LIB(c,[$2],[    LDFLAGS=$save_old_LDFLAGS    $3  ],[    LDFLAGS=$save_old_LDFLAGS    $4  ])])dnl dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]])dnldnl Common setup macro for iconvdnlAC_DEFUN([PHP_SETUP_ICONV], [  found_iconv=no  unset ICONV_DIR  dnl  dnl Check libc first if no path is provided in --with-iconv  dnl  if test "$PHP_ICONV" = "yes"; then    AC_CHECK_FUNC(iconv, [      PHP_DEFINE(HAVE_ICONV)      found_iconv=yes    ],[      AC_CHECK_FUNC(libiconv,[        PHP_DEFINE(HAVE_LIBICONV)        found_iconv=yes      ])    ])  fi  dnl  dnl Check external libs for iconv funcs  dnl  if test "$found_iconv" = "no"; then    for i in $PHP_ICONV /usr/local /usr; do      if test -r $i/include/giconv.h; then        AC_DEFINE(HAVE_GICONV_H, 1, [ ])        ICONV_DIR=$i        iconv_lib_name=giconv        break      elif test -r $i/include/iconv.h; then        ICONV_DIR=$i        iconv_lib_name=iconv        break      fi    done    if test -z "$ICONV_DIR"; then      AC_MSG_ERROR([Please specify the install prefix of iconv with --with-iconv=<DIR>])    fi      if test -f $ICONV_DIR/lib/lib$iconv_lib_name.a ||       test -f $ICONV_DIR/lib/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME    then      PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [        found_iconv=yes        PHP_DEFINE(HAVE_LIBICONV)      ], [        PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [          found_iconv=yes          PHP_DEFINE(HAVE_ICONV)        ], [], [          -L$ICONV_DIR/lib        ])      ], [        -L$ICONV_DIR/lib      ])    fi  fi  if test "$found_iconv" = "yes"; then    if test -n "$ICONV_DIR"; then      AC_DEFINE(HAVE_ICONV, 1, [ ])      PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/lib, $1)      PHP_ADD_INCLUDE($ICONV_DIR/include)    fi    $2ifelse([$3],[],,[else $3])  fi])AC_DEFUN([PHP_DEF_HAVE],[AC_DEFINE([HAVE_]translit($1,a-z_-,A-Z__), 1, [ ])])dnldnl PHP_CHECK_FUNC_LIB(func, libs)dnl This macro checks whether 'func' or '__func' existsdnl in the specified library.dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS.dnl This should be called in the ACTION-IF-NOT-FOUND part of PHP_CHECK_FUNCdnldnl autoconf undefines the builtin "shift" :-(dnl If possible, we use the builtin shift anyway, otherwise we usednl the ubercool definition I have tested so far with FreeBSD/GNU m4ifdef([builtin],[builtin(define, phpshift, [builtin(shift, $@)])],[define([phpshift],[ifelse(index([$@],[,]),-1,,[substr([$@],incr(index([$@],[,])))])])])AC_DEFUN([PHP_CHECK_FUNC_LIB],[  ifelse($2,,:,[  unset ac_cv_lib_$2[]_$1  unset ac_cv_lib_$2[]___$1  unset found  AC_CHECK_LIB($2, $1, [found=yes], [    AC_CHECK_LIB($2, __$1, [found=yes], [found=no])  ])  if test "$found" = "yes"; then    ac_libs=$LIBS    LIBS="$LIBS -l$2"    AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no])    LIBS=$ac_libs  fi  if test "$found" = "yes"; then    PHP_ADD_LIBRARY($2)    PHP_DEF_HAVE($1)    PHP_DEF_HAVE(lib$2)    ac_cv_func_$1=yes  else    PHP_CHECK_FUNC_LIB($1,phpshift(phpshift($@)))  fi  ])])dnldnl PHP_CHECK_FUNC(func, ...)dnl This macro checks whether 'func' or '__func' existsdnl in the default libraries and as a fall back in the specified library.dnl Defines HAVE_func and HAVE_library if found and adds the library to LIBS.dnlAC_DEFUN([PHP_CHECK_FUNC],[  unset ac_cv_func_$1  unset ac_cv_func___$1  unset found    AC_CHECK_FUNC($1, [found=yes],[ AC_CHECK_FUNC(__$1,[found=yes],[found=no]) ])  case $found in  yes[)]     PHP_DEF_HAVE($1)    ac_cv_func_$1=yes  ;;  ifelse($#,1,,[    *[)] PHP_CHECK_FUNC_LIB($@) ;;  ])  esac])dnldnl PHP_AP_EXTRACT_VERSION(/path/httpd)dnl This macro is used to get a comparablednl version for apache1/2.dnlAC_DEFUN([PHP_AP_EXTRACT_VERSION],[  ac_output=`$1 -v 2>&1`  ac_IFS=$IFSIFS="- /."  set $ac_output  IFS=$ac_IFS  APACHE_VERSION=`expr [$]4 \* 1000000 + [$]5 \* 1000 + [$]6`])# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-# serial 46 AC_PROG_LIBTOOLAC_DEFUN([AC_PROG_LIBTOOL],[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl# This can be used to rebuild libtool when neededLIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"# Always use our own libtool.LIBTOOL='$(SHELL) $(top_builddir)/libtool'AC_SUBST(LIBTOOL)dnl# Prevent multiple expansiondefine([AC_PROG_LIBTOOL], [])])AC_DEFUN([AC_LIBTOOL_SETUP],[AC_PREREQ(2.13)dnlAC_REQUIRE([AC_ENABLE_SHARED])dnlAC_REQUIRE([AC_ENABLE_STATIC])dnlAC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnlAC_REQUIRE([AC_CANONICAL_HOST])dnlAC_REQUIRE([AC_CANONICAL_BUILD])dnlAC_REQUIRE([AC_PROG_CC])dnlAC_REQUIRE([AC_PROG_LD])dnlAC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnlAC_REQUIRE([AC_PROG_NM])dnlAC_REQUIRE([LT_AC_PROG_SED])dnlAC_REQUIRE([AC_PROG_LN_S])dnlAC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnlAC_REQUIRE([AC_OBJEXT])dnlAC_REQUIRE([AC_EXEEXT])dnldnl_LT_AC_PROG_ECHO_BACKSLASH# Only perform the check for file, if the check method requires itcase $deplibs_check_method infile_magic*)  if test "$file_magic_cmd" = '$MAGIC_CMD'; then    AC_PATH_MAGIC  fi  ;;esacAC_CHECK_TOOL(RANLIB, ranlib, :)AC_CHECK_TOOL(STRIP, strip, :)ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],enable_win32_dll=yes, enable_win32_dll=no)AC_ARG_ENABLE(libtool-lock,  [  --disable-libtool-lock  avoid locking (might break parallel builds)])test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes# Some flags need to be propagated to the compiler or linker for good# libtool support.case $host in*-*-irix6*)  # Find out which ABI we are using.  echo '[#]line __oline__ "configure"' > conftest.$ac_ext  if AC_TRY_EVAL(ac_compile); then    case `/usr/bin/file conftest.$ac_objext` in    *32-bit*)      LD="${LD-ld} -32"      ;;    *N32*)      LD="${LD-ld} -n32"      ;;    *64-bit*)      LD="${LD-ld} -64"      ;;    esac  fi  rm -rf conftest*  ;;*-*-sco3.2v5*)  # On SCO OpenServer 5, we need -belf to get full-featured binaries.  SAVE_CFLAGS="$CFLAGS"  CFLAGS="$CFLAGS -belf"  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,    [AC_LANG_SAVE     AC_LANG_C     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])     AC_LANG_RESTORE])  if test x"$lt_cv_cc_needs_belf" != x"yes"; then    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf    CFLAGS="$SAVE_CFLAGS"  fi  ;;ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],[*-*-cygwin* | *-*-mingw* | *-*-pw32*)  AC_CHECK_TOOL(DLLTOOL, dlltool, false)  AC_CHECK_TOOL(AS, as, false)  AC_CHECK_TOOL(OBJDUMP, objdump, false)  # recent cygwin and mingw systems supply a stub DllMain which the user  # can override, but on older systems we have to supply one  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,    [AC_TRY_LINK([],      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);      DllMain (0, 0, 0);],      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])  case $host/$CC in  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)    # old mingw systems require "-dll" to link a DLL, while more recent ones    # require "-mdll"    SAVE_CFLAGS="$CFLAGS"    CFLAGS="$CFLAGS -mdll"    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])    CFLAGS="$SAVE_CFLAGS" ;;  *-*-cygwin* | *-*-pw32*)    # cygwin systems need to pass --dll to the linker, and not link    # crt.o which will require a WinMain@16 definition.    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;  esac  ;;  ])esac_LT_AC_LTCONFIG_HACK])# AC_LIBTOOL_HEADER_ASSERT# ------------------------AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],[AC_CACHE_CHECK([whether $CC supports assert without backlinking],    [lt_cv_func_assert_works],    [case $host in    *-*-solaris*)      if test "$GCC" = yes && test "$with_gnu_ld" != yes; then        case `$CC --version 2>/dev/null` in        [[12]].*) lt_cv_func_assert_works=no ;;        *)        lt_cv_func_assert_works=yes ;;        esac      fi      ;;    esac])if test "x$lt_cv_func_assert_works" = xyes; then  AC_CHECK_HEADERS(assert.h)fi])# AC_LIBTOOL_HEADER_ASSERT# _LT_AC_CHECK_DLFCN# --------------------AC_DEFUN([_LT_AC_CHECK_DLFCN],[AC_CHECK_HEADERS(dlfcn.h)])# _LT_AC_CHECK_DLFCN# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE# ---------------------------------AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],[AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_PROG_NM])AC_REQUIRE([AC_OBJEXT])# Check for command to grab the raw symbol name followed by C symbol from nm.AC_MSG_CHECKING([command to parse $NM output])AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl# These are sane defaults that work on at least a few old systems.# [They come from Ultrix.  What could be older than Ultrix?!! ;)]# Character class describing NM global symbol codes.symcode='[[BCDEGRST]]'# Regexp to match symbols that can be accessed directly from C.sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'# Transform the above into a raw symbol and a C symbol.symxfrm='\1 \2\3 \3'# Transform an extracted symbol line into a proper C declarationlt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"# Transform an extracted symbol line into symbol name and symbol addresslt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"# Define system-specific variables.case $host_os inaix*)  symcode='[[BCDT]]'  ;;cygwin* | mingw* | pw32*)  symcode='[[ABCDGISTW]]'  ;;hpux*) # Its linker distinguishes data from code symbols  lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"  lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"  ;;irix* | nonstopux*)  symcode='[[BCDEGRST]]'  ;;osf*)  symcode='[[BCDEGQRST]]'  ;;solaris* | sysv5*)

⌨️ 快捷键说明

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