configure.in 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. dnl $Id$
  2. dnl Process this file with autoconf to produce a configure script.
  3. AC_INIT(zend.c)
  4. AM_INIT_AUTOMAKE(zend, 0.80A, nodefine)
  5. AM_CONFIG_HEADER(zend_config.h)
  6. AM_SANITY_CHECK
  7. AM_MAINTAINER_MODE
  8. AC_PROG_CC
  9. AM_PROG_CC_STDC
  10. ZEND_VERSION=$VERSION
  11. AC_ZEND_C_BIGENDIAN
  12. AH_TOP([
  13. #if defined(__GNUC__) && __GNUC__ >= 4
  14. # define ZEND_API __attribute__ ((visibility("default")))
  15. # define ZEND_DLEXPORT __attribute__ ((visibility("default")))
  16. #else
  17. # define ZEND_API
  18. # define ZEND_DLEXPORT
  19. #endif
  20. #define ZEND_DLIMPORT
  21. #undef uint
  22. #undef ulong
  23. /* Define if you want to enable memory limit support */
  24. #define MEMORY_LIMIT 0
  25. ])
  26. AH_BOTTOM([
  27. #ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
  28. #ifdef HAVE_STDLIB_H
  29. # include <stdlib.h>
  30. #endif
  31. #ifdef HAVE_SYS_TYPES_H
  32. # include <sys/types.h>
  33. #endif
  34. #ifdef HAVE_SYS_SELECT_H
  35. #include <sys/select.h>
  36. #endif
  37. #ifdef HAVE_IEEEFP_H
  38. # include <ieeefp.h>
  39. #endif
  40. #ifdef HAVE_STRING_H
  41. # include <string.h>
  42. #else
  43. # include <strings.h>
  44. #endif
  45. #if ZEND_BROKEN_SPRINTF
  46. int zend_sprintf(char *buffer, const char *format, ...);
  47. #else
  48. # define zend_sprintf sprintf
  49. #endif
  50. #include <math.h>
  51. /* To enable the is_nan, is_infinite and is_finite PHP functions */
  52. #ifdef NETWARE
  53. #define HAVE_ISNAN 1
  54. #define HAVE_ISINF 1
  55. #define HAVE_ISFINITE 1
  56. #endif
  57. #ifndef zend_isnan
  58. #ifdef HAVE_ISNAN
  59. #define zend_isnan(a) isnan(a)
  60. #elif defined(HAVE_FPCLASS)
  61. #define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
  62. #else
  63. #define zend_isnan(a) 0
  64. #endif
  65. #endif
  66. #ifdef HAVE_ISINF
  67. #define zend_isinf(a) isinf(a)
  68. #elif defined(INFINITY)
  69. /* Might not work, but is required by ISO C99 */
  70. #define zend_isinf(a) (((a)==INFINITY)?1:0)
  71. #elif defined(HAVE_FPCLASS)
  72. #define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
  73. #else
  74. #define zend_isinf(a) 0
  75. #endif
  76. #ifdef HAVE_FINITE
  77. #define zend_finite(a) finite(a)
  78. #elif defined(HAVE_ISFINITE) || defined(isfinite)
  79. #define zend_finite(a) isfinite(a)
  80. #elif defined(fpclassify)
  81. #define zend_finite(a) ((fpclassify((a))!=FP_INFINITE&&fpclassify((a))!=FP_NAN)?1:0)
  82. #else
  83. #define zend_finite(a) (zend_isnan(a) ? 0 : zend_isinf(a) ? 0 : 1)
  84. #endif
  85. #endif /* ifndef ZEND_ACCONFIG_H_NO_C_PROTOS */
  86. #ifdef NETWARE
  87. #ifdef USE_WINSOCK
  88. #/*This detection against winsock is of no use*/ undef HAVE_SOCKLEN_T
  89. #/*This detection against winsock is of no use*/ undef HAVE_SYS_SOCKET_H
  90. #endif
  91. #endif
  92. ])
  93. dnl We want this one before the checks, so the checks can modify CFLAGS.
  94. test -z "$CFLAGS" && auto_cflags=1
  95. AC_CHECK_SIZEOF(long, 8)
  96. AC_CHECK_SIZEOF(int, 4)
  97. sinclude(Zend.m4)
  98. LIBZEND_BASIC_CHECKS
  99. LIBZEND_LIBDL_CHECKS
  100. LIBZEND_DLSYM_CHECK
  101. AM_PROG_LIBTOOL
  102. if test "$enable_debug" != "yes"; then
  103. AM_SET_LIBTOOL_VARIABLE([--silent])
  104. fi
  105. dnl
  106. dnl Check for /usr/pkg/{lib,include} which is where NetBSD puts binary
  107. dnl and source packages. This should be harmless on other OSs.
  108. dnl
  109. if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
  110. CFLAGS="$CFLAGS -I/usr/pkg/include"
  111. LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
  112. fi
  113. LIBZEND_ENABLE_DEBUG
  114. LIBZEND_OTHER_CHECKS
  115. ZEND_EXTRA_LIBS="$LIBS"
  116. LIBS=""
  117. AC_SUBST(ZEND_EXTRA_LIBS)
  118. AC_OUTPUT(Makefile)
  119. # Local Variables:
  120. # tab-width: 4
  121. # End: