aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/libgomp/configure.ac
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-05-14 17:46:52 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2014-05-14 17:47:56 +0800
commit18927802fc8b991c35d7703427a53807e3c6d8c7 (patch)
tree39f882d1b632f47604c264b684fc7dcd4c91f37d /gcc-4.9/libgomp/configure.ac
parent5cd97bdbf2d97af4b0e4301f5f2b6c2a4301baf9 (diff)
downloadtoolchain_gcc-18927802fc8b991c35d7703427a53807e3c6d8c7.tar.gz
toolchain_gcc-18927802fc8b991c35d7703427a53807e3c6d8c7.tar.bz2
toolchain_gcc-18927802fc8b991c35d7703427a53807e3c6d8c7.zip
[4.9] Fix openmp support
See the following CLs for 4.8 c27bd5a265e6aeecefa6bfebe52fcf26b08298cd # Support OpenMP b6c94ff8e836a01ad3598135d19c49c9eb01a173 # needed OpenMP: Better CPU count detection for Linux d88e126b2b303c95d94b939c21f8672637871dbd # Fix openmp support to use libgomp/config/linux Change-Id: Ib85a23669c03bcdc9dd5f83b9a0f18e5cad6033d
Diffstat (limited to 'gcc-4.9/libgomp/configure.ac')
-rw-r--r--gcc-4.9/libgomp/configure.ac9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc-4.9/libgomp/configure.ac b/gcc-4.9/libgomp/configure.ac
index 84d250f0b..59b9516b6 100644
--- a/gcc-4.9/libgomp/configure.ac
+++ b/gcc-4.9/libgomp/configure.ac
@@ -184,6 +184,13 @@ AC_LINK_IFELSE(
void *g(void *d) { return NULL; }],
[pthread_t t; pthread_create(&t,NULL,g,NULL);])],
[XPCFLAGS=" -Wc,-pthread"],
+ [CFLAGS="$save_CFLAGS" LIBS="$LIBS"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [#include <pthread.h>
+ void *g(void *d) { return NULL; }],
+ [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
+ [],
[CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
@@ -191,7 +198,7 @@ AC_LINK_IFELSE(
void *g(void *d) { return NULL; }],
[pthread_t t; pthread_create(&t,NULL,g,NULL);])],
[],
- [AC_MSG_ERROR([Pthreads are required to build libgomp])])])
+ [AC_MSG_ERROR([Pthreads are required to build libgomp])])])])
# Check for functions needed.
AC_CHECK_FUNCS(getloadavg clock_gettime strtoull)