aclocal.m4
来自「监控软件rrdtools」· M4 代码 · 共 2,521 行 · 第 1/5 页
M4
2,521 行
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 ]) ]) if test "$ac_cv_broken_snprintf" = "yes"; then AC_DEFINE(PHP_BROKEN_SNPRINTF, 1, [Whether snprintf is C99 conform]) else AC_DEFINE(PHP_BROKEN_SNPRINTF, 0, [Whether snprintf is C99 conform]) fi])dnl PHP_SHARED_MODULE(module-name, object-var, build-dir)dnldnl Basically sets up the link-stage for building module-namednl from object_var in build-dir.dnlAC_DEFUN([PHP_SHARED_MODULE],[ PHP_MODULES="$PHP_MODULES \$(phplibdir)/$1.la" PHP_SUBST($2) cat >>Makefile.objects<<EOF\$(phplibdir)/$1.la: $3/$1.la \$(LIBTOOL) --mode=install cp $3/$1.la \$(phplibdir)$3/$1.la: \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_DEPENDENCIES) \$(LIBTOOL) --mode=link \$(CC) \$(COMMON_FLAGS) \$(CFLAGS_CLEAN) \$(EXTRA_CFLAGS) \$(LDFLAGS) -o \[$]@ -export-dynamic -avoid-version -prefer-pic -module -rpath \$(phplibdir) \$(EXTRA_LDFLAGS) \$($2) \$(translit($1,a-z_-,A-Z__)_SHARED_LIBADD)EOF])dnldnl PHP_SELECT_SAPI(name, type[, sources [, extra-cflags [, build-target]]])dnldnl Selects the SAPI name and type (static, shared, programm)dnl and optionally also the source-files for the SAPI-specificdnl objects.dnlAC_DEFUN([PHP_SELECT_SAPI],[ PHP_SAPI=$1 case "$2" in static[)] PHP_BUILD_STATIC;; shared[)] PHP_BUILD_SHARED;; bundle[)] PHP_BUILD_BUNDLE;; program[)] PHP_BUILD_PROGRAM($5);; esac ifelse($3,,,[PHP_ADD_SOURCES([sapi/$1],[$3],[$4],[sapi])])])dnl deprecatedAC_DEFUN([PHP_EXTENSION],[ sources=`$AWK -f $abs_srcdir/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in` PHP_NEW_EXTENSION($1, $sources, $2, $3) if test -r "$ext_srcdir/Makefile.frag"; then PHP_ADD_MAKEFILE_FRAGMENT fi])AC_DEFUN([PHP_ADD_BUILD_DIR],[ BUILD_DIR="$BUILD_DIR $1"])AC_DEFUN([PHP_GEN_BUILD_DIRS],[ $php_shtool mkdir -p $BUILD_DIR])dnldnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags]]])dnldnl Includes an extension in the build.dnldnl "extname" is the name of the ext/ subdir where the extension resides.dnl "sources" is a list of files relative to the subdir which are useddnl to build the extension.dnl "shared" can be set to "shared" or "yes" to build the extension asdnl a dynamically loadable library. Optional parameter "sapi_class" candnl be set to "cli" to mark extension build only with CLI or CGI sapi's.dnl extra-cflags are passed to the compiler, with @ext_srcdir@ beingdnl substituted.AC_DEFUN([PHP_NEW_EXTENSION],[ ext_builddir=[]PHP_EXT_BUILDDIR($1) ext_srcdir=[]PHP_EXT_SRCDIR($1) ifelse($5,,ac_extra=,[ac_extra=`echo "$5"|sed s#@ext_srcdir@#$ext_srcdir#g`]) if test "$3" != "shared" && test "$3" != "yes" && test "$4" != "cli"; thendnl ---------------------------------------------- Static module PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,) EXT_STATIC="$EXT_STATIC $1" if test "$3" != "nocli"; then EXT_CLI_STATIC="$EXT_CLI_STATIC $1" fi else if test "$3" = "shared" || test "$3" = "yes"; thendnl ---------------------------------------------- Shared module PHP_ADD_SOURCES_X(PHP_EXT_DIR($1),$2,$ac_extra,shared_objects_$1,yes) PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir) AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to build $1 as dynamic module) fi fi if test "$3" != "shared" && test "$3" != "yes" && test "$4" = "cli"; thendnl ---------------------------------------------- CLI static module if test "$PHP_SAPI" = "cgi"; then PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,) EXT_STATIC="$EXT_STATIC $1" else PHP_ADD_SOURCES(PHP_EXT_DIR($1),$2,$ac_extra,cli) fi EXT_CLI_STATIC="$EXT_CLI_STATIC $1" fi PHP_ADD_BUILD_DIR($ext_builddir)])dnldnl Solaris requires main code to be position independent in orderdnl to let shared objects find symbols. Weird. Ugly.dnldnl Must be run after all --with-NN options that let the userdnl choose dynamic extensions, and after the gcc test.dnlAC_DEFUN([PHP_SOLARIS_PIC_WEIRDNESS],[ AC_MSG_CHECKING([whether -fPIC is required]) if test -n "$EXT_SHARED"; then os=`uname -sr 2>/dev/null` case $os in "SunOS 5.6"|"SunOS 5.7"[)] case $CC in gcc*|egcs*) CFLAGS="$CFLAGS -fPIC";; *[)] CFLAGS="$CFLAGS -fpic";; esac AC_MSG_RESULT([yes]);; *[)] AC_MSG_RESULT([no]);; esac else AC_MSG_RESULT([no]) fi])dnldnl Checks whether $withval is "shared" or starts with "shared,XXX"dnl and sets $shared to "yes" or "no", and removes "shared,?" stuffdnl from $withval.dnlAC_DEFUN([PHP_WITH_SHARED],[ PHP_ARG_ANALYZE_EX(withval) shared=$ext_shared unset ext_shared ext_output])dnl The problem is that the default compilation flags in Solaris 2.6 won'tdnl let programs access large files; you need to tell the compiler thatdnl you actually want your programs to work on large files. For morednl details about this brain damage please see:dnl http://www.sas.com/standards/large.file/x_open.20Mar96.htmldnl Written by Paul Eggert <eggert@twinsun.com>.AC_DEFUN([PHP_SYS_LFS],[dnl # If available, prefer support for large files unless the user specified # one of the CPPFLAGS, LDFLAGS, or LIBS variables. AC_MSG_CHECKING([whether large file support needs explicit enabling]) ac_getconfs='' ac_result=yes ac_set='' ac_shellvars='CPPFLAGS LDFLAGS LIBS' for ac_shellvar in $ac_shellvars; do case $ac_shellvar in CPPFLAGS[)] ac_lfsvar=LFS_CFLAGS ;; *[)] ac_lfsvar=LFS_$ac_shellvar ;; esac eval test '"${'$ac_shellvar'+set}"' = set && ac_set=$ac_shellvar (getconf $ac_lfsvar) >/dev/null 2>&1 || { ac_result=no; break; } ac_getconf=`getconf $ac_lfsvar` ac_getconfs=$ac_getconfs$ac_getconf eval ac_test_$ac_shellvar=\$ac_getconf done case "$ac_result$ac_getconfs" in yes[)] ac_result=no ;; esac case "$ac_result$ac_set" in yes?*[)] ac_result="yes, but $ac_set is already set, so use its settings" esac AC_MSG_RESULT([$ac_result]) case $ac_result in yes[)] for ac_shellvar in $ac_shellvars; do eval $ac_shellvar=\$ac_test_$ac_shellvar done ;; esac])AC_DEFUN([PHP_SOCKADDR_SA_LEN],[ AC_CACHE_CHECK([for field sa_len in struct sockaddr],ac_cv_sockaddr_sa_len,[ AC_TRY_COMPILE([#include <sys/types.h>#include <sys/socket.h>], [struct sockaddr s; s.sa_len;], [ac_cv_sockaddr_sa_len=yes AC_DEFINE(HAVE_SOCKADDR_SA_LEN,1,[ ])], [ac_cv_sockaddr_sa_len=no]) ])])dnl ## PHP_OUTPUT(file)dnl ## adds "file" to the list of files generated by AC_OUTPUTdnl ## This macro can be used several times.AC_DEFUN([PHP_OUTPUT],[ PHP_OUTPUT_FILES="$PHP_OUTPUT_FILES $1"])AC_DEFUN([PHP_DECLARED_TIMEZONE],[ AC_CACHE_CHECK(for declared timezone, ac_cv_declared_timezone,[ AC_TRY_COMPILE([#include <sys/types.h>#include <time.h>#ifdef HAVE_SYS_TIME_H#include <sys/time.h>#endif],[ time_t foo = (time_t) timezone;],[ ac_cv_declared_timezone=yes],[ ac_cv_declared_timezone=no])]) if test "$ac_cv_declared_timezone" = "yes"; then AC_DEFINE(HAVE_DECLARED_TIMEZONE, 1, [Whether system headers declare timezone]) fi])AC_DEFUN([PHP_EBCDIC],[ AC_CACHE_CHECK([whether system uses EBCDIC],ac_cv_ebcdic,[ AC_TRY_RUN( [int main(void) { return (unsigned char)'A' != (unsigned char)0xC1; } ],[ ac_cv_ebcdic=yes],[ ac_cv_ebcdic=no],[ ac_cv_ebcdic=no])]) if test "$ac_cv_ebcdic" = "yes"; then AC_DEFINE(CHARSET_EBCDIC,1, [Define if system uses EBCDIC]) fi])dnl Some systems, notably Solaris, cause getcwd() or realpath to fail if adnl component of the path has execute but not read permissionsAC_DEFUN([PHP_BROKEN_GETCWD],[ AC_MSG_CHECKING([for broken getcwd]) os=`uname -sr 2>/dev/null` case $os in SunOS*[)] AC_DEFINE(HAVE_BROKEN_GETCWD,1, [Define if system has broken getcwd]) AC_MSG_RESULT([yes]);; *[)] AC_MSG_RESULT([no]);; esac])AC_DEFUN([PHP_BROKEN_GLIBC_FOPEN_APPEND],[ AC_MSG_CHECKING([for broken libc stdio]) AC_CACHE_VAL(have_broken_glibc_fopen_append,[ AC_TRY_RUN([#include <stdio.h>int main(int argc, char *argv[]){ FILE *fp; long position; char *filename = "/tmp/phpglibccheck"; fp = fopen(filename, "w"); if (fp == NULL) { perror("fopen"); exit(2); } fputs("foobar", fp); fclose(fp); fp = fopen(filename, "a+"); position = ftell(fp); fclose(fp); unlink(filename); if (position == 0) return 1; return 0;}],[have_broken_glibc_fopen_append=no],[have_broken_glibc_fopen_append=yes ],AC_TRY_COMPILE([#include <features.h>],[#if !__GLIBC_PREREQ(2,2)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?