summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Beaver <cellog@php.net>2008-01-18 00:30:10 +0000
committerGreg Beaver <cellog@php.net>2008-01-18 00:30:10 +0000
commit5f8d225834a09d05c7834ce2538f8d70cb3dd8bd (patch)
tree7afe33a3dd188ba88d7338d596d76daa86324f19
parent0d074e23d358a63ac83d97da1a50cddfa2a0db2a (diff)
downloadphp-git-5f8d225834a09d05c7834ce2538f8d70cb3dd8bd.tar.gz
MFPECL: install headers
-rw-r--r--ext/zip/Makefile.frag28
-rw-r--r--ext/zip/config.m48
2 files changed, 36 insertions, 0 deletions
diff --git a/ext/zip/Makefile.frag b/ext/zip/Makefile.frag
new file mode 100644
index 0000000000..b3781e3e7b
--- /dev/null
+++ b/ext/zip/Makefile.frag
@@ -0,0 +1,28 @@
+phpincludedir=$(prefix)/include/php
+
+ZIP_HEADER_FILES= \
+ zip.h \
+ zipint.h \
+ zip_alias.h \
+ zipint_alias.h
+
+install-zip-headers:
+ @echo "Installing ZIP headers: $(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib"
+ @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib
+ @for f in $(ZIP_HEADER_FILES); do \
+ if test -f "$(top_srcdir)/lib/$$f"; then \
+ $(INSTALL_DATA) $(top_srcdir)/lib/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib; \
+ elif test -f "$(top_builddir)/lib/$$f"; then \
+ $(INSTALL_DATA) $(top_builddir)/lib/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib; \
+ elif test -f "$(top_srcdir)/ext/zip/lib/$$f"; then \
+ $(INSTALL_DATA) $(top_srcdir)/ext/zip/lib/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib; \
+ elif test -f "$(top_builddir)/ext/zip/lib/$$f"; then \
+ $(INSTALL_DATA) $(top_builddir)/ext/zip/lib/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/zip/lib; \
+ else \
+ echo "hmmm"; \
+ fi \
+ done;
+
+# mini hack
+install: $(all_targets) $(install_targets) install-zip-headers
+
diff --git a/ext/zip/config.m4 b/ext/zip/config.m4
index c5edaa725e..271bd2faa0 100644
--- a/ext/zip/config.m4
+++ b/ext/zip/config.m4
@@ -66,4 +66,12 @@ if test "$PHP_ZIP" != "no"; then
PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared)
PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
PHP_SUBST(ZIP_SHARED_LIBADD)
+ ifdef([PHP_INSTALL_HEADERS],
+ [
+ dnl Sadly, this is a complete NOP for pecl extensions
+ PHP_INSTALL_HEADERS(ext/zip/lib, [lib/zip.h lib/zipint.h lib/zip_alias.h lib/zipint_alias.h])
+ ])
+
+ dnl so we always include the known-good working hack.
+ PHP_ADD_MAKEFILE_FRAGMENT
fi