Add Haiku support.
authorJérôme Duval <jerome.duval@gmail.com>
Tue, 23 Feb 2016 21:49:01 +0000 (22:49 +0100)
committerRich Salz <rsalz@openssl.org>
Thu, 14 Apr 2016 17:49:42 +0000 (13:49 -0400)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Configurations/10-main.conf
Makefile.shared
config
e_os.h

index 5bf8a0df709baf2a5a61e79e604551fde72b1013..69087d9ac5e431c717c64a7867963ed629d9a561 100644 (file)
@@ -1741,6 +1741,35 @@ sub vms_info {
         shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
         ranlib           => "$ENV{'RANLIB'}",
     },
+    "haiku-common" => {
+        template         => 1,
+        cc               => "cc",
+        cflags           => add_before(picker(default => "-DL_ENDIAN -Wall",
+                                              debug   => "-g -O0",
+                                              release => "-O2"),
+                                       threads("-D_REENTRANT")),
+        sys_id           => "HAIKU",
+        lflags           => "-lnetwork",
+        perlasm_scheme   => "elf",
+        thread_scheme    => "pthreads",
+        dso_scheme       => "dlfcn",
+        shared_target    => "haiku-shared",
+        shared_cflag     => "-fPIC",
+        shared_ldflag    => "-shared",
+        shared_extension => ".so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+    },
+    "haiku-x86" => {
+        inherit_from     => [ "haiku-common", asm("x86_elf_asm") ],
+        cflags           => add(picker(default => "",
+                                       release => "-fomit-frame-pointer")),
+        bn_ops           => "BN_LLONG",
+    },
+    "haiku-x86_64" => {
+        inherit_from     => [ "haiku-common", asm("x86_64_asm") ],
+        cflags           => add("-m64"),
+        bn_ops           => "SIXTY_FOUR_BIT_LONG RC4_CHAR",
+    },
+
 
     ##### VMS
     "vms-generic" => {
index c556129182fe77f6141199c51e2abb810443d2d8..65980b293f7d81cc29a5a1f39cadaa5324278e21 100644 (file)
@@ -561,11 +561,11 @@ symlink.hpux:
 symlink.cygwin symlink.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
 
 # Compatibility targets
-link_dso.bsd-gcc-shared link_dso.linux-shared link_dso.gnu-shared: link_dso.gnu
+link_dso.bsd-gcc-shared link_dso.linux-shared link_dso.gnu-shared link_dso.haiku-shared: link_dso.gnu
 link_shlib.bsd-gcc-shared: link_shlib.linux-shared
-link_shlib.gnu-shared: link_shlib.gnu
-link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
-symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
+link_shlib.gnu-shared link_shlib.haiku-shared: link_shlib.gnu
+link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared link_app.haiku-shared: link_app.gnu
+symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared symlink.haiku-shared: symlink.gnu
 link_dso.bsd-shared: link_dso.bsd
 link_shlib.bsd-shared: link_shlib.bsd
 link_app.bsd-shared: link_app.bsd
diff --git a/config b/config
index 22fb57a479ab83da4fad2534b3e3d189b7fd65fd..9dfe1c3d2b03bd22cc1e089569ed8c0300d011aa 100755 (executable)
--- a/config
+++ b/config
@@ -202,6 +202,10 @@ case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
        echo "${MACHINE}-whatever-freebsd"; exit 0
        ;;
 
+    Haiku:*)
+       echo "${MACHINE}-whatever-haiku"; exit 0
+       ;;
+
     NetBSD:*:*:*386*)
         echo "`(/usr/sbin/sysctl -n hw.model || /sbin/sysctl -n hw.model) | sed 's,.*\(.\)86-class.*,i\186,'`-whatever-netbsd"; exit 0
        ;;
@@ -724,6 +728,8 @@ case "$GUESSOS" in
                        *ELF*)  OUT="BSD-x86-elf" ;;
                        *)      OUT="BSD-x86"; options="$options no-sse2" ;;
                        esac ;;
+  x86_64-*-haiku)      OUT="haiku-x86_64" ;;
+  *-*-haiku)           OUT="haiku-x86" ;;
   *-*-*bsd*)           OUT="BSD-generic32" ;;
 
   *-*-osf)             OUT="osf1-alpha-cc" ;;
diff --git a/e_os.h b/e_os.h
index 648035d59b0fa68e2bb0b5d167e7e09747ba94b7..0124e5e67faa8c9cbd2fbb97fd0b9d33db89035d 100644 (file)
--- a/e_os.h
+++ b/e_os.h
@@ -552,6 +552,13 @@ struct servent *getservbyname(const char *name, const char *proto);
 # endif
 /* end vxworks */
 
+/* haiku */
+# if defined(OPENSSL_SYS_HAIKU)
+#  include <sys/select.h>
+#  include <sys/time.h>
+# endif
+/* end haiku */
+
 #define OSSL_NELEM(x)    (sizeof(x)/sizeof(x[0]))
 
 #ifdef  __cplusplus