diff --git a/ChangeLog b/ChangeLog index 22ac6c64..b627f8de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-10-08 Laurent Vivier + + * Framework for AIX support + +2002-08-07 Vincent Berger + + * support/: Add alloca management for AIX + * configure.in: correct checking for nm + 2002-11-03 Dmitry G. Mastrukov * configure.in: Added Belarusian to ALL_LINGUAS diff --git a/acinclude.m4 b/acinclude.m4 index 9b8a426f..136c65ba 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -677,6 +677,9 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ linux*) libgtop_smp=yes ;; + aix*) + libgtop_smp=yes + ;; *) libgtop_smp=no ;; @@ -716,6 +719,13 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ libgtop_need_server=yes libgtop_postinstall='chgrp sys $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' ;; + aix*) + libgtop_sysdeps_dir=aix + libgtop_use_machine_h=yes + libgtop_need_server=yes + libgtop_have_sysinfo=yes + libgtop_postinstall='chgrp system $(bindir)/libgtop_server && chmod g+s $(bindir)/libgtop_server2' + ;; *) if test x$hacker_mode = xyes ; then case "$host_os" in @@ -874,4 +884,4 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ AM_CONDITIONAL(NEED_LIBGTOP, test x$libgtop_need_server = xyes) ]) - \ No newline at end of file + diff --git a/configure.in b/configure.in index c0b4af40..f69078bf 100644 --- a/configure.in +++ b/configure.in @@ -70,10 +70,8 @@ AC_CHECK_TOOL(CC,gcc) AC_CHECK_TOOL(RANLIB,ranlib) AC_CHECK_TOOL(AS,as) AC_CHECK_TOOL(AR,ar) -AC_CHECK_TOOL(NM,nm) -NM=`which $NM` -export CC CXX RANLIB LD AS AR NM +export CC CXX RANLIB LD AS AR AC_PROG_INSTALL AC_PROG_LN_S @@ -107,6 +105,7 @@ dnl else dnl GNOME_SUPPORT_CHECKS dnl fi dnl fi + AM_CONDITIONAL(BUILD_GNOME_SUPPORT, false) AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes) @@ -222,6 +221,10 @@ AC_CHECK_FUNCS(dlerror,,) LIBS="$oLIBS" AC_SUBST(DL_LIB) +dnl AIX +AH_TEMPLATE(HAVE_VMGETINFO, [Define to 1 if you have the `vmgetinfo' function in libperfstat]) +AC_CHECK_LIB(perfstat, vmgetinfo, AC_DEFINE(HAVE_VMGETINFO)) + dnl Solaris AC_CHECK_LIB(kstat, kstat_open) AC_CHECK_FUNCS(getloadavg swapctl) @@ -372,7 +375,7 @@ LIBGTOP_INCS="$LIBGTOP_INCS $SUPPORTINCS $GLIB_CFLAGS" LIBGTOP_GUILE_LIBS="$LIBGTOP_LIBS" LIBGTOP_GUILE_INCS="$LIBGTOP_INCS" LIBGTOP_BINDIR='$(bindir)' -LIBGTOP_SERVER='$(bindir)/libgtop_server' +LIBGTOP_SERVER='$(bindir)/libgtop_server2' sysdeps_dir="$libgtop_sysdeps_dir" AC_SUBST(sysdeps_dir) @@ -441,7 +444,7 @@ AC_SUBST(LIBGTOP_SERVER) if test x$libgtop_need_server = xyes ; then sysdeps_suid_lib="\$(top_builddir)/sysdeps/\$(sysdeps_dir)/libgtop_sysdeps_suid-2.0.la" - server_programs='libgtop_server' + server_programs='libgtop_server2' else sysdeps_suid_lib= server_programs= @@ -469,6 +472,7 @@ sysdeps/linux/Makefile sysdeps/kernel/Makefile sysdeps/freebsd/Makefile sysdeps/solaris/Makefile +sysdeps/aix/Makefile src/Makefile src/daemon/Makefile src/inodedb/Makefile diff --git a/examples/second.c b/examples/second.c index 6f8da35e..b65bf86f 100644 --- a/examples/second.c +++ b/examples/second.c @@ -22,6 +22,7 @@ */ #include +#include #include #include diff --git a/examples/smp.c b/examples/smp.c index 99b3a20f..f55df9ed 100644 --- a/examples/smp.c +++ b/examples/smp.c @@ -22,6 +22,7 @@ */ #include +#include #include #include @@ -42,6 +43,8 @@ main (int argc, char *argv []) bindtextdomain (GETTEXT_PACKAGE, GTOPLOCALEDIR); textdomain (GETTEXT_PACKAGE); + glibtop_init(); + glibtop_get_cpu (&cpu); ncpu = glibtop_global_server->ncpu ? glibtop_global_server->ncpu : 1; diff --git a/lib/Makefile.am b/lib/Makefile.am index 7a93f3d6..a1942003 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -9,6 +9,7 @@ libgtop_2_0_la_SOURCES = init.c open.c close.c command.c read.c \ sysdeps.c libgtop_2_0_la_LDFLAGS = $(LT_VERSION_INFO) +libgtop_2_0_la_LIBADD = $(top_builddir)/sysdeps/common/libgtop_common-2.0.la $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps-2.0.la $(sysdeps_suid_lib) $(INTLLIBS) BUILT_SOURCES = lib.c diff --git a/libgtop-sysdeps.m4 b/libgtop-sysdeps.m4 index b9009f0b..796376b1 100644 --- a/libgtop-sysdeps.m4 +++ b/libgtop-sysdeps.m4 @@ -91,6 +91,9 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ linux*) libgtop_smp=yes ;; + aix*) + libgtop_smp=yes + ;; *) libgtop_smp=no ;; @@ -130,6 +133,13 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ libgtop_need_server=yes libgtop_postinstall='chgrp sys $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' ;; + aix*) + libgtop_sysdeps_dir=aix + libgtop_use_machine_h=yes + libgtop_need_server=yes + libgtop_have_sysinfo=yes + libgtop_postinstall='chgrp system $(bindir)/libgtop_server && chmod g+s $(bindir)/libgtop_server2' + ;; *) if test x$hacker_mode = xyes ; then case "$host_os" in diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index 871e73e9..7b1e457a 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -15,9 +15,10 @@ LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ INCLUDES = $(LIBGTOP_CFLAGS) @INCLUDES@ -D_BSD \ - -DLIBGTOP_COMPILE_SYSTEM=\"`uname -s`\" \ - -DLIBGTOP_COMPILE_RELEASE=\"`uname -r`\" \ - -DLIBGTOP_COMPILE_MACHINE=\"`uname -m`\" + -DLIBGTOP_COMPILE_SYSTEM="\"`uname -s`\"" \ + -DLIBGTOP_COMPILE_RELEASE="\"`uname -r`\"" \ + -DLIBGTOP_COMPILE_VERSION="\"`uname -v`\"" \ + -DLIBGTOP_COMPILE_MACHINE="\"`uname -m`\"" if NEED_LIBGTOP suid_sysdeps = $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps_suid-2.0.la @@ -41,18 +42,10 @@ libgtop_daemon2_LDADD = $(top_builddir)/lib/libgtop-2.0.la \ $(LIBGTOP_LIBS)\ @LIBSUPPORT@ @INTLLIBS@ @libs_xauth@ -if ENABLE_STATIC -libgtop_daemon2_LDFLAGS = -static -endif - libgtop_server2_SOURCES = server.c slave.c io.c version.c daemon.h libgtop_server2_LDADD = $(top_builddir)/sysdeps/@sysdeps_dir@/libgtop_sysdeps_suid-2.0.la \ $(top_builddir)/sysdeps/common/libgtop_suid_common-2.0.la -if ENABLE_STATIC -libgtop_server2_LDFLAGS = -static -endif - EXTRA_DIST = server_config.h.in server_config.pl install-exec-hook: diff --git a/src/daemon/server.c b/src/daemon/server.c index a4e18476..0657d5e9 100644 --- a/src/daemon/server.c +++ b/src/daemon/server.c @@ -70,6 +70,21 @@ main(int argc, char *argv[]) if (uname (&uts) < 0) _exit (1); +#ifdef _AIX + /* + * [FIXME]: should be in sysdeps part ? + */ + + if ((strcmp (uts.sysname, LIBGTOP_COMPILE_SYSTEM) != 0) || + ((atol(uts.version) < atol(LIBGTOP_COMPILE_VERSION)) && + (atol(uts.release) < atol(LIBGTOP_COMPILE_RELEASE))) ) { + fprintf (stderr, "Can only run on %s %s.%s and upper\n", + LIBGTOP_COMPILE_SYSTEM, + LIBGTOP_COMPILE_VERSION, + LIBGTOP_COMPILE_RELEASE); + _exit (1); + } +#else if (strcmp (uts.sysname, LIBGTOP_COMPILE_SYSTEM) || strcmp (uts.release, LIBGTOP_COMPILE_RELEASE) || strcmp (uts.machine, LIBGTOP_COMPILE_MACHINE)) { @@ -79,6 +94,7 @@ main(int argc, char *argv[]) LIBGTOP_COMPILE_MACHINE); _exit (1); } +#endif glibtop_init_p (glibtop_global_server, 0, 0); diff --git a/sysdeps/Makefile.am b/sysdeps/Makefile.am index 7d524922..57c1909d 100644 --- a/sysdeps/Makefile.am +++ b/sysdeps/Makefile.am @@ -4,7 +4,7 @@ guile_SUBDIRS = ## endif -SUBDIRS = @sysdeps_dir@ common names $(guile_SUBDIRS) +SUBDIRS = common @sysdeps_dir@ names $(guile_SUBDIRS) DIST_SUBDIRS = common guile linux kernel names osf1 \ - stub stub_suid sun4 freebsd solaris + stub stub_suid sun4 freebsd solaris aix