From c01b9850eb32da089b80886537995f039005d0a8 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sun, 16 Aug 1998 23:23:41 +0000 Subject: Completely rewrote this file. It uses now the `libgtop-config' script and 1998-08-17 Martin Baulig * gnome-libgtop-check.m4: Completely rewrote this file. It uses now the `libgtop-config' script and also checks for correct libgtop version. svn path=/trunk/; revision=320 --- macros/gnome-libgtop-check.m4 | 80 ++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 43 deletions(-) (limited to 'macros/gnome-libgtop-check.m4') diff --git a/macros/gnome-libgtop-check.m4 b/macros/gnome-libgtop-check.m4 index cc899e5eff..705a15c260 100644 --- a/macros/gnome-libgtop-check.m4 +++ b/macros/gnome-libgtop-check.m4 @@ -37,54 +37,48 @@ AC_DEFUN([GNOME_LIBGTOP_HOOK], AC_SUBST(LIBGTOP_BINDIR) AC_SUBST(LIBGTOP_SERVER) - if test x$exec_prefix = xNONE; then - if test x$prefix = xNONE; then - libgtop_prefix=$ac_default_prefix/lib - else - libgtop_prefix=$prefix/lib - fi - else - libgtop_prefix=`eval echo \`echo $libdir\`` - fi - - AC_ARG_WITH(libgtop-includes, - [ --with-libgtop-includes Specify location of LIBGTOP headers],[ - CFLAGS="$CFLAGS -I$withval" - ]) - - AC_ARG_WITH(libgtop-libs, - [ --with-libgtop-libs Specify location of LIBGTOP libs],[ - LDFLAGS="$LDFLAGS -L$withval" - libgtop_prefix=$withval - ]) - + dnl Get the cflags and libraries from the libgtop-config script + dnl AC_ARG_WITH(libgtop, - [ --with-libgtop Specify prefix for LIBGTOP files],[ - if test x$withval = xyes; then - dnl Note that an empty true branch is not valid sh syntax. - ifelse([$1], [], :, [$1]) - else - LDFLAGS="$LDFLAGS -L$withval/lib" - CFLAGS="$CFLAGS -I$withval/include" - libgtop_prefix=$withval/lib - fi - ]) + [ --with-libgtop=PFX Prefix where LIBGTOP is installed (optional)], + libgtop_config_prefix="$withval", libgtop_config_prefix="") + AC_ARG_WITH(libgtop-exec, + [ --with-libgtop-exec=PFX Exec prefix where LIBGTOP is installed (optional)], + libgtop_config_exec_prefix="$withval", libgtop_config_exec_prefix="") - AC_MSG_CHECKING(for libgtopConf.sh file in $libgtop_prefix) - if test -f $libgtop_prefix/libgtopConf.sh; then - AC_MSG_RESULT(found) - AC_DEFINE(HAVE_LIBGTOP) - echo "loading libgtop configuration from $libgtop_prefix/libgtopConf.sh" - . $libgtop_prefix/libgtopConf.sh - $1 + if test x$libgtop_config_exec_prefix != x ; then + libgtop_config_args="$libgtop_config_args --exec-prefix=$libgtop_config_exec_prefix" + if test x${LIBGTOP_CONFIG+set} != xset ; then + LIBGTOP_CONFIG=$libgtop_config_exec_prefix/bin/libgtop-config + fi + fi + if test x$libgtop_config_prefix != x ; then + libgtop_config_args="$libgtop_config_args --prefix=$libgtop_config_prefix" + if test x${LIBGTOP_CONFIG+set} != xset ; then + LIBGTOP_CONFIG=$libgtop_config_prefix/bin/libgtop-config + fi + fi + + AC_PATH_PROG(LIBGTOP_CONFIG, libgtop-config, no) + min_libgtop_version=ifelse([$1], ,0.25,$1) + AC_MSG_CHECKING(for libgtop - version >= $min_libgtop_version) + no_libgtop="" + if test "$LIBGTOP_CONFIG" = "no" ; then + no_libgtop=yes + else + configfile=`$LIBGTOP_CONFIG --config` + libgtop_version=`$LIBGTOP_CONFIG --version | sed -e 's,pre.*,,'` + test $libgtop_version \< $min_libgtop_version && no_libgtop=yes + . $configfile + fi + if test x$no_libgtop = x ; then + AC_DEFINE(HAVE_LIBGTOP) + AC_MSG_RESULT(yes) else - AC_MSG_RESULT(not found) - if test x$2 = xfail; then - AC_MSG_ERROR(Could not find the libgtopConf.sh file that is generated by libgtop install) - fi + AC_MSG_RESULT(no) fi - AM_CONDITIONAL(HAVE_LIBGTOP, test -f $libgtop_prefix/libgtopConf.sh) + AM_CONDITIONAL(HAVE_LIBGTOP, test x$no_libgtop != xyes) ]) AC_DEFUN([GNOME_INIT_LIBGTOP],[ -- cgit