1 dnl This file becomes configure.in for self-contained extensions.
8 PHP_CONFIG_NICE(config.nice)
11 AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl
12 AC_DEFUN([PHP_EXT_DIR],[""])dnl
13 AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl
14 AC_DEFUN([PHP_ALWAYS_SHARED],[
15 ext_output="yes, shared"
17 test "[$]$1" = "no" && $1=yes
20 abs_srcdir=`(cd $srcdir && pwd)`
26 dnl Support systems with system libraries in e.g. /usr/lib64
27 PHP_ARG_WITH(libdir, for system library directory,
28 [ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib], lib, no)
31 PHP_SHLIB_SUFFIX_NAMES
33 dnl Find php-config script
34 PHP_ARG_WITH(php-config,,
35 [ --with-php-config=PATH Path to php-config [php-config]], php-config, no)
38 PHP_CONFIG=$PHP_PHP_CONFIG
39 prefix=`$PHP_CONFIG --prefix 2>/dev/null`
40 phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
41 INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
42 EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
43 PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
45 if test -z "$prefix"; then
46 AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH])
49 php_shtool=$srcdir/build/shtool
52 AC_MSG_CHECKING([for PHP prefix])
53 AC_MSG_RESULT([$prefix])
54 AC_MSG_CHECKING([for PHP includes])
55 AC_MSG_RESULT([$INCLUDES])
56 AC_MSG_CHECKING([for PHP extension directory])
57 AC_MSG_RESULT([$EXTENSION_DIR])
58 AC_MSG_CHECKING([for PHP installed headers prefix])
59 AC_MSG_RESULT([$phpincludedir])
73 dnl Only allow AC_PROG_CXX if it's explicitly called (by PHP_REQUIRE_CXX)
74 dnl otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler
75 AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [AC_PROG_CXX], [undefine([AC_PROG_CXX])
76 AC_DEFUN([AC_PROG_CXX], [])])
79 all_targets='$(PHP_MODULES)'
80 install_targets="install-modules install-headers"
81 phplibdir="`pwd`/modules"
82 CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
83 CFLAGS_CLEAN='$(CFLAGS)'
84 CXXFLAGS_CLEAN='$(CXXFLAGS)'
86 test "$prefix" = "NONE" && prefix="/usr/local"
87 test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
89 PHP_SUBST(PHP_MODULES)
90 PHP_SUBST(all_targets)
91 PHP_SUBST(install_targets)
94 PHP_SUBST(exec_prefix)
98 PHP_SUBST(phpincludedir)
102 PHP_SUBST(CFLAGS_CLEAN)
107 PHP_SUBST(CXXFLAGS_CLEAN)
108 PHP_SUBST(EXTENSION_DIR)
109 PHP_SUBST(PHP_EXECUTABLE)
110 PHP_SUBST(EXTRA_LDFLAGS)
111 PHP_SUBST(EXTRA_LIBS)
115 PHP_SUBST(SHARED_LIBTOOL)
118 PHP_SUBST(INSTALL_HEADERS)
121 PHP_GEN_GLOBAL_MAKEFILE
123 test -d modules || $php_shtool mkdir modules
126 AC_CONFIG_HEADER(config.h)