diff --git a/ChangeLog b/ChangeLog index 9eef18b9..2ec66245 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2000-01-23 Martin Baulig + + * lib/sysdeps-init-kernel.c: Load the "glibtop-backend-kernel" before + "glibtop-backend-command" and "glibtop-backend-sysdeps". + + * libgtop-sysdeps.m4: "kernel" is now a backend and no longer a + sysdeps port; we compile the normal "linux" sysdeps dir when we + have it. + + * backends/Makefile.am: Only compile `server' and `sysdeps' + directories if appropriate. + 2000-01-22 Martin Baulig * include/glibtop/backend.h (_glibtop_backend_module): Added diff --git a/backends/Makefile.am b/backends/Makefile.am index e46d5c53..606b115e 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am @@ -1 +1,15 @@ -SUBDIRS = server sysdeps common +if NEED_LIBGTOP +server_dir = server +else +server_dir = +endif + +if HAVE_SYSDEPS +sysdeps_dir = sysdeps +else +sysdeps_dir = +endif + +SUBDIRS = $(server_dir) $(sysdeps_dir) common + +DIST_SUBDIRS = server sysdeps common diff --git a/configure.in b/configure.in index 487bcda2..ee0baabd 100644 --- a/configure.in +++ b/configure.in @@ -123,7 +123,11 @@ AC_SUBST(sysdeps_dir) AC_SUBST(sysdeps_name) AC_MSG_CHECKING(for sysdeps_init_file) -sysdeps_init_file='sysdeps-init-'"$libgtop_sysdeps_name"'.c' +if x$linux_sysctl = xyes ; then + sysdeps_init_file='sysdeps-init-kernel.c' +else + sysdeps_init_file='sysdeps-init-'"$libgtop_sysdeps_name"'.c' +fi AC_SUBST(sysdeps_init_file) AC_MSG_RESULT($sysdeps_init_file) diff --git a/lib/sysdeps-init-kernel.c b/lib/sysdeps-init-kernel.c index eec9bde6..73909ce2 100644 --- a/lib/sysdeps-init-kernel.c +++ b/lib/sysdeps-init-kernel.c @@ -31,6 +31,8 @@ void _glibtop_open_sysdeps (glibtop *server, const char *program_name, const unsigned long features, const unsigned flags) { + glibtop_open_backend_l (server, "glibtop-backend-kernel", + features, NULL); glibtop_open_backend_l (server, "glibtop-backend-common", features, NULL); glibtop_open_backend_l (server, "glibtop-backend-sysdeps", diff --git a/libgtop-sysdeps.m4 b/libgtop-sysdeps.m4 index 982a1b0d..f7ee6a6a 100644 --- a/libgtop-sysdeps.m4 +++ b/libgtop-sysdeps.m4 @@ -27,6 +27,7 @@ AC_DEFUN([LIBGTOP_HACKER_TESTS],[ #include #include +#include #include #include @@ -63,38 +64,38 @@ AC_DEFUN([LIBGTOP_CHECK_SYSDEPS_DIR],[ case "$host_os" in linux*) - if test x$linux_sysctl = xyes ; then - libgtop_sysdeps_dir=kernel - libgtop_use_machine_h=no - else - libgtop_sysdeps_dir=linux - libgtop_use_machine_h=no - fi + libgtop_sysdeps_dir=linux + libgtop_use_machine_h=no libgtop_have_sysinfo=yes libgtop_need_server=no + libgtop_has_sysdeps=yes ;; freebsd*|netbsd*|openbsd*) libgtop_sysdeps_dir=freebsd libgtop_use_machine_h=yes libgtop_need_server=yes + libgtop_has_sysdeps=no libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' ;; bsdi*) libgtop_sysdeps_dir=freebsd libgtop_use_machine_h=yes libgtop_need_server=yes + libgtop_has_sysdeps=no libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' ;; solaris*) libgtop_sysdeps_dir=solaris libgtop_use_machine_h=yes libgtop_need_server=yes + libgtop_has_sysdeps=yes libgtop_postinstall='chgrp sys $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' ;; osf*) libgtop_sysdeps_dir=osf1 libgtop_use_machine_h=yes libgtop_need_server=yes + libgtop_has_sysdeps=yes ;; *) if test x$hacker_mode = xyes ; then @@ -105,17 +106,20 @@ AC_DEFUN([LIBGTOP_CHECK_SYSDEPS_DIR],[ libgtop_sysdeps_dir=sun4 libgtop_use_machine_h=yes libgtop_need_server=yes + libgtop_has_sysdeps=no ;; *) libgtop_sysdeps_dir=stub libgtop_use_machine_h=no libgtop_need_server=no + libgtop_has_sysdeps=yes ;; esac else libgtop_sysdeps_dir=stub libgtop_use_machine_h=no libgtop_need_server=no + libgtop_has_sysdeps=yes fi ;; esac @@ -132,6 +136,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ AC_SUBST(libgtop_sysdeps_name) AC_SUBST(libgtop_use_machine_h) AC_SUBST(libgtop_need_server) + AC_SUBST(libgtop_has_sysdeps) AC_ARG_ENABLE(hacker-mode, [ --enable-hacker-mode Enable building of unstable sysdeps], @@ -179,41 +184,41 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ libgtop_use_machine_h=no libgtop_have_sysinfo=no libgtop_need_server=no + libgtop_has_sysdeps=yes ;; stub_suid) libgtop_sysdeps_dir=stub_suid libgtop_use_machine_h=yes libgtop_have_sysinfo=no libgtop_need_server=yes + libgtop_has_sysdeps=no ;; - linux) + linux|kernel) libgtop_sysdeps_dir=linux libgtop_use_machine_h=no libgtop_have_sysinfo=yes libgtop_need_server=no - ;; - kernel) - libgtop_sysdeps_dir=kernel - libgtop_use_machine_h=no - libgtop_have_sysinfo=yes - libgtop_need_server=no + libgtop_has_sysdeps=yes ;; bsd) libgtop_sysdeps_dir=freebsd libgtop_use_machine_h=yes libgtop_need_server=yes + libgtop_has_sysdeps=no libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' ;; solaris) libgtop_sysdeps_dir=solaris libgtop_use_machine_h=yes libgtop_need_server=yes + libgtop_has_sysdeps=yes libgtop_postinstall='chgrp sys $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' ;; osf) libgtop_sysdeps_dir=osf1 libgtop_use_machine_h=yes libgtop_need_server=yes + libgtop_has_sysdeps=yes ;; *) AC_MSG_ERROR(Invalid value for --with-sysdeps-dir) @@ -348,5 +353,6 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ fi AM_CONDITIONAL(NEED_LIBGTOP, test x$libgtop_need_server = xyes) + AM_CONDITIONAL(HAVE_SYSDEPS, test x$libgtop_has_sysdeps = xyes) ]) diff --git a/sysdeps/Makefile.am b/sysdeps/Makefile.am index 566d5e61..c1367757 100644 --- a/sysdeps/Makefile.am +++ b/sysdeps/Makefile.am @@ -1,4 +1,10 @@ -SUBDIRS = @sysdeps_dir@ common names +if LINUX_SYSCTL +kernel_dir = kernel +else +kernel_dir = +endif + +SUBDIRS = @sysdeps_dir@ $(kernel_dir) common names DIST_SUBDIRS = common linux kernel names osf1 \ stub stub_suid sun4 freebsd solaris