summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2018-08-16 18:56:02 +0200
committerDavid Disseldorp <ddiss@suse.de>2018-08-16 18:58:27 +0200
commit9ee669faa39003c2317e5df892314bcfcee069e3 (patch)
treee69cc9b6ade64c5b3c3769cfa66f355b0cb08ca3 /configure
parent31b78ecd1fb6b755d51e3a17031819adc5891bc4 (diff)
downloadfio-9ee669faa39003c2317e5df892314bcfcee069e3.tar.gz
fio-9ee669faa39003c2317e5df892314bcfcee069e3.tar.bz2
configure: avoid pkg-config usage for http engine
Signed-off-by: David Disseldorp <ddiss@suse.de>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure52
1 files changed, 47 insertions, 5 deletions
diff --git a/configure b/configure
index 0637b105..a03f7fa0 100755
--- a/configure
+++ b/configure
@@ -14,12 +14,13 @@ else
fi
TMPC="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.c"
+TMPC2="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}-2.c"
TMPO="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.o"
TMPE="${TMPDIR1}/fio-conf-${RANDOM}-$$-${RANDOM}.exe"
# NB: do not call "exit" in the trap handler; this is buggy with some shells;
# see <1285349658-3122-1-git-send-email-loic.minier@linaro.org>
-trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
+trap "rm -f $TMPC $TMPC2 $TMPO $TMPE" EXIT INT QUIT TERM
rm -rf config.log
@@ -1573,12 +1574,53 @@ print_config "IPv6 helpers" "$ipv6"
if test "$http" != "yes" ; then
http="no"
fi
-if test "$disable_http" != "yes" && $(pkg-config --exists libcurl openssl); then
- if $(pkg-config --atleast-version=1.1.0 openssl); then
+# check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer
+cat > $TMPC << EOF
+#include <curl/curl.h>
+#include <openssl/hmac.h>
+
+int main(int argc, char **argv)
+{
+ CURL *curl;
+ HMAC_CTX *ctx;
+
+ curl = curl_easy_init();
+ curl_easy_cleanup(curl);
+
+ ctx = HMAC_CTX_new();
+ HMAC_CTX_reset(ctx);
+ HMAC_CTX_free(ctx);
+ return 0;
+}
+EOF
+# openssl < 1.1.0 uses the HMAC_CTX type directly
+cat > $TMPC2 << EOF
+#include <curl/curl.h>
+#include <openssl/hmac.h>
+
+int main(int argc, char **argv)
+{
+ CURL *curl;
+ HMAC_CTX ctx;
+
+ curl = curl_easy_init();
+ curl_easy_cleanup(curl);
+
+ HMAC_CTX_init(&ctx);
+ HMAC_CTX_cleanup(&ctx);
+ return 0;
+}
+EOF
+if test "$disable_http" != "yes"; then
+ HTTP_LIBS="-lcurl -lssl -lcrypto"
+ if compile_prog "" "$HTTP_LIBS" "curl-new-ssl"; then
output_sym "CONFIG_HAVE_OPAQUE_HMAC_CTX"
+ http="yes"
+ LIBS="$HTTP_LIBS $LIBS"
+ elif mv $TMPC2 $TMPC && compile_prog "" "$HTTP_LIBS" "curl-old-ssl"; then
+ http="yes"
+ LIBS="$HTTP_LIBS $LIBS"
fi
- LIBS="$(pkg-config --libs libcurl openssl) $LIBS"
- http="yes"
fi
print_config "http engine" "$http"