From: Tor Lillqvist Date: Thu, 6 May 1999 17:33:15 +0000 (+0000) Subject: New files, used to generate corresponding non-.in files when making a X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=2b688f549c8a2719544b33859cdc5ef99355cf37;p=dana%2Fcg-glib.git New files, used to generate corresponding non-.in files when making a * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in config.h.win32.in tests/makefile.msc.in tests/makefile.cygwin.in: New files, used to generate corresponding non-.in files when making a dist. This is just so the version numbers will be kept in synch automatically. * configure.in: Also substitute @GLIB_MAJOR_VERSION@, @GLIB_MINOR_VERSION@, and @GLIB_INTERFACE_AGE@. * Makefile.am tests/Makefile.am: Also distribute makefile.cygwin. * gerror.c (g_on_error_query): On Win32, put up a MessageBox and then exit. * glib.def: Add a couple of functions. --- diff --git a/ChangeLog b/ChangeLog index ab73b88a..46e13e16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +1999-05-06 Tor Lillqvist + + * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in + config.h.win32.in tests/makefile.msc.in tests/makefile.cygwin.in: + New files, used to generate corresponding non-.in files when + making a dist. This is just so the version numbers will be kept in + synch automatically. + + * configure.in: Also substitute @GLIB_MAJOR_VERSION@, + @GLIB_MINOR_VERSION@, and @GLIB_INTERFACE_AGE@. + + * Makefile.am tests/Makefile.am: Also distribute makefile.cygwin. + + * gerror.c (g_on_error_query): On Win32, put up a MessageBox and + then exit. + + * glib.def: Add a couple of functions. + Sat May 1 10:26:20 PDT 1999 Manish Singh * acinclude.m4 diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index ab73b88a..46e13e16 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,21 @@ +1999-05-06 Tor Lillqvist + + * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in + config.h.win32.in tests/makefile.msc.in tests/makefile.cygwin.in: + New files, used to generate corresponding non-.in files when + making a dist. This is just so the version numbers will be kept in + synch automatically. + + * configure.in: Also substitute @GLIB_MAJOR_VERSION@, + @GLIB_MINOR_VERSION@, and @GLIB_INTERFACE_AGE@. + + * Makefile.am tests/Makefile.am: Also distribute makefile.cygwin. + + * gerror.c (g_on_error_query): On Win32, put up a MessageBox and + then exit. + + * glib.def: Add a couple of functions. + Sat May 1 10:26:20 PDT 1999 Manish Singh * acinclude.m4 diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index ab73b88a..46e13e16 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,21 @@ +1999-05-06 Tor Lillqvist + + * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in + config.h.win32.in tests/makefile.msc.in tests/makefile.cygwin.in: + New files, used to generate corresponding non-.in files when + making a dist. This is just so the version numbers will be kept in + synch automatically. + + * configure.in: Also substitute @GLIB_MAJOR_VERSION@, + @GLIB_MINOR_VERSION@, and @GLIB_INTERFACE_AGE@. + + * Makefile.am tests/Makefile.am: Also distribute makefile.cygwin. + + * gerror.c (g_on_error_query): On Win32, put up a MessageBox and + then exit. + + * glib.def: Add a couple of functions. + Sat May 1 10:26:20 PDT 1999 Manish Singh * acinclude.m4 diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index ab73b88a..46e13e16 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,21 @@ +1999-05-06 Tor Lillqvist + + * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in + config.h.win32.in tests/makefile.msc.in tests/makefile.cygwin.in: + New files, used to generate corresponding non-.in files when + making a dist. This is just so the version numbers will be kept in + synch automatically. + + * configure.in: Also substitute @GLIB_MAJOR_VERSION@, + @GLIB_MINOR_VERSION@, and @GLIB_INTERFACE_AGE@. + + * Makefile.am tests/Makefile.am: Also distribute makefile.cygwin. + + * gerror.c (g_on_error_query): On Win32, put up a MessageBox and + then exit. + + * glib.def: Add a couple of functions. + Sat May 1 10:26:20 PDT 1999 Manish Singh * acinclude.m4 diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index ab73b88a..46e13e16 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,21 @@ +1999-05-06 Tor Lillqvist + + * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in + config.h.win32.in tests/makefile.msc.in tests/makefile.cygwin.in: + New files, used to generate corresponding non-.in files when + making a dist. This is just so the version numbers will be kept in + synch automatically. + + * configure.in: Also substitute @GLIB_MAJOR_VERSION@, + @GLIB_MINOR_VERSION@, and @GLIB_INTERFACE_AGE@. + + * Makefile.am tests/Makefile.am: Also distribute makefile.cygwin. + + * gerror.c (g_on_error_query): On Win32, put up a MessageBox and + then exit. + + * glib.def: Add a couple of functions. + Sat May 1 10:26:20 PDT 1999 Manish Singh * acinclude.m4 diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index ab73b88a..46e13e16 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,21 @@ +1999-05-06 Tor Lillqvist + + * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in + config.h.win32.in tests/makefile.msc.in tests/makefile.cygwin.in: + New files, used to generate corresponding non-.in files when + making a dist. This is just so the version numbers will be kept in + synch automatically. + + * configure.in: Also substitute @GLIB_MAJOR_VERSION@, + @GLIB_MINOR_VERSION@, and @GLIB_INTERFACE_AGE@. + + * Makefile.am tests/Makefile.am: Also distribute makefile.cygwin. + + * gerror.c (g_on_error_query): On Win32, put up a MessageBox and + then exit. + + * glib.def: Add a couple of functions. + Sat May 1 10:26:20 PDT 1999 Manish Singh * acinclude.m4 diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index ab73b88a..46e13e16 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,21 @@ +1999-05-06 Tor Lillqvist + + * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in + config.h.win32.in tests/makefile.msc.in tests/makefile.cygwin.in: + New files, used to generate corresponding non-.in files when + making a dist. This is just so the version numbers will be kept in + synch automatically. + + * configure.in: Also substitute @GLIB_MAJOR_VERSION@, + @GLIB_MINOR_VERSION@, and @GLIB_INTERFACE_AGE@. + + * Makefile.am tests/Makefile.am: Also distribute makefile.cygwin. + + * gerror.c (g_on_error_query): On Win32, put up a MessageBox and + then exit. + + * glib.def: Add a couple of functions. + Sat May 1 10:26:20 PDT 1999 Manish Singh * acinclude.m4 diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index ab73b88a..46e13e16 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,21 @@ +1999-05-06 Tor Lillqvist + + * makefile.msc.in makefile.cygwin.in glibconfig.h.win32.in + config.h.win32.in tests/makefile.msc.in tests/makefile.cygwin.in: + New files, used to generate corresponding non-.in files when + making a dist. This is just so the version numbers will be kept in + synch automatically. + + * configure.in: Also substitute @GLIB_MAJOR_VERSION@, + @GLIB_MINOR_VERSION@, and @GLIB_INTERFACE_AGE@. + + * Makefile.am tests/Makefile.am: Also distribute makefile.cygwin. + + * gerror.c (g_on_error_query): On Win32, put up a MessageBox and + then exit. + + * glib.def: Add a couple of functions. + Sat May 1 10:26:20 PDT 1999 Manish Singh * acinclude.m4 diff --git a/Makefile.am b/Makefile.am index 32014e45..ddc8eeed 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,6 +18,7 @@ EXTRA_DIST = \ README.win32 \ glib.def \ makefile.msc \ + makefile.cygwin \ giowin32.c \ glibconfig.h.win32 \ config.h.win32 @@ -88,6 +89,18 @@ testgdateparser_LDADD = libglib.la m4datadir = $(datadir)/aclocal m4data_DATA = glib.m4 +glibconfig.h.win32: $(top_builddir)/config.status glibconfig.h.win32.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +config.h.win32: $(top_builddir)/config.status config.h.win32.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +makefile.msc: $(top_builddir)/config.status makefile.msc.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +makefile.cygwin: $(top_builddir)/config.status makefile.cygwin.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + .PHONY: files release sanity snapshot files: diff --git a/README.win32 b/README.win32 index d9910aaa..9bd3abeb 100644 --- a/README.win32 +++ b/README.win32 @@ -44,14 +44,15 @@ short. Otherwise stat() calls will fail. 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 -location of the pthreads library and include files in makefile.msc. +location of the pthreads library and include files in makefile.msc or +makefile.cygwin. If using the Microsoft toolchain, build with `nmake -f makefile.msc`. Install with `nmake -f makefile.msc install`. If using egcs, build using `make -f makefile.cygwin`. To test the GLib functions, go to the tests subdirectory and enter -`nmake -f makefile.msc check`. +`nmake -f makefile.msc check` or `make -f makefile.cygwin check`. If you would want to use the cygwin tools to generate executables that *do* use the cygwin runtime, the normal Unix configuration method @@ -83,7 +84,7 @@ 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. NATIVE_WIN32 should maybe be renamed to USE_MSVCRT. The pthreads for Win32 package that the thread support uses isn't quite ready yet, and thus threads really should not be relied upon. diff --git a/config.h.win32 b/config.h.win32.in similarity index 93% rename from config.h.win32 rename to config.h.win32.in index e27082f9..8dc0ff48 100644 --- a/config.h.win32 +++ b/config.h.win32.in @@ -54,11 +54,11 @@ /* #undef G_VA_COPY_AS_ARRAY */ #define G_HAVE___INLINE 1 -#define GLIB_MAJOR_VERSION 1 -#define GLIB_MINOR_VERSION 3 -#define GLIB_MICRO_VERSION 0 -#define GLIB_INTERFACE_AGE 0 -#define GLIB_BINARY_AGE 0 +#define GLIB_MAJOR_VERSION @GLIB_MAJOR_VERSION@ +#define GLIB_MINOR_VERSION @GLIB_MINOR_VERSION@ +#define GLIB_MICRO_VERSION @GLIB_MICRO_VERSION@ +#define GLIB_INTERFACE_AGE @GLIB_INTERFACE_AGE@ +#define GLIB_BINARY_AGE @GLIB_BINARY_AGE@ #define G_THREAD_SOURCE "gthread-posix.c" diff --git a/configure.in b/configure.in index 52427014..ea969fd8 100644 --- a/configure.in +++ b/configure.in @@ -40,7 +40,11 @@ GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION dnl AC_DIVERT_POP()dnl +AC_SUBST(GLIB_MAJOR_VERSION) +AC_SUBST(GLIB_MINOR_VERSION) AC_SUBST(GLIB_VERSION) +AC_SUBST(GLIB_INTERFACE_AGE) +AC_SUBST(GLIB_BINARY_AGE) # libtool versioning LT_RELEASE=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION diff --git a/gbacktrace.c b/gbacktrace.c index cd9350d8..c1b5979e 100644 --- a/gbacktrace.c +++ b/gbacktrace.c @@ -59,8 +59,10 @@ #include /* for bzero on BSD systems */ #endif -#ifdef _MSC_VER -#include /* For _getpid() */ +#ifdef NATIVE_WIN32 +# define STRICT /* Strict typing, please */ +# include +# include /* For _getpid() */ #endif #ifndef NO_FD_SET @@ -82,6 +84,7 @@ volatile gboolean glib_on_error_halt = TRUE; void g_on_error_query (const gchar *prg_name) { +#ifndef NATIVE_WIN32 static const gchar *query1 = "[E]xit, [H]alt"; static const gchar *query2 = ", show [S]tack trace"; static const gchar *query3 = " or [P]roceed"; @@ -133,6 +136,15 @@ g_on_error_query (const gchar *prg_name) } else goto retry; +#else + if (!prg_name) + prg_name = g_get_prgname (); + + MessageBox (NULL, "Terminating", + (prg_name && *prg_name) ? prg_name : NULL, + MB_OK|MB_ICONERROR); + _exit(0); +#endif } void diff --git a/gerror.c b/gerror.c index cd9350d8..c1b5979e 100644 --- a/gerror.c +++ b/gerror.c @@ -59,8 +59,10 @@ #include /* for bzero on BSD systems */ #endif -#ifdef _MSC_VER -#include /* For _getpid() */ +#ifdef NATIVE_WIN32 +# define STRICT /* Strict typing, please */ +# include +# include /* For _getpid() */ #endif #ifndef NO_FD_SET @@ -82,6 +84,7 @@ volatile gboolean glib_on_error_halt = TRUE; void g_on_error_query (const gchar *prg_name) { +#ifndef NATIVE_WIN32 static const gchar *query1 = "[E]xit, [H]alt"; static const gchar *query2 = ", show [S]tack trace"; static const gchar *query3 = " or [P]roceed"; @@ -133,6 +136,15 @@ g_on_error_query (const gchar *prg_name) } else goto retry; +#else + if (!prg_name) + prg_name = g_get_prgname (); + + MessageBox (NULL, "Terminating", + (prg_name && *prg_name) ? prg_name : NULL, + MB_OK|MB_ICONERROR); + _exit(0); +#endif } void diff --git a/glib.def b/glib.def index 03d19620..d6220cba 100644 --- a/glib.def +++ b/glib.def @@ -353,6 +353,8 @@ EXPORTS g_str_equal g_str_hash g_strcasecmp + g_strchomp + g_strchug g_strconcat g_strdelimit g_strdown diff --git a/glib/Makefile.am b/glib/Makefile.am index 32014e45..ddc8eeed 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -18,6 +18,7 @@ EXTRA_DIST = \ README.win32 \ glib.def \ makefile.msc \ + makefile.cygwin \ giowin32.c \ glibconfig.h.win32 \ config.h.win32 @@ -88,6 +89,18 @@ testgdateparser_LDADD = libglib.la m4datadir = $(datadir)/aclocal m4data_DATA = glib.m4 +glibconfig.h.win32: $(top_builddir)/config.status glibconfig.h.win32.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +config.h.win32: $(top_builddir)/config.status config.h.win32.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +makefile.msc: $(top_builddir)/config.status makefile.msc.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +makefile.cygwin: $(top_builddir)/config.status makefile.cygwin.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + .PHONY: files release sanity snapshot files: diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c index cd9350d8..c1b5979e 100644 --- a/glib/gbacktrace.c +++ b/glib/gbacktrace.c @@ -59,8 +59,10 @@ #include /* for bzero on BSD systems */ #endif -#ifdef _MSC_VER -#include /* For _getpid() */ +#ifdef NATIVE_WIN32 +# define STRICT /* Strict typing, please */ +# include +# include /* For _getpid() */ #endif #ifndef NO_FD_SET @@ -82,6 +84,7 @@ volatile gboolean glib_on_error_halt = TRUE; void g_on_error_query (const gchar *prg_name) { +#ifndef NATIVE_WIN32 static const gchar *query1 = "[E]xit, [H]alt"; static const gchar *query2 = ", show [S]tack trace"; static const gchar *query3 = " or [P]roceed"; @@ -133,6 +136,15 @@ g_on_error_query (const gchar *prg_name) } else goto retry; +#else + if (!prg_name) + prg_name = g_get_prgname (); + + MessageBox (NULL, "Terminating", + (prg_name && *prg_name) ? prg_name : NULL, + MB_OK|MB_ICONERROR); + _exit(0); +#endif } void diff --git a/glib/gerror.c b/glib/gerror.c index cd9350d8..c1b5979e 100644 --- a/glib/gerror.c +++ b/glib/gerror.c @@ -59,8 +59,10 @@ #include /* for bzero on BSD systems */ #endif -#ifdef _MSC_VER -#include /* For _getpid() */ +#ifdef NATIVE_WIN32 +# define STRICT /* Strict typing, please */ +# include +# include /* For _getpid() */ #endif #ifndef NO_FD_SET @@ -82,6 +84,7 @@ volatile gboolean glib_on_error_halt = TRUE; void g_on_error_query (const gchar *prg_name) { +#ifndef NATIVE_WIN32 static const gchar *query1 = "[E]xit, [H]alt"; static const gchar *query2 = ", show [S]tack trace"; static const gchar *query3 = " or [P]roceed"; @@ -133,6 +136,15 @@ g_on_error_query (const gchar *prg_name) } else goto retry; +#else + if (!prg_name) + prg_name = g_get_prgname (); + + MessageBox (NULL, "Terminating", + (prg_name && *prg_name) ? prg_name : NULL, + MB_OK|MB_ICONERROR); + _exit(0); +#endif } void diff --git a/glib/glib.def b/glib/glib.def index 03d19620..d6220cba 100644 --- a/glib/glib.def +++ b/glib/glib.def @@ -353,6 +353,8 @@ EXPORTS g_str_equal g_str_hash g_strcasecmp + g_strchomp + g_strchug g_strconcat g_strdelimit g_strdown diff --git a/makefile.msc b/glib/makefile.msc.in similarity index 94% rename from makefile.msc rename to glib/makefile.msc.in index 885bd80c..6c8febbf 100644 --- a/makefile.msc +++ b/glib/makefile.msc.in @@ -7,22 +7,28 @@ BIN = C:\bin # 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 = $(PTHREADS)\pthread.lib PTHREAD_INC = -I $(PTHREADS) +# Full optimization: +OPTIMIZE = -Ox +# Debugging: +#OPTIMIZE = -Zi + ################################################################ # Nothing much configurable below -# cl -? described the options -CC = cl -G5 -GF -Ox -W3 -MD -nologo +# cl -? describes the options +CC = cl -G5 -GF $(OPTIMIZE) -W3 -MD -nologo -# No general LDFLAGS needes -LDFLAGS = /link +# No general LDFLAGS needed +LDFLAGS = /link # /debug INSTALL = copy -GLIB_VER = 1.3 +GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ CFLAGS = -I. -DHAVE_CONFIG_H diff --git a/glibconfig.h.win32 b/glibconfig.h.win32.in similarity index 96% rename from glibconfig.h.win32 rename to glibconfig.h.win32.in index 97f3ff9d..a4aa9c1b 100644 --- a/glibconfig.h.win32 +++ b/glibconfig.h.win32.in @@ -97,9 +97,9 @@ typedef unsigned long long guint64; #define alloca _alloca #endif -#define GLIB_MAJOR_VERSION 1 -#define GLIB_MINOR_VERSION 3 -#define GLIB_MICRO_VERSION 0 +#define GLIB_MAJOR_VERSION @GLIB_MAJOR_VERSION@ +#define GLIB_MINOR_VERSION @GLIB_MINOR_VERSION@ +#define GLIB_MICRO_VERSION @GLIB_MICRO_VERSION@ #ifdef __cplusplus #define G_HAVE_INLINE 1 @@ -119,7 +119,7 @@ typedef unsigned long long guint64; * printf ("sizeof (pthread_mutex_t) = %d\n", sizeof (pthread_mutex_t)); * printf ("PTHREAD_MUTEX_INITIALIZER = "); * for (i = 0; i < sizeof (pthread_mutex_t); i++) - * printf ("%u, ", (unsigned) ((unsigned char *) &m)[i]); + * printf ("%u, ", ((unsigned char *) &m)[i]); * printf ("\n"); * exit(0); * } diff --git a/gmodule/ChangeLog b/gmodule/ChangeLog index ed7c5914..94b1fe9c 100644 --- a/gmodule/ChangeLog +++ b/gmodule/ChangeLog @@ -1,3 +1,7 @@ +1999-05-06 Tor Lillqvist + + * gmodule.c: Remove LibMain. + Sat May 1 10:58:57 PDT 1999 Manish Singh * Makefile.am: use -avoid-version and -module for test plugins diff --git a/gmodule/gmodule.c b/gmodule/gmodule.c index b176a16e..3ae1ed0f 100644 --- a/gmodule/gmodule.c +++ b/gmodule/gmodule.c @@ -170,17 +170,6 @@ _g_module_build_path (const gchar *directory, } #endif /* no implementation */ -#if defined (NATIVE_WIN32) && defined (__LCC__) -int __stdcall -LibMain (void *hinstDll, - unsigned long dwReason, - void *reserved) -{ - return 1; -} -#endif /* NATIVE_WIN32 && __LCC__ */ - - /* --- functions --- */ gboolean g_module_supported (void) diff --git a/makefile.cygwin b/makefile.cygwin.in similarity index 98% rename from makefile.cygwin rename to makefile.cygwin.in index 4820eaaf..2a8761af 100644 --- a/makefile.cygwin +++ b/makefile.cygwin.in @@ -8,6 +8,7 @@ BIN = /bin # 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 PTHREAD_INC = -I $(PTHREADS) @@ -25,7 +26,7 @@ LD = ld DLLTOOL = dlltool INSTALL = install -GLIB_VER = 1.3 +GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ CFLAGS = $(OPTIMIZE) -I. -DHAVE_CONFIG_H diff --git a/makefile.msc.in b/makefile.msc.in new file mode 100644 index 00000000..6c8febbf --- /dev/null +++ b/makefile.msc.in @@ -0,0 +1,173 @@ +## Makefile for building the GLib, gmodule and gthread dlls with Microsoft C +## Use: nmake -f makefile.msc install + +# Change this to wherever you want to install the DLLs. This directory +# should be in your PATH. +BIN = C:\bin + +# 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 = $(PTHREADS)\pthread.lib +PTHREAD_INC = -I $(PTHREADS) + +# Full optimization: +OPTIMIZE = -Ox +# Debugging: +#OPTIMIZE = -Zi + +################################################################ + +# Nothing much configurable below + +# cl -? describes the options +CC = cl -G5 -GF $(OPTIMIZE) -W3 -MD -nologo + +# No general LDFLAGS needed +LDFLAGS = /link # /debug +INSTALL = copy + +GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ + +CFLAGS = -I. -DHAVE_CONFIG_H + +all : \ + glibconfig.h \ + config.h \ + glib-$(GLIB_VER).dll \ + gmodule\gmoduleconf.h \ + gmodule-$(GLIB_VER).dll \ + gthread-$(GLIB_VER).dll \ + testglib.exe \ + testgmodule.exe \ + testgdate.exe \ + testgdateparser.exe \ + testgthread.exe + +install : all + $(INSTALL) glib-$(GLIB_VER).dll $(BIN) + $(INSTALL) gmodule-$(GLIB_VER).dll $(BIN) + $(INSTALL) gthread-$(GLIB_VER).dll $(BIN) + +glib_OBJECTS = \ + garray.obj \ + gcache.obj \ + gcompletion.obj \ + gdataset.obj \ + gdate.obj \ + gerror.obj \ + ghook.obj \ + ghash.obj \ + giochannel.obj \ + giowin32.obj \ + glist.obj \ + gmain.obj \ + gmem.obj \ + gmessages.obj \ + gmutex.obj \ + gnode.obj \ + gprimes.obj \ + gqueue.obj \ + grand.obj \ + gslist.obj \ + gstack.obj \ + gtimer.obj \ + gtree.obj \ + grel.obj \ + gstring.obj \ + gstrfuncs.obj \ + gscanner.obj \ + gutils.obj + +glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def + $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def + +glibconfig.h: glibconfig.h.win32 + copy glibconfig.h.win32 glibconfig.h + +config.h: config.h.win32 + copy config.h.win32 config.h + +.c.obj : + $(CC) $(CFLAGS) -GD -c -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $< + +gmodule_OBJECTS = \ + gmodule.obj + +gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule\gmodule.def + $(CC) $(CFLAGS) -LD -Fegmodule-$(GLIB_VER).dll $(gmodule_OBJECTS) glib-$(GLIB_VER).lib $(LDFLAGS) /def:gmodule\gmodule.def + +gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c + $(CC) $(CFLAGS) -GD -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c + +gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32 + copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h + +gthread_OBJECTS = \ + gthread.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 + +testglib.exe : glib-$(GLIB_VER).dll testglib.obj + $(CC) $(CFLAGS) -Fetestglib.exe testglib.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console + +testglib.obj : testglib.c + $(CC) -c $(CFLAGS) testglib.c + +testgdate.exe : glib-$(GLIB_VER).dll testgdate.obj + $(CC) $(CFLAGS) -Fetestgdate.exe testgdate.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console + +testgdate.obj : testgdate.c + $(CC) -c $(CFLAGS) testgdate.c + +testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.obj + $(CC) $(CFLAGS) -Fetestgdateparser.exe testgdateparser.obj glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console + +testgdateparser.obj : testgdateparser.c + $(CC) -c $(CFLAGS) testgdateparser.c + +testgmodule.exe : glib-$(GLIB_VER).dll gmodule-$(GLIB_VER).dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll + $(CC) $(CFLAGS) testgmodule.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console + +testgmodule.obj : gmodule\testgmodule.c + $(CC) $(CFLAGS) -Igmodule -c gmodule\testgmodule.c + +libgplugin_a.dll : libgplugin_a.obj + $(CC) $(CFLAGS) -LD libgplugin_a.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS) + +libgplugin_a.obj : gmodule\libgplugin_a.c + $(CC) $(CFLAGS) -Igmodule -c gmodule\libgplugin_a.c + +libgplugin_b.dll : libgplugin_b.obj + $(CC) $(CFLAGS) -LD libgplugin_b.obj glib-$(GLIB_VER).lib gmodule-$(GLIB_VER).lib $(LDFLAGS) + +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 + del gmodule\gmoduleconf.h + del *.exe + del *.obj + del *.dll + del *.lib + del *.err + del *.map + del *.sym + del *.exp + del *.lk1 + del *.mk1 + del *.pdb + del *.ilk diff --git a/tests/Makefile.am b/tests/Makefile.am index 539d2d1e..c96d51f1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,10 @@ INCLUDES = -I$(top_srcdir) @GLIB_DEBUG_FLAGS@ +EXTRA_DIST = \ + makefile.msc \ + makefile.cygwin + TESTS = \ array-test \ date-test \ @@ -36,3 +40,8 @@ strfunc_test_LDADD = $(top_builddir)/libglib.la tree_test_LDADD = $(top_builddir)/libglib.la type_test_LDADD = $(top_builddir)/libglib.la +makefile.msc: $(top_builddir)/config.status makefile.msc.in + cd $(top_builddir) && CONFIG_FILES=tests/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +makefile.cygwin: $(top_builddir)/config.status makefile.cygwin.in + cd $(top_builddir) && CONFIG_FILES=tests/$@ CONFIG_HEADERS= $(SHELL) ./config.status diff --git a/tests/makefile.cygwin b/tests/makefile.cygwin.in similarity index 86% rename from tests/makefile.cygwin rename to tests/makefile.cygwin.in index 84cd3c71..6db6bc96 100644 --- a/tests/makefile.cygwin +++ b/tests/makefile.cygwin.in @@ -1,16 +1,17 @@ ## Makefile for building the GLib test programs with egcs on cygwin. ## Use: make -f makefile.cygwin check +OPTIMIZE = -g -O + ################################################################ # Nothing much configurable below -# cl -? described the options CC = gcc -mno-cygwin -mpentium -GLIB_VER = 1.3 +GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ -CFLAGS = -I.. -DHAVE_CONFIG_H +CFLAGS = $(OPTIMIZE) -I.. -DHAVE_CONFIG_H TESTS = \ array-test.exe \ diff --git a/tests/makefile.msc b/tests/makefile.msc.in similarity index 88% rename from tests/makefile.msc rename to tests/makefile.msc.in index ff484e10..8cbf3e37 100644 --- a/tests/makefile.msc +++ b/tests/makefile.msc.in @@ -5,13 +5,13 @@ # Nothing much configurable below -# cl -? described the options +# cl -? describes the options CC = cl -G5 -GF -Ox -W3 -MD -nologo -# No general LDFLAGS needes +# No general LDFLAGS needed LDFLAGS = /link -GLIB_VER = 1.3 +GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@ CFLAGS = -I.. -DHAVE_CONFIG_H