X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=configure;h=a03f7fa004a1c8c006e724538ae77ca54aa43cad;hp=97bc35e9ca7039bd7d81822709bee9145c7910f0;hb=59f15720e4997c1bc8edd9bb0e2738d4d485c6a6;hpb=0290c589836641ad7bb39a97e45dfcf3d8603f23 diff --git a/configure b/configure index 97bc35e9..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,11 +1574,52 @@ print_config "IPv6 helpers" "$ipv6" if test "$http" != "yes" ; then http="no" fi -if test "$disable_http" != "yes" && $(pkg-config --exists libcurl openssl); then - # http engine currently requires opaque HMAC_CTX present in openssl >= 1.1 - if $(pkg-config --atleast-version=1.1.0 openssl); then - LIBS="$(pkg-config --libs libcurl openssl) $LIBS" +# check for openssl >= 1.1.0, which uses an opaque HMAC_CTX pointer +cat > $TMPC << EOF +#include +#include + +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 +#include + +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 fi print_config "http engine" "$http"