diff options
author | sh <sh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-13 10:57:07 +0000 |
---|---|---|
committer | sh <sh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-13 10:57:07 +0000 |
commit | a88ef88cc3429c3feb64df5eb16d6590b504535b (patch) | |
tree | 986b376731172e3e654d665a0958e076f287ef73 /libgomp/configure.ac | |
parent | ce0764124791468577471432f1ced4899d9bd196 (diff) |
libgomp: Add RTEMS support
libgomp/ChangeLog
* configure.tgt (*-*-rtems*): Use local-exec TLS model.
* configure.ac (*-*-rtems*): Assume Pthread is supported.
(pthread.h): Check for this header file.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221415 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp/configure.ac')
-rw-r--r-- | libgomp/configure.ac | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/libgomp/configure.ac b/libgomp/configure.ac index 4687b01d5cc..51e646d4789 100644 --- a/libgomp/configure.ac +++ b/libgomp/configure.ac @@ -170,28 +170,34 @@ AC_SUBST(libtool_VERSION) AC_STDC_HEADERS AC_HEADER_TIME ACX_HEADER_STRING -AC_CHECK_HEADERS(unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h) +AC_CHECK_HEADERS(pthread.h unistd.h semaphore.h sys/loadavg.h sys/time.h sys/time.h) GCC_HEADER_STDINT(gstdint.h) -# Check to see if -pthread or -lpthread is needed. Prefer the former. -# In case the pthread.h system header is not found, this test will fail. XPCFLAGS="" -CFLAGS="$CFLAGS -pthread" -AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [#include <pthread.h> - void *g(void *d) { return NULL; }], - [pthread_t t; pthread_create(&t,NULL,g,NULL);])], - [XPCFLAGS=" -Wc,-pthread"], - [CFLAGS="$save_CFLAGS" LIBS="-lpthread $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);])], - [], - [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) +case "$host" in + *-*-rtems*) + # RTEMS supports Pthreads, but the library is not available at GCC build time. + ;; + *) + # Check to see if -pthread or -lpthread is needed. Prefer the former. + # In case the pthread.h system header is not found, this test will fail. + CFLAGS="$CFLAGS -pthread" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include <pthread.h> + void *g(void *d) { return NULL; }], + [pthread_t t; pthread_create(&t,NULL,g,NULL);])], + [XPCFLAGS=" -Wc,-pthread"], + [CFLAGS="$save_CFLAGS" LIBS="-lpthread $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);])], + [], + [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) +esac m4_include([plugin/configfrag.ac]) |