Gnucash replaced dlopen/dlsym by the g_module functions,

so don't error out if they are unavailable; dlsym is needed 
only optionally for BSD linkers. Also removes quotation 
error in AC_MSG_ERROR macro.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13583 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2006-03-10 11:04:02 +00:00
parent b27cf4b130
commit 8c8cae582b
3 changed files with 17 additions and 6 deletions

View File

@ -1,5 +1,10 @@
2006-03-10 Christian Stimming <stimming@tuhh.de> 2006-03-10 Christian Stimming <stimming@tuhh.de>
* configure.in, src/gnome-utils/dialog-utils.c: Gnucash replaced
dlopen/dlsym by the g_module functions, so don't error out if they
are unavailable; dlsym is needed only optionally for BSD
linkers. Also removes quotation error in AC_MSG_ERROR macro.
* src/gnome-utils/gnc-druid-provider-multifile-gnome.h, * src/gnome-utils/gnc-druid-provider-multifile-gnome.h,
gnc-druid-provider-file-gnome.c: If <glob.h> unavailable, provide gnc-druid-provider-file-gnome.c: If <glob.h> unavailable, provide
own typedef and disable globbing. own typedef and disable globbing.

View File

@ -176,13 +176,13 @@ fi
AC_CHECK_HEADERS(dlfcn.h dl.h utmp.h locale.h mcheck.h unistd.h wctype.h) AC_CHECK_HEADERS(dlfcn.h dl.h utmp.h locale.h mcheck.h unistd.h wctype.h)
# Gnucash replaced dlopen/dlsym by the g_module functions; dlsym
# is needed optionally in one place for BSD linkers, though.
DL_LIB= DL_LIB=
AC_CHECK_FUNCS(dlopen,,[ AC_CHECK_FUNCS(dlsym,,[
AC_CHECK_LIB(dl, dlopen, DL_LIB="-ldl",[ AC_CHECK_LIB(dl, dlsym, DL_LIB="-ldl",[
AC_CHECK_LIB(dld, shl_load, DL_LIB="-ldld",[ AC_CHECK_LIB(dld, shl_load, DL_LIB="-ldld",[
AC_CHECK_FUNCS(dlopen, DL_LIB="", AC_CHECK_FUNCS(dlsym, DL_LIB="")
AC_MSG_ERROR(Dynamic linking is not available on this platform. Some apps,
like panel, will not run properly.))
]) ])
]) ])
]) ])

View File

@ -33,7 +33,9 @@
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include <glade/glade.h> #include <glade/glade.h>
#include <gmodule.h> #include <gmodule.h>
#include <dlfcn.h> #ifdef HAVE_DLFCN_H
# include <dlfcn.h>
#endif
#include "dialog-utils.h" #include "dialog-utils.h"
#include "gnc-commodity.h" #include "gnc-commodity.h"
@ -869,8 +871,12 @@ gnc_glade_autoconnect_full_func(const gchar *handler_name,
} }
if (!g_module_symbol(allsymbols, handler_name, (gpointer *)p_func)) { if (!g_module_symbol(allsymbols, handler_name, (gpointer *)p_func)) {
#ifdef HAVE_DLSYM
/* Fallback to dlsym -- necessary for *BSD linkers */ /* Fallback to dlsym -- necessary for *BSD linkers */
func = dlsym(RTLD_DEFAULT, handler_name); func = dlsym(RTLD_DEFAULT, handler_name);
#else
func = NULL;
#endif
if (func == NULL) { if (func == NULL) {
g_warning("ggaff: could not find signal handler '%s'.", handler_name); g_warning("ggaff: could not find signal handler '%s'.", handler_name);
return; return;