2001-10-31 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * 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
2001-10-31 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * 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
2001-10-31 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * 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
2001-10-31 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * 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
2001-10-31 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * 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
2001-10-31 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * 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
2001-10-31 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * 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
2001-10-31 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
+ * 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
* --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:
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 *************************
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*)
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.h>],
[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.h>],
[pthread_attr_t attr; pthread_attr_create(&attr);],
have_threads=posix)
;;
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
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
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.
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.h>], thread_t, system_thread)
fi
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",
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
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"