configure.ac 2.8 KB

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