Remove redundant stuff.
[cfd] / aclocal.glob
index 0f4b4d8..dfbf692 100644 (file)
@@ -1,6 +1,6 @@
 dnl -*-fundamental-*-                                    *@--GLOB-HEADER--@*
 dnl
-dnl $Id: aclocal.glob,v 1.7 1999/11/11 20:03:58 mdw Exp $
+dnl $Id: aclocal.glob,v 1.11 2001/01/20 12:03:08 mdw Exp $
 dnl
 dnl Common library of autoconf macros
 dnl
@@ -28,6 +28,19 @@ dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 dnl----- Revision history ---------------------------------------------------
 dnl
 dnl $Log: aclocal.glob,v $
+dnl Revision 1.11  2001/01/20 12:03:08  mdw
+dnl Remove redundant stuff.
+dnl
+dnl Revision 1.10  2000/10/14 16:32:15  mdw
+dnl Fixes from upstream.
+dnl
+dnl Revision 1.9  2000/08/15 21:37:49  mdw
+dnl New initialization macro for libraries, and a new base client macro for
+dnl finding libraries with an appropriate version.
+dnl
+dnl Revision 1.8  1999/11/26 01:23:17  mdw
+dnl And support for MXD (not yet released).
+dnl
 dnl Revision 1.7  1999/11/11 20:03:58  mdw
 dnl Add support for mgLib too.
 dnl
@@ -52,13 +65,13 @@ dnl
 
 dnl----- Common files distribution --------------------------- *@--NOTICE--@*
 dnl
-dnl $Id: aclocal.glob,v 1.7 1999/11/11 20:03:58 mdw Exp $
+dnl $Id: aclocal.glob,v 1.11 2001/01/20 12:03:08 mdw Exp $
 
-dnl --- *@-AC_PROG_CC_STDC-@* ---
+dnl --- *@-AM_PROG_CC_STDC-@* ---
 dnl
 dnl Author:    Franc,ois Pinard
 dnl
-dnl Synopsis:  AC_PROG_CC_STDC
+dnl Synopsis:  AM_PROG_CC_STDC
 dnl
 dnl Arguments: ---
 dnl
@@ -303,7 +316,7 @@ dnl         certain things.  But this isn't really a big deal.
 # serial 1
 
 AC_DEFUN(AM_INIT_AUTOMAKE,
-[AC_REQUIRE([AM_PROG_INSTALL])
+[AC_REQUIRE([AC_PROG_INSTALL])
 PACKAGE=[$1]
 AC_SUBST(PACKAGE)
 VERSION=[$2]
@@ -315,8 +328,8 @@ fi
 ifelse([$3],,
 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
-AM_SANITY_CHECK
-AC_ARG_PROGRAM
+AC_REQUIRE([AM_SANITY_CHECK])
+AC_REQUIRE([AC_ARG_PROGRAM])
 dnl FIXME This is truly gross.
 missing_dir=`cd $ac_aux_dir && pwd`
 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
@@ -324,26 +337,7 @@ AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
-AC_PROG_MAKE_SET])
-
-dnl --- *@-AM_PROG_INSTALL-@* ---
-dnl
-dnl Author:    Franc,ois Pinard
-dnl
-dnl Synopsis:  AM_PROG_INSTALL
-dnl
-dnl Arguments: ---
-dnl
-dnl Use:       Calls `AC_PROG_INSTALL' to find an installer.  Then it sets
-dnl            `INSTALL_SCRIPT' to a suitable value if necessary.
-
-# serial 1
-
-AC_DEFUN(AM_PROG_INSTALL,
-[AC_PROG_INSTALL
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL} -m 755'
-AC_SUBST(INSTALL_SCRIPT)dnl
-])
+AC_REQUIRE([AC_PROG_MAKE_SET])])
 
 dnl --- *@-AM_PROG_LEX-@* ---
 dnl
@@ -628,7 +622,7 @@ dnl         set `U' to be `_' and `ANSI2KNR' to be `./ansi2knr'.
 # serial 1
 
 AC_DEFUN(fp_C_PROTOTYPES,
-[AC_REQUIRE([fp_PROG_CC_STDC])
+[AC_REQUIRE([AM_PROG_CC_STDC])
 AC_MSG_CHECKING([for function prototypes])
 if test "$ac_cv_prog_cc_stdc" != no; then
   AC_MSG_RESULT(yes)
@@ -987,35 +981,6 @@ main()
   {
     /* Under Solaris 2.4, strtod returns the wrong value for the
        terminating character under some conditions.  */
-
-## @defmac AC_FUNC_STRTOD
-## @maindex FUNC_STRTOD
-## @ovindex LIBOBJS
-## If the @code{strtod} function is not available, or does not work
-## correctly (like the one on SunOS 5.4), add @samp{strtod.o} to output
-## variable @code{LIBOBJS}.
-## @end defmac
-
-AC_DEFUN(AM_FUNC_STRTOD,
-[AC_CACHE_CHECK(for working strtod, am_cv_func_strtod,
-[AC_TRY_RUN([
-double strtod ();
-int
-main()
-{
-  {
-    /* Some versions of Linux strtod mis-parse strings with leading '+'.  */
-    char *string = " +69";
-    char *term;
-    double value;
-    value = strtod (string, &term);
-    if (value != 69 || term != (string + 4))
-      exit (1);
-  }
-
-  {
-    /* Under Solaris 2.4, strtod returns the wrong value for the
-       terminating character under some conditions.  */
     char *string = "NaN";
     char *term;
     strtod (string, &term);
@@ -1167,12 +1132,15 @@ dnl --- *@-mdw_CHECK_MANYLIBS-@* ---
 dnl
 dnl Author:    Mark Wooding
 dnl
-dnl Synopsis:  mdw_CHECK_MANYLIBS(FUNC, LIBS, [IF-FOUND], [IF-NOT-FOUND])
+dnl Synopsis:  mdw_CHECK_MANYLIBS(FUNC, LIBS, [IF-FOUND], [IF-NOT-FOUND],
+dnl                    [INCLUDES], [ARGS])
 dnl
 dnl Arguments: FUNC = a function to try to find
 dnl            LIBS = a whitespace-separated list of libraries to search
 dnl            IF-FOUND = what to do when the function is found
 dnl            IF-NOT-FOUND = what to do when the function isn't found
+dnl            INCLUDES = other include files to add
+dnl            ARGS = arguments to pass the function
 dnl
 dnl Use:       Searches for a library which defines FUNC.  It first tries
 dnl            without any libraries; then it tries each library specified
@@ -1187,10 +1155,10 @@ AC_DEFUN(mdw_CHECK_MANYLIBS,
 [AC_CACHE_CHECK([for library containing $1], [mdw_cv_lib_$1],
 [mdw_save_LIBS="$LIBS"
 mdw_cv_lib_$1="no"
-AC_TRY_LINK(,[$1()], [mdw_cv_lib_$1="none required"])
+AC_TRY_LINK([$5], [$1($6)], [mdw_cv_lib_$1="none required"])
 test "$mdw_cv_lib_$1" = "no" && for i in $2; do
 LIBS="-l$i $mdw_save_LIBS"
-AC_TRY_LINK(,[$1()],
+AC_TRY_LINK([$5], [$1($6)],
 [mdw_cv_lib_$1="-l$i"
 break])
 done
@@ -1357,44 +1325,85 @@ if test "$GXX" = "yes"; then
   CXXFLAGS="$CXXFLAGS ifelse([$3], [], [-fhandle-exceptions], [$3])"
 fi])
 
-dnl *@-mdw_MLIB-@*
+dnl *@-mdw_INIT_LIB-@*
 dnl
 dnl Author:    Mark Wooding
 dnl
-dnl Synopsis:  mdw_MLIB(VERSION, IF-FOUND, IF-NOT-FOUND
+dnl Synopsis:  mdw_INIT_LIB(LIB, NAME, VERSION, [PACKAGE])
 dnl
-dnl Arguments: VERSION = version of library required
+dnl Arguments: LIB = the name of the library (and the package)
+dnl            NAME = a presentable version of the library's name
+dnl            VERSION = version of the library
+dnl            PACKAGE = package name to pass on to AM_INIT_AUTOMAKE
+dnl
+dnl Use:       Sets up various useful variables.  This macro calls
+dnl            AM_INIT_AUTOMAKE, which might be considered useful.  It also
+dnl            provides variables for the use of `lib-config.in'.
+
+AC_DEFUN([mdw_INIT_LIB],
+[AM_INIT_AUTOMAKE(ifelse([$4], [], [$1], [$4]), [$3])
+LIBRARY="$1" AC_SUBST(LIBRARY)
+LIBNAME="$2" AC_SUBST(LIBNAME)])
+
+dnl *@-mdw_LIB_CONFIG-@*
+dnl
+dnl Author:    Mark Wooding
+dnl
+dnl Synopsis:  mdw_LIB_CONFIG(LIB, NAME, VERSION, IF-FOUND, IF-NOT-FOUND)
+dnl
+dnl Arguments: LIB = the name of the library (and its configuration program)
+dnl            NAME = a presentable version of the library's name
+dnl            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 mLib 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 Use:       Configures a library client program, using a configuration
+dnl            script provided by the library maintainer.
+dnl
+dnl            The default version is 1.0.0pre0; the default action is to
+dnl            add everything to the CFLAGS and LIBS variables, and complain
 dnl            if the library couldn't be found.
 dnl
-dnl            The variable MLIB_VERSION contains the version number of
-dnl            the library; MLIB_CFLAGS is the C compiler flags required
-dnl            and MLIB_LIBS is the linker flags.
-
-AC_DEFUN([mdw_MLIB],
-[AC_MSG_CHECKING([for mLib library])
-if mLib-config --check $1 >/dev/null 2>&1; then
-  MLIB_VERSION=`mLib-config --version`
-  MLIB_CFLAGS=`mLib-config --cflags`
-  MLIB_LIBS=`mLib-config --libs`
-  AC_SUBST(MLIB_VERSION) AC_SUBST(MLIB_CFLAGS) AC_SUBST(MLIB_LIBS)
-  ifelse([$2], [],
-  [CFLAGS="$CFLAGS $MLIB_CFLAGS"
-  LIBS="$MLIB_LIBS $LIBS"],
-  $2)
-  AC_MSG_RESULT([$MLIB_VERSION])
+dnl            The variable LIB_VERSION contains the version number of
+dnl            the library; LIB_CFLAGS is the C compiler flags required
+dnl            and LIB_LIBS is the linker flags.
+
+AC_DEFUN([mdw_LIB_CONFIG],
+[pushdef([upname], translit([$1], [a-z], [A-Z]))dnl
+AC_MSG_CHECKING([for $2 library])
+if $1-config --check $3 >/dev/null 2>&1; then
+  upname[]_VERSION=`$1-config --version`
+  upname[]_CFLAGS=`$1-config --cflags`
+  upname[]_LIBS=`$1-config --libs`
+  AC_SUBST(upname[]_VERSION)
+  AC_SUBST(upname[]_CFLAGS)
+  AC_SUBST(upname[]_LIBS)
+  ifelse([$4], [],
+  [CFLAGS="$CFLAGS $upname[]_CFLAGS"
+  LIBS="$upname[]_LIBS $LIBS"],
+  $4)
+  AC_MSG_RESULT([$upname[]_VERSION])
 else
-  ifelse([$3], [],
-  AC_MSG_ERROR([mLib library not found or too old.]),
-  $3)
+  ifelse([$5], [],
+  AC_MSG_ERROR([$2 library not found or too old.]),
+  $5)
   AC_MSG_RESULT([not found])
 fi])
 
+dnl *@-mdw_MLIB-@*
+dnl
+dnl Author:    Mark Wooding
+dnl
+dnl Synopsis:  mdw_MLIB(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 mLib client program.
+
+AC_DEFUN([mdw_MLIB], [mdw_LIB_CONFIG(mLib, mLib, $@)])
+
 dnl *@-mdw_MGLIB-@*
 dnl
 dnl Author:    Mark Wooding
@@ -1405,34 +1414,11 @@ 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.
+dnl Use:       Configures an mgLib client program.
 
 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])
+[mdw_REQUIRE([mdw_MLIB], [1.6.0])
+mdw_LIB_CONFIG(mgLib, mgLib, $@)])
 
 dnl *@-mdw_CATACOMB-@*
 dnl
@@ -1444,35 +1430,27 @@ dnl Arguments:  VERSION = version of Catacomb required
 dnl            IF-FOUND = what to do if found
 dnl            IF-NOT-FOUND = what to do if not found  
 dnl
-dnl Use:       Configures the program as a Catacomb client.  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 CATACOMB_VERSION contains the version number of
-dnl            the library; CATACOMB_CFLAGS is the C compiler flags required
-dnl            and CATACOMB_LIBS is the linker flags.
+dnl Use:       Configures the program as a Catacomb client.
 
 AC_DEFUN([mdw_CATACOMB],
 [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`
-  CATACOMB_CFLAGS=`catacomb-config --cflags`
-  CATACOMB_LIBS=`catacomb-config --libs`
-  AC_SUBST(CATACOMB_VERSION)
-  AC_SUBST(CATACOMB_CFLAGS) AC_SUBST(CATACOMB_LIBS)
-  ifelse([$2], [],
-  [CFLAGS="$CFLAGS $CATACOMB_CFLAGS"
-  LIBS="$CATACOMB_LIBS $LIBS"],
-  $2)
-  AC_MSG_RESULT([$CATACOMB_VERSION])
-else
-  ifelse([$3], [],
-  AC_MSG_ERROR([Catacomb library not found or too old.]),
-  $3)
-  AC_MSG_RESULT([not found])
-fi])
+mdw_LIB_CONFIG(catacomb, Catacomb, $@)])
+
+dnl *@-mdw_PK-@*
+dnl
+dnl Author:    Mark Wooding
+dnl
+dnl Synopsis:  mdw_PK([VERSION], [IF-FOUND], [IF-NOT-FOUND])
+dnl
+dnl Arguments: VERSION = version of PK required
+dnl            IF-FOUND = what to do if found
+dnl            IF-NOT-FOUND = what to do if not found  
+dnl
+dnl Use:       Configures the program as a PK client.
+
+AC_DEFUN([mdw_PK],
+[mdw_REQUIRE([mdw_MLIB], [1.6.0])
+mdw_LIB_CONFIG(pk, PK, $@)])
 
 dnl --- *@-mdw_OPT_NDEBUG-@* ---
 dnl