]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Un-break compilation on systems with a compiler that does not support -fopenmp.
authorBart Van Assche <bvanassche@acm.org>
Sun, 9 Mar 2008 15:59:30 +0000 (15:59 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 9 Mar 2008 15:59:30 +0000 (15:59 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7615

configure.in
exp-drd/tests/Makefile.am

index dff6a7b2e6bbc8b388ec40d98bae9b20a69135f2..21c42f0f185603aadcf99335d6d165ada2229b9f 100644 (file)
@@ -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])
 
index 170daea43e9b5520131e961786db0e4a46457998..2761e13bf48c9f58788f610f19db0a207a19db0b 100644 (file)
@@ -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