Fix support for DragonFly BSD
authorjrmarino <draco@marino.st>
Fri, 21 Oct 2016 13:48:31 +0000 (08:48 -0500)
committerRich Salz <rsalz@openssl.org>
Sat, 22 Oct 2016 08:25:17 +0000 (04:25 -0400)
The __DragonFly__ macros were introduced in issue #1546 along with a
function naming fix, but it was decided they should be handled
separately.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1765)

config
crypto/engine/eng_all.c
crypto/engine/eng_cryptodev.c
crypto/init.c
crypto/uid.c
include/openssl/engine.h

diff --git a/config b/config
index 65041431503b85a732524b368ed245d795f0dac2..b8a787cc5377f9dfad21a278b46aee5f69776fe5 100755 (executable)
--- a/config
+++ b/config
@@ -187,6 +187,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
         echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0
         ;;
 
+    DragonFly:*)
+       echo "${MACHINE}-whatever-dragonfly"; exit 0
+       ;;
+
     FreeBSD:*)
        echo "${MACHINE}-whatever-freebsd"; exit 0
        ;;
@@ -697,6 +701,7 @@ case "$GUESSOS" in
   powerpc64-*-*bsd*)   OUT="BSD-generic64"; options="$options -DB_ENDIAN" ;;
   sparc64-*-*bsd*)     OUT="BSD-sparc64" ;;
   ia64-*-*bsd*)                OUT="BSD-ia64" ;;
+  x86_64-*-dragonfly*)  OUT="BSD-x86_64" ;;
   amd64-*-*bsd*)       OUT="BSD-x86_64" ;;
   *86*-*-*bsd*)                # mimic ld behaviour when it's looking for libc...
                        if [ -L /usr/lib/libc.so ]; then        # [Free|Net]BSD
index ebe0277370c6df6f756ec76eec2b1d07f4bcdb23..50fe4cba9ec0d2651f62c9472321c26f6305e5d7 100644 (file)
@@ -18,7 +18,7 @@ void ENGINE_load_builtin_engines(void)
     OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL);
 }
 
-#if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)) && !defined(OPENSSL_NO_DEPRECATED)
+#if (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(HAVE_CRYPTODEV)) && !defined(OPENSSL_NO_DEPRECATED)
 void ENGINE_setup_bsd_cryptodev(void)
 {
     static int bsd_cryptodev_default_loaded = 0;
index d63c918c7fc63805c269e1c77786bf7d26828d74..cb242291eabc46ed6475ec005ac760609635f21e 100644 (file)
@@ -42,9 +42,9 @@
 #include <openssl/crypto.h>
 
 #if (defined(__unix__) || defined(unix)) && !defined(USG) && \
-        (defined(OpenBSD) || defined(__FreeBSD__))
+        (defined(OpenBSD) || defined(__FreeBSD__) || defined(__DragonFly__))
 # include <sys/param.h>
-# if (OpenBSD >= 200112) || ((__FreeBSD_version >= 470101 && __FreeBSD_version < 500000) || __FreeBSD_version >= 500041)
+# if (OpenBSD >= 200112) || ((__FreeBSD_version >= 470101 && __FreeBSD_version < 500000) || __FreeBSD_version >= 500041) || defined(__DragonFly__)
 #  define HAVE_CRYPTODEV
 # endif
 # if (OpenBSD >= 200110)
index 7423eccb1b326c771043097a2300f0f9cf3a10a2..93ec7bbc6905807ccea7336b0896a89173d08f05 100644 (file)
@@ -198,7 +198,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_engine_openssl)
     return 1;
 }
 # if !defined(OPENSSL_NO_HW) && \
-    (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV))
+    (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(HAVE_CRYPTODEV))
 static CRYPTO_ONCE engine_cryptodev = CRYPTO_ONCE_STATIC_INIT;
 DEFINE_RUN_ONCE_STATIC(ossl_init_engine_cryptodev)
 {
@@ -525,7 +525,7 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings)
             && !RUN_ONCE(&engine_openssl, ossl_init_engine_openssl))
         return 0;
 # if !defined(OPENSSL_NO_HW) && \
-    (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV))
+    (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(HAVE_CRYPTODEV))
     if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
             && !RUN_ONCE(&engine_cryptodev, ossl_init_engine_cryptodev))
         return 0;
index 12df8a4e87c0c4954c039cd29a5cba8541ff0f19..9756d518505c5a813d1195e40304ac6471a67a5d 100644 (file)
@@ -10,7 +10,7 @@
 #include <openssl/crypto.h>
 #include <openssl/opensslconf.h>
 
-#if defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD__ > 2)
+#if defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD__ > 2) || defined(__DragonFly__)
 
 # include OPENSSL_UNISTD
 
index 319371e42575fc7eecfc967742e1f041466684af..3bafa188e6d70515469dd031f795af2979aa411f 100644 (file)
@@ -745,7 +745,7 @@ typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,
  */
 void *ENGINE_get_static_state(void);
 
-# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
+# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(HAVE_CRYPTODEV)
 DEPRECATEDIN_1_1_0(void ENGINE_setup_bsd_cryptodev(void))
 # endif