mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
754d8ddad8
2001-02-21 Tor Lillqvist <tml@iki.fi> Cygwin support contributed by Stefan Ondrejicka <ondrej@idata.sk>. Hopefully I got it all in while simultaneously adding support for auto*/libtool for mingw. * Makefile.am: Changes for auto* support on Cygwin and Win32. Do still distribute the hand-written makefiles and *.win32.in files, though. Use GIO, GSPAWN and PLATFORMDEP macros set by configure. Use -no-undefined. Pass -export-symbols glib.def to libtool. * configure.in: Define G_PLATFORM_WIN32 on both pure Win32 (mingw) and Cygwin. Add AC_CYGWIN, AC_EXEEXT and AC_LIBTOOL_WIN32_DLL calls for Cygwin and mingw support. Check for %I64u guint64 format (in MS C library). Set G_MODULE_IMPL on mingw and Cygwin. Use ac_object and ac_exeext. Set GIO, GSPAWN, PLATFORMDEP and G_LIBS_EXTRA. Compile timeloop only on Unix. Define OS_WIN32 automake conditional on Win32. * glib.h: Include gwin32.h also on Cygwin. * gfileutils.c (get_contents_posix): Use O_BINARY (defined as 0 on Unix) for Cygwin's sake. * gtimer.c (GETTIME): Reduce #ifdefs, use a macro GETTIME(). * gconvert.c * gthread.c * gutf8.c * gutils.c: For code needed both on Cygwin and native Win32, test for G_PLATFORM_WIN32. * gmarkup.h: Use G_BEGIN_DECLS and G_END_DECLS. * gtypes.h: Refine GLIB_VAR definition. Also check for DLL_EXPORT in case compiling a static library on Win32 or Cygwin. * gwin32.c: No <direct.h> on Cygwin. No need for ftruncate() or dirent emulation on Cygwin. (get_package_directory_from_module) Convert return value from GetModuleFileName() to POSIX path on Cygwin. * tests/Makefile.am (progs_LDADD): Link with libglib, libgthread and libgmodule as appropriate. Use -no-undefined. * gbacktrace.c: Move #ifdefs around a bit on Win32. * gshell.c (unquote_string_inplace): Make static. * testglib.c: Make some vars static. Add Cygwin path tests.
135 lines
3.0 KiB
Plaintext
135 lines
3.0 KiB
Plaintext
## Makefile for building the GLib DLL with gcc for mingw. The build
|
|
## uses tools running on cygwin, however.
|
|
|
|
## Use: make -f makefile.mingw
|
|
|
|
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
|
|
|
|
INCLUDES = -I .
|
|
DEFINES = -DHAVE_CONFIG_H -DGLIB_COMPILATION -DG_LOG_DOMAIN=g_log_domain_glib -DG_ENABLE_DEBUG -DDLL_EXPORT
|
|
DEPCFLAGS = $(INTL_CFLAGS) $(LIBICONV_CFLAGS)
|
|
|
|
DLLS_TO_BUILD = \
|
|
glib-$(GLIB_VER).dll \
|
|
sub-gmodule \
|
|
sub-gthread \
|
|
sub-gobject
|
|
|
|
all : \
|
|
config.h \
|
|
glibconfig.h \
|
|
$(DLLS_TO_BUILD) \
|
|
gspawn-win32-helper.exe \
|
|
testglib.exe \
|
|
testgdate.exe \
|
|
testgdateparser.exe
|
|
|
|
glib_OBJECTS = \
|
|
garray.o \
|
|
gasyncqueue.o \
|
|
gbacktrace.o \
|
|
gcache.o \
|
|
gcompletion.o \
|
|
gconvert.o \
|
|
gdataset.o \
|
|
gdate.o \
|
|
gerror.o \
|
|
gfileutils.o \
|
|
ghash.o \
|
|
ghook.o \
|
|
giochannel.o \
|
|
giowin32.o \
|
|
glist.o \
|
|
gmain.o \
|
|
gmarkup.o \
|
|
gmem.o \
|
|
gmessages.o \
|
|
gnode.o \
|
|
gprimes.o \
|
|
gqsort.o \
|
|
gqueue.o \
|
|
grand.o \
|
|
grel.o \
|
|
gscanner.o \
|
|
gshell.o \
|
|
gslist.o \
|
|
gspawn-win32.o \
|
|
gstrfuncs.o \
|
|
gstring.o \
|
|
gthread.o \
|
|
gthreadpool.o \
|
|
gtimer.o \
|
|
gtree.o \
|
|
gunibreak.o \
|
|
gunidecomp.o \
|
|
guniprop.o \
|
|
gutf8.o \
|
|
gutils.o \
|
|
gwin32.o
|
|
|
|
glibconfig.h: glibconfig.h.win32
|
|
cp $< $@
|
|
|
|
config.h: config.h.win32
|
|
cp $< $@
|
|
|
|
ifeq ($(wildcard makefile.mingw.in),makefile.mingw.in)
|
|
makefile.mingw: makefile.mingw.in
|
|
sed -e 's,@GLIB[_]MAJOR_VERSION@,@GLIB_MAJOR_VERSION@,' \
|
|
-e 's,@GLIB[_]MINOR_VERSION@,@GLIB_MINOR_VERSION@,' <$< >$@
|
|
endif
|
|
|
|
################ glib
|
|
|
|
glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def
|
|
./build-dll glib $(GLIB_VER) glib.def $(glib_OBJECTS) $(INTL_LIBS) $(LIBICONV_LIBS) -luser32 -lwsock32
|
|
|
|
gspawn-win32-helper.exe : gspawn-win32-helper.c
|
|
$(CC) $(CFLAGS) -mwindows -DG_LOG_DOMAIN=\"gspawn-win32-helper\" -o $@ $< -L . -lglib-$(GLIB_VER)
|
|
|
|
################ subdirectories
|
|
|
|
sub-gmodule :
|
|
cd gmodule && $(MAKE) -f makefile.mingw all
|
|
|
|
sub-gthread :
|
|
cd gthread && $(MAKE) -f makefile.mingw all
|
|
|
|
sub-gobject :
|
|
cd gobject && $(MAKE) -f makefile.mingw all
|
|
|
|
################ test progs
|
|
|
|
testglib.o : testglib.c
|
|
$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testglib\" $<
|
|
|
|
testglib.exe : glib-$(GLIB_VER).dll testglib.o
|
|
$(CC) $(CFLAGS) -o testglib testglib.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
|
|
|
|
testgdate.o : testgdate.c
|
|
$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdate\" $<
|
|
|
|
testgdate.exe : glib-$(GLIB_VER).dll testgdate.o
|
|
$(CC) $(CFLAGS) -o testgdate.exe testgdate.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
|
|
|
|
testgdateparser.o : testgdateparser.c
|
|
$(CC) -c $(CFLAGS) -DG_LOG_DOMAIN=\"testgdateparser\" $<
|
|
|
|
testgdateparser.exe : glib-$(GLIB_VER).dll testgdateparser.o
|
|
$(CC) $(CFLAGS) -o testgdateparser.exe testgdateparser.o -L . -lglib-$(GLIB_VER) $(LDFLAGS)
|
|
|
|
|
|
################ other stuff
|
|
|
|
clean::
|
|
-rm config.h glibconfig.h gmodule/gmoduleconf.h
|