summaryrefslogtreecommitdiff
path: root/dev-php/pecl-oauth/files/1.2.3-withcurl.patch
blob: 5069ae92b14638492feea13995161feecb0037aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From 1b68ce035883f1ae186d82682fbbc5ea7d1834b3 Mon Sep 17 00:00:00 2001
From: John Jawed <jawed@php.net>
Date: Fri, 18 Jan 2013 20:28:05 +0000
Subject: [PATCH] Bug 64025 (patch via mattsch at gmail dot com)

git-svn-id: https://svn.php.net/repository/pecl/oauth/trunk@329234 c90b9560-bf6c-de11-be94-00142212c4b1
---
 config.m4 | 40 ++++++++++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 14 deletions(-)

diff --git a/config.m4 b/config.m4
index 832c577..48e2608 100644
--- a/config.m4
+++ b/config.m4
@@ -5,27 +5,39 @@ dnl
 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
+  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])
 
-  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$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
-- 
2.1.4