]> Using LibGTop in the Gnome Project Martin Baulig
martin@home-of-linux.org
1998 Martin Baulig This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For more details see the file COPYING in the source distribution of LibGTop. This is a short introduction in how to use libgtop in the GNOME project. It describes the additional options configure takes and the information stored in the automatically generated libgtopConf.sh configuration script.
Autoconf macros <filename>macros/gnome-libgtop-check.m4</filename> Contains all that you need to include libgtop in any Gnome application. It defines GNOME_INIT_LIBGTOP which you can use in the same way like GNOME_INIT to check whether libgtop is installed and to read its libgtopConf.sh script. It automatically invokes GNOME_LIBGTOP_SYSDEPS. When libgtop can be found, it defines HAVE_LIBGTOP. There's also an automake conditional HAVE_LIBGTOP which you can use. <filename>macros/gnome-libgtop-sysdeps.m4</filename> This file defines GNOME_LIBGTOP_SYSDEPS which you can use to check which sysdeps directory libgtop should use and whether the gtop_server is needed. It defines the following variables: libgtop_sysdeps_dir The sysdeps dir libgtop uses. libgtop_use_machine_h Some of the system dependent parts of libgtop provide a structure _glibtop_machine defined in a header file glibtop_machine.h they provide. This structure gets inserted into the machine member of _glibtop when config.h defines HAVE_GLIBTOP_MACHINE_H. This variable is either yes or no and tells you whether this is the case. If it is true, this macro wil automatically define HAVE_GLIBTOP_MACHINE_H. libgtop_need_server Is either yes or no and tells you whether the server is needed. If it is needed, it will automatically define NEED_LIBGTOP. This macro also provides a conditional NEED_LIBGTOP which you can use in you Makefile.am. Configuration The configure script of libgtop takes some non-standard options to let you decide which parts of the library should be build. Normally, configure decides whether or not using the server is required. Depending upon this decision, it adds either -lgtop (when it's needed) or -lgtop_systems (when it's not needed) to LIBGTOP_LIBS and LIBGTOP_GUILE_LIBS. You can change this behaviour with the following options: --enable-libgtop-server Use the server regardless whether or not it is required. --disable-libgtop-server Do not use the server regardless wheter or not it is required. Normally, the guile interface of libgtop is build when guile can be found on the system. --disable-libgtop-guile Disables building the guile interface even if you have guile installed. --enable-libgtop-guile Has no effect at all since you cannot build the guile interface without having guile installed on your system. If you do not need the names subdirs, you can disable their building with the following option: --disable-libgtop-names Disables building of the names subdirs. --enable-libgtop-names Is the default. If it is enables, GLIBTOP_NAMES will be defined. To disable building of the examples, you can say: --without-examples Disables building of the examples. The <filename>libgtopConf.sh</filename> script After a successful build of libgtop, a libgtopConf.sh script is generated which will later be used to decide how to link a program with libgtop. It defines the following variables: LIBGTOP_LIBDIR Defaults to $(prefix)/lib. It is the directory where the libgtop libraries get installed. LIBGTOP_INCLUDEDIR Defaults to $(prefix)/include. It is the directory where the libgtop header files get installed. LIBGTOP_LIBS Contains everything that you need to add to the _LDADD variable of automake to link a program with libgtop. LIBGTOP_INCS Contains everything that you need to add to the _INCLUDES variable of automake to compile a program that uses libgtop. LIBGTOP_GUILE_INCS Contains everything that you need to add to the _INCLUDES variable of automake to compile a program that uses both libgtop and its guile interface. LIBGTOP_BINDIR Defaults to $(bindir). It is the directory where the libgtop binaries get installed. LIBGTOP_SERVER Defaults to $(bindir)/gtop_server. It is the full pathname where the server gets installed. libgtop_sysdeps_dir The sysdeps directory that is used on your system. libgtop_need_server Is either yes or no and tells you whether using the server is needed or not. libgtop_use_machine_h Is either yes or no and tells you whether glibtop_machine_h should be included in glibtop.h. The system dependent part of the library may provide an additional header file, glibtop_machine_h. In this case, they define a structure _glibtop_machine in this header file. This structure represents the machine member of _glibtop. libgtop_guile_found Is either yes or no and tells you whether guile has been found on your system (or if building the guile interface was disabled). libgtop_want_names Is either yes or no and tells you whether the sysdeps/names subdirectory was build. libgtop_want_guile_names Is either yes or no and tells you whether the sysdeps/guile/names subdirectory was build. libgtop_want_examples Is either yes or no and tells you whether the examples were build. Sample <filename>libgtopConf.sh</filename> &libgtopConf.sh;