[project @ 2004-08-28 16:20:35 by panne]
[ghc-hetmet.git] / aclocal.m4
index 0c25ba9..2b37051 100644 (file)
@@ -431,7 +431,7 @@ esac
 AC_DEFUN([FP_PROG_AR_IS_GNU],
 [AC_REQUIRE([FP_PROG_AR])
 AC_CACHE_CHECK([whether $fp_prog_ar_raw is GNU ar], [fp_cv_prog_ar_is_gnu],
-[if $fp_prog_ar_raw --version | grep "GNU" > /dev/null 2> /dev/null; then
+[if $fp_prog_ar_raw --version 2> /dev/null | grep "GNU" > /dev/null 2>&1; then
   fp_cv_prog_ar_is_gnu=yes
 else
   fp_cv_prog_ar_is_gnu=no
@@ -954,53 +954,24 @@ fi
 ])# FP_PROG_FO_PROCESSOR
 
 
-dnl ** Check which CATALOG file we have to use with DocBook SGML.
-dnl
-dnl FPTOOLS_DOCBOOK_CATALOG(VARIABLE, JADE, STYLESHEET, CATALOGS-TO-CHECK-FOR)
-dnl
-dnl If any of the catalogs given in CATALOGS-TO-CHECK-FOR works on this
-dnl platform, let VARIABLE refer to this catalog; otherwise, VARIABLE
-dnl is set to "no".  JADE is the jade executable and STYLESHEET
-dnl a DocBook style sheet.
-dnl
-AC_DEFUN(FPTOOLS_DOCBOOK_CATALOG,
-[AC_CACHE_CHECK([for DocBook CATALOG], fptools_cv_sgml_catalog,
-[
-cat > conftest.sgml << EOF
-<!DOCTYPE Article PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
-<Article>
-<ArtHeader>
-<Title>Test</Title>
-<Author><OtherName>Test</OtherName></Author>
-<Address>Test</Address>
-<PubDate>Test</PubDate>
-</ArtHeader>
-<Sect1><Title>Test</Title>
-<Para>
-Test.
-</Para>
-</Sect1>
-</Article>
-EOF
-fptools_cv_sgml_catalog=no
-if test -z "$SGML_CATALOG_FILES" ; then
- for fptools_catalog in $4; do
-   ac_try="$2 -t rtf -d $3#print -c $fptools_catalog conftest.sgml"
-   if AC_TRY_EVAL(ac_try); then
-     fptools_cv_sgml_catalog=[$]fptools_catalog
-     break
-   fi
- done
+# FP_PROG_GHC_PKG
+# ----------------
+# Try to find a ghc-pkg matching the ghc mentioned in the environment variable
+# WithGhc. If the latter is unset or no matching ghc-pkg can be found, try to
+# find a plain ghc-pkg. Sets the output variable GhcPkgCmd.
+AC_DEFUN([FP_PROG_GHC_PKG],
+[AC_CACHE_CHECK([for ghc-pkg matching $WithGhc], fp_cv_matching_ghc_pkg,
+[fp_ghc_pkg_guess=`echo $WithGhc | sed 's,ghc\(@<:@^/\\@:>@*\)$,ghc-pkg\1,'`
+if "$fp_ghc_pkg_guess" -l > /dev/null 2>&1; then
+  fp_cv_matching_ghc_pkg=$fp_ghc_pkg_guess
 else
-# If the env var SGML_CATALOG_FILES is defined, assume things are cool.
-  fptools_cv_sgml_catalog="yes"
-fi
-])
-rm -rf conftest*
-if test $fptools_cv_sgml_catalog != "no"; then
-  $1=$fptools_cv_sgml_catalog
-fi
-])
+  fp_cv_matching_ghc_pkg=no
+fi])
+if test x"$fp_cv_matching_ghc_pkg" = xno; then
+  AC_PATH_PROG([GhcPkgCmd], [ghc-pkg])
+else
+  GhcPkgCmd=$fp_cv_matching_ghc_pkg
+fi])# FP_PROG_GHC_PKG
 
 
 # FP_CHECK_WIN32
@@ -1273,7 +1244,7 @@ char **argv;
   return 0;
 }],fptools_cv_readdir_eof_errno=`cat conftestval`, fptools_cv_readdir_eof_errno=bogus, fptools_cv_readdir_eof_errno=0)])
 dnl the cross value is somewhat bogus.
-AC_DEFINE([READDIR_ERRNO_EOF], [$fptools_cv_readdir_eof_errno], [readdir() sets errno to this upon EOF])
+AC_DEFINE_UNQUOTED([READDIR_ERRNO_EOF], [$fptools_cv_readdir_eof_errno], [readdir() sets errno to this upon EOF])
 ])
 
 dnl @synopsis FP_DIRENT_FLAT_LAYOUT