bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnubg] Modifications to Build Scripts - Cross Compiling Win32


From: Michael Petch
Subject: [Bug-gnubg] Modifications to Build Scripts - Cross Compiling Win32
Date: Tue, 05 Aug 2003 02:25:02 -0600

Howdy All,

Since I don't have CVS commit privileges I am going to present you a few
patches for review/potential incorporation. I should note that these
were issues I attempted to fix in order to build the Windows version of
GnuBG on my Linux (Redhat 9) box using the MingW Cross compiler. 

#1)
The first patch is for intl/localename.c (against version 1.1).This
particular file should be updated to support WIN32 header files that
lack new Language defines. The patch that is applied is a simple update
of this file using the new one in gettext-0.12.1. Really upgrading the
whole intl directory in gnubg project to 0.12.1+ would be a better idea.
This fixes the problem of languages like LANG_SORBIAN breaking the build
because windows headers don't have defines for newer languages.

#2)
The second file is the configure.in file (The diff is from version
1.98). First is that i needed to add checks to the script (I borrowed
from libgnomecanvas) to check whether the target of cross compiling is a
Native win32 environment (Mingw). Secondly if we are targetting a Native
win 32 environment, I added the checks for the appropriate usage of
-fnative-struct or -mms-bitfields which differ with newer GCC compilers.
The result of these checks are added compiler flags.

Next is related. The requirements for Sound (WINMM) on windows required
modifying this file to support the appropriate conditional build
directives to support such compilation). A check is done if native win32
(mingw) is the target platform and if it is I ensure the Linux sound
components are not turned on, and that the appropriate WINMM ones are.
last WINMM cflags, and libs defines are set appropriately.

The last thing changed in configure.in was to cehck to see if libgen.h
was available, and if not add the simplelibgen.c and simplelibgen.h are
added to the resulting Makefile.

#3)
The last file I modified was the Makefile.am . Changes were made to
support the new sound system directives, and flags that were generated
by the new configure.in script. 

When cross compiling the executables that get created for windows have
EXE extensions. Unfortunately Makefile.am emits a makefile that doesn't
take into account the potentially different exe extensions (EXEEXT) for
the makebearoff, makehyper, etc tools (GNUBG was correct already).
Without changing this the Make facility got very confused and tried to
rebuild(unsuccessfully) files it already generated.

A check is also done and appropriate makefile processing is emitted to
build in simplelibgen.c if required. This may want to be revisited -
just so happened someone made a modification to simplelibgen (v1.2)
yesterday that also had a bug.

A change was applied yesterday in simplelibgen.c (v1.2) to check to see
that USE_GTK is turned on - to support usages of the GTK dirname
function. Unfortunately if USE_GTK is on, the makefile that gets emitted
must also make sure that GTK_LIBS is linked to all the executables
(makeHyper, makebearoff etc) that may need the GTK verison of the
function. Thus I added @GTK_LIBS@ link options to the other exectuables
we generate (gnubg.exe was okay since it already used the GTK_LIBS if
GTK support was turned on)

----------

The end result is that with a properly configured Linux Mingw cross
compiler environment you can pull the cvs source and build a Windows
build with an appropriate ./configure command with approproate cross
compiling switches and environment variables and then do a standard make
to build it up. I have been able to build up the Gui/Non Gui Windows
Apps (With or without sound), as well tested builds of normal GnuBG for
my Linux platform using the same files.

It is of course critical to have a proper cross compiling environment in
place (which is more time consuming). I will be installing MingW for
Windows Platform (native), and see if I can create a set of instructions
to create an appropriate build environment that would support using
./configure to build gnubg. I have noted that at present external batch
files are used, and must be updated by hand and seem to get out of sync.
Ideally peopel should be able to Pull the CVS tree do an appropriate
./configure and make to produce the desired builds.


-- 
Mike Petch
CApp::Sysware Consulting Ltd.
Suite 1002,1140-15th Ave SW.
Calgary, Alberta, Canada.
T2R 1K6.
(403)804-5700.

Attachment: configure.in.diff
Description: Text Data

Attachment: Makefile.am.diff
Description: Text Data

Attachment: localename.c.diff
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]