rewrite a bit that m4 macro

SVN revision: 41881
This commit is contained in:
Vincent Torri 2009-08-20 08:31:26 +00:00
parent 2e7e9169e7
commit 5213fca489
1 changed files with 19 additions and 37 deletions

View File

@ -13,7 +13,7 @@ AC_DEFUN([EFL_CHECK_PTHREAD],
dnl configure option dnl configure option
AC_ARG_ENABLE([pthread], AC_ARG_ENABLE([pthread],
[AC_HELP_STRING([--disable-pthread], [enable POSIX threads code @<:@default=no@:>@])], [AC_HELP_STRING([--disable-pthread], [enable POSIX threads code @<:@default=yes@:>@])],
[ [
if test "x${enableval}" = "xyes" ; then if test "x${enableval}" = "xyes" ; then
_efl_enable_pthread="yes" _efl_enable_pthread="yes"
@ -21,8 +21,8 @@ AC_ARG_ENABLE([pthread],
_efl_enable_pthread="no" _efl_enable_pthread="no"
fi fi
], ],
[_efl_enable_pthread="yes"] [_efl_enable_pthread="yes"])
)
AC_MSG_CHECKING([whether to build POSIX threads code]) AC_MSG_CHECKING([whether to build POSIX threads code])
AC_MSG_RESULT([${_efl_enable_pthread}]) AC_MSG_RESULT([${_efl_enable_pthread}])
@ -31,43 +31,25 @@ dnl check if the compiler supports pthreads
_efl_have_pthread="no" _efl_have_pthread="no"
if test "x${_efl_enable_pthread}" = "xyes" ; then if test "x${_efl_enable_pthread}" = "xyes" ; then
AC_CHECK_HEADER(pthread.h,
SAVE_CFLAGS=${CFLAGS} [_efl_have_pthread="yes"],
CFLAGS="-pthread" [_efl_have_pthread="no"])
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <pthread.h>
]],
[[]])
],
[
_efl_have_pthread="yes"
EFL_PTHREAD_CFLAGS="-pthread"
EFL_PTHREAD_LIBS="-pthread"
]
)
AC_LANG_POP([C])
CFLAGS=${SAVE_CFLAGS}
fi fi
AC_MSG_CHECKING([whether compiler need -pthread POSIX for threads support]) AC_MSG_CHECKING([whether system support POSIX threads])
AC_MSG_RESULT([${_efl_have_pthread}]) AC_MSG_RESULT([${_efl_enable_pthread}])
if test "x${_efl_have_pthread}" = "xno" -a "x${_efl_enable_pthread}" = "xyes" ; then if test "x${_efl_have_pthread}" = "xyes" ; then
AC_CHECK_HEADER(pthread.h, case "$host_os" in
[ solaris*)
_efl_have_pthread="yes" EFL_PTHREAD_CFLAGS="-mt"
EFL_PTHREAD_LIBS="-lpthread" EFL_PTHREAD_LIBS="-mt"
], ;;
[ *)
_efl_have_pthread="no" EFL_PTHREAD_CFLAGS="-pthread"
]) EFL_PTHREAD_LIBS="-pthead"
;;
AC_MSG_CHECKING([whether system support POSIX threads]) esac
AC_MSG_RESULT([${_efl_enable_pthread}])
fi fi
AC_SUBST(EFL_PTHREAD_CFLAGS) AC_SUBST(EFL_PTHREAD_CFLAGS)