Support OpenBSD
authorAustin Clements <amdragon@MIT.EDU>
Wed, 24 Oct 2012 21:43:28 +0000 (17:43 -0400)
committerDavid Bremner <bremner@debian.org>
Sat, 27 Oct 2012 12:35:47 +0000 (09:35 -0300)
OpenBSD's build flags are identical to FreeBSD, except that libraries
need to be explicitly linked against libc.  No code changes are
necessary.

From: Cody Cutler <ccutler@csail.mit.edu>

configure
lib/Makefile.local

index acb90a8c610efdf24c5d472e6a2d1852b71dc391..232d8477145626dfefc24137147dc5002a836cf2 100755 (executable)
--- a/configure
+++ b/configure
@@ -378,6 +378,10 @@ elif [ $uname = "FreeBSD" ] ; then
     printf "FreeBSD.\n"
     platform=FREEBSD
     linker_resolves_library_dependencies=0
+elif [ $uname = "OpenBSD" ] ; then
+    printf "OpenBSD.\n"
+    platform=OPENBSD
+    linker_resolves_library_dependencies=0
 elif [ $uname = "Linux" ] || [ $uname = "GNU" ] ; then
     printf "$uname\n"
     platform="$uname"
@@ -667,7 +671,7 @@ HAVE_GETLINE = ${have_getline}
 # build its own version)
 HAVE_STRCASESTR = ${have_strcasestr}
 
-# Supported platforms (so far) are: LINUX, MACOSX, SOLARIS, FREEBSD
+# Supported platforms (so far) are: LINUX, MACOSX, SOLARIS, FREEBSD, OPENBSD
 PLATFORM = ${platform}
 
 # Whether the linker will automatically resolve the dependency of one
index 8a9aa28a13365a783e68e811c972f611d73b6708..34e998f897c97f288ab51634fafe67a4bd91d8ad 100644 (file)
@@ -31,6 +31,9 @@ LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
 LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME) -Wl,--no-undefined
+ifeq ($(PLATFORM),OPENBSD)
+LIBRARY_LINK_FLAG += -lc
+endif
 ifeq ($(LIBDIR_IN_LDCONFIG),1)
 ifeq ($(DESTDIR),)
 LIBRARY_INSTALL_POST_COMMAND=ldconfig