* README.win32: Update the pthreads snapshot version we want.
Advice how to hand-expand the makefile.*.in files.
* config.h.win32.in: Define values needed by Sebastian Wilhelmi's
new thread stuff.
* glib.def: Add new functions.
* glibconfig.h.win32.in: Update the pthreads snapshot version.
Fix typo.
* gthread.c: Include config.h, guard inclusion of unistd.h. When
using gcc on Win32, g_thread_functions_for_glib_use must be marked
for export here, too.
* gtimer.c: Implement g_usleep on native Win32 using Sleep (which
only has millisecond granularity, though).
* makefile.cygwin.in
* makefile.msc.in: Update pthreads snapshot version. File
name changes. Remove testgthread.
* tests/makefile.cygwin.in
* tests/makefile.msc.in: Add thread-test. Link with gthread lib.
* gthread-posix.c: Guard pthread_attr_setscope call with test
for _POSIX_THREAD_PRIORITY_SCHEDULING, which should be defined
in a <pthread.h> that supports that feature.
+1999-06-21 Tor Lillqvist <tml@iki.fi>
+
+ * README.win32: Update the pthreads snapshot version we want.
+ Advice how to hand-expand the makefile.*.in files.
+
+ * config.h.win32.in: Define values needed by Sebastian Wilhelmi's
+ new thread stuff.
+
+ * glib.def: Add new functions.
+
+ * glibconfig.h.win32.in: Update the pthreads snapshot version.
+ Fix typo.
+
+ * gthread.c: Include config.h, guard inclusion of unistd.h. When
+ using gcc on Win32, g_thread_functions_for_glib_use must be marked
+ for export here, too.
+
+ * gtimer.c: Implement g_usleep on native Win32 using Sleep (which
+ only has millisecond granularity, though).
+
+ * makefile.cygwin.in
+ * makefile.msc.in: Update pthreads snapshot version. File
+ name changes. Remove testgthread.
+
+ * tests/makefile.cygwin.in
+ * tests/makefile.msc.in: Add thread-test. Link with gthread lib.
+
1999-06-18 Jeff Garzik <jgarzik@pobox.com>
* tests/Makefile.am: Re-order tests in alpha order.
+1999-06-21 Tor Lillqvist <tml@iki.fi>
+
+ * README.win32: Update the pthreads snapshot version we want.
+ Advice how to hand-expand the makefile.*.in files.
+
+ * config.h.win32.in: Define values needed by Sebastian Wilhelmi's
+ new thread stuff.
+
+ * glib.def: Add new functions.
+
+ * glibconfig.h.win32.in: Update the pthreads snapshot version.
+ Fix typo.
+
+ * gthread.c: Include config.h, guard inclusion of unistd.h. When
+ using gcc on Win32, g_thread_functions_for_glib_use must be marked
+ for export here, too.
+
+ * gtimer.c: Implement g_usleep on native Win32 using Sleep (which
+ only has millisecond granularity, though).
+
+ * makefile.cygwin.in
+ * makefile.msc.in: Update pthreads snapshot version. File
+ name changes. Remove testgthread.
+
+ * tests/makefile.cygwin.in
+ * tests/makefile.msc.in: Add thread-test. Link with gthread lib.
+
1999-06-18 Jeff Garzik <jgarzik@pobox.com>
* tests/Makefile.am: Re-order tests in alpha order.
+1999-06-21 Tor Lillqvist <tml@iki.fi>
+
+ * README.win32: Update the pthreads snapshot version we want.
+ Advice how to hand-expand the makefile.*.in files.
+
+ * config.h.win32.in: Define values needed by Sebastian Wilhelmi's
+ new thread stuff.
+
+ * glib.def: Add new functions.
+
+ * glibconfig.h.win32.in: Update the pthreads snapshot version.
+ Fix typo.
+
+ * gthread.c: Include config.h, guard inclusion of unistd.h. When
+ using gcc on Win32, g_thread_functions_for_glib_use must be marked
+ for export here, too.
+
+ * gtimer.c: Implement g_usleep on native Win32 using Sleep (which
+ only has millisecond granularity, though).
+
+ * makefile.cygwin.in
+ * makefile.msc.in: Update pthreads snapshot version. File
+ name changes. Remove testgthread.
+
+ * tests/makefile.cygwin.in
+ * tests/makefile.msc.in: Add thread-test. Link with gthread lib.
+
1999-06-18 Jeff Garzik <jgarzik@pobox.com>
* tests/Makefile.am: Re-order tests in alpha order.
+1999-06-21 Tor Lillqvist <tml@iki.fi>
+
+ * README.win32: Update the pthreads snapshot version we want.
+ Advice how to hand-expand the makefile.*.in files.
+
+ * config.h.win32.in: Define values needed by Sebastian Wilhelmi's
+ new thread stuff.
+
+ * glib.def: Add new functions.
+
+ * glibconfig.h.win32.in: Update the pthreads snapshot version.
+ Fix typo.
+
+ * gthread.c: Include config.h, guard inclusion of unistd.h. When
+ using gcc on Win32, g_thread_functions_for_glib_use must be marked
+ for export here, too.
+
+ * gtimer.c: Implement g_usleep on native Win32 using Sleep (which
+ only has millisecond granularity, though).
+
+ * makefile.cygwin.in
+ * makefile.msc.in: Update pthreads snapshot version. File
+ name changes. Remove testgthread.
+
+ * tests/makefile.cygwin.in
+ * tests/makefile.msc.in: Add thread-test. Link with gthread lib.
+
1999-06-18 Jeff Garzik <jgarzik@pobox.com>
* tests/Makefile.am: Re-order tests in alpha order.
+1999-06-21 Tor Lillqvist <tml@iki.fi>
+
+ * README.win32: Update the pthreads snapshot version we want.
+ Advice how to hand-expand the makefile.*.in files.
+
+ * config.h.win32.in: Define values needed by Sebastian Wilhelmi's
+ new thread stuff.
+
+ * glib.def: Add new functions.
+
+ * glibconfig.h.win32.in: Update the pthreads snapshot version.
+ Fix typo.
+
+ * gthread.c: Include config.h, guard inclusion of unistd.h. When
+ using gcc on Win32, g_thread_functions_for_glib_use must be marked
+ for export here, too.
+
+ * gtimer.c: Implement g_usleep on native Win32 using Sleep (which
+ only has millisecond granularity, though).
+
+ * makefile.cygwin.in
+ * makefile.msc.in: Update pthreads snapshot version. File
+ name changes. Remove testgthread.
+
+ * tests/makefile.cygwin.in
+ * tests/makefile.msc.in: Add thread-test. Link with gthread lib.
+
1999-06-18 Jeff Garzik <jgarzik@pobox.com>
* tests/Makefile.am: Re-order tests in alpha order.
+1999-06-21 Tor Lillqvist <tml@iki.fi>
+
+ * README.win32: Update the pthreads snapshot version we want.
+ Advice how to hand-expand the makefile.*.in files.
+
+ * config.h.win32.in: Define values needed by Sebastian Wilhelmi's
+ new thread stuff.
+
+ * glib.def: Add new functions.
+
+ * glibconfig.h.win32.in: Update the pthreads snapshot version.
+ Fix typo.
+
+ * gthread.c: Include config.h, guard inclusion of unistd.h. When
+ using gcc on Win32, g_thread_functions_for_glib_use must be marked
+ for export here, too.
+
+ * gtimer.c: Implement g_usleep on native Win32 using Sleep (which
+ only has millisecond granularity, though).
+
+ * makefile.cygwin.in
+ * makefile.msc.in: Update pthreads snapshot version. File
+ name changes. Remove testgthread.
+
+ * tests/makefile.cygwin.in
+ * tests/makefile.msc.in: Add thread-test. Link with gthread lib.
+
1999-06-18 Jeff Garzik <jgarzik@pobox.com>
* tests/Makefile.am: Re-order tests in alpha order.
+1999-06-21 Tor Lillqvist <tml@iki.fi>
+
+ * README.win32: Update the pthreads snapshot version we want.
+ Advice how to hand-expand the makefile.*.in files.
+
+ * config.h.win32.in: Define values needed by Sebastian Wilhelmi's
+ new thread stuff.
+
+ * glib.def: Add new functions.
+
+ * glibconfig.h.win32.in: Update the pthreads snapshot version.
+ Fix typo.
+
+ * gthread.c: Include config.h, guard inclusion of unistd.h. When
+ using gcc on Win32, g_thread_functions_for_glib_use must be marked
+ for export here, too.
+
+ * gtimer.c: Implement g_usleep on native Win32 using Sleep (which
+ only has millisecond granularity, though).
+
+ * makefile.cygwin.in
+ * makefile.msc.in: Update pthreads snapshot version. File
+ name changes. Remove testgthread.
+
+ * tests/makefile.cygwin.in
+ * tests/makefile.msc.in: Add thread-test. Link with gthread lib.
+
1999-06-18 Jeff Garzik <jgarzik@pobox.com>
* tests/Makefile.am: Re-order tests in alpha order.
+1999-06-21 Tor Lillqvist <tml@iki.fi>
+
+ * README.win32: Update the pthreads snapshot version we want.
+ Advice how to hand-expand the makefile.*.in files.
+
+ * config.h.win32.in: Define values needed by Sebastian Wilhelmi's
+ new thread stuff.
+
+ * glib.def: Add new functions.
+
+ * glibconfig.h.win32.in: Update the pthreads snapshot version.
+ Fix typo.
+
+ * gthread.c: Include config.h, guard inclusion of unistd.h. When
+ using gcc on Win32, g_thread_functions_for_glib_use must be marked
+ for export here, too.
+
+ * gtimer.c: Implement g_usleep on native Win32 using Sleep (which
+ only has millisecond granularity, though).
+
+ * makefile.cygwin.in
+ * makefile.msc.in: Update pthreads snapshot version. File
+ name changes. Remove testgthread.
+
+ * tests/makefile.cygwin.in
+ * tests/makefile.msc.in: Add thread-test. Link with gthread lib.
+
1999-06-18 Jeff Garzik <jgarzik@pobox.com>
* tests/Makefile.am: Re-order tests in alpha order.
tools, or gcc. Both the compiler from MSVC 5.0 and from MSVC 6.0 have
been used successfully. With gcc I mean egcs-1.1.2 (as distributed by
Mumit Khan), running under cygwin-b20.1. To successfully use gcc,
-follow the instructions below. I use gcc -mno-cygwin, i.e. the
-produced executables (.exe and .dll files) do *not* require the cygwin
-runtime library.
+follow the instructions below. We want to use gcc -mno-cygwin,
+i.e. produce executables (.exe and .dll files) that do *not* require
+the cygwin runtime library. This is sometimes called "mingw32".
To test the GLib functions, go to the tests subdirectory and enter
`nmake -f makefile.msc check` or `make -f makefile.cygwin check`.
With a little work, it might be possible to use the ./configure
mechanism also with a "mingw32" configuration.
-The following preprocessor macros are used for conditional compilation
-related to Win32:
+The following preprocessor macros are defined in glibconfig.h and used
+for conditional compilation related to Win32:
- WIN32 is defined when compiling for the Win32 platform, regardless
if using the X11 or Win32 windowing API (in the case of GLib, this
bundled Microsoft C library (msvcrt.dll) and the pthreads-win32
library. For instance, pathnames are in the native Windows syntax.
-The Win32 port uses the combination with both of those on.
+The Win32 port uses the combination with both of those on. As these
+are in glibconfig.h, they are available to all source files that use
+GLib (or GTk+, which uses GLib).
Additionally, there are the compiler-specific macros:
- _MSC_VER is defined when using the Microsoft compiler
- __GNUC__ is defined when using GCC (i.e. egcs)
-Some of the usage of these macros was a bit mixed up, and had to be
-straightened out when adding the gcc support. In particular, I used to
-check for _MSC_VER in some places where I really wanted to check for
-the Microsoft C library, and those checks has now been changed to
-NATIVE_WIN32. NATIVE_WIN32 ought to be renamed to USE_MSVCRT.
+Some of the usage of these macros used to be a bit mixed up, and had
+to be straightened out when adding the gcc support. In particular, I
+used to check for _MSC_VER in some places where I really wanted to
+check for the Microsoft C library, and those checks has now been
+changed to NATIVE_WIN32. NATIVE_WIN32 ought to be renamed to
+USE_MSVCRT.
Pthreads library
================
Before building you must get the pthreads library for Win32 from
http://sourceware.cygnus.com/pthreads-win32/. The pthreads-win32
-snapshot from 1999-04-07 is the one that should be used. Edit the
+snapshot from 1999-05-30 is the one that should be used. Edit the
location of the pthreads library and include files in makefile.msc or
-makefile.cygwin. The ptreads distribution includes the precompiled dll
+makefile.cygwin. The pthreads distribution includes the precompiled dll
and import libraries both for MSVC and gcc.
The pthreads for Win32 package that the thread support uses supposedly
isn't quite ready yet, and thus threads stuff should not be relied
upon for anything serious.
+Where are the makefiles?
+========================
+
+If you are building from a CVS snapshot, you will not have any
+makefile.msc or makefile.cygwin file. You should copy the
+corresponding makefile.msc.in or makefile.cygwin.in file to that name,
+and edit the line that sets GLIB_VER to the correct version number.
+
+This is done automatically when an official distribution package is
+built.
+
Building with MSVC
==================
Sorry for the illegibility of this diff, but the specs file is like
that... This patch replaces -lcrtdll with -lmsvcrt, replaces crt1 with
-crt2, removes -lmoldname (because that might pull in crtdll.dll), and
-defines __MSVCRT__.
+crt2, removes -lmoldname (because using functions from it would pull
+in crtdll.dll), and defines __MSVCRT__.
--- specs.ORIG Sun Apr 25 00:40:40 1999
+++ specs Sun Apr 25 00:48:04 1999
#define GLIB_INTERFACE_AGE @GLIB_INTERFACE_AGE@
#define GLIB_BINARY_AGE @GLIB_BINARY_AGE@
+#define GLIB_SIZEOF_PTHREAD_T 4
+#define POSIX_MIN_PRIORITY -2
+#define POSIX_MAX_PRIORITY 2
+#define POSIX_YIELD_FUNC Sleep(0)
+
#define G_THREAD_SOURCE "gthread-posix.c"
/* The number of bytes in a char. */
g_static_mutex_get_mutex_impl
g_static_private_get
g_static_private_set
+ g_static_rec_mutex_lock
+ g_static_rec_mutex_trylock
+ g_static_rec_mutex_unlock
+ g_static_rw_lock_free
+ g_static_rw_lock_reader_lock
+ g_static_rw_lock_reader_trylock
+ g_static_rw_lock_reader_unlock
+ g_static_rw_lock_writer_lock
+ g_static_rw_lock_writer_trylock
+ g_static_rw_lock_writer_unlock
g_str_equal
g_str_hash
g_strcasecmp
g_strsplit
g_strtod
g_strup
+ g_thread_create
+ g_thread_join
+ g_thread_self
+ g_thread_set_priority
g_timeout_add
g_timeout_add_full
g_timer_destroy
g_tree_traverse
g_tuples_destroy
g_tuples_index
+ g_usleep
g_vsnprintf
glib_binary_age
glib_interface_age
g_static_mutex_get_mutex_impl
g_static_private_get
g_static_private_set
+ g_static_rec_mutex_lock
+ g_static_rec_mutex_trylock
+ g_static_rec_mutex_unlock
+ g_static_rw_lock_free
+ g_static_rw_lock_reader_lock
+ g_static_rw_lock_reader_trylock
+ g_static_rw_lock_reader_unlock
+ g_static_rw_lock_writer_lock
+ g_static_rw_lock_writer_trylock
+ g_static_rw_lock_writer_unlock
g_str_equal
g_str_hash
g_strcasecmp
g_strsplit
g_strtod
g_strup
+ g_thread_create
+ g_thread_join
+ g_thread_self
+ g_thread_set_priority
g_timeout_add
g_timeout_add_full
g_timer_destroy
g_tree_traverse
g_tuples_destroy
g_tuples_index
+ g_usleep
g_vsnprintf
glib_binary_age
glib_interface_age
* MT safe
*/
+#include "config.h"
#include "glib.h"
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
typedef struct _GRealThread GRealThread;
gboolean g_thread_use_default_impl = TRUE;
gboolean g_threads_got_initialized = FALSE;
+#if defined(NATIVE_WIN32) && defined(__GNUC__)
+__declspec(dllexport)
+#endif
GThreadFunctions g_thread_functions_for_glib_use = {
(GMutex*(*)())g_thread_fail, /* mutex_new */
NULL, /* mutex_lock */
void
g_usleep (gulong microseconds)
{
+#ifdef NATIVE_WIN32
+ Sleep (microseconds / 1000);
+#else
struct timeval tv;
tv.tv_sec = microseconds / G_MICROSEC;
tv.tv_usec = microseconds % G_MICROSEC;
select(0, NULL, NULL, NULL, &tv);
+#endif
}
# This is the location of pthreads for Win32,
# see http://sourceware.cygnus.com/pthreads-win32/
-# We want the 1999-04-07 snapshot.
-PTHREADS = ..\pthreads-snap-1999-04-07
+# We want the 1999-05-30 snapshot.
+PTHREADS = ..\pthreads-snap-1999-05-30
PTHREAD_LIB = $(PTHREADS)\pthread.lib
PTHREAD_INC = -I $(PTHREADS)
testglib.exe \
testgmodule.exe \
testgdate.exe \
- testgdateparser.exe \
- testgthread.exe
+ testgdateparser.exe
install : all
$(INSTALL) glib-$(GLIB_VER).dll $(BIN)
gmain.obj \
gmem.obj \
gmessages.obj \
- gmutex.obj \
gnode.obj \
gprimes.obj \
gqueue.obj \
grand.obj \
gslist.obj \
gstack.obj \
+ gthread.obj \
gtimer.obj \
gtree.obj \
grel.obj \
copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
gthread_OBJECTS = \
- gthread.obj
+ gthread-impl.obj
gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) gthread\gthread.def
$(CC) $(CFLAGS) -LD -Fegthread-$(GLIB_VER).dll $(gthread_OBJECTS) glib-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS) /def:gthread\gthread.def
-gthread.obj : gthread\gthread.c gthread\gthread-posix.c
- $(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread.c
+gthread-impl.obj : gthread\gthread-impl.c gthread\gthread-posix.c
+ $(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread-impl.c
testglib.exe : glib-$(GLIB_VER).dll testglib.obj
$(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
libgplugin_b.obj : gmodule\libgplugin_b.c
$(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_b.c
-testgthread.exe : glib-$(GLIB_VER).dll gthread-$(GLIB_VER).dll testgthread.obj
- $(CC) $(CFLAGS) testgthread.obj glib-$(GLIB_VER).lib gthread-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS) /subsystem:console
-
-testgthread.obj : gthread\testgthread.c
- $(CC) $(CFLAGS) $(PTHREAD_INC) -c gthread\testgthread.c
-
clean:
del config.h
del glibconfig.h
* int i;
* pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
* printf ("sizeof (pthread_mutex_t) = %d\n", sizeof (pthread_mutex_t));
+ * printf ("sizeof (pthread_t) = %d\n", sizeof (pthread_t));
* printf ("PTHREAD_MUTEX_INITIALIZER = ");
* for (i = 0; i < sizeof (pthread_mutex_t); i++)
* printf ("%u, ", ((unsigned char *) &m)[i]);
{
struct _GMutex *runtime_mutex;
union {
- /* The size of the pad array should be sizeof (pthread_mutext_t) */
- /* This value corresponds to the 1999-04-07 version of pthreads-win32 */
+ /* The size of the pad array should be sizeof (pthread_mutex_t) */
+ /* This value corresponds to the 1999-05-30 version of pthreads-win32 */
char pad[4];
double dummy_double;
void *dummy_pointer;
* MT safe
*/
+#include "config.h"
#include "glib.h"
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
typedef struct _GRealThread GRealThread;
gboolean g_thread_use_default_impl = TRUE;
gboolean g_threads_got_initialized = FALSE;
+#if defined(NATIVE_WIN32) && defined(__GNUC__)
+__declspec(dllexport)
+#endif
GThreadFunctions g_thread_functions_for_glib_use = {
(GMutex*(*)())g_thread_fail, /* mutex_new */
NULL, /* mutex_lock */
+1999-06-21 Tor Lillqvist <tml@iki.fi>
+
+ * gthread-posix.c: Guard pthread_attr_setscope call with test
+ for _POSIX_THREAD_PRIORITY_SCHEDULING, which should be defined
+ in a <pthread.h> that supports that feature.
+
1999-06-17 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gthread-posix.c, gthread-solaris.c: Added the native
posix_check_for_error (pthread_attr_setstacksize (&attr, stack_size));
#endif /* HAVE_PTHREAD_ATTR_SETSTACKSIZE */
+#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
if (bound)
posix_check_for_error (pthread_attr_setscope (&attr,
PTHREAD_SCOPE_SYSTEM));
+#endif
+
posix_check_for_error( pthread_attr_setdetachstate( &attr,
joinable ? PTHREAD_CREATE_JOINABLE : PTHREAD_CREATE_DETACHED ) );
void
g_usleep (gulong microseconds)
{
+#ifdef NATIVE_WIN32
+ Sleep (microseconds / 1000);
+#else
struct timeval tv;
tv.tv_sec = microseconds / G_MICROSEC;
tv.tv_usec = microseconds % G_MICROSEC;
select(0, NULL, NULL, NULL, &tv);
+#endif
}
# This is the location of pthreads for Win32,
# see http://sourceware.cygnus.com/pthreads-win32/
-# We want the 1999-04-07 snapshot.
-PTHREADS = ../pthreads-snap-1999-04-07
-PTHREAD_LIB = -L$(PTHREADS) -lpthread
+# We want the 1999-05-30 snapshot.
+PTHREADS = ../pthreads-snap-1999-05-30
+PTHREAD_LIB = -L$(PTHREADS) -lpthread32
PTHREAD_INC = -I $(PTHREADS)
OPTIMIZE = -g -O
testglib.exe \
testgmodule.exe \
testgdate.exe \
- testgdateparser.exe \
- testgthread.exe
+ testgdateparser.exe
install : all
$(INSTALL) glib-$(GLIB_VER).dll $(BIN)
gmain.o \
gmem.o \
gmessages.o \
- gmutex.o \
gnode.o \
gprimes.o \
gqueue.o \
grand.o \
gslist.o \
gstack.o \
+ gthread.o \
gtimer.o \
gtree.o \
grel.o \
$(CP) gmodule/gmoduleconf.h.win32 gmodule/gmoduleconf.h
gthread_OBJECTS = \
- gthread.o
+ gthread-impl.o
gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) glib-$(GLIB_VER).dll gthread/gthread.def
./build-dll gthread $(GLIB_VER) gthread/gthread.def $(gthread_OBJECTS) -L. -lglib-$(GLIB_VER) $(PTHREAD_LIB) -lwsock32
-gthread.o : gthread/gthread.c gthread/gthread-posix.c
- $(CC) $(CFLAGS) $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread/gthread.c
+gthread-impl.o : gthread/gthread-impl.c gthread/gthread-posix.c
+ $(CC) $(CFLAGS) $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread/gthread-impl.c
testglib.exe : glib-$(GLIB_VER).dll testglib.o
$(CC) $(CFLAGS) -o testglib testglib.o -L. -lglib-$(GLIB_VER) $(LDFLAGS)
libgplugin_b.o : gmodule/libgplugin_b.c
$(CC) $(CFLAGS) -Igmodule -c gmodule/libgplugin_b.c
-testgthread.exe : glib-$(GLIB_VER).dll gthread-$(GLIB_VER).dll testgthread.o
- $(CC) $(CFLAGS) -o testgthread.exe testgthread.o -L. -lglib-$(GLIB_VER) -lgthread-$(GLIB_VER) $(PTHREAD_LIB) $(LDFLAGS)
-
-testgthread.o : gthread/testgthread.c
- $(CC) $(CFLAGS) $(PTHREAD_INC) -c gthread/testgthread.c
-
clean:
-rm config.h glibconfig.h gmodule/gmoduleconf.h
-rm *.exe *.o *.dll *.a *.base *.exp
# This is the location of pthreads for Win32,
# see http://sourceware.cygnus.com/pthreads-win32/
-# We want the 1999-04-07 snapshot.
-PTHREADS = ..\pthreads-snap-1999-04-07
+# We want the 1999-05-30 snapshot.
+PTHREADS = ..\pthreads-snap-1999-05-30
PTHREAD_LIB = $(PTHREADS)\pthread.lib
PTHREAD_INC = -I $(PTHREADS)
testglib.exe \
testgmodule.exe \
testgdate.exe \
- testgdateparser.exe \
- testgthread.exe
+ testgdateparser.exe
install : all
$(INSTALL) glib-$(GLIB_VER).dll $(BIN)
gmain.obj \
gmem.obj \
gmessages.obj \
- gmutex.obj \
gnode.obj \
gprimes.obj \
gqueue.obj \
grand.obj \
gslist.obj \
gstack.obj \
+ gthread.obj \
gtimer.obj \
gtree.obj \
grel.obj \
copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
gthread_OBJECTS = \
- gthread.obj
+ gthread-impl.obj
gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) gthread\gthread.def
$(CC) $(CFLAGS) -LD -Fegthread-$(GLIB_VER).dll $(gthread_OBJECTS) glib-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS) /def:gthread\gthread.def
-gthread.obj : gthread\gthread.c gthread\gthread-posix.c
- $(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread.c
+gthread-impl.obj : gthread\gthread-impl.c gthread\gthread-posix.c
+ $(CC) $(CFLAGS) -GD $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread\gthread-impl.c
testglib.exe : glib-$(GLIB_VER).dll testglib.obj
$(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
libgplugin_b.obj : gmodule\libgplugin_b.c
$(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_b.c
-testgthread.exe : glib-$(GLIB_VER).dll gthread-$(GLIB_VER).dll testgthread.obj
- $(CC) $(CFLAGS) testgthread.obj glib-$(GLIB_VER).lib gthread-$(GLIB_VER).lib $(PTHREAD_LIB) $(LDFLAGS) /subsystem:console
-
-testgthread.obj : gthread\testgthread.c
- $(CC) $(CFLAGS) $(PTHREAD_INC) -c gthread\testgthread.c
-
clean:
del config.h
del glibconfig.h
stack-test.exe \
string-test.exe \
strfunc-test.exe\
+ thread-test.exe \
tree-test.exe \
type-test.exe
.c.exe :
$(CC) $(CFLAGS) -c $<
- $(CC) $(CFLAGS) -o $@ $< -L.. -lglib-$(GLIB_VER)
+ $(CC) $(CFLAGS) -o $@ $< -L.. -lglib-$(GLIB_VER) -lgthread-$(GLIB_VER)
check: all
@for P in $(TESTS) ; do echo $$P; ./$$P; done
stack-test.exe \
string-test.exe \
strfunc-test.exe\
+ thread-test.exe \
tree-test.exe \
type-test.exe
.c.exe :
$(CC) $(CFLAGS) -c $<
- $(CC) $(CFLAGS) -Fe$@ $< ..\glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
+ $(CC) $(CFLAGS) -Fe$@ $< ..\glib-$(GLIB_VER).lib ..\gthread-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
check: all
for %p in ($(TESTS)) do %p