Configure check for pthreads.

This commit is contained in:
curt 2001-04-09 17:58:20 +00:00
parent 10db0c3c66
commit a824bec9e1
4 changed files with 21 additions and 2 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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