X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=53bd165bec50facecef493a0d1a45c3bc4a30cff;hb=1f4bc1f36380776c68431dbc3b5fa41dd6d2182e;hp=031145d411c58240209fc1efe2d783358efe4ab3;hpb=f74a195e8eaad2670cf10be30484fda842e3c01e;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index 031145d..53bd165 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -4,6 +4,24 @@ # ensure we don't clash with any pre-supplied autoconf ones. +# FPTOOLS_SET_C_LD_FLAGS +# ---------------------------------- +# Set the C and LD flags for a given platform +AC_DEFUN([FPTOOLS_SET_C_LD_FLAGS], +[ + case $$1 in + i386-apple-darwin|powerpc-apple-darwin) + $2="$$2 -m32" + $3="$$3 -m32" + ;; + x86_64-apple-darwin) + $2="$$2 -m64" + $3="$$3 -m64" + ;; + esac +]) + + # FPTOOLS_FLOAT_WORD_ORDER_BIGENDIAN # ---------------------------------- # Little endian Arm on Linux with some ABIs has big endian word order @@ -907,24 +925,24 @@ fi # 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. +# WithGhc. 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 -elif "$fp_ghc_pkg_guess" list > /dev/null 2>&1; then - # from 6.10, ghc-pkg doesn't support the old -l syntax any more +[ +# If we are told to use ghc-stage2, then we're using an in-tree +# compiler. In this case, we just want ghc-pkg, not ghc-pkg-stage2, +# so we sed off -stage[0-9]$. However, if we are told to use +# ghc-6.12.1 then we want to use ghc-pkg-6.12.1, so we keep any +# other suffix. +fp_ghc_pkg_guess=`echo $WithGhc | sed -e 's/-stage@<:@0-9@:>@$//' -e 's,ghc\(@<:@^/\\@:>@*\)$,ghc-pkg\1,'` +if "$fp_ghc_pkg_guess" list > /dev/null 2>&1; then fp_cv_matching_ghc_pkg=$fp_ghc_pkg_guess else - fp_cv_matching_ghc_pkg=no + AC_MSG_ERROR([Cannot find matching ghc-pkg]) 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 +GhcPkgCmd=$fp_cv_matching_ghc_pkg +AC_SUBST([GhcPkgCmd]) +])# FP_PROG_GHC_PKG # FP_GCC_EXTRA_FLAGS