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.

132 lines
3.1 KiB

19 years ago
18 years ago
23 years ago
22 years ago
  1. dnl This file becomes configure.in for self-contained extensions.
  2. divert(1)
  3. AC_PREREQ(2.13)
  4. AC_INIT(config.m4)
  5. PHP_CONFIG_NICE(config.nice)
  6. dnl
  7. AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl
  8. AC_DEFUN([PHP_EXT_DIR],[""])dnl
  9. AC_DEFUN([PHP_EXT_SRCDIR],[$abs_srcdir])dnl
  10. AC_DEFUN([PHP_ALWAYS_SHARED],[
  11. ext_output="yes, shared"
  12. ext_shared=yes
  13. test "[$]$1" = "no" && $1=yes
  14. ])dnl
  15. dnl
  16. abs_srcdir=`(cd $srcdir && pwd)`
  17. abs_builddir=`pwd`
  18. AC_PROG_CC
  19. AC_PROG_CC_C_O
  20. dnl Support systems with system libraries in e.g. /usr/lib64
  21. PHP_ARG_WITH(libdir, for system library directory,
  22. [ --with-libdir=NAME Look for libraries in .../NAME rather than .../lib], lib, no)
  23. PHP_RUNPATH_SWITCH
  24. PHP_SHLIB_SUFFIX_NAMES
  25. dnl Find php-config script
  26. PHP_ARG_WITH(php-config,,
  27. [ --with-php-config=PATH Path to php-config [php-config]], php-config, no)
  28. dnl For BC
  29. PHP_CONFIG=$PHP_PHP_CONFIG
  30. prefix=`$PHP_CONFIG --prefix 2>/dev/null`
  31. phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null`
  32. INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
  33. EXTENSION_DIR=`$PHP_CONFIG --extension-dir 2>/dev/null`
  34. PHP_EXECUTABLE=`$PHP_CONFIG --php-binary 2>/dev/null`
  35. if test -z "$prefix"; then
  36. AC_MSG_ERROR([Cannot find php-config. Please use --with-php-config=PATH])
  37. fi
  38. php_shtool=$srcdir/build/shtool
  39. PHP_INIT_BUILD_SYSTEM
  40. AC_MSG_CHECKING([for PHP prefix])
  41. AC_MSG_RESULT([$prefix])
  42. AC_MSG_CHECKING([for PHP includes])
  43. AC_MSG_RESULT([$INCLUDES])
  44. AC_MSG_CHECKING([for PHP extension directory])
  45. AC_MSG_RESULT([$EXTENSION_DIR])
  46. AC_MSG_CHECKING([for PHP installed headers prefix])
  47. AC_MSG_RESULT([$phpincludedir])
  48. dnl Always shared
  49. PHP_BUILD_SHARED
  50. dnl Required programs
  51. PHP_PROG_RE2C
  52. PHP_PROG_AWK
  53. sinclude(config.m4)
  54. enable_static=no
  55. enable_shared=yes
  56. dnl Only allow AC_PROG_CXX and AC_PROG_CXXCPP if they are explicitly called (by PHP_REQUIRE_CXX).
  57. dnl Otherwise AC_PROG_LIBTOOL fails if there is no working C++ compiler.
  58. AC_PROVIDE_IFELSE([PHP_REQUIRE_CXX], [], [
  59. undefine([AC_PROG_CXX])
  60. AC_DEFUN([AC_PROG_CXX], [])
  61. undefine([AC_PROG_CXXCPP])
  62. AC_DEFUN([AC_PROG_CXXCPP], [php_prog_cxxcpp=disabled])
  63. ])
  64. AC_PROG_LIBTOOL
  65. all_targets='$(PHP_MODULES)'
  66. install_targets="install-modules install-headers"
  67. phplibdir="`pwd`/modules"
  68. CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
  69. CFLAGS_CLEAN='$(CFLAGS)'
  70. CXXFLAGS_CLEAN='$(CXXFLAGS)'
  71. test "$prefix" = "NONE" && prefix="/usr/local"
  72. test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
  73. PHP_SUBST(PHP_MODULES)
  74. PHP_SUBST(all_targets)
  75. PHP_SUBST(install_targets)
  76. PHP_SUBST(prefix)
  77. PHP_SUBST(exec_prefix)
  78. PHP_SUBST(libdir)
  79. PHP_SUBST(prefix)
  80. PHP_SUBST(phplibdir)
  81. PHP_SUBST(phpincludedir)
  82. PHP_SUBST(CC)
  83. PHP_SUBST(CFLAGS)
  84. PHP_SUBST(CFLAGS_CLEAN)
  85. PHP_SUBST(CPP)
  86. PHP_SUBST(CPPFLAGS)
  87. PHP_SUBST(CXX)
  88. PHP_SUBST(CXXFLAGS)
  89. PHP_SUBST(CXXFLAGS_CLEAN)
  90. PHP_SUBST(EXTENSION_DIR)
  91. PHP_SUBST(PHP_EXECUTABLE)
  92. PHP_SUBST(EXTRA_LDFLAGS)
  93. PHP_SUBST(EXTRA_LIBS)
  94. PHP_SUBST(INCLUDES)
  95. PHP_SUBST(LFLAGS)
  96. PHP_SUBST(LDFLAGS)
  97. PHP_SUBST(SHARED_LIBTOOL)
  98. PHP_SUBST(LIBTOOL)
  99. PHP_SUBST(SHELL)
  100. PHP_SUBST(INSTALL_HEADERS)
  101. PHP_GEN_BUILD_DIRS
  102. PHP_GEN_GLOBAL_MAKEFILE
  103. test -d modules || $php_shtool mkdir modules
  104. touch .deps
  105. AC_CONFIG_HEADER(config.h)
  106. AC_OUTPUT()