]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
m4/pdns_check_libcrypto: fix ecdsa/eddsa includedir 16538/head
authorfamfo <famfo@famfo.xyz>
Sun, 23 Nov 2025 12:53:14 +0000 (13:53 +0100)
committerfamfo <famfo@famfo.xyz>
Sun, 23 Nov 2025 15:21:00 +0000 (16:21 +0100)
On more excotic Linux distributions, like NixOS, the directory in which
the libraries are stored and the directory of the headers is different.
This uses pkg-config to find the right includedir of the headers.

Signed-off-by: famfo <famfo@famfo.xyz>
m4/pdns_check_libcrypto.m4
m4/pdns_check_libcrypto_ecdsa.m4
m4/pdns_check_libcrypto_eddsa.m4

index 4ca3c702eaba8368323011f9216016def26d49aa..b4bf73bec1aad38e78fc917cfdeb7dd89ba28073 100644 (file)
@@ -55,6 +55,7 @@ AC_DEFUN([PDNS_CHECK_LIBCRYPTO], [
                     LIBCRYPTO_LIBS=`$PKG_CONFIG libcrypto --libs-only-l 2>/dev/null`
                     LIBCRYPTO_INCLUDES=`$PKG_CONFIG libcrypto --cflags-only-I 2>/dev/null`
                     ssldir=`$PKG_CONFIG libcrypto --variable=prefix 2>/dev/null`
+                    sslincdir=`$PKG_CONFIG libcrypto --variable=includedir 2>/dev/null`
                     found=true
                 fi
             fi
@@ -78,6 +79,7 @@ AC_DEFUN([PDNS_CHECK_LIBCRYPTO], [
                 LIBCRYPTO_INCLUDES="-I$ssldir/include"
                 LIBCRYPTO_LDFLAGS="-L$ssldir/lib"
                 LIBCRYPTO_LIBS="-lcrypto"
+                sslincdir="$ssldir/include"
                 found=true
                 AC_MSG_RESULT([yes])
                 break
index 8720a63966dd91b97178cf8651fba4226a9026e4..1773890825899f72c95190b06ebb52b95b041d02 100644 (file)
@@ -12,11 +12,11 @@ AC_DEFUN([PDNS_CHECK_LIBCRYPTO_ECDSA], [
 
   # Find the headers we need for ECDSA
   libcrypto_ecdsa=yes
-  AC_CHECK_HEADER([$ssldir/include/openssl/ecdsa.h], [
+  AC_CHECK_HEADER([$sslincdir/openssl/ecdsa.h], [
     AC_CHECK_DECLS([NID_X9_62_prime256v1, NID_secp384r1], [ : ], [
       libcrypto_ecdsa=no
     ], [AC_INCLUDES_DEFAULT
-#include <$ssldir/include/openssl/evp.h>
+#include <$sslincdir/openssl/evp.h>
     ])
   ], [
     libcrypto_ecdsa=no
index 3607fcf04b7c3df55fd3b23eec8babf59376d7d1..ed395b5591249d01118c096cc25987bed9f07334 100644 (file)
@@ -17,13 +17,13 @@ AC_DEFUN([PDNS_CHECK_LIBCRYPTO_EDDSA], [
     AC_DEFINE([HAVE_LIBCRYPTO_ED25519], [1], [define to 1 if OpenSSL ed25519 support is available.])
   ], [ : ],
   [AC_INCLUDES_DEFAULT
-  #include <$ssldir/include/openssl/evp.h>])
+  #include <$sslincdir/openssl/evp.h>])
   AC_CHECK_DECLS([NID_ED448], [
     libcrypto_ed448=yes
     AC_DEFINE([HAVE_LIBCRYPTO_ED448], [1], [define to 1 if OpenSSL ed448 support is available.])
   ], [ : ],
   [AC_INCLUDES_DEFAULT
-  #include <$ssldir/include/openssl/evp.h>])
+  #include <$sslincdir/openssl/evp.h>])
 
   AS_IF([test "$libcrypto_ed25519" = "yes" -o "$libcrypto_ed448" = "yes"], [
     AC_DEFINE([HAVE_LIBCRYPTO_EDDSA], [1], [define to 1 if OpenSSL EDDSA support is available.])