Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 147 lines (125 sloc) 4.182 kb
573b460 @andigutmans Zend Library
andigutmans authored
1 dnl $Id$
2 dnl Process this file with autoconf to produce a configure script.
3
4 AC_INIT(zend.c)
b227e38 convert to automake
Stig S. Bakken authored
5 AM_INIT_AUTOMAKE(zend, 0.80A)
6 AM_CONFIG_HEADER(zend_config.h)
573b460 @andigutmans Zend Library
andigutmans authored
7 AM_SANITY_CHECK
b9fb0b8 @zsuraski If a require() dies, we must bail out (since it corrupts an existing op_...
zsuraski authored
8 AM_MAINTAINER_MODE
b227e38 convert to automake
Stig S. Bakken authored
9 ZEND_VERSION=$VERSION
573b460 @andigutmans Zend Library
andigutmans authored
10
11 dnl We want this one before the checks, so the checks can modify CFLAGS.
12 test -z "$CFLAGS" && auto_cflags=1
13
14 dnl Checks for programs.
15 AC_PROG_YACC
16 if test "$YACC" != "bison -y"; then
b227e38 convert to automake
Stig S. Bakken authored
17 AC_MSG_WARN(You will need bison if you want to regenerate the Zend parser.)
573b460 @andigutmans Zend Library
andigutmans authored
18 else
19 AC_MSG_CHECKING(bison version)
20 set `bison --version| sed -e 's/^GNU Bison version //' -e 's/\./ /'`
21 if test "$1" = "1" -a "$2" -lt "25"; then
b227e38 convert to automake
Stig S. Bakken authored
22 AC_MSG_WARN(You will need bison 1.25 if you want to regenerate the Zend parser (found $1.$2).)
573b460 @andigutmans Zend Library
andigutmans authored
23 fi
24 AC_MSG_RESULT($1.$2 (ok))
25 fi
26 AC_PROG_CC
27 AC_PROG_RANLIB
28 AC_PROG_CC_C_O
b227e38 convert to automake
Stig S. Bakken authored
29 AM_PROG_LEX
573b460 @andigutmans Zend Library
andigutmans authored
30
31 dnl Ugly hack to get around a problem with gcc on AIX.
32 if test "$CC" = "gcc" -a "$ac_cv_prog_cc_g" = "yes" -a \
33 "`uname -sv`" = "AIX 4"; then
34 CFLAGS=`echo $CFLAGS | sed -e 's/-g//'`
35 fi
36
37 dnl
38 dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
39 dnl and source packages. This should be harmless on other OSs.
40 dnl
41 if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
42 CFLAGS="$CFLAGS -I/usr/pkg/include"
43 LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
44 fi
45
46 AC_CHECK_LIB(c, dlopen, [
47 # fake it
48 AC_DEFINE(HAVE_LIBDL) ], [
49 AC_CHECK_LIB(dl, dlopen, [
50 LIBS="-ldl $LIBS"
51 AC_DEFINE(HAVE_LIBDL) ], []) ])
52
53 dnl The sin may be in a library which need not be specifed
54 dnl as well as res_search resides in libsocket
55 AC_CHECK_LIB(c, sin, [:], [
56 AC_CHECK_LIB(m, sin) ])
57
58 dnl Checks for header files.
59 AC_HEADER_STDC
60
61 dnl In QNX opendir resides in libc but dirent.h is still required
62 if test "`uname -s 2>/dev/null`" != "QNX"; then
63 AC_HEADER_DIRENT
64 else
65 AC_CHECK_HEADERS(dirent.h)
66 fi
67 dnl QNX requires unix.h to allow functions in libunix to work properly
68 AC_CHECK_HEADERS(fcntl.h unistd.h crypt.h sys/file.h memory.h pwd.h grp.h sys/socket.h sys/wait.h syslog.h string.h sys/varargs.h stdarg.h sys/resource.h sys/time.h signal.h netinet/in.h dlfcn.h limits.h sys/types.h sys/statvfs.h sys/statfs.h unix.h db.h ndbm.h)
69
70 dnl Checks for types
71 AC_TYPE_SIZE_T
72
73 dnl This is required for QNX and may be some BSD derived systems
74 AC_CHECK_TYPE( uint, unsigned int )
75 AC_CHECK_TYPE( ulong, unsigned long )
76
77 dnl Checks for library functions.
78 AC_FUNC_VPRINTF
79 AC_CHECK_FUNCS(memcpy memmove strdup strerror strcasecmp strstr flock lockf putenv tempnam usleep setlocale gettimeofday setvbuf srand48 lrand48 srandom random link symlink regcomp getlogin cuserid vsnprintf snprintf gcvt utime crypt setitimer rint unsetenv strftime setsockopt tzset statvfs statfs inet_aton)
80 AC_FUNC_UTIME_NULL
81 AC_FUNC_ALLOCA
82 AC_BROKEN_SPRINTF
83 AC_REPLACE_FUNCS(getopt)
84
85 AC_MSG_CHECKING(whether to include debugging symbols)
86 AC_ARG_ENABLE(debug,
87 [ --enable-debug Compile with debugging symbols],
88 [
89 if test "$enableval" = "yes"; then
90 AC_MSG_RESULT(yes)
91 AC_DEFINE(ZEND_DEBUG,1)
92 DEBUG_CFLAGS="-g"
93 test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall"
94 test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
95 DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
96 else
97 AC_MSG_RESULT(no)
98 AC_DEFINE(ZEND_DEBUG,0)
99 DEBUG_CFLAGS=""
100 fi
101 ],[
102 AC_MSG_RESULT(no)
103 AC_DEFINE(ZEND_DEBUG,0)
104 DEBUG_CFLAGS=""
105 ])
106 AC_SUBST(DEBUG_CFLAGS)
107
108
109 AC_MSG_CHECKING(whether to enable a memory limit)
110 AC_ARG_ENABLE(memory-limit,
111 [ --enable-memory-limit Compile with memory limit support. ],
112 [
113 if test "$enableval" = "yes"; then
114 AC_DEFINE(MEMORY_LIMIT, 1)
115 AC_MSG_RESULT(yes)
116 else
117 AC_DEFINE(MEMORY_LIMIT, 0)
118 AC_MSG_RESULT(no)
119 fi
120 ],[
121 AC_DEFINE(MEMORY_LIMIT, 0)
122 AC_MSG_RESULT(no)
123 ])
124
125
97ea66a add --enable-thread-safety option
Stig S. Bakken authored
126 AC_MSG_CHECKING(whether to build Zend thread-safe)
127 AC_ARG_ENABLE(thread-safety,
128 [ --enable-thread-safety Whether to build Zend thread-safe.],[
129 AC_DEFINE(ZTS)
130 AC_MSG_RESULT(yes)
131 ],[
132 AC_MSG_RESULT(no)
133 ])
134 AC_SUBST(TSRM_DIR)
135 AC_SUBST(TSRM_LIB)
136
573b460 @andigutmans Zend Library
andigutmans authored
137 AC_SUBST(CFLAGS_SHLIB)
138 AC_SUBST(LDFLAGS_SHLIB)
139 AC_SUBST(LDFLAGS_SHLIB_EXPORT)
140
141 AC_OUTPUT(Makefile, [], [])
142
143
144 # Local Variables:
145 # tab-width: 4
146 # End:
Something went wrong with that request. Please try again.