Enlightenment CVS committal
Author : mej
Project : eterm
Module : libast
Dir : eterm/libast
Modified Files:
ChangeLog autogen.sh configure.in libast.m4
Log Message:
Thu Jul 13 14:02:08 2006 Michael Jennings (mej)
Added thread, mutex, and condition interfaces along with their
corresponding pthreads-based implementations. Not quite done yet, and
not tested.
Added dynamically-loadable module object class along with
corresponding unit tests. Appears to work fine.
----------------------------------------------------------------------
===================================================================
RCS file: /cvs/e/eterm/libast/ChangeLog,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -3 -r1.145 -r1.146
--- ChangeLog 25 Apr 2006 15:18:41 -0000 1.145
+++ ChangeLog 13 Jul 2006 23:03:44 -0000 1.146
@@ -787,3 +787,12 @@
Began work on UTF-8/Unicode strings.
----------------------------------------------------------------------
+Thu Jul 13 14:02:08 2006 Michael Jennings (mej)
+
+Added thread, mutex, and condition interfaces along with their
+corresponding pthreads-based implementations. Not quite done yet, and
+not tested.
+
+Added dynamically-loadable module object class along with
+corresponding unit tests. Appears to work fine.
+----------------------------------------------------------------------
===================================================================
RCS file: /cvs/e/eterm/libast/autogen.sh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- autogen.sh 18 Jul 2005 05:26:39 -0000 1.10
+++ autogen.sh 13 Jul 2006 23:03:44 -0000 1.11
@@ -1,6 +1,6 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
-# $Id: autogen.sh,v 1.10 2005/07/18 05:26:39 vapier Exp $
+# $Id: autogen.sh,v 1.11 2006/07/13 23:03:44 mej Exp $
broken() {
echo
@@ -55,9 +55,9 @@
export LIBTOOLIZE ACLOCAL AUTOCONF AUTOHEADER AUTOMAKE
# Check for existing libast.m4 we can use. Use the local one if not.
-if test ! -f "`$ACLOCAL --print-ac-dir`/libast.m4"; then
+#if test ! -f "`$ACLOCAL --print-ac-dir`/libast.m4"; then
ACLOCAL_FLAGS="-I . $ACLOCAL_FLAGS"
-fi
+#fi
# Run the stuff.
(set -x && $LIBTOOLIZE -c -f) || abort libtool
===================================================================
RCS file: /cvs/e/eterm/libast/configure.in,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- configure.in 5 Feb 2006 05:56:01 -0000 1.27
+++ configure.in 13 Jul 2006 23:03:44 -0000 1.28
@@ -1,4 +1,4 @@
-dnl# $Id: configure.in,v 1.27 2006/02/05 05:56:01 mej Exp $
+dnl# $Id: configure.in,v 1.28 2006/07/13 23:03:44 mej Exp $
test "x$LIBTOOLIZE" = "x" && LIBTOOLIZE=libtoolize
test "x$ACLOCAL" = "x" && ACLOCAL=aclocal
@@ -96,6 +96,7 @@
AST_MMX_SUPPORT()
AST_ARG_REGEXP(REGEXP)
AST_ARG_BACKQUOTE_EXEC(ALLOW_BACKQUOTE_EXEC)
+AST_PTHREADS()
AST_FLAGS()
AC_SUBST(CC)
===================================================================
RCS file: /cvs/e/eterm/libast/libast.m4,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- libast.m4 22 Dec 2005 23:28:55 -0000 1.14
+++ libast.m4 13 Jul 2006 23:03:44 -0000 1.15
@@ -1,6 +1,6 @@
dnl#####################################################################
dnl# Autoconf m4 macros for LibAST
-dnl# $Id: libast.m4,v 1.14 2005/12/22 23:28:55 mej Exp $
+dnl# $Id: libast.m4,v 1.15 2006/07/13 23:03:44 mej Exp $
dnl#####################################################################
dnl#
@@ -182,7 +182,7 @@
dnl#
AC_DEFUN([AST_IMLIB2_SUPPORT], [
AC_ARG_WITH(imlib,
- [ --with-imlib[=DIR] compile with Imlib2 support (default)],
+ [ --with-imlib[=DIR] compile with Imlib2 support (default)],
[
if test "$withval" != "no"; then
if test "$withval" != "yes"; then
@@ -347,7 +347,7 @@
dnl#
AC_DEFUN([AST_ARG_DEBUG], [
AC_MSG_CHECKING(for debugging level)
- AC_ARG_WITH(debugging, [ --with-debugging[=num] compile in debugging
support. num >= 0], [
+ AC_ARG_WITH(debugging, [ --with-debugging[=num] compile in debugging
support. num >= 0], [
if test "$withval" = "yes"; then
withval=4
fi
@@ -368,7 +368,7 @@
])
AC_DEFUN([AST_ARG_REGEXP], [
AC_ARG_WITH(regexp,
- [ --with-regexp[=TYPE] specify the type of regular expression support
(bsd, posix, pcre)],
+ [ --with-regexp[=TYPE] specify the type of regular expression
support (bsd, posix, pcre)],
[$1=$withval], [$1=yes])
AST_REGEXP_SUPPORT($1)
AC_MSG_CHECKING(for regular expression support)
@@ -377,7 +377,7 @@
AC_DEFUN([AST_ARG_BACKQUOTE_EXEC], [
AC_MSG_CHECKING(if backquote execution support should be enabled)
AC_ARG_WITH(backquote-exec,
- [ --without-backquote-exec disables the execution of commands from
inside config files],
+ [ --without-backquote-exec disables the execution of commands from
inside config files],
[
if test "$withval" = "no"; then
AC_MSG_RESULT(no)
@@ -688,3 +688,195 @@
AC_MSG_RESULT([unknown, assuming none])
fi
])
+
+dnl# Taken from http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([AST_PTHREADS], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+ast_pthreads_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with
CFLAGS=$PTHREAD_CFLAGS])
+ AC_TRY_LINK_FUNC(pthread_join, ast_pthreads_ok=yes)
+ AC_MSG_RESULT($ast_pthreads_ok)
+ if test x"$ast_pthreads_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ast_pthreads_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads
-mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+ *solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ ast_pthreads_flags="-pthreads pthread -mt -pthread $ast_pthreads_flags"
+ ;;
+esac
+
+if test x"$ast_pthreads_ok" = xno; then
+for flag in $ast_pthreads_flags; do
+
+ case $flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $flag])
+ PTHREAD_CFLAGS="$flag"
+ ;;
+
+ pthread-config)
+ AC_CHECK_PROG(ast_pthreads_config, pthread-config, yes, no)
+ if test x"$ast_pthreads_config" = xno; then continue; fi
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config
--libs`"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$flag])
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ AC_TRY_LINK([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+ [ast_pthreads_ok=yes])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ AC_MSG_RESULT($ast_pthreads_ok)
+ if test "x$ast_pthreads_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ast_pthreads_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ AC_MSG_CHECKING([for joinable pthread attribute])
+ attr_name=unknown
+ for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
+ [attr_name=$attr; break])
+ done
+ AC_MSG_RESULT($attr_name)
+ if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+ [Define to necessary symbol if this constant
+ uses a non-standard name on your system.])
+ fi
+
+ AC_MSG_CHECKING([if more special flags are required for pthreads])
+ flag=no
+ case "${host_cpu}-${host_os}" in
+ *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+ *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+ esac
+ AC_MSG_RESULT(${flag})
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+ fi
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ # More AIX lossage: must compile with cc_r
+ AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
+else
+ PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ast_pthreads_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_PTHREADS,1,[Define if you have POSIX
threads libraries and header files.]),[$1])
+ :
+else
+ ast_pthreads_ok=no
+ $2
+fi
+AC_LANG_RESTORE
+])dnl AST_PTHREADS
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs