mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-13 12:53:53 +00:00
Support OpenBSD.
configure.ac:
Set flags to build Boehm GC with threads support and parallel
marking.
Prevent use of "__thread" storage class specifier on OpenBSD;
it does not work.
Enable shared libraries on OpenBSD.
README.OpenBSD:
New file.
.README.in:
README.md:
Mention README.OpenBSD.
.nocopyright:
Add README.OpenBSD.
This commit is contained in:
@@ -9,7 +9,7 @@ or particular architectures, so first read the README file for your particular
|
|||||||
platform, if there is one:
|
platform, if there is one:
|
||||||
|
|
||||||
README.AIX RS/6000 systems running AIX
|
README.AIX RS/6000 systems running AIX
|
||||||
README.FreeBSD The FreeBSD version of BSD Unix on Intel x86
|
README.FreeBSD FreeBSD on Intel x86 and x86_64
|
||||||
README.HPUX HPPA systems running HPUX
|
README.HPUX HPPA systems running HPUX
|
||||||
README.Linux Linux on Intel x86 and x86_64
|
README.Linux Linux on Intel x86 and x86_64
|
||||||
README.Linux-Alpha Linux on DEC Alpha
|
README.Linux-Alpha Linux on DEC Alpha
|
||||||
@@ -17,6 +17,7 @@ platform, if there is one:
|
|||||||
README.Linux-m68k Linux on Motorola 68000
|
README.Linux-m68k Linux on Motorola 68000
|
||||||
README.MacOS Apple Mac systems running Mac OS X
|
README.MacOS Apple Mac systems running Mac OS X
|
||||||
README.MS-Windows Microsoft Windows
|
README.MS-Windows Microsoft Windows
|
||||||
|
README.OpenBSD OpenBSD on x86_64
|
||||||
README.Solaris Solaris (SunOS) on SPARC or Intel x86.
|
README.Solaris Solaris (SunOS) on SPARC or Intel x86.
|
||||||
|
|
||||||
The documentation sources are in the `doc' subdirectory. The installation
|
The documentation sources are in the `doc' subdirectory. The installation
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ README.MinGW-cross
|
|||||||
README.MS-VisualC
|
README.MS-VisualC
|
||||||
README.MS-Windows
|
README.MS-Windows
|
||||||
README.OSF1
|
README.OSF1
|
||||||
|
README.OpenBSD
|
||||||
README.Solaris
|
README.Solaris
|
||||||
README.ssdebug
|
README.ssdebug
|
||||||
README.CSharp
|
README.CSharp
|
||||||
|
|||||||
12
README.OpenBSD
Normal file
12
README.OpenBSD
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
Mercury on OpenBSD
|
||||||
|
==================
|
||||||
|
|
||||||
|
Tested on OpenBSD 6.2 amd64 with clang 4.0 and gcc 4.9.
|
||||||
|
|
||||||
|
The base version of gcc is 4.2.1, but you can install a more recent
|
||||||
|
version from ports with "pkg_add gcc", then direct Mercury to use 'egcc'
|
||||||
|
by running:
|
||||||
|
|
||||||
|
CC=egcc ./configure <your normal configure arguments>
|
||||||
|
|
||||||
@@ -42,6 +42,7 @@ Specific information is contained in individual README files:
|
|||||||
[m68k](README.Linux-m68k))
|
[m68k](README.Linux-m68k))
|
||||||
* [MacOS X](README.MacOS)
|
* [MacOS X](README.MacOS)
|
||||||
* [FreeBSD](README.FreeBSD)
|
* [FreeBSD](README.FreeBSD)
|
||||||
|
* [OpenBSD](README.OpenBSD)
|
||||||
* [AIX](README.AIX)
|
* [AIX](README.AIX)
|
||||||
* [HP-UX](README.HPUX)
|
* [HP-UX](README.HPUX)
|
||||||
* [Solaris](README.Solaris)
|
* [Solaris](README.Solaris)
|
||||||
|
|||||||
27
configure.ac
27
configure.ac
@@ -3265,7 +3265,15 @@ case "$host" in
|
|||||||
ENABLE_BOEHM_PARALLEL_MARK="-DPARALLEL_MARK"
|
ENABLE_BOEHM_PARALLEL_MARK="-DPARALLEL_MARK"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*freebsd*)
|
*-freebsd*)
|
||||||
|
CFLAGS_FOR_THREADS="-DGC_THREADS"
|
||||||
|
THREAD_LIBS="-lpthread"
|
||||||
|
ENABLE_BOEHM_THREAD_LOCAL_ALLOC="-DTHREAD_LOCAL_ALLOC"
|
||||||
|
ENABLE_BOEHM_PARALLEL_MARK="-DPARALLEL_MARK"
|
||||||
|
avoid_sbrk=yes
|
||||||
|
;;
|
||||||
|
|
||||||
|
*-openbsd*)
|
||||||
CFLAGS_FOR_THREADS="-DGC_THREADS"
|
CFLAGS_FOR_THREADS="-DGC_THREADS"
|
||||||
THREAD_LIBS="-lpthread"
|
THREAD_LIBS="-lpthread"
|
||||||
ENABLE_BOEHM_THREAD_LOCAL_ALLOC="-DTHREAD_LOCAL_ALLOC"
|
ENABLE_BOEHM_THREAD_LOCAL_ALLOC="-DTHREAD_LOCAL_ALLOC"
|
||||||
@@ -3326,12 +3334,11 @@ AC_CACHE_VAL(mercury_cv_thread_local_storage,
|
|||||||
)
|
)
|
||||||
AC_MSG_RESULT($mercury_cv_thread_local_storage)
|
AC_MSG_RESULT($mercury_cv_thread_local_storage)
|
||||||
|
|
||||||
# Thread-local storage is disabled on Solaris as there is a linker problem
|
|
||||||
# with shared objects and TLS.
|
|
||||||
|
|
||||||
if test "$mercury_cv_thread_local_storage" = yes; then
|
if test "$mercury_cv_thread_local_storage" = yes; then
|
||||||
case "$host" in
|
case "$host" in
|
||||||
*-solaris2.*)
|
*-solaris2.*)
|
||||||
|
# Thread-local storage is disabled on Solaris as there is a linker
|
||||||
|
# problem with shared objects and TLS.
|
||||||
;;
|
;;
|
||||||
*apple*darwin*)
|
*apple*darwin*)
|
||||||
# XXX only attempt to use __thread with GCC on Mac OS X.
|
# XXX only attempt to use __thread with GCC on Mac OS X.
|
||||||
@@ -3343,6 +3350,14 @@ if test "$mercury_cv_thread_local_storage" = yes; then
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
*-openbsd*)
|
||||||
|
# The above test "passes" but OpenBSD (6.2) does not support TLS
|
||||||
|
# natively, so is emulated by gcc/clang using something like the
|
||||||
|
# pthread thread-specific data API. Moreover, something goes wrong
|
||||||
|
# with the emulation when a Mercury program is dynamically linked
|
||||||
|
# to the Mercury runtime (MR_thread_engine_base is assigned in one
|
||||||
|
# place but remains NULL when read elsewhere).
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
AC_DEFINE([MR_THREAD_LOCAL_STORAGE])
|
AC_DEFINE([MR_THREAD_LOCAL_STORAGE])
|
||||||
;;
|
;;
|
||||||
@@ -4440,6 +4455,10 @@ case "$host" in
|
|||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
EXT_FOR_SHARED_LIB=so
|
EXT_FOR_SHARED_LIB=so
|
||||||
;;
|
;;
|
||||||
|
*-openbsd*)
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
EXT_FOR_SHARED_LIB=so
|
||||||
|
;;
|
||||||
i*86-*-solaris2.*)
|
i*86-*-solaris2.*)
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user