diff --git a/src/README b/src/README index 0762833600203686c7a466fb4448a48e29d17211..c1a4905c7e524317806cb15a9c4b39854ea0782a 100644 --- a/src/README +++ b/src/README @@ -10,6 +10,7 @@ This is what you need to do to install Pike: --without-gmp compile without gmp support --without-readline compile without readline support --without-debug compile without runtime debugging + --without-threads compile without threads support You might also want to set the following environment variables: CFLAGS Put extra flags for your C compiler here. @@ -60,7 +61,8 @@ What to do when it doesn't work: 5) Your gmp/readline/gdbm libraries might not be working or incorrectly installed, start over by running configure with the approperiate - --without-xxx arguments. + --without-xxx arguments. Also note that threads might give problems + with I/O and signals. If so you need to run configure --without-threads. 6) Try a different compiler, malloc, compiler-compiler and/or make. (if you have any other) diff --git a/src/configure.in b/src/configure.in index 7b0c0478c3e5c9e919b4269ccf3526cab68726bb..c54f3d5da36154f3e2ff1efc3e28aed7d829ad3e 100644 --- a/src/configure.in +++ b/src/configure.in @@ -13,6 +13,7 @@ AC_ARG_WITH(gdbm, [ --without-gdbm no GNU database manager support ] AC_ARG_WITH(gmp, [ --without-gmp no Support bignums]) AC_ARG_WITH(readline,[ --without-readline no support for command line editing]) AC_ARG_WITH(debug, [ --without-debug disable run time self tests],[],[with_debug=yes]) +AC_ARG_WITH(threads, [ --without-threads no threads support],[],[with_threads=yes]) if test x$with_debug = xyes ; then AC_DEFINE(DEBUG) @@ -294,6 +295,8 @@ AC_CHECK_LIB(crypt, crypt) ######################################################################## +if test x$with_threads = xyes ; then + AC_MSG_CHECKING(posix threads) OLDLIBS="$LIBS" @@ -311,6 +314,10 @@ esac AC_CACHE_VAL(pike_cv_posix_threads, [ AC_TRY_RUN([ +#define _REENTRANT +#define _THREAD_SAFE +#define _MIT_POSIX_THREADS + #include <pthread.h> void *foo(void *bar) { return ; } @@ -332,11 +339,14 @@ if test $pike_cv_posix_threads = yes ; then AC_MSG_RESULT(yes) AC_DEFINE(_REENTRANT) AC_DEFINE(_THREAD_SAFE) + AC_DEFINE(_MIT_POSIX_THREADS) else AC_MSG_RESULT(no) LIBS="$OLDLIBS" fi +fi + ######################################################################## AC_FUNC_MEMCMP diff --git a/src/machine.h.in b/src/machine.h.in index 42435a736afd6257fbec5d48e31bd13da25536a1..46567089dd6d6edb4bedc685e9c7845b3e062a2c 100644 --- a/src/machine.h.in +++ b/src/machine.h.in @@ -337,6 +337,7 @@ /* Define this if you are going to use threads */ #undef _REENTRANT #undef _THREAD_SAFE +#undef _MIT_POSIX_THREADS /* Define this if you have dlopen() */ #undef HAVE_DLOPEN