Revamp to be like makefile.mingw.in, make the MSVC build actually work

2000-10-06  Tor Lillqvist  <tml@iki.fi>

	* makefile.msc.in: Revamp to be like makefile.mingw.in, make
	the MSVC build actually work again.

	* gmodule/makefile.msc.in
	* gobject/makefile.msc.in
	* gthread/makefile.msc.in: New files, like their mingw counterparts.

	* gmodule/Makefile.am
	* gobject/Makefile.am
	* gthread/Makefile.am: Make and distribute them.

	* */makefile.mingw.in: Allow override of GLib version number from
	the build/win32/module.defs file.

	* glib.def: Add new entry point.

	Fixes from Hans Breuer:

	* glib.h (struct DIR): Keep the last readdir result cached inside
	the DIR struct, to enable several DIRs being open simultaneously.

	* gwin32.c (g_win32_readdir): Use the above instead of static.

	* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
	MSVC happy.
This commit is contained in:
Tor Lillqvist 2000-10-06 21:32:59 +00:00 committed by Tor Lillqvist
parent 0c6a1ee531
commit 8e847255e8
30 changed files with 527 additions and 243 deletions

View File

@ -1,3 +1,31 @@
2000-10-06 Tor Lillqvist <tml@iki.fi>
* makefile.msc.in: Revamp to be like makefile.mingw.in, make
the MSVC build actually work again.
* gmodule/makefile.msc.in
* gobject/makefile.msc.in
* gthread/makefile.msc.in: New files, like their mingw counterparts.
* gmodule/Makefile.am
* gobject/Makefile.am
* gthread/Makefile.am: Make and distribute them.
* */makefile.mingw.in: Allow override of GLib version number from
the build/win32/module.defs file.
* glib.def: Add new entry point.
Fixes from Hans Breuer:
* glib.h (struct DIR): Keep the last readdir result cached inside
the DIR struct, to enable several DIRs being open simultaneously.
* gwin32.c (g_win32_readdir): Use the above instead of static.
* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
MSVC happy.
2000-10-05 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h: Changed alloca stuff a bit: when we have a working

View File

@ -1,3 +1,31 @@
2000-10-06 Tor Lillqvist <tml@iki.fi>
* makefile.msc.in: Revamp to be like makefile.mingw.in, make
the MSVC build actually work again.
* gmodule/makefile.msc.in
* gobject/makefile.msc.in
* gthread/makefile.msc.in: New files, like their mingw counterparts.
* gmodule/Makefile.am
* gobject/Makefile.am
* gthread/Makefile.am: Make and distribute them.
* */makefile.mingw.in: Allow override of GLib version number from
the build/win32/module.defs file.
* glib.def: Add new entry point.
Fixes from Hans Breuer:
* glib.h (struct DIR): Keep the last readdir result cached inside
the DIR struct, to enable several DIRs being open simultaneously.
* gwin32.c (g_win32_readdir): Use the above instead of static.
* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
MSVC happy.
2000-10-05 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h: Changed alloca stuff a bit: when we have a working

View File

@ -1,3 +1,31 @@
2000-10-06 Tor Lillqvist <tml@iki.fi>
* makefile.msc.in: Revamp to be like makefile.mingw.in, make
the MSVC build actually work again.
* gmodule/makefile.msc.in
* gobject/makefile.msc.in
* gthread/makefile.msc.in: New files, like their mingw counterparts.
* gmodule/Makefile.am
* gobject/Makefile.am
* gthread/Makefile.am: Make and distribute them.
* */makefile.mingw.in: Allow override of GLib version number from
the build/win32/module.defs file.
* glib.def: Add new entry point.
Fixes from Hans Breuer:
* glib.h (struct DIR): Keep the last readdir result cached inside
the DIR struct, to enable several DIRs being open simultaneously.
* gwin32.c (g_win32_readdir): Use the above instead of static.
* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
MSVC happy.
2000-10-05 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h: Changed alloca stuff a bit: when we have a working

View File

@ -1,3 +1,31 @@
2000-10-06 Tor Lillqvist <tml@iki.fi>
* makefile.msc.in: Revamp to be like makefile.mingw.in, make
the MSVC build actually work again.
* gmodule/makefile.msc.in
* gobject/makefile.msc.in
* gthread/makefile.msc.in: New files, like their mingw counterparts.
* gmodule/Makefile.am
* gobject/Makefile.am
* gthread/Makefile.am: Make and distribute them.
* */makefile.mingw.in: Allow override of GLib version number from
the build/win32/module.defs file.
* glib.def: Add new entry point.
Fixes from Hans Breuer:
* glib.h (struct DIR): Keep the last readdir result cached inside
the DIR struct, to enable several DIRs being open simultaneously.
* gwin32.c (g_win32_readdir): Use the above instead of static.
* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
MSVC happy.
2000-10-05 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h: Changed alloca stuff a bit: when we have a working

View File

@ -1,3 +1,31 @@
2000-10-06 Tor Lillqvist <tml@iki.fi>
* makefile.msc.in: Revamp to be like makefile.mingw.in, make
the MSVC build actually work again.
* gmodule/makefile.msc.in
* gobject/makefile.msc.in
* gthread/makefile.msc.in: New files, like their mingw counterparts.
* gmodule/Makefile.am
* gobject/Makefile.am
* gthread/Makefile.am: Make and distribute them.
* */makefile.mingw.in: Allow override of GLib version number from
the build/win32/module.defs file.
* glib.def: Add new entry point.
Fixes from Hans Breuer:
* glib.h (struct DIR): Keep the last readdir result cached inside
the DIR struct, to enable several DIRs being open simultaneously.
* gwin32.c (g_win32_readdir): Use the above instead of static.
* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
MSVC happy.
2000-10-05 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h: Changed alloca stuff a bit: when we have a working

View File

@ -1,3 +1,31 @@
2000-10-06 Tor Lillqvist <tml@iki.fi>
* makefile.msc.in: Revamp to be like makefile.mingw.in, make
the MSVC build actually work again.
* gmodule/makefile.msc.in
* gobject/makefile.msc.in
* gthread/makefile.msc.in: New files, like their mingw counterparts.
* gmodule/Makefile.am
* gobject/Makefile.am
* gthread/Makefile.am: Make and distribute them.
* */makefile.mingw.in: Allow override of GLib version number from
the build/win32/module.defs file.
* glib.def: Add new entry point.
Fixes from Hans Breuer:
* glib.h (struct DIR): Keep the last readdir result cached inside
the DIR struct, to enable several DIRs being open simultaneously.
* gwin32.c (g_win32_readdir): Use the above instead of static.
* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
MSVC happy.
2000-10-05 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h: Changed alloca stuff a bit: when we have a working

View File

@ -1,3 +1,31 @@
2000-10-06 Tor Lillqvist <tml@iki.fi>
* makefile.msc.in: Revamp to be like makefile.mingw.in, make
the MSVC build actually work again.
* gmodule/makefile.msc.in
* gobject/makefile.msc.in
* gthread/makefile.msc.in: New files, like their mingw counterparts.
* gmodule/Makefile.am
* gobject/Makefile.am
* gthread/Makefile.am: Make and distribute them.
* */makefile.mingw.in: Allow override of GLib version number from
the build/win32/module.defs file.
* glib.def: Add new entry point.
Fixes from Hans Breuer:
* glib.h (struct DIR): Keep the last readdir result cached inside
the DIR struct, to enable several DIRs being open simultaneously.
* gwin32.c (g_win32_readdir): Use the above instead of static.
* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
MSVC happy.
2000-10-05 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h: Changed alloca stuff a bit: when we have a working

View File

@ -1,3 +1,31 @@
2000-10-06 Tor Lillqvist <tml@iki.fi>
* makefile.msc.in: Revamp to be like makefile.mingw.in, make
the MSVC build actually work again.
* gmodule/makefile.msc.in
* gobject/makefile.msc.in
* gthread/makefile.msc.in: New files, like their mingw counterparts.
* gmodule/Makefile.am
* gobject/Makefile.am
* gthread/Makefile.am: Make and distribute them.
* */makefile.mingw.in: Allow override of GLib version number from
the build/win32/module.defs file.
* glib.def: Add new entry point.
Fixes from Hans Breuer:
* glib.h (struct DIR): Keep the last readdir result cached inside
the DIR struct, to enable several DIRs being open simultaneously.
* gwin32.c (g_win32_readdir): Use the above instead of static.
* giowin32.c (g_io_channel_win32_make_pollfd): Insert cast to keep
MSVC happy.
2000-10-05 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* glib.h: Changed alloca stuff a bit: when we have a working

View File

@ -897,7 +897,7 @@ g_io_channel_win32_make_pollfd (GIOChannel *channel,
if (win32_channel->data_avail_event == NULL)
create_events (win32_channel);
fd->fd = win32_channel->data_avail_event;
fd->fd = (gint) win32_channel->data_avail_event;
fd->events = condition;
if (win32_channel->thread_id == 0)

View File

@ -244,6 +244,7 @@ EXPORTS
g_node_first_sibling
g_node_get_root
g_node_insert
g_node_insert_after
g_node_insert_before
g_node_is_ancestor
g_node_last_child

19
glib.h
View File

@ -3027,18 +3027,21 @@ typedef int pid_t;
# define closedir g_win32_closedir
# define NAME_MAX 255
struct DIR
{
gchar *dir_name;
gboolean just_opened;
guint find_file_handle;
gpointer find_file_data;
};
typedef struct DIR DIR;
struct dirent
{
gchar d_name[NAME_MAX + 1];
};
struct DIR
{
gchar *dir_name;
gboolean just_opened;
guint find_file_handle;
gpointer find_file_data;
struct dirent readdir_result;
};
typedef struct DIR DIR;
/* emulation functions */
extern int g_win32_ftruncate (gint f,
guint size);

View File

@ -897,7 +897,7 @@ g_io_channel_win32_make_pollfd (GIOChannel *channel,
if (win32_channel->data_avail_event == NULL)
create_events (win32_channel);
fd->fd = win32_channel->data_avail_event;
fd->fd = (gint) win32_channel->data_avail_event;
fd->events = condition;
if (win32_channel->thread_id == 0)

View File

@ -244,6 +244,7 @@ EXPORTS
g_node_first_sibling
g_node_get_root
g_node_insert
g_node_insert_after
g_node_insert_before
g_node_is_ancestor
g_node_last_child

View File

@ -3027,18 +3027,21 @@ typedef int pid_t;
# define closedir g_win32_closedir
# define NAME_MAX 255
struct DIR
{
gchar *dir_name;
gboolean just_opened;
guint find_file_handle;
gpointer find_file_data;
};
typedef struct DIR DIR;
struct dirent
{
gchar d_name[NAME_MAX + 1];
};
struct DIR
{
gchar *dir_name;
gboolean just_opened;
guint find_file_handle;
gpointer find_file_data;
struct dirent readdir_result;
};
typedef struct DIR DIR;
/* emulation functions */
extern int g_win32_ftruncate (gint f,
guint size);

View File

@ -130,7 +130,6 @@ g_win32_opendir (const char *dirname)
struct dirent*
g_win32_readdir (DIR *dir)
{
static struct dirent result;
gchar *basename;
g_return_val_if_fail (dir != NULL, NULL);
@ -157,11 +156,11 @@ g_win32_readdir (DIR *dir)
basename = g_path_get_basename (((LPWIN32_FIND_DATA) dir->find_file_data)->cFileName);
strcpy (result.d_name, basename);
strcpy (dir->readdir_result.d_name, basename);
g_free (basename);
return &result;
return &dir->readdir_result;
}
void

View File

@ -7,12 +7,13 @@
# should be in your PATH.
BIN = /bin
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
TOP = ..
include build/win32/make.mingw
# Possibly override GLib version in build/win32/module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below

View File

@ -1,67 +1,52 @@
## Makefile for building the GLib, gmodule and gthread dlls with Microsoft C
## Makefile for building the GLib 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-05-30 snapshot.
PTHREADS = ..\pthreads-snap-1999-05-30
PTHREAD_LIB = $(PTHREADS)\pthread.lib
PTHREAD_INC = -I $(PTHREADS)
TOP = ..
!INCLUDE $(TOP)\build\win32\make.msc
# Possibly override GLib version in build\win32\module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below
!IFNDEF DEBUG
# Full optimization:
OPTIMIZE = -Ox -MD
LINKDEBUG =
!ELSE
# Debugging:
OPTIMIZE = -Zi -MDd
LINKDEBUG = /debug
!ENDIF
INCLUDES = -I .
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib
DEPCFLAGS = $(LIBICONV_CFLAGS)
# cl -? describes the options
CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo
# No general LDFLAGS needed
LDFLAGS = /link $(LINKDEBUG)
INSTALL = copy
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
CFLAGS = -I. -DHAVE_CONFIG_H
DLLS_TO_BUILD = \
glib-$(GLIB_VER).dll \
sub-gmodule \
sub-gthread \
sub-gobject
all : \
glibconfig.h \
config.h \
glib-$(GLIB_VER).dll \
gmodule\gmoduleconf.h \
gmodule-$(GLIB_VER).dll \
gthread-$(GLIB_VER).dll \
glibconfig.h \
$(DLLS_TO_BUILD) \
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)
copy glib-$(GLIB_VER).dll $(BIN)
glib_OBJECTS = \
garray.obj \
gasyncqueue.obj \
gbacktrace.obj \
gcache.obj \
gcompletion.obj \
gdataset.obj \
gdate.obj \
gerror.obj \
gconvert.obj \
ghash.obj \
ghook.obj \
giochannel.obj \
@ -89,91 +74,69 @@ glib_OBJECTS = \
gutils.obj \
gwin32.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 $<
makefile.msc: makefile.msc.in
$(SED) -e s,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@, \
-e s,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@, <makefile.msc.in >$@
.c.i :
$(CC) $(CFLAGS) -GD -E -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $< >$@
################ glib
gmodule_OBJECTS = \
gmodule.obj
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
$(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(LIBICONV_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
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
################ subdirectories
gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
$(CC) $(CFLAGS) -GD -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
sub-gmodule :
cd gmodule
-$(MAKE) -f makefile.msc all
cd ..
gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
sub-gthread :
cd gthread
-$(MAKE) -f makefile.msc all
cd ..
gthread_OBJECTS = \
gthread-impl.obj
sub-gobject :
cd gobject
-$(MAKE) -f makefile.msc all
cd ..
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
################ test progs
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.obj : testglib.c
$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" testglib.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.obj : testgdate.c
$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" testgdate.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.obj : testgdateparser.c
$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" testgdateparser.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
################ other stuff
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
clean:
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
cd gmodule
$(MAKE) -f makefile.msc clean
cd ..
cd gthread
$(MAKE) -f makefile.msc clean
cd ..
cd gobject
$(MAKE) -f makefile.msc clean
cd ..

View File

@ -6,6 +6,8 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gmodule \
EXTRA_DIST = \
makefile.mingw \
makefile.mingw.in \
makefile.msc \
makefile.msc.in \
gmoduleconf.h.in \
gmodule.def \
gmodule-dl.c \
@ -58,6 +60,9 @@ gmodule.rc: $(top_builddir)/config.status $(top_srcdir)/gmodule/gmodule.rc.in
makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gmodule/makefile.mingw.in
cd $(top_builddir) && CONFIG_FILES=gmodule/$@ CONFIG_HEADERS= $(SHELL) ./config.status
makefile.msc: $(top_builddir)/config.status $(top_srcdir)/gmodule/makefile.msc.in
cd $(top_builddir) && CONFIG_FILES=gmodule/$@ CONFIG_HEADERS= $(SHELL) ./config.status
.PHONY: files release
files:

View File

@ -3,12 +3,13 @@
## Use: make -f makefile.mingw
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
TOP = ../..
include ../build/win32/make.mingw
# Possibly override GLib version in build\win32\module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below

48
gmodule/makefile.msc.in Normal file
View File

@ -0,0 +1,48 @@
## Makefile for building the gmodule dll with Microsoft C
## Use: nmake -f makefile.msc install
TOP = ..\..
!INCLUDE $(TOP)\build\win32\make.msc
# Possibly override GLib version in build\win32\module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below
INCLUDES = -I .. -I .
DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=g_log_domain_gmodule
all : \
gmoduleconf.h \
gmodule-$(GLIB_VER).dll \
testgmodule.exe
gmodule_OBJECTS = \
gmodule.obj
gmoduleconf.h: gmoduleconf.h.win32
copy gmoduleconf.h.win32 gmoduleconf.h
makefile.msc: makefile.msc.in
$(SED) -e s,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@, \
-e s,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@, <makefile.msc.in >$@
gmodule-$(GLIB_VER).dll : $(gmodule_OBJECTS) gmodule.def
$(CC) $(CFLAGS) -LD -Fegmodule-$(GLIB_VER).dll $(gmodule_OBJECTS) ..\glib-$(GLIB_VER).lib $(LDFLAGS) /def:gmodule.def
################ test prog
testgmodule.exe : gmodule-$(GLIB_VER).dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll
$(CC) $(CFLAGS) testgmodule.obj gmodule-$(GLIB_VER).lib ..\glib-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
libgplugin_a.dll : libgplugin_a.obj
$(CC) $(CFLAGS) -LD libgplugin_a.obj gmodule-$(GLIB_VER).lib ..\glib-$(GLIB_VER).lib $(LDFLAGS)
libgplugin_b.dll : libgplugin_b.obj
$(CC) $(CFLAGS) -LD libgplugin_b.obj gmodule-$(GLIB_VER).lib ..\glib-$(GLIB_VER).lib $(LDFLAGS)
clean::
del gmoduleconf.h

View File

@ -83,6 +83,8 @@ gobject_query_LDADD = $(progs_LDADD)
EXTRA_DIST += \
makefile.mingw \
makefile.mingw.in \
makefile.msc \
makefile.msc.in \
gobject.def \
gobject.rc \
gobject.rc.in
@ -93,3 +95,5 @@ gobject.rc: $(top_builddir)/config.status $(top_srcdir)/gobject/gobject.rc.in
makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gobject/makefile.mingw.in
cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status
makefile.msc: $(top_builddir)/config.status $(top_srcdir)/gobject/makefile.msc.in
cd $(top_builddir) && CONFIG_FILES=gobject/$@ CONFIG_HEADERS= $(SHELL) ./config.status

View File

@ -3,12 +3,14 @@
## Use: make -f makefile.mingw
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
TOP = ../..
include ../build/win32/make.mingw
# Possibly override GLib version in build/win32/module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below

35
gobject/makefile.msc.in Normal file
View File

@ -0,0 +1,35 @@
## Makefile for building the gobject dll with Microsoft C
## Use: nmake -f makefile.msc install
TOP = ..\..
!INCLUDE $(TOP)\build\win32\make.msc
# Possibly override GLib version in build\win32\object.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below
INCLUDES = -I .. -I .
DEFINES = -DHAVE_CONFIG_H -DGOBJECT_COMPILATION -DG_LOG_DOMAIN=g_log_domain_gobject
all : \
gobject-$(GLIB_VER).dll
gobject_OBJECTS = \
gvalue.obj \
gvaluetypes.obj \
gparam.obj \
gparamspecs.obj \
genums.obj \
gobject.obj \
gtype.obj
makefile.msc: makefile.msc.in
$(SED) -e s,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@, \
-e s,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@, <makefile.msc.in >$@
gobject-$(GLIB_VER).dll : $(gobject_OBJECTS) gobject.def
$(CC) $(CFLAGS) -LD -Fegobject-$(GLIB_VER).dll $(gobject_OBJECTS) ..\glib-$(GLIB_VER).lib $(LDFLAGS) /def:gobject.def

View File

@ -6,6 +6,8 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/gthread \
EXTRA_DIST = \
makefile.mingw \
makefile.mingw.in \
makefile.msc \
makefile.msc.in \
gthread-posix.c \
gthread-solaris.c \
gthread-none.c \
@ -31,3 +33,6 @@ gthread.rc: $(top_builddir)/config.status $(top_srcdir)/gthread/gthread.rc.in
makefile.mingw: $(top_builddir)/config.status $(top_srcdir)/gthread/makefile.mingw.in
cd $(top_builddir) && CONFIG_FILES=gthread/$@ CONFIG_HEADERS= $(SHELL) ./config.status
makefile.msc: $(top_builddir)/config.status $(top_srcdir)/gthread/makefile.msc.in
cd $(top_builddir) && CONFIG_FILES=gthread/$@ CONFIG_HEADERS= $(SHELL) ./config.status

View File

@ -3,12 +3,13 @@
## Use: make -f makefile.mingw
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
TOP = ../..
include ../build/win32/make.mingw
# Possibly override GLib version in build/win32/module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below

32
gthread/makefile.msc.in Normal file
View File

@ -0,0 +1,32 @@
## Makefile for building the gthread dll with Microsoft C
## Use: nmake -f makefile.msc install
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
TOP = ..\..
!INCLUDE $(TOP)\build\win32\make.msc
# Possibly override GLib version in build\win32\module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below
INCLUDES = -I .. -I .
DEFINES = -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"GThread\"
DEPCFLAGS = $(PTHREAD_CFLAGS)
all : \
gthread-$(GLIB_VER).dll
gthread_OBJECTS = \
gthread-impl.obj
makefile.msc: makefile.msc.in
$(SED) -e s,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@, \
-e s,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@, <makefile.msc.in >$@
gthread-$(GLIB_VER).dll : $(gthread_OBJECTS) gthread.def
$(CC) $(CFLAGS) -LD -Fegthread-$(GLIB_VER).dll $(gthread_OBJECTS) ..\glib-$(GLIB_VER).lib $(PTHREAD_LIBS) $(LDFLAGS) /def:gthread.def

View File

@ -130,7 +130,6 @@ g_win32_opendir (const char *dirname)
struct dirent*
g_win32_readdir (DIR *dir)
{
static struct dirent result;
gchar *basename;
g_return_val_if_fail (dir != NULL, NULL);
@ -157,11 +156,11 @@ g_win32_readdir (DIR *dir)
basename = g_path_get_basename (((LPWIN32_FIND_DATA) dir->find_file_data)->cFileName);
strcpy (result.d_name, basename);
strcpy (dir->readdir_result.d_name, basename);
g_free (basename);
return &result;
return &dir->readdir_result;
}
void

View File

@ -7,12 +7,13 @@
# should be in your PATH.
BIN = /bin
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
TOP = ..
include build/win32/make.mingw
# Possibly override GLib version in build/win32/module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below

View File

@ -1,67 +1,52 @@
## Makefile for building the GLib, gmodule and gthread dlls with Microsoft C
## Makefile for building the GLib 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-05-30 snapshot.
PTHREADS = ..\pthreads-snap-1999-05-30
PTHREAD_LIB = $(PTHREADS)\pthread.lib
PTHREAD_INC = -I $(PTHREADS)
TOP = ..
!INCLUDE $(TOP)\build\win32\make.msc
# Possibly override GLib version in build\win32\module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below
!IFNDEF DEBUG
# Full optimization:
OPTIMIZE = -Ox -MD
LINKDEBUG =
!ELSE
# Debugging:
OPTIMIZE = -Zi -MDd
LINKDEBUG = /debug
!ENDIF
INCLUDES = -I .
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib
DEPCFLAGS = $(LIBICONV_CFLAGS)
# cl -? describes the options
CC = cl -G5 -GF $(OPTIMIZE) -W3 -nologo
# No general LDFLAGS needed
LDFLAGS = /link $(LINKDEBUG)
INSTALL = copy
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
CFLAGS = -I. -DHAVE_CONFIG_H
DLLS_TO_BUILD = \
glib-$(GLIB_VER).dll \
sub-gmodule \
sub-gthread \
sub-gobject
all : \
glibconfig.h \
config.h \
glib-$(GLIB_VER).dll \
gmodule\gmoduleconf.h \
gmodule-$(GLIB_VER).dll \
gthread-$(GLIB_VER).dll \
glibconfig.h \
$(DLLS_TO_BUILD) \
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)
copy glib-$(GLIB_VER).dll $(BIN)
glib_OBJECTS = \
garray.obj \
gasyncqueue.obj \
gbacktrace.obj \
gcache.obj \
gcompletion.obj \
gdataset.obj \
gdate.obj \
gerror.obj \
gconvert.obj \
ghash.obj \
ghook.obj \
giochannel.obj \
@ -89,91 +74,69 @@ glib_OBJECTS = \
gutils.obj \
gwin32.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 $<
makefile.msc: makefile.msc.in
$(SED) -e s,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@, \
-e s,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@, <makefile.msc.in >$@
.c.i :
$(CC) $(CFLAGS) -GD -E -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib $< >$@
################ glib
gmodule_OBJECTS = \
gmodule.obj
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
$(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) $(LIBICONV_LIBS) user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def
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
################ subdirectories
gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c
$(CC) $(CFLAGS) -GD -Igmodule -c -DG_LOG_DOMAIN=g_log_domain_gmodule gmodule\gmodule.c
sub-gmodule :
cd gmodule
-$(MAKE) -f makefile.msc all
cd ..
gmodule\gmoduleconf.h: gmodule\gmoduleconf.h.win32
copy gmodule\gmoduleconf.h.win32 gmodule\gmoduleconf.h
sub-gthread :
cd gthread
-$(MAKE) -f makefile.msc all
cd ..
gthread_OBJECTS = \
gthread-impl.obj
sub-gobject :
cd gobject
-$(MAKE) -f makefile.msc all
cd ..
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
################ test progs
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.obj : testglib.c
$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" testglib.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.obj : testgdate.c
$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" testgdate.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.obj : testgdateparser.c
$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" testgdateparser.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
################ other stuff
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
clean:
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
cd gmodule
$(MAKE) -f makefile.msc clean
cd ..
cd gthread
$(MAKE) -f makefile.msc clean
cd ..
cd gobject
$(MAKE) -f makefile.msc clean
cd ..

View File

@ -1,19 +1,19 @@
## Makefile for building the GLib test programs with Microsoft C
## Use: nmake -f makefile.msc check
TOP = ..\..
!INCLUDE $(TOP)\build\win32\make.msc
# Possibly override GLib version in build\win32\module.defs
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
################################################################
# Nothing much configurable below
# cl -? describes the options
CC = cl -G5 -GF -Ox -W3 -MD -nologo
# No general LDFLAGS needed
LDFLAGS = /link
GLIB_VER = @GLIB_MAJOR_VERSION@.@GLIB_MINOR_VERSION@
CFLAGS = -I.. -DHAVE_CONFIG_H
INCLUDES = -I..
DEFINES = -DHAVE_CONFIG_H
TESTS = \
array-test.exe \
@ -26,7 +26,7 @@ TESTS = \
rand-test.exe \
relation-test.exe\
slist-test.exe \
strfunc-test.exe\
# strfunc-test.exe\
string-test.exe \
thread-test.exe \
threadpool-test.exe\
@ -35,20 +35,13 @@ TESTS = \
all : $(TESTS)
makefile.msc: makefile.msc.in
$(SED) -e s,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@, \
-e s,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@, <makefile.msc.in >$@
.c.exe :
$(CC) $(CFLAGS) -c $<
$(CC) $(CFLAGS) -Fe$@ $< ..\glib-$(GLIB_VER).lib ..\gthread-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
$(CC) $(CFLAGS) -Fe$@ $< ..\glib-$(GLIB_VER).lib ..\gmodule\gmodule-$(GLIB_VER).lib ..\gthread\gthread-$(GLIB_VER).lib $(LDFLAGS) /subsystem:console
check: all
for %p in ($(TESTS)) do %p
clean:
del *.exe
del *.obj
del *.dll
del *.lib
del *.err
del *.map
del *.sym
del *.exp
del *.pdb