From eb1df47d71f2366bacfb5a75d037b58ab7df14c8 Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Wed, 31 Oct 2001 15:40:52 +0000 Subject: [PATCH] Make --with-threads=none mean, that we want thread support, but no default 2001-10-31 Sebastian Wilhelmi * configure.in: Make --with-threads=none mean, that we want thread support, but no default thread implementation. This also was the original intention, but disapeared around 1998... So it doesn't seem to be the most requested feature, but we went far to make it possible in the code, so I resurrected this feature. * INSTALL.in: Describe the --enable-gc-friendly, --disable-threads and --with-threads options of configure. --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-0 | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-12 | 9 +++++++++ ChangeLog.pre-2-2 | 9 +++++++++ ChangeLog.pre-2-4 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ INSTALL.in | 28 ++++++++++++++++++++++++++++ configure.in | 35 +++++++++++++++++++---------------- 10 files changed, 119 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 962fc9964..b6a6db3db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2001-10-31 Sebastian Wilhelmi + * configure.in: Make --with-threads=none mean, that we want thread + support, but no default thread implementation. This also was the + original intention, but disapeared around 1998... So it doesn't + seem to be the most requested feature, but we went far to make it + possible in the code, so I resurrected this feature. + + * INSTALL.in: Describe the --enable-gc-friendly, --disable-threads + and --with-threads options of configure. + * glib/gmain.c (g_main_context_acquire, g_main_context_release, g_main_context_wait): Use the right conditional (G_THREADS_ENABLED instead of G_THREAD_ENABLED). Also remove wrong diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 962fc9964..b6a6db3db 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,5 +1,14 @@ 2001-10-31 Sebastian Wilhelmi + * configure.in: Make --with-threads=none mean, that we want thread + support, but no default thread implementation. This also was the + original intention, but disapeared around 1998... So it doesn't + seem to be the most requested feature, but we went far to make it + possible in the code, so I resurrected this feature. + + * INSTALL.in: Describe the --enable-gc-friendly, --disable-threads + and --with-threads options of configure. + * glib/gmain.c (g_main_context_acquire, g_main_context_release, g_main_context_wait): Use the right conditional (G_THREADS_ENABLED instead of G_THREAD_ENABLED). Also remove wrong diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 962fc9964..b6a6db3db 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,14 @@ 2001-10-31 Sebastian Wilhelmi + * configure.in: Make --with-threads=none mean, that we want thread + support, but no default thread implementation. This also was the + original intention, but disapeared around 1998... So it doesn't + seem to be the most requested feature, but we went far to make it + possible in the code, so I resurrected this feature. + + * INSTALL.in: Describe the --enable-gc-friendly, --disable-threads + and --with-threads options of configure. + * glib/gmain.c (g_main_context_acquire, g_main_context_release, g_main_context_wait): Use the right conditional (G_THREADS_ENABLED instead of G_THREAD_ENABLED). Also remove wrong diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 962fc9964..b6a6db3db 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,5 +1,14 @@ 2001-10-31 Sebastian Wilhelmi + * configure.in: Make --with-threads=none mean, that we want thread + support, but no default thread implementation. This also was the + original intention, but disapeared around 1998... So it doesn't + seem to be the most requested feature, but we went far to make it + possible in the code, so I resurrected this feature. + + * INSTALL.in: Describe the --enable-gc-friendly, --disable-threads + and --with-threads options of configure. + * glib/gmain.c (g_main_context_acquire, g_main_context_release, g_main_context_wait): Use the right conditional (G_THREADS_ENABLED instead of G_THREAD_ENABLED). Also remove wrong diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 962fc9964..b6a6db3db 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,5 +1,14 @@ 2001-10-31 Sebastian Wilhelmi + * configure.in: Make --with-threads=none mean, that we want thread + support, but no default thread implementation. This also was the + original intention, but disapeared around 1998... So it doesn't + seem to be the most requested feature, but we went far to make it + possible in the code, so I resurrected this feature. + + * INSTALL.in: Describe the --enable-gc-friendly, --disable-threads + and --with-threads options of configure. + * glib/gmain.c (g_main_context_acquire, g_main_context_release, g_main_context_wait): Use the right conditional (G_THREADS_ENABLED instead of G_THREAD_ENABLED). Also remove wrong diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 962fc9964..b6a6db3db 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,5 +1,14 @@ 2001-10-31 Sebastian Wilhelmi + * configure.in: Make --with-threads=none mean, that we want thread + support, but no default thread implementation. This also was the + original intention, but disapeared around 1998... So it doesn't + seem to be the most requested feature, but we went far to make it + possible in the code, so I resurrected this feature. + + * INSTALL.in: Describe the --enable-gc-friendly, --disable-threads + and --with-threads options of configure. + * glib/gmain.c (g_main_context_acquire, g_main_context_release, g_main_context_wait): Use the right conditional (G_THREADS_ENABLED instead of G_THREAD_ENABLED). Also remove wrong diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 962fc9964..b6a6db3db 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,14 @@ 2001-10-31 Sebastian Wilhelmi + * configure.in: Make --with-threads=none mean, that we want thread + support, but no default thread implementation. This also was the + original intention, but disapeared around 1998... So it doesn't + seem to be the most requested feature, but we went far to make it + possible in the code, so I resurrected this feature. + + * INSTALL.in: Describe the --enable-gc-friendly, --disable-threads + and --with-threads options of configure. + * glib/gmain.c (g_main_context_acquire, g_main_context_release, g_main_context_wait): Use the right conditional (G_THREADS_ENABLED instead of G_THREAD_ENABLED). Also remove wrong diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 962fc9964..b6a6db3db 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,14 @@ 2001-10-31 Sebastian Wilhelmi + * configure.in: Make --with-threads=none mean, that we want thread + support, but no default thread implementation. This also was the + original intention, but disapeared around 1998... So it doesn't + seem to be the most requested feature, but we went far to make it + possible in the code, so I resurrected this feature. + + * INSTALL.in: Describe the --enable-gc-friendly, --disable-threads + and --with-threads options of configure. + * glib/gmain.c (g_main_context_acquire, g_main_context_release, g_main_context_wait): Use the right conditional (G_THREADS_ENABLED instead of G_THREAD_ENABLED). Also remove wrong diff --git a/INSTALL.in b/INSTALL.in index 9a535fd5b..58067f7c5 100644 --- a/INSTALL.in +++ b/INSTALL.in @@ -46,6 +46,34 @@ A few of the more important ones: * --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [ Defaults to the value given to --prefix ] +* --enable-gc-friendly When enabled all memory freed by the application, + but retained by GLib for performance reasons + is set to zero, thus making deployed garbage + collection or memory profiling tools detect + unlinked memory correctly. This will make GLib + slightly slower. + [ Disabled by default ] + +* --disable-threads Do not compile GLib to be multi thread safe. GLib + will be slightly faster then. This is however not + recommended, as many programs rely on GLib being + multi thread safe. + [ Enabled by default ] + +* --with-threads=[none/posix/dce/solaris/win32] Specify a thread + implementation to use. + * 'posix' and 'dce' can be used interchangeable + to mean the different versions of posix + threads. configure tries to find out, which + one is installed. + * 'solaris' uses the native Solaris thread + implementation. + * 'none' means that GLib will be thread safe, + but does not have a default thread + implementation. This has to be supplied to + g_thread_init() by the programmer. + [ Determined by configure by default ] + Options can be given to the compiler and linker by setting environment variables before running configure. A few of the more important ones: diff --git a/configure.in b/configure.in index 96f01c55a..9ec45fe22 100644 --- a/configure.in +++ b/configure.in @@ -1021,9 +1021,6 @@ AC_ARG_WITH(threads, [ --with-threads=[none/posix/dce/solaris/win32] specify a if test "x$enable_threads" = "xno"; then want_threads=no fi -if test "x$want_threads" = "xnone"; then - want_threads=no -fi dnl error and warning message dnl ************************* @@ -1065,7 +1062,10 @@ POSIX_NO_PRIORITIES="I can not find the minimal and maximal priorities for dnl determination of thread implementation dnl *************************************** -have_threads=none +# have_threads=no means no thread support +# have_threads=none means no default thread implementation + +have_threads=no if test "x$want_threads" = xyes || test "x$want_threads" = xsolaris; then case $host in *-*-solaris*) @@ -1080,12 +1080,12 @@ if test "x$want_threads" = xyes || test "x$want_threads" = xposix \ GTHREAD_COMPILE_IMPL_DEFINES="-D_POSIX4_DRAFT_SOURCE -D_POSIX4A_DRAFT10_SOURCE -U_OSF_SOURCE" glib_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $GTHREAD_COMPILE_IMPL_DEFINES" - if test "x$have_threads" = xnone; then + if test "x$have_threads" = xno; then AC_TRY_COMPILE([#include ], [pthread_attr_t attr; pthread_attr_init(&attr);], have_threads=posix) fi - if test "x$have_threads" = xnone; then + if test "x$have_threads" = xno; then AC_TRY_COMPILE([#include ], [pthread_attr_t attr; pthread_attr_create(&attr);], have_threads=posix) @@ -1099,10 +1099,13 @@ if test "x$want_threads" = xyes || test "x$want_threads" = xwin32; then ;; esac fi +if test "x$want_threads" = xnone; then + have_threads=none +fi AC_MSG_CHECKING(for thread implementation) -if test "x$have_threads" = xnone && test "x$want_threads" != xno; then +if test "x$have_threads" = xno && test "x$want_threads" != xno; then AC_MSG_RESULT(none available) AC_MSG_WARN($THREAD_NO_IMPLEMENTATION) else @@ -1117,7 +1120,7 @@ G_THREAD_LIBS= G_THREAD_LIBS_EXTRA= G_THREAD_CFLAGS= -if test x"$have_threads" != xnone; then +if test x"$have_threads" != xno; then G_THREAD_CFLAGS="-D_REENTRANT" # good default guess @@ -1305,7 +1308,7 @@ AC_MSG_RESULT($G_THREAD_LIBS) dnl check for mt safe function variants and some posix functions dnl ************************************************************ -if test x"$have_threads" != xnone; then +if test x"$have_threads" != xno; then glib_save_LIBS="$LIBS" # we are not doing the following for now, as this might require glib # to always be linked with the thread libs on some platforms. @@ -1425,7 +1428,7 @@ if test x"$have_threads" != xnone; then elif test x"$have_threads" = xwin32; then # It's a pointer to a private struct GLIB_SIZEOF(,struct _GThreadData *, system_thread) - else # solaris threads + elif test x"$have_threads" = xsolaris; then GLIB_SIZEOF([#include ], thread_t, system_thread) fi @@ -1439,10 +1442,6 @@ if test x"$have_threads" != xnone; then if test "$ac_cv_func_localtime_r" != "yes"; then AC_MSG_WARN($FUNC_NO_LOCALTIME_R) fi -else - # If no thread implementation exists, we will provide enough - # space for a pointer - GLIB_SIZEOF(, void*, system_thread) fi AC_DEFINE_UNQUOTED(G_THREAD_SOURCE,"gthread-$have_threads.c", @@ -2102,7 +2101,7 @@ esac g_have_eilseq=$have_eilseq case x$have_threads in -xnone) g_enable_threads_def="#undef";; +xno) g_enable_threads_def="#undef";; *) g_enable_threads_def="#define";; esac @@ -2110,7 +2109,11 @@ g_threads_impl_def=$g_threads_impl g_mutex_has_default="$mutex_has_default" g_mutex_sizeof="$glib_cv_sizeof_gmutex" -g_system_thread_sizeof="$glib_cv_sizeof_system_thread" +if test x"$glib_cv_sizeof_system_thread" != x; then + g_system_thread_sizeof="$glib_cv_sizeof_system_thread" +else + g_system_thread_sizeof="$ac_cv_sizeof_void_p" +fi g_mutex_contents="$glib_cv_byte_contents_gmutex" g_module_suffix="$glib_gmodule_suffix"