diff --git a/ChangeLog b/ChangeLog index 383a0151..b70c9ba7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-01-09 Kevin Vandersloot + + * acinclude.m4: remove gnome support check. Fixes the build + for those with automake < 1.4p5. + + * configure.in: remove check for GNOME_SUPPORT + 2001-14-27 Miles Lane * acconfig.h: Added "#undef HAVE_GETTEXT" entry. diff --git a/Makefile.am b/Makefile.am index 7ac7fd6d..4e1c1c3f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,10 @@ ## Process this file with automake to produce Makefile.in. -## if EXAMPLES -## examples_SUBDIRS = examples -## else +if EXAMPLES +examples_SUBDIRS = examples +else examples_SUBDIRS = -## endif +endif if BUILD_GNOME_SUPPORT support = support diff --git a/acinclude.m4 b/acinclude.m4 index 3343fa51..04a52ad8 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,6 +1,6 @@ dnl This is just copied m4s from need-declaration.m4 gnome-fileutils.m4 dnl gnome-supprt-checks.m4 and a little from gnome-libgtop-check.m4 -dnl +dnl and finally libgtop-sysdeps.m4 dnl dnl LIBGTOP_CHECK_TYPE @@ -505,72 +505,296 @@ AC_CHECKING(for AFS) test -d /afs && AC_DEFINE(AFS) ]) -dnl GNOME_SUPPORT_CHECKS -dnl Check for various support functions needed by the standard -dnl Gnome libraries. Sets LIBOBJS, might define some macros. -dnl This should only be used when building the Gnome libs; -dnl Gnome clients should not need this macro. -AC_DEFUN([GNOME_SUPPORT_CHECKS],[ - # we need an `awk' to build `gnomesupport.h' - AC_REQUIRE([AC_PROG_AWK]) + - # this should go away soon - need_gnome_support=yes +dnl This file is intended for use both internally in libgtop and in every program +dnl that wants to use it. +dnl +dnl It defines the following variables: +dnl +dnl * 'libgtop_sysdeps_dir' - sysdeps dir for libgtop. +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'. +dnl * 'libgtop_need_server' - is the server really needed? Defines 'NEED_LIBGTOP' +dnl if true; defines conditional 'NEED_LIBGTOP'. - save_LIBOBJS="$LIBOBJS" - LIBOBJS= +AC_DEFUN([LIBGTOP_HACKER_TESTS],[ + AC_REQUIRE([AC_CANONICAL_HOST]) - AC_CHECK_FUNCS(getopt_long,,LIBOBJS="$LIBOBJS getopt.o getopt1.o") - - # for `scandir' - AC_HEADER_DIRENT + case "$host_os" in + linux*) + AC_ARG_WITH(linux-table, + [ --with-linux-table Use the table () function from Martin Baulig],[ + linux_table="$withval"],[linux_table=auto]) + if test $linux_table = yes ; then + AC_CHECK_HEADER(linux/table.h, linux_table=yes, linux_table=no) + elif test $linux_table = auto ; then + AC_MSG_CHECKING(for table function in Linux Kernel) + AC_TRY_RUN([ +#include +#include - # copied from `configure.in' of `libiberty' - vars="program_invocation_short_name program_invocation_name sys_errlist" - for v in $vars; do - AC_MSG_CHECKING([for $v]) - AC_CACHE_VAL(gnome_cv_var_$v, - [AC_TRY_LINK([int *p;], [extern int $v; p = &$v;], - [eval "gnome_cv_var_$v=yes"], - [eval "gnome_cv_var_$v=no"])]) - if eval "test \"`echo '$gnome_cv_var_'$v`\" = yes"; then - AC_MSG_RESULT(yes) - n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - AC_DEFINE_UNQUOTED($n) - else - AC_MSG_RESULT(no) - fi - done - - AC_REPLACE_FUNCS(memmove mkstemp scandir strcasecmp strerror strndup strnlen) - AC_REPLACE_FUNCS(strtok_r strtod strtol strtoul vasprintf vsnprintf) - - AC_CHECK_FUNCS(realpath,,LIBOBJS="$LIBOBJS canonicalize.o") +#include +#include +#include - # to include `error.c' error.c has some HAVE_* checks - AC_CHECK_FUNCS(vprintf doprnt strerror_r) - AM_FUNC_ERROR_AT_LINE +#include - # This is required if we declare setreuid () and setregid (). - AC_TYPE_UID_T +static inline _syscall3 (int, table, int, type, union table *, tbl, const void *, param); - # see if we need to declare some functions. Solaris is notorious for - # putting functions into the `libc' but not listing them in the headers - AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h dirent.h) - GCC_NEED_DECLARATIONS(gethostname setreuid setregid getpagesize) - GCC_NEED_DECLARATION(scandir,[ -#ifdef HAVE_DIRENT_H -#include -#endif +int +main (void) +{ + union table tbl; + int ret; + + ret = table (TABLE_VERSION, NULL, NULL); + + if (ret == -1) + exit (-errno); + + exit (ret < 1 ? ret : 0); +} +], linux_table=yes, linux_table=no, linux_table=no) + AC_MSG_RESULT($linux_table) + fi + if test $linux_table = yes ; then + AC_DEFINE(HAVE_LINUX_TABLE) + fi + AM_CONDITIONAL(LINUX_TABLE, test $linux_table = yes) + ;; + esac ]) - # Turn our LIBOBJS into libtool objects. This is gross, but it - # requires changes to autoconf before it goes away. - LTLIBOBJS=`echo "$LIBOBJS" | sed 's/\.o/.lo/g'` - AC_SUBST(need_gnome_support) - AC_SUBST(LTLIBOBJS) +AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ + AC_REQUIRE([AC_CANONICAL_HOST]) + + AC_SUBST(libgtop_sysdeps_dir) + AC_SUBST(libgtop_use_machine_h) + AC_SUBST(libgtop_need_server) + + AC_ARG_WITH(libgtop-examples, + [ --with-libgtop-examples Build the libgtop examples (default=no)],[ + build_examples="$withval"], [build_examples=no]) + + AM_CONDITIONAL(EXAMPLES, test x"$build_examples" = xyes) + + AC_ARG_ENABLE(hacker-mode, + [ --enable-hacker-mode Enable building of unstable sysdeps], + [hacker_mode="$enableval"], [hacker_mode=no]) + + AM_CONDITIONAL(HACKER_MODE, test x"$hacker_mode" = xyes) + + if test x$hacker_mode = xyes ; then + LIBGTOP_HACKER_TESTS + fi + + AC_ARG_WITH(libgtop-smp, + [ --with-libgtop-smp Enable SMP support (default-auto)],[ + libgtop_smp="$withval"],[libgtop_smp=auto]) + + if test $libgtop_smp = auto ; then + AC_MSG_CHECKING(whether to enable SMP support) + case "$host_os" in + linux*) + libgtop_smp=yes + ;; + *) + libgtop_smp=no + ;; + esac + AC_MSG_RESULT($libgtop_smp) + fi + + if test $libgtop_smp = yes ; then + AC_DEFINE(HAVE_LIBGTOP_SMP) + fi + + AM_CONDITIONAL(LIBGTOP_SMP, test $libgtop_smp = yes) + + AC_MSG_CHECKING(for libgtop sysdeps directory) + + case "$host_os" in + linux*) + if test x$linux_table = xyes ; then + libgtop_sysdeps_dir=kernel + libgtop_use_machine_h=no + else + libgtop_sysdeps_dir=linux + libgtop_use_machine_h=no + libgtop_have_sysinfo=yes + fi + libgtop_need_server=no + ;; + freebsd*|netbsd*|openbsd*|bsdi*) + libgtop_sysdeps_dir=freebsd + libgtop_use_machine_h=yes + 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_need_server=yes + ;; + osf*) + libgtop_sysdeps_dir=osf1 + libgtop_use_machine_h=yes + libgtop_need_server=yes + ;; + *) + libgtop_sysdeps_dir=stub + libgtop_use_machine_h=no + libgtop_need_server=no + ;; + esac + else + libgtop_sysdeps_dir=stub + libgtop_use_machine_h=no + libgtop_need_server=no + fi + ;; + esac + + test -z "$libgtop_postinstall" && libgtop_postinstall=: + + AC_MSG_RESULT($libgtop_sysdeps_dir) + + AC_SUBST(libgtop_sysdeps_dir) + AC_SUBST(libgtop_postinstall) + AC_SUBST(libgtop_have_sysinfo) + + case "$host_os" in + *bsd*) + AC_CHECK_HEADERS(net/if_var.h) + AC_MSG_CHECKING([for I4B]) + AC_TRY_COMPILE([ +#include +#include + +#include +#include + +#ifdef HAVE_NET_IF_VAR_H +#include +#endif + +#include +#include + +#if defined(__FreeBSD__) || defined(__NetBSD__) +#include +#else +#include +#endif +],[ + size_t size = sizeof (struct sppp); +], have_i4b=yes, have_i4b=no) + AC_MSG_RESULT($have_i4b) + if test x$have_i4b = xyes; then + AC_DEFINE(HAVE_I4B) + AC_MSG_CHECKING([for I4B accounting]) + AC_TRY_COMPILE([ +#include +#include + +#include +#include + +#ifdef HAVE_NET_IF_VAR_H +#include +#endif + +#include +#include + +#if defined(__FreeBSD__) || defined(__NetBSD__) +#include +#else +#include +#endif + +#include +],[ + size_t size = sizeof (struct i4bisppp_softc); +], have_i4b_acct=yes, have_i4b_acct=no) + AC_MSG_RESULT($have_i4b_acct) + if test x$have_i4b_acct = xyes ; then + AC_DEFINE(HAVE_I4B_ACCT) + else + AC_WARN([ +*** I4B accounting disabled - you won't get any PPP statistics. +*** Read "misc/i4b_acct.txt" in the LibGTop source directory +*** to see how to enable it.]) + fi + fi + ;; + linux*) + os_major_version=`uname -r | sed 's/-pre[[0-9]]*//' | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + os_minor_version=`uname -r | sed 's/-pre[[0-9]]*//' | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + os_micro_version=`uname -r | sed 's/-pre[[0-9]]*//' | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + os_version_expr="$os_major_version 65536 * $os_minor_version 256 * + $os_micro_version + p q" + + AC_CHECK_HEADERS(linux/version.h, have_linux_version_h=yes, + have_linux_version_h=no) + + if test x$have_linux_version_h = xyes ; then + version_code=`cat /usr/include/linux/version.h | \ + grep \#define | grep LINUX_VERSION_CODE` + os_version_code=`echo $version_code | \ + sed 's/^.*LINUX_VERSION_CODE[[ \t]]*\([[0-9]]*\).*$/\1/'` + else + os_version_code=`echo "$os_version_expr" | dc` + fi + + AC_MSG_CHECKING(for Linux kernel version code) + 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) + AC_MSG_RESULT($libgtop_use_machine_h) + + AC_MSG_CHECKING(whether we need libgtop) + AC_MSG_RESULT($libgtop_need_server) + + if test x$libgtop_need_server = xyes ; then + AC_DEFINE(NEED_LIBGTOP) + fi + + if test x$libgtop_use_machine_h = xyes ; then + AC_DEFINE(HAVE_GLIBTOP_MACHINE_H) + fi + + AM_CONDITIONAL(NEED_LIBGTOP, test x$libgtop_need_server = xyes) +]) - LIBOBJS="$save_LIBOBJS" - AM_CONDITIONAL(BUILD_GNOME_SUPPORT, test "$need_gnome_support" = yes) -]) \ No newline at end of file diff --git a/autogen.sh b/autogen.sh index 82d2be6c..075f5b39 100755 --- a/autogen.sh +++ b/autogen.sh @@ -3,7 +3,6 @@ srcdir=`dirname $0` test -z "$srcdir" && srcdir=. -ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I ." PKG_NAME="Gnome Top Library" diff --git a/configure.in b/configure.in index 21575bc5..70929633 100644 --- a/configure.in +++ b/configure.in @@ -115,7 +115,7 @@ export cross_compiling AM_PROG_LIBTOOL dnl Let the user enable compiler warnings -GNOME_COMPILE_WARNINGS +dnl GNOME_COMPILE_WARNINGS dnl GNOME_INIT_HOOK(gnome_found=yes) @@ -217,10 +217,6 @@ AC_SUBST(GLIB_LIBS) dnl AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(GLIB >= 1.2.0 is required for LibGTop)) -dnl You need to uncomment the following line if you want to use -dnl libGTop without Gnome. -GNOME_SUPPORT_CHECKS - dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE diff --git a/doc/Makefile.am b/doc/Makefile.am index 712a2002..fe6d7271 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -6,7 +6,7 @@ libgtop2_TEXINFOS = libgtop2.texi about.texi reference.texi \ MAKEINFO += -I @libgtop_top_builddir@/doc -EXTRA_DIST = auto-macros.texi +EXTRA_DIST = auto-macros.texi.in auto-macros.texi: auto-macros.texi.in Makefile ## Use sed and then mv to avoid problems if the user interrupts.