Perrin Harkins wrote:
I pointed someone at some mod_perl documentation that suggested installing GTop to measure shared memory, but he was unable to find libgtop for download at the URL in that module. I investigated and I don't see it anywhere! Is libgtop gone? Did it get replaced with something else? Any Gnome followers here who can shed some light on this?
It's integrated into the gnome project and doesn't really exist as a standalone thing. At least I couldn't find it. When you install the gnome desktop, you get libgtop as well. So if you are on linux, simply check your distro for this package. e.g. use:

http://fr.rpmfind.net/linux/rpm2html/search.php?query=libgtop

in the worst case use the above resource to grap the src.rpm and then extract tar.gz from there.

If somebody here is involved deeper with gnome, please share some light with us.

While we are at this topic, I've patched GTop-0.10 to support libgtop-2.0 and libgtop-1.0 automatically (attached).

I've also backported it to 5.005_03 by including ppport.h in it. Hopefully Doug will release the new version soonish.

__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
--- GTop-0.10/Makefile.PL       2000-01-26 11:25:02.000000000 +1100
+++ GTop-0.10-dev/Makefile.PL   2002-12-27 11:36:26.000000000 +1100
@@ -231,12 +231,14 @@
     );
 }
 
+my %config = get_glibtop_config();
+
 WriteMakefile(
    @insure,
    NAME => 'GTop',
    VERSION_FROM => 'GTop.pm',
-   INC => $GTOP_INCLUDE . $ginc,
-   LIBS => [$GTOP_LIB . "-lgtop -lgtop_sysdeps -lgtop_common -lglib $xlibs"],
+   INC => join(" ", $GTOP_INCLUDE, $ginc, $config{incs}),
+   LIBS => [join(" ", $GTOP_LIB, $config{libs})],
    TYPEMAPS => [qw(typemap.gtop typemap)],
    clean   => {
        FILES => "@{[<*.boot>, <*.gtop>]}",
@@ -255,3 +257,27 @@
 EOF
 } 
 
+# get libgtop CFLAGS/LIBS across 1.x-2.x versions
+sub get_glibtop_config {
+    my %c = ();
+
+    if (system('pkg-config --exists libgtop-2.0') == 0) {
+        # 2.x
+        chomp($c{incs} = qx|pkg-config --cflags libgtop-2.0|);
+        chomp($c{libs} = qx|pkg-config --libs   libgtop-2.0|);
+
+        # 2.0.0 bugfix
+        chomp(my $libdir = qx|pkg-config --variable=libdir libgtop-2.0|);
+        $c{libs} =~ s|\$\(libdir\)|$libdir|;
+    }
+    elsif (system('gnome-config --libs libgtop') == 0) {
+        chomp($c{incs} = qx|gnome-config --cflags libgtop|);
+        chomp($c{libs} = qx|gnome-config --libs   libgtop|);
+
+        # buggy ( < 1.0.9?) versions fixup
+        $c{incs} =~ s|^/|-I/|;
+        $c{libs} =~ s|^/|-L/|;
+    }
+
+    return %c;
+}
--- GTop-0.10/Server/Makefile.PL        2000-02-01 09:05:49.000000000 +1100
+++ GTop-0.10-dev/Server/Makefile.PL    2002-12-27 11:36:26.000000000 +1100
@@ -36,13 +36,41 @@
 close FH;
 close CONST;
 
+my %config = get_glibtop_config();
+
 WriteMakefile(
     NAME => "GTop::Server",
     VERSION_FROM => "Server.pm",
-    INC => $GTOP_INCLUDE . $ginc,
-    LIBS => [$GTOP_LIB . "-lgtop -lgtop_sysdeps -lgtop_common -lglib"],
+    INC => join(" ", $GTOP_INCLUDE, $ginc, $config{incs}),
+    LIBS => [join(" ", $GTOP_LIB, $config{libs})],
     OBJECT => 'io.o main.o gnuserv.o version.o access.o Server.o',
     clean   => {
        FILES => "server_config_flags.h constants.c",
     },
 );
+
+
+# get libgtop CFLAGS/LIBS across 1.x-2.x versions
+sub get_glibtop_config {
+    my %c = ();
+
+    if (system('pkg-config --exists libgtop-2.0') == 0) {
+        # 2.x
+        chomp($c{incs} = qx|pkg-config --cflags libgtop-2.0|);
+        chomp($c{libs} = qx|pkg-config --libs   libgtop-2.0|);
+
+        # 2.0.0 bugfix
+        chomp(my $libdir = qx|pkg-config --variable=libdir libgtop-2.0|);
+        $c{libs} =~ s|\$\(libdir\)|$libdir|;
+    }
+    elsif (system('gnome-config --libs libgtop') == 0) {
+        chomp($c{incs} = qx|gnome-config --cflags libgtop|);
+        chomp($c{libs} = qx|gnome-config --libs   libgtop|);
+
+        # buggy ( < 1.0.9?) versions fixup
+        $c{incs} =~ s|^/|-I/|;
+        $c{libs} =~ s|^/|-L/|;
+    }
+
+    return %c;
+}


Reply via email to