Re: patch to install zip headers

From: Date: Thu, 17 Jan 2008 10:58:38 +0000
Subject: Re: patch to install zip headers
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-5083@lists.php.net to get a copy of this message
Hi Greg! I should definitively read all mails before beginning to reply :) Looks good, please apply :) PS: feel free to apply such patches without asking, they are part of what is required to make libzip available for other extensions On Jan 17, 2008 2:20 AM, Gregory Beaver <greg@chiaraquartet.net> wrote: > Hi, > > The attached patch is basically a direct rip of the header installation > stuff in ext/pdo. I tried it out and was able to install phar via pecl > after these changes. It doesn't affect regular builds, as far as I can > tell. I need to add header detection code to the .m4 in phar, but that > doesn't concern zip. > > Can you review this and commit if you like it? > > Greg > > Index: Makefile.frag > =================================================================== > RCS file: Makefile.frag > diff -N Makefile.frag > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ Makefile.frag 17 Jan 2008 01:16:47 -0000 > @@ -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 > + > Index: config.m4 > =================================================================== > RCS file: /repository/pecl/zip/config.m4,v > retrieving revision 1.12 > diff -u -r1.12 config.m4 > --- config.m4 6 Jan 2007 15:38:01 -0000 1.12 > +++ config.m4 17 Jan 2008 01:16:47 -0000 > @@ -66,4 +66,12 @@ > 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 > Index: package.xml > =================================================================== > RCS file: /repository/pecl/zip/package.xml,v > retrieving revision 1.73.2.14 > diff -u -r1.73.2.14 package.xml > --- package.xml 22 May 2007 09:32:17 -0000 1.73.2.14 > +++ package.xml 17 Jan 2008 01:16:47 -0000 > @@ -24,6 +24,7 @@ > <contents> > <dir name="/"> > <file name="config.m4" role="src"/> > + <file name="Makefile.frag" role="src"/> > <file name="config.w32" role="src"/> > <file name="CREDITS" role="doc"/> > <file name="php_zip.c" role="src"> > @@ -33,7 +34,9 @@ > <file name="php_zip.h" role="src"/> > <dir name="lib"> > <file name="zip.h" role="src"/> > + <file name="zip_alias.h" role="src"/> > <file name="zipint.h" role="src"/> > + <file name="zipint_alias.h" role="src"/> > <file name="zip_add.c" role="src"/> > <file name="zip_close.c" role="src"/> > <file name="zip_delete.c" role="src"/> > > -- Pierre http://blog.thepimp.net | http://www.libgd.org

« previous php.pecl.dev (#5083) next »