From 6e08e9e7ccf00aba847351adc3b46b9dae1f114d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 23 Feb 2016 22:49:01 +0100 Subject: [PATCH] Add Haiku support. Reviewed-by: Richard Levitte Reviewed-by: Tim Hudson Reviewed-by: Rich Salz --- Configurations/10-main.conf | 29 +++++++++++++++++++++++++++++ Makefile.shared | 8 ++++---- config | 6 ++++++ e_os.h | 7 +++++++ 4 files changed, 46 insertions(+), 4 deletions(-) diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index 5bf8a0df70..69087d9ac5 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -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" => { diff --git a/Makefile.shared b/Makefile.shared index c556129182..65980b293f 100644 --- a/Makefile.shared +++ b/Makefile.shared @@ -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 22fb57a479..9dfe1c3d2b 100755 --- 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 648035d59b..0124e5e67f 100644 --- 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 +# include +# endif +/* end haiku */ + #define OSSL_NELEM(x) (sizeof(x)/sizeof(x[0])) #ifdef __cplusplus -- 2.25.1