📄 acinclude.m4
字号:
for var in CFLAGS CXXFLAGS CPPFLAGS LDFLAGS LIBS CC CXX; do eval val=\$$var if test -n "$val"; then echo "$var='$val' \\" >> $1 fi done for arg in [$]0 "[$]@"; do echo "'[$]arg' \\" >> $1 done echo '"[$]@"' >> $1 chmod +x $1])AC_DEFUN([PHP_TIME_R_TYPE],[AC_CACHE_CHECK(for type of reentrant time-related functions, ac_cv_time_r_type,[AC_TRY_RUN([#include <time.h>main() {char buf[27];struct tm t;time_t old = 0;int r, s;s = gmtime_r(&old, &t);r = (int) asctime_r(&t, buf, 26);if (r == s && s == 0) return (0);return (1);}],[ ac_cv_time_r_type=hpux],[ AC_TRY_RUN([#include <time.h>main() { struct tm t, *s; time_t old = 0; char buf[27], *p; s = gmtime_r(&old, &t); p = asctime_r(&t, buf, 26); if (p == buf && s == &t) return (0); return (1);} ],[ ac_cv_time_r_type=irix ],[ ac_cv_time_r_type=POSIX ])],[ ac_cv_time_r_type=POSIX])]) case $ac_cv_time_r_type in hpux[)] AC_DEFINE(PHP_HPUX_TIME_R,1,[Whether you have HP-UX 10.x]) ;; irix[)] AC_DEFINE(PHP_IRIX_TIME_R,1,[Whether you have IRIX-style functions]) ;; esac])AC_DEFUN([PHP_SUBST],[ PHP_VAR_SUBST="$PHP_VAR_SUBST $1"])AC_DEFUN([PHP_SUBST_OLD],[ PHP_SUBST($1) AC_SUBST($1)])AC_DEFUN([PHP_TM_GMTOFF],[AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,[AC_TRY_COMPILE([#include <sys/types.h>#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_gmtoff;], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)])if test "$ac_cv_struct_tm_gmtoff" = yes; then AC_DEFINE(HAVE_TM_GMTOFF,1,[whether you have tm_gmtoff in struct tm])fi])dnl PHP_CONFIGURE_PART(MESSAGE)dnl Idea borrowed from mmAC_DEFUN([PHP_CONFIGURE_PART],[ AC_MSG_RESULT() AC_MSG_RESULT([${T_MD}$1${T_ME}])])AC_DEFUN([PHP_PROG_SENDMAIL],[PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/libAC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:$PHP_ALT_PATH)if test -n "$PROG_SENDMAIL"; then AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail])fi])AC_DEFUN([PHP_RUNPATH_SWITCH],[dnl check for -R, etc. switchAC_MSG_CHECKING([if compiler supports -R])AC_CACHE_VAL(php_cv_cc_dashr,[ SAVE_LIBS=$LIBS LIBS="-R /usr/lib $LIBS" AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no) LIBS=$SAVE_LIBS])AC_MSG_RESULT([$php_cv_cc_dashr])if test $php_cv_cc_dashr = "yes"; then ld_runpath_switch=-Relse AC_MSG_CHECKING([if compiler supports -Wl,-rpath,]) AC_CACHE_VAL(php_cv_cc_rpath,[ SAVE_LIBS=$LIBS LIBS="-Wl,-rpath,/usr/lib $LIBS" AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no) LIBS=$SAVE_LIBS]) AC_MSG_RESULT([$php_cv_cc_rpath]) if test $php_cv_cc_rpath = "yes"; then ld_runpath_switch=-Wl,-rpath, else dnl something innocuous ld_runpath_switch=-L fifi])AC_DEFUN([PHP_STRUCT_FLOCK],[AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock, AC_TRY_COMPILE([#include <unistd.h>#include <fcntl.h> ], [struct flock x;], [ ac_cv_struct_flock=yes ],[ ac_cv_struct_flock=no ]))if test "$ac_cv_struct_flock" = "yes" ; then AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock])fi])AC_DEFUN([PHP_SOCKLEN_T],[AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t, AC_TRY_COMPILE([#include <sys/types.h>#include <sys/socket.h>],[socklen_t x;],[ ac_cv_socklen_t=yes],[ ac_cv_socklen_t=no]))if test "$ac_cv_socklen_t" = "yes"; then AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t])fi])dnldnl PHP_SET_SYM_FILE(path)dnldnl set the path of the file which contains the symbol export listdnlAC_DEFUN([PHP_SET_SYM_FILE],[ PHP_SYM_FILE=$1])dnldnl PHP_BUILD_THREAD_SAFEdnlAC_DEFUN([PHP_BUILD_THREAD_SAFE],[ enable_experimental_zts=yes if test "$pthreads_working" != "yes"; then AC_MSG_ERROR([ZTS currently requires working POSIX threads. We were unable to verify that your system supports Pthreads.]) fi])AC_DEFUN([PHP_REQUIRE_CXX],[ if test -z "$php_cxx_done"; then AC_PROG_CXX AC_PROG_CXXCPP php_cxx_done=yes fi])dnldnl PHP_BUILD_SHAREDdnlAC_DEFUN([PHP_BUILD_SHARED],[ PHP_BUILD_PROGRAM OVERALL_TARGET=libphp4.la php_build_target=shared php_c_pre=$shared_c_pre php_c_meta=$shared_c_meta php_c_post=$shared_c_post php_cxx_pre=$shared_cxx_pre php_cxx_meta=$shared_cxx_meta php_cxx_post=$shared_cxx_post php_lo=$shared_lo])dnldnl PHP_BUILD_STATICdnlAC_DEFUN([PHP_BUILD_STATIC],[ PHP_BUILD_PROGRAM OVERALL_TARGET=libphp4.la php_build_target=static])dnldnl PHP_BUILD_BUNDLEdnlAC_DEFUN([PHP_BUILD_BUNDLE],[ PHP_BUILD_PROGRAM OVERALL_TARGET=libs/libphp4.bundle php_build_target=static])dnldnl PHP_BUILD_PROGRAMdnlAC_DEFUN([PHP_BUILD_PROGRAM],[ OVERALL_TARGET=[]ifelse($1,,php,$1) php_c_pre='$(CC)' php_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)' php_c_post=' && echo > $[@]' php_cxx_pre='$(CXX)' php_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS)' php_cxx_post=' && echo > $[@]' php_lo=o shared_c_pre='$(LIBTOOL) --mode=compile $(CC)' shared_c_meta='$(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -prefer-pic' shared_c_post= shared_cxx_pre='$(LIBTOOL) --mode=compile $(CXX)' shared_cxx_meta='$(COMMON_FLAGS) $(CXXFLAGS_CLEAN) $(EXTRA_CXXFLAGS) -prefer-pic' shared_cxx_post= shared_lo=lo php_build_target=program])dnldnl PHP_RUN_ONCE(namespace, variable, code)dnldnl execute code, if variable is not set in namespacednlAC_DEFUN([PHP_RUN_ONCE],[ changequote({,}) unique=`echo $2|sed 's/[^a-zA-Z0-9]/_/g'` changequote([,]) cmd="echo $ac_n \"\$$1$unique$ac_c\"" if test -n "$unique" && test "`eval $cmd`" = "" ; then eval "$1$unique=set" $3 fi])dnldnl PHP_EXPAND_PATH(path, variable)dnldnl expands path to an absolute path and assigns it to variablednlAC_DEFUN([PHP_EXPAND_PATH],[ if test -z "$1" || echo "$1" | grep '^/' >/dev/null ; then $2=$1 else changequote({,}) ep_dir="`echo $1|sed 's%/*[^/][^/]*/*$%%'`" changequote([,]) ep_realdir="`(cd \"$ep_dir\" && pwd)`" $2="$ep_realdir/`basename \"$1\"`" fi])dnldnl internal, don't useAC_DEFUN([_PHP_ADD_LIBPATH_GLOBAL],[ PHP_RUN_ONCE(LIBPATH, $1, [ test -n "$ld_runpath_switch" && LDFLAGS="$LDFLAGS $ld_runpath_switch$1" LDFLAGS="$LDFLAGS -L$1" PHP_RPATHS="$PHP_RPATHS $1" ])])dnldnldnldnldnl PHP_ADD_LIBPATH(path[, shared-libadd])dnldnl add a library to linkpath/runpathdnlAC_DEFUN([PHP_ADD_LIBPATH],[ if test "$1" != "/usr/lib"; then PHP_EXPAND_PATH($1, ai_p) ifelse([$2],,[ _PHP_ADD_LIBPATH_GLOBAL([$ai_p]) ],[ if test "$ext_shared" = "yes"; then $2="$ld_runpath_switch$ai_p -L$ai_p [$]$2" else _PHP_ADD_LIBPATH_GLOBAL([$ai_p]) fi ]) fi])dnldnl PHP_UTILIZE_RPATHS()dnldnl builds RPATHS/LDFLAGS from PHP_RPATHSdnlAC_DEFUN([PHP_UTILIZE_RPATHS],[ OLD_RPATHS=$PHP_RPATHS unset PHP_RPATHS for i in $OLD_RPATHS; dodnl Can be passed to native cc/libtool PHP_LDFLAGS="$PHP_LDFLAGS -L$i"dnl Libtool-specific PHP_RPATHS="$PHP_RPATHS -R $i"dnl cc-specific NATIVE_RPATHS="$NATIVE_RPATHS $ld_runpath_switch$i" done if test "$PHP_RPATH" = "no"; then unset PHP_RPATHS unset NATIVE_RPATHS fi])dnldnl PHP_ADD_INCLUDE(path [,before])dnldnl add an include path. dnl if before is 1, add in the beginning of INCLUDES.dnlAC_DEFUN([PHP_ADD_INCLUDE],[ if test "$1" != "/usr/include"; then PHP_EXPAND_PATH($1, ai_p) PHP_RUN_ONCE(INCLUDEPATH, $ai_p, [ if test "$2"; then INCLUDES="-I$ai_p $INCLUDES" else INCLUDES="$INCLUDES -I$ai_p" fi ]) fi])dnldnl internal, don't useAC_DEFUN([_PHP_X_ADD_LIBRARY],[dnl ifelse([$2],,$3="-l$1 [$]$3", $3="[$]$3 -l$1") dnl])dnldnldnl internal, don't useAC_DEFUN([_PHP_ADD_LIBRARY_SKELETON],[ case $1 in c|c_r|pthread*[)] ;; *[)] ifelse($3,,[ _PHP_X_ADD_LIBRARY($1,$2,$5) ],[ if test "$ext_shared" = "yes"; then _PHP_X_ADD_LIBRARY($1,$2,$3) else $4($1,$2) fi ]) ;; esac])dnldnldnldnldnl PHP_ADD_LIBRARY(library[, append[, shared-libadd]])dnldnl add a library to the link linednlAC_DEFUN([PHP_ADD_LIBRARY],[ _PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY],[LIBS])])dnldnl PHP_ADD_LIBRARY_DEFER(library[, append[, shared-libadd]])dnldnl add a library to the link line (deferred)dnlAC_DEFUN([PHP_ADD_LIBRARY_DEFER],[ _PHP_ADD_LIBRARY_SKELETON([$1],[$2],[$3],[PHP_ADD_LIBRARY_DEFER],[DLIBS])])dnldnl PHP_ADD_LIBRARY_WITH_PATH(library, path[, shared-libadd])dnldnl add a library to the link line and path to linkpath/runpath.dnl if shared-libadd is not empty and $ext_shared is yes,dnl shared-libadd will be assigned the library informationdnlAC_DEFUN([PHP_ADD_LIBRARY_WITH_PATH],[ifelse($3,,[ if test -n "$2"; then PHP_ADD_LIBPATH($2) fi PHP_ADD_LIBRARY($1)],[ if test "$ext_shared" = "yes"; then $3="-l$1 [$]$3" if test -n "$2"; then PHP_ADD_LIBPATH($2,$3) fi else PHP_ADD_LIBRARY_WITH_PATH($1,$2) fi])])dnldnl PHP_ADD_LIBRARY_DEFER_WITH_PATH(library, path[, shared-libadd])dnldnl add a library to the link line (deferred)dnl and path to linkpath/runpath (not deferred)dnl if shared-libadd is not empty and $ext_shared is yes,dnl shared-libadd will be assigned the library informationdnlAC_DEFUN([PHP_ADD_LIBRARY_DEFER_WITH_PATH],[ifelse($3,,[ if test -n "$2"; then PHP_ADD_LIBPATH($2) fi PHP_ADD_LIBRARY_DEFER($1)],[ if test "$ext_shared" = "yes"; then $3="-l$1 [$]$3" if test -n "$2"; then PHP_ADD_LIBPATH($2,$3) fi else PHP_ADD_LIBRARY_DEFER_WITH_PATH($1,$2) fi])])dnldnl PHP_ADD_FRAMEWORK(framework [,before])dnldnl add a (Darwin / Mac OS X) framework to the linkdnl line. if before is 1, the framework is addeddnl to the beginning of the line.AC_DEFUN([PHP_ADD_FRAMEWORK], [ PHP_RUN_ONCE(FRAMEWORKS, $1, [ if test "$2"; then PHP_FRAMEWORKS="-framework $1 $PHP_FRAMEWORKS" else PHP_FRAMEWORKS="$PHP_FRAMEWORKS -framework $1" fi ])])dnldnl PHP_ADD_FRAMEWORKPATH(path [,before])dnldnl add a (Darwin / Mac OS X) framework path to the linkdnl and include lines. default paths include (but arednl not limited to) /Local/Library/Frameworks anddnl /System/Library/Frameworks, so these don't needdnl to be specifically added. if before is 1, thednl framework path is added to the beginning of thednl relevant lines.AC_DEFUN([PHP_ADD_FRAMEWORKPATH], [ PHP_EXPAND_PATH($1, ai_p) PHP_RUN_ONCE(FRAMEWORKPATH, $ai_p, [ if test "$2"; then PHP_FRAMEWORKPATH="-F$ai_p $PHP_FRAMEWORKPATH" else PHP_FRAMEWORKPATH="$PHP_FRAMEWORKPATH -F$ai_p" fi ])])dnldnl PHP_ADD_FRAMEWORK_WITH_PATH(framework, path)dnldnl add a (Darwin / Mac OS X) framework path and thednl framework itself to the link and include lines.AC_DEFUN([PHP_ADD_FRAMEWORK_WITH_PATH], [ PHP_ADD_FRAMEWORKPATH($2) PHP_ADD_FRAMEWORK($1)])dnldnl Set libtool variablednlAC_DEFUN([PHP_SET_LIBTOOL_VARIABLE],[ if test -z "$LIBTOOL"; then LIBTOOL='$(SHELL) $(top_builddir)/libtool $1' else LIBTOOL="$LIBTOOL $1" fi])dnldnl Check for cc optiondnlAC_DEFUN([PHP_CHECK_CC_OPTION],[ echo "main(){return 0;}" > conftest.$ac_ext opt=$1 changequote({,}) var=`echo $opt|sed 's/[^a-zA-Z0-9]/_/g'` changequote([,]) AC_MSG_CHECKING([if compiler supports -$1 really]) ac_php_compile="${CC-cc} -$opt -o conftest $CFLAGS $CPPFLAGS conftest.$ac_ext 2>&1" if eval $ac_php_compile 2>&1 | egrep "$opt" > /dev/null 2>&1 ; then eval php_cc_$var=no AC_MSG_RESULT([no]) else if eval ./conftest 2>/dev/null ; then eval php_cc_$var=yes AC_MSG_RESULT([yes]) else eval php_cc_$var=no AC_MSG_RESULT([no]) fi fi])AC_DEFUN([PHP_REGEX],[if test "$REGEX_TYPE" = "php"; then AC_DEFINE(HSREGEX,1,[ ]) AC_DEFINE(REGEX,1,[ ]) PHP_ADD_SOURCES(regex, regcomp.c regexec.c regerror.c regfree.c)elif test "$REGEX_TYPE" = "system"; then AC_DEFINE(REGEX,0,[ ])fiAC_MSG_CHECKING([which regex library to use])AC_MSG_RESULT([$REGEX_TYPE])])dnldnl See if we have broken header files like SunOS has.dnlAC_DEFUN([PHP_MISSING_FCLOSE_DECL],[ AC_MSG_CHECKING([for fclose declaration]) AC_TRY_COMPILE([#include <stdio.h>],[int (*func)() = fclose],[ AC_DEFINE(MISSING_FCLOSE_DECL,0,[ ]) AC_MSG_RESULT([ok]) ],[ AC_DEFINE(MISSING_FCLOSE_DECL,1,[ ]) AC_MSG_RESULT([missing]) ])])dnldnl Check for broken sprintf(), C99 conformancednlAC_DEFUN([PHP_AC_BROKEN_SPRINTF],[ AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[ AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[ ac_cv_broken_sprintf=no ],[ ac_cv_broken_sprintf=yes ],[ ac_cv_broken_sprintf=no ]) ]) if test "$ac_cv_broken_sprintf" = "yes"; then AC_DEFINE(PHP_BROKEN_SPRINTF, 1, [Whether sprintf is C99 conform]) else AC_DEFINE(PHP_BROKEN_SPRINTF, 0, [Whether sprintf is C99 conform]) fi])dnldnl Check for broken snprintf(), C99 conformancednlAC_DEFUN([PHP_AC_BROKEN_SNPRINTF],[ AC_CACHE_CHECK(whether snprintf is broken, ac_cv_broken_snprintf,[ AC_TRY_RUN([#define NULL (0L)main() { char buf[20]; int res = 0; res = res || (snprintf(buf, 2, "marcus") != 6); res = res || (buf[1] != '\0'); /* Implementations may consider this as an encoding error */ snprintf(buf, 0, "boerger"); /* However, they MUST ignore the pointer */ res = res || (buf[0] != 'm'); res = res || (snprintf(NULL, 0, "boerger") != 7); res = res || (snprintf(buf, sizeof(buf), "%f", 0.12345678) != 8); exit(res); } ],[ ac_cv_broken_snprintf=no ],[ ac_cv_broken_snprintf=yes ],[ ac_cv_broken_snprintf=no
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -