From: Bart Van Assche Date: Sun, 9 Mar 2008 15:59:30 +0000 (+0000) Subject: Un-break compilation on systems with a compiler that does not support -fopenmp. X-Git-Tag: svn/VALGRIND_3_4_0~929 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b1b811c9eb2f1c5db2075f6fe00c3c8bbec4a0c3;p=thirdparty%2Fvalgrind.git Un-break compilation on systems with a compiler that does not support -fopenmp. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7615 --- diff --git a/configure.in b/configure.in index dff6a7b2e6..21c42f0f18 100644 --- a/configure.in +++ b/configure.in @@ -550,6 +550,27 @@ if test "${no_x}" != 'yes' ; then fi +# does this compiler support -fopenmp ? +AC_MSG_CHECKING([if gcc accepts -fopenmp]) + +safe_CFLAGS=$CFLAGS +CFLAGS="-fopenmp" + +AC_TRY_COMPILE(, [ +int main () { return 0 ; } +], +[ +ac_have_gcc_fopenmp=yes +AC_MSG_RESULT([yes]) +], [ +ac_have_gcc_fopenmp=no +AC_MSG_RESULT([no]) +]) +CFLAGS=$safe_CFLAGS + +AM_CONDITIONAL([HAVE_GCC_FOPENMP], [test x$ac_have_gcc_fopenmp = xyes]) + + # does this compiler support -m32 ? AC_MSG_CHECKING([if gcc accepts -m32]) diff --git a/exp-drd/tests/Makefile.am b/exp-drd/tests/Makefile.am index 170daea43e..2761e13bf4 100644 --- a/exp-drd/tests/Makefile.am +++ b/exp-drd/tests/Makefile.am @@ -186,7 +186,7 @@ AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI) AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_builddir)/include AM_CXXFLAGS = $(AM_CFLAGS) -check_PROGRAMS = \ +check_PROGRAMS_COMMON = \ fp_race \ hg01_all_ok \ hg02_deadlock \ @@ -195,7 +195,6 @@ check_PROGRAMS = \ hg05_race2 \ hg06_readshared \ matinv \ - matinv_openmp \ pth_barrier \ pth_broadcast \ pth_cond_race \ @@ -230,6 +229,14 @@ check_PROGRAMS = \ tc24_nonzero_sem \ trylock +check_PROGRAMS_OPENMP = matinv_openmp + +if HAVE_GCC_FOPENMP +check_PROGRAMS = $(check_PROGRAMS_COMMON) $(check_PROGRAMS_OPENMP) +else +check_PROGRAMS = $(check_PROGRAMS_COMMON) +endif + # tc14_laog_dinphils -- hangs. @@ -257,9 +264,11 @@ hg06_readshared_LDADD = -lpthread matinv_SOURCES = matinv.c matinv_LDADD = -lpthread -lm +if HAVE_GCC_FOPENMP matinv_openmp_SOURCES = matinv_openmp.c matinv_openmp_CFLAGS = -fopenmp matinv_openmp_LDADD = -lpthread -lm +endif pth_barrier_SOURCES = pth_barrier.c pth_barrier_LDADD = -lpthread