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.

123 lines
2.4 KiB

  1. dnl This file becomes configure.in for self-contained extensions.
  2. AC_INIT(config.m4)
  3. PHP_INIT_BUILD_SYSTEM
  4. AC_DEFUN(PHP_WITH_PHP_CONFIG,[
  5. AC_ARG_WITH(php-config,
  6. [ --with-php-config=PATH],[
  7. PHP_CONFIG=$withval
  8. ],[
  9. PHP_CONFIG=php-config
  10. ])
  11. prefix=`$PHP_CONFIG --prefix 2>/dev/null`
  12. INCLUDES=`$PHP_CONFIG --includes 2>/dev/null`
  13. EXTENSION_DIR=`$PHP_CONFIG --extension-dir`
  14. if test -z "$prefix"; then
  15. AC_MSG_ERROR(Cannot find php-config. Please use --with-php-config=PATH)
  16. fi
  17. AC_MSG_CHECKING(for PHP prefix)
  18. AC_MSG_RESULT($prefix)
  19. AC_MSG_CHECKING(for PHP includes)
  20. AC_MSG_RESULT($INCLUDES)
  21. AC_MSG_CHECKING(for PHP extension directory)
  22. AC_MSG_RESULT($EXTENSION_DIR)
  23. ])
  24. dnl
  25. AC_DEFUN(PHP_EXT_BUILDDIR,[.])dnl
  26. AC_DEFUN(PHP_EXT_DIR,[""])dnl
  27. AC_DEFUN(PHP_EXT_SRCDIR,[$abs_srcdir])dnl
  28. AC_DEFUN(PHP_ALWAYS_SHARED,[
  29. ext_output="yes, shared"
  30. ext_shared=yes
  31. test "[$]$1" = "no" && $1=yes
  32. ])dnl
  33. dnl
  34. abs_srcdir=`(cd $srcdir && pwd)`
  35. abs_builddir=`pwd`
  36. PHP_CONFIG_NICE(config.nice)
  37. AC_PROG_CC
  38. AC_PROG_CC_C_O
  39. PHP_RUNPATH_SWITCH
  40. PHP_SHLIB_SUFFIX_NAME
  41. PHP_WITH_PHP_CONFIG
  42. PHP_BUILD_SHARED
  43. AC_PREFIX_DEFAULT()
  44. AC_ARG_WITH(openssl,
  45. [ --with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.5) ],
  46. [
  47. if test "$withval" != "no"; then
  48. PHP_WITH_SHARED
  49. PHP_OPENSSL=$withval
  50. ext_openssl_shared=yes
  51. ext_shared=yes
  52. PHP_SETUP_OPENSSL
  53. fi
  54. ])
  55. sinclude(config.m4)
  56. enable_static=no
  57. enable_shared=yes
  58. AC_PROG_LIBTOOL
  59. AC_PROG_AWK
  60. all_targets='$(PHP_MODULES)'
  61. install_targets=install-modules
  62. phplibdir="`pwd`/modules"
  63. CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
  64. CFLAGS_CLEAN=$CFLAGS
  65. test "$prefix" = "NONE" && prefix="/usr/local"
  66. test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
  67. PHP_SUBST(PHP_MODULES)
  68. PHP_SUBST(all_targets)
  69. PHP_SUBST(install_targets)
  70. PHP_SUBST(prefix)
  71. PHP_SUBST(exec_prefix)
  72. PHP_SUBST(libdir)
  73. PHP_SUBST(prefix)
  74. PHP_SUBST(phplibdir)
  75. PHP_SUBST(PHP_COMPILE)
  76. PHP_SUBST(CC)
  77. PHP_SUBST(CFLAGS)
  78. PHP_SUBST(CFLAGS_CLEAN)
  79. PHP_SUBST(CPP)
  80. PHP_SUBST(CPPFLAGS)
  81. PHP_SUBST(CXX)
  82. PHP_SUBST(DEFS)
  83. PHP_SUBST(EXTENSION_DIR)
  84. PHP_SUBST(EXTRA_LDFLAGS)
  85. PHP_SUBST(EXTRA_LIBS)
  86. PHP_SUBST(INCLUDES)
  87. PHP_SUBST(LEX)
  88. PHP_SUBST(LEX_OUTPUT_ROOT)
  89. PHP_SUBST(LFLAGS)
  90. PHP_SUBST(LDFLAGS)
  91. PHP_SUBST(SHARED_LIBTOOL)
  92. PHP_SUBST(LIBTOOL)
  93. PHP_SUBST(SHELL)
  94. PHP_SUBST(AWK)
  95. PHP_GEN_BUILD_DIRS
  96. PHP_GEN_GLOBAL_MAKEFILE
  97. test -d modules || mkdir modules
  98. touch .deps
  99. AC_CONFIG_HEADER(config.h)
  100. AC_OUTPUT()