X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=b5622dfd2d4ffe153ea07e85d169a709d0d474ea;hb=77f15a8e94b54c4ec1c1cbfbb91a90094383f91d;hp=858a3f0a6cc2fa6c458cfd205904ef27a5d2e56d;hpb=2909e6fb2223bd303e00b34d3a04466474c53f03;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index 858a3f0..b5622df 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -494,7 +494,7 @@ AC_REQUIRE([AC_PROG_CC]) AC_CACHE_CHECK([whether ranlib is needed], [fp_cv_prog_ar_needs_ranlib], [if test $fp_prog_ar_is_gnu = yes; then fp_cv_prog_ar_needs_ranlib=no -elif test $TargetPlatform = powerpc-apple-darwin; then +elif echo $TargetPlatform | grep "^.*-apple-darwin$" > /dev/null 2> /dev/null; then # It's quite tedious to check for Apple's crazy timestamps in .a files, # so we hardcode it. fp_cv_prog_ar_needs_ranlib=yes @@ -1055,4 +1055,66 @@ else GhcPkgCmd=$fp_cv_matching_ghc_pkg fi])# FP_PROG_GHC_PKG + +# FP_GHC_HAS_READLINE +# ------------------- +AC_DEFUN([FP_GHC_HAS_READLINE], +[AC_REQUIRE([FP_PROG_GHC_PKG]) +AC_CACHE_CHECK([whether ghc has readline package], [fp_cv_ghc_has_readline], +[if "${GhcPkgCmd-ghc-pkg}" --show-package readline >/dev/null 2>&1; then + fp_cv_ghc_has_readline=yes +else + fp_cv_ghc_has_readline=no + fi]) +AC_SUBST([GhcHasReadline], [`echo $fp_cv_ghc_has_readline | sed 'y/yesno/YESNO/'`]) +])# FP_GHC_HAS_READLINE + + +# FP_GCC_NEEDS_NO_OMIT_LFPTR +# -------------------------- +# Some OSs (Mandrake Linux, in particular) configure GCC with +# -momit-leaf-frame-pointer on by default. If this is the case, we need to turn +# it off for mangling to work. The test is currently a bit crude, using only the +# version number of gcc. Defines HAVE_GCC_MNO_OMIT_LFPTR. +AC_DEFUN([FP_GCC_NEEDS_NO_OMIT_LFPTR], +[AC_REQUIRE([FP_HAVE_GCC]) +AC_CACHE_CHECK([whether gcc needs -mno-omit-leaf-frame-pointer], [fp_cv_gcc_needs_no_omit_lfptr], +[FP_COMPARE_VERSIONS([$gcc_version_str], [-ge], [3.2], + [fp_cv_gcc_needs_no_omit_lfptr=yes], + [fp_cv_gcc_needs_no_omit_lfptr=no])]) +if test "$fp_cv_gcc_needs_no_omit_lfptr" = "yes"; then + AC_DEFINE([HAVE_GCC_MNO_OMIT_LFPTR], [1], [Define to 1 if gcc supports -mno-omit-leaf-frame-pointer.]) +fi])# FP_GCC_NEEDS_NO_OMIT_LFPTR + + +# FP_SETUP_PROJECT_VERSION +# --------------------- +AC_DEFUN([FP_SETUP_PROJECT_VERSION], +[# Some renamings +AC_SUBST([ProjectName], [$PACKAGE_NAME]) +AC_SUBST([ProjectVersion], [$PACKAGE_VERSION]) + +# Split PACKAGE_VERSION into (possibly empty) parts +VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/` +VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/` +VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/` +ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/` + +# Calculate project version as an integer, using 2 digits for minor version +case $VERSION_MINOR in + ?) ProjectVersionInt=${VERSION_MAJOR}0${VERSION_MINOR} ;; + ??) ProjectVersionInt=${VERSION_MAJOR}${VERSION_MINOR} ;; + *) AC_MSG_ERROR([bad minor version in $PACKAGE_VERSION]) ;; +esac +AC_SUBST([ProjectVersionInt]) + +# The project patchlevel is zero unless stated otherwise +test -z "$ProjectPatchLevel" && ProjectPatchLevel=0 + +# Remove dots from the patch level; this allows us to have versions like 6.4.1.20050508 +ProjectPatchLevel=`echo $ProjectPatchLevel | sed 's/\.//'` + +AC_SUBST([ProjectPatchLevel]) +])# FP_SETUP_PROJECT_VERSION + # LocalWords: fi