From 158dec2b2a12a12e861753da079f8a1dc0f4a691 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Tue, 21 Nov 2000 18:30:21 +0000 Subject: [PATCH] Removed gnomesupport checks here and started to use pkg-config. 2000-11-21 Martin Baulig * configure.in: Removed gnomesupport checks here and started to use pkg-config. * acinclude.m4: New file. Put contents of libgtop-sysdeps.m4 and xml.m4 and LIBGTOP_CHECK_TYPE here. * libgtop-sysdeps.m4, xml.m4: Removed. * Makefile.am (SUBDIRS): Don't compile support and macros. --- ChangeLog | 11 +++++ Makefile.am | 15 +------ libgtop-sysdeps.m4 => acinclude.m4 | 69 ++++++++++++++++++++++++++++++ autogen.sh | 2 +- configure.in | 45 ++++--------------- xml.m4 | 37 ---------------- 6 files changed, 90 insertions(+), 89 deletions(-) rename libgtop-sysdeps.m4 => acinclude.m4 (89%) delete mode 100644 xml.m4 diff --git a/ChangeLog b/ChangeLog index c525766e..5614c61e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-11-21 Martin Baulig + + * configure.in: Removed gnomesupport checks here and started + to use pkg-config. + + * acinclude.m4: New file. Put contents of libgtop-sysdeps.m4 + and xml.m4 and LIBGTOP_CHECK_TYPE here. + * libgtop-sysdeps.m4, xml.m4: Removed. + + * Makefile.am (SUBDIRS): Don't compile support and macros. + 2000-11-20 Martin Baulig Started with the big rewrite for GNOME 2.0: diff --git a/Makefile.am b/Makefile.am index 3c03f1d5..497622c4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1,6 @@ ## Process this file with automake to produce Makefile.in. -if BUILD_GNOME_SUPPORT -support = support -endif - -SUBDIRS = po intl $(support) macros misc include sysdeps backends lib \ - src doc dtd scripts +SUBDIRS = po intl misc include sysdeps backends lib src doc dtd scripts include_HEADERS = glibtop.h configincludedir = $(pkglibdir)/include @@ -44,14 +39,6 @@ CLEANFILES=libgtopConf.sh bin_SCRIPTS = $(top_builddir)/libgtop-config -## to automatically rebuild aclocal.m4 if any of the macros in -## `macros/' change -@MAINT@ include macros/macros.dep -@MAINT@macros/macros.dep: macros/Makefile.am -@MAINT@ cd macros && $(MAKE) macros.dep - -@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 ## the value NONE in configure if the user doesn't specify them (this diff --git a/libgtop-sysdeps.m4 b/acinclude.m4 similarity index 89% rename from libgtop-sysdeps.m4 rename to acinclude.m4 index aaee4c16..59044b84 100644 --- a/libgtop-sysdeps.m4 +++ b/acinclude.m4 @@ -1,3 +1,35 @@ +dnl +dnl LIBGTOP_CHECK_TYPE +dnl +dnl Improved version of AC_CHECK_TYPE which takes into account +dnl that we need to #include some other header files on some +dnl systems to get some types. + +dnl AC_LIBGTOP_CHECK_TYPE(TYPE, DEFAULT) +AC_DEFUN(AC_LIBGTOP_CHECK_TYPE, +[AC_REQUIRE([AC_HEADER_STDC])dnl +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(ac_cv_type_$1, +[AC_EGREP_CPP(dnl +changequote(<<,>>)dnl +<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl +changequote([,]), [#include +#if STDC_HEADERS +#include +#include +#endif + +/* For Tru64 */ +#ifdef HAVE_SYS_BITYPES_H +#include +#endif +], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl +AC_MSG_RESULT($ac_cv_type_$1) +if test $ac_cv_type_$1 = no; then + AC_DEFINE($1, $2) +fi +]) + dnl This is used internally for . AC_DEFUN([GNOME_LIBGTOP_TYPES_PRIVATE], @@ -489,3 +521,40 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ AM_CONDITIONAL(LIBGTOP_USE_GMODULE, test x$libgtop_use_gmodule = xyes) ]) +dnl +dnl LIBGTOP_XML_HOOK (script-if-xml-found, failflag) +dnl +dnl If failflag is "failure", script aborts due to lack of XML +dnl +dnl Check for availability of the libxml library +dnl the XML parser uses libz if available too +dnl + +AC_DEFUN([LIBGTOP_XML_HOOK],[ + LIBGTOP_XML_LIB= + AC_PATH_PROG(XML_CONFIG,xml-config,no) + if test "$XML_CONFIG" = no; then + if test x$2 = xfailure; then + AC_MSG_ERROR(Could not find xml-config) + else + AC_MSG_WARN(Could not find xml-config) + fi + else + AC_CHECK_LIB(xml, xmlDocGetRootElement, [ + $1 + LIBGTOP_XML_LIB=`$XML_CONFIG --libs` + AC_DEFINE(HAVE_LIBXML) + ], [ + if test x$2 = xfailure; then + AC_MSG_ERROR(Could not link sample xml program) + else + AC_MSG_WARN(Could not link sample xml program) + fi + ], `$XML_CONFIG --libs`) + fi + AC_SUBST(LIBGTOP_XML_LIB) +]) + +AC_DEFUN([LIBGTOP_XML_CHECK], [ + LIBGTOP_XML_HOOK([],failure) +]) diff --git a/autogen.sh b/autogen.sh index b3a5bce5..559d79a4 100755 --- a/autogen.sh +++ b/autogen.sh @@ -14,7 +14,7 @@ PKG_NAME="GNOME Portable System Access Library" exit 1 } -USE_GNOME_2_MACROS=1 . gnome-autogen.sh +USE_GNOME2_MACROS=1 . gnome-autogen.sh echo "" echo " *** IMPORTANT *** " diff --git a/configure.in b/configure.in index 6a810423..509f03a2 100644 --- a/configure.in +++ b/configure.in @@ -50,8 +50,10 @@ AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) +GNOME_INTERFACE_VERSION=2 +AC_SUBST(GNOME_INTERFACE_VERSION) + GNOME_COMMON_INIT -AM_ACLOCAL_INCLUDE(.) AC_ISC_POSIX AC_PROG_CC @@ -92,27 +94,9 @@ AM_PROG_LIBTOOL dnl Let the user enable compiler warnings GNOME_COMPILE_WARNINGS -GNOME_INIT_HOOK(gnome_found=yes) - -if test "x$gnome_found" != xyes; then - if test "x$want_gnome" != xno ; then - AC_MSG_ERROR([ -*** GNOME was not found on this system. *** - -*** If you want to use LibGTop without GNOME, you need -*** to give configure the --without-gnome parameter. -]) - else - AC_DEFINE(WITHOUT_GNOME) - fi - GNOME_SUPPORT_CHECKS -else - if test "x$want_gnome" != xno ; then - AM_CONDITIONAL(BUILD_GNOME_SUPPORT, false) - else - GNOME_SUPPORT_CHECKS - fi -fi +PKG_CHECK_MODULES(GNOMESUPPORT, gnome-support-2.0:1.2.1) +AC_SUBST(GNOMESUPPORT_CFLAGS) +AC_SUBST(GNOMESUPPORT_LIBS) AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes) @@ -227,17 +211,6 @@ AC_CHECK_LIB(kvm, kvm_open,[ dnl For DEC OSF1 AC_CHECK_LIB(mach, vm_statistics) -dnl For some broken libc5 systems (Debian 1.3) -saved_CFLAGS=$CFLAGS -CFLAGS="$CFLAGS -D_GNU_SOURCE" -GCC_NEED_DECLARATION(program_invocation_name, [ -#include -#include -#include -#include -]) -CFLAGS=$saved_CFLAGS - dnl Check for Internet sockets. AC_CHECK_FUNC(socket, [AC_CHECK_HEADER(netinet/in.h, @@ -262,7 +235,7 @@ AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname) dnl ## all 'es_??' are only needed for format numbers different of 'es' ALL_LINGUAS="ca da de el es es_DO es_GT es_HN es_MX es_PA es_PE es_SV fi fr ga gl hu ja ko nl no pl pt_BR ru sl sv uk zh_CN.GB2312" -AM_GNOME_GETTEXT +AM_GNOME2_GETTEXT AC_PATH_XTRA @@ -581,6 +554,4 @@ backends/sysdeps/Makefile backends/common/Makefile lib/Makefile doc/Makefile -dtd/Makefile -support/Makefile -macros/Makefile]) +dtd/Makefile]) diff --git a/xml.m4 b/xml.m4 deleted file mode 100644 index ec4f452d..00000000 --- a/xml.m4 +++ /dev/null @@ -1,37 +0,0 @@ -dnl -dnl LIBGTOP_XML_HOOK (script-if-xml-found, failflag) -dnl -dnl If failflag is "failure", script aborts due to lack of XML -dnl -dnl Check for availability of the libxml library -dnl the XML parser uses libz if available too -dnl - -AC_DEFUN([LIBGTOP_XML_HOOK],[ - LIBGTOP_XML_LIB= - AC_PATH_PROG(XML_CONFIG,xml-config,no) - if test "$XML_CONFIG" = no; then - if test x$2 = xfailure; then - AC_MSG_ERROR(Could not find xml-config) - else - AC_MSG_WARN(Could not find xml-config) - fi - else - AC_CHECK_LIB(xml, xmlDocGetRootElement, [ - $1 - LIBGTOP_XML_LIB=`$XML_CONFIG --libs` - AC_DEFINE(HAVE_LIBXML) - ], [ - if test x$2 = xfailure; then - AC_MSG_ERROR(Could not link sample xml program) - else - AC_MSG_WARN(Could not link sample xml program) - fi - ], `$XML_CONFIG --libs`) - fi - AC_SUBST(LIBGTOP_XML_LIB) -]) - -AC_DEFUN([LIBGTOP_XML_CHECK], [ - LIBGTOP_XML_HOOK([],failure) -])