mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
- Fixed header installing under phpize builds
This commit is contained in:
parent
77e5a7e300
commit
bcade7ced4
8 changed files with 53 additions and 27 deletions
|
@ -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
|
||||
|
||||
test: all
|
||||
-@if test ! -z "$(PHP_EXECUTABLE)" && test -x "$(PHP_EXECUTABLE)"; then \
|
||||
TEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \
|
||||
|
|
11
acinclude.m4
11
acinclude.m4
|
@ -971,6 +971,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
|
||||
|
@ -2375,7 +2382,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
|
||||
], [
|
||||
|
@ -2383,7 +2390,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
|
||||
])
|
||||
|
|
|
@ -1188,7 +1188,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
|
||||
|
||||
|
@ -1257,6 +1257,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 \
|
||||
|
|
|
@ -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/])
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue