diff --git a/backends/common/Makefile.am b/backends/common/Makefile.am index d4bd477f..b320b959 100644 --- a/backends/common/Makefile.am +++ b/backends/common/Makefile.am @@ -4,6 +4,8 @@ INCLUDES = @INCLUDES@ backenddir = @LIBGTOP_BACKEND_DIR@ +dynamic_ldflags = @libgtop_dynamic_ldflags@ + backend_DATA = \ libgtop-common.backend @@ -18,7 +20,7 @@ libgtop_backend_common_la_SOURCES = \ marshal.c libgtop_backend_common_la_LDFLAGS = \ - $(LT_VERSION_INFO) -export-dynamic + $(LT_VERSION_INFO) $(dynamic_ldflags) BUILT_SOURCES = \ marshal.c diff --git a/backends/server/Makefile.am b/backends/server/Makefile.am index 8c873299..d65ae001 100644 --- a/backends/server/Makefile.am +++ b/backends/server/Makefile.am @@ -7,6 +7,8 @@ INCLUDES = @INCLUDES@ -D_BSD \ backenddir = @LIBGTOP_BACKEND_DIR@ +dynamic_ldflags = @libgtop_dynamic_ldflags@ + backend_DATA = \ libgtop-server.backend @@ -31,7 +33,7 @@ libgtop_backend_server_la_SOURCES = \ write.c libgtop_backend_server_la_LDFLAGS = \ - $(LT_VERSION_INFO) -export-dynamic + $(LT_VERSION_INFO) $(dynamic_ldflags) libgtop_server_SOURCES = \ server.c \ diff --git a/backends/sysdeps/Makefile.am b/backends/sysdeps/Makefile.am index e4e8887a..6051ebe6 100644 --- a/backends/sysdeps/Makefile.am +++ b/backends/sysdeps/Makefile.am @@ -4,6 +4,8 @@ INCLUDES = @INCLUDES@ backenddir = @LIBGTOP_BACKEND_DIR@ +dynamic_ldflags = @libgtop_dynamic_ldflags@ + backend_DATA = \ libgtop-sysdeps.backend @@ -18,7 +20,7 @@ libgtop_backend_sysdeps_la_SOURCES = \ marshal.c libgtop_backend_sysdeps_la_LDFLAGS = \ - $(LT_VERSION_INFO) -export-dynamic + $(LT_VERSION_INFO) $(dynamic_ldflags) BUILT_SOURCES = \ marshal.c diff --git a/libgtop-sysdeps.m4 b/libgtop-sysdeps.m4 index 326d2ca9..e3520516 100644 --- a/libgtop-sysdeps.m4 +++ b/libgtop-sysdeps.m4 @@ -165,6 +165,9 @@ AC_DEFUN([GNOME_LIBGTOP_DYNLINK],[ AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) + fi + + if test x$with_modules = xyes; then AC_MSG_CHECKING(whether dynamic modules work) oLIBS="$LIBS" oCFLAGS="$CFLAGS" @@ -206,10 +209,14 @@ AC_DEFUN([GNOME_LIBGTOP_DYNLINK],[ AC_SUBST(GMODULE_LIBS) AC_SUBST(GMODULE_FLAGS) libgtop_use_gmodule=yes + libgtop_dynamic_ldflags='-export-dynamic -module' else libgtop_use_gmodule=no + libgtop_dynamic_ldflags= fi + AC_SUBST(libgtop_dynamic_ldflags) + AC_MSG_RESULT($libgtop_use_gmodule) ]) diff --git a/sysdeps/common/Makefile.am b/sysdeps/common/Makefile.am index c05075c1..4e4f547d 100644 --- a/sysdeps/common/Makefile.am +++ b/sysdeps/common/Makefile.am @@ -2,6 +2,8 @@ LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ INCLUDES = @INCLUDES@ +dynamic_ldflags = @libgtop_dynamic_ldflags@ + if INODEDB inodedb_SRCLIST = inodedb.c inodedb_DEFS = -DSYSTEM_INODEDB=\"$(prefix)/var/libgtop/inodedb.db\" @@ -18,7 +20,7 @@ libgtop_common_la_SOURCES = xmalloc.c error.c \ fsusage.c fsusage.h mountlist.c mountlist.h \ $(inodedb_SRCLIST) -libgtop_common_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_common_la_LDFLAGS = $(LT_VERSION_INFO) $(dynamic_ldflags) libgtop_common_la_LIBADD = $(LIBGTOP_EXTRA_LIBS) libgtop_suid_common_la_SOURCES = xmalloc_suid.c error.c sysdeps_suid.c diff --git a/sysdeps/linux/Makefile.am b/sysdeps/linux/Makefile.am index a47dd604..87059b8e 100644 --- a/sysdeps/linux/Makefile.am +++ b/sysdeps/linux/Makefile.am @@ -2,6 +2,8 @@ LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ INCLUDES = @INCLUDES@ +dynamic_ldflags = @libgtop_dynamic_ldflags@ + backenddir = @LIBGTOP_BACKEND_DIR@ backend_LTLIBRARIES = libgtop_sysdeps.la @@ -14,6 +16,6 @@ libgtop_sysdeps_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ interfaces.c netinfo.c netload.c ppp.c libgtop_sysdeps_la_LIBADD = @GLIB_LIBS@ -libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO) -export-dynamic +libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO) $(dynamic_ldflags) include_HEADERS = glibtop_server.h glibtop_machine.h diff --git a/sysdeps/solaris/Makefile.am b/sysdeps/solaris/Makefile.am index f71b518a..760214c9 100644 --- a/sysdeps/solaris/Makefile.am +++ b/sysdeps/solaris/Makefile.am @@ -2,11 +2,7 @@ LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ INCLUDES = @INCLUDES@ -backenddir = @LIBGTOP_BACKEND_DIR@ - -backend_LTLIBRARIES = libgtop_sysdeps.la - -backend_LTLIBRARIES = libgtop_sysdeps.la libgtop_sysdeps_suid.la +lib_LTLIBRARIES = libgtop_sysdeps.la libgtop_sysdeps_suid.la libgtop_sysdeps_la_SOURCES = open.c close.c cpu.c mem.c \ safeio.c swap.c uptime.c loadavg.c \ @@ -16,14 +12,14 @@ libgtop_sysdeps_la_SOURCES = open.c close.c cpu.c mem.c \ procmap.c netload.c netinfo.c ppp.c \ procdata.c interfaces.c -libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO) -export-dynamic +libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO) -module -export-dynamic libgtop_sysdeps_la_LIBADD = @DL_LIB@ libgtop_sysdeps_suid_la_SOURCES = open_suid.c close_suid.c \ shm_limits.c msg_limits.c sem_limits.c -libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO) -export-dynamic +libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO) -module -export-dynamic include_HEADERS = glibtop_server.h glibtop_machine.h