Skip to content

Commit 46e38a1

Browse files
committed
Fixed bug #79737 (Building embed as static fails during install step).
1 parent 315ea60 commit 46e38a1

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

build/Makefile.global

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ build-modules: $(PHP_MODULES) $(PHP_ZEND_EX)
1616
build-binaries: $(PHP_BINARIES)
1717

1818
libphp.la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)
19-
$(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 $@
19+
$(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 $@
2020
-@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1
2121

2222
libs/libphp.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)

sapi/apache2handler/config.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ if test "$PHP_APXS2" != "no"; then
7777
-i -a -n php"
7878
fi
7979

80+
LIBPHP_CFLAGS="-shared"
81+
PHP_SUBST(LIBPHP_CFLAGS)
82+
8083
case $host_alias in
8184
*aix*)
8285
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"

sapi/embed/config.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ AC_MSG_CHECKING([for embedded SAPI library support])
1010
if test "$PHP_EMBED" != "no"; then
1111
case "$PHP_EMBED" in
1212
yes|shared)
13+
LIBPHP_CFLAGS="-shared"
1314
PHP_EMBED_TYPE=shared
1415
INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(prefix)/lib"
1516
;;
1617
static)
18+
LIBPHP_CFLAGS="-static"
1719
PHP_EMBED_TYPE=static
1820
INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0644 $SAPI_STATIC \$(INSTALL_ROOT)\$(prefix)/lib"
1921
;;
@@ -22,6 +24,7 @@ if test "$PHP_EMBED" != "no"; then
2224
;;
2325
esac
2426
if test "$PHP_EMBED_TYPE" != "no"; then
27+
PHP_SUBST(LIBPHP_CFLAGS)
2528
PHP_SELECT_SAPI(embed, $PHP_EMBED_TYPE, php_embed.c, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
2629
PHP_INSTALL_HEADERS([sapi/embed/php_embed.h])
2730
fi

0 commit comments

Comments
 (0)