Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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