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.

128 lines
3.0 KiB

19 years ago
23 years ago
21 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 if it's 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], [AC_PROG_CXX], [undefine([AC_PROG_CXX])
  59. AC_DEFUN([AC_PROG_CXX], [])])
  60. AC_PROG_LIBTOOL
  61. all_targets='$(PHP_MODULES)'
  62. install_targets="install-modules install-headers"
  63. phplibdir="`pwd`/modules"
  64. CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
  65. CFLAGS_CLEAN='$(CFLAGS)'
  66. CXXFLAGS_CLEAN='$(CXXFLAGS)'
  67. test "$prefix" = "NONE" && prefix="/usr/local"
  68. test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
  69. PHP_SUBST(PHP_MODULES)
  70. PHP_SUBST(all_targets)
  71. PHP_SUBST(install_targets)
  72. PHP_SUBST(prefix)
  73. PHP_SUBST(exec_prefix)
  74. PHP_SUBST(libdir)
  75. PHP_SUBST(prefix)
  76. PHP_SUBST(phplibdir)
  77. PHP_SUBST(phpincludedir)
  78. PHP_SUBST(CC)
  79. PHP_SUBST(CFLAGS)
  80. PHP_SUBST(CFLAGS_CLEAN)
  81. PHP_SUBST(CPP)
  82. PHP_SUBST(CPPFLAGS)
  83. PHP_SUBST(CXX)
  84. PHP_SUBST(CXXFLAGS)
  85. PHP_SUBST(CXXFLAGS_CLEAN)
  86. PHP_SUBST(EXTENSION_DIR)
  87. PHP_SUBST(PHP_EXECUTABLE)
  88. PHP_SUBST(EXTRA_LDFLAGS)
  89. PHP_SUBST(EXTRA_LIBS)
  90. PHP_SUBST(INCLUDES)
  91. PHP_SUBST(LFLAGS)
  92. PHP_SUBST(LDFLAGS)
  93. PHP_SUBST(SHARED_LIBTOOL)
  94. PHP_SUBST(LIBTOOL)
  95. PHP_SUBST(SHELL)
  96. PHP_SUBST(INSTALL_HEADERS)
  97. PHP_GEN_BUILD_DIRS
  98. PHP_GEN_GLOBAL_MAKEFILE
  99. test -d modules || $php_shtool mkdir modules
  100. touch .deps
  101. AC_CONFIG_HEADER(config.h)
  102. AC_OUTPUT()