From a824bec9e1eb0547b7d2bc84a597f1f23fa24b29 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 9 Apr 2001 17:58:20 +0000 Subject: [PATCH] Configure check for pthreads. --- Doxyfile | 1 + configure.in | 10 ++++++++++ simgear/Makefile.am | 9 +++++++-- simgear/config.h.in | 3 +++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Doxyfile b/Doxyfile index 1efc699f..74fa7e5f 100644 --- a/Doxyfile +++ b/Doxyfile @@ -313,6 +313,7 @@ INPUT = \ simgear/sg_inlines.h \ simgear/sg_traits.hxx \ simgear/sg_zlib.h \ + simgear/threads \ simgear/sky \ simgear/timing \ simgear/xml diff --git a/configure.in b/configure.in index 07942fe7..27ca332c 100644 --- a/configure.in +++ b/configure.in @@ -28,6 +28,7 @@ echo CC = $CC dnl Checks for programs. AC_PROG_MAKE_SET AC_PROG_CC +AC_PROG_CPP AC_PROG_CXX AC_PROG_RANLIB AC_PROG_INSTALL @@ -94,6 +95,15 @@ AC_CHECK_LIB(m, cos) base_LIBS="$LIBS" +dnl Thread related checks +AC_CHECK_LIB(pthread, pthread_exit) +AC_CHECK_HEADER(pthread.h) +if test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -o "x$ac_cv_header_pthread_h" = "xyes"; then + CXXFLAGS="$CXXFLAGS -D_REENTRANT" + CFLAGS="$CFLAGS -D_REENTRANT" +fi +AM_CONDITIONAL(HAVE_THREADS, test "x$ac_cv_lib_pthread_pthread_exit" = "xyes" -o "x$ac_cv_header_pthread_h" = "xyes") + AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(X11, XCreateWindow) AC_CHECK_LIB(Xext, XShmCreateImage) diff --git a/simgear/Makefile.am b/simgear/Makefile.am index 3078a18d..855b42dc 100644 --- a/simgear/Makefile.am +++ b/simgear/Makefile.am @@ -16,6 +16,12 @@ else ZLIB_DIRS = zlib endif +if HAVE_THREADS +SGTHREAD_DIR = threads +else +SGTHREAD_DIR = +endif + # METAR_DIRS = METAR_DIRS = metar @@ -38,8 +44,7 @@ SUBDIRS = \ screen \ $(SERIAL_DIRS) \ sky \ - threads \ + $(SGTHREAD_DIR) timing \ xgl \ $(ZLIB_DIRS) - diff --git a/simgear/config.h.in b/simgear/config.h.in index 410fd7a8..5dee430e 100644 --- a/simgear/config.h.in +++ b/simgear/config.h.in @@ -197,6 +197,9 @@ /* Define if you have the m library (-lm). */ #undef HAVE_LIBM +/* Define if you have the pthread library (-lpthread). */ +#undef HAVE_LIBPTHREAD + /* Define if you have the socket library (-lsocket). */ #undef HAVE_LIBSOCKET -- 2.39.5