You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

857 lines
21 KiB

Generalized server-API build process on UNIX. Each SAPI implementation now has its own directory under sapi/, just like extensions have theirs under ext/. To make the final targets appear in the main dir, the top-level Makefile includes sapi/NN/Makefile.inc from the selected sapi backend. This is a plan Makefile stub without any autoconf substitutions. Each SAPI backend also has its own config.m4 like extensions (read at the end of diversion 2) and config.h.stub files. Each SAPI backend has to contain: config.m4: just like for extensions, this file contains autoconf/automake directives that end up in the configure script. The only difference is that the sapi config.m4 files are read in diversion (output block) 2 instead of 3. The sapi config.m4 files should set two variables: PHP_SAPI (which sapi backend to choose) and SAPI_TARGET (the name of the resulting library or program, previously BINNAME). If they are not specified, they will default to "cgi" and "php", respectively. Makefile.inc: has to exist, has to define "INSTALL_IT" to the command used to install the final target (or ":" for no operation). It also has to define a plain Makefile rule (without autoconf substitutions) to build $(SAPI_TARGET) Makefile.am: just what you think. Make sure your target is called "libphpsapi_NNN.a", where NNN is the value of PHP_SAPI. Some testing and fixing probably remains. To make everything hang together, I've done some ugly tricks that I can imagine causing some problems. I've built and run the CGI version and built the Apache DSO.
27 years ago
Generalized server-API build process on UNIX. Each SAPI implementation now has its own directory under sapi/, just like extensions have theirs under ext/. To make the final targets appear in the main dir, the top-level Makefile includes sapi/NN/Makefile.inc from the selected sapi backend. This is a plan Makefile stub without any autoconf substitutions. Each SAPI backend also has its own config.m4 like extensions (read at the end of diversion 2) and config.h.stub files. Each SAPI backend has to contain: config.m4: just like for extensions, this file contains autoconf/automake directives that end up in the configure script. The only difference is that the sapi config.m4 files are read in diversion (output block) 2 instead of 3. The sapi config.m4 files should set two variables: PHP_SAPI (which sapi backend to choose) and SAPI_TARGET (the name of the resulting library or program, previously BINNAME). If they are not specified, they will default to "cgi" and "php", respectively. Makefile.inc: has to exist, has to define "INSTALL_IT" to the command used to install the final target (or ":" for no operation). It also has to define a plain Makefile rule (without autoconf substitutions) to build $(SAPI_TARGET) Makefile.am: just what you think. Make sure your target is called "libphpsapi_NNN.a", where NNN is the value of PHP_SAPI. Some testing and fixing probably remains. To make everything hang together, I've done some ugly tricks that I can imagine causing some problems. I've built and run the CGI version and built the Apache DSO.
27 years ago
27 years ago
26 years ago
26 years ago
26 years ago
27 years ago
26 years ago
27 years ago
27 years ago
Generalized server-API build process on UNIX. Each SAPI implementation now has its own directory under sapi/, just like extensions have theirs under ext/. To make the final targets appear in the main dir, the top-level Makefile includes sapi/NN/Makefile.inc from the selected sapi backend. This is a plan Makefile stub without any autoconf substitutions. Each SAPI backend also has its own config.m4 like extensions (read at the end of diversion 2) and config.h.stub files. Each SAPI backend has to contain: config.m4: just like for extensions, this file contains autoconf/automake directives that end up in the configure script. The only difference is that the sapi config.m4 files are read in diversion (output block) 2 instead of 3. The sapi config.m4 files should set two variables: PHP_SAPI (which sapi backend to choose) and SAPI_TARGET (the name of the resulting library or program, previously BINNAME). If they are not specified, they will default to "cgi" and "php", respectively. Makefile.inc: has to exist, has to define "INSTALL_IT" to the command used to install the final target (or ":" for no operation). It also has to define a plain Makefile rule (without autoconf substitutions) to build $(SAPI_TARGET) Makefile.am: just what you think. Make sure your target is called "libphpsapi_NNN.a", where NNN is the value of PHP_SAPI. Some testing and fixing probably remains. To make everything hang together, I've done some ugly tricks that I can imagine causing some problems. I've built and run the CGI version and built the Apache DSO.
27 years ago
Generalized server-API build process on UNIX. Each SAPI implementation now has its own directory under sapi/, just like extensions have theirs under ext/. To make the final targets appear in the main dir, the top-level Makefile includes sapi/NN/Makefile.inc from the selected sapi backend. This is a plan Makefile stub without any autoconf substitutions. Each SAPI backend also has its own config.m4 like extensions (read at the end of diversion 2) and config.h.stub files. Each SAPI backend has to contain: config.m4: just like for extensions, this file contains autoconf/automake directives that end up in the configure script. The only difference is that the sapi config.m4 files are read in diversion (output block) 2 instead of 3. The sapi config.m4 files should set two variables: PHP_SAPI (which sapi backend to choose) and SAPI_TARGET (the name of the resulting library or program, previously BINNAME). If they are not specified, they will default to "cgi" and "php", respectively. Makefile.inc: has to exist, has to define "INSTALL_IT" to the command used to install the final target (or ":" for no operation). It also has to define a plain Makefile rule (without autoconf substitutions) to build $(SAPI_TARGET) Makefile.am: just what you think. Make sure your target is called "libphpsapi_NNN.a", where NNN is the value of PHP_SAPI. Some testing and fixing probably remains. To make everything hang together, I've done some ugly tricks that I can imagine causing some problems. I've built and run the CGI version and built the Apache DSO.
27 years ago
Generalized server-API build process on UNIX. Each SAPI implementation now has its own directory under sapi/, just like extensions have theirs under ext/. To make the final targets appear in the main dir, the top-level Makefile includes sapi/NN/Makefile.inc from the selected sapi backend. This is a plan Makefile stub without any autoconf substitutions. Each SAPI backend also has its own config.m4 like extensions (read at the end of diversion 2) and config.h.stub files. Each SAPI backend has to contain: config.m4: just like for extensions, this file contains autoconf/automake directives that end up in the configure script. The only difference is that the sapi config.m4 files are read in diversion (output block) 2 instead of 3. The sapi config.m4 files should set two variables: PHP_SAPI (which sapi backend to choose) and SAPI_TARGET (the name of the resulting library or program, previously BINNAME). If they are not specified, they will default to "cgi" and "php", respectively. Makefile.inc: has to exist, has to define "INSTALL_IT" to the command used to install the final target (or ":" for no operation). It also has to define a plain Makefile rule (without autoconf substitutions) to build $(SAPI_TARGET) Makefile.am: just what you think. Make sure your target is called "libphpsapi_NNN.a", where NNN is the value of PHP_SAPI. Some testing and fixing probably remains. To make everything hang together, I've done some ugly tricks that I can imagine causing some problems. I've built and run the CGI version and built the Apache DSO.
27 years ago
Generalized server-API build process on UNIX. Each SAPI implementation now has its own directory under sapi/, just like extensions have theirs under ext/. To make the final targets appear in the main dir, the top-level Makefile includes sapi/NN/Makefile.inc from the selected sapi backend. This is a plan Makefile stub without any autoconf substitutions. Each SAPI backend also has its own config.m4 like extensions (read at the end of diversion 2) and config.h.stub files. Each SAPI backend has to contain: config.m4: just like for extensions, this file contains autoconf/automake directives that end up in the configure script. The only difference is that the sapi config.m4 files are read in diversion (output block) 2 instead of 3. The sapi config.m4 files should set two variables: PHP_SAPI (which sapi backend to choose) and SAPI_TARGET (the name of the resulting library or program, previously BINNAME). If they are not specified, they will default to "cgi" and "php", respectively. Makefile.inc: has to exist, has to define "INSTALL_IT" to the command used to install the final target (or ":" for no operation). It also has to define a plain Makefile rule (without autoconf substitutions) to build $(SAPI_TARGET) Makefile.am: just what you think. Make sure your target is called "libphpsapi_NNN.a", where NNN is the value of PHP_SAPI. Some testing and fixing probably remains. To make everything hang together, I've done some ugly tricks that I can imagine causing some problems. I've built and run the CGI version and built the Apache DSO.
27 years ago
  1. dnl ## $Id$ -*- sh -*-
  2. dnl ## Process this file with autoconf to produce a configure script.
  3. divert(1)
  4. AC_INIT(main.c)
  5. PHP_FAST_OUTPUT(sapi/Makefile ext/Makefile Makefile pear/Makefile)
  6. dnl Because ``make install'' is often performed by the superuser,
  7. dnl we create the libs subdirectory as the user who configures PHP.
  8. dnl Otherwise, the current user will not be able to delete libs
  9. dnl or the contents of libs.
  10. test -d libs || mkdir libs
  11. if test "$with_shared_apache" != "no" && test -n "$with_shared_apache" ; then
  12. AC_MSG_ERROR(--with-shared-apache is not supported. Please refer to the documentation for using APXS)
  13. fi
  14. if test -n "$with_apache" && test -n "$with_apxs"; then
  15. AC_MSG_ERROR(--with-apache and --with-apxs cannot be used together)
  16. fi
  17. cwd=`pwd`
  18. CONFIGURE_COMMAND=$0
  19. for arg in "$@"; do
  20. CONFIGURE_COMMAND="$CONFIGURE_COMMAND '$arg'"
  21. done
  22. php_shtool="$srcdir/build/shtool"
  23. T_MD=`$php_shtool echo -n -e %B`
  24. T_ME=`$php_shtool echo -n -e %b`
  25. dnl ## Diversion 2 is the initial checking of OS features, programs,
  26. dnl ## libraries and so on.
  27. dnl ## In diversion 3 we check for compile-time options to the PHP
  28. dnl ## core and how to deal with different system dependencies. This
  29. dnl ## includes what regex library is used and whether debugging or short
  30. dnl ## tags are enabled, and the default behaviour of php.ini options.
  31. dnl ## This is also where an SAPI interface is selected (choosing between
  32. dnl ## Apache module, CGI etc.)
  33. dnl ## In diversion 4 we check which extensions should be compiled.
  34. dnl ## All of these are normally in the extension directories.
  35. dnl ## Diversion 5 is the last one. Here we generate files and clean up.
  36. divert(2)
  37. PHP_CONFIGURE_PART(Running system checks)
  38. dnl ## This is where the version number is changed from now on!
  39. AM_INIT_AUTOMAKE(php, 4.0b4-dev)
  40. PHP_VERSION=$VERSION
  41. echo "/* automatically generated by configure */" > php_version.h.new
  42. echo "/* edit configure.in.in to change version number */" >> php_version.h.new
  43. echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new
  44. cmp php_version.h.new php_version.h >/dev/null 2>&1
  45. if test $? -ne 0 ; then
  46. rm -f php_version.h && mv php_version.h.new php_version.h && \
  47. echo 'Updated php_version.h'
  48. else
  49. rm -f php_version.h.new
  50. fi
  51. AM_CONFIG_HEADER(php_config.h)
  52. AM_MAINTAINER_MODE
  53. dnl We want this one before the checks, so the checks can modify CFLAGS.
  54. test -z "$CFLAGS" && auto_cflags=1
  55. dnl If we're using cc on HP-UX, add -Ae -D_HPUX_SOURCE [obsolete]
  56. dnl if test -n "$auto_cflags" && test "`uname -s 2>/dev/null`" = "HP-UX"; then
  57. dnl test -n "$GCC" || CFLAGS="-Ae $CFLAGS -D_HPUX_SOURCE"
  58. dnl fi
  59. dnl Checks for programs.
  60. AC_PROG_YACC
  61. if test "$YACC" != "bison -y"; then
  62. AC_MSG_WARN(You will need bison if you want to regenerate the PHP parsers.)
  63. else
  64. AC_MSG_CHECKING(bison version)
  65. oldIFS=$IFS; IFS=.
  66. set `bison -V | sed -e 's/^GNU Bison version //'`
  67. IFS=$oldIFS
  68. if test "$1" = "1" -a "$2" -lt "25"; then
  69. AC_MSG_WARN(Bison 1.25 or newer needed to regenerate parsers (found $1.$2).)
  70. fi
  71. AC_MSG_RESULT($1.$2 (ok))
  72. fi
  73. dnl ## there has to be a better way...
  74. dnl## OLDLIBS=$LIBS; LIBS=""
  75. AC_PROG_CC
  76. AC_AIX
  77. dnl## LIBS=$OLDLIBS
  78. AM_PROG_CC_STDC
  79. AC_PROG_RANLIB
  80. AC_PROG_CC_C_O
  81. AC_PROG_LN_S
  82. AM_PROG_LEX
  83. dnl Make flex scanners use const if they can, even if __STDC__ is not
  84. dnl true, for compilers like Sun's that only set __STDC__ true in
  85. dnl "limit-to-ANSI-standard" mode, not in "ANSI-compatible" mode
  86. AC_C_CONST
  87. if test "$ac_cv_c_const" = "yes" ; then
  88. LEX_CFLAGS="-DYY_USE_CONST"
  89. fi
  90. sinclude(Zend/acinclude.m4)
  91. sinclude(Zend/Zend.m4)
  92. sinclude(TSRM/tsrm.m4)
  93. dnl check for -R, etc. switch
  94. AC_MSG_CHECKING(whether compiler supports -R)
  95. AC_CACHE_VAL(php_cv_cc_dashr,[
  96. SAVE_LIBS="${LIBS}"
  97. LIBS="-R /usr/lib ${LIBS}"
  98. AC_TRY_LINK([], [], php_cv_cc_dashr=yes, php_cv_cc_dashr=no)
  99. LIBS="${SAVE_LIBS}"])
  100. AC_MSG_RESULT($php_cv_cc_dashr)
  101. if test $php_cv_cc_dashr = "yes"; then
  102. ld_runpath_switch="-R"
  103. else
  104. AC_MSG_CHECKING([whether compiler supports -Wl,-rpath,])
  105. AC_CACHE_VAL(php_cv_cc_rpath,[
  106. SAVE_LIBS="${LIBS}"
  107. LIBS="-Wl,-rpath,/usr/lib ${LIBS}"
  108. AC_TRY_LINK([], [], php_cv_cc_rpath=yes, php_cv_cc_rpath=no)
  109. LIBS="${SAVE_LIBS}"])
  110. AC_MSG_RESULT($php_cv_cc_rpath)
  111. if test $php_cv_cc_rpath = "yes"; then
  112. ld_runpath_switch="-Wl,-rpath,"
  113. else
  114. dnl something innocuous
  115. ld_runpath_switch="-L"
  116. fi
  117. fi
  118. dnl AC_PROG_INSTALL
  119. AC_PATH_PROG(PROG_SENDMAIL, sendmail, /usr/lib/sendmail, $PATH /usr/bin /usr/sbin /usr/etc /etc /usr/ucblib)
  120. if test -n "$PROG_SENDMAIL"; then
  121. AC_DEFINE(HAVE_SENDMAIL)
  122. fi
  123. dnl
  124. dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
  125. dnl and source packages. This should be harmless on other OSs.
  126. dnl
  127. if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
  128. CFLAGS="$CFLAGS -I/usr/pkg/include"
  129. LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
  130. fi
  131. INCLUDES="-I\$(top_builddir)/Zend -I\$(top_srcdir)"
  132. AC_CHECK_LIB(nsl, gethostname, [
  133. AC_ADD_LIBRARY(nsl)
  134. AC_DEFINE(HAVE_LIBNSL) ], [])
  135. AC_CHECK_LIB(socket, socket, [
  136. AC_ADD_LIBRARY(socket)
  137. AC_DEFINE(HAVE_LIBSOCKET) ], [
  138. AC_CHECK_LIB(socket, htonl, [
  139. AC_ADD_LIBRARY(socket)
  140. ])])
  141. AC_CHECK_LIB(nsl, gethostbyaddr, [
  142. AC_ADD_LIBRARY(nsl)
  143. AC_DEFINE(HAVE_LIBNSL) ], [])
  144. AC_CHECK_LIB(crypt, crypt, [
  145. AC_ADD_LIBRARY(crypt)
  146. AC_DEFINE(HAVE_LIBCRYPT,1,[ ]) ], [])
  147. dnl The sin may be in a library which need not be specifed
  148. dnl as well as res_search resides in libsocket
  149. AC_CHECK_LIB(m, sin)
  150. AC_CHECK_LIB(bind, inet_aton, [
  151. AC_ADD_LIBRARY(bind)
  152. AC_DEFINE(HAVE_LIBBIND) ], [])
  153. AC_CHECK_LIB(resolv, inet_aton)
  154. dnl The res_search may be in libsocket as well, and if it is
  155. dnl make sure to check for dn_skipname in libresolv, or if res_search
  156. dnl is in neither of these libs, still check for dn_skipname in libresolv
  157. AC_CHECK_LIB(socket, res_search, [
  158. AC_CHECK_LIB(resolv, dn_skipname)
  159. AC_CHECK_LIB(resolv, __dn_skipname)
  160. LIBS="$LIBS -lsocket"
  161. AC_DEFINE(HAVE_LIBSOCKET) ], [
  162. AC_CHECK_LIB(resolv, res_search, [
  163. LIBS="$LIBS -lresolv"
  164. AC_DEFINE(HAVE_LIBRESOLV)
  165. ], [
  166. AC_CHECK_LIB(resolv, dn_skipname)
  167. AC_CHECK_LIB(resolv, __dn_skipname)
  168. ])
  169. ])
  170. dnl Checks for header files.
  171. AC_HEADER_STDC
  172. dnl In QNX opendir resides in libc but dirent.h is still required
  173. if test "`uname -s 2>/dev/null`" != "QNX"; then
  174. AC_HEADER_DIRENT
  175. else
  176. AC_CHECK_HEADERS(dirent.h)
  177. fi
  178. AC_MISSING_FCLOSE_DECL
  179. dnl QNX requires unix.h to allow functions in libunix to work properly
  180. AC_CHECK_HEADERS(
  181. arpa/inet.h \
  182. crypt.h \
  183. dlfcn.h \
  184. fcntl.h \
  185. grp.h \
  186. limits.h \
  187. locale.h \
  188. memory.h \
  189. netinet/in.h \
  190. pwd.h \
  191. signal.h \
  192. stdarg.h \
  193. stdlib.h \
  194. string.h \
  195. sys/file.h \
  196. sys/mman.h \
  197. sys/select.h \
  198. sys/socket.h \
  199. sys/statfs.h \
  200. sys/statvfs.h \
  201. sys/time.h \
  202. sys/types.h \
  203. sys/varargs.h \
  204. sys/wait.h \
  205. syslog.h \
  206. unistd.h \
  207. unix.h \
  208. )
  209. dnl Checks for typedefs, structures, and compiler characteristics.
  210. AC_STRUCT_TM
  211. AC_STRUCT_TIMEZONE
  212. PHP_TM_GMTOFF
  213. PHP_STRUCT_FLOCK
  214. PHP_SOCKLEN_T
  215. AC_CHECK_SIZEOF(long, 8)
  216. AC_CHECK_SIZEOF(int, 4)
  217. test -d /usr/ucblib && AC_ADD_LIBPATH(/usr/ucblib)
  218. dnl Check for members of the stat structure
  219. AC_STRUCT_ST_BLKSIZE
  220. dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exists
  221. dnl The WARNING_LEVEL required because cc in QNX hates -w option without an argument
  222. if test "`uname -s 2>/dev/null`" != "QNX"; then
  223. AC_STRUCT_ST_BLOCKS
  224. else
  225. AC_MSG_WARN(warnings level for cc set to 0)
  226. WARNING_LEVEL=0
  227. fi
  228. AC_STRUCT_ST_RDEV
  229. dnl Checks for types
  230. AC_TYPE_SIZE_T
  231. AC_TYPE_UID_T
  232. dnl This is required for QNX and may be some BSD derived systems
  233. AC_CHECK_TYPE( uint, unsigned int )
  234. AC_CHECK_TYPE( ulong, unsigned long )
  235. dnl Checks for library functions.
  236. AC_FUNC_VPRINTF
  237. AC_CHECK_FUNCS(
  238. asctime_r \
  239. crypt \
  240. ctime_r \
  241. cuserid \
  242. flock \
  243. gcvt \
  244. getlogin \
  245. gethostbyaddr \
  246. gettimeofday \
  247. gmtime_r \
  248. inet_aton \
  249. link \
  250. localtime_r \
  251. lockf \
  252. lrand48 \
  253. memcpy \
  254. memmove \
  255. mmap \
  256. putenv \
  257. random \
  258. rand_r \
  259. regcomp \
  260. rint \
  261. setitimer \
  262. setlocale \
  263. setsockopt \
  264. setvbuf \
  265. shutdown \
  266. sin \
  267. snprintf \
  268. srand48 \
  269. srandom \
  270. statfs \
  271. statvfs \
  272. strcasecmp \
  273. strdup \
  274. strerror \
  275. strftime \
  276. strstr \
  277. strtok_r \
  278. symlink \
  279. tempnam \
  280. tzset \
  281. unsetenv \
  282. usleep \
  283. utime \
  284. vsnprintf \
  285. )
  286. AC_REPLACE_FUNCS(strlcat strlcpy getopt)
  287. AC_FUNC_UTIME_NULL
  288. AC_FUNC_ALLOCA
  289. AC_BROKEN_SPRINTF
  290. PHP_DECLARED_TIMEZONE
  291. dnl AIX keeps in_addr_t in /usr/include/netinet/in.h
  292. dnl AC_MSG_CHECKING(for in_addr_t)
  293. AC_CACHE_VAL(ac_cv_type_$1,
  294. [AC_EGREP_CPP(dnl
  295. changequote(<<,>>)dnl
  296. <<in_addr_t[^a-zA-Z_0-9]>>dnl
  297. changequote([,]), [#include <sys/types.h>
  298. #if STDC_HEADERS
  299. #include <stdlib.h>
  300. #include <stddef.h>
  301. #endif
  302. #ifdef HAVE_NETINET_IN_H
  303. #include <netinet/in.h>
  304. #endif], ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)])dnl
  305. dnl AC_MSG_RESULT($ac_cv_type_in_addr_t)
  306. if test $ac_cv_type_in_addr_t = no; then
  307. AC_DEFINE(in_addr_t, u_int)
  308. fi
  309. divert(3)
  310. abs_srcdir=`(cd $srcdir; pwd)`
  311. abs_builddir=`pwd`
  312. AC_MSG_CHECKING(whether to use a configuration file)
  313. AC_ARG_WITH(config-file-path,
  314. [ --with-config-file-path=PATH
  315. Sets the path in which to look for php.ini.
  316. defaults to /usr/local/lib],
  317. [
  318. if test "$withval" = "yes"; then
  319. AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "/usr/local/lib")
  320. AC_DEFINE(USE_CONFIG_FILE, 1)
  321. AC_MSG_RESULT(yes)
  322. else
  323. if test "$withval" != "no"; then
  324. AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "$withval")
  325. AC_DEFINE(USE_CONFIG_FILE, 1)
  326. AC_MSG_RESULT(yes)
  327. else
  328. AC_DEFINE(CONFIGURATION_FILE_PATH, 0)
  329. AC_DEFINE(USE_CONFIG_FILE, 0)
  330. AC_MSG_RESULT(no)
  331. fi
  332. fi
  333. ],[
  334. AC_DEFINE_UNQUOTED(CONFIGURATION_FILE_PATH, "/usr/local/lib")
  335. AC_DEFINE(USE_CONFIG_FILE, 1)
  336. AC_MSG_RESULT(yes)
  337. ])
  338. AC_ARG_ENABLE(debug,
  339. [ --disable-debug Compile without debugging symbols], [
  340. PHP_DEBUG=$enableval
  341. ],[
  342. PHP_DEBUG=yes
  343. ])
  344. AC_MSG_CHECKING(whether to include debugging symbols)
  345. AC_MSG_RESULT($PHP_DEBUG)
  346. if test "$PHP_DEBUG" = "yes"; then
  347. AC_DEFINE(DEBUG,1)
  348. PHP_DEBUG=1
  349. ZEND_DEBUG=yes
  350. else
  351. AC_DEFINE(DEBUG,0)
  352. PHP_DEBUG=0
  353. ZEND_DEBUG=no
  354. fi
  355. test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
  356. AC_MSG_CHECKING(whether to enable safe mode by default)
  357. AC_ARG_ENABLE(safe-mode,
  358. [ --enable-safe-mode Enable safe mode by default.],
  359. [
  360. if test "$enableval" = "yes"; then
  361. AC_DEFINE(PHP_SAFE_MODE, 1)
  362. AC_MSG_RESULT(yes)
  363. else
  364. AC_DEFINE(PHP_SAFE_MODE, 0)
  365. AC_MSG_RESULT(no)
  366. fi
  367. ],[
  368. AC_DEFINE(PHP_SAFE_MODE, 0)
  369. AC_MSG_RESULT(no)
  370. ])
  371. AC_MSG_CHECKING(for safe mode exec dir)
  372. AC_ARG_WITH(exec-dir,
  373. [ --with-exec-dir[=DIR] Only allow executables in DIR when in safe mode
  374. defaults to /usr/local/php/bin],
  375. [
  376. if test "$withval" != "no"; then
  377. if test "$withval" = "yes"; then
  378. AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin")
  379. AC_MSG_RESULT(/usr/local/php/bin)
  380. else
  381. AC_DEFINE_UNQUOTED(PHP_SAFE_MODE_EXEC_DIR,"$withval")
  382. AC_MSG_RESULT($withval)
  383. fi
  384. else
  385. AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin")
  386. AC_MSG_RESULT(/usr/local/php/bin)
  387. fi
  388. ],[
  389. AC_DEFINE(PHP_SAFE_MODE_EXEC_DIR,"/usr/local/php/bin")
  390. AC_MSG_RESULT(/usr/local/php/bin)
  391. ])
  392. AC_MSG_CHECKING(whether to enable track_vars variables by default)
  393. AC_ARG_ENABLE(track-vars,
  394. [ --enable-track-vars Enable GET/POST/Cookie track variables by default.],
  395. [
  396. if test "$enableval" = "yes"; then
  397. AC_DEFINE(PHP_TRACK_VARS, 1)
  398. AC_MSG_RESULT(yes)
  399. else
  400. AC_DEFINE(PHP_TRACK_VARS, 0)
  401. AC_MSG_RESULT(no)
  402. fi
  403. ],[
  404. AC_DEFINE(PHP_TRACK_VARS, 0)
  405. AC_MSG_RESULT(no)
  406. ])
  407. AC_MSG_CHECKING(whether to enable magic quotes by default)
  408. AC_ARG_ENABLE(magic-quotes,
  409. [ --enable-magic-quotes Enable magic quotes by default.],
  410. [
  411. if test "$enableval" = "yes"; then
  412. AC_DEFINE(MAGIC_QUOTES, 1)
  413. AC_MSG_RESULT(yes)
  414. else
  415. AC_DEFINE(MAGIC_QUOTES, 0)
  416. AC_MSG_RESULT(no)
  417. fi
  418. ],[
  419. AC_DEFINE(MAGIC_QUOTES, 0)
  420. AC_MSG_RESULT(no)
  421. ])
  422. AC_MSG_CHECKING(whether to enable runpaths)
  423. AC_ARG_ENABLE(rpath,
  424. [ --disable-rpath Disable passing additional runtime library
  425. search paths],
  426. [
  427. if test "$enableval" = "no"; then
  428. enable_rpath=no
  429. else
  430. enable_rpath=yes
  431. fi
  432. ],[
  433. enable_rpath=yes
  434. ])
  435. AC_MSG_RESULT($enable_rpath)
  436. AC_MSG_CHECKING(whether to enable short tags by default)
  437. AC_ARG_ENABLE(short-tags,
  438. [ --disable-short-tags Disable the short-form <? start tag by default.],
  439. [
  440. if test "$enableval" = "no"; then
  441. AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, 0)
  442. AC_MSG_RESULT(no)
  443. else
  444. AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, 1)
  445. AC_MSG_RESULT(yes)
  446. fi
  447. ],[
  448. AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, 1)
  449. AC_MSG_RESULT(yes)
  450. ])
  451. AC_MSG_CHECKING(whether to enable the URL-aware fopen wrapper)
  452. AC_ARG_ENABLE(url-fopen-wrapper,
  453. [ --disable-url-fopen-wrapper
  454. Disable the URL-aware fopen wrapper that allows
  455. accessing files via http or ftp.],
  456. [
  457. if test "$enableval" = "yes"; then
  458. AC_DEFINE(PHP3_URL_FOPEN, 1)
  459. AC_MSG_RESULT(yes)
  460. else
  461. AC_DEFINE(PHP3_URL_FOPEN, 0)
  462. AC_MSG_RESULT(no)
  463. fi
  464. ],[
  465. AC_DEFINE(PHP3_URL_FOPEN, 1)
  466. AC_MSG_RESULT(yes)
  467. ])
  468. DMALLOC_RESULT=no
  469. AC_MSG_CHECKING(whether to enable dmalloc)
  470. AC_ARG_ENABLE(dmalloc,
  471. [ --enable-dmalloc Enable dmalloc],
  472. [
  473. if test "$enableval" = "yes" ; then
  474. AC_DEFINE(HAVE_DMALLOC, 1)
  475. AC_ADD_LIBRARY(dmalloc)
  476. CFLAGS="$CFLAGS -DDMALLOC_FUNC_CHECK"
  477. DMALLOC_RESULT=yes
  478. fi
  479. ])
  480. AC_MSG_RESULT($DMALLOC_RESULT)
  481. AC_ARG_ENABLE(pear,
  482. [ --disable-pear Do not install PEAR],[
  483. PHP_PEAR=$enableval
  484. ],[
  485. PHP_PEAR=yes
  486. ])
  487. AC_MSG_CHECKING(whether to install PEAR)
  488. AC_MSG_RESULT($PHP_PEAR)
  489. if test "$PHP_PEAR" = "yes"; then
  490. PEAR_DIR=pear
  491. fi
  492. PHP_SAPI=cgi
  493. PHP_BUILD_PROGRAM
  494. dnl paths to the targets relative to the build directory
  495. SAPI_PROGRAM=php
  496. dnl on HP-UX, the extension is .sl. Need to improve this
  497. SAPI_SHARED=libs/libphp4.so
  498. SAPI_STATIC=libs/libphp4.a
  499. PHP_CONFIGURE_PART(Configuring SAPI modules)
  500. esyscmd(./scripts/config-stubs sapi)
  501. AC_MSG_CHECKING(for chosen SAPI module)
  502. AC_MSG_RESULT($PHP_SAPI)
  503. divert(4)
  504. PHP_CONFIGURE_PART(Configuring extensions)
  505. # reading config stubs
  506. esyscmd(./scripts/config-stubs ext)
  507. PHP_FAST_OUTPUT(sapi/$PHP_SAPI/Makefile)
  508. AC_MSG_CHECKING(whether to enable versioning)
  509. AC_ARG_ENABLE(versioning,
  510. [ --enable-versioning Export only required symbols.
  511. See INSTALL for more information],[
  512. PHP_VERSIONING=$enableval
  513. ],[
  514. PHP_VERSIONING=no
  515. ])
  516. AC_MSG_RESULT($PHP_VERSIONING)
  517. if test "$PHP_VERSIONING" = "yes"; then
  518. test -z "$PHP_SYM_FILE" && PHP_SYM_FILE="$abs_srcdir/sapi/$PHP_SAPI/php.sym"
  519. if test -f "$PHP_SYM_FILE"; then
  520. EXTRA_LDFLAGS="-export-symbols $PHP_SYM_FILE"
  521. fi
  522. fi
  523. divert(5)
  524. enable_shared=yes
  525. enable_static=yes
  526. case "$php_build_target" in
  527. program)
  528. enable_shared=no
  529. ;;
  530. shared)
  531. enable_static=no
  532. EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version"
  533. ;;
  534. static)
  535. enable_shared=no
  536. ;;
  537. esac
  538. if test "$PHP_SAPI" = "cgi"; then
  539. PHP_PROGRAM=php
  540. fi
  541. PHP_REGEX
  542. case "`uname -s`" in
  543. SunOS*)
  544. CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS";;
  545. esac
  546. CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  547. PHP_CONFIGURE_PART(Configuring Zend)
  548. LIBZEND_BASIC_CHECKS
  549. LIBZEND_OTHER_CHECKS
  550. if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then
  551. TSRM_LIB='TSRM/libtsrm.la'
  552. TSRM_DIR=TSRM
  553. AC_DEFINE(ZTS)
  554. INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM"
  555. PHP_THREAD_SAFETY=yes
  556. else
  557. PHP_THREAD_SAFETY=no
  558. fi
  559. if test "$abs_srcdir" != "$abs_builddir"; then
  560. INCLUDES="$INCLUDES -I\$(top_srcdir)/Zend"
  561. if test "$PHP_THREAD_SAFETY" = "yes"; then
  562. INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM"
  563. fi
  564. fi
  565. dnl *** Commented out - generates slow code and consumes a lot of
  566. dnl *** resources during compilation - we need to figure out how
  567. dnl *** to supply it only when absolutely necessary
  568. dnl If we are using gcc add -fpic to make dl() work on some platforms
  569. dnl test -n "$GCC" && CFLAGS="$CFLAGS -fpic"
  570. dnl add -fPIC option on Solaris if we are building dynamic extensions
  571. dnl PHP_SOLARIS_PIC_WEIRDNESS
  572. EXTRA_LIBS="$EXTRA_LIBS $LIBS"
  573. LIBS=""
  574. LDFLAGS=""
  575. if test "$PHP_THREAD_SAFETY" = "yes"; then
  576. PHP_CONFIGURE_PART(Configuring TSRM)
  577. TSRM_BASIC_CHECKS
  578. TSRM_OTHER_CHECKS
  579. EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
  580. EXTRA_LIBS="$EXTRA_LIBS $LIBS"
  581. LDFLAGS=""
  582. LIBS=""
  583. PHP_OUTPUT(TSRM/Makefile)
  584. fi
  585. phplibdir="`pwd`/modules"
  586. phptempdir="`pwd`/libs"
  587. AC_BUILD_RPATH
  588. EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
  589. PHP_BUILD_DATE=`date '+%Y-%m-%d'`
  590. AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE")
  591. PHP_UNAME=`uname -a`
  592. AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME")
  593. PHP_OS=`uname`
  594. AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS")
  595. PHP_SUBST(abs_builddir)
  596. PHP_SUBST(abs_srcdir)
  597. PHP_SUBST(bindir)
  598. PHP_SUBST(exec_prefix)
  599. PHP_SUBST(includedir)
  600. PHP_SUBST(libdir)
  601. PHP_SUBST(phplibdir)
  602. PHP_SUBST(phptempdir)
  603. PHP_SUBST(prefix)
  604. PHP_SUBST(CC)
  605. PHP_SUBST(CFLAGS)
  606. PHP_SUBST(CONFIGURE_COMMAND)
  607. PHP_SUBST(CPP)
  608. PHP_SUBST(CPPFLAGS)
  609. PHP_SUBST(CXX)
  610. PHP_SUBST(DEBUG_CFLAGS)
  611. PHP_SUBST(DEFS)
  612. PHP_SUBST(EXTRA_LDFLAGS)
  613. PHP_SUBST(EXTRA_LIBS)
  614. PHP_SUBST(INCLUDES)
  615. PHP_SUBST(INSTALL_IT)
  616. PHP_SUBST(LEX)
  617. PHP_SUBST(LEX_OUTPUT_ROOT)
  618. PHP_SUBST(LFLAGS)
  619. PHP_SUBST(LIBTOOL)
  620. PHP_SUBST(NATIVE_RPATHS)
  621. PHP_SUBST(PEAR_DIR)
  622. PHP_SUBST(PHP_BUILD_DATE)
  623. PHP_SUBST(PHP_COMPILE)
  624. PHP_SUBST(PHP_LDFLAGS)
  625. PHP_SUBST(PHP_LIBS)
  626. PHP_SUBST(PHP_PROGRAM)
  627. PHP_SUBST(PHP_RPATHS)
  628. PHP_SUBST(PHP_SAPI)
  629. PHP_SUBST(PHP_VERSION)
  630. PHP_SUBST(PROG_SENDMAIL)
  631. PHP_SUBST(SHELL)
  632. PHP_SUBST(SHLIBTOOL)
  633. PHP_SUBST(TSRM_DIR)
  634. PHP_SUBST(TSRM_LIB)
  635. PHP_SUBST(WARNING_LEVEL)
  636. PHP_SUBST(YACC)
  637. PHP_CONFIGURE_PART(Configuring libtool)
  638. AM_PROG_LIBTOOL
  639. if test "$enable_debug" != "yes"; then
  640. AM_SET_LIBTOOL_VARIABLE([--silent])
  641. fi
  642. PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
  643. if test "$enable_shared" = "yes"; then
  644. SHLIBTOOL='$(LIBTOOL)'
  645. else
  646. if test -n "$EXT_SHARED"; then
  647. PHP_CONFIGURE_PART(Configuring shared libtool)
  648. $SHELL $srcdir/ltconfig --output=shlibtool --disable-static --srcdir=$srcdir --cache-file=./config.cache $srcdir/ltmain.sh
  649. SHLIBTOOL='$(SHELL) $(top_builddir)/shlibtool'
  650. else
  651. PHP_COMPILE='$(COMPILE) -c $< && touch $@'
  652. fi
  653. fi
  654. test "$prefix" = "NONE" && prefix="/usr/local"
  655. test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
  656. PHP_CONFIGURE_PART(Generating files)
  657. PHP_FAST_GENERATE
  658. #libphp4.module
  659. AC_OUTPUT([php4.spec Zend/Makefile
  660. scripts/mkextlib build-defs.h
  661. $PHP_OUTPUT_FILES
  662. ], [], [
  663. if test ! -f $srcdir/ext/bcmath/number.c; then
  664. echo "creating number.c"
  665. echo "/* Dummy File */" > $srcdir/ext/bcmath/number.c
  666. echo "creating number.h"
  667. echo "/* Dummy File */" > $srcdir/ext/bcmath/number.h
  668. fi
  669. ################################################################
  670. # Create configuration headers
  671. #
  672. if test -d TSRM; then
  673. echo '#include "../php_config.h"' > TSRM/tsrm_config.h
  674. fi
  675. cat >Zend/zend_config.h <<FEO
  676. #include "../php_config.h"
  677. #if defined(APACHE) && defined(PHP_API_VERSION)
  678. #undef HAVE_DLFCN_H
  679. #endif
  680. FEO
  681. # run this only when generating all the files?
  682. if true; then
  683. chmod +x scripts/mkextlib
  684. # Hacking while airborne considered harmful.
  685. #
  686. echo "creating internal_functions.c"
  687. extensions=\`grep '^s.@EXT_STATIC@' \$0|sed -e 's/^.*@% *//' -e 's/%.*$//'\`
  688. mv -f internal_functions.c internal_functions.c.old 2>/dev/null
  689. sh $srcdir/genif.sh $srcdir/internal_functions.c.in $srcdir \$extensions > internal_functions.c
  690. if cmp internal_functions.c.old internal_functions.c > /dev/null 2>&1; then
  691. echo "internal_functions.c is unchanged"
  692. mv internal_functions.c.old internal_functions.c
  693. else
  694. rm -f internal_functions.c.old
  695. fi
  696. if test -n "$PHP_APXS_BROKEN"; then
  697. echo "+--------------------------------------------------------------------+"
  698. echo "| WARNING: Your $APXS script is most likely broken."
  699. echo "| |"
  700. echo "| Please go read http://www.php.net/FAQ.php3#4.11 and make the |"
  701. echo "| changes described there and try again. |"
  702. fi
  703. # Warn about CGI version with no extra security options.
  704. if test "$PHP_SAPI" = "cgi"; then
  705. if test "$REDIRECT" = "0"; then
  706. if test "$DISCARD_PATH" = "0"; then
  707. echo "+--------------------------------------------------------------------+"
  708. echo "| Warning: |"
  709. echo "| You will be compiling the CGI version of PHP without any |"
  710. echo "| redirection checking. By putting this cgi binary somewhere in |"
  711. echo "| your web space, users may be able to circumvent existing .htaccess |"
  712. echo "| security by loading files directly through the parser. See |"
  713. echo "| http://www.php.net/manual/config-security.php3 for more details. |"
  714. fi
  715. fi
  716. fi
  717. echo "+--------------------------------------------------------------------+"
  718. echo "| License: |"
  719. echo "| This software is subject to the PHP License, available in this |"
  720. echo "| distribution in the file LICENSE. By continuing this installation |"
  721. echo "| process, you are bound by the terms of this license agreement. |"
  722. echo "| If you do not agree with the terms of this license, you must abort |"
  723. echo "| the installation process at this point. |"
  724. echo "+--------------------------------------------------------------------+"
  725. fi
  726. ])
  727. dnl ## Local Variables:
  728. dnl ## tab-width: 4
  729. dnl ## End: