diff options
author | CDT 1999 Shawn T. Amundson <amundson@gtk.org> | 1999-05-08 07:40:44 +0000 |
---|---|---|
committer | Shawn Amundson <amundson@src.gnome.org> | 1999-05-08 07:40:44 +0000 |
commit | 499c9786d1316bc72c539d55786bb3a65d95a83a (patch) | |
tree | 9af442bcdb994b2d8f4ae926d0ed0eb1edfdf02a | |
parent | 2b688f549c8a2719544b33859cdc5ef99355cf37 (diff) | |
download | glib-499c9786d1316bc72c539d55786bb3a65d95a83a.tar.gz glib-499c9786d1316bc72c539d55786bb3a65d95a83a.tar.bz2 glib-499c9786d1316bc72c539d55786bb3a65d95a83a.zip |
Port to BeOS by myself and Richard Offer.
Sat May 8 01:52:29 CDT 1999 Shawn T. Amundson <amundson@gtk.org>
* configure.in
gerror.c
gmain.c
gstrfuncs.c
gutils.c
ltconfig
ltmain.sh
gmodule/Makefile.am
gmodule/gmodule.c
gmodule/gmoduleconf.h.in
gmodule/gmodule-beos.c
gthread/Makefile.am: Port to BeOS by myself and Richard Offer.
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-12 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 15 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 15 | ||||
-rw-r--r-- | acconfig.h | 3 | ||||
-rw-r--r-- | configure.in | 37 | ||||
-rw-r--r-- | gbacktrace.c | 4 | ||||
-rw-r--r-- | gerror.c | 4 | ||||
-rw-r--r-- | glib/gbacktrace.c | 4 | ||||
-rw-r--r-- | glib/gerror.c | 4 | ||||
-rw-r--r-- | glib/gmain.c | 8 | ||||
-rw-r--r-- | glib/gstrfuncs.c | 5 | ||||
-rw-r--r-- | glib/gutils.c | 4 | ||||
-rw-r--r-- | gmain.c | 8 | ||||
-rw-r--r-- | gmodule/Makefile.am | 7 | ||||
-rw-r--r-- | gmodule/gmodule-beos.c | 171 | ||||
-rw-r--r-- | gmodule/gmodule.c | 2 | ||||
-rw-r--r-- | gmodule/gmoduleconf.h.in | 1 | ||||
-rw-r--r-- | gstrfuncs.c | 5 | ||||
-rw-r--r-- | gthread/Makefile.am | 2 | ||||
-rw-r--r-- | gutils.c | 4 | ||||
-rwxr-xr-x | ltconfig | 1 | ||||
-rw-r--r-- | ltmain.sh | 3 |
27 files changed, 387 insertions, 10 deletions
@@ -1,3 +1,18 @@ +Sat May 8 01:52:29 CDT 1999 Shawn T. Amundson + + * configure.in + gerror.c + gmain.c + gstrfuncs.c + gutils.c + ltconfig + ltmain.sh + gmodule/Makefile.am + gmodule/gmodule.c + gmodule/gmoduleconf.h.in + gmodule/gmodule-beos.c + gthread/Makefile.am: Port to BeOS by myself and Richard Offer. + 1999-05-06 Tor Lillqvist <tml@iki.fi> * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 46e13e160..850d2d5ff 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,18 @@ +Sat May 8 01:52:29 CDT 1999 Shawn T. Amundson + + * configure.in + gerror.c + gmain.c + gstrfuncs.c + gutils.c + ltconfig + ltmain.sh + gmodule/Makefile.am + gmodule/gmodule.c + gmodule/gmoduleconf.h.in + gmodule/gmodule-beos.c + gthread/Makefile.am: Port to BeOS by myself and Richard Offer. + 1999-05-06 Tor Lillqvist <tml@iki.fi> * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 46e13e160..850d2d5ff 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,18 @@ +Sat May 8 01:52:29 CDT 1999 Shawn T. Amundson + + * configure.in + gerror.c + gmain.c + gstrfuncs.c + gutils.c + ltconfig + ltmain.sh + gmodule/Makefile.am + gmodule/gmodule.c + gmodule/gmoduleconf.h.in + gmodule/gmodule-beos.c + gthread/Makefile.am: Port to BeOS by myself and Richard Offer. + 1999-05-06 Tor Lillqvist <tml@iki.fi> * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 46e13e160..850d2d5ff 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,18 @@ +Sat May 8 01:52:29 CDT 1999 Shawn T. Amundson + + * configure.in + gerror.c + gmain.c + gstrfuncs.c + gutils.c + ltconfig + ltmain.sh + gmodule/Makefile.am + gmodule/gmodule.c + gmodule/gmoduleconf.h.in + gmodule/gmodule-beos.c + gthread/Makefile.am: Port to BeOS by myself and Richard Offer. + 1999-05-06 Tor Lillqvist <tml@iki.fi> * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 46e13e160..850d2d5ff 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,18 @@ +Sat May 8 01:52:29 CDT 1999 Shawn T. Amundson + + * configure.in + gerror.c + gmain.c + gstrfuncs.c + gutils.c + ltconfig + ltmain.sh + gmodule/Makefile.am + gmodule/gmodule.c + gmodule/gmoduleconf.h.in + gmodule/gmodule-beos.c + gthread/Makefile.am: Port to BeOS by myself and Richard Offer. + 1999-05-06 Tor Lillqvist <tml@iki.fi> * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 46e13e160..850d2d5ff 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,18 @@ +Sat May 8 01:52:29 CDT 1999 Shawn T. Amundson + + * configure.in + gerror.c + gmain.c + gstrfuncs.c + gutils.c + ltconfig + ltmain.sh + gmodule/Makefile.am + gmodule/gmodule.c + gmodule/gmoduleconf.h.in + gmodule/gmodule-beos.c + gthread/Makefile.am: Port to BeOS by myself and Richard Offer. + 1999-05-06 Tor Lillqvist <tml@iki.fi> * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 46e13e160..850d2d5ff 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,18 @@ +Sat May 8 01:52:29 CDT 1999 Shawn T. Amundson + + * configure.in + gerror.c + gmain.c + gstrfuncs.c + gutils.c + ltconfig + ltmain.sh + gmodule/Makefile.am + gmodule/gmodule.c + gmodule/gmoduleconf.h.in + gmodule/gmodule-beos.c + gthread/Makefile.am: Port to BeOS by myself and Richard Offer. + 1999-05-06 Tor Lillqvist <tml@iki.fi> * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 46e13e160..850d2d5ff 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,18 @@ +Sat May 8 01:52:29 CDT 1999 Shawn T. Amundson + + * configure.in + gerror.c + gmain.c + gstrfuncs.c + gutils.c + ltconfig + ltmain.sh + gmodule/Makefile.am + gmodule/gmodule.c + gmodule/gmoduleconf.h.in + gmodule/gmodule-beos.c + gthread/Makefile.am: Port to BeOS by myself and Richard Offer. + 1999-05-06 Tor Lillqvist <tml@iki.fi> * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in diff --git a/acconfig.h b/acconfig.h index b62380027..aaa035c3e 100644 --- a/acconfig.h +++ b/acconfig.h @@ -54,6 +54,7 @@ #undef HAVE_LONG_DOUBLE #undef HAVE_POLL #undef HAVE_PWD_H +#undef HAVE_PW_GECOS #undef HAVE_SYS_PARAM_H #undef HAVE_SYS_POLL_H #undef HAVE_SYS_SELECT_H @@ -94,6 +95,8 @@ #undef G_THREAD_SOURCE +#undef GLIB_NATIVE_BEOS + /* #undef PACKAGE */ /* #undef VERSION */ diff --git a/configure.in b/configure.in index ea969fd86..03b58ffc3 100644 --- a/configure.in +++ b/configure.in @@ -78,6 +78,19 @@ AM_MAINTAINER_MODE AC_CANONICAL_HOST +AC_MSG_CHECKING(for the BeOS) +case $host in + *-*-beos*) + AC_DEFINE(GLIB_NATIVE_BEOS, 1) + glib_native_beos="yes" + AC_MSG_RESULT([$glib_native_beos]) + ;; + default) + glib_native_beos="no" + AC_MSG_RESULT($glib_native_beos) + ;; +esac + dnl figure debugging default, prior to $ac_help setup dnl AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl @@ -446,6 +459,7 @@ dnl *********************** dnl *** g_module checks *** dnl *********************** G_MODULE_LIBS= +G_MODULE_PLUGIN_LIBS= G_MODULE_LDFLAGS= dnl G_MODULE_IMPL= don't reset, so cmd-line can override G_MODULE_NEED_USCORE=0 @@ -458,6 +472,14 @@ if test -z "$G_MODULE_IMPL"; then ,) ,) fi +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 -L\$(top_builddir_full)/.libs -lglib" + G_MODULE_PLUGIN_LIBS="-L\$(top_builddir_full)/gmodule/.libs -lgmodule" + G_MODULE_IMPL=G_MODULE_IMPL_BEOS +,) +fi dnl *** dlopen() and dlsym() in libdl if test -z "$G_MODULE_IMPL"; then AC_CHECK_LIB(dl, dlopen, @@ -540,6 +562,7 @@ if test -z "$G_MODULE_IMPL"; then fi AC_SUBST(G_MODULE_IMPL) AC_SUBST(G_MODULE_LIBS) +AC_SUBST(G_MODULE_PLUGIN_LIBS) AC_SUBST(G_MODULE_LDFLAGS) AC_SUBST(G_MODULE_HAVE_DLERROR) AC_SUBST(G_MODULE_NEED_USCORE) @@ -708,6 +731,15 @@ if test "x$G_THREAD_LIBS" = xerror; then AC_MSG_ERROR($LIBS_NOT_FOUND_1$have_threads$LIBS_NOT_FOUND_2) fi +case $host in + *-*-beos*) + G_THREAD_LIBS="-lbe -lroot -L\$(top_builddir_full)/.libs -lglib " + ;; + *) + ;; +esac + + AC_MSG_CHECKING(thread related libraries) AC_MSG_RESULT($G_THREAD_LIBS) @@ -1258,6 +1290,11 @@ g_threads_impl_def=$g_threads_impl g_mutex_has_default="$mutex_has_default" g_mutex_sizeof="$glib_cv_sizeof_gmutex" g_mutex_contents="$glib_cv_byte_contents_gmutex" + +if test "x$glib_native_beos" = "xyes"; then + glib_native_beos_def="\$glib_native_beos_def +#define GLIB_NATIVE_BEOS 1" +fi ]) AC_OUTPUT([ diff --git a/gbacktrace.c b/gbacktrace.c index c1b5979e5..6e6e74f66 100644 --- a/gbacktrace.c +++ b/gbacktrace.c @@ -150,7 +150,7 @@ g_on_error_query (const gchar *prg_name) void g_on_error_stack_trace (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#if !defined(NATIVE_WIN32) && ! defined(GLIB_NATIVE_BEOS) pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; @@ -194,7 +194,7 @@ stack_trace_sigchld (int signum) static void stack_trace (char **args) { -#ifndef NATIVE_WIN32 +#if !defined(NATIVE_WIN32) && !defined(GLIB_NATIVE_BEOS) pid_t pid; int in_fd[2]; int out_fd[2]; @@ -150,7 +150,7 @@ g_on_error_query (const gchar *prg_name) void g_on_error_stack_trace (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#if !defined(NATIVE_WIN32) && ! defined(GLIB_NATIVE_BEOS) pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; @@ -194,7 +194,7 @@ stack_trace_sigchld (int signum) static void stack_trace (char **args) { -#ifndef NATIVE_WIN32 +#if !defined(NATIVE_WIN32) && !defined(GLIB_NATIVE_BEOS) pid_t pid; int in_fd[2]; int out_fd[2]; diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c index c1b5979e5..6e6e74f66 100644 --- a/glib/gbacktrace.c +++ b/glib/gbacktrace.c @@ -150,7 +150,7 @@ g_on_error_query (const gchar *prg_name) void g_on_error_stack_trace (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#if !defined(NATIVE_WIN32) && ! defined(GLIB_NATIVE_BEOS) pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; @@ -194,7 +194,7 @@ stack_trace_sigchld (int signum) static void stack_trace (char **args) { -#ifndef NATIVE_WIN32 +#if !defined(NATIVE_WIN32) && !defined(GLIB_NATIVE_BEOS) pid_t pid; int in_fd[2]; int out_fd[2]; diff --git a/glib/gerror.c b/glib/gerror.c index c1b5979e5..6e6e74f66 100644 --- a/glib/gerror.c +++ b/glib/gerror.c @@ -150,7 +150,7 @@ g_on_error_query (const gchar *prg_name) void g_on_error_stack_trace (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#if !defined(NATIVE_WIN32) && ! defined(GLIB_NATIVE_BEOS) pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; @@ -194,7 +194,7 @@ stack_trace_sigchld (int signum) static void stack_trace (char **args) { -#ifndef NATIVE_WIN32 +#if !defined(NATIVE_WIN32) && !defined(GLIB_NATIVE_BEOS) pid_t pid; int in_fd[2]; int out_fd[2]; diff --git a/glib/gmain.c b/glib/gmain.c index bab33b69b..c95dc2dd0 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -54,6 +54,10 @@ #include <windows.h> #endif /* NATIVE_WIN32 */ +#ifdef GLIB_NATIVE_BEOS +#include <net/socket.h> +#endif /* GLIB_NATIVE_BEOS */ + /* Types */ typedef struct _GTimeoutData GTimeoutData; @@ -318,6 +322,10 @@ g_poll (GPollFD *fds, guint nfds, gint timeout) #include <sys/select.h> #endif /* HAVE_SYS_SELECT_H */ +#ifdef GLIB_NATIVE_BEOS +#undef NO_FD_SET +#endif /* GLIB_NATIVE_BEOS */ + #ifndef NO_FD_SET # define SELECT_MASK fd_set #else /* !NO_FD_SET */ diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c index f24fdcb20..d490dffd1 100644 --- a/glib/gstrfuncs.c +++ b/glib/gstrfuncs.c @@ -669,7 +669,12 @@ g_strsignal (gint signum) char *msg; #ifdef HAVE_STRSIGNAL +#ifdef GLIB_NATIVE_BEOS +extern const char * strsignal(int); +#else /* !GLIB_NATIVE_BEOS */ + /* this is declared differently (const) in string.h on BeOS */ extern char *strsignal (int sig); +#endif return strsignal (signum); #elif NO_SYS_SIGLIST switch (signum) diff --git a/glib/gutils.c b/glib/gutils.c index 4d90a6671..fd468f790 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -504,7 +504,11 @@ g_get_any_init (void) if (pw) { g_user_name = g_strdup (pw->pw_name); +#ifdef HAVE_PW_GECOS g_real_name = g_strdup (pw->pw_gecos); +#else + g_real_name = g_strdup (g_user_name); +#endif if (!g_home_dir) g_home_dir = g_strdup (pw->pw_dir); } @@ -54,6 +54,10 @@ #include <windows.h> #endif /* NATIVE_WIN32 */ +#ifdef GLIB_NATIVE_BEOS +#include <net/socket.h> +#endif /* GLIB_NATIVE_BEOS */ + /* Types */ typedef struct _GTimeoutData GTimeoutData; @@ -318,6 +322,10 @@ g_poll (GPollFD *fds, guint nfds, gint timeout) #include <sys/select.h> #endif /* HAVE_SYS_SELECT_H */ +#ifdef GLIB_NATIVE_BEOS +#undef NO_FD_SET +#endif /* GLIB_NATIVE_BEOS */ + #ifndef NO_FD_SET # define SELECT_MASK fd_set #else /* !NO_FD_SET */ diff --git a/gmodule/Makefile.am b/gmodule/Makefile.am index 2aaa1e1e8..8d28f5e9a 100644 --- a/gmodule/Makefile.am +++ b/gmodule/Makefile.am @@ -10,6 +10,7 @@ EXTRA_DIST = \ gmodule-dld.c \ gmodule-os2.c \ gmodule-win32.c \ + gmodule-beos.c \ gmoduleconf.h.win32 BUILT_SOURCES = gmoduleconf.h @@ -20,6 +21,8 @@ include_HEADERS = \ libglib = $(top_builddir)/libglib.la # -lglib +top_builddir_full=`cd \$(top_builddir); pwd` + lib_LTLIBRARIES = libgmodule.la libgplugin_a.la libgplugin_b.la libgmodule_la_SOURCES = gmodule.c @@ -34,11 +37,11 @@ libgmodule_la_LIBADD = @G_MODULE_LIBS@ # $(libglib) libgplugin_a_la_SOURCES = libgplugin_a.c libgplugin_a_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module -libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ # $(libglib) +libgplugin_a_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_PLUGIN_LIBS@ # $(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@ # $(libglib) +libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ @G_MODULE_PLUGIN_LIBS@ # $(libglib) noinst_PROGRAMS = testgmodule testgmodule_LDFLAGS += @G_MODULE_LDFLAGS@ diff --git a/gmodule/gmodule-beos.c b/gmodule/gmodule-beos.c new file mode 100644 index 000000000..8cc99b232 --- /dev/null +++ b/gmodule/gmodule-beos.c @@ -0,0 +1,171 @@ +/* GMODULE - GLIB wrapper code for dynamic module loading + * Copyright (C) 1998 Tim Janik + * + * BeOS GMODULE implementation + * Copyright (C) 1999 Richard Offer and Shawn T. Amundson (amundson@gtk.org) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +/* + * MT safe + */ + +#include <be/kernel/image.h> /* image (aka DSO) handling functions... */ + +/* + * The BeOS doesn't use the same symantics as Unix's dlopen.... + * + */ +#ifndef RTLD_GLOBAL +#define RTLD_GLOBAL 0 +#endif /* RTLD_GLOBAL */ +#ifndef RTLD_LAZY +#define RTLD_LAZY 1 +#endif /* RTLD_LAZY */ +#ifndef RTLD_NOW +#define RTLD_NOW 0 +#endif /* RTLD_NOW */ + + +/* + * Points to Ponder + * + * You can load the same DSO more than once, in which case you'll have + * different image_id's. While this means that we don't have to worry about + * reference counts, it could lead to problems in the future.... + * richard. + */ + +#include <Errors.h> +#include <stdio.h> + +/* --- functions --- */ +static gpointer +_g_module_open (const gchar *file_name, + gboolean bind_lazy) +{ + image_id handle; + + handle = load_add_on (file_name); + if (handle < B_OK) { + g_module_set_error (g_strdup_printf("failed to load_add_on(%s), reason: %s", + (gchar *) file_name, strerror(handle))); + return NULL; + } + + return (gpointer) handle; +} + +static gpointer +_g_module_self (void) +{ + image_info info; + int32 cookie = 0; + status_t status; + + /* Is it always the first one? I'm guessing yes. */ + if ((status = get_next_image_info(0, &cookie, &info)) == B_OK) + return (gpointer) info.id; + else + { + g_module_set_error (g_strdup_printf("get_next_image_info() for self failed, reason: %s", strerror(status))); + return NULL; + } +} + +static void +_g_module_close (gpointer handle, + gboolean is_unref) +{ + image_info info; + gchar *name; + + if (unload_add_on((image_id) handle) != B_OK) + { + /* Try and get the name of the image. */ + if (get_image_info((image_id) handle, &info) != B_OK) + name = g_strdup("(unknown)"); + else + name = g_strdup (info.name); + + g_module_set_error (g_strdup_printf("failed to unload_add_on(%s)", + name)); + g_free (name); + } +} + +static gpointer +_g_module_symbol (gpointer handle, + const gchar *symbol_name) +{ + image_id id; + gpointer p; + status_t status; + image_info info; + gchar name[256]; + int32 name_len; + int32 type; + int32 n; + + id = (image_id) handle; + + if ((status = get_image_info(id, &info)) != B_OK) + { + g_module_set_error (g_strdup_printf("failed get_image_info(), reason: %s", strerror(status))); + return NULL; + } + + name_len = 256; + type = B_SYMBOL_TYPE_ANY; + n = 0; + while ((status = get_nth_image_symbol(id, n, name, &name_len, &type, (void **)&p)) == B_OK) + { + if (!strncmp (name, symbol_name, strlen(symbol_name))) + { + return p; + } + + if (!strcmp (name, "_end")) + { + g_module_set_error (g_strdup_printf("g_module_symbol(): no symbol matching '%s'", symbol_name)); + return NULL; + } + + name_len = 256; + type = B_SYMBOL_TYPE_ANY; + n++; + } + + g_module_set_error (g_strdup_printf("failed get_image_symbol(%s), reason: %s", symbol_name, strerror(status))); + return NULL; +} + +static gchar* +_g_module_build_path (const gchar *directory, + const gchar *module_name) +{ + printf("WARNING: _g_module_build_path() untested!\n"); + if (directory && *directory) { + if (strncmp (module_name, "lib", 3) == 0) + return g_strconcat (directory, "/", module_name, NULL); + else + return g_strconcat (directory, "/lib", module_name, ".so", NULL); + } else if (strncmp (module_name, "lib", 3) == 0) + return g_strdup (module_name); + else + return g_strconcat ("lib", module_name, ".so", NULL); +} diff --git a/gmodule/gmodule.c b/gmodule/gmodule.c index 3ae1ed0fa..e72d4cd11 100644 --- a/gmodule/gmodule.c +++ b/gmodule/gmodule.c @@ -136,6 +136,8 @@ g_module_set_error (const gchar *error) #include "gmodule-win32.c" #elif (G_MODULE_IMPL == G_MODULE_IMPL_OS2) #include "gmodule-os2.c" +#elif (G_MODULE_IMPL == G_MODULE_IMPL_BEOS) +#include "gmodule-beos.c" #else #undef CHECK_ERROR #define CHECK_ERROR(rv) { g_module_set_error ("dynamic modules are " \ diff --git a/gmodule/gmoduleconf.h.in b/gmodule/gmoduleconf.h.in index 0f3b6f9ed..65bc6793b 100644 --- a/gmodule/gmoduleconf.h.in +++ b/gmodule/gmoduleconf.h.in @@ -30,6 +30,7 @@ extern "C" { #define G_MODULE_IMPL_DLD 2 #define G_MODULE_IMPL_WIN32 3 #define G_MODULE_IMPL_OS2 4 +#define G_MODULE_IMPL_BEOS 5 #define G_MODULE_IMPL @G_MODULE_IMPL@ #undef G_MODULE_HAVE_DLERROR diff --git a/gstrfuncs.c b/gstrfuncs.c index f24fdcb20..d490dffd1 100644 --- a/gstrfuncs.c +++ b/gstrfuncs.c @@ -669,7 +669,12 @@ g_strsignal (gint signum) char *msg; #ifdef HAVE_STRSIGNAL +#ifdef GLIB_NATIVE_BEOS +extern const char * strsignal(int); +#else /* !GLIB_NATIVE_BEOS */ + /* this is declared differently (const) in string.h on BeOS */ extern char *strsignal (int sig); +#endif return strsignal (signum); #elif NO_SYS_SIGLIST switch (signum) diff --git a/gthread/Makefile.am b/gthread/Makefile.am index f24dffb2a..35b9d2df4 100644 --- a/gthread/Makefile.am +++ b/gthread/Makefile.am @@ -12,6 +12,8 @@ EXTRA_DIST = \ libglib = $(top_builddir)/libglib.la # -lglib +top_builddir_full=`cd \$(top_builddir); pwd` + lib_LTLIBRARIES = libgthread.la libgthread_la_SOURCES = gthread.c @@ -504,7 +504,11 @@ g_get_any_init (void) if (pw) { g_user_name = g_strdup (pw->pw_name); +#ifdef HAVE_PW_GECOS g_real_name = g_strdup (pw->pw_gecos); +#else + g_real_name = g_strdup (g_user_name); +#endif if (!g_home_dir) g_home_dir = g_strdup (pw->pw_dir); } @@ -1694,6 +1694,7 @@ beos*) library_names_spec='${libname}.so' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH + deplibs_check_method=pass_all lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes @@ -788,6 +788,9 @@ compiler." # } # /* impgen.c ends here */ ;; + *-*-beos*) + allow_undefined=no + ;; *) allow_undefined=yes ;; |