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

Patch pecl-oauth-1.2.3-with-curl.patch for oauth Bug #64025

Patch version 2013-01-18 17:38 UTC

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

Developer: mattsch@gmail.com

diff -r -u oauth-1.2.3-orig/config.m4 oauth-1.2.3/config.m4
--- oauth-1.2.3-orig/config.m4	2013-01-17 18:44:22.369435642 -0600
+++ oauth-1.2.3/config.m4	2013-01-18 00:14:44.673460894 -0600
@@ -5,27 +5,39 @@
 PHP_ARG_ENABLE(oauth, for oauth support,
 [  --enable-oauth          Include oauth support])
 
+AC_ARG_WITH([curl],
+    AS_HELP_STRING([--without-curl], [Ignore presence of cURL and disable it]))
+
 if test "$PHP_OAUTH" != "no"; then
   PHP_SUBST(OAUTH_SHARED_LIBADD)
 
   PHP_NEW_EXTENSION(oauth, oauth.c provider.c, $ext_shared)
   CFLAGS="$CFLAGS -Wall -g"
 
-  AC_MSG_CHECKING(for cURL in default path)
-  for i in /usr/local /usr; do
-    if test -r $i/include/curl/easy.h; then
-      CURL_DIR=$i
-      AC_MSG_RESULT(found in $i)
-      break
-    fi
-  done
-
-  if test -z "$CURL_DIR"; then
-    AC_MSG_RESULT(cURL not found, cURL support disabled)
-  else
-    PHP_ADD_LIBRARY(curl,,OAUTH_SHARED_LIBADD)
-    AC_DEFINE(OAUTH_USE_CURL, 1, [Whether cURL is present and should be used])
-  fi
+  AS_IF([test "x$with_curl" != "xno"],
+      [
+        AC_MSG_CHECKING(for cURL in default path)
+        have_curl=no
+        for i in /usr/local /usr; do
+          if test -r $i/include/curl/easy.h; then
+            have_curl=yes
+            CURL_DIR=$i
+            AC_MSG_RESULT(found in $i)
+            break
+          fi
+        done
+      ],
+      [have_curl=no])
+
+  AS_IF([test "x$have_curl" = "xyes"],
+      [
+        PHP_ADD_LIBRARY(curl,,OAUTH_SHARED_LIBADD)
+        AC_DEFINE(OAUTH_USE_CURL, 1, [Whether cURL is present and should be used])
+      ],
+      [AS_IF([test "x$with_curl" = "xyes"],
+             [AC_MSG_ERROR([cURL requested but not found])
+      ])
+  ])
 
   PHP_ADD_EXTENSION_DEP(oauth, hash)
 fi
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 15:01:36 2024 UTC