Makefile fragment installing headers
authorMichael Wallner <mike@php.net>
Tue, 3 May 2005 14:48:33 +0000 (14:48 +0000)
committerMichael Wallner <mike@php.net>
Tue, 3 May 2005 14:48:33 +0000 (14:48 +0000)
Makefile.frag [new file with mode: 0644]
config.m4

diff --git a/Makefile.frag b/Makefile.frag
new file mode 100644 (file)
index 0000000..9854c03
--- /dev/null
@@ -0,0 +1,41 @@
+phpincludedir=$(prefix)/include/php
+
+HTTP_HEADER_FILES= \
+       phpstr/phpstr.h \
+       php_http_cache_api.h \
+       php_http_headers_api.h \
+       php_http_response_object.h \
+       php_http_util_object.h \
+       php_http.h \
+       php_http_curl_api.h \
+       php_http_message_api.h \
+       php_http_send_api.h \
+       php_http_api.h \
+       php_http_date_api.h \
+       php_http_message_object.h \
+       php_http_std_defs.h \
+       php_http_auth_api.h \
+       php_http_exception_object.h \
+       php_http_request_object.h \
+       php_http_url_api.h
+
+install-http-headers:
+       @echo "Installing HTTP headers:          $(INSTALL_ROOT)$(phpincludedir)/ext/http/"
+       @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/http
+       @for f in $(HTTP_HEADER_FILES); do \
+               if test -f "$(top_srcdir)/$$f"; then \
+                       $(INSTALL_DATA) $(top_srcdir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
+               elif test -f "$(top_builddir)/$$f"; then \
+                       $(INSTALL_DATA) $(top_builddir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
+               elif test -f "$(top_srcdir)/ext/http/$$f"; then \
+                       $(INSTALL_DATA) $(top_srcdir)/ext/http/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
+               elif test -f "$(top_builddir)/ext/http/$$f"; then \
+                       $(INSTALL_DATA) $(top_builddir)/ext/http/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
+               else \
+                       echo "WTF? $f $$f"; \
+               fi \
+       done;
+
+# mini hack
+install: $(all_targets) $(install_targets) install-http-headers
+
index 8b3a49f107c0932d3a29ed7a4a49c31011602c88..cb11b2d5f288c85f1644ba7c78834701dd21f3c2 100644 (file)
--- a/config.m4
+++ b/config.m4
@@ -78,5 +78,6 @@ dnl ----
                http_headers_api.c http_message_api.c http_send_api.c http_url_api.c"
        PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, [$ext_shared])
        PHP_SUBST([HTTP_SHARED_LIBADD])
+       PHP_ADD_MAKEFILE_FRAGMENT
        AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support])
 fi