From: panne Date: Tue, 19 Aug 2003 09:23:09 +0000 (+0000) Subject: [project @ 2003-08-19 09:23:08 by panne] X-Git-Tag: Approx_11550_changesets_converted~554 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=6a0b7a2f1075aa200aa4fde54d34efb7e58a21f8 [project @ 2003-08-19 09:23:08 by panne] Revamped FPTOOLS_PROG_DIFF --- diff --git a/aclocal.m4 b/aclocal.m4 index d07f365..995b19b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -4,6 +4,30 @@ # ensure we don't clash with any pre-supplied autoconf ones. +# FP_PROG_CONTEXT_DIFF +# -------------------- +# Figure out how to do context diffs. Sets the output variable ContextDiffCmd. +# NB: NeXTStep thinks diff'ing a file against itself is "trouble". +# Used by ghc, glafp-utils/ltx, and glafp-utils/runstdtest +AC_DEFUN([FP_PROG_CONTEXT_DIFF], +[AC_CACHE_CHECK([for a working context diff], [fp_cv_context_diff], +[echo foo > conftest1 +echo foo > conftest2 +fp_cv_context_diff=no +for fp_var in '-C 1' '-c1' +do + if diff $fp_var conftest1 conftest2 > /dev/null 2>&1; then + fp_cv_context_diff="diff $fp_var" + break + fi +done]) +if test x"$fp_cv_context_diff" = xno; then + AC_MSG_ERROR([cannot figure out how to do context diffs]) +fi +AC_SUBST(ContextDiffCmd, [$fp_cv_context_diff]) +])# FP_PROG_CONTEXT_DIFF + + # FP_ALTZONE # ------------------- # Defines HAVE_DECL_ALTZONE to 1 if declared, 0 otherwise. @@ -270,31 +294,6 @@ AlexVersion=$fptools_cv_alex_version; AC_SUBST(AlexVersion) ]) -dnl -dnl What's the best way of doing context diffs? -dnl -dnl (NB: NeXTStep thinks diff'ing a file against itself is "trouble") -dnl -AC_DEFUN(FPTOOLS_PROG_DIFF, -[AC_CACHE_CHECK([for ok way to do context diffs], fptools_cv_context_diffs, -[echo foo > conftest1 -echo foo > conftest2 -if diff -C 1 conftest1 conftest2 > /dev/null 2>&1 ; then - fptools_cv_context_diffs='diff -C 1' -else - if diff -c1 conftest1 conftest2 > /dev/null 2>&1 ; then - fptools_cv_context_diffs='diff -c1' - else - echo "Can't figure out how to do context diffs." - echo "Neither \`diff -C 1' nor \`diff -c1' works." - exit 1 - fi -fi -rm -f conftest1 conftest2 -]) -ContextDiffCmd=$fptools_cv_context_diffs -AC_SUBST(ContextDiffCmd) -]) dnl dnl Check whether ld supports -x diff --git a/configure.ac b/configure.ac index 3bac0be..5fb4686 100644 --- a/configure.ac +++ b/configure.ac @@ -651,7 +651,7 @@ fi AC_SUBST(SRC_CC_OPTS) dnl ** figure out how to do context diffs -FPTOOLS_PROG_DIFF +FP_PROG_CONTEXT_DIFF dnl ** Find find command (for Win32's benefit) FPTOOLS_FIND_FIND