$1=[$]ac_new_flags
])
-AC_DEFUN([PHP_SETUP_OPENSSL],[
- if test "$PHP_OPENSSL" = "yes"; then
- PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
- fi
-
- for i in $PHP_OPENSSL; do
- if test -r $i/include/openssl/evp.h; then
- OPENSSL_INCDIR=$i/include
- fi
- if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
- OPENSSL_LIBDIR=$i/lib
- fi
- done
-
- if test -z "$OPENSSL_INCDIR"; then
- AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>])
- fi
-
- if test -z "$OPENSSL_LIBDIR"; then
- AC_MSG_ERROR([Cannot find OpenSSL's libraries])
- fi
-
- old_CPPFLAGS=$CPPFLAGS
- CPPFLAGS=-I$OPENSSL_INCDIR
- AC_MSG_CHECKING([for OpenSSL version])
- AC_EGREP_CPP(yes,[
-#include <openssl/opensslv.h>
-#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
- yes
-#endif
- ],[
- AC_MSG_RESULT([>= 0.9.6])
- ],[
- AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
- ])
- CPPFLAGS=$old_CPPFLAGS
-
- PHP_ADD_INCLUDE($OPENSSL_INCDIR)
- PHP_ADD_LIBPATH($OPENSSL_LIBDIR)
-
- PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
- PHP_ADD_LIBRARY(crypto)
- ],[
- AC_MSG_ERROR([libcrypto not found!])
- ],[
- -L$OPENSSL_LIBDIR
- ])
-
- PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [
- PHP_ADD_LIBRARY(ssl)
- ],[
- AC_MSG_ERROR([libssl not found!])
- ],[
- -L$OPENSSL_LIBDIR
- ])
-
- OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR
- AC_SUBST(OPENSSL_INCDIR_OPT)
-])
-
dnl PHP_EVAL_LIBLINE(LINE, SHARED-LIBADD)
dnl
dnl Use this macro, if you need to add libraries and or library search
fi
])
-dnl PHP_SHARED_MODULE(module-name, object-var, build-dir)
+dnl PHP_SHARED_MODULE(module-name, object-var, build-dir, cxx)
dnl
dnl Basically sets up the link-stage for building module-name
dnl from object_var in build-dir.
\$(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)
+ \$(LIBTOOL) --mode=link ifelse($4,,[\$(CC)],[\$(CXX)]) \$(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
])
dnl deprecated
AC_DEFUN([PHP_EXTENSION],[
- sources=`$AWK -f $abs_srcdir/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in`
+ sources=`$AWK -f $abs_srcdir/build/scan_makefile_in.awk < []PHP_EXT_SRCDIR($1)[]/Makefile.in`
PHP_NEW_EXTENSION($1, $sources, $2, $3)
])
dnl
-dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags]]])
+dnl PHP_NEW_EXTENSION(extname, sources [, shared [,sapi_class[, extra-cflags[, cxx]]]])
dnl
dnl Includes an extension in the build.
dnl
if test "$3" = "shared" || test "$3" = "yes"; then
dnl ---------------------------------------------- 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)
+ PHP_SHARED_MODULE($1,shared_objects_$1, $ext_builddir, $6)
AC_DEFINE_UNQUOTED([COMPILE_DL_]translit($1,a-z_-,A-Z__), 1, Whether to build $1 as dynamic module)
fi
fi
dnl
-dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-ldflags]]])
+dnl PHP_CHECK_LIBRARY(library, function [, action-found [, action-not-found [, extra-libs]]])
dnl
dnl Wrapper for AC_CHECK_LIB
dnl
])
])
+dnl
+dnl PHP_SETUP_OPENSSL(shared-add [, action-found [, action-not-found]])
+dnl
+dnl Common setup macro for openssl
+dnl
+AC_DEFUN([PHP_SETUP_OPENSSL],[
+ found_openssl=no
+ unset OPENSSL_INCDIR
+ unset OPENSSL_LIBDIR
+
+ if test "$PHP_OPENSSL" = "yes"; then
+ PHP_OPENSSL="/usr/local/ssl /usr/local /usr /usr/local/openssl"
+ fi
+
+ for i in $PHP_OPENSSL; do
+ if test -r $i/include/openssl/evp.h; then
+ OPENSSL_INCDIR=$i/include
+ fi
+ if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
+ OPENSSL_LIBDIR=$i/lib
+ fi
+ done
+
+ if test -z "$OPENSSL_INCDIR"; then
+ AC_MSG_ERROR([Cannot find OpenSSL's <evp.h>])
+ fi
+
+ if test -z "$OPENSSL_LIBDIR"; then
+ AC_MSG_ERROR([Cannot find OpenSSL's libraries])
+ fi
+
+ old_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS=-I$OPENSSL_INCDIR
+ AC_MSG_CHECKING([for OpenSSL version])
+ AC_EGREP_CPP(yes,[
+#include <openssl/opensslv.h>
+#if OPENSSL_VERSION_NUMBER >= 0x0090600fL
+ yes
+#endif
+ ],[
+ AC_MSG_RESULT([>= 0.9.6])
+ ],[
+ AC_MSG_ERROR([OpenSSL version 0.9.6 or greater required.])
+ ])
+ CPPFLAGS=$old_CPPFLAGS
+
+ PHP_CHECK_LIBRARY(crypto, CRYPTO_free, [
+ PHP_CHECK_LIBRARY(ssl, SSL_CTX_set_ssl_version, [
+ found_openssl=yes
+ ], [
+ AC_MSG_ERROR([libssl not found!])
+ ],[
+ -L$OPENSSL_LIBDIR -lcrypto
+ ])
+ ], [
+ AC_MSG_ERROR([libcrypto not found!])
+ ],[
+ -L$OPENSSL_LIBDIR
+ ])
+
+ OPENSSL_INCDIR_OPT=-I$OPENSSL_INCDIR
+ AC_SUBST(OPENSSL_INCDIR_OPT)
+
+ if test "$found_openssl" = "yes"; then
+ if test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR"; then
+ PHP_ADD_INCLUDE($OPENSSL_INCDIR)
+ PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1)
+ PHP_ADD_LIBRARY(crypto,,$1)
+ PHP_ADD_LIBRARY(ssl,, $1)
+ fi
+ $2
+ifelse([$3],[],,[else $3])
+ fi
+])
+
dnl
dnl PHP_SETUP_ICONV(shared-add [, action-found [, action-not-found]])
dnl
PHP_CONFIG_FILE_SCAN_DIR=""
fi
-# compatibility
-if test -z "$with_pear" && test "$enable_pear" = "no"; then
- with_pear=no
-fi
-
-PHP_ARG_WITH(pear, [whether to install PEAR, and where],
-[ --with-pear=DIR Install PEAR in DIR (default PREFIX/lib/php)
- --without-pear Do not install PEAR], DEFAULT, yes)
-
-if test "$PHP_PEAR" != "no" && test "$disable_cli" != "1"; then
- install_pear="install-pear"
- PEAR_INSTALLDIR=$PHP_PEAR
-fi
-
-if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then
- case $PHP_LAYOUT in
- GNU) PEAR_INSTALLDIR=$datadir/pear;;
- *) PEAR_INSTALLDIR=$libdir/php;;
- esac
-fi
-
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
PHP_ARG_ENABLE(safe-mode, whether to enable safe mode by default,
AC_DEFINE(HAVE_IPV6,1,[Whether to enable IPv6 support])
fi
-
-dnl
-dnl OpenSSL configure
-dnl
-PHP_ARG_WITH(openssl,for OpenSSL support,
-[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6) ])
-
-if test "$PHP_OPENSSL" != "no"; then
- ext_openssl_shared=$ext_shared
- PHP_SETUP_OPENSSL
-fi
+AC_MSG_CHECKING([whether to enable versioning])
+AC_ARG_ENABLE(versioning,
+[ --enable-versioning Export only required symbols.
+ See INSTALL for more information], [
+ if test "x$APXS" != "x"; then
+ PHP_VERSIONING=$enableval
+ else
+ PHP_VERSIONING=no
+ fi
+],[
+ PHP_VERSIONING=no
+])
+AC_MSG_RESULT([$PHP_VERSIONING])
divert(5)
# reading config stubs
esyscmd(./build/config-stubs ext)
-
-dnl Other settings.
+dnl Extensions post-config
dnl -------------------------------------------------------------------------
-PHP_HELP_SEPARATOR([Other settings:])
-
-AC_MSG_CHECKING([whether to enable versioning])
-AC_ARG_ENABLE(versioning,
-[ --enable-versioning Export only required symbols.
- See INSTALL for more information], [
- if test "x$APXS" != "x"; then
- PHP_VERSIONING=$enableval
- else
- PHP_VERSIONING=no
- fi
-],[
- PHP_VERSIONING=no
-])
-AC_MSG_RESULT([$PHP_VERSIONING])
-
if test "$PHP_VERSIONING" = "yes"; then
test -z "$PHP_SYM_FILE" && PHP_SYM_FILE="$abs_srcdir/sapi/$PHP_SAPI/php.sym"
if test -f "$PHP_SYM_FILE"; then
;;
esac
-PHP_REGEX
-
EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
dnl this has to be here to prevent the openssl crypt() from
unset LIBS LDFLAGS
+dnl PEAR
+dnl -------------------------------------------------------------------------
+
+PHP_HELP_SEPARATOR([PEAR:])
+PHP_CONFIGURE_PART(Configuring PEAR)
+
+# compatibility
+if test -z "$with_pear" && test "$enable_pear" = "no"; then
+ with_pear=no
+fi
+
+PHP_ARG_WITH(pear, [whether to install PEAR],
+[ --with-pear=DIR Install PEAR in DIR (default PREFIX/lib/php)
+ --without-pear Do not install PEAR], DEFAULT, yes)
+
+if test "$PHP_PEAR" != "no"; then
+
+ dnl
+ dnl PEAR dependancies
+ dnl
+ if test "$PHP_SAPI_CLI" = "no"; then
+ pear_error_msg="$pear_error_msg
+ PEAR requires CLI to be enabled. Add --enable-cli to the configure line."
+ fi
+ if test "$PHP_PCRE_REGEX" = "no"; then
+ pear_error_msg="$pear_error_msg
+ PEAR requires PCRE to be enabled. Add --with-pcre-regex to the configure line."
+ fi
+ if test "$PHP_XML" = "no"; then
+ pear_error_msg="$pear_error_msg
+ PEAR requires XML to be enabled. Add --enable-xml to the configure line."
+ fi
+
+dnl
+dnl ext/xmlrpc is not really there yet to be a requirement..
+dnl
+dnl if test "$PHP_XMLRPC" = "no"; then
+dnl pear_error_msg="$pear_error_msg
+dnl PEAR requires XML-RPC to be enabled. Add --with-xmlrpc to the configure line."
+dnl fi
+dnl
+
+ if test "$pear_error_msg"; then
+ AC_MSG_ERROR([$pear_error_msg])
+ fi
+
+ install_pear="install-pear"
+ PEAR_INSTALLDIR=$PHP_PEAR
+
+ if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then
+ case $PHP_LAYOUT in
+ GNU) PEAR_INSTALLDIR=$datadir/pear;;
+ *) PEAR_INSTALLDIR=$libdir/php;;
+ esac
+ fi
+fi
+
+
dnl Configuring Zend and TSRM.
dnl -------------------------------------------------------------------------
+++ /dev/null
-dnl
-dnl $Id$
-dnl
-
-if test "$PHP_OPENSSL" != "no"; then
- PHP_NEW_EXTENSION(openssl, openssl.c, $ext_openssl_shared)
- OPENSSL_SHARED_LIBADD="-lcrypto -lssl"
- PHP_SUBST(OPENSSL_SHARED_LIBADD)
- AC_DEFINE(HAVE_OPENSSL_EXT,1,[ ])
-fi
if test "$PHP_OPENSSL" != "no"; then
PHP_SETUP_OPENSSL(OPENSSL_SHARED_LIBADD,
[
- PHP_NEW_EXTENSION(openssl, openssl.c xp_ssl.c, $ext_shared)
+ PHP_NEW_EXTENSION(openssl, openssl.c, $ext_shared)
PHP_SUBST(OPENSSL_SHARED_LIBADD)
AC_DEFINE(HAVE_OPENSSL_EXT,1,[ ])
], [
PHP_ARG_WITH(snmp,for SNMP support,
[ --with-snmp[=DIR] Include SNMP support.])
+PHP_ARG_WITH(openssl-dir,OpenSSL dir for SNMP,
+[ --with-openssl-dir[=DIR] SNMP: openssl install prefix.], no, no)
+
if test "$PHP_SNMP" != "no"; then
dnl
AC_MSG_RESULT($SNMP_SSL)
if test "$SNMP_SSL" = "yes"; then
- if test "$PHP_OPENSSL" != "no"; then
- PHP_ADD_LIBRARY(ssl, 1, SNMP_SHARED_LIBADD)
- PHP_ADD_LIBRARY(crypto,1, SNMP_SHARED_LIBADD)
- else
- AC_MSG_ERROR(The UCD-SNMP in this system is built with SSL support.
+ if test "$PHP_OPENSSL_DIR" != "no"; then
+ PHP_OPENSSL=$PHP_OPENSSL_DIR
+ fi
+
+ if test "$PHP_OPENSSL" = "no"; then
+ AC_MSG_ERROR([The UCD-SNMP in this system is built with SSL support.
- Add --with-openssl<=DIR> to your configure line.)
+ Add --with-openssl-dir=DIR to your configure line.])
+ else
+ PHP_SETUP_OPENSSL(SNMP_SHARED_LIBADD, [], [
+ AC_MSG_ERROR([SNMP: OpenSSL check failed. Please check config.log for more information.])
+ ])
fi
fi
dnl Check if flush should be called explicitly after buffered io
dnl
AC_DEFUN(AC_FLUSH_IO,[
- AC_CACHE_CHECK([whether flush should be called explicitly after a bufferered io], ac_cv_flush_io,[
+ AC_CACHE_CHECK([whether flush should be called explicitly after a buffered io], ac_cv_flush_io,[
AC_TRY_RUN( [
#include <stdio.h>
#include <stdlib.h>
REGEX_TYPE=php
])
+PHP_REGEX
+
dnl
dnl round fuzz
dnl
+++ /dev/null
-BEGIN {
- mode=0
- sources=""
-}
-
-mode == 0 && /^LTLIBRARY_SOURCES.*\\$/ {
- if (match($0, "[^=]*$")) {
- sources=substr($0, RSTART, RLENGTH-1)
- }
- mode=1
- next
-}
-
-mode == 0 && /^LTLIBRARY_SOURCES.*/ {
- if (match($0, "[^=]*$")) {
- sources=substr($0, RSTART, RLENGTH)
- }
-}
-
-mode == 1 && /.*\\$/ {
- sources=sources substr($0, 0, length - 1)
- next
-}
-
-mode == 1 {
- sources=sources $0
- mode=0
-}
-
-END {
- print sources
-}
scripts/phpize.m4 \
build/mkdep.awk \
build/shtool \
+ build/scan_makefile_in.awk \
Makefile.global \
- scan_makefile_in.awk \
acinclude.m4
bin_SCRIPTS = phpize php-config
includedir="$prefix/include/php"
builddir="`pwd`"
-FILES_BUILD="mkdep.awk shtool"
-FILES="acinclude.m4 Makefile.global scan_makefile_in.awk"
+FILES_BUILD="mkdep.awk scan_makefile_in.awk shtool"
+FILES="acinclude.m4 Makefile.global"
CLEAN_FILES="$FILES *.lo *.la *.o .deps .libs/ build/ include/ modules/ install-sh \
mkinstalldirs missing config.nice config.sub config.guess configure configure.in \
aclocal.m4 config.h config.h.in conftest* ltmain.sh libtool config.cache \
aclocal || exit 1
autoconf || exit 1
autoheader || exit 1
-libtoolize=`$phpdir/shtool path glibtoolize libtoolize`
+libtoolize=`$builddir/build/shtool path glibtoolize libtoolize`
$libtoolize -f -c || exit 1
# dumping API NOs:
AC_PREFIX_DEFAULT()
-AC_ARG_WITH(openssl,
-[ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.5) ],
-[
- if test "$withval" != "no"; then
- PHP_WITH_SHARED
- PHP_OPENSSL=$withval
- ext_openssl_shared=yes
- ext_shared=yes
- PHP_SETUP_OPENSSL
- fi
-])
-
AC_PROG_AWK
sinclude(config.m4)