summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <baulig@suse.de>2001-02-14 23:42:19 +0000
committerMartin Baulig <martin@src.gnome.org>2001-02-14 23:42:19 +0000
commit1baa2ef8ff29edf8cb9f0be55576308ea09c3b68 (patch)
tree6f084d8df6a43fee68320030e2703432c97f3be6
parent0bd5a6c082739bdb2ba2259eed381a298fbe8807 (diff)
downloadlibgtop-1baa2ef8ff29edf8cb9f0be55576308ea09c3b68.tar.gz
Merged from LIBGTOP_1_1_2_PATCHES.
2001-02-14 Martin Baulig <baulig@suse.de> Merged from LIBGTOP_1_1_2_PATCHES. * libgtop-sysdeps.m4 (GLIBTOP_SOLARIS_RELEASE): Define this on Solaris; we use version codes like 270 for SunOS 5.7 and 251 for SunOS 2.5.1. * LIBGTOP-VERSION (LIBGTOP_VERSION_SUFFIX): Added this so you can have your tarballs called `libgtop-1.x.y-snap.tar.gz' or whatever. This only affects the `VERSION' variable and thus how the resulting tarball will be called, but not `LIBGTOP_VERSION_CODE' etc. * configure.in, acconfig.h: Added checks for <procfs.h> and <sys/procfs.h> * configure.in (DL_LIB): Check for dlopen() and AC_SUBST this. * Makefile.am: Make `aclocal.m4' also depend on `LIBGTOP-VERSION' when in maintainer-mode.
-rw-r--r--ChangeLog20
-rw-r--r--LIBGTOP-VERSION5
-rw-r--r--Makefile.am2
-rw-r--r--acconfig.h8
-rw-r--r--configure.in42
-rw-r--r--libgtop-sysdeps.m426
6 files changed, 97 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index e8990bb0..deed6e63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
2001-02-14 Martin Baulig <baulig@suse.de>
+ Merged from LIBGTOP_1_1_2_PATCHES.
+
+ * libgtop-sysdeps.m4 (GLIBTOP_SOLARIS_RELEASE): Define this on Solaris;
+ we use version codes like 270 for SunOS 5.7 and 251 for SunOS 2.5.1.
+
+ * LIBGTOP-VERSION (LIBGTOP_VERSION_SUFFIX): Added this so you can
+ have your tarballs called `libgtop-1.x.y-snap.tar.gz' or whatever.
+ This only affects the `VERSION' variable and thus how the resulting
+ tarball will be called, but not `LIBGTOP_VERSION_CODE' etc.
+
+ * configure.in, acconfig.h: Added checks for <procfs.h>
+ and <sys/procfs.h>
+
+ * configure.in (DL_LIB): Check for dlopen() and AC_SUBST this.
+
+ * Makefile.am: Make `aclocal.m4' also depend on `LIBGTOP-VERSION'
+ when in maintainer-mode.
+
+2001-02-14 Martin Baulig <baulig@suse.de>
+
* include/glibtop/limits.h: Removed; this file doesn't exist
in the stable branch.
diff --git a/LIBGTOP-VERSION b/LIBGTOP-VERSION
index 756e5700..c700e7b6 100644
--- a/LIBGTOP-VERSION
+++ b/LIBGTOP-VERSION
@@ -12,6 +12,9 @@ LIBGTOP_MICRO_VERSION=11
LIBGTOP_INTERFACE_AGE=10
LIBGTOP_BINARY_AGE=10
+# you can set this to `-snap' for instance to create
+# a `libgtop-1.x.y-snap.tar.gz' tarball.
+LIBGTOP_VERSION_SUFFIX=.1-solaris
# Increase each time you change the client/server protocol.
LIBGTOP_SERVER_VERSION=5
@@ -21,5 +24,5 @@ LIBGTOP_VERSION=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION.$LIBGTOP_MICRO_VER
LIBGTOP_VERSION_CODE=`echo "$LIBGTOP_MAJOR_VERSION 1000000 * $LIBGTOP_MINOR_VERSION 1000 * + $LIBGTOP_MICRO_VERSION + p q" | dc`
# For automake.
-VERSION=$LIBGTOP_VERSION
+VERSION=$LIBGTOP_VERSION$LIBGTOP_VERSION_SUFFIX
PACKAGE=libgtop
diff --git a/Makefile.am b/Makefile.am
index 8457feba..58fc3b7e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,7 +42,7 @@ bin_SCRIPTS = $(top_builddir)/libgtop-config
@MAINT@macros/macros.dep: macros/Makefile.am
@MAINT@ cd macros && $(MAKE) macros.dep
-@MAINT@$(top_srcdir)/aclocal.m4: libgtop-sysdeps.m4
+@MAINT@$(top_srcdir)/aclocal.m4: libgtop-sysdeps.m4 LIBGTOP-VERSION
## We create libgtopConf.sh here and not from configure because we want
## to get the paths expanded correctly. Macros like srcdir are given
diff --git a/acconfig.h b/acconfig.h
index 9da7413a..efe32e0f 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -156,6 +156,14 @@
*/
#undef GLIBTOP_LINUX_VERSION_CODE
+/* Solaris release code (eg. 251 for Solaris 2.5.1). */
+#undef GLIBTOP_SOLARIS_RELEASE
+
/* Define if you want to use LibGTop without GNOME. */
#undef WITHOUT_GNOME
+/* Define if you have the <procfs.h> header file */
+#undef HAVE_PROCFS_H
+
+/* Define if you have the <sys/procfs.h> header file */
+#undef HAVE_SYS_PROCFS_H
diff --git a/configure.in b/configure.in
index 8acee974..3b3caf48 100644
--- a/configure.in
+++ b/configure.in
@@ -33,6 +33,7 @@ AC_SUBST(LIBGTOP_BINARY_AGE)
AC_SUBST(LIBGTOP_SERVER_VERSION)
AC_SUBST(LIBGTOP_VERSION)
AC_SUBST(LIBGTOP_VERSION_CODE)
+AC_SUBST(LIBGTOP_VERSION_SUFFIX)
# libtool versioning
LT_RELEASE=$LIBGTOP_MAJOR_VERSION.$LIBGTOP_MINOR_VERSION
@@ -199,7 +200,45 @@ AC_CHECK_TYPE(ssize_t, int)
AC_CHECK_HEADERS(memory.h)
AC_CHECK_HEADERS(string.h strings.h, break)
AC_REPLACE_FUNCS(strerror)
-AC_CHECK_LIB(kvm, kvm_open)
+
+dnl dlopen() and dlsym()
+DL_LIB=
+AC_CHECK_FUNCS(dlopen,,[
+ AC_CHECK_LIB(dl, dlopen, DL_LIB="-ldl", [
+ AC_CHECK_LIB(dld, shl_load, DL_LIB="-ldld", [
+ AC_CHECK_FUNCS(dlopen, DL_LIB="", DL_LIB="")
+ ])
+ ])
+])
+oLIBS="$LIBS"
+LIBS="$LIBS $DL_LIB"
+AC_CHECK_FUNCS(dlerror,,)
+LIBS="$oLIBS"
+AC_SUBST(DL_LIB)
+
+dnl Solaris
+AC_CHECK_LIB(kstat, kstat_open)
+AC_CHECK_FUNCS(getloadavg swapctl)
+AC_CHECK_HEADERS(procfs.h sys/procfs.h, break)
+
+dnl Some versions of Solaris require -lelf for -lkvm
+AC_CHECK_LIB(kvm, kvm_open,[
+ LIBS="-lkvm $LIBS"
+],[AC_MSG_CHECKING(for kvm_open in -lkvm with -lelf)
+ AC_CACHE_VAL(ac_cv_lib_kvm_with_elf,
+ [ac_save_LIBS="$LIBS"
+ LIBS="-lkvm -lelf $LIBS"
+ AC_TRY_LINK([char kvm_open();], [kvm_open()],
+ ac_cv_lib_kvm_with_elf=yes, ac_cv_lib_kvm_with_elf=no)
+ LIBS="$ac_save_LIBS"
+ ])
+ if test "$ac_cv_lib_kvm_with_elf" = "yes"; then
+ AC_MSG_RESULT(yes)
+ LIBS="-lkvm -lelf $LIBS"
+ else
+ AC_MSG_RESULT(no)
+ fi
+])
dnl For DEC OSF1
AC_CHECK_LIB(mach, vm_statistics)
@@ -419,6 +458,7 @@ sysdeps/osf1/Makefile
sysdeps/linux/Makefile
sysdeps/kernel/Makefile
sysdeps/freebsd/Makefile
+sysdeps/solaris/Makefile
src/Makefile
src/daemon/Makefile
src/inodedb/Makefile
diff --git a/libgtop-sysdeps.m4 b/libgtop-sysdeps.m4
index 26538baf..b9009f0b 100644
--- a/libgtop-sysdeps.m4
+++ b/libgtop-sysdeps.m4
@@ -73,7 +73,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
AC_ARG_ENABLE(hacker-mode,
[ --enable-hacker-mode Enable building of unstable sysdeps],
- [hacker_mode="$withval"], [hacker_mode=no])
+ [hacker_mode="$enableval"], [hacker_mode=no])
AM_CONDITIONAL(HACKER_MODE, test x"$hacker_mode" = xyes)
@@ -124,12 +124,20 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
libgtop_need_server=yes
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_postinstall='chgrp sys $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server'
+ ;;
*)
if test x$hacker_mode = xyes ; then
case "$host_os" in
sunos4*)
+ #Please note that this port is obsolete and not working at
+ #all. It is only useful for people who want to fix it ... :-)
libgtop_sysdeps_dir=sun4
- libgtop_use_machine_h=yes
+ libgtop_use_machine_h=yes
libgtop_need_server=yes
;;
osf*)
@@ -177,7 +185,7 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
#include <net/netisr.h>
#include <net/route.h>
-#if (defined __FreeBSD__) || (defined __NetBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
#include <net/if_sppp.h>
#else
#include <i4b/sppp/if_sppp.h>
@@ -249,6 +257,18 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[
AC_DEFINE_UNQUOTED(GLIBTOP_LINUX_VERSION_CODE, $os_version_code)
AC_MSG_RESULT($os_version_code)
;;
+ solaris*)
+ os_major_version=`uname -r | sed 's/\([[0-9]]*\).\([[0-9]]\)\.*\([[0-9]]*\)/\1/'`
+ os_minor_version=`uname -r | sed 's/\([[0-9]]*\).\([[0-9]]\)\.*\([[0-9]]*\)/\2/'`
+ os_micro_version=`uname -r | sed 's/\([[0-9]]*\).\([[0-9]]\)\.*\([[0-9]]*\)/\3/'`
+ test -z "$os_micro_version" && os_micro_version=0
+ os_version_expr="$os_major_version 100 * $os_minor_version 10 * + $os_micro_version + p q"
+ os_version_code=`echo "$os_version_expr" | dc`
+
+ AC_MSG_CHECKING(for Solaris release code)
+ AC_DEFINE_UNQUOTED(GLIBTOP_SOLARIS_RELEASE, $os_version_code)
+ AC_MSG_RESULT($os_version_code)
+ ;;
esac
AC_MSG_CHECKING(for machine.h in libgtop sysdeps dir)