Skip to content

Commit

Permalink
Improved check for GCC's -pthread and -pthreads flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha Schumann committed Dec 22, 1999
1 parent b0e1f9c commit aa3737e
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions TSRM/tsrm.m4
@@ -1,3 +1,15 @@
AC_DEFUN(TSRM_CHECK_GCC_ARG,[
AC_MSG_CHECKING(whether $CC supports $1)
> conftest.c
cmd='$CC $1 -c conftest.c'
if eval $cmd 2>&1 | egrep -e $1 >/dev/null ; then
$2=no
else
$2=yes
fi
AC_MSG_RESULT($$2)
rm -f conftest.*
])

AC_DEFUN(TSRM_BASIC_CHECKS,[
Expand Down Expand Up @@ -31,11 +43,24 @@ AC_MSG_RESULT(yes - installed in $PTH_PREFIX)

AC_DEFUN(TSRM_CHECK_PTHREADS,[
dnl Check for FreeBSD/Linux -pthread option
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -pthread"
AC_CHECK_FUNCS(pthread_kill)
if test -n "$GCC"; then
dnl FreeBSD/Linux
TSRM_CHECK_GCC_ARG(-pthread, gcc_pthread)
if test "$gcc_pthread" = "yes"; then
LDFLAGS="$LDFLAGS -pthread"
else
dnl gcc on Solaris
TSRM_CHECK_GCC_ARG(-pthreads, gcc_pthreads)
if test "$gcc_pthreads" = "yes"; then
LDFLAGS="$LDFLAGS -pthreads"
fi
fi
AC_CHECK_FUNCS(pthread_kill)
fi
if test "$ac_cv_func_pthread_kill" != "yes"; then
LDFLAGS="$old_LDFLAGS"
Expand Down

0 comments on commit aa3737e

Please sign in to comment.