From: Bart Van Assche Date: Wed, 12 Mar 2008 17:11:48 +0000 (+0000) Subject: Renamed HAVE_GCC_FOPENMP into HAVE_OPENMP. Changed compile test into link test. X-Git-Tag: svn/VALGRIND_3_4_0~897 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14e26daf1063db4b6a63762aad28d9c07aef845e;p=thirdparty%2Fvalgrind.git Renamed HAVE_GCC_FOPENMP into HAVE_OPENMP. Changed compile test into link test. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7652 --- diff --git a/configure.in b/configure.in index dd6c953c9b..a06d73c630 100644 --- a/configure.in +++ b/configure.in @@ -553,20 +553,30 @@ fi # does this compiler support -fopenmp, does it have the include file # and does it have libgomp ? +AC_MSG_CHECKING([for OpenMP]) + safe_CFLAGS=$CFLAGS CFLAGS="-fopenmp" -AC_COMPILE_CHECK([OpenMP], [#include ], [ omp_set_dynamic(0); ], +AC_LINK_IFELSE( +[ +#include +int main(int argc, char** argv) +{ + omp_set_dynamic(0); + return 0; +} +], [ -ac_have_gcc_fopenmp=yes +ac_have_openmp=yes AC_MSG_RESULT([yes]) ], [ -ac_have_gcc_fopenmp=no +ac_have_openmp=no AC_MSG_RESULT([no]) ]) CFLAGS=$safe_CFLAGS -AM_CONDITIONAL([HAVE_GCC_FOPENMP], [test x$ac_have_gcc_fopenmp = xyes]) +AM_CONDITIONAL([HAVE_OPENMP], [test x$ac_have_openmp = xyes]) # does this compiler support -m32 ? diff --git a/exp-drd/Makefile.am b/exp-drd/Makefile.am index 46d677aad9..8ed1c37921 100644 --- a/exp-drd/Makefile.am +++ b/exp-drd/Makefile.am @@ -20,7 +20,7 @@ if VGP_PPC64_AIX5 noinst_PROGRAMS += exp-drd-ppc64-aix5 vgpreload_exp-drd-ppc64-aix5.so endif -if HAVE_GCC_FOPENMP +if HAVE_OPENMP VGPRELOAD_DRD_SOURCES_COMMON = drd_pthread_intercepts.c drd_gomp_intercepts.c else VGPRELOAD_DRD_SOURCES_COMMON = drd_pthread_intercepts.c diff --git a/exp-drd/tests/Makefile.am b/exp-drd/tests/Makefile.am index 2bfce6081f..14a6241f8a 100644 --- a/exp-drd/tests/Makefile.am +++ b/exp-drd/tests/Makefile.am @@ -239,7 +239,7 @@ check_PROGRAMS_COMMON = \ check_PROGRAMS_OPENMP = omp_prime matinv_openmp -if HAVE_GCC_FOPENMP +if HAVE_OPENMP check_PROGRAMS = $(check_PROGRAMS_COMMON) $(check_PROGRAMS_OPENMP) else check_PROGRAMS = $(check_PROGRAMS_COMMON) @@ -374,7 +374,7 @@ tc24_nonzero_sem_LDADD = -lpthread trylock_SOURCES = trylock.c trylock_LDADD = -lpthread -lrt -if HAVE_GCC_FOPENMP +if HAVE_OPENMP matinv_openmp_SOURCES = matinv_openmp.c matinv_openmp_CFLAGS = -fopenmp matinv_openmp_LDFLAGS = -fopenmp