From 20c306fc6d2d6b2a164b78c3a2652e3c70ec5374 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Wed, 12 Jan 2000 22:46:29 +0000 Subject: [PATCH] Call `_glibtop_open_sysdeps'. 2000-01-12 Martin Baulig * lib/init.c (glibtop_init_s): Call `_glibtop_open_sysdeps'. * include/glibtop/open.h (_glibtop_open_sysdeps): Declare this when we are _IN_LIBGTOP. * configure.in (sysdeps_name): Define and AC_SUBST this. (sysdeps_init_file): Define and AC_SUBST this to `sysdeps-init-${sysdeps_name}.c'. * libgtop-sysdeps.m4 (GNOME_LIBGTOP_SYSDEPS): Define and AC_SUBST `libgtop_sysdeps_name'. --- ChangeLog | 14 ++++++++++++++ configure.in | 16 ++++++++++++---- include/glibtop/open.h | 7 +++++++ lib/Makefile.am | 7 ++++--- lib/init.c | 10 +--------- libgtop-sysdeps.m4 | 6 ++++++ 6 files changed, 44 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fe57704..2676da0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2000-01-12 Martin Baulig + + * lib/init.c (glibtop_init_s): Call `_glibtop_open_sysdeps'. + + * include/glibtop/open.h (_glibtop_open_sysdeps): Declare this + when we are _IN_LIBGTOP. + + * configure.in (sysdeps_name): Define and AC_SUBST this. + (sysdeps_init_file): Define and AC_SUBST this to + `sysdeps-init-${sysdeps_name}.c'. + + * libgtop-sysdeps.m4 (GNOME_LIBGTOP_SYSDEPS): Define and AC_SUBST + `libgtop_sysdeps_name'. + 2000-01-12 Martin Baulig * include/glibtop/errors.h (GLIBTOP_ERROR_NO_BACKEND_OPENED): diff --git a/configure.in b/configure.in index 10f40559..ce8c1fac 100644 --- a/configure.in +++ b/configure.in @@ -113,6 +113,16 @@ AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes) GNOME_LIBGTOP_SYSDEPS GNOME_LIBGTOP_TYPES +sysdeps_dir="$libgtop_sysdeps_dir" +sysdeps_name="$libgtop_sysdeps_name" +AC_SUBST(sysdeps_dir) +AC_SUBST(sysdeps_name) + +AC_MSG_CHECKING(for sysdeps_init_file) +sysdeps_init_file='sysdeps-init-'"$libgtop_sysdeps_name"'.c' +AC_SUBST(sysdeps_init_file) +AC_MSG_RESULT($sysdeps_init_file) + LIBGTOP_XML_CHECK AC_ARG_WITH(libgtop-inodedb, @@ -137,7 +147,8 @@ AM_CONDITIONAL(ENABLE_SHARED, test x$enable_static = xyes) AM_PROG_LIBTOOL -AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(GLIB >= 1.2.0 is required for LibGTop)) +AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(GLIB >= 1.2.0 is required for LibGTop), + [gmodule]) dnl You need to uncomment the following line if you want to use dnl libGTop without Gnome. @@ -323,9 +334,6 @@ LIBGTOP_INCS="$LIBGTOP_INCS $SUPPORTINCS $GLIB_CFLAGS" LIBGTOP_BINDIR='$(bindir)' LIBGTOP_SERVER='$(bindir)/libgtop_server' -sysdeps_dir="$libgtop_sysdeps_dir" -AC_SUBST(sysdeps_dir) - LIBGTOP_EXTRA_LIBS="$LIBGTOP_EXTRA_LIBS $GLIB_LIBS $LIBGTOP_XML_LIB" LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_sysdeps -lgtop_common -lgtop" diff --git a/include/glibtop/open.h b/include/glibtop/open.h index fa947c4c..7f8d5f25 100644 --- a/include/glibtop/open.h +++ b/include/glibtop/open.h @@ -68,6 +68,13 @@ void glibtop_open_s (glibtop *server, const char *program_name, const unsigned long features, const unsigned flags); +#ifdef _IN_LIBGTOP + +void +_glibtop_open_sysdeps (glibtop *server, const char *program_name, + const unsigned long features, const unsigned flags); + +#endif /* _IN_LIBGTOP */ END_LIBGTOP_DECLS diff --git a/lib/Makefile.am b/lib/Makefile.am index ef2164ed..d15ac1e6 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -4,9 +4,12 @@ INCLUDES = @INCLUDES@ lib_LTLIBRARIES = libgtop.la +sysdeps_init_file = @sysdeps_init_file@ + libgtop_la_SOURCES = init.c open.c close.c lib.c parameter.c \ sysdeps.c errors.c glib-arrays.c \ - backend.c init-backends.c open-backend.c + backend.c init-backends.c open-backend.c \ + $(sysdeps_init_file) libgtop_la_LDFLAGS = $(LT_VERSION_INFO) libgtop_la_LIBADD = $(LIBGTOP_XML_LIB) @@ -28,7 +31,5 @@ structures.h: structures.pl $(top_builddir)/config.h \ structures.h > tmp-s mv tmp-s structures.h -EXTRA_DIST = lib.pl structures.pl - CLEANFILES = $(BUILT_SOURCES) diff --git a/lib/init.c b/lib/init.c index ec5756a2..5335da53 100644 --- a/lib/init.c +++ b/lib/init.c @@ -247,9 +247,6 @@ glibtop * glibtop_init_s (glibtop **server_ptr, unsigned long features, unsigned flags) { glibtop *server; -#if 0 - glibtop_init_func_t *init_fkt; -#endif if (server_ptr == NULL) return NULL; @@ -264,20 +261,15 @@ glibtop_init_s (glibtop **server_ptr, unsigned long features, unsigned flags) if (flags & GLIBTOP_INIT_NO_INIT) return server; -#if 0 - /* Do the initialization, but only if not already initialized. */ - if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) { glibtop_open_s (server, "glibtop", features, flags); - for (init_fkt = _glibtop_init_hook_s; *init_fkt; init_fkt++) - (*init_fkt) (server); + _glibtop_open_sysdeps (server, "glibtop", features, flags); server->sysdeps.pointer_size = sizeof (void*)*8; server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS; } -#endif return server; } diff --git a/libgtop-sysdeps.m4 b/libgtop-sysdeps.m4 index 60711180..982a1b0d 100644 --- a/libgtop-sysdeps.m4 +++ b/libgtop-sysdeps.m4 @@ -4,6 +4,7 @@ dnl dnl It defines the following variables: dnl dnl * 'libgtop_sysdeps_dir' - sysdeps dir for libgtop. +dnl * 'libgtop_sysdeps_name' - name of the sysdeps dir. dnl * 'libgtop_use_machine_h' - some of system dependend parts of libgtop provide dnl their own header file. In this case we need to dnl define 'HAVE_GLIBTOP_MACHINE_H'. @@ -128,6 +129,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_SUBST(libgtop_sysdeps_dir) + AC_SUBST(libgtop_sysdeps_name) AC_SUBST(libgtop_use_machine_h) AC_SUBST(libgtop_need_server) @@ -219,6 +221,10 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ esac fi + AC_MSG_CHECKING(for libgtop sysdeps name) + libgtop_sysdeps_name=`echo $libgtop_sysdeps_dir | sed -e 's/_/-/g'` + AC_MSG_RESULT($libgtop_sysdeps_name) + AC_SUBST(libgtop_sysdeps_dir) AC_SUBST(libgtop_postinstall) AC_SUBST(libgtop_have_sysinfo)