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