Make gtk-win build work on cygwin

This commit is contained in:
Yevgen Muntyan 2012-07-29 06:12:48 +01:00
parent de95b48e26
commit 6757227410
4 changed files with 39 additions and 8 deletions

View File

@ -1,9 +1,28 @@
if [ -z "$OSTYPE" -o "$OSTYPE" != "cygwin" ]; then
export mgwsystem=linux
else
export mgwsystem=cygwin
fi
if [ $mgwsystem = linux ]; then
export mgwlinux=true
export mgwcygwin=false
else
export mgwlinux=false
export mgwcygwin=true
fi
export mgwbuildroot=$HOME/projects/gtk-win-build export mgwbuildroot=$HOME/projects/gtk-win-build
export mgwpythondotver=2.7 export mgwpythondotver=2.7
export mgwpythonver=`echo $mgwpythondotver | sed 's/[.]//'` export mgwpythonver=`echo $mgwpythondotver | sed 's/[.]//'`
export mgwpythoninstdir=$HOME/.wine/drive_c/Python$mgwpythonver
export mgwpythonsystem32dir=$HOME/.wine/drive_c/windows/system32 if $mgwlinux; then
export mgwpythoninstdir=$HOME/.wine/drive_c/Python$mgwpythonver
export mgwpythonsystem32dir=$HOME/.wine/drive_c/windows/system32
else
export mgwpythoninstdir=/cygdrive/c/Tools/Python$mgwpythonver
export mgwpythonsystem32dir=/cygdrive/c/Windows/SysWOW64
fi
export mgwdir_s=$mgwdir export mgwdir_s=$mgwdir
export mgwdir=`cd $mgwdir && pwd` export mgwdir=`cd $mgwdir && pwd`

View File

@ -1,4 +1,4 @@
<?xml version="1.0" ?><!-- -%- indent-width:2; use-tabs:0 -%- --> <?xml version="1.0" ?><!-- -%- lang:xml; indent-width:2; use-tabs:0 -%- -->
<moduleset> <moduleset>
<repository type="hg" name="muntyan.bitbucket.org" href="http://bitbucket.org/muntyan/"/> <repository type="hg" name="muntyan.bitbucket.org" href="http://bitbucket.org/muntyan/"/>
@ -61,6 +61,9 @@
<dependencies> <dependencies>
<dep package="libiconv"/> <dep package="libiconv"/>
</dependencies> </dependencies>
<patches>
<patch file="libxml2.patch" strip="1"/>
</patches>
</tarball> </tarball>
<tarball id="glib"> <tarball id="glib">

View File

@ -12,7 +12,7 @@ else:
assert _gtkwinconfig in ['debug', 'release'] assert _gtkwinconfig in ['debug', 'release']
_mingw_tool_prefix = None _mingw_tool_prefix = None
for __p in ('i586-mingw32msvc', 'i486-mingw32'): for __p in ('i686-pc-mingw32', 'i586-mingw32msvc', 'i486-mingw32'):
if os.path.exists('/usr/bin/%s-gcc' % (__p,)): if os.path.exists('/usr/bin/%s-gcc' % (__p,)):
_mingw_tool_prefix = '/usr/bin/%s-' % (__p,) _mingw_tool_prefix = '/usr/bin/%s-' % (__p,)
break break
@ -63,7 +63,7 @@ for _var in _mingw_tools:
if _gtkwinconfig == 'debug': if _gtkwinconfig == 'debug':
_def_cflags = '-gstabs' _def_cflags = '-gstabs'
else: else:
_def_cflags = '-O2' _def_cflags = '-gstabs -O2'
# os.environ['LDFLAGS'] = "-L%s/lib" % (prefix,) # os.environ['LDFLAGS'] = "-L%s/lib" % (prefix,)
# os.environ['CPPFLAGS'] = "-I%s/include" % (prefix,) # os.environ['CPPFLAGS'] = "-I%s/include" % (prefix,)
@ -84,8 +84,14 @@ for __dir in os.environ['PATH'].split(':'):
#Populating autogenargs #Populating autogenargs
_configure_target = 'i586-pc-mingw32msvc' if os.environ['mgwlinux'] == 'true':
_configure_build = 'i686-pc-linux-gnu' _configure_build = 'i686-pc-linux-gnu'
_configure_target = 'i586-pc-mingw32msvc'
elif os.environ['mgwcygwin'] == 'true':
_configure_build = 'i686-pc-cygwin'
_configure_target = 'i686-pc-mingw32'
else:
raise RuntimeError("oops")
autogenargs = ' --build=' + _configure_build autogenargs = ' --build=' + _configure_build
autogenargs += ' --host=' + _configure_target autogenargs += ' --host=' + _configure_target
@ -107,12 +113,14 @@ module_autogenargs['gettext'] = autogenargs + " --without-emacs" \
+ " --with-included-gettext" \ + " --with-included-gettext" \
+ " --without-libexpat-prefix" \ + " --without-libexpat-prefix" \
+ " --without-libxml2-prefix" \ + " --without-libxml2-prefix" \
+ " --without-libglib-2.0-prefix" + " --without-libglib-2.0-prefix" \
+ " --enable-threads=win32"
if _gtkwinconfig == 'debug': if _gtkwinconfig == 'debug':
module_autogenargs['gettext'] += " CPPFLAGS=-DHAVE_INLINE" module_autogenargs['gettext'] += " CPPFLAGS=-DHAVE_INLINE"
module_autogenargs['libxml2'] = autogenargs + " --without-python" \ module_autogenargs['libxml2'] = autogenargs + " --without-python" \
+ " --without-zlib" \ + " --without-zlib" \
+ " --without-threads" \
+ _cflags_cmdline.replace('-gstabs', '-g') + _cflags_cmdline.replace('-gstabs', '-g')
module_autogenargs['pkgconfig'] = autogenargs \ module_autogenargs['pkgconfig'] = autogenargs \

View File

@ -1,4 +1,5 @@
#! /bin/sh #! /bin/sh
# -%- lang:sh; indent-width:2 -%-
builddir=`pwd` builddir=`pwd`
srcdir=`dirname $0`/../.. srcdir=`dirname $0`/../..