Created
February 16, 2013 05:17
-
-
Save kuwa72/4965652 to your computer and use it in GitHub Desktop.
Gauche-head/OpenBSD5.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/configure.ac b/configure.ac | |
index aa17d7c..619a920 100644 | |
--- a/configure.ac | |
+++ b/configure.ac | |
@@ -199,6 +199,14 @@ case $GAUCHE_THREAD_TYPE in | |
THREADDLLIBS="-lpthread -lrt" | |
GAUCHE_THREAD_TYPE=pthreads | |
;; | |
+ *-*-openbsd*) | |
+ AC_DEFINE(GC_OPENBSD_THREADS,1,[Define to use OpenBSD threads]) | |
+ OPT_INCLUDES="$INCLUDES -pthread" | |
+ OPT_THREADLIBS="-lpthread" | |
+ GAUCHE_THREAD_TYPE=none | |
+ AC_SUBST(OPT_INCLUDES) | |
+ AC_SUBST(OPT_THREADLIBS) | |
+ ;; | |
*-*-solaris*) | |
AC_DEFINE(GC_SOLARIS_THREADS,1,[Define to use Solaris threads]) | |
AC_DEFINE(GC_SOLARIS_PTHREADS,1,[Define to use Solaris pthreads]) | |
diff --git a/ext/Makefile.ext.in b/ext/Makefile.ext.in | |
index 0fd21c5..07c772b 100644 | |
--- a/ext/Makefile.ext.in | |
+++ b/ext/Makefile.ext.in | |
@@ -19,7 +19,7 @@ DESTDIR = | |
CC = @CC@ | |
AR = @AR@ | |
LOCAL_LFLAGS = @LOCAL_LIB@ | |
-LIBS = $(XLIBS) @LIBS@ | |
+LIBS = $(XLIBS) @LIBS@ @OPT_THREADLIBS@ | |
CFLAGS = @CFLAGS@ @SHLIB_SO_CFLAGS@ $(XCFLAGS) | |
CPPFLAGS = @CPPFLAGS@ $(XCPPFLAGS) | |
LDFLAGS = $(LOCAL_LFLAGS) $(XLDFLAGS) @SHLIB_SO_LDFLAGS@ | |
@@ -27,7 +27,7 @@ LDFLAGS = $(LOCAL_LFLAGS) $(XLDFLAGS) @SHLIB_SO_LDFLAGS@ | |
# These are set by configure | |
DEFS = @DEFS@ | |
OPTFLAGS = @OPTFLAGS@ | |
-INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/src -I$(top_builddir)/src -I$(top_srcdir)/gc/include @LOCAL_INC@ $(EXTRA_INCLUDES) | |
+INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/src -I$(top_builddir)/src -I$(top_srcdir)/gc/include @LOCAL_INC@ $(EXTRA_INCLUDES) @OPT_INCLUDES@ | |
OBJEXT = @OBJEXT@ | |
EXEEXT = @EXEEXT@ | |
SOEXT = @SHLIB_SO_SUFFIX@ | |
diff --git a/ext/net/gauche-net.h b/ext/net/gauche-net.h | |
index 7377a36..40ab3d4 100644 | |
--- a/ext/net/gauche-net.h | |
+++ b/ext/net/gauche-net.h | |
@@ -74,6 +74,10 @@ typedef SOCKET Socket; | |
#endif | |
#include <gauche/extern.h> | |
+#ifdef __OpenBSD__ | |
+#include <sys/uio.h> | |
+#endif /*__OpenBSD__*/ | |
+ | |
SCM_DECL_BEGIN | |
/* windows stuff */ | |
@@ -94,7 +98,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); | |
* Sockaddr_storage | |
*/ | |
-#if !defined(HAVE_STRUCT_SOCKADDR_STORAGE) && !defined(_MSC_VER) | |
+#if !defined(HAVE_STRUCT_SOCKADDR_STORAGE) && !defined(_MSC_VER) && !defined(__OpenBSD__) | |
/* Alternative implementation in case the system doesn't provide | |
sockaddr_storage. The code is based on the reference implementation | |
provided in RFC3493. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OpenBSD5.3だと動かんようだ。
ext/utilでlibpthread.so.17.0をリンクしようとしてコケる。
でもext/tlsのビルドにpthread必須なのでちょっと考え中。