Skip to content

Make --enable-embed libs respect --libdir #12389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,11 @@ dnl SAPI configuration.
dnl ----------------------------------------------------------------------------

dnl Paths to the targets are relative to the build directory.
SAPI_SHARED=libs/libphp.[]$SHLIB_DL_SUFFIX_NAME
SAPI_STATIC=libs/libphp.a
SAPI_LIBNAME=libphp
SAPI_LIBNAME_SHARED=$SAPI_LIBNAME.[]$SHLIB_DL_SUFFIX_NAME
SAPI_LIBNAME_STATIC=$SAPI_LIBNAME.a
SAPI_SHARED=libs/$SAPI_LIBNAME_SHARED
SAPI_STATIC=libs/$SAPI_LIBNAME_STATIC
SAPI_LIBTOOL=libphp.la

PHP_CONFIGURE_PART(Configuring SAPI modules)
Expand Down Expand Up @@ -1392,6 +1395,7 @@ test "$exec_prefix" = "NONE" && exec_prefix='${prefix}'
test "$program_prefix" = "NONE" && program_prefix=
test "$program_suffix" = "NONE" && program_suffix=

orig_libdir=$libdir
case $libdir in
'${exec_prefix}/lib')
libdir=$libdir/php
Expand Down Expand Up @@ -1531,6 +1535,7 @@ PHP_SUBST(exec_prefix)
PHP_SUBST_OLD(program_prefix)
PHP_SUBST_OLD(program_suffix)
PHP_SUBST(includedir)
PHP_SUBST_OLD(orig_libdir)
PHP_SUBST(libdir)
PHP_SUBST(mandir)
PHP_SUBST(phplibdir)
Expand Down Expand Up @@ -1578,6 +1583,8 @@ PHP_SUBST(SHARED_LIBTOOL)
PHP_SUBST(PHP_FRAMEWORKS)
PHP_SUBST(PHP_FRAMEWORKPATH)
PHP_SUBST(INSTALL_HEADERS)
PHP_SUBST_OLD(SAPI_LIBNAME_SHARED)
PHP_SUBST_OLD(SAPI_LIBNAME_STATIC)

old_CC=$CC

Expand Down
5 changes: 3 additions & 2 deletions sapi/embed/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ if test "$PHP_EMBED" != "no"; then
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"
INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(orig_libdir); \$(INSTALL) -m 0755 $SAPI_SHARED \$(INSTALL_ROOT)\$(orig_libdir)"
;;
static)
LIBPHP_CFLAGS="-static"
PHP_EMBED_TYPE=static
INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(prefix)/lib; \$(INSTALL) -m 0644 $SAPI_STATIC \$(INSTALL_ROOT)\$(prefix)/lib"
INSTALL_IT="\$(mkinstalldirs) \$(INSTALL_ROOT)\$(orig_libdir); \$(INSTALL) -m 0644 $SAPI_STATIC \$(INSTALL_ROOT)\$(orig_libdir)"
;;
*)
PHP_EMBED_TYPE=no
Expand All @@ -29,6 +29,7 @@ if test "$PHP_EMBED" != "no"; then
PHP_INSTALL_HEADERS([sapi/embed/php_embed.h])
fi
AC_MSG_RESULT([$PHP_EMBED_TYPE])
PHP_SUBST_OLD(PHP_EMBED_TYPE)
else
AC_MSG_RESULT(no)
fi
8 changes: 8 additions & 0 deletions scripts/man1/php-config.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ Directory where extensions are searched by default
Directory prefix where header files are installed by default
.TP
.PD 0
.B \-\-lib-dir
Directory where libraries are installed by default
.TP
.PD 0
.B \-\-lib-embed
PHP embed library name
.TP
.PD 0
.B \-\-php-binary
Full path to php CLI or CGI binary
.TP
Expand Down
15 changes: 15 additions & 0 deletions scripts/php-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ exec_prefix="@exec_prefix@"
version="@PHP_VERSION@"
vernum="@PHP_VERSION_ID@"
include_dir="@includedir@/php"
lib_dir="@orig_libdir@"
includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib"
ldflags="@PHP_LDFLAGS@"
libs="@EXTRA_LIBS@"
Expand All @@ -21,6 +22,7 @@ configure_options="@CONFIGURE_OPTIONS@"
php_sapis="@PHP_INSTALLED_SAPIS@"
ini_dir="@EXPANDED_PHP_CONFIG_FILE_SCAN_DIR@"
ini_path="@EXPANDED_PHP_CONFIG_FILE_PATH@"
php_embed_type="@PHP_EMBED_TYPE@"

# Set php_cli_binary and php_cgi_binary if available
for sapi in $php_sapis; do
Expand All @@ -41,6 +43,13 @@ else
php_binary="$php_cgi_binary"
fi

# Set embed SAPI library path
if test "$php_embed_type" = "shared"; then
php_embed_lib=@SAPI_LIBNAME_SHARED@
elif test "$php_embed_type" = "static"; then
php_embed_lib=@SAPI_LIBNAME_STATIC@
fi

# Remove quotes
configure_options=`echo $configure_options | $SED -e "s#'##g"`

Expand All @@ -57,6 +66,10 @@ case "$1" in
echo $extension_dir;;
--include-dir)
echo $include_dir;;
--lib-dir)
echo $lib_dir;;
--lib-embed)
echo $php_embed_lib;;
--php-binary)
echo $php_binary;;
--php-sapis)
Expand All @@ -83,6 +96,8 @@ Options:
--libs [$libs]
--extension-dir [$extension_dir]
--include-dir [$include_dir]
--lib-dir [$lib_dir]
--lib-embed [$php_embed_lib]
--man-dir [$man_dir]
--php-binary [$php_binary]
--php-sapis [$php_sapis]
Expand Down