summaryrefslogtreecommitdiff
path: root/cfitsio/0001-cfitsio-autoconf-disable-curl.patch
blob: bd0189b38cc2dbcc8556f5e25c4a8c99f52e408a (plain) (blame)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
Only in b/cfitsio: autom4te.cache
diff --recursive -u -p a/cfitsio/configure b/cfitsio/configure
--- a/cfitsio/configure	2018-05-09 15:16:00.000000000 -0400
+++ b/cfitsio/configure	2018-08-06 15:42:35.000000000 -0400
@@ -710,6 +710,7 @@ enable_reentrant
 enable_sse2
 enable_ssse3
 enable_hera
+enable_curl
 with_bzip2
 with_gsiftp
 with_gsiftp_flavour
@@ -1341,6 +1342,7 @@ Optional Features:
   --enable-ssse3          Enable use of instructions in the SSSE3 extended
                           instruction set
   --enable-hera           Build for HERA (ASD use only)
+  --disable-curl          Disable use of cURL library (HTTPS)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -2264,6 +2266,13 @@ if test "x$BUILD_HERA" = xyes; then
 
 fi
 
+# Check whether --enable-curl was given.
+if test "${enable_curl+set}" = set; then :
+  enableval=$enable_curl;  if test $enableval = yes; then CURL_DISABLED=yes; fi
+
+fi
+
+
 # Optional support for bzip2 compression:
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -4780,17 +4789,18 @@ if test "x$CFITSIO_SHLIB" = x; then CFIT
 
 # Curl library (will be pulled in to the shared CFITSIO library):
 # ---------------------------------------------------------------
-CURL_LIB=""
-CURL_INC=""
-# Use curl-config to get compiler & linker flags, if available.
-# On Macs, prefer XCode curl-config, and reject MacPorts version
-# until further notice to prevent build errors:
-if test "x$EXT" = xdarwin -a -x /usr/bin/curl-config; then
-  CURLCONFIG="/usr/bin/curl-config"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for curl-config... choosing /usr/bin/curl-config on Mac" >&5
+if test "x$CURL_DISABLED" != x; then
+  CURL_LIB=""
+  CURL_INC=""
+  # Use curl-config to get compiler & linker flags, if available.
+  # On Macs, prefer XCode curl-config, and reject MacPorts version
+  # until further notice to prevent build errors:
+  if test "x$EXT" = xdarwin -a -x /usr/bin/curl-config; then
+    CURLCONFIG="/usr/bin/curl-config"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for curl-config... choosing /usr/bin/curl-config on Mac" >&5
 $as_echo "checking for curl-config... choosing /usr/bin/curl-config on Mac" >&6; }
-else
-  # Extract the first word of "curl-config", so it can be a program name with args.
+  else
+    # Extract the first word of "curl-config", so it can be a program name with args.
 set dummy curl-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
@@ -4844,30 +4854,34 @@ $as_echo "no" >&6; }
 fi
 
 
-fi
-if test "x$CURLCONFIG" != x; then
-  CURL_LIB=`$CURLCONFIG --libs`
-  CURL_INC=`$CURLCONFIG --cflags`
-  # Also reject anaconda curl on Macs until further notice:
-  if test "x$EXT" = xdarwin -a `echo $CURL_LIB $CURL_INC | grep -ci anaconda` -gt 0; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Rejecting Anaconda curl. Disabling HTTPS support." >&5
+  fi
+  if test "x$CURLCONFIG" != x; then
+    CURL_LIB=`$CURLCONFIG --libs`
+    CURL_INC=`$CURLCONFIG --cflags`
+    # Also reject anaconda curl on Macs until further notice:
+    if test "x$EXT" = xdarwin -a `echo $CURL_LIB $CURL_INC | grep -ci anaconda` -gt 0; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Rejecting Anaconda curl. Disabling HTTPS support." >&5
 $as_echo "$as_me: WARNING: Rejecting Anaconda curl. Disabling HTTPS support." >&2;}
-  else
-    LIBS="$CURL_LIB $LIBS"
-    if test "x$CURL_INC" != x; then
-      CFLAGS="$CURL_INC $CFLAGS"
-    fi
-    $as_echo "#define CFITSIO_HAVE_CURL 1" >>confdefs.h
+    else
+      LIBS="$CURL_LIB $LIBS"
+      if test "x$CURL_INC" != x; then
+        CFLAGS="$CURL_INC $CFLAGS"
+      fi
+      $as_echo "#define CFITSIO_HAVE_CURL 1" >>confdefs.h
 
+    fi
+  # No curl-config:
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: curl-config not found. Disabling HTTPS support." >&5
+$as_echo "$as_me: WARNING: curl-config not found. Disabling HTTPS support." >&2;}
+  # Incomplete stubs for possible future use:
+  #  AC_CHECK_LIB([curl],[main],[],
+  #       [AC_MSG_WARN(Not building curl support for CFITSIO)])
+  #  AC_CHECK_HEADER(curl.h,[])
   fi
-# No curl-config:
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: curl-config not found. Disabling HTTPS support." >&5
-$as_echo "$as_me: WARNING: curl-config not found. Disabling HTTPS support." >&2;}
-# Incomplete stubs for possible future use:
-#  AC_CHECK_LIB([curl],[main],[],
-#       [AC_MSG_WARN(Not building curl support for CFITSIO)])
-#  AC_CHECK_HEADER(curl.h,[])
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: curl disabled. Disabling HTTPS support." >&5
+$as_echo "$as_me: WARNING: curl disabled. Disabling HTTPS support." >&2;}
 fi
 
 # GSIFTP flags:
diff --recursive -u -p a/cfitsio/configure.in b/cfitsio/configure.in
--- a/cfitsio/configure.in	2018-05-09 15:16:00.000000000 -0400
+++ b/cfitsio/configure.in	2018-08-06 15:42:27.000000000 -0400
@@ -53,6 +53,12 @@ if test "x$BUILD_HERA" = xyes; then
   AC_DEFINE(BUILD_HERA)
 fi
 
+AC_ARG_ENABLE(
+  curl,
+  [AS_HELP_STRING([--disable-curl],[Disable use of cURL library (HTTPS)])],
+  [ if test $enableval = yes; then CURL_DISABLED=yes; fi ]
+)
+
 # Optional support for bzip2 compression:
 AC_ARG_WITH(
   bzip2,
@@ -441,37 +447,41 @@ if test "x$CFITSIO_SHLIB" = x; then CFIT
 
 # Curl library (will be pulled in to the shared CFITSIO library):
 # ---------------------------------------------------------------
-CURL_LIB=""
-CURL_INC=""
-# Use curl-config to get compiler & linker flags, if available.
-# On Macs, prefer XCode curl-config, and reject MacPorts version
-# until further notice to prevent build errors:
-if test "x$EXT" = xdarwin -a -x /usr/bin/curl-config; then
-  CURLCONFIG="/usr/bin/curl-config"
-  AC_MSG_RESULT(checking for curl-config... choosing /usr/bin/curl-config on Mac)
-else
-  AC_CHECK_PROG([CURLCONFIG], [curl-config], [curl-config], [], [], [/opt/local/bin/curl-config])
-fi
-if test "x$CURLCONFIG" != x; then
-  CURL_LIB=`$CURLCONFIG --libs`
-  CURL_INC=`$CURLCONFIG --cflags`
-  # Also reject anaconda curl on Macs until further notice:
-  if test "x$EXT" = xdarwin -a `echo $CURL_LIB $CURL_INC | grep -ci anaconda` -gt 0; then
-    AC_MSG_WARN(Rejecting Anaconda curl. Disabling HTTPS support.)
+if test "x$CURL_DISABLED" != x; then
+  CURL_LIB=""
+  CURL_INC=""
+  # Use curl-config to get compiler & linker flags, if available.
+  # On Macs, prefer XCode curl-config, and reject MacPorts version
+  # until further notice to prevent build errors:
+  if test "x$EXT" = xdarwin -a -x /usr/bin/curl-config; then
+    CURLCONFIG="/usr/bin/curl-config"
+    AC_MSG_RESULT(checking for curl-config... choosing /usr/bin/curl-config on Mac)
   else
-    LIBS="$CURL_LIB $LIBS"
-    if test "x$CURL_INC" != x; then
-      CFLAGS="$CURL_INC $CFLAGS"
+    AC_CHECK_PROG([CURLCONFIG], [curl-config], [curl-config], [], [], [/opt/local/bin/curl-config])
+  fi
+  if test "x$CURLCONFIG" != x; then
+    CURL_LIB=`$CURLCONFIG --libs`
+    CURL_INC=`$CURLCONFIG --cflags`
+    # Also reject anaconda curl on Macs until further notice:
+    if test "x$EXT" = xdarwin -a `echo $CURL_LIB $CURL_INC | grep -ci anaconda` -gt 0; then
+      AC_MSG_WARN(Rejecting Anaconda curl. Disabling HTTPS support.)
+    else
+      LIBS="$CURL_LIB $LIBS"
+      if test "x$CURL_INC" != x; then
+        CFLAGS="$CURL_INC $CFLAGS"
+      fi
+      AC_DEFINE(CFITSIO_HAVE_CURL)
     fi
-    AC_DEFINE(CFITSIO_HAVE_CURL)
+  # No curl-config:
+  else
+    AC_MSG_WARN(curl-config not found. Disabling HTTPS support.)
+  # Incomplete stubs for possible future use:
+  #  AC_CHECK_LIB([curl],[main],[],
+  #       [AC_MSG_WARN(Not building curl support for CFITSIO)])
+  #  AC_CHECK_HEADER(curl.h,[])
   fi
-# No curl-config:
 else
-  AC_MSG_WARN(curl-config not found. Disabling HTTPS support.)
-# Incomplete stubs for possible future use:
-#  AC_CHECK_LIB([curl],[main],[],
-#       [AC_MSG_WARN(Not building curl support for CFITSIO)])
-#  AC_CHECK_HEADER(curl.h,[])
+  AC_MSG_WARN(curl disabled. Disabling HTTPS support.)
 fi
 
 # GSIFTP flags: