summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-05-20 21:28:37 +0100
committerIan Lynagh <igloo@earth.li>2012-05-20 21:28:37 +0100
commite8121501ee3549a35e954726ccfd871ac9d51f83 (patch)
treecc1f63e46aacbdd253468870c802d45b5318b06d /aclocal.m4
parent113ae477493dba17fe489f95eff40c8c1bd04840 (diff)
downloadhaskell-e8121501ee3549a35e954726ccfd871ac9d51f83.tar.gz
Fix dblatex and xml* tool detection on Windows
We now normalise their paths, so that native Windows paths rather than cygwin paths. This means that we are able to execute them from Cabal or python. I've also abstracted out the normalisation code into an m4 function.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m454
1 files changed, 22 insertions, 32 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index f05dfe96ea..857e5f751e 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -475,6 +475,21 @@ AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS],
])
+AC_DEFUN([FP_PATH_PROG],[
+ AC_PATH_PROG($1,$2,$3,$4,$5,$6)
+ # If we have a cygwin path for something, and we try to run it
+ # from cabal or python, then it'll fail. So we convert to a
+ # native path.
+ if test "$HostOS" = "mingw32" && \
+ test "${OSTYPE}" != "msys" && \
+ test "${$1}" != ""
+ then
+ # Canonicalise to <drive>:/path/to/gcc
+ $1=`cygpath -m "${$1}"`
+ fi
+])
+
+
# FP_VISIBILITY_HIDDEN
# ----------------------------------
# Is the visibility hidden attribute supported?
@@ -781,16 +796,7 @@ dnl at least Happy version 1.14. If there's no installed Happy, we look
dnl for a happy source tree and point the build system at that instead.
dnl
AC_DEFUN([FPTOOLS_HAPPY],
-[AC_PATH_PROG(HappyCmd,happy,)
-# Happy is passed to Cabal, so we need a native path
-if test "$HostOS" = "mingw32" && \
- test "${OSTYPE}" != "msys" && \
- test "${HappyCmd}" != ""
-then
- # Canonicalise to <drive>:/path/to/gcc
- HappyCmd=`cygpath -m "${HappyCmd}"`
- AC_MSG_NOTICE([normalized happy command to $HappyCmd])
-fi
+[FP_PATH_PROG(HappyCmd,happy,)
AC_CACHE_CHECK([for version of happy], fptools_cv_happy_version,
changequote(, )dnl
@@ -817,15 +823,7 @@ dnl at least Alex version 2.0.1.
dnl
AC_DEFUN([FPTOOLS_ALEX],
[
-AC_PATH_PROG(AlexCmd,alex,)
-# Alex is passed to Cabal, so we need a native path
-if test "$HostOS" = "mingw32" && \
- test "${OSTYPE}" != "msys" && \
- test "${AlexCmd}" != ""
-then
- # Canonicalise to <drive>:/path/to/gcc
- AlexCmd=`cygpath -m "${AlexCmd}"`
-fi
+FP_PATH_PROG(AlexCmd,alex,)
AC_CACHE_CHECK([for version of alex], fptools_cv_alex_version,
changequote(, )dnl
@@ -972,18 +970,10 @@ AC_SUBST([LdHasNoCompactUnwind])
# Sets fp_prog_ar_raw to the full path of ar and fp_prog_ar to a non-Cygwin
# version of it. Exits if no ar can be found
AC_DEFUN([FP_PROG_AR],
-[AC_PATH_PROG([fp_prog_ar_raw], [ar])
-if test -z "$fp_prog_ar_raw"; then
+[FP_PATH_PROG([fp_prog_ar], [ar])
+if test -z "$fp_prog_ar"; then
AC_MSG_ERROR([cannot find ar in your PATH, no idea how to make a library])
fi
-fp_prog_ar="$fp_prog_ar_raw"
-case $HostPlatform in
- *mingw32) if test x${OSTYPE} != xmsys; then
- fp_prog_ar="`cygpath -w "${fp_prog_ar_raw}" | sed -e 's@\\\\@/@g'`"
- AC_MSG_NOTICE([normalized ar command to $fp_prog_ar])
- fi
- ;;
-esac
])# FP_PROG_AR
@@ -1354,7 +1344,7 @@ EOF
# which we use for building PDF and PS docs.
# DblatexCmd is empty if dblatex could not be found.
AC_DEFUN([FP_PROG_DBLATEX],
-[AC_PATH_PROG([DblatexCmd], [dblatex])
+[FP_PATH_PROG([DblatexCmd], [dblatex])
if test -z "$DblatexCmd"; then
AC_MSG_WARN([cannot find dblatex in your PATH, you will not be able to build the PDF and PS documentation])
fi
@@ -1366,7 +1356,7 @@ fi
# Sets the output variable XsltprocCmd to the full path of the XSLT processor
# xsltproc. XsltprocCmd is empty if xsltproc could not be found.
AC_DEFUN([FP_PROG_XSLTPROC],
-[AC_PATH_PROG([XsltprocCmd], [xsltproc])
+[FP_PATH_PROG([XsltprocCmd], [xsltproc])
if test -z "$XsltprocCmd"; then
AC_MSG_WARN([cannot find xsltproc in your PATH, you will not be able to build the HTML documentation])
fi
@@ -1402,7 +1392,7 @@ AC_SUBST([HAVE_DOCBOOK_XSL])
# Sets the output variable XmllintCmd to the full path of the XSLT processor
# xmllint. XmllintCmd is empty if xmllint could not be found.
AC_DEFUN([FP_PROG_XMLLINT],
-[AC_PATH_PROG([XmllintCmd], [xmllint])
+[FP_PATH_PROG([XmllintCmd], [xmllint])
if test -z "$XmllintCmd"; then
AC_MSG_WARN([cannot find xmllint in your PATH, you will not be able to validate your documentation])
fi