php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch raphf_and_propro_devel_m4 for pecl_http Bug #67622

Patch version 2014-07-17 06:40 UTC

Return to Bug #67622 | Download this patch
Patch Revisions:

Developer: pajoye@php.net

diff --git a/config9.m4 b/config9.m4
index ce63132..60e6006 100644
--- a/config9.m4
+++ b/config9.m4
@@ -334,18 +334,25 @@ dnl RAPHF
 dnl ----
 	HTTP_HAVE_PHP_EXT([raphf], [
 		AC_MSG_CHECKING([for php_raphf.h])
-		HTTP_EXT_RAPHF_INCDIR=
-		for i in `echo $INCLUDES | $SED -e's/-I//g'` $abs_srcdir ../raphf; do
-			if test -d $i; then
-				if test -f $i/php_raphf.h; then
-					HTTP_EXT_RAPHF_INCDIR=$i
-					break
-				elif test -f $i/ext/raphf/php_raphf.h; then
-					HTTP_EXT_RAPHF_INCDIR=$i/ext/raphf
-					break
-				fi
-			fi
-		done
+        PHP_INC_DIR=`php-config --include-dir`
+        if test -f $PHP_INC_DIR/ext/raphf/php_raphf.h; then
+            HTTP_EXT_RAPHF_INCDIR=$PHP_INC_DIR/ext/raphf
+        fi
+
+		if test "x$HTTP_EXT_RAPHF_INCDIR" = "x"; then
+    		HTTP_EXT_RAPHF_INCDIR=
+	    	for i in `echo $INCLUDES | $SED -e's/-I//g'` $abs_srcdir ../raphf; do
+		    	if test -d $i; then
+			    	if test -f $i/php_raphf.h; then
+				    	HTTP_EXT_RAPHF_INCDIR=$i
+					    break
+				    elif test -f $i/ext/raphf/php_raphf.h; then
+					    HTTP_EXT_RAPHF_INCDIR=$i/ext/raphf
+					    break
+				    fi
+			    fi
+		    done
+        fi
 		if test "x$HTTP_EXT_RAPHF_INCDIR" = "x"; then
 			AC_MSG_ERROR([not found])
 		else
@@ -355,30 +362,40 @@ dnl ----
 		fi
 	])
 
+
 dnl ----
 dnl PROPRO
 dnl ----
 	HTTP_HAVE_PHP_EXT([propro], [
 		AC_MSG_CHECKING([for php_propro.h])
-		HTTP_EXT_PROPRO_INCDIR=
-		for i in `echo $INCLUDES | $SED -e's/-I//g'` $abs_srcdir ../propro; do
-			if test -d $i; then
-				if test -f $i/php_propro.h; then
-					HTTP_EXT_PROPRO_INCDIR=$i
-					break
-				elif test -f $i/ext/propro/php_propro.h; then
-					HTTP_EXT_PROPRO_INCDIR=$i/ext/propro
-					break
-				fi
-			fi
-		done
+        PHP_INC_DIR=`php-config --include-dir`
+        if test -f $PHP_INC_DIR/ext/propro/php_propro.h; then
+            HTTP_EXT_PROPRO_INCDIR=$PHP_INC_DIR/ext/raphf
+        fi
+
+
 		if test "x$HTTP_EXT_PROPRO_INCDIR" = "x"; then
-			AC_MSG_ERROR([not found])
-		else
-			AC_MSG_RESULT([$HTTP_EXT_PROPRO_INCDIR])
-			AC_DEFINE([PHP_HTTP_HAVE_PHP_PROPRO_H], [1], [Have ext/propro support])
-			PHP_ADD_INCLUDE([$HTTP_EXT_PROPRO_INCDIR])
-		fi
+
+		    HTTP_EXT_PROPRO_INCDIR=
+		    for i in `echo $INCLUDES | $SED -e's/-I//g'` $abs_srcdir ../propro; do
+		    	if test -d $i; then
+		    		if test -f $i/php_propro.h; then
+		    			HTTP_EXT_PROPRO_INCDIR=$i
+		    			break
+		    		elif test -f $i/ext/propro/php_propro.h; then
+		    			HTTP_EXT_PROPRO_INCDIR=$i/ext/propro
+	    				break
+	    			fi
+			fi
+	    	done
+    		if test "x$HTTP_EXT_PROPRO_INCDIR" = "x"; then
+	    		AC_MSG_ERROR([not found])
+	    	else
+		    	AC_MSG_RESULT([$HTTP_EXT_PROPRO_INCDIR])
+		    	AC_DEFINE([PHP_HTTP_HAVE_PHP_PROPRO_H], [1], [Have ext/propro support])
+		    	PHP_ADD_INCLUDE([$HTTP_EXT_PROPRO_INCDIR])
+	    	fi
+        fi
 	])
 
 PHP_ARG_WITH([http-shared-deps], [whether to depend on extensions which have been built shared],
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Sep 25 14:03:44 2022 UTC