2002-03-07 22:20:02 +08:00
|
|
|
dnl This file becomes configure.in for self-contained extensions.
|
1999-12-30 10:59:53 +08:00
|
|
|
|
2005-06-05 20:58:59 +08:00
|
|
|
divert(1)
|
|
|
|
|
|
|
|
AC_PREREQ(2.13)
|
2002-03-07 22:20:02 +08:00
|
|
|
AC_INIT(config.m4)
|
|
|
|
|
2005-05-27 21:15:47 +08:00
|
|
|
PHP_CONFIG_NICE(config.nice)
|
|
|
|
|
2007-07-18 23:04:22 +08:00
|
|
|
dnl
|
2004-12-30 15:08:39 +08:00
|
|
|
AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl
|
|
|
|
AC_DEFUN([PHP_EXT_DIR],[""])dnl
|
|
|
|
AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl
|
|
|
|
AC_DEFUN([PHP_ALWAYS_SHARED],[
|
2002-03-13 20:30:49 +08:00
|
|
|
ext_output="yes, shared"
|
|
|
|
ext_shared=yes
|
|
|
|
test "[$]$1" = "no" && $1=yes
|
|
|
|
])dnl
|
2002-03-13 17:20:49 +08:00
|
|
|
dnl
|
2000-05-03 05:20:56 +08:00
|
|
|
abs_srcdir=`(cd $srcdir && pwd)`
|
2002-03-07 22:20:02 +08:00
|
|
|
abs_builddir=`pwd`
|
2000-05-03 05:20:56 +08:00
|
|
|
|
1999-12-30 10:59:53 +08:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CC_C_O
|
|
|
|
|
2005-01-20 08:54:18 +08:00
|
|
|
dnl Support systems with system libraries in e.g. /usr/lib64
|
2007-07-18 23:04:22 +08:00
|
|
|
PHP_ARG_WITH(libdir, for system library directory,
|
|
|
|
[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib], lib, no)
|
2005-01-20 08:54:18 +08:00
|
|
|
|
2002-10-17 13:05:01 +08:00
|
|
|
PHP_RUNPATH_SWITCH
|
2006-04-10 20:16:17 +08:00
|
|
|
PHP_SHLIB_SUFFIX_NAMES
|
1999-12-30 10:59:53 +08:00
|
|
|
|
2007-07-18 23:04:22 +08:00
|
|
|
dnl Find php-config script
|
2007-07-25 17:41:06 +08:00
|
|
|
PHP_ARG_WITH(php-config,,
|
2007-07-18 23:04:22 +08:00
|
|
|
[ --with-php-config=PATH Path to php-config [php-config]], php-config, no)
|
2002-03-07 22:20:02 +08:00
|
|
|
|
2007-07-25 17:41:06 +08:00
|
|
|
prefix=`$PHP_PHP_CONFIG --prefix 2>/dev/null`
|
|
|
|
phpincludedir=`$PHP_PHP_CONFIG --include-dir 2>/dev/null`
|
|
|
|
INCLUDES=`$PHP_PHP_CONFIG --includes 2>/dev/null`
|
|
|
|
EXTENSION_DIR=`$PHP_PHP_CONFIG --extension-dir 2>/dev/null`
|
|
|
|
PHP_EXECUTABLE=`$PHP_PHP_CONFIG --php-binary 2>/dev/null`
|
2007-07-18 23:04:22 +08:00
|
|
|
|
|
|
|
if test -z "$prefix"; then
|
|
|
|
AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH])
|
|
|
|
fi
|
|
|
|
|
|
|
|
php_shtool=$srcdir/build/shtool
|
|
|
|
PHP_INIT_BUILD_SYSTEM
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for PHP prefix])
|
|
|
|
AC_MSG_RESULT([$prefix])
|
|
|
|
AC_MSG_CHECKING([for PHP includes])
|
|
|
|
AC_MSG_RESULT([$INCLUDES])
|
|
|
|
AC_MSG_CHECKING([for PHP extension directory])
|
|
|
|
AC_MSG_RESULT([$EXTENSION_DIR])
|
|
|
|
AC_MSG_CHECKING([for PHP installed headers prefix])
|
|
|
|
AC_MSG_RESULT([$phpincludedir])
|
|
|
|
|
|
|
|
dnl Always shared
|
|
|
|
PHP_BUILD_SHARED
|
1999-12-30 10:59:53 +08:00
|
|
|
|
2007-07-18 23:04:22 +08:00
|
|
|
dnl Required programs
|
2003-09-03 03:42:17 +08:00
|
|
|
PHP_PROG_RE2C
|
2005-02-25 02:11:36 +08:00
|
|
|
PHP_PROG_AWK
|
2002-03-20 10:07:11 +08:00
|
|
|
|
1999-12-30 10:59:53 +08:00
|
|
|
sinclude(config.m4)
|
|
|
|
|
|
|
|
enable_static=no
|
|
|
|
enable_shared=yes
|
|
|
|
|
2007-08-06 22:33:51 +08:00
|
|
|
dnl Only allow AC_PROG_CXX if it's explicitly called (by PHP_REQUIRE_CXX)
|
|
|
|
dnl otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler
|
|
|
|
AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [AC_PROG_CXX], [undefine([AC_PROG_CXX])
|
|
|
|
AC_DEFUN([AC_PROG_CXX], [])])
|
1999-12-30 10:59:53 +08:00
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
|
2002-11-12 00:32:17 +08:00
|
|
|
all_targets='$(PHP_MODULES)'
|
2005-11-22 07:08:02 +08:00
|
|
|
install_targets="install-modules install-headers"
|
1999-12-30 10:59:53 +08:00
|
|
|
phplibdir="`pwd`/modules"
|
2001-05-20 13:29:54 +08:00
|
|
|
CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
|
2003-09-03 16:08:12 +08:00
|
|
|
CFLAGS_CLEAN='$(CFLAGS)'
|
2007-06-01 23:12:29 +08:00
|
|
|
CXXFLAGS_CLEAN='$(CXXFLAGS)'
|
1999-12-30 10:59:53 +08:00
|
|
|
|
|
|
|
test "$prefix" = "NONE" && prefix="/usr/local"
|
|
|
|
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
|
|
|
|
|
2002-03-07 22:20:02 +08:00
|
|
|
PHP_SUBST(PHP_MODULES)
|
|
|
|
PHP_SUBST(all_targets)
|
|
|
|
PHP_SUBST(install_targets)
|
|
|
|
|
1999-12-30 10:59:53 +08:00
|
|
|
PHP_SUBST(prefix)
|
|
|
|
PHP_SUBST(exec_prefix)
|
|
|
|
PHP_SUBST(libdir)
|
|
|
|
PHP_SUBST(prefix)
|
|
|
|
PHP_SUBST(phplibdir)
|
2005-11-22 07:08:02 +08:00
|
|
|
PHP_SUBST(phpincludedir)
|
1999-12-30 10:59:53 +08:00
|
|
|
|
|
|
|
PHP_SUBST(CC)
|
|
|
|
PHP_SUBST(CFLAGS)
|
2002-12-16 21:39:27 +08:00
|
|
|
PHP_SUBST(CFLAGS_CLEAN)
|
1999-12-30 10:59:53 +08:00
|
|
|
PHP_SUBST(CPP)
|
|
|
|
PHP_SUBST(CPPFLAGS)
|
|
|
|
PHP_SUBST(CXX)
|
2005-03-04 22:34:24 +08:00
|
|
|
PHP_SUBST(CXXFLAGS)
|
2007-06-01 23:12:29 +08:00
|
|
|
PHP_SUBST(CXXFLAGS_CLEAN)
|
2000-05-03 04:10:46 +08:00
|
|
|
PHP_SUBST(EXTENSION_DIR)
|
2005-08-09 00:06:49 +08:00
|
|
|
PHP_SUBST(PHP_EXECUTABLE)
|
1999-12-30 10:59:53 +08:00
|
|
|
PHP_SUBST(EXTRA_LDFLAGS)
|
|
|
|
PHP_SUBST(EXTRA_LIBS)
|
|
|
|
PHP_SUBST(INCLUDES)
|
|
|
|
PHP_SUBST(LFLAGS)
|
2002-03-20 10:07:11 +08:00
|
|
|
PHP_SUBST(LDFLAGS)
|
2000-05-03 04:10:46 +08:00
|
|
|
PHP_SUBST(SHARED_LIBTOOL)
|
1999-12-30 10:59:53 +08:00
|
|
|
PHP_SUBST(LIBTOOL)
|
|
|
|
PHP_SUBST(SHELL)
|
2005-11-22 07:08:02 +08:00
|
|
|
PHP_SUBST(INSTALL_HEADERS)
|
1999-12-30 10:59:53 +08:00
|
|
|
|
2002-03-07 22:20:02 +08:00
|
|
|
PHP_GEN_BUILD_DIRS
|
|
|
|
PHP_GEN_GLOBAL_MAKEFILE
|
1999-12-30 10:59:53 +08:00
|
|
|
|
2005-05-07 10:51:53 +08:00
|
|
|
test -d modules || $php_shtool mkdir modules
|
2000-05-03 04:56:03 +08:00
|
|
|
touch .deps
|
2000-05-03 04:10:46 +08:00
|
|
|
|
2001-03-12 17:54:26 +08:00
|
|
|
AC_CONFIG_HEADER(config.h)
|
1999-12-30 10:59:53 +08:00
|
|
|
|
|
|
|
AC_OUTPUT()
|