diff --git a/configure.ac b/configure.ac index a63354f296866..6d1f98ca4e580 100644 --- a/configure.ac +++ b/configure.ac @@ -415,7 +415,7 @@ dnl to avoid -lnsl checks, if we already have the functions which dnl are usually in libnsl dnl Also, uClibc will bark at linking with glibc's libnsl. -PHP_CHECK_FUNC(socket, socket) +PHP_CHECK_FUNC(socket, socket, network) PHP_CHECK_FUNC(socketpair, socket) PHP_CHECK_FUNC(htonl, socket) PHP_CHECK_FUNC(gethostname, nsl) @@ -429,8 +429,8 @@ fi AC_CHECK_LIB(m, sin) dnl Check for inet_aton -dnl in -lc, -lbind and -lresolv -PHP_CHECK_FUNC(inet_aton, resolv, bind) +dnl in -lc, -lbind, -lresolv and -lnetwork +PHP_CHECK_FUNC(inet_aton, resolv, bind, network) dnl Then headers. dnl ------------------------------------------------------------------------- diff --git a/ext/bz2/config.m4 b/ext/bz2/config.m4 index 55917c07f4212..4b91263969496 100644 --- a/ext/bz2/config.m4 +++ b/ext/bz2/config.m4 @@ -6,7 +6,7 @@ PHP_ARG_WITH(bz2, for BZip2 support, [ --with-bz2[=DIR] Include BZip2 support]) if test "$PHP_BZ2" != "no"; then - if test -r $PHP_BZ2/include/bzlib.h; then + if test -r "$PHP_BZ2/include/bzlib.h" || test -r "$PHP_BZ2/develop/headers/bzlib.h"; then BZIP_DIR=$PHP_BZ2 else AC_MSG_CHECKING(for BZip2 in default path) diff --git a/ext/curl/config.m4 b/ext/curl/config.m4 index c0d4f864a2717..108738479064d 100644 --- a/ext/curl/config.m4 +++ b/ext/curl/config.m4 @@ -23,6 +23,9 @@ if test "$PHP_CURL" != "no"; then elif test -r $PHP_CURL/lib/pkgconfig/libcurl.pc; then PKNAME=$PHP_CURL/lib/pkgconfig/libcurl.pc AC_MSG_RESULT(using $PKNAME) + elif test -r $PHP_CURL/develop/lib/pkgconfig/libcurl.pc; then + PKNAME=$PHP_CURL/develop/lib/pkgconfig/libcurl.pc + AC_MSG_RESULT(using $PKNAME) else AC_MSG_RESULT(not found) AC_MSG_WARN(Could not find libcurl.pc. Try without $PHP_CURL or set PKG_CONFIG_PATH) @@ -45,11 +48,11 @@ if test "$PHP_CURL" != "no"; then dnl fallback to old vay, using curl-config AC_MSG_WARN(Fallback: search for curl headers and curl-config) - if test -r $PHP_CURL/include/curl/easy.h; then + if test -r $PHP_CURL/include/curl/easy.h || test -r $PHP_CURL/develop/headers/curl/easy.h; 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 /usr /system; do if test -r $i/include/curl/easy.h; then CURL_DIR=$i AC_MSG_RESULT(found in $i) diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index 7fe9ed995efaa..de82ab7ded21e 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -50,17 +50,23 @@ AC_DEFUN([PHP_GD_ZLIB],[ elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then PHP_ZLIB_DIR="$PHP_ZLIB_DIR" PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" + elif test -f "$PHP_ZLIB_DIR/develop/headers/zlib.h"; then + PHP_ZLIB_DIR="$PHP_ZLIB_DIR" + PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/develop/headers" else AC_MSG_ERROR([Can't find zlib headers under "$PHP_ZLIB_DIR"]) fi else - for i in /usr/local /usr; do + for i in /usr/local /usr /system; do if test -f "$i/include/zlib/zlib.h"; then PHP_ZLIB_DIR="$i" PHP_ZLIB_INCDIR="$i/include/zlib" elif test -f "$i/include/zlib.h"; then PHP_ZLIB_DIR="$i" PHP_ZLIB_INCDIR="$i/include" + elif test -f "$i/develop/headers/zlib.h"; then + PHP_ZLIB_DIR="$i" + PHP_ZLIB_INCDIR="$i/develop/headers" fi done fi @@ -71,6 +77,7 @@ AC_DEFUN([PHP_GD_WEBP],[ for i in $PHP_WEBP_DIR /usr/local /usr; do test -f $i/include/webp/decode.h && GD_WEBP_DIR=$i && break + test -f $i/develop/headers/webp/decode.h && GD_WEBP_DIR=$i && break done if test -z "$GD_WEBP_DIR"; then @@ -79,6 +86,7 @@ AC_DEFUN([PHP_GD_WEBP],[ for i in $PHP_WEBP_DIR /usr/local /usr; do test -f $i/include/webp/encode.h && GD_WEBP_DIR=$i && break + test -f $i/develop/headers/webp/encode.h && GD_WEBP_DIR=$i && break done if test -z "$GD_WEBP_DIR"; then @@ -103,8 +111,9 @@ AC_DEFUN([PHP_GD_WEBP],[ AC_DEFUN([PHP_GD_JPEG],[ if test "$PHP_JPEG_DIR" != "no"; then - for i in $PHP_JPEG_DIR /usr/local /usr; do + for i in $PHP_JPEG_DIR /usr/local /usr /system; do test -f $i/include/jpeglib.h && GD_JPEG_DIR=$i && break + test -f $i/develop/headers/jpeglib.h && GD_JPEG_DIR=$i && break done if test -z "$GD_JPEG_DIR"; then @@ -130,6 +139,7 @@ AC_DEFUN([PHP_GD_PNG],[ for i in $PHP_PNG_DIR /usr/local /usr; do test -f $i/include/png.h && GD_PNG_DIR=$i && break + test -f $i/develop/headers/png.h && GD_PNG_DIR=$i && break done if test -z "$GD_PNG_DIR"; then @@ -162,6 +172,8 @@ AC_DEFUN([PHP_GD_XPM],[ for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do test -f $i/include/xpm.h && GD_XPM_DIR=$i && GD_XPM_INC=$i && break test -f $i/include/X11/xpm.h && GD_XPM_DIR=$i && GD_XPM_INC=$i/X11 && break + test -f $i/develop/headers/xpm.h && GD_XPM_DIR=$i && GD_XPM_INC=$i && break + test -f $i/develop/headers/X11/xpm.h && GD_XPM_DIR=$i && GD_XPM_INC=$i/X11 && break done if test -z "$GD_XPM_DIR"; then @@ -186,7 +198,7 @@ AC_DEFUN([PHP_GD_XPM],[ AC_DEFUN([PHP_GD_FREETYPE2],[ if test "$PHP_FREETYPE_DIR" != "no"; then - for i in $PHP_FREETYPE_DIR /usr/local /usr; do + for i in $PHP_FREETYPE_DIR /usr/local /usr /system; do if test -f "$i/bin/freetype-config"; then FREETYPE2_DIR=$i FREETYPE2_CONFIG="$i/bin/freetype-config" @@ -220,7 +232,9 @@ AC_DEFUN([PHP_GD_CHECK_VERSION],[ PHP_CHECK_LIBRARY(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageCreateFromWebp, [AC_DEFINE(HAVE_GD_WEBP, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageCreateFromJpeg, [AC_DEFINE(HAVE_GD_JPG, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) - PHP_CHECK_LIBRARY(gd, gdImageCreateFromXpm, [AC_DEFINE(HAVE_GD_XPM, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) + if test -n "$GD_XPM_DIR"; then + PHP_CHECK_LIBRARY(gd, gdImageCreateFromXpm, [AC_DEFINE(HAVE_GD_XPM, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) + fi PHP_CHECK_LIBRARY(gd, gdImageCreateFromBmp, [AC_DEFINE(HAVE_GD_BMP, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageStringFT, [AC_DEFINE(HAVE_GD_FREETYPE, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdVersionString, [AC_DEFINE(HAVE_GD_LIBVERSION, 1, [ ])], [], [ $GD_SHARED_LIBADD ]) @@ -317,7 +331,7 @@ dnl Various checks for GD features PHP_GD_FREETYPE2 dnl Header path - for i in include/gd include/gd2 include gd ""; do + for i in include/gd include/gd2 include gd develop/headers ""; do test -f "$PHP_GD/$i/gd.h" && GD_INCLUDE="$PHP_GD/$i" done diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4 index c82be9cc057b6..f905609ac59c2 100644 --- a/ext/gettext/config.m4 +++ b/ext/gettext/config.m4 @@ -6,8 +6,9 @@ PHP_ARG_WITH(gettext,for GNU gettext support, [ --with-gettext[=DIR] Include GNU gettext support]) if test "$PHP_GETTEXT" != "no"; then - for i in $PHP_GETTEXT /usr/local /usr; do - test -r $i/include/libintl.h && GETTEXT_DIR=$i && break + for i in $PHP_GETTEXT /usr/local /usr /system; do + test -r $i/include/libintl.h && GETTEXT_DIR=$i && GETTEXT_INCDIR=$GETTEXT_DIR/include && break + test -r $i/develop/headers/libintl.h && GETTEXT_DIR=$i && GETTEXT_INCDIR=$GETTEXT_DIR/develop/headers && break done if test -z "$GETTEXT_DIR"; then @@ -15,7 +16,6 @@ if test "$PHP_GETTEXT" != "no"; then fi GETTEXT_LIBDIR=$GETTEXT_DIR/$PHP_LIBDIR - GETTEXT_INCDIR=$GETTEXT_DIR/include O_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR" diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4 index 22cca7eaf208e..0623949d5466b 100644 --- a/ext/gmp/config.m4 +++ b/ext/gmp/config.m4 @@ -8,6 +8,7 @@ if test "$PHP_GMP" != "no"; then for i in $PHP_GMP /usr/local /usr; do test -f $i/include/gmp.h && GMP_DIR=$i && break test -f $i/include/$MACHINE_INCLUDES/gmp.h && GMP_DIR=$i && break + test -f $i/develop/headers/gmp.h && GMP_DIR=$i && break done if test -z "$GMP_DIR"; then diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index f9ea76de4ff86..552b557fb18d6 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -301,7 +301,9 @@ void php_register_signal_constants(INIT_FUNC_ARGS) #ifdef SIGPOLL REGISTER_LONG_CONSTANT("SIGPOLL", (zend_long) SIGPOLL, CONST_CS | CONST_PERSISTENT); #endif +#ifdef SIGIO REGISTER_LONG_CONSTANT("SIGIO", (zend_long) SIGIO, CONST_CS | CONST_PERSISTENT); +#endif #ifdef SIGPWR REGISTER_LONG_CONSTANT("SIGPWR", (zend_long) SIGPWR, CONST_CS | CONST_PERSISTENT); #endif @@ -622,7 +624,7 @@ PHP_FUNCTION(pcntl_alarm) #define PHP_RUSAGE_PARA(from, to, field) \ add_assoc_long(to, #field, from.field) -#ifndef _OSD_POSIX +#if !defined(_OSD_POSIX) && !defined(__HAIKU__) #define PHP_RUSAGE_SPECIAL(from, to) \ PHP_RUSAGE_PARA(from, to, ru_oublock); \ PHP_RUSAGE_PARA(from, to, ru_inblock); \ diff --git a/ext/pdo_sqlite/config.m4 b/ext/pdo_sqlite/config.m4 index b050eea4f1c5d..9d54cb93ac54e 100644 --- a/ext/pdo_sqlite/config.m4 +++ b/ext/pdo_sqlite/config.m4 @@ -33,7 +33,7 @@ if test "$PHP_PDO_SQLITE" != "no"; then php_pdo_sqlite_sources_core="pdo_sqlite.c sqlite_driver.c sqlite_statement.c" if test "$PHP_PDO_SQLITE" != "yes"; then - SEARCH_PATH="$PHP_PDO_SQLITE /usr/local /usr" # you might want to change this + SEARCH_PATH="$PHP_PDO_SQLITE /usr/local /usr /system" # you might want to change this SEARCH_FOR="/include/sqlite3.h" # you most likely want to change this if test -r $PHP_PDO_SQLITE/$SEARCH_FOR; then # path given as parameter PDO_SQLITE_DIR=$PHP_PDO_SQLITE @@ -43,6 +43,9 @@ if test "$PHP_PDO_SQLITE" != "no"; then if test -r $i/$SEARCH_FOR; then PDO_SQLITE_DIR=$i AC_MSG_RESULT(found in $i) + elif test -r $i/develop/headers/sqlite3.h; then + PDO_SQLITE_DIR=$i + AC_MSG_RESULT(found in $i) fi done fi diff --git a/ext/readline/config.m4 b/ext/readline/config.m4 index 0a00370fce579..04b2c2e73a533 100644 --- a/ext/readline/config.m4 +++ b/ext/readline/config.m4 @@ -14,8 +14,9 @@ else fi if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then - for i in $PHP_READLINE /usr/local /usr; do + for i in $PHP_READLINE /usr/local /usr /system; do test -f $i/include/readline/readline.h && READLINE_DIR=$i && break + test -f $i/develop/headers/readline/readline.h && READLINE_DIR=$i && break done if test -z "$READLINE_DIR"; then diff --git a/ext/sqlite3/config0.m4 b/ext/sqlite3/config0.m4 index 0e5fbc5d1dbc8..5f7d83776cf15 100644 --- a/ext/sqlite3/config0.m4 +++ b/ext/sqlite3/config0.m4 @@ -27,6 +27,10 @@ if test $PHP_SQLITE3 != "no"; then SQLITE3_DIR=$i AC_MSG_RESULT(found in $i) break + elif test -r $i/develop/headers/sqlite3.h; then + SQLITE3_DIR=$i + AC_MSG_RESULT(found in $i) + break fi done diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index aa63a6e42e9da..9a0eae32942fa 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -136,7 +136,7 @@ PHP_FUNCTION(getrusage) #ifdef PHP_WIN32 /* Windows only implements a limited amount of fields from the rusage struct */ PHP_RUSAGE_PARA(ru_majflt); PHP_RUSAGE_PARA(ru_maxrss); -#elif !defined(_OSD_POSIX) +#elif !defined(_OSD_POSIX) && !defined(__HAIKU__) PHP_RUSAGE_PARA(ru_oublock); PHP_RUSAGE_PARA(ru_inblock); PHP_RUSAGE_PARA(ru_msgsnd); diff --git a/ext/zip/config.m4 b/ext/zip/config.m4 index 6422b8f5933fd..5ec6baf21eb75 100644 --- a/ext/zip/config.m4 +++ b/ext/zip/config.m4 @@ -26,17 +26,23 @@ if test "$PHP_ZIP" != "no"; then elif test -f "$PHP_ZLIB_DIR/include/zlib.h"; then PHP_ZLIB_DIR="$PHP_ZLIB_DIR" PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include" + elif test -f "$PHP_ZLIB_DIR/develop/headers/zlib.h"; then + PHP_ZLIB_DIR="$PHP_ZLIB_DIR" + PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/develop/headers" else AC_MSG_ERROR([Can not find zlib headers under "$PHP_ZLIB_DIR"]) fi else - for i in /usr/local /usr; do + for i in /usr/local /usr /system; do if test -f "$i/include/zlib/zlib.h"; then PHP_ZLIB_DIR="$i" PHP_ZLIB_INCDIR="$i/include/zlib" elif test -f "$i/include/zlib.h"; then PHP_ZLIB_DIR="$i" PHP_ZLIB_INCDIR="$i/include" + elif test -f "$i/develop/headers/zlib.h"; then + PHP_ZLIB_DIR="$i" + PHP_ZLIB_INCDIR="$i/develop/headers" fi done fi @@ -73,13 +79,19 @@ if test "$PHP_ZIP" != "no"; then fi else - for i in /usr/local /usr; do + for i in /usr/local /usr /system; do if test -r $i/include/zip.h; then LIBZIP_CFLAGS="-I$i/include" LIBZIP_LIBDIR="$i/$PHP_LIBDIR" AC_MSG_RESULT(in default path: found in $i) break fi + if test -r $i/develop/headers/zip.h; then + LIBZIP_CFLAGS="-I$i/develop/headers" + LIBZIP_LIBDIR="$i/$PHP_LIBDIR" + AC_MSG_RESULT(in default path: found in $i) + break + fi done fi diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4 index ab94c15fe0a35..0d12f7b7f8056 100644 --- a/ext/zlib/config0.m4 +++ b/ext/zlib/config0.m4 @@ -19,15 +19,21 @@ if test "$PHP_ZLIB" != "no" || test "$PHP_ZLIB_DIR" != "no"; then elif test -f $PHP_ZLIB/include/zlib.h; then ZLIB_DIR=$PHP_ZLIB ZLIB_INCDIR=$ZLIB_DIR/include + elif test -f $PHP_ZLIB/develop/headers/zlib.h; then + ZLIB_DIR=$PHP_ZLIB + ZLIB_INCDIR=$ZLIB_DIR/develop/headers fi else - for i in /usr/local /usr $PHP_ZLIB_DIR; do + for i in /usr/local /usr /system $PHP_ZLIB_DIR; do if test -f $i/include/zlib/zlib.h; then ZLIB_DIR=$i ZLIB_INCDIR=$i/include/zlib elif test -f $i/include/zlib.h; then ZLIB_DIR=$i ZLIB_INCDIR=$i/include + elif test -f $i/develop/headers/zlib.h; then + ZLIB_DIR=$i + ZLIB_INCDIR=$i/develop/headers fi done fi @@ -42,7 +48,7 @@ if test "$PHP_ZLIB" != "no" || test "$PHP_ZLIB_DIR" != "no"; then esac AC_MSG_CHECKING([for zlib version >= 1.2.0.4]) - ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_DIR/include/zlib.h | $SED -e 's/[[^0-9\.]]//g'` + ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_INCDIR/zlib.h | $SED -e 's/[[^0-9\.]]//g'` AC_MSG_RESULT([$ZLIB_VERSION]) if test `echo $ZLIB_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*1000000 + $2*10000 + $3*100 + $4}'` -lt 1020004; then AC_MSG_ERROR([libz version greater or equal to 1.2.0.4 required]) diff --git a/sapi/fpm/fpm/fpm_children.c b/sapi/fpm/fpm/fpm_children.c index b48fa54f532a2..889ec2f09db43 100644 --- a/sapi/fpm/fpm/fpm_children.c +++ b/sapi/fpm/fpm/fpm_children.c @@ -204,13 +204,17 @@ void fpm_children_bury() /* {{{ */ } else if (WIFSIGNALED(status)) { const char *signame = fpm_signal_names[WTERMSIG(status)]; - const char *have_core = WCOREDUMP(status) ? " - core dumped" : ""; + #ifdef WCOREDUMP + const char *have_core = WCOREDUMP(status) ? " - core dumped" : ""; + #endif if (signame == NULL) { signame = ""; } - snprintf(buf, sizeof(buf), "on signal %d (%s%s)", WTERMSIG(status), signame, have_core); + #ifndef __HAIKU__ + snprintf(buf, sizeof(buf), "on signal %d (%s%s)", WTERMSIG(status), signame, have_core); + #endif /* if it's been killed because of dynamic process management * don't restart it automaticaly diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c index 6089e3109edf7..293546ba2d598 100644 --- a/sapi/fpm/fpm/fpm_unix.c +++ b/sapi/fpm/fpm/fpm_unix.c @@ -373,10 +373,15 @@ int fpm_unix_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ if (is_root) { if (wp->config->process_priority != 64) { - if (setpriority(PRIO_PROCESS, 0, wp->config->process_priority) < 0) { - zlog(ZLOG_SYSERROR, "[pool %s] Unable to set priority for this new process", wp->config->name); + #ifndef __HAIKU__ + if (setpriority(PRIO_PROCESS, 0, wp->config->process_priority) < 0) { + zlog(ZLOG_SYSERROR, "[pool %s] Unable to set priority for this new process", wp->config->name); + return -1; + } + #else return -1; - } + #endif + } if (wp->set_gid) { @@ -560,10 +565,14 @@ int fpm_unix_init_main() /* {{{ */ if (fpm_global_config.process_priority != 64) { if (is_root) { - if (setpriority(PRIO_PROCESS, 0, fpm_global_config.process_priority) < 0) { - zlog(ZLOG_SYSERROR, "Unable to set priority for the master process"); + #ifndef __HAIKU__ + if (setpriority(PRIO_PROCESS, 0, fpm_global_config.process_priority) < 0) { + zlog(ZLOG_SYSERROR, "Unable to set priority for the master process"); + return -1; + } + #else return -1; - } + #endif } else { zlog(ZLOG_NOTICE, "'process.priority' directive is ignored when FPM is not running as root"); } diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 5ef6b59d648a8..e90f77fed0211 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1736,7 +1736,7 @@ int main(int argc, char **argv) /* {{{ */ exit(0); } -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(__HAIKU__) zend_sigaction(SIGIO, &sigio_struct, NULL); #endif