Commit 45bd53be authored by Erick Gallesio's avatar Erick Gallesio

CFLAGS adapation when using threads

parent 5e7d7c3b
2006-04-15 Erick Gallesio <eg@essi.fr>
* configure.in: Added the _REENTRANT and GC_LINUX_THREADS in the
CFLAGS for Linux, when using threads for the GC.
* src/fport.c, src/system.c
* lib/repl.stk (main-repl): Changed the way buffer are flushed.
Bonus: when programs exits normally in interactive mode, the
......
......@@ -3801,6 +3801,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
case "$THREADS" in
no | none | single)
THREADS=none
......@@ -4168,6 +4169,16 @@ echo "$as_me: error: Unknown thread system: $THREADS" >&2;}
;;
esac
case "$THREADS" in
none) true ;;
*) case `uname -s` in
Linux*) CFLAGS="$CFLAGS -D_REENTRANT=1 -DGC_LINUX_THREADS=1";;
esac
esac
if test "$THREADS" = pthreads; then
PTHREADS_TRUE=
......@@ -4437,7 +4448,7 @@ if test "${with_provided_gc+set}" = set; then
HAVE_GC="no"
fi;
# On Mac OS X use the given GC (tio compile it without -Ox)
# On Mac OS X use the given GC (to compile it without -Ox)
case `uname -s` in
Darwin*) echo "Force '--with-provided-gc' on MacOS";
HAVE_GC="no" ;;
......
......@@ -2,7 +2,7 @@ dnl configure.in for STklos
dnl
dnl Author: Erick Gallesio [eg@unice.fr]
dnl Creation date: 28-Dec-1999 21:19 (eg)
dnl Last file update: 15-Apr-2006 11:17 (eg)
dnl Last file update: 15-Apr-2006 12:44 (eg)
AC_INIT(src/stklos.c)
......@@ -73,6 +73,7 @@ AC_DEFUN(GC_CHECK_DEFINE, [
[$3], [$4])
])
dnl Now look at what threads we want
case "$THREADS" in
no | none | single)
......@@ -106,6 +107,17 @@ case "$THREADS" in
AC_MSG_ERROR([Unknown thread system: $THREADS])
;;
esac
dnl Add the options _REENTRANT and GC_LINUX_THREADS if we are on Linux
case "$THREADS" in
none) true ;;
*) case `uname -s` in
Linux*) CFLAGS="$CFLAGS -D_REENTRANT=1 -DGC_LINUX_THREADS=1";;
esac
esac
dnl Automake nightmare
AM_CONDITIONAL(PTHREADS, test "$THREADS" = pthreads)
AM_CONDITIONAL(LURC, test "$THREADS" = lurc)
......@@ -141,7 +153,7 @@ AC_ARG_WITH(provided-gc,
[ --with-provided-gc use our GC version even the system provides one],
HAVE_GC="no")
# On Mac OS X use the given GC (tio compile it without -Ox)
# On Mac OS X use the given GC (to compile it without -Ox)
case `uname -s` in
Darwin*) echo "Force '--with-provided-gc' on MacOS";
HAVE_GC="no" ;;
......
......@@ -21,12 +21,9 @@
*
* Author: Erick Gallesio [eg@essi.fr]
* Creation date: 2-Feb-2006 21:58 (eg)
* Last file update: 8-Feb-2006 10:24 (eg)
* Last file update: 15-Apr-2006 13:05 (eg)
*/
#define _REENTRANT 1
#define GC_LINUX_THREADS 1
#include <lurc.h>
#ifdef LURC_ENABLE_PTHREAD
......
......@@ -21,12 +21,9 @@
*
* Author: Erick Gallesio [eg@essi.fr]
* Creation date: 2-Feb-2006 21:58 (eg)
* Last file update: 6-Apr-2006 19:16 (eg)
* Last file update: 15-Apr-2006 13:06 (eg)
*/
#define _REENTRANT 1
#define GC_LINUX_THREADS 1
#include <unistd.h>
#include "stklos.h"
#include "vm.h"
......
......@@ -32,8 +32,6 @@ extern "C"
{
#endif
#define STK_USE_PTHREADS 1
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
......
......@@ -21,13 +21,10 @@
*
* Author: Erick Gallesio [eg@essi.fr]
* Creation date: 23-Jan-2006 12:14 (eg)
* Last file update: 15-Apr-2006 00:16 (eg)
* Last file update: 15-Apr-2006 13:06 (eg)
*/
#define _REENTRANT 1
#define GC_LINUX_THREADS 1
#include <unistd.h>
#include "stklos.h"
#include "vm.h"
......
......@@ -21,15 +21,11 @@
*
* Author: Erick Gallesio [eg@essi.fr]
* Creation date: 4-Feb-2006 11:03 (eg)
* Last file update: 12-Apr-2006 23:24 (eg)
* Last file update: 15-Apr-2006 13:06 (eg)
*/
#ifndef _STK_THREAD_H
#define _STK_THREAD_H
//FIX:
#define _REENTRANT 1
#define GC_LINUX_THREADS 1
#include <pthread.h>
enum thread_state { th_new, th_runnable, th_terminated, th_blocked};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment