Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 198 lines (166 sloc) 4.646 kB
9d9d39a Please welcome the new build system.
Sascha Schumann authored
1 dnl This file becomes configure.in for self-contained extensions.
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
2
c28f59a - Proper fix for phpize when dealing with PECL
foobar authored
3 divert(1)
4
5 AC_PREREQ(2.13)
9d9d39a Please welcome the new build system.
Sascha Schumann authored
6 AC_INIT(config.m4)
7
b74a5ea - Make sure EGREP and SED get set early enough.
foobar authored
8 PHP_CONFIG_NICE(config.nice)
9
6b4b1e7 MFH: cleanup & sync
Jani Taskinen authored
10 dnl
69eec3f MFB_4_3: Quote macro names in AC_DEFUN()
foobar authored
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],[
2ea99fe a bit of refactoring and making always_shared a nop in every day life
Sascha Schumann authored
15 ext_output="yes, shared"
16 ext_shared=yes
17 test "[$]$1" = "no" && $1=yes
18 ])dnl
e10ca10 Provide context-specific functions which yield the directories
Sascha Schumann authored
19 dnl
3b9bcd7 Set abs_srcdir. Last example in README.S-C-EXTENSIONS works now.
Sascha Schumann authored
20 abs_srcdir=`(cd $srcdir && pwd)`
9d9d39a Please welcome the new build system.
Sascha Schumann authored
21 abs_builddir=`pwd`
3b9bcd7 Set abs_srcdir. Last example in README.S-C-EXTENSIONS works now.
Sascha Schumann authored
22
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
23 AC_PROG_CC
87acbd2 MFH:- Detect whether debugging was enabled in PHP and drop optimizing…
Jani Taskinen authored
24 PHP_DETECT_ICC
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
25 AC_PROG_CC_C_O
26
76906e0 - Add --with-libdir to phpized builds too
foobar authored
27 dnl Support systems with system libraries in e.g. /usr/lib64
6b4b1e7 MFH: cleanup & sync
Jani Taskinen authored
28 PHP_ARG_WITH(libdir, for system library directory,
29 [ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib], lib, no)
76906e0 - Add --with-libdir to phpized builds too
foobar authored
30
775a064 Fix some phpize problems.
foobar authored
31 PHP_RUNPATH_SWITCH
276171f MFH: - Determine the shared/link lib suffixes in one macro.
foobar authored
32 PHP_SHLIB_SUFFIX_NAMES
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
33
6b4b1e7 MFH: cleanup & sync
Jani Taskinen authored
34 dnl Find php-config script
934b97d @tony2001 MFH
tony2001 authored
35 PHP_ARG_WITH(php-config,,
6b4b1e7 MFH: cleanup & sync
Jani Taskinen authored
36 [ --with-php-config=PATH Path to php-config [php-config]], php-config, no)
9d9d39a Please welcome the new build system.
Sascha Schumann authored
37
e602885 MFH:- Fixed bug #42292 ($PHP_CONFIG not set for phpized builds)
Jani Taskinen authored
38 dnl For BC
39 PHP_CONFIG=$PHP_PHP_CONFIG
40 prefix=`$PHP_CONFIG --prefix 2>/dev/null`
41 phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
42 INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
43 EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
44 PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
6b4b1e7 MFH: cleanup & sync
Jani Taskinen authored
45
46 if test -z "$prefix"; then
47 AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH])
48 fi
49
50 php_shtool=$srcdir/build/shtool
51 PHP_INIT_BUILD_SYSTEM
52
53 AC_MSG_CHECKING([for PHP prefix])
54 AC_MSG_RESULT([$prefix])
55 AC_MSG_CHECKING([for PHP includes])
56 AC_MSG_RESULT([$INCLUDES])
57 AC_MSG_CHECKING([for PHP extension directory])
58 AC_MSG_RESULT([$EXTENSION_DIR])
59 AC_MSG_CHECKING([for PHP installed headers prefix])
60 AC_MSG_RESULT([$phpincludedir])
61
708cb0e MFH:- Applied the missing parts to phpize.m4 for zend extension builds
Jani Taskinen authored
62 dnl Checks for PHP_DEBUG / ZEND_DEBUG / ZTS
87acbd2 MFH:- Detect whether debugging was enabled in PHP and drop optimizing…
Jani Taskinen authored
63 AC_MSG_CHECKING([if debug is enabled])
64 old_CPPFLAGS=$CPPFLAGS
65 CPPFLAGS="-I$phpincludedir"
66 AC_EGREP_CPP(php_debug_is_enabled,[
67 #include <main/php_config.h>
68 #if ZEND_DEBUG
69 php_debug_is_enabled
70 #endif
71 ],[
72 PHP_DEBUG=yes
73 ],[
74 PHP_DEBUG=no
75 ])
708cb0e MFH:- Applied the missing parts to phpize.m4 for zend extension builds
Jani Taskinen authored
76 AC_MSG_RESULT([$PHP_DEBUG])
77
78 AC_MSG_CHECKING([if zts is enabled])
79 old_CPPFLAGS=$CPPFLAGS
80 CPPFLAGS="-I$phpincludedir"
81 AC_EGREP_CPP(php_zts_is_enabled,[
82 #include <main/php_config.h>
83 #if ZTS
84 php_zts_is_enabled
85 #endif
86 ],[
87 PHP_THREAD_SAFETY=yes
88 ],[
89 PHP_THREAD_SAFETY=no
90 ])
87acbd2 MFH:- Detect whether debugging was enabled in PHP and drop optimizing…
Jani Taskinen authored
91 CPPFLAGS=$old_CPPFLAGS
92 AC_MSG_RESULT([$PHP_DEBUG])
93
708cb0e MFH:- Applied the missing parts to phpize.m4 for zend extension builds
Jani Taskinen authored
94 dnl Support for building and testing Zend extensions
95 if test "$PHP_DEBUG" = "yes" && test "$PHP_THREAD_SAFETY" = "yes; then
96 ZEND_EXT_TYPE="zend_extension_debug_ts"
97 elif test "$PHP_DEBUG" = "yes"; then
98 ZEND_EXT_TYPE="zend_extension_debug"
99 elif test "$PHP_THREAD_SAFETY" = "yes; then
100 ZEND_EXT_TYPE="zend_extension_ts"
101 else
102 ZEND_EXT_TYPE="zend_extension"
103 fi
104 PHP_SUBST(ZEND_EXT_TYPE)
105
106 dnl Discard optimization flags when debugging is enabled
87acbd2 MFH:- Detect whether debugging was enabled in PHP and drop optimizing…
Jani Taskinen authored
107 if test "$PHP_DEBUG" = "yes"; then
108 PHP_DEBUG=1
109 ZEND_DEBUG=yes
110 changequote({,})
111 CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'`
112 CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'`
113 changequote([,])
114 dnl add -O0 only if GCC or ICC is used
115 if test "$GCC" = "yes" || test "$ICC" = "yes"; then
116 CFLAGS="$CFLAGS -O0"
117 CXXFLAGS="$CXXFLAGS -O0"
118 fi
119 else
120 PHP_DEBUG=0
121 ZEND_DEBUG=no
122 fi
123
6b4b1e7 MFH: cleanup & sync
Jani Taskinen authored
124 dnl Always shared
125 PHP_BUILD_SHARED
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
126
6b4b1e7 MFH: cleanup & sync
Jani Taskinen authored
127 dnl Required programs
7382178 enable re2c check for self-contained extensions
Sascha Schumann authored
128 PHP_PROG_RE2C
2a6da0f - Restructured and added a few comments here and there.
foobar authored
129 PHP_PROG_AWK
2af5002 ws
Jani Taskinen authored
130
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
131 sinclude(config.m4)
132
133 enable_static=no
134 enable_shared=yes
135
395e75b MFH: Fixed a minor problem in not enabling c++/g++ when not needed.
Jani Taskinen authored
136 dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by PHP_REQUIRE_CXX).
137 dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler.
138 AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [
139 undefine([AC_PROG_CXX])
140 AC_DEFUN([AC_PROG_CXX], [])
141 undefine([AC_PROG_CXXCPP])
e4ad267 @dsp MFB: - Fixed the fix for not requiring C++ always
dsp authored
142 AC_DEFUN([AC_PROG_CXXCPP], [php_prog_cxxcpp=disabled])
395e75b MFH: Fixed a minor problem in not enabling c++/g++ when not needed.
Jani Taskinen authored
143 ])
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
144 AC_PROG_LIBTOOL
145
708cb0e MFH:- Applied the missing parts to phpize.m4 for zend extension builds
Jani Taskinen authored
146 all_targets='$(PHP_MODULES) $(PHP_ZEND_EX)'
7243d31 MFH: - Fixed header installing under phpize builds
foobar authored
147 install_targets="install-modules install-headers"
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
148 phplibdir="`pwd`/modules"
83b1883 @Define HAVE_CONFIG_H when building standalone DSO extensions (Stig)
Stig Bakken authored
149 CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
a283caf centralize cflags
Sascha Schumann authored
150 CFLAGS_CLEAN='$(CFLAGS)'
c1c44dd MFH: - Add missing CXXFLAGS_CLEAN variable.
foobar authored
151 CXXFLAGS_CLEAN='$(CXXFLAGS)'
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
152
153 test "$prefix" = "NONE" && prefix="/usr/local"
154 test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
155
9d9d39a Please welcome the new build system.
Sascha Schumann authored
156 PHP_SUBST(PHP_MODULES)
708cb0e MFH:- Applied the missing parts to phpize.m4 for zend extension builds
Jani Taskinen authored
157 PHP_SUBST(PHP_ZEND_EX)
158
9d9d39a Please welcome the new build system.
Sascha Schumann authored
159 PHP_SUBST(all_targets)
160 PHP_SUBST(install_targets)
161
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
162 PHP_SUBST(prefix)
163 PHP_SUBST(exec_prefix)
164 PHP_SUBST(libdir)
165 PHP_SUBST(prefix)
166 PHP_SUBST(phplibdir)
7243d31 MFH: - Fixed header installing under phpize builds
foobar authored
167 PHP_SUBST(phpincludedir)
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
168
169 PHP_SUBST(CC)
170 PHP_SUBST(CFLAGS)
e5b8617 CFLAGS_CLEAN was not properly defined
Sascha Schumann authored
171 PHP_SUBST(CFLAGS_CLEAN)
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
172 PHP_SUBST(CPP)
173 PHP_SUBST(CPPFLAGS)
174 PHP_SUBST(CXX)
e891278 Add missing subst
foobar authored
175 PHP_SUBST(CXXFLAGS)
c1c44dd MFH: - Add missing CXXFLAGS_CLEAN variable.
foobar authored
176 PHP_SUBST(CXXFLAGS_CLEAN)
5989ae5 Fix building external extensions.
Sascha Schumann authored
177 PHP_SUBST(EXTENSION_DIR)
ee5fd96 - Made it possible to do "make test" for phpized extensions
foobar authored
178 PHP_SUBST(PHP_EXECUTABLE)
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
179 PHP_SUBST(EXTRA_LDFLAGS)
180 PHP_SUBST(EXTRA_LIBS)
181 PHP_SUBST(INCLUDES)
182 PHP_SUBST(LFLAGS)
4a0291d - Make it possible to build ext/openssl as shared extension
foobar authored
183 PHP_SUBST(LDFLAGS)
5989ae5 Fix building external extensions.
Sascha Schumann authored
184 PHP_SUBST(SHARED_LIBTOOL)
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
185 PHP_SUBST(LIBTOOL)
186 PHP_SUBST(SHELL)
7243d31 MFH: - Fixed header installing under phpize builds
foobar authored
187 PHP_SUBST(INSTALL_HEADERS)
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
188
9d9d39a Please welcome the new build system.
Sascha Schumann authored
189 PHP_GEN_BUILD_DIRS
190 PHP_GEN_GLOBAL_MAKEFILE
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
191
6262539 - Added PHP_INSTALL_HEADERS() macro
foobar authored
192 test -d modules || $php_shtool mkdir modules
cae3b7d Pear Changes:
Sascha Schumann authored
193 touch .deps
5989ae5 Fix building external extensions.
Sascha Schumann authored
194
7a75900 HEADS UP: renamed config header file in "phpize"d extensions to
Stig Bakken authored
195 AC_CONFIG_HEADER(config.h)
f2f8d38 Integration of -ng changes. Changes:
Sascha Schumann authored
196
197 AC_OUTPUT()
Something went wrong with that request. Please try again.