configure: fix for -lpthread detection with OpenSSL and pkg-config
authorDaniel Stenberg <daniel@haxx.se>
Wed, 8 Aug 2018 12:42:29 +0000 (14:42 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 9 Aug 2018 10:06:28 +0000 (12:06 +0200)
... by making sure it uses the -I provided by pkg-config!

Reported-by: pszemus on github
Fixes #2848
Closes #2850

configure.ac

index 22280a5e98ce23e72b76c6bb17997666a250e98f..18b7ae0f1bde8e31f95077fa5d10d720d7a00edf 100755 (executable)
@@ -1650,7 +1650,10 @@ if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
      LIBS="-lcrypto $LIBS"
      ],[
      LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
-     CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
+     if test "$PKGCONFIG" = "no" ; then
+       # only set this if pkg-config wasn't used
+       CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
+     fi
      AC_CHECK_LIB(crypto, HMAC_Init_ex,[
        HAVECRYPTO="yes"
        LIBS="-lcrypto $LIBS"], [