Add support for mgLib too. 1.2.7
authormdw <mdw>
Thu, 11 Nov 1999 20:03:58 +0000 (20:03 +0000)
committermdw <mdw>
Thu, 11 Nov 1999 20:03:58 +0000 (20:03 +0000)
aclocal.glob

index 3606cf5..0f4b4d8 100644 (file)
@@ -1,6 +1,6 @@
 dnl -*-fundamental-*-                                    *@--GLOB-HEADER--@*
 dnl
-dnl $Id: aclocal.glob,v 1.6 1999/11/11 17:49:33 mdw Exp $
+dnl $Id: aclocal.glob,v 1.7 1999/11/11 20:03:58 mdw Exp $
 dnl
 dnl Common library of autoconf macros
 dnl
@@ -28,6 +28,9 @@ dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 dnl----- Revision history ---------------------------------------------------
 dnl
 dnl $Log: aclocal.glob,v $
+dnl Revision 1.7  1999/11/11 20:03:58  mdw
+dnl Add support for mgLib too.
+dnl
 dnl Revision 1.6  1999/11/11 17:49:33  mdw
 dnl New macros for configuring clients of mLib and Catacomb.
 dnl
@@ -49,7 +52,7 @@ dnl
 
 dnl----- Common files distribution --------------------------- *@--NOTICE--@*
 dnl
-dnl $Id: aclocal.glob,v 1.6 1999/11/11 17:49:33 mdw Exp $
+dnl $Id: aclocal.glob,v 1.7 1999/11/11 20:03:58 mdw Exp $
 
 dnl --- *@-AC_PROG_CC_STDC-@* ---
 dnl
@@ -1392,6 +1395,45 @@ else
   AC_MSG_RESULT([not found])
 fi])
 
+dnl *@-mdw_MGLIB-@*
+dnl
+dnl Author:    Mark Wooding
+dnl
+dnl Synopsis:  mdw_MGLIB(VERSION, IF-FOUND, IF-NOT-FOUND
+dnl
+dnl Arguments: VERSION = version of library required
+dnl            IF-FOUND = what to do if found
+dnl            IF-NOT-FOUND = what to do if not found  
+dnl
+dnl Use:       Configures an mgLib client program.  The default
+dnl            version is 1.0.0pre0; the default action is to add
+dnl            everything to the CFLAGS and LIBS variables, and complain
+dnl            if the library couldn't be found.
+dnl
+dnl            The variable MGLIB_VERSION contains the version number of
+dnl            the library; MGLIB_CFLAGS is the C compiler flags required
+dnl            and MGLIB_LIBS is the linker flags.
+
+AC_DEFUN([mdw_MGLIB],
+[mdw_REQUIRE([mdw_MGLIB], [1.6.0])
+AC_MSG_CHECKING([for mgLib library])
+if mgLib-config --check $1 >/dev/null 2>&1; then
+  MGLIB_VERSION=`mgLib-config --version`
+  MGLIB_CFLAGS=`mgLib-config --cflags`
+  MGLIB_LIBS=`mgLib-config --libs`
+  AC_SUBST(MGLIB_VERSION) AC_SUBST(MGLIB_CFLAGS) AC_SUBST(MGLIB_LIBS)
+  ifelse([$2], [],
+  [CFLAGS="$CFLAGS $MGLIB_CFLAGS"
+  LIBS="$MGLIB_LIBS $LIBS"],
+  $2)
+  AC_MSG_RESULT([$MGLIB_VERSION])
+else
+  ifelse([$3], [],
+  AC_MSG_ERROR([mgLib library not found or too old.]),
+  $3)
+  AC_MSG_RESULT([not found])
+fi])
+
 dnl *@-mdw_CATACOMB-@*
 dnl
 dnl Author:    Mark Wooding
@@ -1412,7 +1454,7 @@ dnl               the library; CATACOMB_CFLAGS is the C compiler flags required
 dnl            and CATACOMB_LIBS is the linker flags.
 
 AC_DEFUN([mdw_CATACOMB],
-[mdw_REQUIRE([mdw_MLIB], [1.5.0])
+[mdw_REQUIRE([mdw_MLIB], [1.6.0])
 AC_MSG_CHECKING([for Catacomb library])
 if catacomb-config --check $1 >/dev/null 2>&1; then
   CATACOMB_VERSION=`catacomb-config --version`