X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=7fd96fe079da96876b9f1f40c4ce43cbea588eb8;hb=0ee1d0fd7b5cae2857fe6632cbee5441c011bb99;hp=f2762b30b862d69b0230cfb3196970f4ca19e5c9;hpb=79b5a2cb4b9ed5fe41a05fa2ec98bd1f83971daf;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index f2762b3..7fd96fe 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -571,22 +571,17 @@ AC_DEFUN([FP_MINGW_GCC], ]) dnl Small feature test for perl version. Assumes PerlCmd -dnl contains path to perl binary +dnl contains path to perl binary. +dnl +dnl (Perl versions prior to v5.6 does not contain the string "v5"; +dnl instead they display version strings such as "version 5.005".) dnl AC_DEFUN([FPTOOLS_CHECK_PERL_VERSION], [$PerlCmd -v >conftest.out 2>&1 - if grep "v5.6" conftest.out >/dev/null 2>&1; then + if grep "v5" conftest.out >/dev/null 2>&1; then : else - if grep "v5.8" conftest.out >/dev/null 2>&1; then - : - else - if grep "version 6" conftest.out >/dev/null 2>&1; then - : - else - AC_MSG_ERROR([your version of perl probably won't work, try upgrading it.]) - fi - fi + AC_MSG_ERROR([your version of perl probably won't work, try upgrading it.]) fi rm -fr conftest* ]) @@ -1101,52 +1096,29 @@ AC_REQUIRE([AC_PROG_CC]) AC_DEFUN([FP_FIND_ROOT],[ AC_MSG_CHECKING(for path to top of build tree) -hardtop=`pwd` +dnl This would be +dnl make -C utils/pwd clean && make -C utils/pwd +dnl except we don't want to have to know what make is called. Sigh. +cd utils/pwd +rm -f *.o +rm -f *.hi +rm -f pwd +rm -f pwd.exe +$WithGhc -v0 --make pwd -o pwd +cd ../.. + +hardtop=`utils/pwd/pwd forwardslash` + +if ! test -d "$hardtop"; then + AC_MSG_ERROR([cannot determine current directory]) +fi dnl Remove common automounter nonsense dnl -hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|' | sed 's|^//\(.\)/|\1:/|' ` +hardtop=`echo $hardtop | sed 's|^/tmp_mnt.*\(/local/.*\)$|\1|' | sed 's|^/tmp_mnt/|/|'` + +hardtop_plat="$hardtop" -dnl Find 'hardtop_plat', the native format for 'hardtop' -dnl (i.e., right kind of \dnl slashes on a Win32 box, but with b-slashes -dnl being escaped). -dnl -dnl Note OSTYPE: On Cygwin we need to use 'cygpath' to convert -dnl /cygdrive/c/foo to c:/foo but we must not do that if we -dnl aren't building using Cygwin (notably msys), because -dnl cygpath doesn't exist. It seems that 'bash' sets -dnl OSTYPE to 'cygwin' or 'msys' respectively, but cygwin's -dnl 'sh' does not. So we hackily assume that if the shell -dnl hasn't set it to 'msys' then we must be in Cygwin. -dnl Sigh. -dnl -dnl The Right Thing is probably to test $BuildPlatform -dnl instead, but we are sloppy about setting that correctly -dnl at the moment, so we just work around for now. -dnl -dnl The quotes round "$(OSTYPE)" are essential, for the -dnl Cygwin-sh case where OSTYPE is not set. -case $HostPlatform in - i386-unknown-mingw32 | i386-unknown-cygwin32) - if test "${OSTYPE}" != "msys" - then - # convert $hardtop to a path that mingw will understand too - cyghardtop=${hardtop} - hardtop=`cygpath -w ${cyghardtop} | sed -e 's@\\\\@/@g'` - hardtop_plat=`cygpath -w ${cyghardtop} | sed -e 's@\\\\@\\\\\\\\@g'` - else -dnl OK, so we're in the MSYS case. hardtop looks like /c/.... -dnl We want to make hardtop_plat into c:/... -dnl Stop using [] for quotes temporarily, so we can use [] in the sed regexp -changequote(, )dnl - hardtop_plat=`echo ${hardtop} | sed -e 's@^/\\([a-zA-Z]\\)/@\\1:/@g'` -changequote([, ])dnl - fi - ;; - *) - hardtop_plat=${hardtop} - ;; -esac AC_SUBST(hardtop) AC_SUBST(hardtop_plat)