From: Dmitry Stogov Date: Mon, 29 Jun 2020 08:14:20 +0000 (+0300) Subject: Fixed bug #79737 (Building embed as static fails during install step). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46e38a192751be02ff95d56fb0c6c18ec4d7d6df;p=php Fixed bug #79737 (Building embed as static fails during install step). --- diff --git a/build/Makefile.global b/build/Makefile.global index 45c948e5d9..61ba37271d 100644 --- a/build/Makefile.global +++ b/build/Makefile.global @@ -16,7 +16,7 @@ build-modules: $(PHP_MODULES) $(PHP_ZEND_EX) build-binaries: $(PHP_BINARIES) libphp.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) - $(LIBTOOL) --mode=link $(CC) -shared $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ + $(LIBTOOL) --mode=link $(CC) $(LIBPHP_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ -@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1 libs/libphp.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4 index 67c6d9beea..bcdb188d1b 100644 --- a/sapi/apache2handler/config.m4 +++ b/sapi/apache2handler/config.m4 @@ -77,6 +77,9 @@ if test "$PHP_APXS2" != "no"; then -i -a -n php" fi + LIBPHP_CFLAGS="-shared" + PHP_SUBST(LIBPHP_CFLAGS) + case $host_alias in *aix*) EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp" diff --git a/sapi/embed/config.m4 b/sapi/embed/config.m4 index 069f4dcd0c..39d7dcf0a3 100644 --- a/sapi/embed/config.m4 +++ b/sapi/embed/config.m4 @@ -10,10 +10,12 @@ AC_MSG_CHECKING([for embedded SAPI library support]) if test "$PHP_EMBED" != "no"; then case "$PHP_EMBED" in yes|shared) + LIBPHP_CFLAGS="-shared" PHP_EMBED_TYPE=shared INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(prefix)/lib" ;; static) + LIBPHP_CFLAGS="-static" PHP_EMBED_TYPE=static INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0644 $SAPI_STATIC \$(INSTALL_ROOT)\$(prefix)/lib" ;; @@ -22,6 +24,7 @@ if test "$PHP_EMBED" != "no"; then ;; esac if test "$PHP_EMBED_TYPE" != "no"; then + PHP_SUBST(LIBPHP_CFLAGS) PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) PHP_INSTALL_HEADERS([sapi/embed/php_embed.h]) fi