summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Darlow <mail@mcgruff.plus.com>2012-07-02 01:26:30 +0100
committerNoel Darlow <mail@mcgruff.plus.com>2012-07-02 01:26:30 +0100
commit5b54caac764dd2e608ad111f819871dd2818a277 (patch)
tree1e5c4dd3b2b4c952675847394aa2ce81262ee29a /dev-lang/php/files/4.4.1
parent3 (diff)
downloadunderlay-5b54caac764dd2e608ad111f819871dd2818a277.tar.gz
underlay-5b54caac764dd2e608ad111f819871dd2818a277.tar.bz2
underlay-5b54caac764dd2e608ad111f819871dd2818a277.zip
still trying..
Diffstat (limited to 'dev-lang/php/files/4.4.1')
-rw-r--r--dev-lang/php/files/4.4.1/CVS/Entries8
-rw-r--r--dev-lang/php/files/4.4.1/CVS/Repository1
-rw-r--r--dev-lang/php/files/4.4.1/CVS/Root1
-rw-r--r--dev-lang/php/files/4.4.1/CVS/Tag1
-rw-r--r--dev-lang/php/files/4.4.1/php4.4.1-apache2sapi.patch51
-rw-r--r--dev-lang/php/files/4.4.1/php4.4.1-curl-open_basedir.patch20
-rw-r--r--dev-lang/php/files/4.4.1/php4.4.1-current_key_by_reference.patch22
-rw-r--r--dev-lang/php/files/4.4.1/php4.4.1-gd-safe_mode.patch112
-rw-r--r--dev-lang/php/files/4.4.1/php4.4.1-mbstring-header_inj.patch145
-rw-r--r--dev-lang/php/files/4.4.1/php4.4.1-mod_rewrite-crash.patch20
-rw-r--r--dev-lang/php/files/4.4.1/php4.4.1-multilib-search-path.patch1488
11 files changed, 1869 insertions, 0 deletions
diff --git a/dev-lang/php/files/4.4.1/CVS/Entries b/dev-lang/php/files/4.4.1/CVS/Entries
new file mode 100644
index 0000000..397aaa4
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/CVS/Entries
@@ -0,0 +1,8 @@
+/php4.4.1-apache2sapi.patch/1.1/Wed Jan 4 09:24:47 2006/-ko/T1.1
+/php4.4.1-curl-open_basedir.patch/1.1/Wed Jan 4 09:24:47 2006/-ko/T1.1
+/php4.4.1-current_key_by_reference.patch/1.1/Fri Nov 4 11:19:08 2005/-ko/T1.1
+/php4.4.1-gd-safe_mode.patch/1.1/Wed Jan 4 09:24:47 2006/-ko/T1.1
+/php4.4.1-mbstring-header_inj.patch/1.1/Wed Jan 4 09:24:47 2006/-ko/T1.1
+/php4.4.1-mod_rewrite-crash.patch/1.1/Thu Nov 3 23:54:59 2005/-ko/T1.1
+/php4.4.1-multilib-search-path.patch/1.1/Wed Jan 4 09:24:47 2006/-ko/T1.1
+D
diff --git a/dev-lang/php/files/4.4.1/CVS/Repository b/dev-lang/php/files/4.4.1/CVS/Repository
new file mode 100644
index 0000000..074c579
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/CVS/Repository
@@ -0,0 +1 @@
+gentoo-x86/dev-lang/php/files/4.4.1
diff --git a/dev-lang/php/files/4.4.1/CVS/Root b/dev-lang/php/files/4.4.1/CVS/Root
new file mode 100644
index 0000000..854a2c8
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/CVS/Root
@@ -0,0 +1 @@
+:pserver:anonymous@anoncvs.gentoo.org:/var/cvsroot
diff --git a/dev-lang/php/files/4.4.1/CVS/Tag b/dev-lang/php/files/4.4.1/CVS/Tag
new file mode 100644
index 0000000..5062263
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/CVS/Tag
@@ -0,0 +1 @@
+N1.1
diff --git a/dev-lang/php/files/4.4.1/php4.4.1-apache2sapi.patch b/dev-lang/php/files/4.4.1/php4.4.1-apache2sapi.patch
new file mode 100644
index 0000000..49f5c95
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/php4.4.1-apache2sapi.patch
@@ -0,0 +1,51 @@
+--- sapi/apache2handler/sapi_apache2.c 2005-10-12 23:41:36.000000000 +0200
++++ sapi/apache2handler/sapi_apache2.c 2005-11-18 21:19:33.000000000 +0100
+@@ -18,7 +18,7 @@
+ +----------------------------------------------------------------------+
+ */
+
+-/* $Id: sapi_apache2.c,v 1.1.2.40.2.5 2005/10/12 21:41:36 tony2001 Exp $ */
++/* $Id: sapi_apache2.c,v 1.1.2.40.2.8 2005/11/18 19:03:13 iliaa Exp $ */
+
+ #include <fcntl.h>
+
+@@ -443,6 +443,18 @@
+ php_request_shutdown(NULL);
+ }
+
++static void php_apache_ini_dtor(request_rec *r, request_rec *p TSRMLS_DC)
++{
++ if (strcmp(r->protocol, "INCLUDED")) {
++ zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try();
++ }
++ if (p) {
++ ((php_struct *)SG(server_context))->r = p;
++ } else {
++ apr_pool_cleanup_run(r->pool, (void *)&SG(server_context), php_server_context_cleanup);
++ }
++}
++
+ static int php_handler(request_rec *r)
+ {
+ php_struct *ctx;
+@@ -453,10 +465,7 @@
+ request_rec *parent_req = NULL;
+ TSRMLS_FETCH();
+
+-#define PHPAP_INI_OFF \
+- if (strcmp(r->protocol, "INCLUDED")) { \
+- zend_try { zend_ini_deactivate(TSRMLS_C); } zend_end_try(); \
+- } \
++#define PHPAP_INI_OFF php_apache_ini_dtor(r, parent_req TSRMLS_CC);
+
+ conf = ap_get_module_config(r->per_dir_config, &php4_module);
+
+@@ -535,7 +544,7 @@
+ if (!parent_req) {
+ parent_req = ctx->r;
+ }
+- if (parent_req && strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) {
++ if (parent_req && parent_req->handler && strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) {
+ if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) {
+ zend_bailout();
+ }
diff --git a/dev-lang/php/files/4.4.1/php4.4.1-curl-open_basedir.patch b/dev-lang/php/files/4.4.1/php4.4.1-curl-open_basedir.patch
new file mode 100644
index 0000000..60094c0
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/php4.4.1-curl-open_basedir.patch
@@ -0,0 +1,20 @@
+--- ext/curl/curl.c 2005-12-02 23:34:12.000000000 +0100
++++ ext/curl/curl.c 2005-12-03 01:13:51.000000000 +0100
+@@ -67,7 +67,7 @@
+
+ #define PHP_CURL_CHECK_OPEN_BASEDIR(str, len) \
+ if (((PG(open_basedir) && *PG(open_basedir)) || PG(safe_mode)) && \
+- strncasecmp(str, "file://", sizeof("file://") - 1) == 0) \
++ strncasecmp(str, "file:", sizeof("file:") - 1) == 0) \
+ { \
+ php_url *tmp_url; \
+ \
+@@ -76,7 +76,7 @@
+ RETURN_FALSE; \
+ } \
+ \
+- if (tmp_url->query || php_check_open_basedir(tmp_url->path TSRMLS_CC) || \
++ if (tmp_url->query || tmp_url->fragment || php_check_open_basedir(tmp_url->path TSRMLS_CC) || \
+ (PG(safe_mode) && !php_checkuid(tmp_url->path, "rb+", CHECKUID_CHECK_MODE_PARAM)) \
+ ) { \
+ php_url_free(tmp_url); \
diff --git a/dev-lang/php/files/4.4.1/php4.4.1-current_key_by_reference.patch b/dev-lang/php/files/4.4.1/php4.4.1-current_key_by_reference.patch
new file mode 100644
index 0000000..cf3754d
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/php4.4.1-current_key_by_reference.patch
@@ -0,0 +1,22 @@
+--- ext/standard/basic_functions.c 2005/09/29 16:31:48 1.543.2.51.2.3
++++ ext/standard/basic_functions.c 2005/11/02 17:58:00 1.543.2.51.2.4
+@@ -17,7 +17,7 @@
+ +----------------------------------------------------------------------+
+ */
+
+-/* $Id: basic_functions.c,v 1.543.2.51.2.3 2005/09/29 16:31:48 iliaa Exp $ */
++/* $Id: basic_functions.c,v 1.543.2.51.2.4 2005/11/02 17:58:00 iliaa Exp $ */
+
+ #include "php.h"
+ #include "php_streams.h"
+@@ -802,8 +802,8 @@ function_entry basic_functions[] = {
+ PHP_FE(prev, first_arg_force_ref)
+ PHP_FE(next, first_arg_force_ref)
+ PHP_FE(reset, first_arg_force_ref)
+- PHP_FE(current, NULL)
+- PHP_FE(key, NULL)
++ PHP_FE(current, first_arg_force_ref)
++ PHP_FE(key, first_arg_force_ref)
+ PHP_FE(min, NULL)
+ PHP_FE(max, NULL)
+ PHP_FE(in_array, NULL)
diff --git a/dev-lang/php/files/4.4.1/php4.4.1-gd-safe_mode.patch b/dev-lang/php/files/4.4.1/php4.4.1-gd-safe_mode.patch
new file mode 100644
index 0000000..a35c28a
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/php4.4.1-gd-safe_mode.patch
@@ -0,0 +1,112 @@
+--- ext/gd/gd.c 2005-10-06 22:44:52.000000000 +0200
++++ ext/gd/gd.c 2005-11-03 21:42:59.000000000 +0100
+@@ -18,7 +18,7 @@
+ +----------------------------------------------------------------------+
+ */
+
+-/* $Id: gd.c,v 1.221.2.56.2.1 2005/10/06 20:44:52 iliaa Exp $ */
++/* $Id: gd.c,v 1.221.2.56.2.3 2005/11/03 20:20:04 sniper Exp $ */
+
+ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
+ Cold Spring Harbor Labs. */
+@@ -623,7 +623,7 @@
+
+ convert_to_string_ex(file);
+
+- stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", IGNORE_PATH | IGNORE_URL_WIN | REPORT_ERRORS, NULL);
++ stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", ENFORCE_SAFE_MODE | IGNORE_PATH | IGNORE_URL_WIN | REPORT_ERRORS, NULL);
+ if (stream == NULL) {
+ RETURN_FALSE;
+ }
+@@ -807,6 +807,10 @@
+ convert_to_boolean_ex(dither);
+ convert_to_long_ex(ncolors);
+
++ if (Z_LVAL_PP(ncolors) <= 0) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of colors has to be greater than zero");
++ RETURN_FALSE;
++ }
+ gdImageTrueColorToPalette(im, Z_LVAL_PP(dither), Z_LVAL_PP(ncolors));
+
+ RETURN_TRUE;
+@@ -1436,7 +1440,7 @@
+
+ fn = Z_STRVAL_PP(file);
+
+- stream = php_stream_open_wrapper(fn, "rb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
++ stream = php_stream_open_wrapper(fn, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
+ if (stream == NULL) {
+ RETURN_FALSE;
+ }
+@@ -1644,10 +1648,7 @@
+ }
+
+ if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
+- if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(fn, "rb+", CHECKUID_CHECK_FILE_AND_DIR))) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn);
+- RETURN_FALSE;
+- }
++ PHP_GD_CHECK_OPEN_BASEDIR(fn, "Invalid filename");
+
+ fp = VCWD_FOPEN(fn, "wb");
+ if (!fp) {
+@@ -3742,16 +3743,10 @@
+ }
+
+ /* Check origin file */
+- if (!fn_org || fn_org == empty_string || php_check_open_basedir(fn_org TSRMLS_CC)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid origin filename '%s'", fn_org);
+- RETURN_FALSE;
+- }
++ PHP_GD_CHECK_OPEN_BASEDIR(fn_org, "Invalid origin filename");
+
+ /* Check destination file */
+- if (!fn_dest || fn_dest == empty_string || php_check_open_basedir(fn_dest TSRMLS_CC)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid destination filename '%s'", fn_dest);
+- RETURN_FALSE;
+- }
++ PHP_GD_CHECK_OPEN_BASEDIR(fn_dest, "Invalid destination filename");
+
+ /* Open origin file */
+ org = VCWD_FOPEN(fn_org, "rb");
+--- ext/gd/gd_ctx.c 2005-10-06 22:44:52.000000000 +0200
++++ ext/gd/gd_ctx.c 2005-11-03 21:42:59.000000000 +0100
+@@ -73,10 +73,7 @@
+ }
+
+ if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) {
+- if (!fn || fn == empty_string || php_check_open_basedir(fn TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(fn, "rb+", CHECKUID_CHECK_FILE_AND_DIR))) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid filename '%s'", fn);
+- RETURN_FALSE;
+- }
++ PHP_GD_CHECK_OPEN_BASEDIR(fn, "Invalid filename");
+
+ fp = VCWD_FOPEN(fn, "wb");
+ if (!fp) {
+--- ext/gd/php_gd.h 2003-03-31 10:49:30.000000000 +0200
++++ ext/gd/php_gd.h 2005-11-15 11:15:27.000000000 +0100
+@@ -17,7 +17,7 @@
+ +----------------------------------------------------------------------+
+ */
+
+-/* $Id: php_gd.h,v 1.44.2.5 2003/03/31 08:49:30 sniper Exp $ */
++/* $Id: php_gd.h,v 1.44.2.5.8.2 2005/11/15 08:15:36 sniper Exp $ */
+
+ #ifndef PHP_GD_H
+ #define PHP_GD_H
+@@ -30,6 +30,15 @@
+
+ #if HAVE_LIBGD
+
++/* open_basedir and safe_mode checks */
++#define PHP_GD_CHECK_OPEN_BASEDIR(filename, errormsg) \
++ if (!filename || filename == empty_string || php_check_open_basedir(filename TSRMLS_CC) || \
++ (PG(safe_mode) && !php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR)) \
++ ) { \
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, errormsg); \
++ RETURN_FALSE; \
++ }
++
+ #define PHP_GDIMG_TYPE_GIF 1
+ #define PHP_GDIMG_TYPE_PNG 2
+ #define PHP_GDIMG_TYPE_JPG 3
diff --git a/dev-lang/php/files/4.4.1/php4.4.1-mbstring-header_inj.patch b/dev-lang/php/files/4.4.1/php4.4.1-mbstring-header_inj.patch
new file mode 100644
index 0000000..adbf35a
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/php4.4.1-mbstring-header_inj.patch
@@ -0,0 +1,145 @@
+--- ext/mbstring/mbstring.c 2005-09-21 15:19:19.000000000 +0200
++++ ext/mbstring/mbstring.c 2005-11-22 01:00:03.000000000 +0100
+@@ -17,7 +17,7 @@
+ +----------------------------------------------------------------------+
+ */
+
+-/* $Id: mbstring.c,v 1.142.2.47.2.1 2005/09/21 13:19:19 iliaa Exp $ */
++/* $Id: mbstring.c,v 1.142.2.47.2.5 2005/11/21 23:21:19 hirokawa Exp $ */
+
+ /*
+ * PHP4 Multibyte String module "mbstring"
+@@ -2924,16 +2924,17 @@
+ }
+ /* }}} */
+
+-/* {{{ proto string mb_encode_mimeheader(string str [, string charset [, string transfer-encoding [, string linefeed]]])
++/* {{{ proto string mb_encode_mimeheader(string str [, string charset [, string transfer-encoding [, string linefeed [, int indent]]]])
+ Converts the string to MIME "encoded-word" in the format of =?charset?(B|Q)?encoded_string?= */
+ PHP_FUNCTION(mb_encode_mimeheader)
+ {
+- pval **argv[4];
++ pval **argv[5];
+ enum mbfl_no_encoding charset, transenc;
+ mbfl_string string, result, *ret;
+ char *p, *linefeed;
++ int indent;
+
+- if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 4 || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), argv) == FAILURE) {
++ if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 5 || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), argv) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+@@ -2970,6 +2971,12 @@
+ linefeed = Z_STRVAL_PP(argv[3]);
+ }
+
++ indent = 0;
++ if (ZEND_NUM_ARGS() >= 5) {
++ convert_to_long_ex(argv[4]);
++ indent = Z_LVAL_PP(argv[4]);
++ }
++
+ convert_to_string_ex(argv[0]);
+ mbfl_string_init(&string);
+ mbfl_string_init(&result);
+@@ -2977,7 +2984,7 @@
+ string.no_encoding = MBSTRG(current_internal_encoding);
+ string.val = Z_STRVAL_PP(argv[0]);
+ string.len = Z_STRLEN_PP(argv[0]);
+- ret = mbfl_mime_header_encode(&string, &result, charset, transenc, linefeed, 0);
++ ret = mbfl_mime_header_encode(&string, &result, charset, transenc, linefeed, indent);
+ if (ret != NULL) {
+ RETVAL_STRINGL((char *)ret->val, ret->len, 0) /* the string is already strdup()'ed */
+ } else {
+@@ -3460,6 +3467,22 @@
+ * Sends an email message with MIME scheme
+ */
+ #if HAVE_SENDMAIL
++#define SKIP_LONG_HEADER_SEP_MBSTRING(str, pos) \
++ if (str[pos] == '\r' && str[pos + 1] == '\n' && (str[pos + 2] == ' ' || str[pos + 2] == '\t')) { \
++ pos += 3; \
++ while (str[pos] == ' ' || str[pos] == '\t') { \
++ pos++; \
++ } \
++ continue; \
++ } \
++ else if (str[pos] == '\n' && (str[pos + 1] == ' ' || str[pos + 1] == '\t')) { \
++ pos += 2; \
++ while (str[pos] == ' ' || str[pos] == '\t') { \
++ pos++; \
++ } \
++ continue; \
++ } \
++
+ PHP_FUNCTION(mb_send_mail)
+ {
+ int argc, n;
+@@ -3474,8 +3497,9 @@
+ body_enc; /* body transfar encoding */
+ mbfl_memory_device device; /* automatic allocateable buffer for additional header */
+ const mbfl_language *lang;
+- char *force_extra_parameters = INI_STR("mail.force_extra_parameters");
+ int err = 0;
++ char *to_r;
++ int to_len, i;
+
+ /* initialize */
+ mbfl_memory_device_init(&device, 0, 0);
+@@ -3502,6 +3526,32 @@
+ convert_to_string_ex(argv[0]);
+ if (Z_STRVAL_PP(argv[0])) {
+ to = Z_STRVAL_PP(argv[0]);
++ to_len = Z_STRLEN_PP(argv[0]);
++ if (to_len > 0) {
++ to_r = estrndup(to, to_len);
++ for (; to_len; to_len--) {
++ if (!isspace((unsigned char) to_r[to_len - 1])) {
++ break;
++ }
++ to_r[to_len - 1] = '\0';
++ }
++ for (i = 0; to_r[i]; i++) {
++ if (iscntrl((unsigned char) to_r[i])) {
++ /* According to RFC 822, section 3.1.1 long headers may be
++separated into
++ * parts using CRLF followed at least one linear-white-space
++character ('\t' or ' ').
++ * To prevent these separators from being replaced with a space,
++we use the
++ * SKIP_LONG_HEADER_SEP_MBSTRING to skip over them.
++ */
++ SKIP_LONG_HEADER_SEP_MBSTRING(to_r, i);
++ to_r[i] = ' ';
++ }
++ }
++ } else {
++ to_r = to;
++ }
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing To: field");
+ err = 1;
+@@ -3596,18 +3646,19 @@
+ extra_cmd = Z_STRVAL_PP(argv[4]);
+ }
+
+- if (force_extra_parameters) {
+- extra_cmd = estrdup(force_extra_parameters);
+- } else if (extra_cmd) {
++ if (extra_cmd) {
+ extra_cmd = php_escape_shell_cmd(extra_cmd);
+ }
+
+- if (!err && php_mail(to, subject, message, headers, extra_cmd TSRMLS_CC)) {
++ if (!err && php_mail(to_r, subject, message, headers, extra_cmd TSRMLS_CC)) {
+ RETVAL_TRUE;
+ } else {
+ RETVAL_FALSE;
+ }
+
++ if (to_r != to) {
++ efree(to_r);
++ }
+ if (extra_cmd) {
+ efree(extra_cmd);
+ }
diff --git a/dev-lang/php/files/4.4.1/php4.4.1-mod_rewrite-crash.patch b/dev-lang/php/files/4.4.1/php4.4.1-mod_rewrite-crash.patch
new file mode 100644
index 0000000..a08a19e
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/php4.4.1-mod_rewrite-crash.patch
@@ -0,0 +1,20 @@
+--- sapi/apache2handler/sapi_apache2.c 2005/10/12 21:41:36 1.1.2.40.2.5
++++ sapi/apache2handler/sapi_apache2.c 2005/11/02 17:55:17 1.1.2.40.2.6
+@@ -18,7 +18,7 @@
+ +----------------------------------------------------------------------+
+ */
+
+-/* $Id: sapi_apache2.c,v 1.1.2.40.2.5 2005/10/12 21:41:36 tony2001 Exp $ */
++/* $Id: sapi_apache2.c,v 1.1.2.40.2.6 2005/11/02 17:55:17 iliaa Exp $ */
+
+ #include <fcntl.h>
+
+@@ -535,7 +535,7 @@ normal:
+ if (!parent_req) {
+ parent_req = ctx->r;
+ }
+- if (parent_req && strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) {
++ if (parent_req && parent_req->handler && strcmp(parent_req->handler, PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SCRIPT)) {
+ if (php_apache_request_ctor(r, ctx TSRMLS_CC)!=SUCCESS) {
+ zend_bailout();
+ }
diff --git a/dev-lang/php/files/4.4.1/php4.4.1-multilib-search-path.patch b/dev-lang/php/files/4.4.1/php4.4.1-multilib-search-path.patch
new file mode 100644
index 0000000..26df783
--- /dev/null
+++ b/dev-lang/php/files/4.4.1/php4.4.1-multilib-search-path.patch
@@ -0,0 +1,1488 @@
+diff -Nru php-4.4.1.orig/acinclude.m4 php-4.4.1/acinclude.m4
+--- php-4.4.1.orig/acinclude.m4 2005-09-23 11:20:22.000000000 +0200
++++ php-4.4.1/acinclude.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -194,7 +194,7 @@
+ unset ac_new_flags
+ for i in [$]$1; do
+ case [$]i in
+- -L/usr/lib|-L/usr/lib/[)] ;;
++ -L/usr/lib|-L/usr/lib/|-L/usr/lib64|-L/usr/lib64/[)] ;;
+ *[)] ac_new_flags="[$]ac_new_flags [$]i" ;;
+ esac
+ done
+@@ -645,7 +645,7 @@
+ ])
+
+ AC_DEFUN([PHP_PROG_SENDMAIL],[
+-PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib
++PHP_ALT_PATH=/usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib:/usr/lib64
+ AC_PATH_PROG(PROG_SENDMAIL, sendmail,[], $PATH:$PHP_ALT_PATH)
+ if test -n "$PROG_SENDMAIL"; then
+ AC_DEFINE(HAVE_SENDMAIL,1,[whether you have sendmail])
+@@ -856,7 +856,9 @@
+ dnl add a library to linkpath/runpath
+ dnl
+ AC_DEFUN([PHP_ADD_LIBPATH],[
+- if test "$1" != "/usr/lib"; then
++ case x$1 in
++ x/usr/lib|x/usr/lib64) ;;
++ *)
+ PHP_EXPAND_PATH($1, ai_p)
+ ifelse([$2],,[
+ _PHP_ADD_LIBPATH_GLOBAL([$ai_p])
+@@ -866,8 +868,8 @@
+ else
+ _PHP_ADD_LIBPATH_GLOBAL([$ai_p])
+ fi
+- ])
+- fi
++ ]) ;;
++ esac
+ ])
+
+ dnl
+@@ -1671,15 +1673,20 @@
+ fi
+
+ for i in $PHP_KERBEROS; do
+- if test -f $i/lib/libkrb5.a || test -f $i/lib/libkrb5.$SHLIB_SUFFIX_NAME; then
++ if test -f $i/lib/libkrb5.a -o -f $i/lib/libkrb5.$SHLIB_SUFFIX_NAME; then
+ PHP_KERBEROS_DIR=$i
++ PHP_KERBEROS_LIBDIR=$i/lib
++ break
++ elif test -f $i/lib64/libkrb5.a -o -f $i/lib64/libkrb5.$SHLIB_SUFFIX_NAME; then
++ PHP_KERBEROS_DIR=$i
++ PHP_KERBEROS_LIBDIR=$i/lib64
+ break
+ fi
+ done
+
+ if test "$PHP_KERBEROS_DIR"; then
+ found_kerberos=yes
+- PHP_ADD_LIBPATH($PHP_KERBEROS_DIR/lib, $1)
++ PHP_ADD_LIBPATH($PHP_KERBEROS_LIBDIR, $1)
+ PHP_ADD_LIBRARY(gssapi_krb5, 1, $1)
+ PHP_ADD_LIBRARY(krb5, 1, $1)
+ PHP_ADD_LIBRARY(k5crypto, 1, $1)
+@@ -1751,6 +1758,9 @@
+ if test -r $i/lib/libssl.a -o -r $i/lib/libssl.$SHLIB_SUFFIX_NAME; then
+ OPENSSL_LIBDIR=$i/lib
+ fi
++ if test -r $i/lib64/libssl.a -o -r $i/lib64/libssl.$SHLIB_SUFFIX_NAME; then
++ OPENSSL_LIBDIR=$i/lib64
++ fi
+ test -n "$OPENSSL_INCDIR" && test -n "$OPENSSL_LIBDIR" && break
+ done
+
+@@ -1871,7 +1881,9 @@
+ fi
+
+ if test -f $ICONV_DIR/lib/lib$iconv_lib_name.a ||
+- test -f $ICONV_DIR/lib/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
++ test -f $ICONV_DIR/lib/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME ||
++ test -f $ICONV_DIR/lib64/lib$iconv_lib_name.a ||
++ test -f $ICONV_DIR/lib64/lib$iconv_lib_name.$SHLIB_SUFFIX_NAME
+ then
+ PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [
+ found_iconv=yes
+diff -Nru php-4.4.1.orig/ext/bz2/config.m4 php-4.4.1/ext/bz2/config.m4
+--- php-4.4.1.orig/ext/bz2/config.m4 2004-01-21 06:04:50.000000000 +0100
++++ php-4.4.1/ext/bz2/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -19,6 +19,12 @@
+ done
+ fi
+
++ for j in lib64 lib; do
++ if test -d $BZIP_DIR/$j; then
++ BZIP_LIBDIR=$BZIP_DIR/$j
++ fi
++ done
++
+ if test -z "$BZIP_DIR"; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(Please reinstall the BZip2 distribution)
+@@ -27,12 +33,12 @@
+ PHP_CHECK_LIBRARY(bz2, BZ2_bzerror,
+ [
+ PHP_ADD_INCLUDE($BZIP_DIR/include)
+- PHP_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_DIR/lib, BZ2_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_LIBDIR, BZ2_SHARED_LIBADD)
+ AC_DEFINE(HAVE_BZ2,1,[ ])
+ ], [
+ AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0)
+ ], [
+- -L$BZIP_DIR/lib
++ -L$BZIP_LIBDIR
+ ])
+
+ PHP_NEW_EXTENSION(bz2, bz2.c, $ext_shared)
+diff -Nru php-4.4.1.orig/ext/curl/config.m4 php-4.4.1/ext/curl/config.m4
+--- php-4.4.1.orig/ext/curl/config.m4 2005-02-09 17:23:49.000000000 +0100
++++ php-4.4.1/ext/curl/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -23,6 +23,12 @@
+ done
+ fi
+
++ for j in lib64 lib; do
++ if test -d $CURL_DIR/$j; then
++ CURL_LIBDIR=$CURL_DIR/$j
++ fi
++ done
++
+ if test -z "$CURL_DIR"; then
+ AC_MSG_RESULT(not found)
+ AC_MSG_ERROR(Please reinstall the libcurl distribution -
+@@ -51,7 +57,7 @@
+
+ PHP_ADD_INCLUDE($CURL_DIR/include)
+ PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
+- PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/lib, CURL_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_LIBDIR, CURL_SHARED_LIBADD)
+
+ PHP_CHECK_LIBRARY(curl,curl_easy_perform,
+ [
+@@ -59,14 +65,14 @@
+ ],[
+ AC_MSG_ERROR(There is something wrong. Please check config.log for more information.)
+ ],[
+- $CURL_LIBS -L$CURL_DIR/lib
++ $CURL_LIBS -L$CURL_LIBDIR
+ ])
+
+ PHP_CHECK_LIBRARY(curl,curl_version_info,
+ [
+ AC_DEFINE(HAVE_CURL_VERSION_INFO,1,[ ])
+ ],[],[
+- $CURL_LIBS -L$CURL_DIR/lib
++ $CURL_LIBS -L$CURL_LIBDIR
+ ])
+
+ dnl if test "$PHP_CURLWRAPPERS" != "no" ; then
+diff -Nru php-4.4.1.orig/ext/dba/config.m4 php-4.4.1/ext/dba/config.m4
+--- php-4.4.1.orig/ext/dba/config.m4 2005-08-22 21:59:42.000000000 +0200
++++ php-4.4.1/ext/dba/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -80,12 +80,18 @@
+ fi
+ done
+
++ for j in lib64 lib; do
++ if test -d $THIS_PREFIX/$j; then
++ THIS_PREFIX_LIBDIR=$THIS_PREFIX/$j
++ fi
++ done
++
+ if test -n "$THIS_INCLUDE"; then
+ PHP_CHECK_LIBRARY(gdbm, gdbm_open, [
+ AC_DEFINE_UNQUOTED(GDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
+ AC_DEFINE(DBA_GDBM, 1, [ ])
+ THIS_LIBS=gdbm
+- ], [], [-L$THIS_PREFIX/lib])
++ ], [], [-L$THIS_PREFIX_LIBDIR])
+ fi
+
+ PHP_DBA_STD_ASSIGN
+@@ -110,14 +116,20 @@
+ break
+ fi
+ done
+-
++
++ for j in lib64 lib; do
++ if test -d $THIS_PREFIX/$j; then
++ THIS_PREFIX_LIBDIR=$THIS_PREFIX/$j
++ fi
++ done
++
+ if test -n "$THIS_INCLUDE"; then
+ for LIB in ndbm db1 c; do
+ PHP_CHECK_LIBRARY($LIB, dbm_open, [
+ AC_DEFINE_UNQUOTED(NDBM_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
+ AC_DEFINE(DBA_NDBM, 1, [ ])
+ THIS_LIBS=$LIB
+- ], [], [-L$THIS_PREFIX/lib])
++ ], [], [-L$THIS_PREFIX_LIBDIR])
+ if test -n "$THIS_LIBS"; then
+ break
+ fi
+@@ -135,25 +147,28 @@
+ dnl parameters(version, library list, function)
+ AC_DEFUN([PHP_DBA_DB_CHECK],[
+ for LIB in $2; do
+- if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f $THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then
+- PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib, -l$LIB,[
+- AC_TRY_LINK([
++ for LIBDIR in lib64 lib; do
++ if test -f $THIS_PREFIX/$LIBDIR/lib$LIB.a -o -f $THIS_PREFIX/$LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then
++ PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/$LIBDIR, -l$LIB,[
++ AC_TRY_LINK([
+ #include "$THIS_INCLUDE"
+- ],[
+- $3;
+- ],[
+- AC_EGREP_CPP(yes,[
++ ],[
++ $3;
++ ],[
++ AC_EGREP_CPP(yes,[
+ #include "$THIS_INCLUDE"
+ #if DB_VERSION_MAJOR == $1
+- yes
++ yes
+ #endif
+- ],[
+- THIS_LIBS=$LIB
+- break
++ ],[
++ THIS_LIBS=$LIB
++ break
++ ])
+ ])
+ ])
+- ])
+- fi
++ fi
++ done
++ test -n "$THIS_LIBS" && break
+ done
+ if test -z "$THIS_LIBS"; then
+ AC_MSG_CHECKING(for db$1 major version)
+@@ -314,6 +329,12 @@
+ fi
+ done
+
++ for j in lib64 lib; do
++ if test -d $THIS_PREFIX/$j; then
++ THIS_PREFIX_LIBDIR=$THIS_PREFIX/$j
++ fi
++ done
++
+ if test -n "$THIS_INCLUDE"; then
+ for LIB in dbm c gdbm; do
+ PHP_CHECK_LIBRARY($LIB, dbminit, [
+@@ -328,7 +349,7 @@
+ fi
+ AC_DEFINE(DBA_DBM, 1, [ ])
+ THIS_LIBS=$LIB
+- ], [], [-L$THIS_PREFIX/lib])
++ ], [], [-L$THIS_PREFIX_LIBDIR])
+ if test -n "$THIS_LIBS"; then
+ break
+ fi
+@@ -364,13 +385,19 @@
+ fi
+ done
+
++ for j in lib64 lib; do
++ if test -d $THIS_PREFIX/$j; then
++ THIS_PREFIX_LIBDIR=$THIS_PREFIX/$j
++ fi
++ done
++
+ if test -n "$THIS_INCLUDE"; then
+ for LIB in cdb c; do
+ PHP_CHECK_LIBRARY($LIB, cdb_read, [
+ AC_DEFINE_UNQUOTED(CDB_INCLUDE_FILE, "$THIS_INCLUDE", [ ])
+ AC_DEFINE(DBA_CDB, 1, [ ])
+ THIS_LIBS=$LIB
+- ], [], [-L$THIS_PREFIX/lib])
++ ], [], [-L$THIS_PREFIX_LIBDIR])
+ if test -n "$THIS_LIBS"; then
+ break
+ fi
+diff -Nru php-4.4.1.orig/ext/domxml/config.m4 php-4.4.1/ext/domxml/config.m4
+--- php-4.4.1.orig/ext/domxml/config.m4 2004-12-30 08:02:17.000000000 +0100
++++ php-4.4.1/ext/domxml/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -48,13 +48,15 @@
+ AC_MSG_ERROR(Please reinstall the libxml >= 2.4.14 distribution)
+ fi
+
++ for j in lib64 lib; do
++ if test -d $DOMXML_DIR/$j; then
++ DOMXML_LIBDIR=$DOMXML_DIR/$j
++ fi
++ done
++
+ PHP_DOM_CHECK_VERSION
+
+- if test -f $DOMXML_DIR/lib/libxml2.a -o -f $DOMXML_DIR/lib/libxml2.$SHLIB_SUFFIX_NAME ; then
+- DOM_LIBNAME=xml2
+- else
+- DOM_LIBNAME=xml
+- fi
++ DOM_LIBNAME=xml2
+
+ XML2_CONFIG=$DOMXML_DIR/bin/xml2-config
+
+@@ -62,7 +64,7 @@
+ DOM_LIBS=`$XML2_CONFIG --libs`
+ PHP_EVAL_LIBLINE($DOM_LIBS, DOMXML_SHARED_LIBADD)
+ else
+- PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_LIBDIR, DOMXML_SHARED_LIBADD)
+ fi
+
+ PHP_ADD_INCLUDE($DOMXML_DIR/include$DOMXML_DIR_ADD)
+@@ -70,7 +72,13 @@
+ if test "$PHP_ZLIB_DIR" = "no"; then
+ AC_MSG_ERROR(DOMXML requires ZLIB. Use --with-zlib-dir=<DIR>)
+ else
+- PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, DOMXML_SHARED_LIBADD)
++ for j in lib64 lib; do
++ if test -d $PHP_ZLIB_DIR/$j; then
++ PHP_ZLIB_LIBDIR=$PHP_ZLIB_DIR/$j
++ fi
++ done
++
++ PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_LIBDIR, DOMXML_SHARED_LIBADD)
+ fi
+
+ AC_DEFINE(HAVE_DOMXML,1,[ ])
+@@ -135,27 +143,35 @@
+ AC_MSG_ERROR(Please reinstall the libxslt >= 1.0.3 distribution)
+ fi
+
++ for j in lib64 lib; do
++ if test -d $DOMXSLT_DIR/$j; then
++ DOMXSLT_LIBDIR=$DOMXSLT_DIR/$j
++ fi
++ done
++
+ PHP_DOM_XSLT_CHECK_VERSION
+
+- PHP_ADD_LIBRARY_WITH_PATH(xslt, $DOMXSLT_DIR/lib, DOMXML_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(xslt, $DOMXSLT_LIBDIR, DOMXML_SHARED_LIBADD)
+
+ PHP_ADD_INCLUDE($DOMXSLT_DIR/include)
+
+ if test "$PHP_DOM" = "no"; then
+ AC_MSG_ERROR(DOMXSLT requires DOMXML. Use --with-dom=<DIR>)
+ fi
+-
+- if test -f $DOMXML_DIR/lib/libxml2.a -o -f $DOMXML_DIR/lib/libxml2.$SHLIB_SUFFIX_NAME ; then
+- DOM_LIBNAME=xml2
+- else
+- DOM_LIBNAME=xml
+- fi
+
+- PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD)
++ for j in lib64 lib; do
++ if test -d $DOMXML_DIR/$j; then
++ DOMXML_LIBDIR=$DOMXML_DIR/$j
++ fi
++ done
++
++ DOM_LIBNAME=xml2
++
++ PHP_ADD_LIBRARY_WITH_PATH($DOM_LIBNAME, $DOMXML_LIBDIR, DOMXML_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($DOMXML_DIR/include$DOMXML_DIR_ADD)
+
+- if test -f $DOMXML_DIR/lib/libxsltbreakpoint.a -o -f $DOMXML_DIR/lib/libxsltbreakpoint.$SHLIB_SUFFIX_NAME ; then
+- PHP_ADD_LIBRARY_WITH_PATH(xsltbreakpoint, $DOMXML_DIR/lib, DOMXML_SHARED_LIBADD)
++ if test -f $DOMXML_LIBDIR/libxsltbreakpoint.a -o -f $DOMXML_LIBDIR/libxsltbreakpoint.$SHLIB_SUFFIX_NAME ; then
++ PHP_ADD_LIBRARY_WITH_PATH(xsltbreakpoint, $DOMXML_LIBDIR, DOMXML_SHARED_LIBADD)
+ fi
+
+ AC_DEFINE(HAVE_DOMXSLT,1,[ ])
+@@ -185,9 +201,15 @@
+ AC_MSG_ERROR(Please reinstall the libxslt >= 1.0.3 distribution)
+ fi
+
++ for j in lib64 lib; do
++ if test -d $DOMEXSLT_DIR/$j; then
++ DOMEXSLT_LIBDIR=$DOMEXSLT_DIR/$j
++ fi
++ done
++
+ PHP_DOM_EXSLT_CHECK_VERSION
+
+- PHP_ADD_LIBRARY_WITH_PATH(exslt, $DOMEXSLT_DIR/lib, DOMXML_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(exslt, $DOMEXSLT_LIBDIR, DOMXML_SHARED_LIBADD)
+
+ PHP_ADD_INCLUDE($DOMEXSLT_DIR/include)
+
+diff -Nru php-4.4.1.orig/ext/gd/config.m4 php-4.4.1/ext/gd/config.m4
+--- php-4.4.1.orig/ext/gd/config.m4 2005-05-17 14:23:09.000000000 +0200
++++ php-4.4.1/ext/gd/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -50,8 +50,15 @@
+ AC_DEFUN([PHP_GD_JPEG],[
+ if test "$PHP_JPEG_DIR" != "no"; then
+
+- for i in $PHP_JPEG_DIR /usr/local /usr; do
+- test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i && break
++ for j in lib64 lib; do
++ for i in $PHP_JPEG_DIR /usr/local /usr; do
++ if test -f "$i/$j/libjpeg.$SHLIB_SUFFIX_NAME" -o -f "$i/$j/libjpeg.a"; then
++ GD_JPEG_DIR=$i
++ GD_JPEG_LIB_DIR=$i/$j
++ break
++ fi
++ done
++ test -n "$GD_JPEG_DIR" && break
+ done
+
+ if test -z "$GD_JPEG_DIR"; then
+@@ -61,11 +68,11 @@
+ PHP_CHECK_LIBRARY(jpeg,jpeg_read_header,
+ [
+ PHP_ADD_INCLUDE($GD_JPEG_DIR/include)
+- PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_DIR/lib, GD_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_LIB_DIR, GD_SHARED_LIBADD)
+ ],[
+ AC_MSG_ERROR([Problem with libjpeg.(a|so). Please check config.log for more information.])
+ ],[
+- -L$GD_JPEG_DIR/lib
++ -L$GD_JPEG_LIB_DIR
+ ])
+ else
+ AC_MSG_RESULT([If configure fails try --with-jpeg-dir=<DIR>])
+@@ -75,8 +82,15 @@
+ AC_DEFUN([PHP_GD_PNG],[
+ if test "$PHP_PNG_DIR" != "no"; then
+
+- for i in $PHP_PNG_DIR /usr/local /usr; do
+- test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i && break
++ for j in lib64 lib; do
++ for i in $PHP_PNG_DIR /usr/local /usr; do
++ if test -f "$i/$j/libpng.$SHLIB_SUFFIX_NAME" -o -f "$i/$j/libpng.a"; then
++ GD_PNG_DIR=$i
++ GD_PNG_LIB_DIR=$i/$j
++ break
++ fi
++ done
++ test -n "$GD_PNG_DIR" && break
+ done
+
+ if test -z "$GD_PNG_DIR"; then
+@@ -94,12 +108,12 @@
+ PHP_CHECK_LIBRARY(png,png_write_image,
+ [
+ PHP_ADD_INCLUDE($GD_PNG_DIR/include)
+- PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, GD_SHARED_LIBADD)
+- PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_DIR/lib, GD_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_LIB_DIR, GD_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_LIB_DIR, GD_SHARED_LIBADD)
+ ],[
+ AC_MSG_ERROR([Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information.])
+ ],[
+- -L$PHP_ZLIB_DIR/lib -lz -L$GD_PNG_DIR/lib
++ -L$PHP_ZLIB_LIB_DIR -lz -L$GD_PNG_LIB_DIR
+ ])
+
+ else
+@@ -110,8 +124,15 @@
+ AC_DEFUN([PHP_GD_XPM],[
+ if test "$PHP_XPM_DIR" != "no"; then
+
+- for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do
+- test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i && break
++ for j in lib64 lib; do
++ for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do
++ if test -f "$i/$j/libXpm.$SHLIB_SUFFIX_NAME" -o -f "$i/$j/libXpm.a"; then
++ GD_XPM_DIR=$i
++ GD_XPM_LIB_DIR=$i/$j
++ break
++ fi
++ done
++ test -n "$GD_XPM_DIR" && break
+ done
+
+ if test -z "$GD_XPM_DIR"; then
+@@ -129,12 +150,12 @@
+ PHP_CHECK_LIBRARY(Xpm,XpmFreeXpmImage,
+ [
+ PHP_ADD_INCLUDE($GD_XPM_INC)
+- PHP_ADD_LIBRARY_WITH_PATH(Xpm, $GD_XPM_DIR/lib, GD_SHARED_LIBADD)
+- PHP_ADD_LIBRARY_WITH_PATH(X11, $GD_XPM_DIR/lib, GD_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(Xpm, $GD_XPM_LIB_DIR, GD_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(X11, $GD_XPM_LIB_DIR, GD_SHARED_LIBADD)
+ ],[
+ AC_MSG_ERROR([Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information.])
+ ],[
+- -L$GD_XPM_DIR/lib -lX11
++ -L$GD_XPM_LIB_DIR -lX11
+ ])
+ else
+ AC_MSG_RESULT(If configure fails try --with-xpm-dir=<DIR>)
+@@ -145,25 +166,29 @@
+ if test "$PHP_TTF" != "no"; then
+ if test "$PHP_FREETYPE_DIR" = "no" -o "$PHP_FREETYPE_DIR" = ""; then
+ if test -n "$PHP_TTF"; then
+- for i in $PHP_TTF /usr/local /usr; do
+- if test -f "$i/include/freetype.h"; then
+- TTF_DIR=$i
+- unset TTF_INC_DIR
+- fi
+- if test -f "$i/include/freetype/freetype.h"; then
+- TTF_DIR=$i
+- TTF_INC_DIR=$i/include/freetype
+- fi
+- if test -f "$i/include/freetype1/freetype/freetype.h"; then
+- TTF_DIR=$i
+- TTF_INC_DIR=$i/include/freetype1/freetype
+- fi
++ for j in lib64 lib; do
++ for i in $PHP_TTF /usr/local /usr; do
++ if test -f "$i/$j/libttf.a" -o -f "$i/$j/libttf.$SHLIB_SUFFIX_NAME"; then
++ TTF_DIR=$i
++ TTF_LIB_DIR=$i/$j
++ if test -f "$i/include/freetype.h"; then
++ unset TTF_INC_DIR
++ elif test -f "$i/include/freetype/freetype.h"; then
++ TTF_INC_DIR=$i/include/freetype
++ elif test -f "$i/include/freetype1/freetype/freetype.h"; then
++ TTF_INC_DIR=$i/include/freetype1/freetype
++ else
++ unset TTF_DIR
++ fi
++ fi
++ test -n "$TTF_DIR" && break
++ done
+ test -n "$TTF_DIR" && break
+ done
+ fi
+ if test -n "$TTF_DIR" ; then
+ AC_DEFINE(HAVE_LIBTTF,1,[ ])
+- PHP_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib, GD_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(ttf, $TTF_LIB_DIR, GD_SHARED_LIBADD)
+ fi
+ if test -z "$TTF_INC_DIR"; then
+ TTF_INC_DIR=$TTF_DIR/include
+@@ -178,16 +203,21 @@
+ AC_DEFUN([PHP_GD_FREETYPE2],[
+ if test "$PHP_FREETYPE_DIR" != "no"; then
+
+- for i in $PHP_FREETYPE_DIR /usr/local /usr; do
+- if test -f "$i/include/freetype2/freetype/freetype.h"; then
+- FREETYPE2_DIR=$i
+- FREETYPE2_INC_DIR=$i/include/freetype2
+- break
+- fi
++ for j in lib64 lib; do
++ for i in $PHP_FREETYPE_DIR /usr/local /usr; do
++ if test -f "$i/include/freetype2/freetype/freetype.h" && \
++ test -f "$i/$j/libfreetype.a" -o -f "$i/$j/libfreetype.$SHLIB_SUFFIX_NAME"; then
++ FREETYPE2_DIR=$i
++ FREETYPE2_LIB_DIR=$i/$j
++ FREETYPE2_INC_DIR=$i/include/freetype2
++ break
++ fi
++ done
++ test -n "$FREETYPE2_DIR" && break
+ done
+
+ if test -n "$FREETYPE2_DIR" ; then
+- PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/lib, GD_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_LIB_DIR, GD_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($FREETYPE2_DIR/include)
+ PHP_ADD_INCLUDE($FREETYPE2_INC_DIR)
+ AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ])
+@@ -203,8 +233,16 @@
+ AC_DEFUN([PHP_GD_T1LIB],[
+ if test "$PHP_T1LIB" != "no"; then
+
+- for i in $PHP_T1LIB /usr/local /usr; do
+- test -f "$i/include/t1lib.h" && GD_T1_DIR=$i && break
++ for j in lib64 lib; do
++ for i in $PHP_T1LIB /usr/local /usr; do
++ if test -f "$i/include/t1lib.h" && \
++ test -f "$i/$j/libt1.a" -o -f "$i/$j/libt1.$SHLIB_SUFFIX_NAME"; then
++ GD_T1_DIR=$i
++ GD_T1_LIB_DIR=$i/$j
++ break
++ fi
++ done
++ test -n "$GD_T1_DIR" && break
+ done
+
+ if test -z "$GD_T1_DIR"; then
+@@ -215,11 +253,11 @@
+ [
+ AC_DEFINE(HAVE_LIBT1,1,[ ])
+ PHP_ADD_INCLUDE($GD_T1_DIR/include)
+- PHP_ADD_LIBRARY_WITH_PATH(t1, $GD_T1_DIR/lib, GD_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(t1, $GD_T1_LIB_DIR, GD_SHARED_LIBADD)
+ ],[
+ AC_MSG_ERROR([Problem with libt1.(a|so). Please check config.log for more information.])
+ ],[
+- -L$GD_T1_DIR/lib
++ -L$GD_T1_LIB_DIR
+ ])
+ fi
+ ])
+@@ -365,7 +403,7 @@
+ done
+
+ dnl Library path
+- for i in lib/gd1.3 lib/gd lib gd1.3 gd ""; do
++ for i in lib/gd1.3 lib64/gd1.3 lib/gd lib64/gd lib lib64 gd1.3 gd ""; do
+ test -f "$PHP_GD/$i/libgd.$SHLIB_SUFFIX_NAME" -o -f "$PHP_GD/$i/libgd.a" && GD_LIB="$PHP_GD/$i"
+ done
+
+diff -Nru php-4.4.1.orig/ext/gettext/config.m4 php-4.4.1/ext/gettext/config.m4
+--- php-4.4.1.orig/ext/gettext/config.m4 2003-10-01 04:53:58.000000000 +0200
++++ php-4.4.1/ext/gettext/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -14,11 +14,15 @@
+ AC_MSG_ERROR(Cannot locate header file libintl.h)
+ fi
+
+- GETTEXT_LIBDIR=$GETTEXT_DIR/lib
++ for j in lib64 lib; do
++ if test -d $GETTEXT_DIR/$j; then
++ GETTEXT_LIBDIR=$GETTEXT_DIR/$j
++ fi
++ done
++
+ GETTEXT_INCDIR=$GETTEXT_DIR/include
+
+ O_LDFLAGS=$LDFLAGS
+- LDFLAGS="$LDFLAGS -L$GETTEXT_LIBDIR"
+ AC_CHECK_LIB(intl, bindtextdomain, [
+ GETTEXT_LIBS=intl
+ GETTEXT_CHECK_IN_LIB=intl
+diff -Nru php-4.4.1.orig/ext/gmp/config.m4 php-4.4.1/ext/gmp/config.m4
+--- php-4.4.1.orig/ext/gmp/config.m4 2003-11-19 05:44:24.000000000 +0100
++++ php-4.4.1/ext/gmp/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -14,20 +14,26 @@
+ if test -z "$GMP_DIR"; then
+ AC_MSG_ERROR(Unable to locate gmp.h)
+ fi
+-
++
++ for j in lib64 lib; do
++ if test -d $GMP_DIR/$j; then
++ GMP_LIBDIR=$GMP_DIR/$j
++ fi
++ done
++
+ PHP_CHECK_LIBRARY(gmp, __gmp_randinit_lc_2exp_size,
+ [],[
+ PHP_CHECK_LIBRARY(gmp, gmp_randinit_lc_2exp_size,
+ [],[
+ AC_MSG_ERROR([GNU MP Library version 4.1.2 or greater required.])
+ ],[
+- -L$GMP_DIR/lib
++ -L$GMP_LIBDIR
+ ])
+ ],[
+- -L$GMP_DIR/lib
++ -L$GMP_LIBDIR
+ ])
+
+- PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/lib, GMP_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_LIBDIR, GMP_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($GMP_DIR/include)
+
+ PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared)
+diff -Nru php-4.4.1.orig/ext/iconv/config.m4 php-4.4.1/ext/iconv/config.m4
+--- php-4.4.1.orig/ext/iconv/config.m4 2005-01-10 22:38:56.000000000 +0100
++++ php-4.4.1/ext/iconv/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -23,8 +23,14 @@
+ PHP_ICONV_PREFIX="$ICONV_DIR"
+ fi
+
++ for j in lib64 lib; do
++ if test -d $PHP_ICONV_PREFIX/$j; then
++ PHP_ICONV_PREFIX_LIBDIR=$PHP_ICONV_PREFIX/$j
++ fi
++ done
++
+ CFLAGS="-I$PHP_ICONV_PREFIX/include $CFLAGS"
+- LDFLAGS="-L$PHP_ICONV_PREFIX/lib $LDFLAGS"
++ LDFLAGS="-L$PHP_ICONV_PREFIX_LIBDIR $LDFLAGS"
+
+ if test -r $PHP_ICONV_PREFIX/include/giconv.h; then
+ PHP_ICONV_H_PATH="$PHP_ICONV_PREFIX/include/giconv.h"
+diff -Nru php-4.4.1.orig/ext/imap/config.m4 php-4.4.1/ext/imap/config.m4
+--- php-4.4.1.orig/ext/imap/config.m4 2005-01-11 05:56:57.000000000 +0100
++++ php-4.4.1/ext/imap/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -167,6 +167,7 @@
+ for lib in c-client4 c-client imap; do
+ IMAP_LIB=$lib
+ IMAP_LIB_CHK(lib)
++ IMAP_LIB_CHK(lib64)
+ IMAP_LIB_CHK(c-client)
+ done
+
+diff -Nru php-4.4.1.orig/ext/interbase/config.m4 php-4.4.1/ext/interbase/config.m4
+--- php-4.4.1.orig/ext/interbase/config.m4 2003-04-25 10:59:00.000000000 +0200
++++ php-4.4.1/ext/interbase/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -9,10 +9,18 @@
+ if test "$PHP_INTERBASE" != "no"; then
+ if test "$PHP_INTERBASE" = "yes"; then
+ IBASE_INCDIR=/usr/interbase/include
+- IBASE_LIBDIR=/usr/interbase/lib
++ for j in lib64 lib; do
++ if test -d /usr/interbase/$j; then
++ IBASE_LIBDIR=/usr/interbase/$j
++ fi
++ done
+ else
+ IBASE_INCDIR=$PHP_INTERBASE/include
+- IBASE_LIBDIR=$PHP_INTERBASE/lib
++ for j in lib64 lib; do
++ if test -d $PHP_INTERBASE/$j; then
++ IBASE_LIBDIR=$PHP_INTERBASE/$j
++ fi
++ done
+ fi
+
+ PHP_CHECK_LIBRARY(gds, isc_detach_database,
+diff -Nru php-4.4.1.orig/ext/ldap/config.m4 php-4.4.1/ext/ldap/config.m4
+--- php-4.4.1.orig/ext/ldap/config.m4 2005-05-08 18:06:24.000000000 +0200
++++ php-4.4.1/ext/ldap/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -6,7 +6,8 @@
+ if test -f $1/include/ldap.h; then
+ LDAP_DIR=$1
+ LDAP_INCDIR=$1/include
+- LDAP_LIBDIR=$1/lib
++ test -f $1/lib/libldap.so && LDAP_LIBDIR=$1/lib
++ test -f $1/lib64/libldap.so && LDAP_LIBDIR=$1/lib64
+ elif test -f $1/include/umich-ldap/ldap.h; then
+ LDAP_DIR=$1
+ LDAP_INCDIR=$1/include/umich-ldap
+diff -Nru php-4.4.1.orig/ext/mbstring/config.m4 php-4.4.1/ext/mbstring/config.m4
+--- php-4.4.1.orig/ext/mbstring/config.m4 2005-02-21 08:10:13.000000000 +0100
++++ php-4.4.1/ext/mbstring/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -167,12 +167,18 @@
+ PHP_ADD_INCLUDE([$PHP_LIBMBFL_INCLUDE])
+ fi
+
++ for j in lib64 lib; do
++ if test -d $PHP_LIBMBFL/$j; then
++ PHP_LIBMBFL_LIBDIR=$PHP_LIBMBFL/$j
++ fi
++ done
++
+ PHP_CHECK_LIBRARY(mbfl, mbfl_buffer_converter_new, [
+- PHP_ADD_LIBRARY_WITH_PATH(mbfl, $PHP_LIBMBFL/lib, MBSTRING_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(mbfl, $PHP_LIBMBFL_LIBDIR, MBSTRING_SHARED_LIBADD)
+ ],[
+ AC_MSG_ERROR([Problem with libmbfl. Please check config.log for more information.])
+ ], [
+- -LPHP_LIBMBFL/lib
++ -L$PHP_LIBMBFL_LIBDIR
+ ])
+ fi
+ ])
+diff -Nru php-4.4.1.orig/ext/mcal/config.m4 php-4.4.1/ext/mcal/config.m4
+--- php-4.4.1.orig/ext/mcal/config.m4 2002-03-27 11:26:16.000000000 +0100
++++ php-4.4.1/ext/mcal/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -19,7 +19,7 @@
+ fi
+ done
+
+- for i in $MCAL_DIR $MCAL_DIR/mcal $MCAL_DIR/mcal/lib $MCAL_DIR/lib/mcal $MCAL_DIR/lib; do
++ for i in $MCAL_DIR $MCAL_DIR/mcal $MCAL_DIR/mcal/lib $MCAL_DIR/lib/mcal $MCAL_DIR/lib64/mcal $MCAL_DIR/lib $MCAL_DIR/lib64; do
+ if test -r "$i/libmcal.a"; then
+ MCAL_LIBRARY=$i
+ fi
+diff -Nru php-4.4.1.orig/ext/mcrypt/config.m4 php-4.4.1/ext/mcrypt/config.m4
+--- php-4.4.1.orig/ext/mcrypt/config.m4 2005-01-22 02:37:12.000000000 +0100
++++ php-4.4.1/ext/mcrypt/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -14,6 +14,12 @@
+ AC_MSG_ERROR(mcrypt.h not found. Please reinstall libmcrypt.)
+ fi
+
++ for j in lib64 lib; do
++ if test -d $MCRYPT_DIR/$j; then
++ MCRYPT_LIBDIR=$MCRYPT_DIR/$j
++ fi
++ done
++
+ PHP_CHECK_LIBRARY(mcrypt, mcrypt_module_open,
+ [
+ PHP_ADD_LIBRARY(ltdl,, MCRYPT_SHARED_LIBADD)
+@@ -23,7 +29,7 @@
+ [
+ AC_DEFINE(HAVE_MCRYPT_GENERIC_DEINIT,1,[ ])
+ ],[],[
+- -L$MCRYPT_DIR/lib -lltdl
++ -L$MCRYPT_LIBDIR -lltdl
+ ])
+
+ ],[
+@@ -35,7 +41,7 @@
+ [
+ AC_DEFINE(HAVE_MCRYPT_GENERIC_DEINIT,1,[ ])
+ ],[],[
+- -L$MCRYPT_DIR/lib
++ -L$MCRYPT_LIBDIR
+ ])
+ ],[
+ PHP_CHECK_LIBRARY(mcrypt, init_mcrypt,
+@@ -44,16 +50,16 @@
+ ],[
+ AC_MSG_ERROR([Sorry, I was not able to diagnose which libmcrypt version you have installed.])
+ ],[
+- -L$MCRYPT_DIR/lib
++ -L$MCRYPT_LIBDIR
+ ])
+ ],[
+- -L$MCRYPT_DIR/lib
++ -L$MCRYPT_LIBDIR
+ ])
+ ],[
+- -L$MCRYPT_DIR/lib -lltdl
++ -L$MCRYPT_LIBDIR -lltdl
+ ])
+
+- PHP_ADD_LIBRARY_WITH_PATH(mcrypt, $MCRYPT_DIR/lib, MCRYPT_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(mcrypt, $MCRYPT_LIBDIR, MCRYPT_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($MCRYPT_DIR/include)
+
+ PHP_NEW_EXTENSION(mcrypt, mcrypt.c, $ext_shared)
+diff -Nru php-4.4.1.orig/ext/mcve/config.m4 php-4.4.1/ext/mcve/config.m4
+--- php-4.4.1.orig/ext/mcve/config.m4 2004-12-08 07:48:11.000000000 +0100
++++ php-4.4.1/ext/mcve/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -67,8 +67,14 @@
+
+ CPPFLAGS=$saved_CPPFLAGS
+
++ for j in lib64 lib; do
++ if test -d $MCVE_DIR/$j; then
++ MCVE_LIBDIR=$MCVE_DIR/$j
++ fi
++ done
++
+ PHP_ADD_INCLUDE($MCVE_DIR/include)
+- PHP_ADD_LIBRARY_WITH_PATH(mcve, $MCVE_DIR/lib, MCVE_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(mcve, $MCVE_LIBDIR, MCVE_SHARED_LIBADD)
+
+ dnl Build test. Check for libmcve or libmonetra
+ dnl libmonetra_compat.h handle's MCVE_ -> M_ conversion
+diff -Nru php-4.4.1.orig/ext/mhash/config.m4 php-4.4.1/ext/mhash/config.m4
+--- php-4.4.1.orig/ext/mhash/config.m4 2003-10-01 04:54:01.000000000 +0200
++++ php-4.4.1/ext/mhash/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -14,8 +14,14 @@
+ AC_MSG_ERROR(Please reinstall libmhash - I cannot find mhash.h)
+ fi
+
++ for j in lib64 lib; do
++ if test -d $MHASH_DIR/$j; then
++ MHASH_LIBDIR=$MHASH_DIR/$j
++ fi
++ done
++
+ PHP_ADD_INCLUDE($MHASH_DIR/include)
+- PHP_ADD_LIBRARY_WITH_PATH(mhash, $MHASH_DIR/lib, MHASH_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(mhash, $MHASH_LIBDIR, MHASH_SHARED_LIBADD)
+
+ PHP_NEW_EXTENSION(mhash, mhash.c, $ext_shared)
+ PHP_SUBST(MHASH_SHARED_LIBADD)
+diff -Nru php-4.4.1.orig/ext/ming/config.m4 php-4.4.1/ext/ming/config.m4
+--- php-4.4.1.orig/ext/ming/config.m4 2003-07-11 09:48:33.000000000 +0200
++++ php-4.4.1/ext/ming/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -8,10 +8,12 @@
+ if test "$PHP_MING" != "no"; then
+ AC_CHECK_LIB(m, sin)
+
+- for i in $PHP_MING /usr/local /usr; do
+- if test -f $i/lib/libming.$SHLIB_SUFFIX_NAME -o -f $i/lib/libming.a; then
++ for j in lib64 lib; do
++ for i in $PHP_MING /usr/local /usr; do
++ if test -f $i/$j/libming.$SHLIB_SUFFIX_NAME -o -f $i/$j/libming.a; then
+ MING_DIR=$i
+- fi
++ fi
++ done
+ done
+
+ if test -z "$MING_DIR"; then
+@@ -28,16 +30,22 @@
+ AC_MSG_ERROR(Please reinstall ming distribution. ming.h not found.)
+ fi
+
++ for j in lib64 lib; do
++ if test -d $MING_DIR/$j; then
++ MING_LIBDIR=$MING_DIR/$j
++ fi
++ done
++
+ PHP_CHECK_LIBRARY(ming, Ming_useSWFVersion, [
+ AC_DEFINE(HAVE_MING,1,[ ])
+ ],[
+ AC_MSG_ERROR([Ming library 0.2a or greater required.])
+ ],[
+- -L$MING_DIR/lib
++ -L$MING_LIBDIR
+ ])
+
+ PHP_ADD_INCLUDE($MING_INC_DIR)
+- PHP_ADD_LIBRARY_WITH_PATH(ming, $MING_DIR/lib, MING_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(ming, $MING_LIBDIR, MING_SHARED_LIBADD)
+
+ AC_MSG_CHECKING([for destroySWFBlock])
+ AC_TRY_RUN([
+diff -Nru php-4.4.1.orig/ext/msession/config.m4 php-4.4.1/ext/msession/config.m4
+--- php-4.4.1.orig/ext/msession/config.m4 2002-03-12 17:25:11.000000000 +0100
++++ php-4.4.1/ext/msession/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -8,13 +8,17 @@
+ if test "$PHP_MSESSION" != "no"; then
+ if test -r $PHP_MSESSION/lib/libphoenix.a; then
+ PHOENIX_DIR=$PHP_MSESSION
++ PHOENIX_LIBDIR=$PHP_MSESSION/lib
+ else
+ AC_MSG_CHECKING(for msession in default path)
+- for i in /usr/local/phoenix /usr/local /usr; do
+- if test -r $i/lib/libphoenix.a; then
+- PHOENIX_DIR=$i
+- AC_MSG_RESULT(found in $i)
+- fi
++ for j in lib64 lib; do
++ for i in /usr/local/phoenix /usr/local /usr; do
++ if test -r $i/$j/libphoenix.a; then
++ PHOENIX_DIR=$i
++ PHOENIX_LIBDIR=$i/$j
++ AC_MSG_RESULT(found in $i)
++ fi
++ done
+ done
+ fi
+
+@@ -25,7 +29,7 @@
+
+
+ AC_DEFINE(HAVE_MSESSION, 1, [ ])
+- PHP_ADD_LIBRARY_WITH_PATH(phoenix, "$PHOENIX_DIR/lib", PHOENIX_LIB)
++ PHP_ADD_LIBRARY_WITH_PATH(phoenix, "$PHOENIX_LIBDIR", PHOENIX_LIB)
+ PHOENIX_INCLUDE="-I$PHOENIX_DIR"
+ PHP_SUBST(PHOENIX_LIB)
+
+diff -Nru php-4.4.1.orig/ext/mssql/config.m4 php-4.4.1/ext/mssql/config.m4
+--- php-4.4.1.orig/ext/mssql/config.m4 2004-12-08 19:59:11.000000000 +0100
++++ php-4.4.1/ext/mssql/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -19,6 +19,12 @@
+ fi
+ done
+
++ for j in lib64 lib; do
++ if test -d $FREETDS_INSTALLATION_DIR/$j; then
++ FREETDS_INSTALLATION_DIR_LIBDIR=$FREETDS_INSTALLATION_DIR/$j
++ fi
++ done
++
+ if test -z "$FREETDS_INSTALLATION_DIR"; then
+ AC_MSG_ERROR(Cannot find FreeTDS in known installation directories)
+ fi
+@@ -32,12 +38,12 @@
+ fi
+ fi
+
+- if test ! -r "$FREETDS_INSTALLATION_DIR/lib/libtds.a" && test ! -r "$FREETDS_INSTALLATION_DIR/lib/libtds.so"; then
+- AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR/lib/libtds.[a|so])
++ if test ! -r "$FREETDS_INSTALLATION_DIR_LIBDIR/libtds.a" && test ! -r "$FREETDS_INSTALLATION_DIR_LIBDIR/libtds.so"; then
++ AC_MSG_ERROR(Could not find $FREETDS_INSTALLATION_DIR_LIBDIR/libtds.[a|so])
+ fi
+
+ MSSQL_INCDIR=$FREETDS_INSTALLATION_DIR/include
+- MSSQL_LIBDIR=$FREETDS_INSTALLATION_DIR/lib
++ MSSQL_LIBDIR=$FREETDS_INSTALLATION_DIR_LIBDIR
+
+ PHP_ADD_INCLUDE($MSSQL_INCDIR)
+ PHP_ADD_LIBRARY_WITH_PATH(sybdb, $MSSQL_LIBDIR, MSSQL_SHARED_LIBADD)
+diff -Nru php-4.4.1.orig/ext/mysql/config.m4 php-4.4.1/ext/mysql/config.m4
+--- php-4.4.1.orig/ext/mysql/config.m4 2005-07-26 16:02:00.000000000 +0200
++++ php-4.4.1/ext/mysql/config.m4 2005-12-01 09:12:18.000000000 +0100
+@@ -121,7 +121,7 @@
+ ;;
+ esac
+
+- for i in lib lib/mysql; do
++ for i in lib64 lib64/mysql lib lib/mysql; do
+ MYSQL_LIB_CHK($i)
+ done
+
+@@ -132,13 +132,18 @@
+ PHP_CHECK_LIBRARY($MY_LIBNAME, mysql_close, [ ],
+ [
+ if test "$PHP_ZLIB_DIR" != "no"; then
++ for j in lib64 lib; do
++ if test -d $PHP_ZLIB_DIR/$j; then
++ PHP_ZLIB_LIBDIR=$PHP_ZLIB_DIR/$j
++ fi
++ done
+ PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, MYSQL_SHARED_LIBADD)
+ PHP_CHECK_LIBRARY($MY_LIBNAME, mysql_error, [], [
+ AC_MSG_ERROR([mysql configure failed. Please check config.log for more information.])
+ ], [
+- -L$PHP_ZLIB_DIR/lib -L$MYSQL_LIB_DIR
++ -L$PHP_ZLIB_LIBDIR -L$MYSQL_LIB_DIR
+ ])
+- MYSQL_LIBS="-L$PHP_ZLIB_DIR/lib -lz"
++ MYSQL_LIBS="-L$PHP_ZLIB_LIBDIR -lz"
+ else
+ PHP_ADD_LIBRARY(z,, MYSQL_SHARED_LIBADD)
+ PHP_CHECK_LIBRARY($MY_LIBNAME, mysql_errno, [], [
+diff -Nru php-4.4.1.orig/ext/ncurses/config.m4 php-4.4.1/ext/ncurses/config.m4
+--- php-4.4.1.orig/ext/ncurses/config.m4 2003-12-09 21:33:22.000000000 +0100
++++ php-4.4.1/ext/ncurses/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -38,20 +38,26 @@
+ LIBNAME=ncurses
+ LIBSYMBOL=initscr
+
++ for j in lib64 lib; do
++ if test -d $NCURSES_DIR/$j; then
++ NCURSES_LIBDIR=$NCURSES_DIR/$j
++ fi
++ done
++
+ PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL, [
+ AC_DEFINE(HAVE_NCURSESLIB,1,[ ])
+- PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $NCURSES_DIR/lib, NCURSES_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $NCURSES_LIBDIR, NCURSES_SHARED_LIBADD)
+
+ PHP_CHECK_LIBRARY(panel, new_panel, [
+ AC_DEFINE(HAVE_NCURSES_PANEL,1,[ ])
+- PHP_ADD_LIBRARY_WITH_PATH(panel, $NCURSES_DIR/lib, NCURSES_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(panel, $NCURSES_LIBDIR, NCURSES_SHARED_LIBADD)
+ ], [], [
+- -L$NCURSES_DIR/lib -l$LIBNAME -lm
++ -L$NCURSES_LIBDIR -l$LIBNAME -lm
+ ])
+ ], [
+ AC_MSG_ERROR(Wrong ncurses lib version or lib not found)
+ ], [
+- -L$NCURSES_DIR/lib -lm
++ -L$NCURSES_LIBDIR -lm
+ ])
+
+ AC_CHECK_LIB($LIBNAME, color_set, [AC_DEFINE(HAVE_NCURSES_COLOR_SET, 1, [ ])])
+diff -Nru php-4.4.1.orig/ext/odbc/config.m4 php-4.4.1/ext/odbc/config.m4
+--- php-4.4.1.orig/ext/odbc/config.m4 2005-04-22 01:02:23.000000000 +0200
++++ php-4.4.1/ext/odbc/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -47,19 +47,8 @@
+ #
+ # Check for the library files, and setup the ODBC_LIBS path...
+ #
+-if test ! -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -a \
+- ! -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a; then
+- #
+- # we have an error and should bail out, as we can't find the libs!
+- #
+- echo ""
+- echo "*********************************************************************"
+- echo "* Unable to locate $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so or $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a"
+- echo "* Please correct this by creating the following links and reconfiguring:"
+- echo "* $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a -> $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a"
+- echo "* $1/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -> $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so"
+- echo "*********************************************************************"
+-else
++if test -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -a \
++ -f $1/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a; then
+ ODBC_LFLAGS=-L$1
+ ODBC_LIBS=-l${ac_solid_prefix}${ac_solid_os}${ac_solid_version}
+ fi
+@@ -100,8 +89,12 @@
+ withval=/usr/local
+ fi
+ if test "$withval" != "no"; then
++ for i in lib64 lib; do
++ ADABAS_LIBDIR=$withval/$i
++ test -f "$ADABAS_LIBDIR/odbclib.a" && break
++ done
+ PHP_ADD_INCLUDE($withval/incl)
+- PHP_ADD_LIBPATH($withval/lib)
++ PHP_ADD_LIBPATH($ADABAS_LIBDIR)
+ ODBC_OBJS="$withval/lib/odbclib.a"
+ ODBC_LIB="$abs_builddir/ext/odbc/libodbc_adabas.a"
+ $srcdir/build/shtool mkdir -f -p ext/odbc
+@@ -132,8 +125,12 @@
+ withval=/usr/local
+ fi
+ if test "$withval" != "no"; then
++ for i in lib64 lib; do
++ SAPDB_LIBDIR=$withval/$i
++ test -f "$SAPDB_LIBDIR/libsqlod.a" -o -f "$SAPDB_LIBDIR/libsqlod.$SHLIB_SUFFIX_NAME" && break
++ done
+ PHP_ADD_INCLUDE($withval/incl)
+- PHP_ADD_LIBPATH($withval/lib)
++ PHP_ADD_LIBPATH($SAPDB_LIBDIR)
+ PHP_ADD_LIBRARY(sqlod)
+ ODBC_TYPE=sapdb
+ AC_DEFINE(HAVE_SAPDB,1,[ ])
+@@ -158,19 +155,36 @@
+ withval=/usr/local/solid
+ fi
+ if test "$withval" != "no"; then
+- ODBC_INCDIR=$withval/include
+- ODBC_LIBDIR=$withval/lib
+- ODBC_INCLUDE=-I$ODBC_INCDIR
+- ODBC_TYPE=solid
+- if test -f $ODBC_LIBDIR/soc*35.a; then
+- AC_DEFINE(HAVE_SOLID_35,1,[ ])
+- elif test -f $ODBC_LIBDIR/scl*30.a; then
+- AC_DEFINE(HAVE_SOLID_30,1,[ ])
+- elif test -f $ODBC_LIBDIR/scl*23.a; then
+- AC_DEFINE(HAVE_SOLID,1,[ ])
++ for i in lib64 lib; do
++ SOLID_LIBDIR=$withval/$i
++ ODBC_INCDIR=$withval/include
++ ODBC_LIBDIR=$withval/$j
++ ODBC_INCLUDE=-I$ODBC_INCDIR
++ ODBC_TYPE=solid
++ if test -f $ODBC_LIBDIR/soc*35.a; then
++ AC_DEFINE(HAVE_SOLID_35,1,[ ])
++ elif test -f $ODBC_LIBDIR/scl*30.a; then
++ AC_DEFINE(HAVE_SOLID_30,1,[ ])
++ elif test -f $ODBC_LIBDIR/scl*23.a; then
++ AC_DEFINE(HAVE_SOLID,1,[ ])
++ fi
++ AC_MSG_RESULT(yes)
++ ODBC_LIBS=
++ AC_FIND_SOLID_LIBS($ODBC_LIBDIR)
++ test -n "$ODBC_LIBS" && break
++ done
++ if test -z "$ODBC_LIBS"; then
++ #
++ # we have an error and should bail out, as we can't find the libs!
++ #
++ echo ""
++ echo "*********************************************************************"
++ echo "* Unable to locate ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so or ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a"
++ echo "* Please correct this by creating the following links and reconfiguring:"
++ echo "* ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a -> ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.a"
++ echo "* ODBC_LIBDIR/${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so -> ODBC_LIBDIR/lib${ac_solid_prefix}${ac_solid_os}${ac_solid_version}.so"
++ echo "*********************************************************************"
+ fi
+- AC_MSG_RESULT(yes)
+- AC_FIND_SOLID_LIBS($ODBC_LIBDIR)
+ else
+ AC_MSG_RESULT(no)
+ fi
+@@ -400,11 +414,15 @@
+ withval=/usr/local
+ fi
+ if test "$withval" != "no"; then
+- PHP_ADD_LIBRARY_WITH_PATH(iodbc, $withval/lib)
++ for i in lib64 lib; do
++ IODBC_LIBDIR=$withval/$i
++ test -f "$IODBC_LIBDIR/libiodbc.a" -o -f "$IODBC_LIBDIR/libiodbc.$SHLIB_SUFFIX_NAME" && break
++ done
++ PHP_ADD_LIBRARY_WITH_PATH(iodbc, $IODBC_LIBDIR)
+ PHP_ADD_INCLUDE($withval/include, 1)
+ ODBC_TYPE=iodbc
+ ODBC_INCLUDE=-I$withval/include
+- ODBC_LFLAGS=-L$withval/lib
++ ODBC_LFLAGS=-L$IODBC_LIBDIR
+ ODBC_LIBS=-liodbc
+ AC_DEFINE(HAVE_IODBC,1,[ ])
+ AC_DEFINE(HAVE_ODBC2,1,[ ])
+@@ -429,8 +447,11 @@
+ withval=/usr/local/easysoft/oob/client
+ fi
+ if test "$withval" != "no"; then
++ for i in lib64 lib; do
++ ODBC_LIBDIR=$withval/$i
++ test -f "$ODBC_LIBDIR/libesoobclient.a" -o -f "$ODBC_LIBDIR/libesoobclient.$SHLIB_SUFFIX_NAME" && break
++ done
+ ODBC_INCDIR=$withval/include
+- ODBC_LIBDIR=$withval/lib
+ ODBC_LFLAGS=-L$ODBC_LIBDIR
+ ODBC_INCLUDE=-I$ODBC_INCDIR
+ ODBC_LIBS=-lesoobclient
+@@ -456,8 +477,11 @@
+ withval=/usr/local
+ fi
+ if test "$withval" != "no"; then
++ for i in lib64 lib; do
++ ODBC_LIBDIR=$withval/$i
++ test -f "$ODBC_LIBDIR/libodbc.a" -o -f "$ODBC_LIBDIR/libodbc.$SHLIB_SUFFIX_NAME" && break
++ done
+ ODBC_INCDIR=$withval/include
+- ODBC_LIBDIR=$withval/lib
+ ODBC_LFLAGS=-L$ODBC_LIBDIR
+ ODBC_INCLUDE=-I$ODBC_INCDIR
+ ODBC_LIBS=-lodbc
+diff -Nru php-4.4.1.orig/ext/pcre/config.m4 php-4.4.1/ext/pcre/config.m4
+--- php-4.4.1.orig/ext/pcre/config.m4 2005-08-09 19:41:56.000000000 +0200
++++ php-4.4.1/ext/pcre/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -25,7 +25,7 @@
+ AC_MSG_ERROR([Could not find pcre.h in $PHP_PCRE_REGEX])
+ fi
+
+- for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/lib; do
++ for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/lib64 $PHP_PCRE_REGEX/lib; do
+ test -f $j/libpcre.a -o -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
+ done
+
+diff -Nru php-4.4.1.orig/ext/pgsql/config.m4 php-4.4.1/ext/pgsql/config.m4
+--- php-4.4.1.orig/ext/pgsql/config.m4 2005-07-25 01:11:45.000000000 +0200
++++ php-4.4.1/ext/pgsql/config.m4 2005-12-01 09:13:30.000000000 +0100
+@@ -44,7 +44,7 @@
+ fi
+ done
+
+- for j in lib lib/pgsql lib/postgres lib/postgresql ""; do
++ for j in lib64 lib lib64/pgsql lib/pgsql lib64/postgres lib/postgres lib64/postgresql lib/postgresql ""; do
+ if test -f "$i/$j/libpq.so" || test -f "$i/$j/libpq.a"; then
+ PGSQL_LIBDIR=$i/$j
+ fi
+diff -Nru php-4.4.1.orig/ext/pspell/config.m4 php-4.4.1/ext/pspell/config.m4
+--- php-4.4.1.orig/ext/pspell/config.m4 2005-02-17 04:51:50.000000000 +0100
++++ php-4.4.1/ext/pspell/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -27,7 +27,11 @@
+ AC_MSG_ERROR(Cannot find pspell)
+ fi
+
+- PSPELL_LIBDIR=$PSPELL_DIR/lib
++ for j in lib64 lib; do
++ if test -d $PSPELL_DIR/$j; then
++ PSPELL_LIBDIR=$PSPELL_DIR/$j
++ fi
++ done
+
+ PHP_ADD_LIBRARY_WITH_PATH(pspell, $PSPELL_LIBDIR, PSPELL_SHARED_LIBADD)
+
+diff -Nru php-4.4.1.orig/ext/readline/config.m4 php-4.4.1/ext/readline/config.m4
+--- php-4.4.1.orig/ext/readline/config.m4 2003-10-01 04:54:04.000000000 +0200
++++ php-4.4.1/ext/readline/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -29,22 +29,28 @@
+ ])
+ ])
+
++ for j in lib64 lib; do
++ if test -d $READLINE_DIR/$j; then
++ READLINE_LIBDIR=$READLINE_DIR/$j
++ fi
++ done
++
+ PHP_CHECK_LIBRARY(readline, readline,
+ [
+- PHP_ADD_LIBRARY_WITH_PATH(readline, $READLINE_DIR/lib, READLINE_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(readline, $READLINE_LIBDIR, READLINE_SHARED_LIBADD)
+ ], [
+ AC_MSG_ERROR(readline library not found)
+ ], [
+- -L$READLINE_DIR/lib
++ -L$READLINE_LIBDIR
+ ])
+
+ PHP_CHECK_LIBRARY(history, add_history,
+ [
+- PHP_ADD_LIBRARY_WITH_PATH(history, $READLINE_DIR/lib, READLINE_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(history, $READLINE_LIBDIR, READLINE_SHARED_LIBADD)
+ ], [
+ AC_MSG_ERROR(history library required by readline not found)
+ ], [
+- -L$READLINE_DIR/lib
++ -L$READLINE_LIBDIR
+ ])
+
+ PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli)
+@@ -73,13 +79,19 @@
+ ])
+ ])
+
++ for j in lib64 lib; do
++ if test -d $LIBEDIT_DIR/$j; then
++ LIBEDIT_LIBDIR=$LIBEDIT_DIR/$j
++ fi
++ done
++
+ PHP_CHECK_LIBRARY(edit, readline,
+ [
+- PHP_ADD_LIBRARY_WITH_PATH(edit, $LIBEDIT_DIR/lib, READLINE_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(edit, $LIBEDIT_LIBDIR, READLINE_SHARED_LIBADD)
+ ], [
+ AC_MSG_ERROR(edit library required by readline not found)
+ ], [
+- -L$READLINE_DIR/lib
++ -L$READLINE_LIBDIR
+ ])
+
+ PHP_NEW_EXTENSION(readline, readline.c, $ext_shared, cli)
+diff -Nru php-4.4.1.orig/ext/session/config.m4 php-4.4.1/ext/session/config.m4
+--- php-4.4.1.orig/ext/session/config.m4 2003-10-01 04:54:06.000000000 +0200
++++ php-4.4.1/ext/session/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -24,8 +24,14 @@
+ if test -z "$MM_DIR" ; then
+ AC_MSG_ERROR(cannot find mm library)
+ fi
+-
+- PHP_ADD_LIBRARY_WITH_PATH(mm, $MM_DIR/lib, SESSION_SHARED_LIBADD)
++
++ for j in lib64 lib; do
++ if test -d $MM_DIR/$j; then
++ MM_LIBDIR=$MM_DIR/$j
++ fi
++ done
++
++ PHP_ADD_LIBRARY_WITH_PATH(mm, $MM_LIBDIR, SESSION_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($MM_DIR/include)
+ AC_DEFINE(HAVE_LIBMM, 1, [Whether you have libmm])
+ fi
+diff -Nru php-4.4.1.orig/ext/snmp/config.m4 php-4.4.1/ext/snmp/config.m4
+--- php-4.4.1.orig/ext/snmp/config.m4 2003-09-23 10:16:47.000000000 +0200
++++ php-4.4.1/ext/snmp/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -45,8 +45,8 @@
+ test -f $i/snmp/snmp.h && SNMP_INCDIR=$i/snmp
+ test -f $i/snmp/include/ucd-snmp/snmp.h && SNMP_INCDIR=$i/snmp/include/ucd-snmp
+ done
+- for i in /usr /usr/snmp /usr/local /usr/local/snmp; do
+- test -f $i/lib/libsnmp.a -o -f $i/lib/libsnmp.$SHLIB_SUFFIX_NAME && SNMP_LIBDIR=$i/lib
++ for i in /usr/lib /usr/lib64 /usr/snmp/lib /usr/local/lib /usr/local/snmp/lib; do
++ test -f $i/libsnmp.a -o -f $i/libsnmp.$SHLIB_SUFFIX_NAME && SNMP_LIBDIR=$i
+ done
+ else
+ SNMP_INCDIR=$PHP_SNMP/include
+diff -Nru php-4.4.1.orig/ext/xml/config.m4 php-4.4.1/ext/xml/config.m4
+--- php-4.4.1.orig/ext/xml/config.m4 2004-12-20 21:38:18.000000000 +0100
++++ php-4.4.1/ext/xml/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -33,6 +33,10 @@
+ for i in $PHP_XML $PHP_EXPAT_DIR; do
+ if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.$SHLIB_SUFFIX_NAME ; then
+ EXPAT_DIR=$i
++ EXPAT_LIBDIR=$i/lib
++ elif test -f $i/lib64/libexpat.a -o -f $i/lib64/libexpat.$SHLIB_SUFFIX_NAME ; then
++ EXPAT_DIR=$i
++ EXPAT_LIBDIR=$i/lib64
+ fi
+ done
+
+@@ -41,7 +45,7 @@
+ fi
+
+ PHP_ADD_INCLUDE($EXPAT_DIR/include)
+- PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/lib, XML_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_LIBDIR, XML_SHARED_LIBADD)
+ PHP_SUBST(XML_SHARED_LIBADD)
+ fi
+ fi
+diff -Nru php-4.4.1.orig/ext/xmlrpc/config.m4 php-4.4.1/ext/xmlrpc/config.m4
+--- php-4.4.1.orig/ext/xmlrpc/config.m4 2003-10-03 07:25:43.000000000 +0200
++++ php-4.4.1/ext/xmlrpc/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -29,6 +29,12 @@
+ PHP_ADD_INCLUDE($i/include)
+ testval=yes
+ break
++ elif test -f $i/lib64/libexpat.a -o -f $i/lib64/libexpat.$SHLIB_SUFFIX_NAME; then
++ AC_DEFINE(HAVE_LIBEXPAT2,1,[ ])
++ PHP_ADD_LIBRARY_WITH_PATH(expat, $i/lib64, XMLRPC_SHARED_LIBADD)
++ PHP_ADD_INCLUDE($i/include)
++ testval=yes
++ break
+ fi
+ done
+
+@@ -87,6 +93,12 @@
+ AC_MSG_ERROR(Please reinstall the XMLRPC-EPI distribution)
+ fi
+
++ for j in lib64 lib; do
++ if test -d $XMLRPC_DIR/$j; then
++ XMLRPC_LIBDIR=$XMLRPC_DIR/$j
++ fi
++ done
++
+ PHP_ADD_INCLUDE($XMLRPC_DIR)
+- PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_DIR/lib, XMLRPC_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_LIBDIR, XMLRPC_SHARED_LIBADD)
+ fi
+diff -Nru php-4.4.1.orig/ext/xslt/config.m4 php-4.4.1/ext/xslt/config.m4
+--- php-4.4.1.orig/ext/xslt/config.m4 2004-08-18 07:14:16.000000000 +0200
++++ php-4.4.1/ext/xslt/config.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -104,6 +104,12 @@
+ PHP_ADD_LIBRARY_WITH_PATH(expat, $i/lib, XSLT_SHARED_LIBADD)
+ found_expat=yes
+ break
++ elif test -f $i/lib64/libexpat.a -o -f $i/lib64/libexpat.$SHLIB_SUFFIX_NAME; then
++ AC_DEFINE(HAVE_LIBEXPAT2, 1, [ ])
++ PHP_ADD_INCLUDE($i/include)
++ PHP_ADD_LIBRARY_WITH_PATH(expat, $i/lib64, XSLT_SHARED_LIBADD)
++ found_expat=yes
++ break
+ fi
+ done
+
+@@ -124,29 +130,38 @@
+ ])
+
+ if test "$PHP_SABLOT_JS" != "no"; then
+- for i in $PHP_SABLOT_JS /usr/local /usr; do
+- if test -f $i/lib/libjs.a -o -f $i/lib/libjs.$SHLIB_SUFFIX_NAME; then
+- PHP_SABLOT_JS_DIR=$i
+- break
+- fi
++ for j in lib64 lib; do
++ for i in $PHP_SABLOT_JS /usr/local /usr; do
++ if test -f $i/$j/libjs.a -o -f $i/$j/libjs.$SHLIB_SUFFIX_NAME; then
++ PHP_SABLOT_JS_DIR=$i
++ PHP_SABLOT_JS_LIBDIR=$i/$j
++ break
++ fi
++ done
+ done
+
+ PHP_CHECK_LIBRARY(js, JS_GetRuntime,
+ [
+- PHP_ADD_LIBRARY_WITH_PATH(js, $PHP_SABLOT_JS_DIR/lib, XSLT_SHARED_LIBADD)
+- PHP_SABLOT_JS_LIBS="-L$PHP_SABLOT_JS_DIR/lib -ljs"
++ PHP_ADD_LIBRARY_WITH_PATH(js, $PHP_SABLOT_JS_LIBDIR, XSLT_SHARED_LIBADD)
++ PHP_SABLOT_JS_LIBS="-L$PHP_SABLOT_JS_LIBDIR -ljs"
+ ], [
+ AC_MSG_ERROR([libjs not found. Please check config.log for more information.])
+ ], [
+- -L$PHP_SABLOT_JS_DIR/lib
++ -L$PHP_SABLOT_JS_LIBDIR
+ ])
+ fi
+
++ for j in lib64 lib; do
++ if test -d $XSLT_DIR/$j; then
++ XSLT_LIBDIR=$XSLT_DIR/$j
++ fi
++ done
++
+ PHP_CHECK_LIBRARY(sablot, SablotSetEncoding,
+ [
+ AC_DEFINE(HAVE_SABLOT_SET_ENCODING, 1, [ ])
+ ], [], [
+- -L$XSLT_DIR/lib $PHP_SABLOT_JS_LIBS
++ -L$XSLT_LIBDIR $PHP_SABLOT_JS_LIBS
+ ])
+
+ dnl SablotSetOptions implemented in Sablotron CVS > 2002/10/31
+@@ -154,14 +169,14 @@
+ [
+ AC_DEFINE(HAVE_SABLOT_GET_OPTIONS, 1, [Whether Sablotron supports SablotGetOptions])
+ ], [], [
+- -L$XSLT_DIR/lib $PHP_SABLOT_JS_LIBS
++ -L$XSLT_LIBDIR $PHP_SABLOT_JS_LIBS
+ ])
+
+ AC_DEFINE(HAVE_SABLOT_BACKEND, 1, [ ])
+ fi
+
+ PHP_ADD_INCLUDE($XSLT_DIR/include)
+- PHP_ADD_LIBRARY_WITH_PATH($XSLT_LIBNAME, $XSLT_DIR/lib, XSLT_SHARED_LIBADD)
++ PHP_ADD_LIBRARY_WITH_PATH($XSLT_LIBNAME, $XSLT_LIBDIR, XSLT_SHARED_LIBADD)
+
+ AC_DEFINE(HAVE_XSLT, 1, [ ])
+ fi
+diff -Nru php-4.4.1.orig/ext/zlib/config0.m4 php-4.4.1/ext/zlib/config0.m4
+--- php-4.4.1.orig/ext/zlib/config0.m4 2003-07-02 01:54:44.000000000 +0200
++++ php-4.4.1/ext/zlib/config0.m4 2005-12-01 08:55:02.000000000 +0100
+@@ -36,15 +36,21 @@
+ AC_MSG_ERROR(Cannot find libz)
+ fi
+
++ for j in lib64 lib; do
++ if test -d $ZLIB_DIR/$j; then
++ ZLIB_LIBDIR=$ZLIB_DIR/$j
++ fi
++ done
++
+ PHP_CHECK_LIBRARY(z, gzgets, [
+ AC_DEFINE(HAVE_ZLIB,1,[ ])
+ ],[
+ AC_MSG_ERROR(ZLIB extension requires zlib >= 1.0.9)
+ ],[
+- -L$ZLIB_DIR/lib
++ -L$ZLIB_LIBDIR
+ ])
+
+- PHP_ADD_LIBPATH($ZLIB_DIR/lib, ZLIB_SHARED_LIBADD)
++ PHP_ADD_LIBPATH($ZLIB_LIBDIR, ZLIB_SHARED_LIBADD)
+
+ PHP_ZLIB_DIR=$ZLIB_DIR
+ PHP_ADD_LIBRARY(z,, ZLIB_SHARED_LIBADD)