Permalink
Newer
Older
100644 129 lines (102 sloc) 2.68 KB
1
dnl This file becomes configure.in for self-contained extensions.
3
divert(1)
4
5
AC_PREREQ(2.13)
6
AC_INIT(config.m4)
7
8
PHP_CONFIG_NICE(config.nice)
9
10
AC_DEFUN([PHP_WITH_PHP_CONFIG],[
11
AC_ARG_WITH(php-config,
Stig Bakken
@Define HAVE_CONFIG_H when building standalone DSO extensions (Stig)
May 20, 2001
12
[ --with-php-config=PATH],[
13
PHP_CONFIG=$withval
14
],[
15
PHP_CONFIG=php-config
16
])
17
18
prefix=`$PHP_CONFIG --prefix 2>/dev/null`
19
phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
20
INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
Sascha Schumann
May 2, 2000
21
EXTENSION_DIR=`$PHP_CONFIG --extension-dir`
22
PHP_EXECUTABLE=`$PHP_CONFIG --php-binary`
23
24
if test -z "$prefix"; then
25
AC_MSG_ERROR(Cannot find php-config. Please use --with-php-config=PATH)
27
28
php_shtool=$srcdir/build/shtool
29
PHP_INIT_BUILD_SYSTEM
30
Sascha Schumann
May 2, 2000
31
AC_MSG_CHECKING(for PHP prefix)
32
AC_MSG_RESULT($prefix)
Sascha Schumann
May 2, 2000
33
AC_MSG_CHECKING(for PHP includes)
34
AC_MSG_RESULT($INCLUDES)
Sascha Schumann
May 2, 2000
35
AC_MSG_CHECKING(for PHP extension directory)
36
AC_MSG_RESULT($EXTENSION_DIR)
37
AC_MSG_CHECKING(for PHP installed headers prefix)
38
AC_MSG_RESULT($phpincludedir)
41
AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl
42
AC_DEFUN([PHP_EXT_DIR],[""])dnl
43
AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl
44
AC_DEFUN([PHP_ALWAYS_SHARED],[
45
ext_output="yes, shared"
46
ext_shared=yes
47
test "[$]$1" = "no" && $1=yes
48
])dnl
50
abs_srcdir=`(cd $srcdir && pwd)`
51
abs_builddir=`pwd`
53
AC_PROG_CC
54
AC_PROG_CC_C_O
55
56
dnl Support systems with system libraries in e.g. /usr/lib64
57
AC_ARG_WITH(libdir,
58
[ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib],
59
[PHP_LIBDIR=$withval], [PHP_LIBDIR=lib])
60
61
PHP_RUNPATH_SWITCH
62
PHP_SHLIB_SUFFIX_NAMES
63
PHP_WITH_PHP_CONFIG
64
65
PHP_BUILD_SHARED
66
67
AC_PREFIX_DEFAULT()
68
72
sinclude(config.m4)
73
74
enable_static=no
75
enable_shared=yes
76
77
AC_PROG_LIBTOOL
78
79
all_targets='$(PHP_MODULES)'
80
install_targets="install-modules install-headers"
81
phplibdir="`pwd`/modules"
Stig Bakken
@Define HAVE_CONFIG_H when building standalone DSO extensions (Stig)
May 20, 2001
82
CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
Sascha Schumann
Sep 3, 2003
83
CFLAGS_CLEAN='$(CFLAGS)'
84
CXXFLAGS_CLEAN='$(CXXFLAGS)'
85
86
test "$prefix" = "NONE" && prefix="/usr/local"
87
test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
88
89
PHP_SUBST(PHP_MODULES)
90
PHP_SUBST(all_targets)
91
PHP_SUBST(install_targets)
92
93
PHP_SUBST(prefix)
94
PHP_SUBST(exec_prefix)
95
PHP_SUBST(libdir)
96
PHP_SUBST(prefix)
97
PHP_SUBST(phplibdir)
98
PHP_SUBST(phpincludedir)
99
100
PHP_SUBST(CC)
101
PHP_SUBST(CFLAGS)
102
PHP_SUBST(CFLAGS_CLEAN)
103
PHP_SUBST(CPP)
104
PHP_SUBST(CPPFLAGS)
105
PHP_SUBST(CXX)
foobar
Mar 4, 2005
106
PHP_SUBST(CXXFLAGS)
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)
112
PHP_SUBST(INCLUDES)
113
PHP_SUBST(LFLAGS)
115
PHP_SUBST(SHARED_LIBTOOL)
116
PHP_SUBST(LIBTOOL)
117
PHP_SUBST(SHELL)
118
PHP_SUBST(INSTALL_HEADERS)
120
PHP_GEN_BUILD_DIRS
121
PHP_GEN_GLOBAL_MAKEFILE
123
test -d modules || $php_shtool mkdir modules
Sascha Schumann
May 2, 2000
124
touch .deps
126
AC_CONFIG_HEADER(config.h)
127
128
AC_OUTPUT()