X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=f0ad4cf4c30d9572595a5720795e2439273322ba;hb=9a17dfd7f10952762cd8aff1ef4dbd0ae6daec37;hp=85a1ee20b27f4f930cdc7720c5b0b367bd512bd7;hpb=2f330af4eeeae4562d9ea9eeaec7571901481f8c;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index 85a1ee2..f0ad4cf 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -100,7 +100,7 @@ AC_DEFUN([FP_PROG_CONTEXT_DIFF], [echo foo > conftest1 echo foo > conftest2 fp_cv_context_diff=no -for fp_var in '-C 1' '-c1' +for fp_var in '-U 1' '-u1' '-C 1' '-c1' do if diff $fp_var conftest1 conftest2 > /dev/null 2>&1; then fp_cv_context_diff="diff $fp_var" @@ -306,6 +306,15 @@ dnl AC_DEFUN([FPTOOLS_ALEX], [ AC_PATH_PROG(AlexCmd,alex,) +# Alex is passed to Cabal, so we need a native path +if test "x$HostPlatform" = "xi386-unknown-mingw32" && \ + test "${OSTYPE}" != "msys" && \ + test "${AlexCmd}" != "" +then + # Canonicalise to :/path/to/gcc + AlexCmd=`cygpath -m ${AlexCmd}` +fi + AC_CACHE_CHECK([for version of alex], fptools_cv_alex_version, changequote(, )dnl [if test x"$AlexCmd" != x; then @@ -984,6 +993,11 @@ AC_CACHE_CHECK([for extra options to pass gcc when compiling via C], [fp_cv_gcc_ )], []) ;; + sparc-*-solaris2) + FP_COMPARE_VERSIONS([$fp_gcc_version], [-ge], [4.2], + [fp_cv_gcc_extra_opts="$fp_cv_gcc_extra_opts -fno-toplevel-reorder"], + []) + ;; esac ]) AC_SUBST([GccExtraViaCOpts],$fp_cv_gcc_extra_opts) @@ -1072,6 +1086,13 @@ static void handler(int i) tock = 1; } +static void timeout(int i) +{ + // timer_settime() has been known to hang, so just in case + // we install a 1-second timeout (see #2257) + exit(99); +} + int main(int argc, char *argv[]) { @@ -1092,6 +1113,15 @@ int main(int argc, char *argv[]) exit(3); } + action.sa_handler = timeout; + action.sa_flags = 0; + sigemptyset(&action.sa_mask); + if (sigaction(SIGALRM, &action, NULL) == -1) { + fprintf(stderr,"SIGALRM problem\n"); + exit(3); + } + alarm(1); + if (timer_create(CLOCK_PROCESS_CPUTIME_ID, &ev, &timer) != 0) { fprintf(stderr,"No CLOCK_PROCESS_CPUTIME_ID timer\n"); exit(1); @@ -1116,7 +1146,7 @@ int main(int argc, char *argv[]) out: if (!tock) { - fprintf(stderr,"no CLOCK_REALTIME signal\n"); + fprintf(stderr,"no CLOCK_PROCESS_CPUTIME_ID signal\n"); exit(5); } @@ -1128,7 +1158,7 @@ out: } it.it_value.tv_sec = 0; - it.it_value.tv_nsec = 1; + it.it_value.tv_nsec = 1000000; it.it_interval = it.it_value; if (timer_settime(timer, 0, &it, NULL) != 0) { fprintf(stderr,"settime problem\n");