makefile.mingw.in tests/makefile.mingw.in Rename makefile.cygwin(.in) to
authorTor Lillqvist <tml@iki.fi>
Sat, 13 May 2000 19:30:58 +0000 (19:30 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sat, 13 May 2000 19:30:58 +0000 (19:30 +0000)
2000-05-13  Tor Lillqvist  <tml@iki.fi>

* makefile.mingw.in
* tests/makefile.mingw.in
* build-dll: Rename makefile.cygwin(.in) to
makefile.mingw(.in), which better describes what it is. Move the
build of gmodule, gthread and gobject DLLs to makefiles in those
directories. Move resource file handling and build number bump to
build-dll, where it sits much cleaner.

* README.win32
* Makefile.am (EXTRA_DIST): Update accordingly.

* glib.h: Add G_PI, G_PI_2, G_PI_4, G_E, G_LN2, G_LN10 and
G_SQRT2. M_PI etc aren't necessarily in <math.h> in strict ISO C
implementations.

* glib.def: Add g_strcanon.

* gtree.c (g_tree_node_rotate_left): Remove unused variables.

* gwin32.c (g_win32_opendir): Remove unneeded statement.

gmodule:

* makefile.mingw.in: New file, with gmodule stuff
moved from ../makefile.mingw.in.

* Makefile.am: Add to EXTRA_DIST, and add rule to make makefile.mingw.

gobject:
* makefile.mingw.in
* gobject.def
* gobject.rc.in: New files, for Win32 (mingw) build.

* Makefile.am: Add to EXTRA_DIST. Add rules to produce the
corresponding non-*.in files.

* gtype.h: (Win32:) Mark _g_type_fundamental_last for
export/import from DLL.

gthread:
* makefile.mingw.in: New file, with gthread stuff moved from
../makefile.mingw.in.

* Makefile.am: Add to EXTRA_DIST, add rule to build makefile.mingw.

36 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
Makefile.am
README.win32
build-dll
glib.def
glib.h
glib/Makefile.am
glib/glib.def
glib/glib.h
glib/gtree.c
glib/gwin32.c
glib/makefile.mingw.in [new file with mode: 0644]
gmodule/ChangeLog
gmodule/Makefile.am
gmodule/makefile.mingw.in [new file with mode: 0644]
gobject/ChangeLog
gobject/Makefile.am
gobject/gobject.def [new file with mode: 0644]
gobject/gobject.rc.in [new file with mode: 0644]
gobject/gtype.h
gobject/makefile.mingw.in [new file with mode: 0644]
gthread/ChangeLog
gthread/Makefile.am
gthread/makefile.mingw.in [new file with mode: 0644]
gtree.c
gwin32.c
makefile.cygwin.in [deleted file]
makefile.mingw.in [new file with mode: 0644]
tests/makefile.mingw.in [moved from tests/makefile.cygwin.in with 64% similarity]

index 01757c6..42d36db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in
+       * tests/makefile.mingw.in
+       * build-dll: Rename makefile.cygwin(.in) to
+       makefile.mingw(.in), which better describes what it is. Move the
+       build of gmodule, gthread and gobject DLLs to makefiles in those
+       directories. Move resource file handling and build number bump to
+       build-dll, where it sits much cleaner.
+
+       * README.win32
+       * Makefile.am (EXTRA_DIST): Update accordingly.
+
+       * glib.h: Add G_PI, G_PI_2, G_PI_4, G_E, G_LN2, G_LN10 and
+       G_SQRT2. M_PI etc aren't necessarily in <math.h> in strict ISO C
+       implementations.
+
+       * glib.def: Add g_strcanon.
+
+       * gtree.c (g_tree_node_rotate_left): Remove unused variables.
+
+       * gwin32.c (g_win32_opendir): Remove unneeded statement.
+
 Thu May  4 02:04:46 2000  Tim Janik  <timj@gtk.org>
 
         * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
index 01757c6..42d36db 100644 (file)
@@ -1,3 +1,26 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in
+       * tests/makefile.mingw.in
+       * build-dll: Rename makefile.cygwin(.in) to
+       makefile.mingw(.in), which better describes what it is. Move the
+       build of gmodule, gthread and gobject DLLs to makefiles in those
+       directories. Move resource file handling and build number bump to
+       build-dll, where it sits much cleaner.
+
+       * README.win32
+       * Makefile.am (EXTRA_DIST): Update accordingly.
+
+       * glib.h: Add G_PI, G_PI_2, G_PI_4, G_E, G_LN2, G_LN10 and
+       G_SQRT2. M_PI etc aren't necessarily in <math.h> in strict ISO C
+       implementations.
+
+       * glib.def: Add g_strcanon.
+
+       * gtree.c (g_tree_node_rotate_left): Remove unused variables.
+
+       * gwin32.c (g_win32_opendir): Remove unneeded statement.
+
 Thu May  4 02:04:46 2000  Tim Janik  <timj@gtk.org>
 
         * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
index 01757c6..42d36db 100644 (file)
@@ -1,3 +1,26 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in
+       * tests/makefile.mingw.in
+       * build-dll: Rename makefile.cygwin(.in) to
+       makefile.mingw(.in), which better describes what it is. Move the
+       build of gmodule, gthread and gobject DLLs to makefiles in those
+       directories. Move resource file handling and build number bump to
+       build-dll, where it sits much cleaner.
+
+       * README.win32
+       * Makefile.am (EXTRA_DIST): Update accordingly.
+
+       * glib.h: Add G_PI, G_PI_2, G_PI_4, G_E, G_LN2, G_LN10 and
+       G_SQRT2. M_PI etc aren't necessarily in <math.h> in strict ISO C
+       implementations.
+
+       * glib.def: Add g_strcanon.
+
+       * gtree.c (g_tree_node_rotate_left): Remove unused variables.
+
+       * gwin32.c (g_win32_opendir): Remove unneeded statement.
+
 Thu May  4 02:04:46 2000  Tim Janik  <timj@gtk.org>
 
         * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
index 01757c6..42d36db 100644 (file)
@@ -1,3 +1,26 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in
+       * tests/makefile.mingw.in
+       * build-dll: Rename makefile.cygwin(.in) to
+       makefile.mingw(.in), which better describes what it is. Move the
+       build of gmodule, gthread and gobject DLLs to makefiles in those
+       directories. Move resource file handling and build number bump to
+       build-dll, where it sits much cleaner.
+
+       * README.win32
+       * Makefile.am (EXTRA_DIST): Update accordingly.
+
+       * glib.h: Add G_PI, G_PI_2, G_PI_4, G_E, G_LN2, G_LN10 and
+       G_SQRT2. M_PI etc aren't necessarily in <math.h> in strict ISO C
+       implementations.
+
+       * glib.def: Add g_strcanon.
+
+       * gtree.c (g_tree_node_rotate_left): Remove unused variables.
+
+       * gwin32.c (g_win32_opendir): Remove unneeded statement.
+
 Thu May  4 02:04:46 2000  Tim Janik  <timj@gtk.org>
 
         * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
index 01757c6..42d36db 100644 (file)
@@ -1,3 +1,26 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in
+       * tests/makefile.mingw.in
+       * build-dll: Rename makefile.cygwin(.in) to
+       makefile.mingw(.in), which better describes what it is. Move the
+       build of gmodule, gthread and gobject DLLs to makefiles in those
+       directories. Move resource file handling and build number bump to
+       build-dll, where it sits much cleaner.
+
+       * README.win32
+       * Makefile.am (EXTRA_DIST): Update accordingly.
+
+       * glib.h: Add G_PI, G_PI_2, G_PI_4, G_E, G_LN2, G_LN10 and
+       G_SQRT2. M_PI etc aren't necessarily in <math.h> in strict ISO C
+       implementations.
+
+       * glib.def: Add g_strcanon.
+
+       * gtree.c (g_tree_node_rotate_left): Remove unused variables.
+
+       * gwin32.c (g_win32_opendir): Remove unneeded statement.
+
 Thu May  4 02:04:46 2000  Tim Janik  <timj@gtk.org>
 
         * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
index 01757c6..42d36db 100644 (file)
@@ -1,3 +1,26 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in
+       * tests/makefile.mingw.in
+       * build-dll: Rename makefile.cygwin(.in) to
+       makefile.mingw(.in), which better describes what it is. Move the
+       build of gmodule, gthread and gobject DLLs to makefiles in those
+       directories. Move resource file handling and build number bump to
+       build-dll, where it sits much cleaner.
+
+       * README.win32
+       * Makefile.am (EXTRA_DIST): Update accordingly.
+
+       * glib.h: Add G_PI, G_PI_2, G_PI_4, G_E, G_LN2, G_LN10 and
+       G_SQRT2. M_PI etc aren't necessarily in <math.h> in strict ISO C
+       implementations.
+
+       * glib.def: Add g_strcanon.
+
+       * gtree.c (g_tree_node_rotate_left): Remove unused variables.
+
+       * gwin32.c (g_win32_opendir): Remove unneeded statement.
+
 Thu May  4 02:04:46 2000  Tim Janik  <timj@gtk.org>
 
         * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
index 01757c6..42d36db 100644 (file)
@@ -1,3 +1,26 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in
+       * tests/makefile.mingw.in
+       * build-dll: Rename makefile.cygwin(.in) to
+       makefile.mingw(.in), which better describes what it is. Move the
+       build of gmodule, gthread and gobject DLLs to makefiles in those
+       directories. Move resource file handling and build number bump to
+       build-dll, where it sits much cleaner.
+
+       * README.win32
+       * Makefile.am (EXTRA_DIST): Update accordingly.
+
+       * glib.h: Add G_PI, G_PI_2, G_PI_4, G_E, G_LN2, G_LN10 and
+       G_SQRT2. M_PI etc aren't necessarily in <math.h> in strict ISO C
+       implementations.
+
+       * glib.def: Add g_strcanon.
+
+       * gtree.c (g_tree_node_rotate_left): Remove unused variables.
+
+       * gwin32.c (g_win32_opendir): Remove unneeded statement.
+
 Thu May  4 02:04:46 2000  Tim Janik  <timj@gtk.org>
 
         * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
index 01757c6..42d36db 100644 (file)
@@ -1,3 +1,26 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in
+       * tests/makefile.mingw.in
+       * build-dll: Rename makefile.cygwin(.in) to
+       makefile.mingw(.in), which better describes what it is. Move the
+       build of gmodule, gthread and gobject DLLs to makefiles in those
+       directories. Move resource file handling and build number bump to
+       build-dll, where it sits much cleaner.
+
+       * README.win32
+       * Makefile.am (EXTRA_DIST): Update accordingly.
+
+       * glib.h: Add G_PI, G_PI_2, G_PI_4, G_E, G_LN2, G_LN10 and
+       G_SQRT2. M_PI etc aren't necessarily in <math.h> in strict ISO C
+       implementations.
+
+       * glib.def: Add g_strcanon.
+
+       * gtree.c (g_tree_node_rotate_left): Remove unused variables.
+
+       * gwin32.c (g_win32_opendir): Remove unneeded statement.
+
 Thu May  4 02:04:46 2000  Tim Janik  <timj@gtk.org>
 
         * configure.in (STRIP_DUMMY): some Make 3.79 $(strip ) versions are
index f66c3a2..b3c4d79 100644 (file)
@@ -19,8 +19,8 @@ EXTRA_DIST = \
        glib.def                \
        makefile.msc            \
        makefile.msc.in         \
-       makefile.cygwin         \
-       makefile.cygwin.in      \
+       makefile.mingw          \
+       makefile.mingw.in       \
        giowin32.c              \
        glibconfig.h.win32      \
        glibconfig.h.win32.in   \
@@ -107,7 +107,7 @@ config.h.win32: $(top_builddir)/config.status $(top_srcdir)/config.h.win32.in
 makefile.msc: $(top_builddir)/config.status $(top_srcdir)/makefile.msc.in
        cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
-makefile.cygwin: $(top_builddir)/config.status $(top_srcdir)/makefile.cygwin.in
+makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/makefile.mingw.in
        cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 glib.rc: $(top_builddir)/config.status $(top_srcdir)/glib.rc.in
index f1f605c..778562d 100644 (file)
@@ -4,9 +4,9 @@ General
 For more information about the port or GLib, GTk+ and the GIMP to
 native Windows, and pre-built binary packages, see
 http://www.iki.fi/tml/gimp/win32/ . "Native" means that we use the
-Win32 API only, and not any POSIX emulation layer except that provided
-by the Microsoft runtime C library. Additionally, a pthreads emulation
-library is used.
+Win32 API only, and not any POSIX operating system emulation layer
+except that provided by the Microsoft runtime C library. Additionally,
+a pthreads emulation library is used.
 
 To build GLib on Win32, you can use either the Microsoft compiler and
 tools, or gcc. Both the compiler from MSVC 5.0 and from MSVC 6.0 have
@@ -18,7 +18,7 @@ and .dll files) that do *not* require the cygwin runtime library. This
 is called "mingw".
 
 To test the GLib functions, go to the tests subdirectory and enter
-`nmake -f makefile.msc check` or `make -f makefile.cygwin check`.
+`nmake -f makefile.msc check` or `make -f makefile.mingw check`.
 
 If you would want to use the cygwin tools to generate executables that
 *do* use the cygwin runtime, the normal Unix configuration method
@@ -69,7 +69,7 @@ Before building you must get the pthreads library for Win32 from
 http://sourceware.cygnus.com/pthreads-win32/. The pthreads-win32
 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 pthreads distribution includes the precompiled dll
+makefile.mingw. 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
@@ -80,8 +80,8 @@ 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,
+makefile.msc or makefile.mingw file. You should copy the
+corresponding makefile.msc.in or makefile.mingw.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
@@ -355,7 +355,7 @@ diff -ru2 ./w32api/include/wingdi.h ../../src/mingw-runtime-19991107/w32api/incl
 5) Whew. That hopefully should be it.
 
 Next, go back to the GLib directory and build using `make -f
-makefile.cygwin`.  Building the dlls uses the script build-dll which
+makefile.mingw`. Building the dlls uses the script build-dll which
 is somewhat of a hack. But I couldn't get things working in a cleaner
 way.
 
index 3ad30ac..0d1f6f0 100644 (file)
--- a/build-dll
+++ b/build-dll
@@ -3,9 +3,8 @@
 # Temporary hack until building dlls is easier with gcc -mno-cygwin
 # ("mingw32").
 
-# This is usable with cygwin b20.1 and egcs-2.91.66 19990314
-# (egcs-1.1.2 release) or gcc-2.95(.2) as distributed by Mumit Khan. For
-# other combinations, no idea.
+# This is usable with cygwin b20.1 and gcc-2.95.2 as distributed by
+# Mumit Khan. For other combinations, no idea.
 
 GCC="gcc"
 DLLTOOL="dlltool"
@@ -29,6 +28,35 @@ for F in $ldargs; do
     esac
 done
 
+# Check if we have a resource file for this DLL.
+resfile=""
+if [ -f $library.rc ]; then
+    # Kludge to get the path to the win32 headers. Should work for both
+    # gcc running on cygwin, and bare mingw gcc, even if the make is
+    # running on cygwin (whew).
+    WIN32APIHEADERS=`echo "\#include <winver.h>" | $GCC -M -E - | tail -1 | sed -e 's![\\/]winver.h!!' | tr -d '\015'`
+
+    resfile=$library-win32res.o
+    objs="$objs $resfile"
+
+    # Check if we have a build number stamp file.
+    if [ -f $library-build.stamp ]; then
+       read number <$library-build.stamp
+       buildnumber=$[number+1]
+       echo Build number is $buildnumber
+       echo $buildnumber >$library-build.stamp
+    else
+       echo Using zero as build number
+        buildnumber=0
+    fi
+
+    m4 -DBUILDNUMBER=$buildnumber <$library.rc >$library-win32res.rc
+    windres --include-dir $WIN32APIHEADERS $library-win32res.rc $library-win32res.o
+    rm $library-win32res.rc
+fi
+
+# Build the DLL.
+
 $GCC -mdll -mno-cygwin -Wl,--base-file,$library.base -o $dllfile $ldargs &&
 $DLLTOOL --as=$AS --dllname $dllfile $defswitch --base-file $library.base --output-exp $library.exp $objs &&
 $GCC -mdll -mno-cygwin -Wl,--base-file,$library.base,$library.exp -o $dllfile $ldargs &&
index 20f83b7..c7ea6ff 100644 (file)
--- a/glib.def
+++ b/glib.def
@@ -370,6 +370,7 @@ EXPORTS
        g_static_rw_lock_writer_unlock
        g_str_equal
        g_str_hash
+       g_strcanon
        g_strcasecmp
        g_strchomp
        g_strchug
diff --git a/glib.h b/glib.h
index b05f2bf..23aa72c 100644 (file)
--- a/glib.h
+++ b/glib.h
  */
 #include <glibconfig.h>
 
+/* Define some mathematical constants that aren't available
+ * symbolically in some strict ISO C implementations.
+ */
+#define G_E     2.7182818284590452354E0
+#define G_LN2   6.9314718055994530942E-1
+#define G_LN10  2.3025850929940456840E0
+#define G_PI    3.14159265358979323846E0
+#define G_PI_2  1.57079632679489661923E0
+#define G_PI_4  0.78539816339744830962E0
+#define G_SQRT2 1.4142135623730950488E0
+
 /* include varargs functions for assertment macros
  */
 #include <stdarg.h>
index f66c3a2..b3c4d79 100644 (file)
@@ -19,8 +19,8 @@ EXTRA_DIST = \
        glib.def                \
        makefile.msc            \
        makefile.msc.in         \
-       makefile.cygwin         \
-       makefile.cygwin.in      \
+       makefile.mingw          \
+       makefile.mingw.in       \
        giowin32.c              \
        glibconfig.h.win32      \
        glibconfig.h.win32.in   \
@@ -107,7 +107,7 @@ config.h.win32: $(top_builddir)/config.status $(top_srcdir)/config.h.win32.in
 makefile.msc: $(top_builddir)/config.status $(top_srcdir)/makefile.msc.in
        cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
-makefile.cygwin: $(top_builddir)/config.status $(top_srcdir)/makefile.cygwin.in
+makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/makefile.mingw.in
        cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
 glib.rc: $(top_builddir)/config.status $(top_srcdir)/glib.rc.in
index 20f83b7..c7ea6ff 100644 (file)
@@ -370,6 +370,7 @@ EXPORTS
        g_static_rw_lock_writer_unlock
        g_str_equal
        g_str_hash
+       g_strcanon
        g_strcasecmp
        g_strchomp
        g_strchug
index b05f2bf..23aa72c 100644 (file)
  */
 #include <glibconfig.h>
 
+/* Define some mathematical constants that aren't available
+ * symbolically in some strict ISO C implementations.
+ */
+#define G_E     2.7182818284590452354E0
+#define G_LN2   6.9314718055994530942E-1
+#define G_LN10  2.3025850929940456840E0
+#define G_PI    3.14159265358979323846E0
+#define G_PI_2  1.57079632679489661923E0
+#define G_PI_4  0.78539816339744830962E0
+#define G_SQRT2 1.4142135623730950488E0
+
 /* include varargs functions for assertment macros
  */
 #include <stdarg.h>
index 1f29951..fa40b77 100644 (file)
@@ -657,12 +657,10 @@ g_tree_node_height (GTreeNode *node)
 static GTreeNode*
 g_tree_node_rotate_left (GTreeNode *node)
 {
-  GTreeNode *left;
   GTreeNode *right;
   gint a_bal;
   gint b_bal;
 
-  left = node->left;
   right = node->right;
 
   node->right = right->left;
index bd4ae65..b5e2d80 100644 (file)
@@ -101,7 +101,6 @@ g_win32_opendir (const char *dirname)
   if (k && result->dir_name[k - 1] == '\\')
     {
       result->dir_name[k - 1] = '\0';
-      k--;
     }
   mask = g_strdup_printf ("%s\\*", result->dir_name);
 
diff --git a/glib/makefile.mingw.in b/glib/makefile.mingw.in
new file mode 100644 (file)
index 0000000..7174781
--- /dev/null
@@ -0,0 +1,120 @@
+## Makefile for building the GLib DLL with gcc for mingw. The build
+## uses tools running on cygwin, however.
+
+## Use: make -f makefile.mingw
+
+# Change this to wherever you want to install the DLLs. This directory
+# should be in your PATH.
+BIN = /bin
+
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+TOP = ..
+
+include $(TOP)/build/win32/make.mingw
+
+################################################################
+
+# Nothing much configurable below
+
+INCLUDES = -I .
+DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib
+
+DLLS_TO_BUILD = \
+       glib-$(GLIB_VER).dll \
+       gmodule/gmodule-$(GLIB_VER).dll \
+       gthread/gthread-$(GLIB_VER).dll \
+       gobject/gobject-$(GLIB_VER).dll \
+
+
+all : \
+       config.h \
+       glibconfig.h \
+       $(DLLS_TO_BUILD) \
+       testglib.exe \
+       testgdate.exe \
+       testgdateparser.exe
+
+install : all
+       $(INSTALL) $(DLLS_TO_BUILD) $(BIN)
+
+glib_OBJECTS = \
+       garray.o \
+       gasyncqueue.o \
+       gcache.o \
+       gcompletion.o \
+       gdataset.o \
+       gdate.o \
+       gerror.o \
+       ghook.o \
+       ghash.o \
+       giochannel.o \
+       giowin32.o \
+       glist.o \
+       gmain.o \
+       gmem.o \
+       gmessages.o \
+       gnode.o \
+       gprimes.o \
+       gqueue.o \
+       grand.o \
+       gslist.o \
+       gthread.o \
+       gthreadpool.o \
+       gtimer.o \
+       gtree.o \
+       grel.o \
+       gstring.o \
+       gstrfuncs.o \
+       gscanner.o \
+       gutils.o \
+       gwin32.o
+
+glibconfig.h: glibconfig.h.win32
+       cp $< $@
+
+config.h: config.h.win32
+       cp $< $@
+
+makefile.mingw: makefile.mingw.in
+       sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
+           -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
+
+################ glib
+
+glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
+       ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) -luser32 -lwsock32
+
+################ subdirectories
+
+gmodule/gmodule-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+       cd gmodule && $(MAKE) -f makefile.mingw all
+
+gthread/gthread-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+       cd gthread && $(MAKE) -f makefile.mingw all
+
+gobject/gobject-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+       cd gobject && $(MAKE) -f makefile.mingw all
+
+################ test progs
+
+testglib.exe : glib-$(GLIB_VER).dll testglib.o
+       $(CC) $(CFLAGS) -o testglib testglib.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testgdate.exe : glib-$(GLIB_VER).dll testgdate.o
+       $(CC) $(CFLAGS) -o testgdate.exe testgdate.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testgdate.o : testgdate.c
+       $(CC) -c $(CFLAGS) testgdate.c
+
+testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.o
+       $(CC) $(CFLAGS) -o testgdateparser.exe testgdateparser.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testgdateparser.o : testgdateparser.c
+       $(CC) -c $(CFLAGS) testgdateparser.c
+
+
+################ other stuff
+
+clean::
+       -rm config.h glibconfig.h gmodule/gmoduleconf.h
index b477036..211595b 100644 (file)
@@ -1,3 +1,10 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in: New file, with gmodule stuff
+       moved from ../makefile.mingw.in.
+
+       * Makefile.am: Add to EXTRA_DIST, and add rule to make makefile.mingw.
+
 2000-05-02  Tor Lillqvist  <tml@iki.fi>
 
        * gmodule-win32.c: No need to include <psapi.h>
index 2aa96ae..e4d3b38 100644 (file)
@@ -4,6 +4,8 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gmodule \
        -DG_LOG_DOMAIN=g_log_domain_gmodule @GLIB_DEBUG_FLAGS@
 
 EXTRA_DIST =   \
+               makefile.mingw  \
+               makefile.mingw.in \
                gmoduleconf.h.in \
                gmodule.def     \
                gmodule-dl.c    \
@@ -53,6 +55,9 @@ testgmodule_LDADD = libgmodule.la $(libglib) @G_MODULE_LIBS@
 gmodule.rc: $(top_builddir)/config.status $(top_srcdir)/gmodule/gmodule.rc.in
        cd $(top_builddir) && CONFIG_FILES=gmodule/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
+makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gmodule/makefile.mingw.in
+       cd $(top_builddir) && CONFIG_FILES=gmodule/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
 .PHONY: files release
 
 files:
diff --git a/gmodule/makefile.mingw.in b/gmodule/makefile.mingw.in
new file mode 100644 (file)
index 0000000..2c9c903
--- /dev/null
@@ -0,0 +1,58 @@
+## Makefile for building the gmodule DLL with gcc for mingw. The build
+## uses tools running on cygwin, however.
+
+## Use: make -f makefile.mingw
+
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+TOP = ../..
+
+include $(TOP)/build/win32/make.mingw
+
+################################################################
+
+# Nothing much configurable below
+
+INCLUDES = -I .. -I .
+DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=g_log_domain_gmodule
+
+BUILD_DLL = ../build-dll
+
+all : \
+       gmoduleconf.h \
+       gmodule-$(GLIB_VER).dll \
+       testgmodule.exe
+
+makefile.mingw: makefile.mingw.in
+       sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
+           -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
+
+gmodule_OBJECTS = \
+       gmodule.o
+
+gmoduleconf.h: gmoduleconf.h.win32
+       cp $< $@
+
+
+gmodule-win32res.o : gmodule.rc gmodule-build.tmp
+
+gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule.def
+       $(BUILD_DLL) gmodule $(GLIB_VER) gmodule.def $(gmodule_OBJECTS) gmodule-win32res.o -L .. -lglib-$(GLIB_VER)
+
+################ test prog
+
+testgmodule.exe : gmodule-$(GLIB_VER).dll testgmodule.o libgplugin_a.dll libgplugin_b.dll
+# Wow, do we really have to do it like this to get some symbols
+# exported from a .exe? Apparently yes. Does the __declspec(dllexport) 
+# actually do anything in gcc?
+       $(CC) $(CFLAGS) -Wl,--base-file,testgmodule.base -o testgmodule.exe testgmodule.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER) $(LDFLAGS)
+       $(DLLTOOL) --base-file testgmodule.base --output-exp testgmodule.exp testgmodule.o
+       $(CC) $(CFLAGS) -Wl,--base-file,testgmodule.base,testgmodule.exp -o testgmodule.exe testgmodule.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER) $(LDFLAGS)
+       $(DLLTOOL) --base-file testgmodule.base --output-exp testgmodule.exp testgmodule.o
+       $(CC) $(CFLAGS) -Wl,testgmodule.exp -o testgmodule.exe testgmodule.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER) $(LDFLAGS)
+
+libgplugin_a.dll : libgplugin_a.o
+       $(BUILD_DLL) libgplugin_a - - libgplugin_a.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER)
+
+libgplugin_b.dll : libgplugin_b.o
+       $(BUILD_DLL) libgplugin_b - - libgplugin_b.o -L .. -lglib-$(GLIB_VER) -L . -lgmodule-$(GLIB_VER)
index 5f3717e..f7535eb 100644 (file)
@@ -1,3 +1,15 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in
+       * gobject.def
+       * gobject.rc.in: New files, for Win32 (mingw) build.
+
+       * Makefile.am: Add to EXTRA_DIST. Add rules to produce the
+       corresponding non-*.in files.
+
+       * gtype.h: (Win32:) Mark _g_type_fundamental_last for
+       export/import from DLL.
+
 Fri May  5 01:15:48 2000  Tim Janik  <timj@gtk.org>
 
        * gtype.h: add reserved fundamental ids for gtk types (for transition
index 80ac2de..80a2d5e 100644 (file)
@@ -80,4 +80,15 @@ gobject_query_LDADD = $(progs_LDADD)
 # auxillary files
 #
 EXTRA_DIST += \
-       TODO
+       TODO            \
+       makefile.mingw  \
+       makefile.mingw.in \
+       gobject.rc      \
+       gobject.rc.in
+
+gobject.rc: $(top_builddir)/config.status $(top_srcdir)/gobject/gobject.rc.in
+       cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gobject/makefile.mingw.in
+       cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
diff --git a/gobject/gobject.def b/gobject/gobject.def
new file mode 100644 (file)
index 0000000..f7e023a
--- /dev/null
@@ -0,0 +1,118 @@
+EXPORTS
+       _g_type_fundamental_last
+       g_enum_complete_type_info
+       g_enum_get_value
+       g_enum_get_value_by_name
+       g_enum_get_value_by_nick
+       g_enum_register_static
+       g_flags_complete_type_info
+       g_flags_get_first_value
+       g_flags_get_value_by_name
+       g_flags_get_value_by_nick
+       g_flags_register_static
+       g_object_class_find_param_spec
+       g_object_class_install_param
+       g_object_get
+       g_object_get_param
+       g_object_get_qdata
+       g_object_get_valist
+       g_object_new
+       g_object_new_valist
+       g_object_queue_param_changed
+       g_object_ref
+       g_object_set
+       g_object_set_param
+       g_object_set_qdata
+       g_object_set_qdata_full
+       g_object_set_valist
+       g_object_steal_qdata
+       g_object_unref
+       g_param_spec_bool
+       g_param_spec_char
+       g_param_spec_double
+       g_param_spec_enum
+       g_param_spec_flags
+       g_param_spec_float
+       g_param_spec_get_qdata
+       g_param_spec_int
+       g_param_spec_long
+       g_param_spec_object
+       g_param_spec_ref
+       g_param_spec_set_qdata
+       g_param_spec_set_qdata_full
+       g_param_spec_steal_qdata
+       g_param_spec_string
+       g_param_spec_string_c
+       g_param_spec_uchar
+       g_param_spec_uint
+       g_param_spec_ulong
+       g_param_spec_unref
+       g_type_add_interface_dynamic
+       g_type_add_interface_static
+       g_type_check_class_cast
+       g_type_check_flags
+       g_type_check_instance_cast
+       g_type_children
+       g_type_class_is_a
+       g_type_class_peek
+       g_type_class_peek_parent
+       g_type_class_ref
+       g_type_class_unref
+       g_type_conforms_to
+       g_type_create_instance
+       g_type_free_instance
+       g_type_from_name
+       g_type_fundamental_branch_last
+       g_type_get_qdata
+       g_type_init
+       g_type_instance_conforms_to
+       g_type_interface_peek
+       g_type_interfaces
+       g_type_is_a
+       g_type_name
+       g_type_next_base
+       g_type_parent
+       g_type_qname
+       g_type_register_dynamic
+       g_type_register_fundamental
+       g_type_register_static
+       g_type_set_qdata
+       g_value_convert
+       g_value_copy
+       g_value_defaults
+       g_value_dup_object
+       g_value_dup_string
+       g_value_get_bool
+       g_value_get_char
+       g_value_get_double
+       g_value_get_enum
+       g_value_get_flags
+       g_value_get_float
+       g_value_get_int
+       g_value_get_long
+       g_value_get_object
+       g_value_get_string
+       g_value_get_uchar
+       g_value_get_uint
+       g_value_get_ulong
+       g_value_init
+       g_value_init_default
+       g_value_reset
+       g_value_set_bool
+       g_value_set_char
+       g_value_set_default
+       g_value_set_double
+       g_value_set_enum
+       g_value_set_flags
+       g_value_set_float
+       g_value_set_int
+       g_value_set_long
+       g_value_set_object
+       g_value_set_string
+       g_value_set_uchar
+       g_value_set_uint
+       g_value_set_ulong
+       g_value_unset
+       g_value_validate
+       g_values_cmp
+       g_values_exchange
diff --git a/gobject/gobject.rc.in b/gobject/gobject.rc.in
new file mode 100644 (file)
index 0000000..dfecde1
--- /dev/null
@@ -0,0 +1,30 @@
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+  FILEVERSION @GLIB_MAJOR_VERSION@,@GLIB_MINOR_VERSION@,@GLIB_MICRO_VERSION@,BUILDNUMBER
+  PRODUCTVERSION @GLIB_MAJOR_VERSION@,@GLIB_MINOR_VERSION@,@GLIB_MICRO_VERSION@,0
+  FILEFLAGSMASK 0
+  FILEFLAGS 0
+  FILEOS VOS__WINDOWS32
+  FILETYPE VFT_DLL
+  FILESUBTYPE VFT2_UNKNOWN
+  BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+      BLOCK "040904B0"
+      BEGIN
+       VALUE "CompanyName", "The GLib developer community"
+       VALUE "FileDescription", "GLib"
+       VALUE "FileVersion", "@GLIB_VERSION@.BUILDNUMBER"
+       VALUE "InternalName", "gobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@"
+       VALUE "LegalCopyright", "Copyright © 1998-2000 Tim Janik and Red Hat, Inc."
+       VALUE "OriginalFilename", "gobject-@GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@.dll"
+       VALUE "ProductName", "GLib"
+       VALUE "ProductVersion", "@GLIB_VERSION@"
+      END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+      VALUE "Translation", 0x409, 1200
+    END
+  END
index 5ddf4e9..66b8a90 100644 (file)
@@ -293,9 +293,18 @@ void            g_type_free_instance            (GTypeInstance  *instance);
 #define _G_TYPE_IGC(ip, ct)             ((ct*) (((GTypeInstance*) ip)->g_class))
 #define _G_TYPE_CIT(ip, gt)             (g_type_instance_conforms_to ((GTypeInstance*) ip, gt))
 #define _G_TYPE_CCT(cp, gt)             (g_type_class_is_a ((GTypeClass*) cp, gt))
-extern GType    _g_type_fundamental_last;
-
 
+#ifdef G_OS_WIN32
+#  ifdef GMODULE_COMPILATION
+#    define GTYPE_C_VAR __declspec(dllexport)
+#  else /* !GLIB_COMPILATION */
+#    define GTYPE_C_VAR extern __declspec(dllimport)
+#  endif /* !GLIB_COMPILATION */
+#else /* !G_OS_WIN32 */
+#  define GTYPE_C_VAR extern
+#endif /* !G_OS_WIN32 */
+
+GTYPE_C_VAR GType    _g_type_fundamental_last;
 
 #ifdef __cplusplus
 }
diff --git a/gobject/makefile.mingw.in b/gobject/makefile.mingw.in
new file mode 100644 (file)
index 0000000..f7e0e5d
--- /dev/null
@@ -0,0 +1,37 @@
+## Makefile for building the gobject DLL with gcc for mingw. The build
+## uses tools running on cygwin, however.
+
+## Use: make -f makefile.mingw
+
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+TOP = ../..
+
+include $(TOP)/build/win32/make.mingw
+
+################################################################
+
+# Nothing much configurable below
+
+INCLUDES = -I .. -I .
+DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=g_log_domain_gobject
+
+BUILD_DLL = ../build-dll
+
+all : \
+       gobject-$(GLIB_VER).dll
+
+makefile.mingw: makefile.mingw.in
+       sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
+           -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
+
+gobject_OBJECTS = \
+       gvalue.o \
+       gparam.o \
+       gparamspecs.o \
+       genums.o \
+       gobject.o \
+       gtype.o
+
+gobject-$(GLIB_VER).dll : $(gobject_OBJECTS) gobject.def
+       $(BUILD_DLL) gobject $(GLIB_VER) gobject.def $(gobject_OBJECTS) -L .. -lglib-$(GLIB_VER)
index f2fa1c8..f57db4d 100644 (file)
@@ -1,3 +1,10 @@
+2000-05-13  Tor Lillqvist  <tml@iki.fi>
+
+       * makefile.mingw.in: New file, with gthread stuff moved from
+       ../makefile.mingw.in.
+
+       * Makefile.am: Add to EXTRA_DIST, add rule to build makefile.mingw.
+
 2000-04-25  Sebastian Wilhelmi  <wilhelmi@ira.uka.de>
 
        * gthread-solaris.c (g_mutex_new_solaris_impl): Changed the scope
index 9374543..beeedcc 100644 (file)
@@ -4,6 +4,8 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gthread \
        -DG_LOG_DOMAIN=\"GThread\" @GTHREAD_COMPILE_IMPL_DEFINES@
 
 EXTRA_DIST =                           \
+               makefile.mingw          \
+               makefile.mingw.in       \
                gthread-posix.c         \
                gthread-solaris.c       \
                gthread-none.c          \
@@ -28,3 +30,5 @@ libgthread_la_LIBADD = @G_THREAD_LIBS_EXTRA@ @G_THREAD_LIBS@
 gthread.rc: $(top_builddir)/config.status $(top_srcdir)/gthread/gthread.rc.in
        cd $(top_builddir) && CONFIG_FILES=gthread/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
+makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gthread/makefile.mingw.in
+       cd $(top_builddir) && CONFIG_FILES=gthread/$@ CONFIG_HEADERS= $(SHELL) ./config.status
diff --git a/gthread/makefile.mingw.in b/gthread/makefile.mingw.in
new file mode 100644 (file)
index 0000000..47e7863
--- /dev/null
@@ -0,0 +1,39 @@
+## Makefile for building the gthread DLL with gcc for mingw. The build
+## uses tools running on cygwin, however.
+
+## Use: make -f makefile.mingw
+
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+TOP = ../..
+
+# This is the location of pthreads for Win32, 
+# see http://sourceware.cygnus.com/pthreads-win32/
+# We want the 1999-05-30 snapshot.
+PTHREADS = $(TOP)/pthreads-snap-1999-05-30
+PTHREAD_LIBS = -L $(PTHREADS) -lpthread32
+PTHREAD_INC = -I $(PTHREADS)
+
+include $(TOP)/build/win32/make.mingw
+
+################################################################
+
+# Nothing much configurable below
+
+INCLUDES = -I .. -I . $(PTHREAD_INC)
+DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"GThread\"
+
+BUILD_DLL = ../build-dll
+
+all : \
+       gthread-$(GLIB_VER).dll
+
+makefile.mingw: makefile.mingw.in
+       sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
+           -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
+
+gthread_OBJECTS = \
+       gthread-impl.o
+
+gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) gthread.def
+       $(BUILD_DLL) gthread $(GLIB_VER) gthread.def $(gthread_OBJECTS) -L .. -lglib-$(GLIB_VER) $(PTHREAD_LIBS)
diff --git a/gtree.c b/gtree.c
index 1f29951..fa40b77 100644 (file)
--- a/gtree.c
+++ b/gtree.c
@@ -657,12 +657,10 @@ g_tree_node_height (GTreeNode *node)
 static GTreeNode*
 g_tree_node_rotate_left (GTreeNode *node)
 {
-  GTreeNode *left;
   GTreeNode *right;
   gint a_bal;
   gint b_bal;
 
-  left = node->left;
   right = node->right;
 
   node->right = right->left;
index bd4ae65..b5e2d80 100644 (file)
--- a/gwin32.c
+++ b/gwin32.c
@@ -101,7 +101,6 @@ g_win32_opendir (const char *dirname)
   if (k && result->dir_name[k - 1] == '\\')
     {
       result->dir_name[k - 1] = '\0';
-      k--;
     }
   mask = g_strdup_printf ("%s\\*", result->dir_name);
 
diff --git a/makefile.cygwin.in b/makefile.cygwin.in
deleted file mode 100644 (file)
index c5f9f2b..0000000
+++ /dev/null
@@ -1,220 +0,0 @@
-## Makefile for building the GLib, gmodule and gthread DLLs with
-## gcc on mingw or cygwin.
-## Use: make -f makefile.cygwin install
-
-# Change this to wherever you want to install the DLLs. This directory
-# should be in your PATH.
-BIN = /bin
-
-# This is the location of pthreads for Win32, 
-# see http://sourceware.cygnus.com/pthreads-win32/
-# 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
-
-GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
-
-TOP = ..
-
-include $(TOP)/build/win32/make.mingw
-
-################################################################
-
-# Nothing much configurable below
-
-DLLTOOL = dlltool
-INSTALL = install
-
-INCLUDES = -I .
-DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib
-
-all : \
-       config.h        \
-       glibconfig.h    \
-       glib-$(GLIB_VER).dll \
-       gmodule/gmoduleconf.h \
-       gmodule-$(GLIB_VER).dll \
-       gthread-$(GLIB_VER).dll \
-       testglib.exe    \
-       testgmodule.exe \
-       testgdate.exe   \
-       testgdateparser.exe
-
-install : all
-       $(INSTALL) glib-$(GLIB_VER).dll $(BIN)
-       $(INSTALL) gmodule-$(GLIB_VER).dll $(BIN)
-       $(INSTALL) gthread-$(GLIB_VER).dll $(BIN)
-
-glib_OBJECTS = \
-       garray.o        \
-       gasyncqueue.o   \
-       gcache.o        \
-       gcompletion.o   \
-       gdataset.o      \
-       gdate.o         \
-       gerror.o        \
-       ghook.o         \
-       ghash.o         \
-       giochannel.o    \
-       giowin32.o      \
-       glist.o         \
-       gmain.o         \
-       gmem.o          \
-       gmessages.o     \
-       gnode.o         \
-       gprimes.o       \
-       gqueue.o        \
-       grand.o         \
-       gslist.o        \
-       gthread.o       \
-       gthreadpool.o   \
-       gtimer.o        \
-       gtree.o         \
-       grel.o          \
-       gstring.o       \
-       gstrfuncs.o     \
-       gscanner.o      \
-       gutils.o        \
-       gwin32.o        \
-       glib-win32res.o
-
-glibconfig.h: glibconfig.h.win32
-       cp glibconfig.h.win32 glibconfig.h
-
-config.h: config.h.win32
-       cp config.h.win32 config.h
-
-################ glib
-
-# The *.stamp files aren't distributed. Thus, this takes care of only
-# tml building libraries with nonzero build number.
-
-ifeq ($(wildcard glib-build.stamp),glib-build.stamp)
-# Bump the build number
-glib-build.tmp :
-       bash -c "read number && echo $$[number+1]" <glib-build.stamp >glib-build.tmp
-       cp glib-build.tmp glib-build.stamp
-else
-# Use zero as build number.
-glib-build.tmp :
-       echo 0 >glib-build.tmp
-endif
-
-glib-win32res.o : glib.rc glib-build.tmp
-       m4 -DBUILDNUMBER=`cat glib-build.tmp` <glib.rc >glib-win32res.rc
-       windres --include-dir $(WIN32APIHEADERS) glib-win32res.rc glib-win32res.o
-       rm glib-build.tmp glib-win32res.rc
-
-glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
-       ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) -luser32 -lwsock32
-
-
-################ gmodule
-
-gmodule_OBJECTS = \
-       gmodule.o       \
-       gmodule-win32res.o
-
-# Unfortunately I couldn't use a pattern rule for this, so copy-paste
-# from above.
-ifeq ($(wildcard glib-build.stamp),glib-build.stamp)
-gmodule-build.tmp :
-       bash -c "read number && echo $$[number+1]" <gmodule-build.stamp >gmodule-build.tmp
-       cp gmodule-build.tmp gmodule-build.stamp
-else
-gmodule-build.tmp :
-       echo 0 >gmodule-build.tmp
-endif
-
-gmodule-win32res.o : gmodule/gmodule.rc gmodule-build.tmp
-       m4 -DBUILDNUMBER=`cat gmodule-build.tmp` <gmodule/gmodule.rc >gmodule-win32res.rc
-       windres --include-dir $(WIN32APIHEADERS) gmodule-win32res.rc gmodule-win32res.o
-       rm gmodule-build.tmp gmodule-win32res.rc
-
-
-gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule/gmodule.def
-       ./build-dll gmodule $(GLIB_VER) gmodule/gmodule.def $(gmodule_OBJECTS) -L. -lglib-$(GLIB_VER) -lwsock32
-
-gmodule.o : gmodule/gmodule.c gmodule/gmodule-win32.c
-       $(CC) $(CFLAGS) -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule/gmodule.c
-
-gmodule/gmoduleconf.h: gmodule/gmoduleconf.h.win32
-       cp gmodule/gmoduleconf.h.win32 gmodule/gmoduleconf.h
-
-################ gthread
-
-gthread_OBJECTS = \
-       gthread-impl.o  \
-       gthread-win32res.o
-
-# Ditto copy-pasting
-ifeq ($(wildcard glib-build.stamp),glib-build.stamp)
-gthread-build.tmp :
-       bash -c "read number && echo $$[number+1]" <gthread-build.stamp >gthread-build.tmp
-       cp gthread-build.tmp gthread-build.stamp
-else
-gthread-build.tmp :
-       echo 0 >gthread-build.tmp
-endif
-
-gthread-win32res.o : gthread/gthread.rc gthread-build.tmp
-       m4 -DBUILDNUMBER=`cat gthread-build.tmp` <gthread/gthread.rc >gthread-win32res.rc
-       windres --include-dir $(WIN32APIHEADERS) gthread-win32res.rc gthread-win32res.o
-       rm gthread-build.tmp gthread-win32res.rc
-
-
-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)
-
-gthread-impl.o : gthread/gthread-impl.c gthread/gthread-posix.c
-       $(CC) $(CFLAGS) $(PTHREAD_INC) -DG_LOG_DOMAIN=\"GThread\" -c gthread/gthread-impl.c
-
-################ test progs
-
-testglib.exe : glib-$(GLIB_VER).dll testglib.o
-       $(CC) $(CFLAGS) -o testglib testglib.o -L. -lglib-$(GLIB_VER) $(LDFLAGS)
-
-testgdate.exe : glib-$(GLIB_VER).dll testgdate.o
-       $(CC) $(CFLAGS) -o testgdate.exe testgdate.o -L. -lglib-$(GLIB_VER) $(LDFLAGS)
-
-testgdate.o : testgdate.c
-       $(CC) -c $(CFLAGS) testgdate.c
-
-testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.o
-       $(CC) $(CFLAGS) -o testgdateparser.exe testgdateparser.o -L. -lglib-$(GLIB_VER) $(LDFLAGS)
-
-testgdateparser.o : testgdateparser.c
-       $(CC) -c $(CFLAGS) testgdateparser.c
-
-testgmodule.exe : glib-$(GLIB_VER).dll gmodule-$(GLIB_VER).dll testgmodule.o libgplugin_a.dll libgplugin_b.dll
-# Wow, do we really have to do it like this to get some symbols
-# exported from a .exe? Apparently yes. Does the __declspec(dllexport) 
-# actually do anything in egcs-1.1.2?
-       $(CC) $(CFLAGS) -Wl,--base-file,testgmodule.base -o testgmodule.exe testgmodule.o -L. -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) $(LDFLAGS)
-       $(DLLTOOL) --base-file testgmodule.base --output-exp testgmodule.exp testgmodule.o
-       $(CC) $(CFLAGS) -Wl,--base-file,testgmodule.base,testgmodule.exp -o testgmodule.exe testgmodule.o -L. -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) $(LDFLAGS)
-       $(DLLTOOL) --base-file testgmodule.base --output-exp testgmodule.exp testgmodule.o
-       $(CC) $(CFLAGS) -Wl,testgmodule.exp -o testgmodule.exe testgmodule.o -L. -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER) $(LDFLAGS)
-
-testgmodule.o : gmodule/testgmodule.c
-       $(CC) $(CFLAGS) -Igmodule -c gmodule/testgmodule.c
-
-libgplugin_a.dll : libgplugin_a.o
-       ./build-dll libgplugin_a - - libgplugin_a.o -L. -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER)
-
-libgplugin_a.o : gmodule/libgplugin_a.c
-       $(CC) $(CFLAGS) -Igmodule -c gmodule/libgplugin_a.c
-
-libgplugin_b.dll : libgplugin_b.o
-       ./build-dll libgplugin_b - - libgplugin_b.o -L. -lglib-$(GLIB_VER) -lgmodule-$(GLIB_VER)
-
-libgplugin_b.o : gmodule/libgplugin_b.c
-       $(CC) $(CFLAGS) -Igmodule -c gmodule/libgplugin_b.c
-
-################ other stuff
-
-clean::
-       -rm config.h glibconfig.h gmodule/gmoduleconf.h
diff --git a/makefile.mingw.in b/makefile.mingw.in
new file mode 100644 (file)
index 0000000..7174781
--- /dev/null
@@ -0,0 +1,120 @@
+## Makefile for building the GLib DLL with gcc for mingw. The build
+## uses tools running on cygwin, however.
+
+## Use: make -f makefile.mingw
+
+# Change this to wherever you want to install the DLLs. This directory
+# should be in your PATH.
+BIN = /bin
+
+GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
+
+TOP = ..
+
+include $(TOP)/build/win32/make.mingw
+
+################################################################
+
+# Nothing much configurable below
+
+INCLUDES = -I .
+DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib
+
+DLLS_TO_BUILD = \
+       glib-$(GLIB_VER).dll \
+       gmodule/gmodule-$(GLIB_VER).dll \
+       gthread/gthread-$(GLIB_VER).dll \
+       gobject/gobject-$(GLIB_VER).dll \
+
+
+all : \
+       config.h \
+       glibconfig.h \
+       $(DLLS_TO_BUILD) \
+       testglib.exe \
+       testgdate.exe \
+       testgdateparser.exe
+
+install : all
+       $(INSTALL) $(DLLS_TO_BUILD) $(BIN)
+
+glib_OBJECTS = \
+       garray.o \
+       gasyncqueue.o \
+       gcache.o \
+       gcompletion.o \
+       gdataset.o \
+       gdate.o \
+       gerror.o \
+       ghook.o \
+       ghash.o \
+       giochannel.o \
+       giowin32.o \
+       glist.o \
+       gmain.o \
+       gmem.o \
+       gmessages.o \
+       gnode.o \
+       gprimes.o \
+       gqueue.o \
+       grand.o \
+       gslist.o \
+       gthread.o \
+       gthreadpool.o \
+       gtimer.o \
+       gtree.o \
+       grel.o \
+       gstring.o \
+       gstrfuncs.o \
+       gscanner.o \
+       gutils.o \
+       gwin32.o
+
+glibconfig.h: glibconfig.h.win32
+       cp $< $@
+
+config.h: config.h.win32
+       cp $< $@
+
+makefile.mingw: makefile.mingw.in
+       sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
+           -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
+
+################ glib
+
+glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
+       ./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) -luser32 -lwsock32
+
+################ subdirectories
+
+gmodule/gmodule-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+       cd gmodule && $(MAKE) -f makefile.mingw all
+
+gthread/gthread-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+       cd gthread && $(MAKE) -f makefile.mingw all
+
+gobject/gobject-$(GLIB_VER).dll : glib-$(GLIB_VER).dll
+       cd gobject && $(MAKE) -f makefile.mingw all
+
+################ test progs
+
+testglib.exe : glib-$(GLIB_VER).dll testglib.o
+       $(CC) $(CFLAGS) -o testglib testglib.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testgdate.exe : glib-$(GLIB_VER).dll testgdate.o
+       $(CC) $(CFLAGS) -o testgdate.exe testgdate.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testgdate.o : testgdate.c
+       $(CC) -c $(CFLAGS) testgdate.c
+
+testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.o
+       $(CC) $(CFLAGS) -o testgdateparser.exe testgdateparser.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
+
+testgdateparser.o : testgdateparser.c
+       $(CC) -c $(CFLAGS) testgdateparser.c
+
+
+################ other stuff
+
+clean::
+       -rm config.h glibconfig.h gmodule/gmoduleconf.h
similarity index 64%
rename from tests/makefile.cygwin.in
rename to tests/makefile.mingw.in
index bfae543..6763811 100644 (file)
@@ -1,7 +1,5 @@
-## Makefile for building the GLib test programs with gcc on mingw or cygwin.
-## Use: make -f makefile.cygwin check
-
-OPTIMIZE = -g -O
+## Makefile for building the GLib test programs with gcc for mingw.
+## Use: make -f makefile.mingw check
 
 GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
 
@@ -36,14 +34,19 @@ TESTS = \
 
 all:   $(TESTS)
 
+makefile.mingw: makefile.mingw.in
+       sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
+           -e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
+
 .SUFFIXES: .c .exe
 
 .c.exe:
        $(CC) $(CFLAGS) -c $<
-       $(CC) $(CFLAGS) -o $@ $< -L.. -lglib-$(GLIB_VER) -lgthread-$(GLIB_VER)
+       $(CC) $(CFLAGS) -o $@ $< -L .. -lglib-$(GLIB_VER) -L ../gthread -lgthread-$(GLIB_VER)
 
 check: all
        @for P in $(TESTS) ; do echo $$P; ./$$P; done
+       @echo All tests successful.
 
 clean::
        -rm *.exe *.o