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.

88 lines
3.2 KiB

  1. # +----------------------------------------------------------------------+
  2. # | PHP version 4.0 |
  3. # +----------------------------------------------------------------------+
  4. # | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
  5. # +----------------------------------------------------------------------+
  6. # | This source file is subject to version 2.02 of the PHP license, |
  7. # | that is bundled with this package in the file LICENSE, and is |
  8. # | available at through the world-wide-web at |
  9. # | http://www.php.net/license/2_02.txt. |
  10. # | If you did not receive a copy of the PHP license and are unable to |
  11. # | obtain it through the world-wide-web, please send a note to |
  12. # | license@php.net so we can mail you a copy immediately. |
  13. # +----------------------------------------------------------------------+
  14. # | Authors: Sascha Schumann <sascha@schumann.cx> |
  15. # +----------------------------------------------------------------------+
  16. #
  17. # $Id$
  18. #
  19. AC_DEFUN(LIB_SHARED_CONVENIENCE,[
  20. lib_target="\$(LTLIBRARY_NAME)"
  21. cat >>$1<<EOF
  22. \$(LTLIBRARY_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
  23. \$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \[$]@ \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
  24. EOF
  25. ])
  26. AC_DEFUN(LIB_SHARED_MODULE,[
  27. lib_target="\$(LTLIBRARY_SHARED_NAME)"
  28. cat >>$1<<EOF
  29. \$(LTLIBRARY_SHARED_NAME): \$(LTLIBRARY_SHARED_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
  30. \$(SHARED_LIBTOOL) --mode=link \$(COMPILE) \$(LDFLAGS) -o \[$]@ -avoid-version -module -rpath \$(phplibdir) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_SHARED_LIBADD)
  31. \$(SHARED_LIBTOOL) --mode=install cp \[$]@ \$(phplibdir)
  32. EOF
  33. ])
  34. AC_DEFUN(LIB_STATIC_CONVENIENCE,[
  35. lib_target="\$(LTLIBRARY_NAME)"
  36. cat >>$1<<EOF
  37. \$(LTLIBRARY_NAME): \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_DEPENDENCIES)
  38. \$(LINK) \$(LTLIBRARY_LDFLAGS) \$(LTLIBRARY_OBJECTS) \$(LTLIBRARY_LIBADD)
  39. EOF
  40. ])
  41. dnl LIB_BUILD(path, shared, convenience)
  42. dnl sets up path to build a shared/static convenience/module
  43. AC_DEFUN(LIB_BUILD,[
  44. lib_makefile="$1/libs.mk"
  45. lib_target=""
  46. $php_shtool mkdir -p $1
  47. if test "$BSD_MAKEFILE" = "yes"; then
  48. lib_include_conf=".include \"\$(top_builddir)/config_vars.mk\""
  49. else
  50. lib_include_conf="include \$(top_builddir)/config_vars.mk"
  51. fi
  52. cat >$lib_makefile<<EOF
  53. $lib_include_conf
  54. LTLIBRARY_OBJECTS = \$(LTLIBRARY_SOURCES:.c=.lo) \$(LTLIBRARY_OBJECTS_X)
  55. LTLIBRARY_SHARED_OBJECTS = \$(LTLIBRARY_OBJECTS:.lo=.slo)
  56. EOF
  57. if test "$2" = "shared" || test "$2" = "yes"; then
  58. lib_build_shared=yes
  59. if test -n "$3"; then
  60. dnl ---------------------------------------- Shared Convenience
  61. LIB_SHARED_CONVENIENCE($lib_makefile)
  62. else
  63. dnl ---------------------------------------- Shared Module
  64. LIB_SHARED_MODULE($lib_makefile)
  65. fi
  66. else
  67. dnl ---------------------------------------- Static Convenience = Static Module
  68. LIB_STATIC_CONVENIENCE($lib_makefile)
  69. fi
  70. dnl ---------------------------------------- Generate build targets
  71. if test -n "$lib_target"; then
  72. cat >>$lib_makefile<<EOF
  73. targets = $lib_target
  74. EOF
  75. fi
  76. ])