[PATCH] Add BeOS



This is step 1 in adding BeOS.  There is a new file (gthread-beos.c) that
isn't with this patch and I have small patches for gtimer.c and gspawn.c
that add header files that are needed.

Please let me know of any problems and I will try to correct them.

david
Index: configure.in
===================================================================
RCS file: /cvs/gnome/glib/configure.in,v
retrieving revision 1.159
diff -u -r1.159 configure.in
--- configure.in	2000/11/15 17:48:42	1.159
+++ configure.in	2000/11/27 21:27:03
@@ -424,10 +424,18 @@
         AC_DEFINE(HAVE_SYS_SELECT_H,1,[found fd_set in sys/select.h])
         AC_MSG_RESULT([yes, found in sys/select.h])
     else
-	AC_DEFINE(NO_FD_SET,1,[didn't find fd_set])
-	AC_MSG_RESULT(no)
+        AC_HEADER_EGREP(fd_set, sys/socket.h, gtk_ok=yes)
+        if test $gtk_ok = yes; then
+            # This is for BeOS
+            AC_DEFINE(HAVE_SYS_SOCKET_H,1,[found fd_set in sys/socket.h])
+            AC_MSG_RESULT([yes, found in sys/socket.h])
+        else
+            AC_DEFINE(NO_FD_SET,1,[didn't find fd_set])
+            AC_MSG_RESULT(no)
+        fi
     fi
 fi
+AC_SEARCH_LIBS(select, socket bind)
 
 dnl *** check for sane realloc() ***
 AC_CACHE_CHECK([whether realloc (NULL,) will work],glib_cv_sane_realloc,[
@@ -571,9 +579,9 @@
 dnl *** load_image (BeOS)
 if test -z "$G_MODULE_IMPL" -a "x$glib_native_beos" = "xyes"; then
   AC_CHECK_LIB(root, load_image,
-      [G_MODULE_LIBS="-lbe -lroot -lglib"
+      [G_MODULE_LIBS="-lbe -lroot"
       G_MODULE_LIBS_EXTRA="-L\$(top_builddir_full)/.libs"
-      G_MODULE_PLUGIN_LIBS="-L\$(top_builddir_full)/gmodule/.libs -lgmodule"
+      G_MODULE_PLUGIN_LIBS="-L\$(top_builddir_full)/gmodule/.libs -lgmodule-1.3"
       G_MODULE_IMPL=G_MODULE_IMPL_BEOS],
       [])
 fi   
@@ -654,6 +662,13 @@
 if test -z "$G_MODULE_IMPL"; then
 	G_MODULE_IMPL=0
 fi
+
+case $host in
+    *-*-beos*)
+        OBJECT_LIBADD="-L../.libs -lglib-1.3"
+        ;;
+esac
+
 AC_SUBST(G_MODULE_IMPL)
 AC_SUBST(G_MODULE_LIBS)
 AC_SUBST(G_MODULE_LIBS_EXTRA)
@@ -662,7 +677,7 @@
 AC_SUBST(G_MODULE_HAVE_DLERROR)
 AC_SUBST(G_MODULE_NEED_USCORE)
 AC_SUBST(GLIB_DEBUG_FLAGS)
-
+AC_SUBST(OBJECT_LIBADD)
 
 dnl ***********************
 dnl *** g_thread checks ***
@@ -918,6 +933,12 @@
            mutex_header_file='thread.h'
 	   g_threads_impl="SOLARIS"
            ;;
+        beos)
+           G_THREAD_LIBS="-lbe -lroot"
+           mutex_has_default=no
+           mutex_header_file='kernel/OS.h'
+           g_threads_impl="BEOS"
+           ;;
         none)
 	   g_threads_impl="NONE"
            ;;
@@ -931,15 +952,6 @@
         AC_MSG_ERROR($LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2)
 fi
 
-case $host in
-  *-*-beos*)
-    G_THREAD_LIBS="-lbe -lroot -lglib "
-    G_THREAD_LIBS_EXTRA="-L\$(top_builddir_full)/.libs"
-    ;;
-  *)
-    ;;
-esac
-
 AC_MSG_CHECKING(thread related libraries)
 AC_MSG_RESULT($G_THREAD_LIBS)
 
@@ -1044,11 +1056,15 @@
 		fi
 		AC_DEFINE_UNQUOTED(POSIX_YIELD_FUNC,$posix_yield_func,[The POSIX RT yield function])
 		CPPFLAGS="$glib_save_CPPFLAGS"
-	else # solaris threads
+	elif test x"$have_threads" = xsolaris; then
 		GLIB_SIZEOF([#include <thread.h>],
 			thread_t,
 			system_thread)
-	fi
+	elif text x"$have_threads" = xbeos; then
+                GLIB_SIZEOF([#include <kernel/OS.h>],
+                         thread_id,
+                         system_thread)
+        fi
 
 	LIBS="$glib_save_LIBS"
 
Index: gfileutils.c
===================================================================
RCS file: /cvs/gnome/glib/gfileutils.c,v
retrieving revision 1.11
diff -u -r1.11 gfileutils.c
--- gfileutils.c	2000/11/13 19:01:27	1.11
+++ gfileutils.c	2000/11/27 21:27:03
@@ -52,6 +52,11 @@
 
 #endif /* G_OS_WIN32 */
 
+#ifdef G_OS_BEOS
+/* we need stdlib.h for the definition of mkstemp */
+#include <stdlib.h>
+#endif /* G_OS_BEOS */
+
 #ifndef S_ISLNK
 #define S_ISLNK(x) 0
 #endif
Index: gmain.c
===================================================================
RCS file: /cvs/gnome/glib/gmain.c,v
retrieving revision 1.42
diff -u -r1.42 gmain.c
--- gmain.c	2000/09/29 13:37:00	1.42
+++ gmain.c	2000/11/27 21:27:05
@@ -36,6 +36,13 @@
 /* uncomment the next line to get poll() debugging info */
 /* #define G_MAIN_POLL_DEBUG */
 
+#ifdef HAVE_SYS_SOCKET_H
+/* we include this here as it includes a file that defines MIN & MAX,
+ * so as we redefine them in gmacros.h this stops a warning...
+ */
+#include <sys/socket.h>
+#endif /* HAVE_SYS_SOCKET_H */
+
 #include "glib.h"
 #include <sys/types.h>
 #include <time.h>
@@ -57,10 +64,6 @@
 #include <windows.h>
 #endif /* G_OS_WIN32 */
 
-#ifdef G_OS_BEOS
-#include <net/socket.h>
-#endif /* G_OS_BEOS */
-
 /* Types */
 
 typedef struct _GTimeoutData GTimeoutData;
@@ -365,10 +368,6 @@
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif /* HAVE_SYS_SELECT_H */
-
-#ifdef G_OS_BEOS
-#undef NO_FD_SET
-#endif /* G_OS_BEOS */
 
 #ifndef NO_FD_SET
 #  define SELECT_MASK fd_set
Index: ltconfig
===================================================================
RCS file: /cvs/gnome/glib/ltconfig,v
retrieving revision 1.12
diff -u -r1.12 ltconfig
--- ltconfig	2000/03/22 10:04:29	1.12
+++ ltconfig	2000/11/27 21:27:12
@@ -1145,7 +1145,7 @@
 
   beos*)
     if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
-      allow_undefined_flag=unsupported
+      allow_undefined_flag=--ignore-undefined##unsupported
       # Joseph Beckenbach <jrb3 best com> says some releases of gcc
       # support --undefined.  This deserves some investigation.  FIXME
       archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
Index: gmodule/Makefile.am
===================================================================
RCS file: /cvs/gnome/glib/gmodule/Makefile.am,v
retrieving revision 1.24
diff -u -r1.24 Makefile.am
--- gmodule/Makefile.am	2000/10/16 01:02:17	1.24
+++ gmodule/Makefile.am	2000/11/27 21:27:15
@@ -40,17 +40,17 @@
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
 	-export-dynamic
 
-libgmodule_1_3_la_LIBADD = @G_MODULE_LIBS_EXTRA@ @G_MODULE_LIBS@ # $(libglib)
+libgmodule_1_3_la_LIBADD = @G_MODULE_LIBS_EXTRA@ @G_MODULE_LIBS@ @OBJECT_LIBADD@ # $(libglib)
 # we should really depend on $(libglib) for libgmodule.la, but libtool has a
 # problem with this ;(
 
 libgplugin_a_la_SOURCES = libgplugin_a.c
 libgplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
-libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ # $(libglib)
+libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ @OBJECT_LIBADD@ # $(libglib)
 
 libgplugin_b_la_SOURCES = libgplugin_b.c
 libgplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
-libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ # $(libglib)
+libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_LIBS_EXTRA@ @G_MODULE_PLUGIN_LIBS@ @OBJECT_LIBADD@ # $(libglib)
 
 noinst_PROGRAMS = testgmodule
 testgmodule_LDFLAGS += @G_MODULE_LDFLAGS@
Index: gmodule/gmodule.c
===================================================================
RCS file: /cvs/gnome/glib/gmodule/gmodule.c,v
retrieving revision 1.28
diff -u -r1.28 gmodule.c
--- gmodule/gmodule.c	2000/07/26 11:02:01	1.28
+++ gmodule/gmodule.c	2000/11/27 21:27:16
@@ -134,6 +134,8 @@
 #include "gmodule-dld.c"
 #elif	(G_MODULE_IMPL == G_MODULE_IMPL_WIN32)
 #include "gmodule-win32.c"
+#elif   (G_MODULE_IMPL == G_MODULE_IMPL_BEOS)
+#include "gmodule-beos.c"
 #else
 #undef	SUPPORT_OR_RETURN
 #define	SUPPORT_OR_RETURN(rv)	{ g_module_set_error ("dynamic modules are " \
Index: gobject/Makefile.am
===================================================================
RCS file: /cvs/gnome/glib/gobject/Makefile.am,v
retrieving revision 1.17
diff -u -r1.17 Makefile.am
--- gobject/Makefile.am	2000/11/13 19:01:28	1.17
+++ gobject/Makefile.am	2000/11/27 21:27:16
@@ -16,7 +16,7 @@
 libgobject_1_3_la_LDFLAGS = \
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
 	-export-dynamic
-libgobject_1_3_la_LIBADD = # $(libglib)
+libgobject_1_3_la_LIBADD = @OBJECT_LIBADD@ # $(libglib)
 
 #
 # setup source file variables
Index: gthread/Makefile.am
===================================================================
RCS file: /cvs/gnome/glib/gthread/Makefile.am,v
retrieving revision 1.19
diff -u -r1.19 Makefile.am
--- gthread/Makefile.am	2000/10/25 10:58:46	1.19
+++ gthread/Makefile.am	2000/11/27 21:27:16
@@ -29,7 +29,7 @@
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
 	-export-dynamic
 
-libgthread_1_3_la_LIBADD = @G_THREAD_LIBS_EXTRA@ @G_THREAD_LIBS@
+libgthread_1_3_la_LIBADD = @G_THREAD_LIBS_EXTRA@ @G_THREAD_LIBS@ @OBJECT_LIBADD@
 
 gthread.rc: $(top_builddir)/config.status $(top_srcdir)/gthread/gthread.rc.in
 	cd $(top_builddir) && CONFIG_FILES=gthread/$@ CONFIG_HEADERS= $(SHELL) ./config.status


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]