]> Pileus Git - ~andy/gtk/commitdiff
Update README.win32
authorTor Lillqvist <tml@iki.fi>
Mon, 24 Aug 2009 07:08:53 +0000 (10:08 +0300)
committerTor Lillqvist <tml@iki.fi>
Mon, 24 Aug 2009 07:08:53 +0000 (10:08 +0300)
README.win32

index 9d731602fc88af141c3976cab9dab7b648499eef..f7c8ca63073d3ec97104d49f5dad51a1f7d1426a 100644 (file)
-The Win32 backend in GTK+ is not as stable or correct as the X11 one.
-
-For prebuilt runtime and developer packages see
-http://ftp.gnome.org/pub/gnome/binaries/win32/
-
-Building GTK+ on Win32
-======================
-
-First you obviously need developer packages for the compile-time
-dependencies: Pango, atk, glib, gettext-runtime, libiconv, libpng,
-zlib, libtiff at least. See
-http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies .
-
-After installing the dependencies, there are two ways to build GTK+
-for win32.
-
-1) GNU tools, ./configure && make install
------------------------------------------
-
-This requires you have mingw and MSYS.
-
-Use the configure script, and the resulting Makefiles (which use
-libtool and gcc to do the compilation). I use this myself, but it can
-be hard to setup correctly.
-
-The full script I run to build GTK+ 2.10 unpacked from a source
-distribution is as below. This is from bulding GTK+ 2.10.9, slightly
-edited to make it match this 2.11 development branch. Actually I don't
-use any script like this to build the development branch, as I don't
-distribute any binaries from development branches.
-
-MOD=gtk+
-VER=2.10.9
-THIS=$MOD-$VER
-HEX=`echo $THIS | md5sum | cut -d' ' -f1`
-TARGET=c:/devel/target/$HEX
-DEPS="`/devel/src/tml/latest.sh glib atk cairo pango`"
-sed -e 's/need_relink=yes/need_relink=no # no way --tml/' <ltmain.sh >ltmain.temp && mv ltmain.temp ltmain.sh
-usedev
-usemsvs6
-MY_PKG_CONFIG_PATH=""
-for D in $DEPS; do
-    PATH=/devel/dist/$D/bin:$PATH
-    MY_PKG_CONFIG_PATH=/devel/dist/$D/lib/pkgconfig:$MY_PKG_CONFIG_PATH
-done
-PKG_CONFIG_PATH=$MY_PKG_CONFIG_PATH:$PKG_CONFIG_PATH CC='gcc -mtune=pentium3 -mthreads' CPPFLAGS='-I/opt/gnu/include -I/opt/gnuwin32/include -I/opt/misc/include' LDFLAGS='-L/opt/gnu/lib -L/opt/gnuwin32/lib -L/opt/misc/lib -Wl,--enable-auto-image-base' LIBS=-lintl CFLAGS=-O2 ./configure --with-gdktarget=win32 --enable-debug=yes --disable-gtk-doc --disable-static --prefix=$TARGET &&
-libtoolcacheize &&
-unset MY_PKG_CONFIG_PATH &&
-PATH=/devel/target/$HEX/bin:.libs:$PATH make install &&
-(cd $TARGET/bin; strip --strip-unneeded *.dll *.exe) &&
-(cd $TARGET/lib/gtk-2.0/2.10.0/loaders; strip --strip-unneeded *.dll) &&
-(cd $TARGET/lib/gtk-2.0/2.10.0/immodules; strip --strip-unneeded *.dll) &&
-(cd $TARGET/lib/gtk-2.0/2.10.0/engines; strip --strip-unneeded *.dll) &&
-PATH=$TARGET/bin:$PATH gdk-pixbuf-query-loaders >$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders &&
-grep -v -E 'Automatically generated|Created by|LoaderDir =' <$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders >$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp &&
-mv $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders &&
-grep -v -E 'Automatically generated|Created by|ModulesPath =' <$TARGET/etc/gtk-2.0/gtk.immodules >$TARGET/etc/gtk-2.0/gtk.immodules.temp &&
-mv $TARGET/etc/gtk-2.0/gtk.immodules.temp $TARGET/etc/gtk-2.0/gtk.immodules &&
-./gtk-zip.sh &&
-(cd /devel/src/tml && zip /tmp/$MOD-dev-$VER.zip make/$THIS.make) &&
-manifestify /tmp/$MOD*-$VER.zip
-
-You should not just copy the above blindly. There are some things in
-the script that are very specific to *my* build setup on *my* current
-machine. For instance the "latest.sh" script, the "usedev" and
-"usemsvs6" shell functions, the /devel/dist folder. The above script
-is really just meant for reference, to give an idea. You really need
-to understand what things like PKG_CONFIG_PATH are and set them up
-properly after installing the dependencies before building GTK+.
-
-As you see above, after running configure, one can just say "make
-install", like on Unix. A post-build fix is needed, running
-gdk-pixbuf-query-loaders once more to get a correct gdk-pixbuf.loaders
-file.
-
-2) Microsoft's tools
---------------------
-
-Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
-makefile.msc in gdk and gtk. Be prepared to manually edit various
-makefile.msc files, and the makefile snippets in build/win32.
-
-Alternative 1 also generates Microsoft import libraries (.lib), if you
-have lib.exe available. It might also work for cross-compilation from
-Unix.
-
-I use method 1 myself. Hans Breuer has been taking care of the MSVC
-makefiles. At times, we disagree a bit about various issues, and for
-instance the makefile.msc files might not produce identically named
-DLLs and import libraries as the "autoconfiscated" makefiles and
-libtool do. If this bothers you, you will have to fix the makefiles.
-
-Using GTK+ on Win32
-===================
-
-To use GTK+ on Win32, you also need either one of the above mentioned
-compilers. Other compilers might work, but don't count on it. Look for
-prebuilt developer packages (DLLs, import libraries, headers) on the
-above website.
-
-Multi-threaded use of GTK+ on Win32
-===================================
-
-Multi-threaded GTK+ programs might work on Windows in special simple
-cases, but not in general. Sorry. If you have all GTK+ and GDK calls
-in the same thread, it might work. Otherwise, probably not at
-all. Possible ways to fix this are being investigated.
-
-Wintab
-======
-
-The tablet support uses the Wintab API. The Wintab development kit is
-no longer required. The wintab.h header file is bundled with GTK+
-sources. Unfortunately it seems that only Wacom tablets come with
-support for the Wintab API nowadays.
-
---Tor Lillqvist <tml@iki.fi>, <tml@novell.com>
+The Win32 backend in GTK+ is not as stable or correct as the X11 one.\r
+\r
+For prebuilt runtime and developer packages see\r
+http://ftp.gnome.org/pub/gnome/binaries/win32/\r
+\r
+Building GTK+ on Win32\r
+======================\r
+\r
+First you obviously need developer packages for the compile-time\r
+dependencies: Pango, atk, glib, gettext-runtime, libiconv, libpng,\r
+zlib, libtiff at least. See\r
+http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies .\r
+\r
+After installing the dependencies, there are two ways to build GTK+\r
+for win32.\r
+\r
+1) GNU tools, ./configure && make install\r
+-----------------------------------------\r
+\r
+This requires you have mingw and MSYS.\r
+\r
+Use the configure script, and the resulting Makefiles (which use\r
+libtool and gcc to do the compilation). I use this myself, but it can\r
+be hard to setup correctly.\r
+\r
+The full script I run to build GTK+ 2.16 unpacked from a source\r
+distribution is as below. This is from bulding GTK+ 2.16.5. I don't\r
+use any script like this to build the development branch, as I don't\r
+distribute any binaries from development branches.\r
+\r
+# This is a shell script that calls functions and scripts from\r
+# tml@iki.fi's personal work envĂ­ronment. It is not expected to be\r
+# usable unmodified by others, and is included only for reference.\r
+\r
+MOD=gtk+\r
+VER=2.16.5\r
+REV=1\r
+ARCH=win32\r
+\r
+THIS=${MOD}_${VER}-${REV}_${ARCH}\r
+\r
+RUNZIP=${MOD}_${VER}-${REV}_${ARCH}.zip\r
+DEVZIP=${MOD}-dev_${VER}-${REV}_${ARCH}.zip\r
+\r
+HEX=`echo $THIS | md5sum | cut -d' ' -f1`\r
+TARGET=c:/devel/target/$HEX\r
+\r
+usedev\r
+usemsvs6\r
+\r
+(\r
+\r
+set -x\r
+\r
+DEPS=`latest --arch=${ARCH} glib atk cairo pango libpng zlib libtiff jpeg`\r
+PROXY_LIBINTL=`latest --arch=${ARCH} proxy-libintl`\r
+\r
+PKG_CONFIG_PATH=\r
+for D in $DEPS; do\r
+    PATH=/devel/dist/${ARCH}/$D/bin:$PATH\r
+    [ -d /devel/dist/${ARCH}/$D/lib/pkgconfig ] && PKG_CONFIG_PATH=/devel/dist/${ARCH}/$D/lib/pkgconfig:$PKG_CONFIG_PATH\r
+done\r
+\r
+LIBPNG=`latest --arch=${ARCH} libpng`\r
+ZLIB=`latest --arch=${ARCH} zlib`\r
+LIBTIFF=`latest --arch=${ARCH} libtiff`\r
+JPEG=`latest --arch=${ARCH} jpeg`\r
+\r
+patch -p0 <<'EOF'\r
+EOF\r
+\r
+lt_cv_deplibs_check_method='pass_all' \\r
+CC='gcc -mtune=pentium3 -mthreads' \\r
+CPPFLAGS="-I/devel/dist/${ARCH}/${LIBPNG}/include \\r
+-I/devel/dist/${ARCH}/${ZLIB}/include \\r
+-I/devel/dist/${ARCH}/${LIBTIFF}/include \\r
+-I/devel/dist/${ARCH}/${JPEG}/include \\r
+-I/devel/dist/${ARCH}/${PROXY_LIBINTL}/include" \\r
+LDFLAGS="-L/devel/dist/${ARCH}/${LIBPNG}/lib \\r
+-L/devel/dist/${ARCH}/${ZLIB}/lib \\r
+-L/devel/dist/${ARCH}/${LIBTIFF}/lib \\r
+-L/devel/dist/${ARCH}/${JPEG}/lib \\r
+-L/devel/dist/${ARCH}/${PROXY_LIBINTL}/lib -Wl,--exclude-libs=libintl.a \\r
+-Wl,--enable-auto-image-base" \\r
+LIBS=-lintl \\r
+CFLAGS=-O2 \\r
+./configure \\r
+--with-gdktarget=win32 \\r
+--disable-gdiplus \\r
+--with-included-immodules \\r
+--without-libjasper \\r
+--enable-debug=yes \\r
+--enable-explicit-deps=no \\r
+--disable-gtk-doc \\r
+--disable-static \\r
+--prefix=$TARGET &&\r
+\r
+libtoolcacheize &&\r
+rm gtk/gtk.def &&\r
+(PATH="$PWD/gdk-pixbuf/.libs:/devel/target/$HEX/bin:$PATH" make -j3 install || (rm .libtool-cache* && PATH="/devel/target/$HEX/bin:$PATH" make -j3 install)) &&\r
+\r
+PATH="/devel/target/$HEX/bin:$PATH" gdk-pixbuf-query-loaders >/devel/target/$HEX/etc/gtk-2.0/gdk-pixbuf.loaders &&\r
+\r
+grep -v -E 'Automatically generated|Created by|LoaderDir =' <$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders >$TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp &&\r
+    mv $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders.temp $TARGET/etc/gtk-2.0/gdk-pixbuf.loaders &&\r
+grep -v -E 'Automatically generated|Created by|ModulesPath =' <$TARGET/etc/gtk-2.0/gtk.immodules >$TARGET/etc/gtk-2.0/gtk.immodules.temp &&\r
+    mv $TARGET/etc/gtk-2.0/gtk.immodules.temp $TARGET/etc/gtk-2.0/gtk.immodules &&\r
+\r
+./gtk-zip.sh &&\r
+\r
+mv /tmp/${MOD}-${VER}.zip /tmp/$RUNZIP &&\r
+mv /tmp/${MOD}-dev-${VER}.zip /tmp/$DEVZIP\r
+\r
+) 2>&1 | tee /devel/src/tml/packaging/$THIS.log\r
+\r
+(cd /devel && zip /tmp/$DEVZIP src/tml/packaging/$THIS.{sh,log}) &&\r
+manifestify /tmp/$RUNZIP /tmp/$DEVZIP\r
+\r
+You should not just copy the above blindly. There are some things in\r
+the script that are very specific to *my* build setup on *my* current\r
+machine. For instance the "latest" command, the "usedev" and\r
+"usemsvs6" shell functions, the /devel/dist folder. The above script\r
+is really just meant for reference, to give an idea. You really need\r
+to understand what things like PKG_CONFIG_PATH are and set them up\r
+properly after installing the dependencies before building GTK+.\r
+\r
+As you see above, after running configure, one can just say "make\r
+install", like on Unix. A post-build fix is needed, running\r
+gdk-pixbuf-query-loaders once more to get a correct gdk-pixbuf.loaders\r
+file.\r
+\r
+For a 64-bit build you need to remove the gtk/gtk.def file and let it\r
+be regenerated by the makefilery. This is because the 64-bit GTK dll\r
+has a slightly different list of exported function names. This is on\r
+purpose and not a bug. The API is the same at the source level, and\r
+the same #defines of some function names to actually have a _utf8\r
+suffix is used (just to keep the header simpler). But the\r
+corresponding non-suffixed function to maintain ABI stability are not\r
+needed in the 64-bit case (because there are no older EXEs around that\r
+would require such for ABI stability).\r
+\r
+\r
+2) Microsoft's tools\r
+--------------------\r
+\r
+Use the Microsoft compiler, cl and Make, nmake. Say nmake -f\r
+makefile.msc in gdk and gtk. Be prepared to manually edit various\r
+makefile.msc files, and the makefile snippets in build/win32.\r
+\r
+Alternative 1 also generates Microsoft import libraries (.lib), if you\r
+have lib.exe available. It might also work for cross-compilation from\r
+Unix.\r
+\r
+I use method 1 myself. Hans Breuer has been taking care of the MSVC\r
+makefiles. At times, we disagree a bit about various issues, and for\r
+instance the makefile.msc files might not produce identically named\r
+DLLs and import libraries as the "autoconfiscated" makefiles and\r
+libtool do. If this bothers you, you will have to fix the makefiles.\r
+\r
+Using GTK+ on Win32\r
+===================\r
+\r
+To use GTK+ on Win32, you also need either one of the above mentioned\r
+compilers. Other compilers might work, but don't count on it. Look for\r
+prebuilt developer packages (DLLs, import libraries, headers) on the\r
+above website.\r
+\r
+Multi-threaded use of GTK+ on Win32\r
+===================================\r
+\r
+Multi-threaded GTK+ programs might work on Windows in special simple\r
+cases, but not in general. Sorry. If you have all GTK+ and GDK calls\r
+in the same thread, it might work. Otherwise, probably not at\r
+all. Possible ways to fix this are being investigated.\r
+\r
+Wintab\r
+======\r
+\r
+The tablet support uses the Wintab API. The Wintab development kit is\r
+no longer required. The wintab.h header file is bundled with GTK+\r
+sources. Unfortunately it seems that only Wacom tablets come with\r
+support for the Wintab API nowadays.\r
+\r
+--Tor Lillqvist <tml@iki.fi>, <tml@novell.com>\r