rewrite a bit that m4 macro

SVN revision: 41881
devs/devilhorns/wayland_egl
Vincent Torri 14 years ago
parent 2e7e9169e7
commit 5213fca489
  1. 56
      legacy/eina/m4/efl_pthread.m4

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

Loading…
Cancel
Save