gtk/README.win32

94 lines
4.0 KiB
Plaintext
Raw Normal View History

The Win32 backend in GTK+ is not as stable or correct as the X11
one.
For prebuilt runtime and developer packages see
http://www.gimp.org/win32/downloads.html .
There is also a gtk-1-3-win32-production branch of GTK+ that was
branched off from before the addition of the no-flicker and other
functionality that was new in GTK+ 2.0.0. The vesion number used for
that branch is 1.3.0. It corresponds most closely to GTK 1.2.7 on
Unix. For new code, you shouldn't be using that.
Building GTK+ on Win32
======================
There are two ways to build GTK+ for win32.
Updates. 2001-10-29 Tor Lillqvist <tml@iki.fi> * README.win32: Updates. * gtk-zip.sh.in: New file, used to build distribution package for Windows. * gdk/gdkglobals.c: Mark gdk_threads_mutex for DLL export when applicable with GDKVAR. * gtk/gtk.def: Update. * gtk/gtkfilesel.c: Include <winsock.h> (if available) for gethostname(). * gtk/gtkmain.c * gtk/gtkrc.c: (Win32) Save actual DLL name for later use in DLL entry function. Avoid hardcoded paths GTK_LIBDIR, GTK_SYSCONFDIR, GTK_DATA_PREFIX and GTK_LOCALEDIR, instead add functions that call g_win32_get_package_installation_subdirectory() with the actual DLL name saved above. Redefine above directory name macros to call these functions. Remove some ifdefs. * gtk/maketypes.awk: Output GTKTYPEBUILTINS_VAR (that marks variable for export on Win32) also to the _vars file. Changes for autoconfiscated build on Win32, and addition of Win32 backend to the related files: * configure.in: Like in GLib, set LT_CURRENT_MINUS_AGE for use when forming DLL name in some files. Set MS_LIB_AVAILABLE is lib.exe is available. Call AC_LIBTOOL_WIN32_DLL. Set PLATFORM_WIN32, OS_WIN32 and USE_WIN32 automake conditionals. Add win32 target, using pangowin32. Don't use the -export-symbols-regex option on Win32, we use .def files to list exported symbols. Check <winsock.h> (for gethostname() in gtkfilesel.c). Enclose nested AC_CHECK_* macros in brackets to prevent premature m4 expansion. * acconfig.h: Add HAVE_WINTAB. * gdk/Makefile.am: Add libgdk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gdk.def file. If MS_LIB_AVAILABLE, build MS import library. Install the import libraries. If HAVE_WINTAB, link with the Wintab library. * gtk/Makefile.am: Add libgtk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gtk-win32.def file. Install import libraries.
2001-10-29 07:06:37 +00:00
1) Use the autoconf-generated 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.
Personally I run configure with:
CC='gcc -mpentium -fnative-struct' CPPFLAGS='-I/target/include' CFLAGS=-O2 LDFLAGS='-L/target/lib' ./configure --disable-static --prefix=/target --with-gdktarget=win32 --with-wintab=/src/wtkit126 --with-ie55=/src/workshop/ie55_lib --host=i386-pc-mingw32
Then, in theory, you can just say "make", like on Unix. In reality,
there are a few hickups that require manual intervention, and it's
best to run make separately in each subdirectory. At least for me,
when libtool creates an .exe file, it puts the real .exe in the .libs
directory, and leaves a wrapper .exe in the work directory. For some
reason that wrapper doesn't work for me, it doesn't do anything. So, I
always do a "cp .libs/*.exe ." after running a make that has produced
some exes.
Another issue is with the gdk-pixbuf.loaders file. It's probably best
to do a "make install" in the gdk-pixbuf directory, and let that set
up a mostly correct gdk-pixbuf.loaders in the target directory. Then
copy that back to the source directory. It's needed in gtk/stock-icons
where make runs gdk-pixbuf-csource.
Etc, you get the idea. It can be a bit of a pain.
Updates. 2001-10-29 Tor Lillqvist <tml@iki.fi> * README.win32: Updates. * gtk-zip.sh.in: New file, used to build distribution package for Windows. * gdk/gdkglobals.c: Mark gdk_threads_mutex for DLL export when applicable with GDKVAR. * gtk/gtk.def: Update. * gtk/gtkfilesel.c: Include <winsock.h> (if available) for gethostname(). * gtk/gtkmain.c * gtk/gtkrc.c: (Win32) Save actual DLL name for later use in DLL entry function. Avoid hardcoded paths GTK_LIBDIR, GTK_SYSCONFDIR, GTK_DATA_PREFIX and GTK_LOCALEDIR, instead add functions that call g_win32_get_package_installation_subdirectory() with the actual DLL name saved above. Redefine above directory name macros to call these functions. Remove some ifdefs. * gtk/maketypes.awk: Output GTKTYPEBUILTINS_VAR (that marks variable for export on Win32) also to the _vars file. Changes for autoconfiscated build on Win32, and addition of Win32 backend to the related files: * configure.in: Like in GLib, set LT_CURRENT_MINUS_AGE for use when forming DLL name in some files. Set MS_LIB_AVAILABLE is lib.exe is available. Call AC_LIBTOOL_WIN32_DLL. Set PLATFORM_WIN32, OS_WIN32 and USE_WIN32 automake conditionals. Add win32 target, using pangowin32. Don't use the -export-symbols-regex option on Win32, we use .def files to list exported symbols. Check <winsock.h> (for gethostname() in gtkfilesel.c). Enclose nested AC_CHECK_* macros in brackets to prevent premature m4 expansion. * acconfig.h: Add HAVE_WINTAB. * gdk/Makefile.am: Add libgdk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gdk.def file. If MS_LIB_AVAILABLE, build MS import library. Install the import libraries. If HAVE_WINTAB, link with the Wintab library. * gtk/Makefile.am: Add libgtk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gtk-win32.def file. Install import libraries.
2001-10-29 07:06:37 +00:00
2) 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.
Updates. 2001-10-29 Tor Lillqvist <tml@iki.fi> * README.win32: Updates. * gtk-zip.sh.in: New file, used to build distribution package for Windows. * gdk/gdkglobals.c: Mark gdk_threads_mutex for DLL export when applicable with GDKVAR. * gtk/gtk.def: Update. * gtk/gtkfilesel.c: Include <winsock.h> (if available) for gethostname(). * gtk/gtkmain.c * gtk/gtkrc.c: (Win32) Save actual DLL name for later use in DLL entry function. Avoid hardcoded paths GTK_LIBDIR, GTK_SYSCONFDIR, GTK_DATA_PREFIX and GTK_LOCALEDIR, instead add functions that call g_win32_get_package_installation_subdirectory() with the actual DLL name saved above. Redefine above directory name macros to call these functions. Remove some ifdefs. * gtk/maketypes.awk: Output GTKTYPEBUILTINS_VAR (that marks variable for export on Win32) also to the _vars file. Changes for autoconfiscated build on Win32, and addition of Win32 backend to the related files: * configure.in: Like in GLib, set LT_CURRENT_MINUS_AGE for use when forming DLL name in some files. Set MS_LIB_AVAILABLE is lib.exe is available. Call AC_LIBTOOL_WIN32_DLL. Set PLATFORM_WIN32, OS_WIN32 and USE_WIN32 automake conditionals. Add win32 target, using pangowin32. Don't use the -export-symbols-regex option on Win32, we use .def files to list exported symbols. Check <winsock.h> (for gethostname() in gtkfilesel.c). Enclose nested AC_CHECK_* macros in brackets to prevent premature m4 expansion. * acconfig.h: Add HAVE_WINTAB. * gdk/Makefile.am: Add libgdk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gdk.def file. If MS_LIB_AVAILABLE, build MS import library. Install the import libraries. If HAVE_WINTAB, link with the Wintab library. * gtk/Makefile.am: Add libgtk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gtk-win32.def file. Install import libraries.
2001-10-29 07:06:37 +00:00
Alternative 1 also generates Microsoft import libraries (.lib), if you
have lib.exe available. It might also work for cross-compilation from
Updates. 2001-10-29 Tor Lillqvist <tml@iki.fi> * README.win32: Updates. * gtk-zip.sh.in: New file, used to build distribution package for Windows. * gdk/gdkglobals.c: Mark gdk_threads_mutex for DLL export when applicable with GDKVAR. * gtk/gtk.def: Update. * gtk/gtkfilesel.c: Include <winsock.h> (if available) for gethostname(). * gtk/gtkmain.c * gtk/gtkrc.c: (Win32) Save actual DLL name for later use in DLL entry function. Avoid hardcoded paths GTK_LIBDIR, GTK_SYSCONFDIR, GTK_DATA_PREFIX and GTK_LOCALEDIR, instead add functions that call g_win32_get_package_installation_subdirectory() with the actual DLL name saved above. Redefine above directory name macros to call these functions. Remove some ifdefs. * gtk/maketypes.awk: Output GTKTYPEBUILTINS_VAR (that marks variable for export on Win32) also to the _vars file. Changes for autoconfiscated build on Win32, and addition of Win32 backend to the related files: * configure.in: Like in GLib, set LT_CURRENT_MINUS_AGE for use when forming DLL name in some files. Set MS_LIB_AVAILABLE is lib.exe is available. Call AC_LIBTOOL_WIN32_DLL. Set PLATFORM_WIN32, OS_WIN32 and USE_WIN32 automake conditionals. Add win32 target, using pangowin32. Don't use the -export-symbols-regex option on Win32, we use .def files to list exported symbols. Check <winsock.h> (for gethostname() in gtkfilesel.c). Enclose nested AC_CHECK_* macros in brackets to prevent premature m4 expansion. * acconfig.h: Add HAVE_WINTAB. * gdk/Makefile.am: Add libgdk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gdk.def file. If MS_LIB_AVAILABLE, build MS import library. Install the import libraries. If HAVE_WINTAB, link with the Wintab library. * gtk/Makefile.am: Add libgtk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gtk-win32.def file. Install import libraries.
2001-10-29 07:06:37 +00:00
Unix.
Note that 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 will 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.
Updates. 2001-10-29 Tor Lillqvist <tml@iki.fi> * README.win32: Updates. * gtk-zip.sh.in: New file, used to build distribution package for Windows. * gdk/gdkglobals.c: Mark gdk_threads_mutex for DLL export when applicable with GDKVAR. * gtk/gtk.def: Update. * gtk/gtkfilesel.c: Include <winsock.h> (if available) for gethostname(). * gtk/gtkmain.c * gtk/gtkrc.c: (Win32) Save actual DLL name for later use in DLL entry function. Avoid hardcoded paths GTK_LIBDIR, GTK_SYSCONFDIR, GTK_DATA_PREFIX and GTK_LOCALEDIR, instead add functions that call g_win32_get_package_installation_subdirectory() with the actual DLL name saved above. Redefine above directory name macros to call these functions. Remove some ifdefs. * gtk/maketypes.awk: Output GTKTYPEBUILTINS_VAR (that marks variable for export on Win32) also to the _vars file. Changes for autoconfiscated build on Win32, and addition of Win32 backend to the related files: * configure.in: Like in GLib, set LT_CURRENT_MINUS_AGE for use when forming DLL name in some files. Set MS_LIB_AVAILABLE is lib.exe is available. Call AC_LIBTOOL_WIN32_DLL. Set PLATFORM_WIN32, OS_WIN32 and USE_WIN32 automake conditionals. Add win32 target, using pangowin32. Don't use the -export-symbols-regex option on Win32, we use .def files to list exported symbols. Check <winsock.h> (for gethostname() in gtkfilesel.c). Enclose nested AC_CHECK_* macros in brackets to prevent premature m4 expansion. * acconfig.h: Add HAVE_WINTAB. * gdk/Makefile.am: Add libgdk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gdk.def file. If MS_LIB_AVAILABLE, build MS import library. Install the import libraries. If HAVE_WINTAB, link with the Wintab library. * gtk/Makefile.am: Add libgtk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gtk-win32.def file. Install import libraries.
2001-10-29 07:06:37 +00:00
Using GTK+ on Win32
===================
Updates. 2001-10-29 Tor Lillqvist <tml@iki.fi> * README.win32: Updates. * gtk-zip.sh.in: New file, used to build distribution package for Windows. * gdk/gdkglobals.c: Mark gdk_threads_mutex for DLL export when applicable with GDKVAR. * gtk/gtk.def: Update. * gtk/gtkfilesel.c: Include <winsock.h> (if available) for gethostname(). * gtk/gtkmain.c * gtk/gtkrc.c: (Win32) Save actual DLL name for later use in DLL entry function. Avoid hardcoded paths GTK_LIBDIR, GTK_SYSCONFDIR, GTK_DATA_PREFIX and GTK_LOCALEDIR, instead add functions that call g_win32_get_package_installation_subdirectory() with the actual DLL name saved above. Redefine above directory name macros to call these functions. Remove some ifdefs. * gtk/maketypes.awk: Output GTKTYPEBUILTINS_VAR (that marks variable for export on Win32) also to the _vars file. Changes for autoconfiscated build on Win32, and addition of Win32 backend to the related files: * configure.in: Like in GLib, set LT_CURRENT_MINUS_AGE for use when forming DLL name in some files. Set MS_LIB_AVAILABLE is lib.exe is available. Call AC_LIBTOOL_WIN32_DLL. Set PLATFORM_WIN32, OS_WIN32 and USE_WIN32 automake conditionals. Add win32 target, using pangowin32. Don't use the -export-symbols-regex option on Win32, we use .def files to list exported symbols. Check <winsock.h> (for gethostname() in gtkfilesel.c). Enclose nested AC_CHECK_* macros in brackets to prevent premature m4 expansion. * acconfig.h: Add HAVE_WINTAB. * gdk/Makefile.am: Add libgdk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gdk.def file. If MS_LIB_AVAILABLE, build MS import library. Install the import libraries. If HAVE_WINTAB, link with the Wintab library. * gtk/Makefile.am: Add libgtk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gtk-win32.def file. Install import libraries.
2001-10-29 07:06:37 +00:00
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
Updates. 2001-10-29 Tor Lillqvist <tml@iki.fi> * README.win32: Updates. * gtk-zip.sh.in: New file, used to build distribution package for Windows. * gdk/gdkglobals.c: Mark gdk_threads_mutex for DLL export when applicable with GDKVAR. * gtk/gtk.def: Update. * gtk/gtkfilesel.c: Include <winsock.h> (if available) for gethostname(). * gtk/gtkmain.c * gtk/gtkrc.c: (Win32) Save actual DLL name for later use in DLL entry function. Avoid hardcoded paths GTK_LIBDIR, GTK_SYSCONFDIR, GTK_DATA_PREFIX and GTK_LOCALEDIR, instead add functions that call g_win32_get_package_installation_subdirectory() with the actual DLL name saved above. Redefine above directory name macros to call these functions. Remove some ifdefs. * gtk/maketypes.awk: Output GTKTYPEBUILTINS_VAR (that marks variable for export on Win32) also to the _vars file. Changes for autoconfiscated build on Win32, and addition of Win32 backend to the related files: * configure.in: Like in GLib, set LT_CURRENT_MINUS_AGE for use when forming DLL name in some files. Set MS_LIB_AVAILABLE is lib.exe is available. Call AC_LIBTOOL_WIN32_DLL. Set PLATFORM_WIN32, OS_WIN32 and USE_WIN32 automake conditionals. Add win32 target, using pangowin32. Don't use the -export-symbols-regex option on Win32, we use .def files to list exported symbols. Check <winsock.h> (for gethostname() in gtkfilesel.c). Enclose nested AC_CHECK_* macros in brackets to prevent premature m4 expansion. * acconfig.h: Add HAVE_WINTAB. * gdk/Makefile.am: Add libgdk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gdk.def file. If MS_LIB_AVAILABLE, build MS import library. Install the import libraries. If HAVE_WINTAB, link with the Wintab library. * gtk/Makefile.am: Add libgtk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gtk-win32.def file. Install import libraries.
2001-10-29 07:06:37 +00:00
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 can
Updates. 2001-10-29 Tor Lillqvist <tml@iki.fi> * README.win32: Updates. * gtk-zip.sh.in: New file, used to build distribution package for Windows. * gdk/gdkglobals.c: Mark gdk_threads_mutex for DLL export when applicable with GDKVAR. * gtk/gtk.def: Update. * gtk/gtkfilesel.c: Include <winsock.h> (if available) for gethostname(). * gtk/gtkmain.c * gtk/gtkrc.c: (Win32) Save actual DLL name for later use in DLL entry function. Avoid hardcoded paths GTK_LIBDIR, GTK_SYSCONFDIR, GTK_DATA_PREFIX and GTK_LOCALEDIR, instead add functions that call g_win32_get_package_installation_subdirectory() with the actual DLL name saved above. Redefine above directory name macros to call these functions. Remove some ifdefs. * gtk/maketypes.awk: Output GTKTYPEBUILTINS_VAR (that marks variable for export on Win32) also to the _vars file. Changes for autoconfiscated build on Win32, and addition of Win32 backend to the related files: * configure.in: Like in GLib, set LT_CURRENT_MINUS_AGE for use when forming DLL name in some files. Set MS_LIB_AVAILABLE is lib.exe is available. Call AC_LIBTOOL_WIN32_DLL. Set PLATFORM_WIN32, OS_WIN32 and USE_WIN32 automake conditionals. Add win32 target, using pangowin32. Don't use the -export-symbols-regex option on Win32, we use .def files to list exported symbols. Check <winsock.h> (for gethostname() in gtkfilesel.c). Enclose nested AC_CHECK_* macros in brackets to prevent premature m4 expansion. * acconfig.h: Add HAVE_WINTAB. * gdk/Makefile.am: Add libgdk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gdk.def file. If MS_LIB_AVAILABLE, build MS import library. Install the import libraries. If HAVE_WINTAB, link with the Wintab library. * gtk/Makefile.am: Add libgtk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gtk-win32.def file. Install import libraries.
2001-10-29 07:06:37 +00:00
be downloaded from http://www.pointing.com. Pass the --with-wintab
flag to configure if you use that. If you use nmake and you don't care
for Wintab, undefine HAVE_WINTAB in config.h.win32 and remove
references to the wntab32x library from the makefile before building.
ActiveIMM
=========
If you want to build a GTK+ that supports ActiveIMM (the Input Method
Manager for non-EastAsia locales that can be used on Win9x/NT4), you
need the dimm.h header file. That is somewhat difficult to find, but
http://msdn.microsoft.com/downloads/samples/internet/wizard/ seems to
be a good place to look nowadays. If you use "autoconfiscated" build,
pass the --with-ie55 flag to configure specifyin the location of the
ie55_lib directory created by downloading the IE5.5 headers and libs
from the above URL.
Updates. 2001-10-29 Tor Lillqvist <tml@iki.fi> * README.win32: Updates. * gtk-zip.sh.in: New file, used to build distribution package for Windows. * gdk/gdkglobals.c: Mark gdk_threads_mutex for DLL export when applicable with GDKVAR. * gtk/gtk.def: Update. * gtk/gtkfilesel.c: Include <winsock.h> (if available) for gethostname(). * gtk/gtkmain.c * gtk/gtkrc.c: (Win32) Save actual DLL name for later use in DLL entry function. Avoid hardcoded paths GTK_LIBDIR, GTK_SYSCONFDIR, GTK_DATA_PREFIX and GTK_LOCALEDIR, instead add functions that call g_win32_get_package_installation_subdirectory() with the actual DLL name saved above. Redefine above directory name macros to call these functions. Remove some ifdefs. * gtk/maketypes.awk: Output GTKTYPEBUILTINS_VAR (that marks variable for export on Win32) also to the _vars file. Changes for autoconfiscated build on Win32, and addition of Win32 backend to the related files: * configure.in: Like in GLib, set LT_CURRENT_MINUS_AGE for use when forming DLL name in some files. Set MS_LIB_AVAILABLE is lib.exe is available. Call AC_LIBTOOL_WIN32_DLL. Set PLATFORM_WIN32, OS_WIN32 and USE_WIN32 automake conditionals. Add win32 target, using pangowin32. Don't use the -export-symbols-regex option on Win32, we use .def files to list exported symbols. Check <winsock.h> (for gethostname() in gtkfilesel.c). Enclose nested AC_CHECK_* macros in brackets to prevent premature m4 expansion. * acconfig.h: Add HAVE_WINTAB. * gdk/Makefile.am: Add libgdk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gdk.def file. If MS_LIB_AVAILABLE, build MS import library. Install the import libraries. If HAVE_WINTAB, link with the Wintab library. * gtk/Makefile.am: Add libgtk-win32-1.3.la target and associated macros and rules. Use -no-undefined on Win32. Use gtk-win32.def file. Install import libraries.
2001-10-29 07:06:37 +00:00
--Tor Lillqvist <tml@iki.fi>