Skip to content
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
113 changes: 101 additions & 12 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,18 @@ dnl
dnl Adds a path to linkpath/runpath (LDFLAGS)
dnl
AC_DEFUN([PHP_ADD_LIBPATH],[
if test "$1" != "/usr/$PHP_LIBDIR" && test "$1" != "/usr/lib"; then
is_system_libpath='no'
if test "$1" = "/usr/$PHP_LIBDIR"; then
is_system_libpath='yes'
else
for i in $SYSTEM_SHLIBDIR_PATHS; do
if test "$1" = "$i/lib"; then
is_system_libpath='yes'
break
fi
done
fi
if test $is_system_libpath = 'no'; then
PHP_EXPAND_PATH($1, ai_p)
ifelse([$2],,[
_PHP_ADD_LIBPATH_GLOBAL([$ai_p])
Expand Down Expand Up @@ -487,7 +498,16 @@ dnl add an include path.
dnl if before is 1, add in the beginning of INCLUDES.
dnl
AC_DEFUN([PHP_ADD_INCLUDE],[
if test "$1" != "/usr/include"; then
is_system_incpath='no'
if test $is_system_incpath = 'no'; then
for i in $SYSTEM_SHLIBDIR_PATHS; do
if test "$1" = "$i/include"; then
is_system_incpath='yes'
break
fi
done
fi
if test $is_system_incpath = 'no'; then
PHP_EXPAND_PATH($1, ai_p)
PHP_RUN_ONCE(INCLUDEPATH, $ai_p, [
if test "$2"; then
Expand Down Expand Up @@ -1953,29 +1973,97 @@ dnl
dnl PHP_SHLIB_SUFFIX_NAMES
dnl
dnl Determines link library suffix SHLIB_SUFFIX_NAME
dnl which can be: .so, .sl or .dylib
dnl which can be: .so, .sl .tbd or .dylib
dnl
dnl Determines shared library suffix SHLIB_DL_SUFFIX_NAME
dnl suffix can be: .so or .sl
dnl
AC_DEFUN([PHP_SHLIB_SUFFIX_NAMES],[
AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl
PHP_SUBST_OLD(SHLIB_SUFFIX_NAME)
PHP_SUBST_OLD(SHLIB_SUFFIX_NAMES)
PHP_SUBST_OLD(SHLIB_DL_SUFFIX_NAME)
SHLIB_SUFFIX_NAME=so
SHLIB_SUFFIX_NAMES="so"
SHLIB_DL_SUFFIX_NAME=$SHLIB_SUFFIX_NAME
case $host_alias in
*hpux*[)]
SHLIB_SUFFIX_NAME=sl
SHLIB_SUFFIX_NAMES="sl"
SHLIB_DL_SUFFIX_NAME=sl
;;
*darwin*[)]
SHLIB_SUFFIX_NAME=dylib
SHLIB_SUFFIX_NAMES="dylib tbd"
SHLIB_DL_SUFFIX_NAME=so
;;
esac
])

AC_DEFUN([PHP_CHECK_SHLIB_EXISTS],[
$2=no
if test -n "$3"; then
for ext in $SHLIB_SUFFIX_NAMES; do
for ver in $3; do
if test $ext = "dylib" || test $ext = "tbd"; then
if test -f $1.$ver.$ext; then
$2=yes
break
fi
elif test -f $1.$ext.$ver; then
$2=yes
break
fi
done
if test $2 = "yes"; then
break
fi
done
else
for ext in a $SHLIB_SUFFIX_NAMES; do
if test -f $1.$ext; then
$2=yes
break
fi
done
fi
])

AC_DEFUN([PHP_SYSTEM_SHLIBDIR_PATHS],[
AC_REQUIRE([PHP_CANONICAL_HOST_TARGET])dnl
PHP_SUBST_OLD(SYSTEM_SHLIBDIR_PATHS)
SYSTEM_SHLIBDIR_PATHS="/usr"
case $host_alias in
*darwin*[)]
shopt -s nullglob

CLT_SDK_PATH=""
for sdk_path in /Library/Developer/CommandLineTools/SDKs/*.sdk; do
CLT_SDK_PATH="$CLT_SDK_PATH $sdk_path/usr"
done
if test -z "$CLT_SDK_PATH" && xcrun --show-sdk-path >/dev/null 2>&1; then
CLT_SDK_PATH="$(xcrun --show-sdk-path)/usr"
fi
if test -n "$CLT_SDK_PATH"; then
SYSTEM_SHLIBDIR_PATHS="$SYSTEM_SHLIBDIR_PATHS $CLT_SDK_PATH"
fi

XCODE_SDK_PATH=""
for sdk_path in /Applications/Xcode*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/*.sdk; do
XCODE_SDK_PATH="$XCODE_SDK_PATH $sdk_path/usr"
done
if test -z "$XCODE_SDK_PATH" && xcrun --show-sdk-platform-path >/dev/null 2>&1; then
XCODE_SDK_PATH="$(xcrun --show-sdk-platform-path)/usr"
fi
if test -n "$XCODE_SDK_PATH"; then
SYSTEM_SHLIBDIR_PATHS="$SYSTEM_SHLIBDIR_PATHS $XCODE_SDK_PATH"
fi

shopt -u nullglob
;;
esac
])

dnl
dnl PHP_CHECK_64BIT([do if 32], [do if 64])
dnl
Expand Down Expand Up @@ -2197,11 +2285,12 @@ AC_DEFUN([PHP_SETUP_KERBEROS],[
if test "$found_kerberos" = "no"; then

if test "$PHP_KERBEROS" = "yes"; then
PHP_KERBEROS="/usr/kerberos /usr/local /usr"
PHP_KERBEROS="/usr/kerberos /usr/local $SYSTEM_SHLIBDIR_PATHS"
fi

for i in $PHP_KERBEROS; do
if test -f $i/$PHP_LIBDIR/libkrb5.a || test -f $i/$PHP_LIBDIR/libkrb5.$SHLIB_SUFFIX_NAME; then
PHP_CHECK_SHLIB_EXISTS($i/$PHP_LIBDIR/libkrb5, krb_lib_exists)
if test $krb_lib_exists = "yes"; then
PHP_KERBEROS_DIR=$i
break
fi
Expand Down Expand Up @@ -2273,14 +2362,15 @@ AC_DEFUN([PHP_SETUP_OPENSSL],[
if test "$found_openssl" = "no"; then

if test "$PHP_OPENSSL_DIR" = "yes"; then
PHP_OPENSSL_DIR="/usr/local/ssl /usr/local /usr /usr/local/openssl"
PHP_OPENSSL_DIR="/usr/local/ssl /usr/local/openssl /usr/local $SYSTEM_SHLIBDIR_PATHS"
fi

for i in $PHP_OPENSSL_DIR; do
if test -r $i/include/openssl/evp.h; then
OPENSSL_INCDIR=$i/include
fi
if test -r $i/$PHP_LIBDIR/libssl.a -o -r $i/$PHP_LIBDIR/libssl.$SHLIB_SUFFIX_NAME; then
PHP_CHECK_SHLIB_EXISTS($i/$PHP_LIBDIR/libssl, openssl_lib_exists)
if test $openssl_lib_exists = "yes"; then
OPENSSL_LIBDIR=$i/$PHP_LIBDIR
fi
test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
Expand Down Expand Up @@ -2393,7 +2483,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [
dnl
if test "$found_iconv" = "no"; then

for i in $PHP_ICONV /usr/local /usr; do
for i in $PHP_ICONV /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -r $i/include/giconv.h; then
AC_DEFINE(HAVE_GICONV_H, 1, [ ])
ICONV_DIR=$i
Expand All @@ -2410,9 +2500,8 @@ AC_DEFUN([PHP_SETUP_ICONV], [
AC_MSG_ERROR([Please specify the install prefix of iconv with --with-iconv=<DIR>])
fi

if test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.a ||
test -f $ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
then
PHP_CHECK_SHLIB_EXISTS($ICONV_DIR/$PHP_LIBDIR/lib$iconv_lib_name, iconv_lib_exists)
if test $iconv_lib_exists = "yes"; then
PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
found_iconv=yes
PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv])
Expand Down Expand Up @@ -2454,7 +2543,7 @@ AC_DEFUN([PHP_SETUP_LIBXML], [
dnl First try to find xml2-config
AC_CACHE_CHECK([for xml2-config path], ac_cv_php_xml2_config_path,
[
for i in $PHP_LIBXML_DIR /usr/local /usr; do
for i in $PHP_LIBXML_DIR /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -x "$i/bin/xml2-config"; then
ac_cv_php_xml2_config_path="$i/bin/xml2-config"
break
Expand Down
7 changes: 5 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ dnl -------------------------------------------------------------------------
PTHREADS_CHECK
PHP_HELP_SEPARATOR([SAPI modules:])
PHP_SHLIB_SUFFIX_NAMES
PHP_SYSTEM_SHLIBDIR_PATHS
PHP_BUILD_PROGRAM
PHP_SAPI=none

Expand Down Expand Up @@ -391,7 +392,9 @@ if test -d /usr/pkg/include -a -d /usr/pkg/lib ; then
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include"
LDFLAGS="$LDFLAGS -L/usr/pkg/lib"
fi
test -d /usr/ucblib && PHP_ADD_LIBPATH(/usr/ucblib)
if test -d /usr/ucblib; then
PHP_ADD_LIBPATH(/usr/ucblib)
fi


dnl First, library checks.
Expand Down Expand Up @@ -788,7 +791,7 @@ if test "$PHP_VALGRIND" != "no"; then
AC_MSG_CHECKING([for valgrind header])

if test "$PHP_VALGRIND" = "yes"; then
SEARCH_PATH="/usr/local /usr"
SEARCH_PATH="/usr/local $SYSTEM_SHLIBDIR_PATHS"
else
SEARCH_PATH="$PHP_VALGRIND"
fi
Expand Down
2 changes: 1 addition & 1 deletion ext/bz2/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if test "$PHP_BZ2" != "no"; then
BZIP_DIR=$PHP_BZ2
else
AC_MSG_CHECKING(for BZip2 in default path)
for i in /usr/local /usr; do
for i in /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -r $i/include/bzlib.h; then
BZIP_DIR=$i
AC_MSG_RESULT(found in $i)
Expand Down
2 changes: 1 addition & 1 deletion ext/curl/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if test "$PHP_CURL" != "no"; then
CURL_DIR=$PHP_CURL
else
AC_MSG_CHECKING(for cURL in default path)
for i in /usr/local /usr; do
for i in /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -r $i/include/curl/easy.h; then
CURL_DIR=$i
AC_MSG_RESULT(found in $i)
Expand Down
26 changes: 14 additions & 12 deletions ext/dba/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ dnl
# QDBM
if test "$PHP_QDBM" != "no"; then
PHP_DBA_STD_BEGIN
for i in $PHP_QDBM /usr/local /usr; do
for i in $PHP_QDBM /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/include/depot.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/depot.h
Expand Down Expand Up @@ -142,7 +142,7 @@ if test "$PHP_GDBM" != "no"; then
if test "$HAVE_QDBM" = "1"; then
PHP_DBA_STD_RESULT(gdbm, gdbm, [You cannot combine --with-gdbm with --with-qdbm])
fi
for i in $PHP_GDBM /usr/local /usr; do
for i in $PHP_GDBM /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/include/gdbm.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/gdbm.h
Expand All @@ -167,7 +167,7 @@ PHP_DBA_STD_RESULT(gdbm)
# NDBM
if test "$PHP_NDBM" != "no"; then
PHP_DBA_STD_BEGIN
for i in $PHP_NDBM /usr/local /usr; do
for i in $PHP_NDBM /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/include/ndbm.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/ndbm.h
Expand Down Expand Up @@ -201,7 +201,7 @@ PHP_DBA_STD_RESULT(ndbm)
dnl TCADB
if test "$PHP_TCADB" != "no"; then
PHP_DBA_STD_BEGIN
for i in $PHP_TCADB /usr/local /usr; do
for i in $PHP_TCADB /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/include/tcadb.h"; then
THIS_PREFIX=$i
PHP_ADD_INCLUDE($THIS_PREFIX/include)
Expand Down Expand Up @@ -232,7 +232,7 @@ PHP_DBA_STD_RESULT(tcadb)
dnl LMDB
if test "$PHP_LMDB" != "no"; then
PHP_DBA_STD_BEGIN
for i in $PHP_LMDB /usr/local /usr; do
for i in $PHP_LMDB /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/include/lmdb.h"; then
THIS_PREFIX=$i
PHP_ADD_INCLUDE($THIS_PREFIX/include)
Expand Down Expand Up @@ -267,7 +267,8 @@ AC_DEFUN([PHP_DBA_DB_CHECK],[
AC_MSG_ERROR([DBA: Could not find necessary header file(s).])
fi
for LIB in $2; do
if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a || test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then
PHP_CHECK_SHLIB_EXISTS($THIS_PREFIX/$PHP_LIBDIR/lib$LIB, dba_lib_exists)
if test $dba_lib_exists = "yes"; then
lib_found="";
PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$PHP_LIBDIR, -l$LIB,[
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
Expand Down Expand Up @@ -343,7 +344,7 @@ if test "$PHP_DB4" != "no"; then
PHP_DBA_STD_BEGIN
dbdp4="/usr/local/BerkeleyDB.4."
dbdp5="/usr/local/BerkeleyDB.5."
for i in $PHP_DB4 ${dbdp5}1 ${dbdp5}0 ${dbdp4}8 ${dbdp4}7 ${dbdp4}6 ${dbdp4}5 ${dbdp4}4 ${dbdp4}3 ${dbdp4}2 ${dbdp4}1 ${dbdp}0 /usr/local /usr; do
for i in $PHP_DB4 ${dbdp5}1 ${dbdp5}0 ${dbdp4}8 ${dbdp4}7 ${dbdp4}6 ${dbdp4}5 ${dbdp4}4 ${dbdp4}3 ${dbdp4}2 ${dbdp4}1 ${dbdp}0 /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/db5/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/db5/db.h
Expand Down Expand Up @@ -408,7 +409,8 @@ if test "$PHP_DB3" != "no"; then
if test "$HAVE_DB4" = "1"; then
PHP_DBA_STD_RESULT(db3, Berkeley DB3, [You cannot combine --with-db3 with --with-db4])
fi
for i in $PHP_DB3 /usr/local/BerkeleyDB.3.3 /usr/local/BerkeleyDB.3.2 /usr/local/BerkeleyDB.3.1 /usr/local/BerkeleyDB.3.0 /usr/local /usr; do
dbdp3="/usr/local/BerkeleyDB.3."
for i in $PHP_DB3 ${dbdp3}.3 ${dbdp3}.2 ${dbdp3}.1 ${dbdp3}.0 /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/db3/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db3/db.h
Expand Down Expand Up @@ -441,7 +443,7 @@ if test "$PHP_DB2" != "no"; then
if test "$HAVE_DB3" = "1" || test "$HAVE_DB4" = "1"; then
PHP_DBA_STD_RESULT(db2, Berkeley DB2, [You cannot combine --with-db2 with --with-db3 or --with-db4])
fi
for i in $PHP_DB2 $PHP_DB2/BerkeleyDB /usr/BerkeleyDB /usr/local /usr; do
for i in $PHP_DB2 $PHP_DB2/BerkeleyDB /usr/BerkeleyDB /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/db2/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/db2/db.h
Expand Down Expand Up @@ -494,7 +496,7 @@ if test "$PHP_DB1" != "no"; then
done
else
AC_DEFINE_UNQUOTED(DB1_VERSION, "Unknown DB1", [ ])
for i in $PHP_DB1 /usr/local /usr; do
for i in $PHP_DB1 /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/db1/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/db1/db.h
Expand Down Expand Up @@ -541,7 +543,7 @@ if test "$PHP_DBM" != "no"; then
if test "$HAVE_QDBM" = "1"; then
PHP_DBA_STD_RESULT(dbm, dbm, [You cannot combine --with-dbm with --with-qdbm])
fi
for i in $PHP_DBM /usr/local /usr; do
for i in $PHP_DBM /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/include/dbm.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/dbm.h
Expand Down Expand Up @@ -607,7 +609,7 @@ if test "$PHP_CDB" = "yes"; then
THIS_RESULT="builtin"
elif test "$PHP_CDB" != "no"; then
PHP_DBA_STD_BEGIN
for i in $PHP_CDB /usr/local /usr; do
for i in $PHP_CDB /usr/local $SYSTEM_SHLIBDIR_PATHS; do
if test -f "$i/include/cdb.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/cdb.h
Expand Down
2 changes: 1 addition & 1 deletion ext/enchant/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if test "$PHP_ENCHANT" != "no"; then
if test "$PHP_ENCHANT" != "yes"; then
ENCHANT_SEARCH_DIRS=$PHP_ENCHANT
else
ENCHANT_SEARCH_DIRS="/usr/local /usr"
ENCHANT_SEARCH_DIRS="/usr/local $SYSTEM_SHLIBDIR_PATHS"
fi
for i in $ENCHANT_SEARCH_DIRS; do
if test -f $i/include/enchant/enchant.h; then
Expand Down
Loading