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.

119 lines
2.4 KiB

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