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.

112 lines
2.1 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_PROG_AWK
  45. sinclude(config.m4)
  46. enable_static=no
  47. enable_shared=yes
  48. AC_PROG_LIBTOOL
  49. all_targets='$(PHP_MODULES)'
  50. install_targets=install-modules
  51. phplibdir="`pwd`/modules"
  52. CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H"
  53. CFLAGS_CLEAN=$CFLAGS
  54. test "$prefix" = "NONE" && prefix="/usr/local"
  55. test "$exec_prefix" = "NONE" && exec_prefix='$(prefix)'
  56. PHP_SUBST(PHP_MODULES)
  57. PHP_SUBST(all_targets)
  58. PHP_SUBST(install_targets)
  59. PHP_SUBST(prefix)
  60. PHP_SUBST(exec_prefix)
  61. PHP_SUBST(libdir)
  62. PHP_SUBST(prefix)
  63. PHP_SUBST(phplibdir)
  64. PHP_SUBST(PHP_COMPILE)
  65. PHP_SUBST(CC)
  66. PHP_SUBST(CFLAGS)
  67. PHP_SUBST(CFLAGS_CLEAN)
  68. PHP_SUBST(CPP)
  69. PHP_SUBST(CPPFLAGS)
  70. PHP_SUBST(CXX)
  71. PHP_SUBST(DEFS)
  72. PHP_SUBST(EXTENSION_DIR)
  73. PHP_SUBST(EXTRA_LDFLAGS)
  74. PHP_SUBST(EXTRA_LIBS)
  75. PHP_SUBST(INCLUDES)
  76. PHP_SUBST(LEX)
  77. PHP_SUBST(LEX_OUTPUT_ROOT)
  78. PHP_SUBST(LFLAGS)
  79. PHP_SUBST(LDFLAGS)
  80. PHP_SUBST(SHARED_LIBTOOL)
  81. PHP_SUBST(LIBTOOL)
  82. PHP_SUBST(SHELL)
  83. PHP_SUBST(AWK)
  84. PHP_GEN_BUILD_DIRS
  85. PHP_GEN_GLOBAL_MAKEFILE
  86. test -d modules || mkdir modules
  87. touch .deps
  88. AC_CONFIG_HEADER(config.h)
  89. AC_OUTPUT()