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

223 lines
4.7 KiB

26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
  1. AC_DEFUN(LIBZEND_BISON_CHECK,[
  2. if test "$YACC" != "bison -y"; then
  3. AC_MSG_WARN(You will need bison if you want to regenerate the Zend parser.)
  4. else
  5. AC_MSG_CHECKING(bison version)
  6. set `bison --version| sed -e 's/^GNU Bison version //' -e 's/\./ /'`
  7. if test "${1}" = "1" -a "${2}" -lt "25"; then
  8. AC_MSG_WARN(You will need bison 1.25 if you want to regenerate the Zend parser (found ${1}.${2}).)
  9. fi
  10. AC_MSG_RESULT(${1}.${2} (ok))
  11. fi
  12. ])
  13. AC_DEFUN(LIBZEND_BASIC_CHECKS,[
  14. AC_REQUIRE([AC_PROG_YACC])
  15. AC_REQUIRE([AC_PROG_CC])
  16. AC_REQUIRE([AC_PROG_CC_C_O])
  17. AC_REQUIRE([AM_PROG_LEX])
  18. AC_REQUIRE([AC_HEADER_STDC])
  19. LIBZEND_BISON_CHECK
  20. dnl Ugly hack to get around a problem with gcc on AIX.
  21. if test "$CC" = "gcc" -a "$ac_cv_prog_cc_g" = "yes" -a \
  22. "`uname -sv`" = "AIX 4"; then
  23. CFLAGS=`echo $CFLAGS | sed -e 's/-g//'`
  24. fi
  25. dnl Hack to work around a Mac OS X cpp problem
  26. dnl Known versions needing this workaround are 5.3 and 5.4
  27. if test "$ac_cv_prog_gcc" = "yes" -a "`uname -s`" = "Rhapsody"; then
  28. CPPFLAGS="$CPPFLAGS -traditional-cpp"
  29. fi
  30. AC_CHECK_HEADERS(
  31. limits.h \
  32. malloc.h \
  33. string.h \
  34. unistd.h \
  35. stdarg.h \
  36. sys/types.h \
  37. signal.h \
  38. unix.h \
  39. dlfcn.h)
  40. AC_TYPE_SIZE_T
  41. AC_TYPE_SIGNAL
  42. AC_CHECK_LIB(c, dlopen, [
  43. # fake it
  44. AC_DEFINE(HAVE_LIBDL) ], [
  45. AC_CHECK_LIB(dl, dlopen, [
  46. LIBS="-ldl $LIBS"
  47. AC_DEFINE(HAVE_LIBDL) ], []) ])
  48. dnl This is required for QNX and may be some BSD derived systems
  49. AC_CHECK_TYPE( uint, unsigned int )
  50. AC_CHECK_TYPE( ulong, unsigned long )
  51. dnl Checks for library functions.
  52. AC_FUNC_VPRINTF
  53. AC_FUNC_MEMCMP
  54. AC_FUNC_ALLOCA
  55. AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol)
  56. AC_ZEND_BROKEN_SPRINTF
  57. AC_SUBST(ZEND_SCANNER)
  58. ])
  59. AC_DEFUN(LIBZEND_ENABLE_DEBUG,[
  60. AC_ARG_ENABLE(debug,
  61. [ --disable-debug Compile without debugging symbols],[
  62. ZEND_DEBUG=$enableval
  63. ],[
  64. ZEND_DEBUG=yes
  65. ])
  66. ])
  67. AC_DEFUN(LIBZEND_OTHER_CHECKS,[
  68. AC_ARG_ENABLE(experimental-zts,
  69. [ --enable-experimental-zts This will most likely break your build],[
  70. ZEND_EXPERIMENTAL_ZTS=$enableval
  71. ],[
  72. ZEND_EXPERIMENTAL_ZTS=no
  73. ])
  74. AC_ARG_ENABLE(inline-optimization,
  75. [ --enable-inline-optimization If you have much memory and are using
  76. gcc, you might try this.],[
  77. ZEND_INLINE_OPTIMIZATION=$enableval
  78. ],[
  79. ZEND_INLINE_OPTIMIZATION=no
  80. ])
  81. AC_ARG_ENABLE(memory-limit,
  82. [ --enable-memory-limit Compile with memory limit support. ], [
  83. ZEND_MEMORY_LIMIT=$enableval
  84. ],[
  85. ZEND_MEMORY_LIMIT=no
  86. ])
  87. AC_MSG_CHECKING(whether to enable experimental ZTS)
  88. AC_MSG_RESULT($ZEND_EXPERIMENTAL_ZTS)
  89. AC_MSG_CHECKING(whether to enable inline optimization for GCC)
  90. AC_MSG_RESULT($ZEND_INLINE_OPTIMIZATION)
  91. AC_MSG_CHECKING(whether to enable a memory limit)
  92. AC_MSG_RESULT($ZEND_MEMORY_LIMIT)
  93. AC_MSG_CHECKING(whether to enable Zend debugging)
  94. AC_MSG_RESULT($ZEND_DEBUG)
  95. if test "$ZEND_DEBUG" = "yes"; then
  96. AC_DEFINE(ZEND_DEBUG,1)
  97. echo " $CFLAGS" | grep ' -g' >/dev/null || DEBUG_CFLAGS="-g"
  98. test -n "$GCC" && DEBUG_CFLAGS="$DEBUG_CFLAGS -Wall"
  99. test -n "$GCC" && test "$USE_MAINTAINER_MODE" = "yes" && \
  100. DEBUG_CFLAGS="$DEBUG_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"
  101. else
  102. AC_DEFINE(ZEND_DEBUG,0)
  103. fi
  104. test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
  105. if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then
  106. AC_DEFINE(ZTS)
  107. ZEND_SCANNER_TYPE=cc
  108. CPPFLAGS="$CPPFLAGS -I../TSRM"
  109. LIBZEND_CPLUSPLUS_CHECKS
  110. else
  111. ZEND_SCANNER_TYPE=c
  112. fi
  113. ZEND_SCANNER="libZend_${ZEND_SCANNER_TYPE}.la"
  114. if test "$ZEND_MEMORY_LIMIT" = "yes"; then
  115. AC_DEFINE(MEMORY_LIMIT, 1, [Memory limit])
  116. else
  117. AC_DEFINE(MEMORY_LIMIT, 0, [Memory limit])
  118. fi
  119. changequote({,})
  120. if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
  121. INLINE_CFLAGS=`echo $ac_n "$CFLAGS $ac_c" | sed s/-O[0-9]*//`
  122. else
  123. INLINE_CFLAGS="$CFLAGS"
  124. fi
  125. changequote([,])
  126. AC_C_INLINE
  127. AC_SUBST(INLINE_CFLAGS)
  128. ])
  129. AC_DEFUN(LIBZEND_CPLUSPLUS_CHECKS,[
  130. dnl extra check to avoid C++ preprocessor testing if in non-ZTS mode
  131. if test "$ZEND_EXPERIMENTAL_ZTS" = "yes"; then
  132. AC_PROG_CXX
  133. AC_PROG_CXXCPP
  134. AC_LANG_CPLUSPLUS
  135. AC_CHECK_HEADER(stdiostream.h, [ AC_DEFINE(HAVE_STDIOSTREAM_H, [], Whether you have stdiostream.h) ])
  136. AC_CHECK_LIB(C, cin)
  137. AC_CHECK_LIB(g++, cin)
  138. AC_CHECK_LIB(stdc++, cin)
  139. dnl Digital Unix 4.0
  140. AC_CHECK_LIB(cxx, cin)
  141. AC_CHECK_LIB(cxxstd, __array_delete)
  142. AC_CACHE_CHECK(for class istdiostream,ac_cv_class_istdiostream,[
  143. AC_TRY_COMPILE([
  144. #include <sys/types.h>
  145. #include <unistd.h>
  146. #include <fstream.h>
  147. #include <stdiostream.h>
  148. ],[
  149. istdiostream *foo = new istdiostream((FILE *) 0);
  150. ],[
  151. ac_cv_class_istdiostream=yes
  152. ],[
  153. ac_cv_class_istdiostream=no
  154. ])
  155. ])
  156. if test "$ac_cv_class_istdiostream" = "yes"; then
  157. AC_DEFINE(HAVE_CLASS_ISTDIOSTREAM, 1, [Whether you have class istdiostream])
  158. fi
  159. AC_LANG_C
  160. fi
  161. ])