diff options
author | foobar <sniper@php.net> | 2005-11-21 23:08:02 +0000 |
---|---|---|
committer | foobar <sniper@php.net> | 2005-11-21 23:08:02 +0000 |
commit | 7243d31ae025ee68fd19dc916f30d0e691a3293e (patch) | |
tree | 099c1835aa8881ab9aaadd8f7d3ec58e69d45b37 | |
parent | 19ea8abd0979399878703c2f894dd82ee96907db (diff) | |
download | php-git-7243d31ae025ee68fd19dc916f30d0e691a3293e.tar.gz |
MFH: - Fixed header installing under phpize builds
-rw-r--r-- | Makefile.global | 28 | ||||
-rw-r--r-- | acinclude.m4 | 11 | ||||
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | ext/standard/config.m4 | 3 | ||||
-rw-r--r-- | scripts/Makefile.frag | 19 | ||||
-rw-r--r-- | scripts/man1/php-config.1.in | 4 | ||||
-rw-r--r-- | scripts/php-config.in | 4 | ||||
-rw-r--r-- | scripts/phpize.m4 | 7 |
8 files changed, 53 insertions, 27 deletions
diff --git a/Makefile.global b/Makefile.global index 78c35677e4..86e6fc97d9 100644 --- a/Makefile.global +++ b/Makefile.global @@ -5,9 +5,6 @@ INSTALL_DATA = $(INSTALL) -m 644 DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir) COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH) -CORE_HEADERS = Zend/ TSRM/ include/ main/ main/streams/ regex/ ext/standard/ -INSTALL_HEADERS = $(CORE_HEADERS) $(INSTALL_EXT_HEADERS) - all: $(all_targets) @echo @echo "Build complete." @@ -45,6 +42,31 @@ install-modules: build-modules @rm -f modules/*.la >/dev/null 2>&1 @$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR) +install-headers: + -@if test "$(INSTALL_HEADERS)"; then + for i in $(INSTALL_HEADERS); do \ + i=`$(top_srcdir)/build/shtool path -d $$i`; \ + paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \ + done; \ + $(mkinstalldirs) $$paths && \ + echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \ + for i in $(INSTALL_HEADERS); do \ + if test "$(PHP_PECL_EXTENSION)"; then \ + src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \ + else \ + src=$$i; \ + fi; \ + if test -f "$(top_srcdir)/$$src"; then \ + $(INSTALL_DATA) $(top_srcdir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \ + elif test -f "$(top_builddir)/$$src"; then \ + $(INSTALL_DATA) $(top_builddir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \ + else \ + (cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \ + cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \ + fi \ + done; \ + fi + install-su: install-pear test: all diff --git a/acinclude.m4 b/acinclude.m4 index 7b8e6a23dd..0cc1ac347f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -973,6 +973,13 @@ dnl ---------------------------------------------- CLI static module EXT_CLI_STATIC="$EXT_CLI_STATIC $1" fi PHP_ADD_BUILD_DIR($ext_builddir) + +dnl Set for phpize builds only +dnl --------------------------- + if test "$ext_builddir" = "."; then + PHP_PECL_EXTENSION=$1 + PHP_SUBST(PHP_PECL_EXTENSION) + fi ]) dnl @@ -2379,7 +2386,7 @@ AC_DEFUN([PHP_INSTALL_HEADERS],[ ifelse([$2],[],[ for header_file in $1; do PHP_RUN_ONCE(INSTALLHEADERS, $header_file, [ - INSTALL_EXT_HEADERS="$INSTALL_EXT_HEADERS $header_file" + INSTALL_HEADERS="$INSTALL_HEADERS $header_file" ]) done ], [ @@ -2387,7 +2394,7 @@ AC_DEFUN([PHP_INSTALL_HEADERS],[ for header_file in $2; do hp_hf="$header_path/$header_file" PHP_RUN_ONCE(INSTALLHEADERS, $hp_hf, [ - INSTALL_EXT_HEADERS="$INSTALL_EXT_HEADERS $hp_hf" + INSTALL_HEADERS="$INSTALL_HEADERS $hp_hf" ]) done ]) diff --git a/configure.in b/configure.in index 3b119d2faf..3a01a9dd0b 100644 --- a/configure.in +++ b/configure.in @@ -1129,7 +1129,7 @@ PHP_SUBST(WARNING_LEVEL) PHP_SUBST(PHP_FRAMEWORKS) PHP_SUBST(PHP_FRAMEWORKPATH) PHP_SUBST_OLD(SHLIB_SUFFIX_NAME) -PHP_SUBST(INSTALL_EXT_HEADERS) +PHP_SUBST(INSTALL_HEADERS) old_CC=$CC @@ -1198,6 +1198,8 @@ esac PHP_SUBST(all_targets) PHP_SUBST(install_targets) +PHP_INSTALL_HEADERS([Zend/ TSRM/ include/ main/ main/streams/ regex/]) + PHP_ADD_SOURCES(TSRM, TSRM.c tsrm_strtok_r.c tsrm_virtual_cwd.c) PHP_ADD_SOURCES(main, main.c snprintf.c spprintf.c php_sprintf.c \ diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 4958e79fa4..621a84785f 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -492,3 +492,6 @@ PHP_NEW_EXTENSION(standard, array.c base64.c basic_functions.c browscap.c crc32. filters.c proc_open.c sunfuncs.c streamsfuncs.c http.c) PHP_ADD_MAKEFILE_FRAGMENT + +PHP_INSTALL_HEADERS([ext/standard/]) + diff --git a/scripts/Makefile.frag b/scripts/Makefile.frag index 61783d777d..632cbb00d7 100644 --- a/scripts/Makefile.frag +++ b/scripts/Makefile.frag @@ -31,25 +31,6 @@ install-build: $(INSTALL) $(BUILD_FILES_EXEC) $(INSTALL_ROOT)$(phpbuilddir) && \ $(INSTALL_DATA) $(BUILD_FILES) $(INSTALL_ROOT)$(phpbuilddir)) -install-headers: - -@for i in $(INSTALL_HEADERS); do \ - i=`$(top_srcdir)/build/shtool path -d $$i`; \ - paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \ - done; \ - $(mkinstalldirs) $$paths && \ - echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \ - for i in $(INSTALL_HEADERS); do \ - if test -f "$(top_srcdir)/$$i"; then \ - $(INSTALL_DATA) $(top_srcdir)/$$i $(INSTALL_ROOT)$(phpincludedir)/$$i; \ - elif test -f "$(top_builddir)/$$i"; then \ - $(INSTALL_DATA) $(top_builddir)/$$i $(INSTALL_ROOT)$(phpincludedir)/$$i; \ - else \ - (cd $(top_srcdir)/$$i && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \ - cd $(top_builddir)/$$i && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \ - fi \ - done; \ - cd $(top_srcdir)/sapi/embed && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/main - install-programs: $(builddir)/phpize $(builddir)/php-config @echo "Installing helper programs: $(INSTALL_ROOT)$(bindir)/" @for prog in $(bin_SCRIPTS); do \ diff --git a/scripts/man1/php-config.1.in b/scripts/man1/php-config.1.in index bdc5654785..c4a6998f9a 100644 --- a/scripts/man1/php-config.1.in +++ b/scripts/man1/php-config.1.in @@ -51,6 +51,10 @@ Extra libraries which PHP was compiled with Directory where extensions are searched by default .TP .PD 0 +.B \-\-include-dir +Directory prefix where header files are installed by default +.TP +.PD 0 .B \-\-php-binary Full path to php CLI/CGI binary .TP diff --git a/scripts/php-config.in b/scripts/php-config.in index 8c5a0a55df..593f28edca 100644 --- a/scripts/php-config.in +++ b/scripts/php-config.in @@ -24,12 +24,14 @@ case "$1" in echo $libs;; --extension-dir) echo $extension_dir;; +--include-dir) + echo $includedir;; --php-binary) echo $php_binary;; --version) echo $version;; *) - echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--php-binary|--version]" + echo "Usage: $0 [--prefix|--includes|--ldflags|--libs|--extension-dir|--include-dir|--php-binary|--version]" exit 1;; esac diff --git a/scripts/phpize.m4 b/scripts/phpize.m4 index 87531ca675..62618f7ee7 100644 --- a/scripts/phpize.m4 +++ b/scripts/phpize.m4 @@ -16,6 +16,7 @@ AC_DEFUN([PHP_WITH_PHP_CONFIG],[ ]) prefix=`$PHP_CONFIG --prefix 2>/dev/null` + phpincludedir=`$PHP_CONFIG --include-dir 2>/dev/null` INCLUDES=`$PHP_CONFIG --includes 2>/dev/null` EXTENSION_DIR=`$PHP_CONFIG --extension-dir` PHP_EXECUTABLE=`$PHP_CONFIG --php-binary` @@ -33,6 +34,8 @@ AC_DEFUN([PHP_WITH_PHP_CONFIG],[ AC_MSG_RESULT($INCLUDES) AC_MSG_CHECKING(for PHP extension directory) AC_MSG_RESULT($EXTENSION_DIR) + AC_MSG_CHECKING(for PHP installed headers prefix) + AC_MSG_RESULT($phpincludedir) ]) dnl AC_DEFUN([PHP_EXT_BUILDDIR],[.])dnl @@ -74,7 +77,7 @@ enable_shared=yes AC_PROG_LIBTOOL all_targets='$(PHP_MODULES)' -install_targets=install-modules +install_targets="install-modules install-headers" phplibdir="`pwd`/modules" CPPFLAGS="$CPPFLAGS -DHAVE_CONFIG_H" CFLAGS_CLEAN='$(CFLAGS)' @@ -91,6 +94,7 @@ PHP_SUBST(exec_prefix) PHP_SUBST(libdir) PHP_SUBST(prefix) PHP_SUBST(phplibdir) +PHP_SUBST(phpincludedir) PHP_SUBST(CC) PHP_SUBST(CFLAGS) @@ -109,6 +113,7 @@ PHP_SUBST(LDFLAGS) PHP_SUBST(SHARED_LIBTOOL) PHP_SUBST(LIBTOOL) PHP_SUBST(SHELL) +PHP_SUBST(INSTALL_HEADERS) PHP_GEN_BUILD_DIRS PHP_GEN_GLOBAL_MAKEFILE |