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.

116 lines
2.2 KiB

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