|
From: <sv...@va...> - 2009-01-22 22:44:36
|
Author: sewardj Date: 2009-01-22 22:44:30 +0000 (Thu, 22 Jan 2009) New Revision: 9034 Log: Move the test for __sync_bool_compare_and_swap almost to the bottom, so it can use $mflag_primary. This makes the word size for which the test is done (-m32 or -m64) be the same as for which it is actually needed, and in some situations unbreaks building of the regtests in 32-bit mode on a 64-bit machine. For the same reason, apply $mflag_primary to the test for OpenMP. Modified: trunk/configure.in Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2009-01-22 22:36:02 UTC (rev 9033) +++ trunk/configure.in 2009-01-22 22:44:30 UTC (rev 9034) @@ -1215,24 +1215,6 @@ fi -# does this compiler have built-in functions for atomic memory access ? -AC_MSG_CHECKING([if gcc supports __sync_bool_compare_and_swap]) - -AC_TRY_LINK(, -[ - int variable = 1; - return (__sync_bool_compare_and_swap(&variable, 1, 2) - && __sync_add_and_fetch(&variable, 1) ? 1 : 0) -], -[ - AC_MSG_RESULT([yes]) - AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o.]) -], -[ - AC_MSG_RESULT([no]) -]) - - # does the ppc assembler support "mtocrf" et al? AC_MSG_CHECKING([if ppc32/64 as supports mtocrf/mfocrf]) @@ -1647,7 +1629,7 @@ AC_MSG_CHECKING([for OpenMP]) safe_CFLAGS=$CFLAGS -CFLAGS="-fopenmp" +CFLAGS="-fopenmp $mflag_primary" AC_LINK_IFELSE( [ @@ -1670,6 +1652,29 @@ AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes]) +# does this compiler have built-in functions for atomic memory access ? +AC_MSG_CHECKING([if gcc supports __sync_bool_compare_and_swap]) + +safe_CFLAGS=$CFLAGS +CFLAGS="$mflag_primary" + +AC_TRY_LINK(, +[ + int variable = 1; + return (__sync_bool_compare_and_swap(&variable, 1, 2) + && __sync_add_and_fetch(&variable, 1) ? 1 : 0) +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_BUILTIN_ATOMIC, 1, [Define to 1 if gcc supports __sync_bool_compare_and_swap() a.o.]) +], +[ + AC_MSG_RESULT([no]) +]) + +CFLAGS=$safe_CFLAGS + + #---------------------------------------------------------------------------- # Ok. We're done checking. #---------------------------------------------------------------------------- |