configure.ac 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723
  1. ## -*- autoconf -*-
  2. dnl ## Process this file with autoconf to produce a configure script.
  3. dnl include Zend specific macro definitions first
  4. dnl -------------------------------------------------------------------------
  5. sinclude(Zend/acinclude.m4)
  6. dnl Basic autoconf + automake initialization, generation of config.nice.
  7. dnl -------------------------------------------------------------------------
  8. AC_PREREQ([2.68])
  9. AC_INIT(README.GIT-RULES)
  10. ifdef([AC_PRESERVE_HELP_ORDER], [AC_PRESERVE_HELP_ORDER], [])
  11. PHP_CONFIG_NICE(config.nice)
  12. PHP_CANONICAL_HOST_TARGET
  13. AC_CONFIG_HEADERS([main/php_config.h])
  14. AH_TOP([
  15. #ifndef PHP_CONFIG_H
  16. #define PHP_CONFIG_H
  17. #if defined(__GNUC__) && __GNUC__ >= 4
  18. # define ZEND_API __attribute__ ((visibility("default")))
  19. # define ZEND_DLEXPORT __attribute__ ((visibility("default")))
  20. #else
  21. # define ZEND_API
  22. # define ZEND_DLEXPORT
  23. #endif
  24. #define ZEND_DLIMPORT
  25. #undef uint
  26. #undef ulong
  27. ])
  28. AH_BOTTOM([
  29. #ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
  30. #ifdef HAVE_STDLIB_H
  31. # include <stdlib.h>
  32. #endif
  33. #ifdef HAVE_SYS_TYPES_H
  34. # include <sys/types.h>
  35. #endif
  36. #ifdef HAVE_SYS_SELECT_H
  37. #include <sys/select.h>
  38. #endif
  39. #ifdef HAVE_IEEEFP_H
  40. # include <ieeefp.h>
  41. #endif
  42. #ifdef HAVE_STRING_H
  43. # include <string.h>
  44. #else
  45. # include <strings.h>
  46. #endif
  47. #if ZEND_BROKEN_SPRINTF
  48. int zend_sprintf(char *buffer, const char *format, ...);
  49. #else
  50. # define zend_sprintf sprintf
  51. #endif
  52. #include <math.h>
  53. #ifndef zend_isnan
  54. #if HAVE_DECL_ISNAN && (!defined(__cplusplus) || __cplusplus < 201103L)
  55. #define zend_isnan(a) isnan(a)
  56. #elif defined(HAVE_FPCLASS)
  57. #define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
  58. #else
  59. #define zend_isnan(a) ((a) != (a))
  60. #endif
  61. #endif
  62. #if HAVE_DECL_ISINF && (!defined(__cplusplus) || __cplusplus < 201103L)
  63. #define zend_isinf(a) isinf(a)
  64. #elif defined(INFINITY)
  65. /* Might not work, but is required by ISO C99 */
  66. #define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
  67. #elif defined(HAVE_FPCLASS)
  68. #define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
  69. #else
  70. #define zend_isinf(a) 0
  71. #endif
  72. #if HAVE_DECL_ISFINITE && (!defined(__cplusplus) || __cplusplus < 201103L)
  73. #define zend_finite(a) isfinite(a)
  74. #elif defined(HAVE_FINITE)
  75. #define zend_finite(a) finite(a)
  76. #elif defined(fpclassify)
  77. #define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
  78. #else
  79. #define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
  80. #endif
  81. #endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
  82. #undef PTHREADS
  83. #endif /* PHP_CONFIG_H */
  84. ])
  85. PHP_MAJOR_VERSION=7
  86. PHP_MINOR_VERSION=3
  87. PHP_RELEASE_VERSION=28
  88. PHP_EXTRA_VERSION=""
  89. PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
  90. PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
  91. dnl Allow version values to be used in Makefile
  92. PHP_SUBST(PHP_MAJOR_VERSION)
  93. PHP_SUBST(PHP_MINOR_VERSION)
  94. PHP_SUBST(PHP_RELEASE_VERSION)
  95. PHP_SUBST(PHP_EXTRA_VERSION)
  96. dnl Define where extension directories are located in the configure context
  97. AC_DEFUN([PHP_EXT_BUILDDIR],[$config_m4_dir])dnl
  98. AC_DEFUN([PHP_EXT_DIR],[$config_m4_dir])dnl
  99. AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir/$config_m4_dir])dnl
  100. AC_DEFUN([PHP_ALWAYS_SHARED],[])dnl
  101. dnl Setting up the PHP version based on the information above.
  102. dnl -------------------------------------------------------------------------
  103. echo "/* automatically generated by configure */" > php_version.h.new
  104. echo "/* edit configure.ac to change version number */" >> php_version.h.new
  105. echo "#define PHP_MAJOR_VERSION $PHP_MAJOR_VERSION" >> php_version.h.new
  106. echo "#define PHP_MINOR_VERSION $PHP_MINOR_VERSION" >> php_version.h.new
  107. echo "#define PHP_RELEASE_VERSION $PHP_RELEASE_VERSION" >> php_version.h.new
  108. echo "#define PHP_EXTRA_VERSION \"$PHP_EXTRA_VERSION\"" >> php_version.h.new
  109. echo "#define PHP_VERSION \"$PHP_VERSION\"" >> php_version.h.new
  110. echo "#define PHP_VERSION_ID $PHP_VERSION_ID" >> php_version.h.new
  111. cmp php_version.h.new $srcdir/main/php_version.h >/dev/null 2>&1
  112. if test $? -ne 0 ; then
  113. rm -f $srcdir/main/php_version.h && mv php_version.h.new $srcdir/main/php_version.h && \
  114. echo 'Updated main/php_version.h'
  115. else
  116. rm -f php_version.h.new
  117. fi
  118. dnl Settings we want to make before the checks.
  119. dnl -------------------------------------------------------------------------
  120. cwd=`pwd`
  121. php_shtool=$srcdir/build/shtool
  122. T_MD=`$php_shtool echo -n -e %B`
  123. T_ME=`$php_shtool echo -n -e %b`
  124. PHP_INIT_BUILD_SYSTEM
  125. dnl We want this one before the checks, so the checks can modify CFLAGS.
  126. test -z "$CFLAGS" && auto_cflags=1
  127. abs_srcdir=`(cd $srcdir; pwd)`
  128. abs_builddir=`pwd`
  129. php_abs_top_srcdir=$abs_srcdir
  130. php_abs_top_builddir=$abs_builddir
  131. dnl Because ``make install'' is often performed by the superuser,
  132. dnl we create the libs subdirectory as the user who configures PHP.
  133. dnl Otherwise, the current user will not be able to delete libs
  134. dnl or the contents of libs.
  135. $php_shtool mkdir -p libs
  136. rm -f libs/*
  137. dnl Checks for programs.
  138. dnl -------------------------------------------------------------------------
  139. AC_PROG_CC([cc gcc])
  140. PHP_DETECT_ICC
  141. PHP_DETECT_SUNCC
  142. AC_PROG_CC_C_O
  143. dnl Change to AC_PROG_CC_STDC when we start requiring a post-2.13 autoconf
  144. dnl AC_PROG_CC_STDC
  145. AC_PROG_CPP
  146. AC_USE_SYSTEM_EXTENSIONS
  147. AC_PROG_LN_S
  148. dnl Support systems with system libraries in e.g. /usr/lib64
  149. PHP_ARG_WITH(libdir, for system library directory,
  150. [ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib],lib,no)
  151. PHP_ARG_ENABLE(rpath, whether to enable runpaths,
  152. [ --disable-rpath Disable passing additional runtime library
  153. search paths], yes, no)
  154. dnl check for -R, etc. switch
  155. PHP_RUNPATH_SWITCH
  156. dnl Checks for some support/generator progs
  157. PHP_PROG_AWK
  158. PHP_PROG_BISON
  159. PHP_PROG_RE2C
  160. dnl Check if bison generated files exist when bison does not..
  161. case $php_cv_bison_version in
  162. ""|invalid[)]
  163. if ! test -f "$abs_srcdir/Zend/zend_language_parser.h" || ! test -f "$abs_srcdir/Zend/zend_language_parser.c" ; then
  164. AC_MSG_ERROR([bison is required to build PHP/Zend when building a GIT checkout!])
  165. fi
  166. ;;
  167. esac
  168. PHP_ARG_ENABLE(re2c-cgoto, whether to enable computed goto gcc extension with re2c,
  169. [ --enable-re2c-cgoto Enable -g flag to re2c to use computed goto gcc extension], no, no)
  170. if test "$PHP_RE2C_CGOTO" = "no"; then
  171. RE2C_FLAGS=""
  172. else
  173. AC_MSG_CHECKING([whether re2c -g works])
  174. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[
  175. int main(int argc, const char **argv)
  176. {
  177. argc = argc;
  178. argv = argv;
  179. label1:
  180. label2:
  181. static void *adr[] = { &&label1, &&label2};
  182. goto *adr[0];
  183. return 0;
  184. }
  185. ]])],[
  186. RE2C_FLAGS=""
  187. AC_MSG_RESULT([no])
  188. ],[
  189. RE2C_FLAGS="-g"
  190. AC_MSG_RESULT([yes])
  191. ])
  192. fi
  193. PHP_SUBST(RE2C_FLAGS)
  194. dnl Platform-specific compile settings.
  195. dnl -------------------------------------------------------------------------
  196. dnl See bug #28605
  197. case $host_cpu in
  198. alpha*)
  199. if test "$GCC" = "yes"; then
  200. CFLAGS="$CFLAGS -mieee"
  201. else
  202. CFLAGS="$CFLAGS -ieee"
  203. fi
  204. ;;
  205. sparc*)
  206. if test "$SUNCC" = "yes"; then
  207. CFLAGS="$CFLAGS -xmemalign=8s"
  208. fi
  209. ;;
  210. esac
  211. dnl Mark symbols hidden by default if the compiler (for example, gcc >= 4)
  212. dnl supports it. This can help reduce the binary size and startup time.
  213. AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
  214. [CFLAGS="$CFLAGS -fvisibility=hidden"])
  215. case $host_alias in
  216. *solaris*)
  217. CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
  218. if test "${enable_libgcc+set}" != "set" && test "$GCC" = "yes"; then
  219. enable_libgcc=yes
  220. fi
  221. ;;
  222. *dgux*)
  223. CPPFLAGS="$CPPFLAGS -D_BSD_TIMEOFDAY_FLAVOR"
  224. ;;
  225. *darwin*|*rhapsody*)
  226. if test -n "$GCC"; then
  227. PHP_CHECK_GCC_ARG(-no-cpp-precomp, gcc_no_cpp_precomp=yes)
  228. if test "$gcc_no_cpp_precomp" = "yes"; then
  229. CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
  230. fi
  231. fi
  232. php_multiple_shlib_versions_ok=yes
  233. ;;
  234. *beos*)
  235. beos_threads=1
  236. LIBS="$LIBS -lbe -lroot"
  237. ;;
  238. *mips*)
  239. CPPFLAGS="$CPPFLAGS -D_XPG_IV"
  240. ;;
  241. *hpux*)
  242. if test "$GCC" = "yes"; then
  243. CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
  244. fi
  245. ;;
  246. esac
  247. # Disable PIC mode by default where it is known to be safe to do so,
  248. # to avoid the performance hit from the lost register
  249. AC_MSG_CHECKING([whether to force non-PIC code in shared modules])
  250. case $host_alias in
  251. i?86-*-linux*|i?86-*-freebsd*)
  252. if test "${with_pic+set}" != "set" || test "$with_pic" = "no"; then
  253. with_pic=no
  254. AC_MSG_RESULT(yes)
  255. else
  256. AC_MSG_RESULT(no)
  257. fi
  258. ;;
  259. *)
  260. AC_MSG_RESULT(no)
  261. ;;
  262. esac
  263. dnl Include Zend and TSRM configurations.
  264. dnl -------------------------------------------------------------------------
  265. sinclude(Zend/Zend.m4)
  266. sinclude(TSRM/threads.m4)
  267. sinclude(TSRM/tsrm.m4)
  268. dnl .
  269. dnl -------------------------------------------------------------------------
  270. PTHREADS_CHECK
  271. PHP_HELP_SEPARATOR([SAPI modules:])
  272. PHP_SHLIB_SUFFIX_NAMES
  273. PHP_BUILD_PROGRAM
  274. PHP_SAPI=none
  275. dnl SAPI configuration.
  276. dnl -------------------------------------------------------------------------
  277. dnl paths to the targets are relative to the build directory
  278. SAPI_SHARED=libs/libphp[]$PHP_MAJOR_VERSION[.]$SHLIB_DL_SUFFIX_NAME
  279. SAPI_STATIC=libs/libphp[]$PHP_MAJOR_VERSION[.a]
  280. SAPI_LIBTOOL=libphp[]$PHP_MAJOR_VERSION[.la]
  281. PHP_CONFIGURE_PART(Configuring SAPI modules)
  282. esyscmd(./build/config-stubs sapi)
  283. dnl Show which main SAPI was selected
  284. AC_MSG_CHECKING([for chosen SAPI module])
  285. AC_MSG_RESULT([$PHP_SAPI])
  286. dnl Show which binaries were selected
  287. AC_MSG_CHECKING([for executable SAPI binaries])
  288. if test "$PHP_BINARIES"; then
  289. AC_MSG_RESULT([$PHP_BINARIES])
  290. else
  291. AC_MSG_RESULT([none])
  292. fi
  293. dnl Exit early
  294. if test -z "$PHP_INSTALLED_SAPIS"; then
  295. AC_MSG_ERROR([Nothing to build.])
  296. fi
  297. dnl force ZTS
  298. if test "$enable_maintainer_zts" = "yes"; then
  299. PTHREADS_ASSIGN_VARS
  300. PTHREADS_FLAGS
  301. fi
  302. dnl Starting system checks.
  303. dnl -------------------------------------------------------------------------
  304. PHP_CONFIGURE_PART(Running system checks)
  305. dnl Find sendmail binary
  306. PHP_PROG_SENDMAIL
  307. dnl Check whether the system uses EBCDIC (not ASCII) as its native codeset
  308. PHP_EBCDIC
  309. dnl Check whether the system byte ordering is bigendian
  310. PHP_C_BIGENDIAN
  311. dnl Check whether writing to stdout works
  312. PHP_TEST_WRITE_STDOUT
  313. dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
  314. dnl and source packages. This should be harmless on other OSs.
  315. if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
  316. CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
  317. LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
  318. fi
  319. test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib)
  320. dnl First, library checks.
  321. dnl -------------------------------------------------------------------------
  322. dnl Some systems (OpenServer 5) dislike -lsocket -lnsl, so we try
  323. dnl to avoid -lnsl checks, if we already have the functions which
  324. dnl are usually in libnsl
  325. dnl Also, uClibc will bark at linking with glibc's libnsl.
  326. PHP_CHECK_FUNC(socket, socket)
  327. PHP_CHECK_FUNC(socketpair, socket)
  328. PHP_CHECK_FUNC(htonl, socket)
  329. PHP_CHECK_FUNC(gethostname, nsl)
  330. PHP_CHECK_FUNC(gethostbyaddr, nsl)
  331. PHP_CHECK_FUNC(yp_get_default_domain, nsl)
  332. PHP_CHECK_FUNC(dlopen, dl)
  333. if test "$ac_cv_func_dlopen" = "yes"; then
  334. AC_DEFINE(HAVE_LIBDL, 1, [ ])
  335. fi
  336. AC_CHECK_LIB(m, sin)
  337. dnl Check for inet_aton
  338. dnl in -lc, -lbind and -lresolv
  339. PHP_CHECK_FUNC(inet_aton, resolv, bind)
  340. dnl Then headers.
  341. dnl -------------------------------------------------------------------------
  342. dnl Checks for header files.
  343. AC_HEADER_STDC
  344. AC_HEADER_DIRENT
  345. dnl QNX requires unix.h to allow functions in libunix to work properly
  346. AC_CHECK_HEADERS([ \
  347. inttypes.h \
  348. stdint.h \
  349. dirent.h \
  350. ApplicationServices/ApplicationServices.h \
  351. sys/param.h \
  352. sys/types.h \
  353. sys/time.h \
  354. netinet/in.h \
  355. alloca.h \
  356. arpa/inet.h \
  357. arpa/nameser.h \
  358. assert.h \
  359. crypt.h \
  360. dns.h \
  361. fcntl.h \
  362. grp.h \
  363. ieeefp.h \
  364. langinfo.h \
  365. limits.h \
  366. locale.h \
  367. monetary.h \
  368. netdb.h \
  369. poll.h \
  370. pwd.h \
  371. resolv.h \
  372. signal.h \
  373. stdarg.h \
  374. stdlib.h \
  375. string.h \
  376. syslog.h \
  377. sysexits.h \
  378. sys/ioctl.h \
  379. sys/file.h \
  380. sys/mman.h \
  381. sys/mount.h \
  382. sys/poll.h \
  383. sys/resource.h \
  384. sys/select.h \
  385. sys/socket.h \
  386. sys/stat.h \
  387. sys/statfs.h \
  388. sys/statvfs.h \
  389. sys/vfs.h \
  390. sys/sysexits.h \
  391. sys/varargs.h \
  392. sys/wait.h \
  393. sys/loadavg.h \
  394. termios.h \
  395. unistd.h \
  396. unix.h \
  397. utime.h \
  398. sys/utsname.h \
  399. sys/ipc.h \
  400. dlfcn.h \
  401. assert.h \
  402. tmmintrin.h \
  403. nmmintrin.h \
  404. immintrin.h
  405. ],[],[],[
  406. #ifdef HAVE_SYS_PARAM_H
  407. #include <sys/param.h>
  408. #endif
  409. #ifdef HAVE_SYS_TYPES_H
  410. #include <sys/types.h>
  411. #endif
  412. #ifdef HAVE_SYS_TIME_H
  413. #include <sys/time.h>
  414. #endif
  415. #ifdef HAVE_NETINET_IN_H
  416. #include <netinet/in.h>
  417. #endif
  418. #ifdef HAVE_ARPA_NAMESER_H
  419. #include <arpa/nameser.h>
  420. #endif
  421. ])
  422. PHP_FOPENCOOKIE
  423. PHP_BROKEN_GETCWD
  424. PHP_BROKEN_GLIBC_FOPEN_APPEND
  425. if test "$GCC" = "yes"; then
  426. PHP_BROKEN_GCC_STRLEN_OPT
  427. fi
  428. dnl Checks for typedefs, structures, and compiler characteristics.
  429. dnl -------------------------------------------------------------------------
  430. AC_STRUCT_TM
  431. AC_STRUCT_TIMEZONE
  432. PHP_MISSING_TIME_R_DECL
  433. PHP_MISSING_FCLOSE_DECL
  434. PHP_TM_GMTOFF
  435. PHP_STRUCT_FLOCK
  436. PHP_SOCKLEN_T
  437. AC_CHECK_SIZEOF(size_t, 8)
  438. AC_CHECK_SIZEOF(long long, 8)
  439. AC_CHECK_SIZEOF(long long int, 8)
  440. AC_CHECK_SIZEOF(long, 8)
  441. AC_CHECK_SIZEOF(int, 4)
  442. dnl These are defined elsewhere than stdio.h
  443. PHP_CHECK_SIZEOF(intmax_t, 0)
  444. PHP_CHECK_SIZEOF(ssize_t, 8)
  445. PHP_CHECK_SIZEOF(ptrdiff_t, 8)
  446. dnl Check stdint types (must be after header check)
  447. PHP_CHECK_STDINT_TYPES
  448. dnl Check __builtin_expect
  449. PHP_CHECK_BUILTIN_EXPECT
  450. dnl Check __builtin_clz
  451. PHP_CHECK_BUILTIN_CLZ
  452. dnl Check __builtin_ctzl
  453. PHP_CHECK_BUILTIN_CTZL
  454. dnl Check __builtin_ctzll
  455. PHP_CHECK_BUILTIN_CTZLL
  456. dnl Check __builtin_smull_overflow
  457. PHP_CHECK_BUILTIN_SMULL_OVERFLOW
  458. dnl Check __builtin_smulll_overflow
  459. PHP_CHECK_BUILTIN_SMULLL_OVERFLOW
  460. dnl Check __builtin_saddl_overflow
  461. PHP_CHECK_BUILTIN_SADDL_OVERFLOW
  462. dnl Check __builtin_saddll_overflow
  463. PHP_CHECK_BUILTIN_SADDLL_OVERFLOW
  464. dnl Check __builtin_ssubl_overflow
  465. PHP_CHECK_BUILTIN_SSUBL_OVERFLOW
  466. dnl Check __builtin_ssubll_overflow
  467. PHP_CHECK_BUILTIN_SSUBLL_OVERFLOW
  468. dnl Check __builtin_cpu_init
  469. PHP_CHECK_BUILTIN_CPU_INIT
  470. dnl Check __builtin_cpu_supports
  471. PHP_CHECK_BUILTIN_CPU_SUPPORTS
  472. dnl Check instructions
  473. PHP_CHECK_CPU_SUPPORTS([ssse3])
  474. PHP_CHECK_CPU_SUPPORTS([sse4.2])
  475. PHP_CHECK_CPU_SUPPORTS([avx])
  476. PHP_CHECK_CPU_SUPPORTS([avx2])
  477. dnl The ABI of php_addslashes in PHP 7.3 is dependent on __SSE4_2__,
  478. dnl which depends on target attributes. Use this check to make sure that
  479. dnl SSE 4.2 availability during the PHP compilation is used, independently
  480. dnl of whether extensions are compiled with SSE 4.2 support.
  481. AC_MSG_CHECKING([whether __SSE4_2__ is defined])
  482. AC_RUN_IFELSE([AC_LANG_SOURCE([[
  483. int main() {
  484. #if defined(__SSE4_2__)
  485. return 0;
  486. #else
  487. return 1;
  488. #endif
  489. }
  490. ]])], [
  491. AC_MSG_RESULT([yes])
  492. AC_DEFINE(HAVE_SSE4_2_DEF, 1, [Define if __SSE4_2__ has been defined])
  493. ], [AC_MSG_RESULT([no])], [AC_MSG_RESULT([no])])
  494. dnl Check for members of the stat structure
  495. AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev])
  496. dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exist
  497. dnl The WARNING_LEVEL required because cc in QNX hates -w option without an argument
  498. if test "`uname -s 2>/dev/null`" != "QNX"; then
  499. AC_STRUCT_ST_BLOCKS
  500. else
  501. AC_MSG_WARN([warnings level for cc set to 0])
  502. WARNING_LEVEL=0
  503. fi
  504. dnl Checks for types
  505. AC_TYPE_SIZE_T
  506. AC_TYPE_UID_T
  507. dnl Checks for sockaddr_storage and sockaddr.sa_len
  508. PHP_SOCKADDR_CHECKS
  509. dnl Checks for GCC function attributes on all systems except ones without glibc
  510. dnl Fix for these systems is already included in GCC 7, but not on GCC 6
  511. dnl
  512. dnl At least some versions of FreeBSD seem to have buggy ifunc support, see
  513. dnl bug #77284. Conservatively don't use ifuncs on FreeBSD.
  514. AS_CASE([$host_alias], [*-*-*android*|*-*-*uclibc*|*-*-*musl*|*freebsd*], [true], [
  515. AX_GCC_FUNC_ATTRIBUTE([ifunc])
  516. AX_GCC_FUNC_ATTRIBUTE([target])
  517. ])
  518. dnl Check for IPv6 support
  519. AC_CACHE_CHECK([for IPv6 support], ac_cv_ipv6_support,
  520. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
  521. #include <sys/socket.h>
  522. #include <netinet/in.h>]], [[struct sockaddr_in6 s; struct in6_addr t=in6addr_any; int i=AF_INET6; s; t.s6_addr[0] = 0;]])],
  523. [ac_cv_ipv6_support=yes], [ac_cv_ipv6_support=no])])
  524. dnl Checks for library functions.
  525. dnl -------------------------------------------------------------------------
  526. AC_FUNC_VPRINTF
  527. AC_CHECK_FUNCS(
  528. alphasort \
  529. asctime_r \
  530. chroot \
  531. ctime_r \
  532. cuserid \
  533. crypt \
  534. explicit_memset \
  535. flock \
  536. ftok \
  537. funopen \
  538. gai_strerror \
  539. gcvt \
  540. getloadavg \
  541. getlogin \
  542. getprotobyname \
  543. getprotobynumber \
  544. getservbyname \
  545. getservbyport \
  546. gethostname \
  547. getrusage \
  548. gettimeofday \
  549. gmtime_r \
  550. getpwnam_r \
  551. getgrnam_r \
  552. getpwuid_r \
  553. grantpt \
  554. inet_ntoa \
  555. inet_ntop \
  556. inet_pton \
  557. isascii \
  558. link \
  559. localtime_r \
  560. lockf \
  561. lchown \
  562. lrand48 \
  563. memcpy \
  564. memmove \
  565. mkstemp \
  566. mmap \
  567. nl_langinfo \
  568. perror \
  569. poll \
  570. ptsname \
  571. putenv \
  572. realpath \
  573. random \
  574. rand_r \
  575. scandir \
  576. setitimer \
  577. setlocale \
  578. localeconv \
  579. setenv \
  580. setpgid \
  581. setsockopt \
  582. setvbuf \
  583. shutdown \
  584. sin \
  585. snprintf \
  586. srand48 \
  587. srandom \
  588. statfs \
  589. statvfs \
  590. std_syslog \
  591. strcasecmp \
  592. strcoll \
  593. strdup \
  594. strerror \
  595. strftime \
  596. strnlen \
  597. strptime \
  598. strstr \
  599. strtok_r \
  600. symlink \
  601. tempnam \
  602. tzset \
  603. unlockpt \
  604. unsetenv \
  605. usleep \
  606. utime \
  607. vsnprintf \
  608. vasprintf \
  609. asprintf \
  610. nanosleep \
  611. )
  612. dnl Some systems (like OpenSolaris) do not have nanosleep in libc
  613. PHP_CHECK_FUNC_LIB(nanosleep, rt)
  614. dnl Check for getaddrinfo, should be a better way, but...
  615. dnl Also check for working getaddrinfo
  616. AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
  617. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
  618. [[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);]])],[AC_RUN_IFELSE([AC_LANG_SOURCE([[
  619. #include <string.h>
  620. #include <netdb.h>
  621. #include <sys/types.h>
  622. #ifndef AF_INET
  623. # include <sys/socket.h>
  624. #endif
  625. int main(void) {
  626. struct addrinfo *ai, *pai, hints;
  627. memset(&hints, 0, sizeof(hints));
  628. hints.ai_flags = AI_NUMERICHOST;
  629. if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
  630. return 1;
  631. }
  632. if (ai == 0) {
  633. return 1;
  634. }
  635. pai = ai;
  636. while (pai) {
  637. if (pai->ai_family != AF_INET) {
  638. /* 127.0.0.1/NUMERICHOST should only resolve ONE way */
  639. return 1;
  640. }
  641. if (pai->ai_addr->sa_family != AF_INET) {
  642. /* 127.0.0.1/NUMERICHOST should only resolve ONE way */
  643. return 1;
  644. }
  645. pai = pai->ai_next;
  646. }
  647. freeaddrinfo(ai);
  648. return 0;
  649. }
  650. ]])],[ac_cv_func_getaddrinfo=yes], [ac_cv_func_getaddrinfo=no], [ac_cv_func_getaddrinfo=no])],
  651. [ac_cv_func_getaddrinfo=no])])
  652. if test "$ac_cv_func_getaddrinfo" = yes; then
  653. AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
  654. fi
  655. dnl Check for the __sync_fetch_and_add builtin
  656. AC_CACHE_CHECK([for __sync_fetch_and_add], ac_cv_func_sync_fetch_and_add,
  657. [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[int x;__sync_fetch_and_add(&x,1);]])],[ac_cv_func_sync_fetch_and_add=yes],[ac_cv_func_sync_fetch_and_add=no])])
  658. if test "$ac_cv_func_sync_fetch_and_add" = yes; then
  659. AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD,1,[Define if you have the __sync_fetch_and_add function])
  660. fi
  661. AC_REPLACE_FUNCS(strlcat strlcpy explicit_bzero getopt)
  662. AC_FUNC_UTIME_NULL
  663. AC_FUNC_ALLOCA
  664. dnl PHP_AC_BROKEN_SPRINTF
  665. dnl PHP_AC_BROKEN_SNPRINTF
  666. PHP_DECLARED_TIMEZONE
  667. PHP_TIME_R_TYPE
  668. PHP_READDIR_R_TYPE
  669. PHP_CHECK_IN_ADDR_T
  670. AC_CHECK_FUNCS(crypt_r, [ php_crypt_r="1" ], [ php_crypt_r="0" ])
  671. if test "x$php_crypt_r" = "x1"; then
  672. PHP_CRYPT_R_STYLE
  673. fi
  674. dnl Check for asm goto support
  675. AC_CACHE_CHECK([for asm goto], ac_cv__asm_goto,
  676. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  677. int main(void) {
  678. __asm__ goto("jmp %l0\n" :::: end);
  679. end:
  680. return 0;
  681. }
  682. ]])], [ac_cv__asm_goto=yes], [ac_cv__asm_goto=no], [ac_cv__asm_goto=no])])
  683. if test "$ac_cv__asm_goto" = yes; then
  684. AC_DEFINE(HAVE_ASM_GOTO,1,[Define if asm goto support])
  685. fi
  686. dnl Check for variable length array support
  687. AC_CACHE_CHECK([whether compiler supports VLA], ac_cv__compiler_c99_vla,
  688. [AC_RUN_IFELSE([AC_LANG_SOURCE([[
  689. #include <stdlib.h>
  690. int main(void) {
  691. int i[rand()%10];
  692. return 0;
  693. }
  694. ]])],[ac_cv__compiler_c99_vla=yes], [ac_cv__compiler_c99_vla=no], [ac_cv__compiler_c99_vla=no])])
  695. if test "$ac_cv__compiler_c99_vla" = yes; then
  696. AC_DEFINE(HAVE_COMPILER_C99_VLA, 1, [Compiler supports VLA])
  697. fi
  698. dnl Check valgrind support
  699. PHP_ARG_WITH(valgrind, [whether to enable valgrind support],
  700. [ --with-valgrind=DIR Enable valgrind support], yes, no)
  701. if test "$PHP_VALGRIND" != "no"; then
  702. AC_MSG_CHECKING([for valgrind header])
  703. if test "$PHP_VALGRIND" = "yes"; then
  704. SEARCH_PATH="/usr/local /usr"
  705. else
  706. SEARCH_PATH="$PHP_VALGRIND"
  707. fi
  708. SEARCH_FOR="/include/valgrind/valgrind.h"
  709. for i in $SEARCH_PATH ; do
  710. if test -r $i/$SEARCH_FOR; then
  711. VALGRIND_DIR=$i
  712. fi
  713. done
  714. if test -z "$VALGRIND_DIR"; then
  715. AC_MSG_RESULT([not found])
  716. else
  717. AC_MSG_RESULT(found in $VALGRIND_DIR)
  718. AC_DEFINE(HAVE_VALGRIND, 1, [ ])
  719. fi
  720. fi
  721. dnl General settings.
  722. dnl -------------------------------------------------------------------------
  723. PHP_CONFIGURE_PART(General settings)
  724. PHP_HELP_SEPARATOR([General settings:])
  725. PHP_ARG_ENABLE(gcov, whether to include gcov symbols,
  726. [ --enable-gcov Enable GCOV code coverage (requires LTP) - FOR DEVELOPERS ONLY!!], no, no)
  727. if test "$PHP_GCOV" = "yes"; then
  728. if test "$GCC" != "yes"; then
  729. AC_MSG_ERROR([GCC is required for --enable-gcov])
  730. fi
  731. dnl Check if ccache is being used
  732. case `$php_shtool path $CC` in
  733. *ccache*[)] gcc_ccache=yes;;
  734. *[)] gcc_ccache=no;;
  735. esac
  736. if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
  737. AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
  738. fi
  739. dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison)
  740. ltp_version_min="105"
  741. dnl non-working versions, e.g. "1.8 1.18";
  742. dnl remove "none" when introducing the first incompatible LTP version and
  743. dnl separate any following additions by spaces
  744. ltp_version_exclude="1.8"
  745. AC_CHECK_PROG(LTP, lcov, lcov)
  746. AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
  747. PHP_SUBST(LTP)
  748. PHP_SUBST(LTP_GENHTML)
  749. if test "$LTP"; then
  750. AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
  751. php_cv_ltp_version=invalid
  752. ltp_version_vars=`$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./ /g' | tr -d a-z`
  753. if test -n "$ltp_version_vars"; then
  754. set $ltp_version_vars
  755. ltp_version="${1}.${2}"
  756. ltp_version_num="`expr ${1} \* 100 + ${2}`"
  757. if test $ltp_version_num -ge $ltp_version_min; then
  758. php_cv_ltp_version="$ltp_version (ok)"
  759. for ltp_check_version in $ltp_version_exclude; do
  760. if test "$ltp_version" = "$ltp_check_version"; then
  761. php_cv_ltp_version=invalid
  762. break
  763. fi
  764. done
  765. fi
  766. fi
  767. ])
  768. else
  769. ltp_msg="To enable code coverage reporting you must have LTP installed"
  770. AC_MSG_ERROR([$ltp_msg])
  771. fi
  772. case $php_cv_ltp_version in
  773. ""|invalid[)]
  774. ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min, excluded: $ltp_version_exclude)."
  775. AC_MSG_ERROR([$ltp_msg])
  776. LTP="exit 0;"
  777. ;;
  778. esac
  779. if test -z "$LTP_GENHTML"; then
  780. AC_MSG_ERROR([Could not find genhtml from the LTP package])
  781. fi
  782. AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
  783. PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.gcov, $abs_srcdir)
  784. dnl Remove all optimization flags from CFLAGS
  785. changequote({,})
  786. CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'`
  787. CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'`
  788. changequote([,])
  789. dnl Add the special gcc flags
  790. CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage"
  791. CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage"
  792. fi
  793. PHP_ARG_ENABLE(debug, whether to include debugging symbols,
  794. [ --enable-debug Compile with debugging symbols], no, no)
  795. if test "$PHP_DEBUG" = "yes"; then
  796. PHP_DEBUG=1
  797. ZEND_DEBUG=yes
  798. changequote({,})
  799. CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9s]*//g'`
  800. CXXFLAGS=`echo "$CXXFLAGS" | $SED -e 's/-O[0-9s]*//g'`
  801. changequote([,])
  802. dnl add -O0 only if GCC or ICC is used
  803. if test "$GCC" = "yes" || test "$ICC" = "yes"; then
  804. CFLAGS="$CFLAGS -O0"
  805. CXXFLAGS="$CXXFLAGS -g -O0"
  806. fi
  807. if test "$SUNCC" = "yes"; then
  808. if test -n "$auto_cflags"; then
  809. CFLAGS="-g"
  810. CXXFLAGS="-g"
  811. else
  812. CFLAGS="$CFLAGS -g"
  813. CXXFLAGS="$CFLAGS -g"
  814. fi
  815. fi
  816. else
  817. PHP_DEBUG=0
  818. ZEND_DEBUG=no
  819. fi
  820. PHP_ARG_WITH(layout, layout of installed files,
  821. [ --with-layout=TYPE Set how installed files will be laid out. Type can
  822. be either PHP or GNU @<:@PHP@:>@], PHP, no)
  823. case $PHP_LAYOUT in
  824. GNU)
  825. oldstyleextdir=no
  826. ;;
  827. *)
  828. oldstyleextdir=yes
  829. ;;
  830. esac
  831. PHP_ARG_WITH(config-file-path, path to configuration file,
  832. [ --with-config-file-path=PATH
  833. Set the path in which to look for php.ini @<:@PREFIX/lib@:>@], DEFAULT, no)
  834. if test "$PHP_CONFIG_FILE_PATH" = "DEFAULT"; then
  835. case $PHP_LAYOUT in
  836. GNU)
  837. PHP_CONFIG_FILE_PATH=$sysconfdir
  838. ;;
  839. *)
  840. PHP_CONFIG_FILE_PATH=$libdir
  841. ;;
  842. esac
  843. fi
  844. AC_MSG_CHECKING([where to scan for configuration files])
  845. PHP_ARG_WITH(config-file-scan-dir,,
  846. [ --with-config-file-scan-dir=PATH
  847. Set the path where to scan for configuration files], DEFAULT, no)
  848. if test "$PHP_CONFIG_FILE_SCAN_DIR" = "DEFAULT"; then
  849. PHP_CONFIG_FILE_SCAN_DIR=
  850. fi
  851. AC_MSG_RESULT([$PHP_CONFIG_FILE_SCAN_DIR])
  852. test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
  853. PHP_ARG_ENABLE(sigchild, whether to enable PHP's own SIGCHLD handler,
  854. [ --enable-sigchild Enable PHP's own SIGCHLD handler], no, no)
  855. if test "$PHP_SIGCHILD" = "yes"; then
  856. AC_DEFINE(PHP_SIGCHILD, 1, [ ])
  857. else
  858. AC_DEFINE(PHP_SIGCHILD, 0, [ ])
  859. fi
  860. PHP_ARG_ENABLE(libgcc, whether to explicitly link against libgcc,
  861. [ --enable-libgcc Enable explicitly linking against libgcc], no, no)
  862. if test "$PHP_LIBGCC" = "yes"; then
  863. PHP_LIBGCC_LIBPATH(gcc)
  864. if test -z "$libgcc_libpath"; then
  865. AC_MSG_ERROR([Cannot locate libgcc. Make sure that gcc is in your path])
  866. fi
  867. PHP_ADD_LIBPATH($libgcc_libpath)
  868. PHP_ADD_LIBRARY(gcc, yes)
  869. fi
  870. PHP_ARG_ENABLE(short-tags, whether to enable short tags by default,
  871. [ --disable-short-tags Disable the short-form <? start tag by default], yes, no)
  872. if test "$PHP_SHORT_TAGS" = "yes"; then
  873. AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, "1", [ ])
  874. else
  875. AC_DEFINE(DEFAULT_SHORT_OPEN_TAG, "0", [ ])
  876. fi
  877. PHP_ARG_ENABLE(dmalloc, whether to enable dmalloc,
  878. [ --enable-dmalloc Enable dmalloc], no, no)
  879. if test "$PHP_DMALLOC" = "yes"; then
  880. AC_CHECK_LIB(dmalloc, dmalloc_error, [
  881. PHP_ADD_LIBRARY(dmalloc)
  882. AC_DEFINE(HAVE_DMALLOC,1,[Whether you have dmalloc])
  883. CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK"
  884. ], [
  885. AC_MSG_ERROR([Problem with enabling dmalloc. Please check config.log for details.])
  886. ])
  887. fi
  888. PHP_ARG_ENABLE(ipv6, whether to enable IPv6 support,
  889. [ --disable-ipv6 Disable IPv6 support], yes, no)
  890. if test "$PHP_IPV6" != "no" && test "$ac_cv_ipv6_support" = yes; then
  891. AC_DEFINE(HAVE_IPV6, 1, [Whether to enable IPv6 support])
  892. fi
  893. dnl ##
  894. dnl ## DTRACE CHECKS
  895. dnl ## Note: this has to be done after SAPI configuration!
  896. dnl ##
  897. PHP_ARG_ENABLE(dtrace, whether to enable DTrace support,
  898. [ --enable-dtrace Enable DTrace support], no, no)
  899. if test "$PHP_DTRACE" = "yes"; then
  900. AC_CHECK_HEADERS([sys/sdt.h], [
  901. PHP_INIT_DTRACE([Zend/zend_dtrace.d],[Zend/zend_dtrace_gen.h],[main/main.c Zend/zend_API.c \
  902. Zend/zend_execute.c Zend/zend_exceptions.c \
  903. Zend/zend_dtrace.c Zend/zend.c])
  904. AC_DEFINE(HAVE_DTRACE, 1, [Whether to enable DTrace support])
  905. PHP_SUBST(PHP_DTRACE_OBJS)
  906. ], [
  907. AC_MSG_ERROR([Cannot find sys/sdt.h which is required for DTrace support])
  908. ])
  909. fi
  910. AC_MSG_CHECKING([how big to make fd sets])
  911. PHP_ARG_ENABLE(fd-setsize,,
  912. [ --enable-fd-setsize Set size of descriptor sets], no, no)
  913. if test "$PHP_FD_SETSIZE" != "no"; then
  914. if test "0$PHP_FD_SETSIZE" -gt 0 2>/dev/null; then
  915. CPPFLAGS="$CPPFLAGS -DFD_SETSIZE=$PHP_FD_SETSIZE"
  916. AC_MSG_RESULT([using $PHP_FD_SETSIZE])
  917. else
  918. AC_MSG_ERROR([Invalid value passed to --enable-fd-setsize!])
  919. fi
  920. else
  921. AC_MSG_RESULT([using system default])
  922. fi
  923. dnl Extension configuration.
  924. dnl -------------------------------------------------------------------------
  925. PHP_HELP_SEPARATOR([Extensions:
  926. --with-EXTENSION=[shared[,PATH]]
  927. NOTE: Not all extensions can be build as 'shared'.
  928. Example: --with-foobar=shared,/usr/local/foobar/
  929. o Builds the foobar extension as shared extension.
  930. o foobar package install prefix is /usr/local/foobar/
  931. ])
  932. PHP_CONFIGURE_PART(Configuring extensions)
  933. dnl
  934. dnl Check if all enabled by default extensions should be disabled
  935. dnl
  936. AC_ARG_ENABLE(all,
  937. [ --disable-all Disable all extensions which are enabled by default
  938. ], [
  939. PHP_ENABLE_ALL=$enableval
  940. ])
  941. # reading config stubs
  942. esyscmd(./build/config-stubs ext)
  943. dnl Extensions post-config
  944. dnl -------------------------------------------------------------------------
  945. enable_shared=yes
  946. enable_static=yes
  947. case $php_sapi_module in
  948. shared[)]
  949. enable_static=no
  950. case $with_pic in
  951. yes)
  952. standard_libtool_flag='-prefer-pic'
  953. ;;
  954. no)
  955. standard_libtool_flag='-prefer-non-pic'
  956. ;;
  957. esac
  958. EXTRA_LDFLAGS="$EXTRA_LDFLAGS -avoid-version -module"
  959. ;;
  960. *[)]
  961. standard_libtool_flag='-prefer-non-pic -static'
  962. if test -z "$PHP_MODULES" && test -z "$PHP_ZEND_EX"; then
  963. enable_shared=no
  964. fi
  965. ;;
  966. esac
  967. EXTRA_LIBS="$EXTRA_LIBS $DLIBS $LIBS"
  968. dnl this has to be here to prevent the openssl crypt() from
  969. dnl overriding the system provided crypt().
  970. if test "$ac_cv_lib_crypt_crypt" = "yes"; then
  971. EXTRA_LIBS="-lcrypt $EXTRA_LIBS -lcrypt"
  972. fi
  973. unset LIBS LDFLAGS
  974. dnl PEAR
  975. dnl -------------------------------------------------------------------------
  976. PHP_HELP_SEPARATOR([PEAR:])
  977. PHP_CONFIGURE_PART(Configuring PEAR)
  978. # compatibility
  979. if test -z "$with_pear" && test "$enable_pear" = "no"; then
  980. with_pear=no
  981. fi
  982. # If CLI is disabled -> disable PEAR
  983. if test "$PHP_CLI" = "no"; then
  984. with_pear=no
  985. fi
  986. PHP_ARG_WITH(pear, [whether to install PEAR],
  987. [ --with-pear=DIR Install PEAR in DIR @<:@PREFIX/lib/php@:>@
  988. --without-pear Do not install PEAR], DEFAULT, yes)
  989. if test "$PHP_PEAR" != "no"; then
  990. dnl
  991. dnl PEAR dependencies
  992. dnl
  993. if test "$PHP_XML" = "no"; then
  994. pear_error_msg="$pear_error_msg
  995. PEAR requires XML to be enabled. Add --enable-xml to the configure line. (or --without-pear)"
  996. fi
  997. if test "$pear_error_msg"; then
  998. AC_MSG_ERROR([$pear_error_msg])
  999. fi
  1000. install_pear="install-pear"
  1001. PEAR_INSTALLDIR=$PHP_PEAR
  1002. if test "$PHP_PEAR" = "DEFAULT" || test "$PHP_PEAR" = "yes"; then
  1003. case $PHP_LAYOUT in
  1004. GNU) PEAR_INSTALLDIR=$datadir/pear;;
  1005. *) PEAR_INSTALLDIR=$libdir/php;;
  1006. esac
  1007. fi
  1008. PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/pear/Makefile.frag,$abs_srcdir/pear,pear)
  1009. fi
  1010. dnl Configuring Zend and TSRM.
  1011. dnl -------------------------------------------------------------------------
  1012. PHP_HELP_SEPARATOR([Zend:])
  1013. PHP_CONFIGURE_PART(Configuring Zend)
  1014. LIBZEND_BASIC_CHECKS
  1015. LIBZEND_DLSYM_CHECK
  1016. LIBZEND_OTHER_CHECKS
  1017. if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
  1018. AC_DEFINE(ZTS,1,[ ])
  1019. PHP_THREAD_SAFETY=yes
  1020. else
  1021. PHP_THREAD_SAFETY=no
  1022. fi
  1023. INCLUDES="$INCLUDES -I\$(top_builddir)/TSRM"
  1024. INCLUDES="$INCLUDES -I\$(top_builddir)/Zend"
  1025. if test "$abs_srcdir" != "$abs_builddir"; then
  1026. INCLUDES="$INCLUDES -I\$(top_srcdir)/main -I\$(top_srcdir)/Zend"
  1027. INCLUDES="$INCLUDES -I\$(top_srcdir)/TSRM -I\$(top_builddir)/"
  1028. fi
  1029. ZEND_EXTRA_LIBS="$LIBS"
  1030. unset LIBS LDFLAGS
  1031. PHP_HELP_SEPARATOR([TSRM:])
  1032. PHP_CONFIGURE_PART(Configuring TSRM)
  1033. TSRM_BASIC_CHECKS
  1034. if test "$PHP_THREAD_SAFETY" = "yes"; then
  1035. TSRM_THREADS_CHECKS
  1036. fi
  1037. EXTRA_LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
  1038. EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $LDFLAGS"
  1039. EXTRA_LIBS="$EXTRA_LIBS $LIBS"
  1040. unset LIBS LDFLAGS
  1041. test "$prefix" = "NONE" && prefix=/usr/local
  1042. test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
  1043. test "$program_prefix" = "NONE" && program_prefix=
  1044. test "$program_suffix" = "NONE" && program_suffix=
  1045. case $libdir in
  1046. '${exec_prefix}/lib')
  1047. libdir=$libdir/php
  1048. ;;
  1049. esac
  1050. case `eval echo $datadir` in
  1051. '${prefix}/share')
  1052. datadir=$datadir/php
  1053. ;;
  1054. esac
  1055. phplibdir=`pwd`/modules
  1056. $php_shtool mkdir -p $phplibdir
  1057. phptempdir=`pwd`/libs
  1058. old_exec_prefix=$exec_prefix
  1059. old_libdir=$libdir
  1060. old_datadir=$datadir
  1061. exec_prefix=`eval echo $exec_prefix`
  1062. libdir=`eval echo $libdir`
  1063. datadir=`eval eval echo $datadir`
  1064. dnl Build extension directory path
  1065. ZEND_MODULE_API_NO=`$EGREP '#define ZEND_MODULE_API_NO ' $srcdir/Zend/zend_modules.h|$SED 's/#define ZEND_MODULE_API_NO //'`
  1066. if test -z "$EXTENSION_DIR"; then
  1067. extbasedir=$ZEND_MODULE_API_NO
  1068. if test "$oldstyleextdir" = "yes"; then
  1069. if test "$PHP_DEBUG" = "1"; then
  1070. part1=debug
  1071. else
  1072. part1=no-debug
  1073. fi
  1074. if test "$enable_maintainer_zts" = "yes"; then
  1075. part2=zts
  1076. else
  1077. part2=non-zts
  1078. fi
  1079. extbasedir=$part1-$part2-$extbasedir
  1080. EXTENSION_DIR=$libdir/extensions/$extbasedir
  1081. else
  1082. if test "$enable_maintainer_zts" = "yes"; then
  1083. extbasedir=$extbasedir-zts
  1084. fi
  1085. if test "$PHP_DEBUG" = "1"; then
  1086. extbasedir=$extbasedir-debug
  1087. fi
  1088. EXTENSION_DIR=$libdir/$extbasedir
  1089. fi
  1090. fi
  1091. case $PHP_LAYOUT in
  1092. GNU)
  1093. datarootdir=$prefix/share
  1094. ;;
  1095. *)
  1096. datarootdir=$prefix/php
  1097. ;;
  1098. esac
  1099. dnl Expand all directory names for use in macros/constants
  1100. EXPANDED_PEAR_INSTALLDIR=`eval echo $PEAR_INSTALLDIR`
  1101. EXPANDED_EXTENSION_DIR=`eval echo $EXTENSION_DIR`
  1102. EXPANDED_LOCALSTATEDIR=`eval echo $localstatedir`
  1103. EXPANDED_BINDIR=`eval echo $bindir`
  1104. EXPANDED_SBINDIR=`eval echo $sbindir`
  1105. EXPANDED_MANDIR=`eval echo $mandir`
  1106. EXPANDED_LIBDIR=$libdir
  1107. EXPANDED_SYSCONFDIR=`eval echo $sysconfdir`
  1108. EXPANDED_DATADIR=$datadir
  1109. EXPANDED_PHP_CONFIG_FILE_PATH=`eval echo "$PHP_CONFIG_FILE_PATH"`
  1110. EXPANDED_PHP_CONFIG_FILE_SCAN_DIR=`eval echo "$PHP_CONFIG_FILE_SCAN_DIR"`
  1111. INCLUDE_PATH=.:$EXPANDED_PEAR_INSTALLDIR
  1112. exec_prefix=$old_exec_prefix
  1113. libdir=$old_libdir
  1114. datadir=$old_datadir
  1115. AC_SUBST(INCLUDE_PATH)
  1116. AC_SUBST(EXPANDED_PEAR_INSTALLDIR)
  1117. AC_SUBST(EXPANDED_EXTENSION_DIR)
  1118. AC_SUBST(EXPANDED_BINDIR)
  1119. AC_SUBST(EXPANDED_SBINDIR)
  1120. AC_SUBST(EXPANDED_MANDIR)
  1121. AC_SUBST(EXPANDED_LIBDIR)
  1122. AC_SUBST(EXPANDED_DATADIR)
  1123. AC_SUBST(EXPANDED_SYSCONFDIR)
  1124. AC_SUBST(EXPANDED_LOCALSTATEDIR)
  1125. AC_SUBST(EXPANDED_PHP_CONFIG_FILE_PATH)
  1126. AC_SUBST(EXPANDED_PHP_CONFIG_FILE_SCAN_DIR)
  1127. if test -n "$php_ldflags_add_usr_lib"; then
  1128. PHP_RPATHS="$PHP_RPATHS /usr/lib"
  1129. fi
  1130. PHP_UTILIZE_RPATHS
  1131. if test -z "$php_ldflags_add_usr_lib"; then
  1132. PHP_REMOVE_USR_LIB(PHP_LDFLAGS)
  1133. PHP_REMOVE_USR_LIB(LDFLAGS)
  1134. fi
  1135. EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PHP_LDFLAGS"
  1136. EXTRA_LDFLAGS_PROGRAM="$EXTRA_LDFLAGS_PROGRAM $PHP_LDFLAGS"
  1137. # SOURCE_DATE_EPOCH for reproducible builds https://reproducible-builds.org/specs/source-date-epoch/
  1138. PHP_BUILD_DATE=`date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y-%m-%d 2>/dev/null`
  1139. if test $? -ne 0 ; then
  1140. PHP_BUILD_DATE=`date -u +%Y-%m-%d`
  1141. fi
  1142. AC_DEFINE_UNQUOTED(PHP_BUILD_DATE,"$PHP_BUILD_DATE",[PHP build date])
  1143. PHP_UNAME=`uname -a | xargs`
  1144. AC_DEFINE_UNQUOTED(PHP_UNAME,"$PHP_UNAME",[uname -a output])
  1145. PHP_OS=`uname | xargs`
  1146. AC_DEFINE_UNQUOTED(PHP_OS,"$PHP_OS",[uname output])
  1147. PHP_SUBST_OLD(PHP_INSTALLED_SAPIS)
  1148. PHP_SUBST(PHP_EXECUTABLE)
  1149. PHP_SUBST(PHP_FASTCGI_OBJS)
  1150. PHP_SUBST(PHP_SAPI_OBJS)
  1151. PHP_SUBST(PHP_BINARY_OBJS)
  1152. PHP_SUBST(PHP_GLOBAL_OBJS)
  1153. PHP_SUBST(PHP_BINARIES)
  1154. PHP_SUBST(PHP_MODULES)
  1155. PHP_SUBST(PHP_ZEND_EX)
  1156. PHP_SUBST(EXT_LIBS)
  1157. PHP_SUBST_OLD(abs_builddir)
  1158. PHP_SUBST_OLD(abs_srcdir)
  1159. PHP_SUBST_OLD(php_abs_top_builddir)
  1160. PHP_SUBST_OLD(php_abs_top_srcdir)
  1161. PHP_SUBST(bindir)
  1162. PHP_SUBST(sbindir)
  1163. PHP_SUBST(exec_prefix)
  1164. PHP_SUBST_OLD(program_prefix)
  1165. PHP_SUBST_OLD(program_suffix)
  1166. PHP_SUBST(includedir)
  1167. PHP_SUBST(libdir)
  1168. PHP_SUBST(mandir)
  1169. PHP_SUBST(phplibdir)
  1170. PHP_SUBST(phptempdir)
  1171. PHP_SUBST(prefix)
  1172. PHP_SUBST(localstatedir)
  1173. PHP_SUBST(datadir)
  1174. PHP_SUBST(datarootdir)
  1175. PHP_SUBST(sysconfdir)
  1176. PHP_SUBST(EXEEXT)
  1177. PHP_SUBST(CC)
  1178. PHP_SUBST(CFLAGS)
  1179. PHP_SUBST(CFLAGS_CLEAN)
  1180. PHP_SUBST(CPP)
  1181. PHP_SUBST(CPPFLAGS)
  1182. PHP_SUBST(CXX)
  1183. PHP_SUBST(CXXFLAGS)
  1184. PHP_SUBST(CXXFLAGS_CLEAN)
  1185. PHP_SUBST_OLD(DEBUG_CFLAGS)
  1186. PHP_SUBST_OLD(EXTENSION_DIR)
  1187. PHP_SUBST_OLD(EXTRA_LDFLAGS)
  1188. PHP_SUBST_OLD(EXTRA_LDFLAGS_PROGRAM)
  1189. PHP_SUBST_OLD(EXTRA_LIBS)
  1190. PHP_SUBST_OLD(ZEND_EXTRA_LIBS)
  1191. PHP_SUBST_OLD(INCLUDES)
  1192. PHP_SUBST_OLD(EXTRA_INCLUDES)
  1193. PHP_SUBST_OLD(INCLUDE_PATH)
  1194. PHP_SUBST_OLD(INSTALL_IT)
  1195. PHP_SUBST(LFLAGS)
  1196. PHP_SUBST(LIBTOOL)
  1197. PHP_SUBST(LN_S)
  1198. PHP_SUBST_OLD(NATIVE_RPATHS)
  1199. PHP_SUBST_OLD(PEAR_INSTALLDIR)
  1200. PHP_SUBST(PHP_BUILD_DATE)
  1201. PHP_SUBST_OLD(PHP_LDFLAGS)
  1202. PHP_SUBST_OLD(PHP_LIBS)
  1203. PHP_SUBST(OVERALL_TARGET)
  1204. PHP_SUBST(PHP_RPATHS)
  1205. PHP_SUBST(PHP_SAPI)
  1206. PHP_SUBST_OLD(PHP_VERSION)
  1207. PHP_SUBST_OLD(PHP_VERSION_ID)
  1208. PHP_SUBST(SHELL)
  1209. PHP_SUBST(SHARED_LIBTOOL)
  1210. PHP_SUBST(WARNING_LEVEL)
  1211. PHP_SUBST(PHP_FRAMEWORKS)
  1212. PHP_SUBST(PHP_FRAMEWORKPATH)
  1213. PHP_SUBST(INSTALL_HEADERS)
  1214. old_CC=$CC
  1215. if test "$PHP_THREAD_SAFETY" = "yes" && test -n "$ac_cv_pthreads_cflags"; then
  1216. CXXFLAGS="$CXXFLAGS $ac_cv_pthreads_cflags"
  1217. INLINE_CFLAGS="$INLINE_CFLAGS $ac_cv_pthreads_cflags"
  1218. CPPFLAGS="$CPPFLAGS $ac_cv_pthreads_cflags"
  1219. fi
  1220. dnl This will go away, if we have a facility to run per-extension code
  1221. dnl after the thread_safety decision was done
  1222. if test "$PHP_THREAD_SAFETY" = "yes" && test "$PHP_MYSQL" = "yes"; then
  1223. CPPFLAGS="$CPPFLAGS -DTHREAD=1"
  1224. fi
  1225. ZEND_EXT_TYPE="zend_extension"
  1226. PHP_SUBST(ZEND_EXT_TYPE)
  1227. dnl
  1228. dnl Libtool creation
  1229. dnl
  1230. PHP_HELP_SEPARATOR([Libtool:])
  1231. PHP_CONFIGURE_PART(Configuring libtool)
  1232. LDFLAGS="$LDFLAGS $PHP_AIX_LDFLAGS"
  1233. dnl Autoconf 2.13's libtool checks go slightly nuts on Mac OS X 10.5 and 10.6.
  1234. dnl This hack works around it. Ugly.
  1235. case $host_alias in
  1236. *darwin9*|*darwin10*)
  1237. ac_cv_exeext=
  1238. ;;
  1239. esac
  1240. dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by PHP_REQUIRE_CXX).
  1241. dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler.
  1242. AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [
  1243. undefine([AC_PROG_CXX])
  1244. AC_DEFUN([AC_PROG_CXX], [])
  1245. undefine([AC_PROG_CXXCPP])
  1246. AC_DEFUN([AC_PROG_CXXCPP], [php_prog_cxxcpp=disabled])
  1247. ])
  1248. AC_PROG_LIBTOOL
  1249. PHP_SET_LIBTOOL_VARIABLE([--silent])
  1250. dnl libtool 1.4.3 needs this.
  1251. PHP_SET_LIBTOOL_VARIABLE([--preserve-dup-deps])
  1252. test -z "$PHP_COMPILE" && PHP_COMPILE='$(LIBTOOL) --mode=compile $(COMPILE) -c $<'
  1253. test -z "$CXX_PHP_COMPILE" && CXX_PHP_COMPILE='$(LIBTOOL) --mode=compile $(CXX_COMPILE) -c $<'
  1254. SHARED_LIBTOOL='$(LIBTOOL)'
  1255. CC=$old_CC
  1256. PHP_CONFIGURE_PART(Generating files)
  1257. CXXFLAGS_CLEAN=$CXXFLAGS
  1258. CFLAGS_CLEAN="$CFLAGS \$(PROF_FLAGS)"
  1259. CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
  1260. INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
  1261. CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"
  1262. if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
  1263. pharcmd=pharcmd
  1264. pharcmd_install=install-pharcmd
  1265. else
  1266. pharcmd=
  1267. pharcmd_install=
  1268. fi;
  1269. all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_BINARIES) $pharcmd"
  1270. install_targets="$install_sapi $install_modules $install_binaries install-build install-headers install-programs $install_pear $pharcmd_install"
  1271. PHP_SUBST(all_targets)
  1272. PHP_SUBST(install_targets)
  1273. PHP_SUBST(install_binary_targets)
  1274. PHP_INSTALL_HEADERS([Zend/ TSRM/ include/ main/ main/streams/])
  1275. PHP_ADD_SOURCES(TSRM, TSRM.c tsrm_strtok_r.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
  1276. PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \
  1277. fopen_wrappers.c alloca.c php_scandir.c \
  1278. php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
  1279. strlcat.c explicit_bzero.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
  1280. network.c php_open_temporary_file.c \
  1281. output.c getopt.c php_syslog.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
  1282. PHP_ADD_SOURCES_X(main, fastcgi.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, PHP_FASTCGI_OBJS, no)
  1283. PHP_ADD_SOURCES(main/streams, streams.c cast.c memory.c filter.c \
  1284. plain_wrapper.c userspace.c transports.c xp_socket.c mmap.c \
  1285. glob_wrapper.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
  1286. PHP_ADD_SOURCES(/main, internal_functions.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, sapi)
  1287. PHP_ADD_SOURCES_X(/main, internal_functions_cli.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1, PHP_BINARY_OBJS)
  1288. PHP_ADD_SOURCES(Zend, \
  1289. zend_language_parser.c zend_language_scanner.c \
  1290. zend_ini_parser.c zend_ini_scanner.c \
  1291. zend_alloc.c zend_compile.c zend_constants.c zend_dtrace.c \
  1292. zend_execute_API.c zend_highlight.c zend_llist.c \
  1293. zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \
  1294. zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \
  1295. zend_list.c zend_builtin_functions.c zend_sprintf.c \
  1296. zend_ini.c zend_sort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \
  1297. zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c zend_gc.c \
  1298. zend_closures.c zend_float.c zend_string.c zend_signal.c zend_generators.c \
  1299. zend_virtual_cwd.c zend_ast.c zend_objects.c zend_object_handlers.c zend_objects_API.c \
  1300. zend_default_classes.c zend_inheritance.c zend_smart_str.c zend_cpuinfo.c, \
  1301. -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
  1302. dnl Selectively disable optimization due to high RAM usage during
  1303. dnl compiling the executor.
  1304. if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
  1305. flag=-O0
  1306. else
  1307. flag=
  1308. fi
  1309. PHP_ADD_SOURCES_X(Zend, zend_execute.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,PHP_GLOBAL_OBJS,,$flag)
  1310. PHP_ADD_BUILD_DIR(main main/streams)
  1311. PHP_ADD_BUILD_DIR(TSRM)
  1312. PHP_ADD_BUILD_DIR(Zend)
  1313. PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/scripts/Makefile.frag,$abs_srcdir/scripts,scripts)
  1314. PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.frag,$abs_srcdir/Zend,Zend)
  1315. PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Zend/Makefile.frag,$abs_srcdir/Zend,Zend)
  1316. PHP_GEN_BUILD_DIRS
  1317. PHP_GEN_GLOBAL_MAKEFILE
  1318. AC_DEFINE([HAVE_BUILD_DEFS_H], 1, [ ])
  1319. $php_shtool mkdir -p pear/scripts
  1320. $php_shtool mkdir -p scripts
  1321. $php_shtool mkdir -p scripts/man1
  1322. ALL_OUTPUT_FILES="php7.spec main/build-defs.h \
  1323. scripts/phpize scripts/man1/phpize.1 \
  1324. scripts/php-config scripts/man1/php-config.1 \
  1325. $PHP_OUTPUT_FILES"
  1326. dnl
  1327. dnl Check for unknown configure options
  1328. dnl
  1329. PHP_CHECK_CONFIGURE_OPTIONS
  1330. dnl
  1331. dnl Generate build files
  1332. dnl
  1333. AC_CONFIG_FILES([$ALL_OUTPUT_FILES])
  1334. AC_CONFIG_COMMANDS([default],[],[
  1335. if test "\$CONFIG_FILES" = "$ALL_OUTPUT_FILES" || test "\$CONFIG_FILES" = " $ALL_OUTPUT_FILES" || test -z "\$CONFIG_FILES"; then
  1336. REDO_ALL=yes
  1337. fi
  1338. ################################################################
  1339. # Create configuration headers
  1340. #
  1341. test -d TSRM || $php_shtool mkdir TSRM
  1342. echo '#include <../main/php_config.h>' > TSRM/tsrm_config.h
  1343. test -d Zend || $php_shtool mkdir Zend
  1344. cat >Zend/zend_config.h <<FEO
  1345. #include <../main/php_config.h>
  1346. #if defined(APACHE) && defined(PHP_API_VERSION)
  1347. #undef HAVE_DLFCN_H
  1348. #endif
  1349. FEO
  1350. # run this only when generating all the files?
  1351. if test -n "\$REDO_ALL"; then
  1352. # Hacking while airborne considered harmful.
  1353. #
  1354. echo "creating main/internal_functions.c"
  1355. extensions="$EXT_STATIC"
  1356. dnl mv -f main/internal_functions.c main/internal_functions.c.old 2>/dev/null
  1357. sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$extensions > main/internal_functions.c
  1358. echo "creating main/internal_functions_cli.c"
  1359. cli_extensions="$EXT_CLI_STATIC"
  1360. sh $srcdir/build/genif.sh $srcdir/main/internal_functions.c.in $srcdir "$EXTRA_MODULE_PTRS" $AWK \$cli_extensions > main/internal_functions_cli.c
  1361. if test -n "$PHP_APXS_BROKEN"; then
  1362. echo "+--------------------------------------------------------------------+"
  1363. echo "| WARNING: Your $APXS script is most likely broken."
  1364. echo "| |"
  1365. echo "| Please go read http://www.php.net/faq.build#faq.build.apxs |"
  1366. echo "| and make the changes described there and try again. |"
  1367. fi
  1368. if test -n "$DEBUG_LOG"; then
  1369. rm -f config.cache
  1370. cat <<X
  1371. +--------------------------------------------------------------------+
  1372. | *** ATTENTION *** |
  1373. | |
  1374. | Something is likely to be messed up here, because the configure |
  1375. | script was not able to detect a simple feature on your platform. |
  1376. | This is often caused by incorrect configuration parameters. Please |
  1377. | see the file debug.log for error messages. |
  1378. | |
  1379. | If you are unable to fix this, send the file debug.log to the |
  1380. | php-install@lists.php.net mailing list and include appropriate |
  1381. | information about your setup. |
  1382. X
  1383. fi
  1384. if test "$PHP_SAPI" = "apache2handler"; then
  1385. if test "$APACHE_VERSION" -ge 2004001; then
  1386. if test -z "$APACHE_THREADED_MPM"; then
  1387. cat <<X
  1388. +--------------------------------------------------------------------+
  1389. | *** WARNING *** |
  1390. | |
  1391. | You have built PHP for Apache's current non-threaded MPM. |
  1392. | If you change Apache to use a threaded MPM you must reconfigure |
  1393. | PHP with --enable-maintainer-zts |
  1394. X
  1395. fi
  1396. fi
  1397. fi
  1398. # Warn about linking Apache with libpthread if oci8 extension is enabled on linux.
  1399. if test "$PHP_OCI8" != "no"; then
  1400. if test "$PHP_SAPI" = "apache"; then
  1401. if test `uname` = "Linux"; then
  1402. cat <<X
  1403. +--------------------------------------------------------------------+
  1404. | *** WARNING *** |
  1405. | |
  1406. | Please check that your Apache (httpd) is linked with libpthread. |
  1407. | If not, you have to recompile Apache with pthread. For more |
  1408. | details, see this page: http://www.php.net/manual/ref.oci8.php |
  1409. X
  1410. fi
  1411. fi
  1412. if test "$PHP_SIGCHILD" != "yes"; then
  1413. if test "$PHP_OCI8_INSTANT_CLIENT" = "no"; then
  1414. cat <<X
  1415. +--------------------------------------------------------------------+
  1416. | Notice: |
  1417. | If you encounter <defunc> processes when using a local Oracle |
  1418. | database, set the value BEQUEATH_DETACH=YES in Oracle Net's |
  1419. | sqlnet.ora file on the PHP host, or set the environment variable |
  1420. | BEQUEATH_DETACH to YES before starting Apache. If the problem |
  1421. | still occurs, then recompile PHP and specify --enable-sigchild |
  1422. | when configuring. |
  1423. X
  1424. fi
  1425. fi
  1426. fi
  1427. cat <<X
  1428. +--------------------------------------------------------------------+
  1429. | License: |
  1430. | This software is subject to the PHP License, available in this |
  1431. | distribution in the file LICENSE. By continuing this installation |
  1432. | process, you are bound by the terms of this license agreement. |
  1433. | If you do not agree with the terms of this license, you must abort |
  1434. | the installation process at this point. |
  1435. +--------------------------------------------------------------------+
  1436. Thank you for using PHP.
  1437. X
  1438. # Output unknown configure options
  1439. if test "$PHP_UNKNOWN_CONFIGURE_OPTIONS"; then
  1440. echo "Notice: Following unknown configure options were used:
  1441. $PHP_UNKNOWN_CONFIGURE_OPTIONS
  1442. Check '[$]0 --help' for available options
  1443. "
  1444. fi
  1445. fi
  1446. ])
  1447. AC_OUTPUT
  1448. dnl ## Local Variables:
  1449. dnl ## tab-width: 4
  1450. dnl ## End: