Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] Compiling ethereal with glib2 and gtk1.3 on Win32

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Lars Roland <Lars.Roland@xxxxxxx>
Date: Mon, 21 Jul 2003 17:36:50 +0200
Hello Gerald,

attached patches allow you to build ethereal with glib2 and gtk1 on Win32 using the libraries from http://www.gimp.org/~tml/gimp/win32/downloads.html
See also http://www.ethereal.com/lists/ethereal-dev/200306/msg00130.html

The combination of using glib2 and newer gtk1.3 library improves stability of ethereal, fixes a GDI-resource leak and supports 8-bit colour display mode.

I think, it would be good to build official ethereal-release with them. There will be no change in the look of the gui, because this is still gtk1.

Extract both developement packages
http://www.gimp.org/~tml/gimp/win32/glib-dev-2.2.1.zip
http://www.gimp.org/~tml/gimp/win32/gtk+-dev-1.3.0-20030115.zip
into the same directory (preserve directory structure). This directory will be GTK_DIR and GLIB_DIR in config.nmake .

For runtime and for nsis-packaging you need following:

From http://www.gimp.org/~tml/gimp/win32/gtk+-1.3.0-20030216.zip
the new gtk-libraries libgtk-0.dll and libgdk-0.dll .

From http://www.gimp.org/~tml/gimp/win32/glib-2.2.1.zip
libglib-2.0-0.dll , libgmodule-2.0-0.dll and libgobject-2.0-0.dll

http://www.gimp.org/~tml/gimp/win32/libintl-0.10.40-tml-20020904.zip contains libintl-1.dll.

From http://ftp.gnu.org/gnu/libiconv/libiconv-1.9.1.bin.woe32.zip
iconv.dll

Best regards,

Lars Roland
Index: ethereal/packaging/nsis/Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/packaging/nsis/Makefile.nmake,v
retrieving revision 1.18
diff -u -r1.18 Makefile.nmake
--- ethereal/packaging/nsis/Makefile.nmake	11 Jun 2003 09:17:01 -0000	1.18
+++ ethereal/packaging/nsis/Makefile.nmake	13 Jun 2003 20:32:15 -0000
@@ -32,10 +32,17 @@
 	../../plugins/pcli/pcli.dll \
 	../../plugins/rtnet/rtnet.dll
 
-DELIVERABLES=$(EXE) $(DLL) $(DOC) $(GPL) $(PLUGINS) 
+DELIVERABLES=$(EXE) $(DLL) $(DOC) $(GPL) $(PLUGINS)
 
 ethereal-setup-$(VERSION).exe : ethereal.nsi $(DELIVERABLES)
-	$(MAKENSIS) /DVERSION=$(VERSION) /DWTAP_VERSION=$(WTAP_VERSION) /DCOMMON_FILES_GNU=$(COMMON_FILES_GNU) /DNET_SNMP_DIR=$(NET_SNMP_DIR) ethereal.nsi
+	$(MAKENSIS) \
+!IF "$(GTK_VERSION)" == "2.0"
+	/DGTK2 \
+!ENDIF
+!IF "$(GLIB_VERSION)" == "2.0"
+	/DGLIB2 \
+!ENDIF
+	/DVERSION=$(VERSION) /DWTAP_VERSION=$(WTAP_VERSION) /DCOMMON_FILES_GNU=$(COMMON_FILES_GNU) /DNET_SNMP_DIR=$(NET_SNMP_DIR) ethereal.nsi
 
 clean:
 	rm -f ethereal-setup-$(VERSION).exe
Index: ethereal/packaging/nsis/ethereal.nsi
===================================================================
RCS file: /cvsroot/ethereal/packaging/nsis/ethereal.nsi,v
retrieving revision 1.16
diff -u -r1.16 ethereal.nsi
--- ethereal/packaging/nsis/ethereal.nsi	11 Jun 2003 09:17:01 -0000	1.16
+++ ethereal/packaging/nsis/ethereal.nsi	13 Jun 2003 20:32:15 -0000
@@ -71,10 +71,18 @@
 
 SetOutPath $INSTDIR
 File "..\..\wiretap\wiretap-${WTAP_VERSION}.dll"
+!ifndef GLIB2
 File "${COMMON_FILES_GNU}\iconv-1.3.dll"
 File "${COMMON_FILES_GNU}\glib-1.3.dll"
 File "${COMMON_FILES_GNU}\gmodule-1.3.dll"
 File "${COMMON_FILES_GNU}\gnu-intl.dll"
+!else
+File "${COMMON_FILES_GNU}\iconv.dll"
+File "${COMMON_FILES_GNU}\libglib-2.0-0.dll"
+File "${COMMON_FILES_GNU}\libgmodule-2.0-0.dll"
+File "${COMMON_FILES_GNU}\libgobject-2.0-0.dll"
+File "${COMMON_FILES_GNU}\libintl-1.dll"
+!endif
 File "${COMMON_FILES_GNU}\zlib.dll"
 File "${COMMON_FILES_GNU}\adns_dll.dll"
 File "..\..\FAQ"
@@ -105,8 +113,33 @@
 SetOutPath $INSTDIR
 File "..\..\ethereal.exe"
 File "..\..\doc\ethereal.html"
+!ifndef GTK2
+!ifndef GLIB2
 File "${COMMON_FILES_GNU}\gtk-1.3.dll"
 File "${COMMON_FILES_GNU}\gdk-1.3.dll"
+!else
+File "${COMMON_FILES_GNU}\libgtk-0.dll"
+File "${COMMON_FILES_GNU}\libgdk-0.dll"
+!endif
+!else
+File "${COMMON_FILES_GNU}\libgdk-win32-2.0-0.dll"
+File "${COMMON_FILES_GNU}\libgdk_pixbuf-2.0-0.dll"
+File "${COMMON_FILES_GNU}\libgtk-win32-2.0-0.dll"
+File "${COMMON_FILES_GNU}\libatk-1.0-0.dll"
+File "${COMMON_FILES_GNU}\libpango-1.0-0.dll"
+File "${COMMON_FILES_GNU}\libpangowin32-1.0-0.dll"
+SetOutPath $INSTDIR\etc\gtk-2.0
+File "${COMMON_FILES_GNU}\etc\gtk-2.0\gdk-pixbuf.loaders"
+File "${COMMON_FILES_GNU}\etc\gtk-2.0\gtk.immodules"
+SetOutPath $INSTDIR\etc\pango
+File "${COMMON_FILES_GNU}\etc\pango\pango.modules"
+SetOutPath $INSTDIR\lib\gtk-2.0\2.2.0\loaders
+File "${COMMON_FILES_GNU}\lib\gtk-2.0\2.2.0\loaders\libpixbufloader-*.dll"
+SetOutPath $INSTDIR\lib\gtk-2.0\2.2.0\immodules
+File "${COMMON_FILES_GNU}\lib\gtk-2.0\2.2.0\immodules\im-*.dll"
+SetOutPath $INSTDIR\lib\pango\1.2.0\modules
+File "${COMMON_FILES_GNU}\lib\pango\1.2.0\modules\pango-*.dll"
+!endif
 SectionEnd
 
 Section "Tethereal"
@@ -191,6 +224,13 @@
 ;
 SetShellVarContext all
 
+!ifdef GTK2
+Delete "$INSTDIR\etc\gtk-2.0\*.*"
+Delete "$INSTDIR\etc\pango\*.*"
+Delete "$INSTDIR\lib\gtk-2.0\2.2.0\loaders\*.*"
+Delete "$INSTDIR\lib\gtk-2.0\2.2.0\immodules\*.*"
+Delete "$INSTDIR\lib\pango\1.2.0\modules\*.*"
+!endif
 Delete "$INSTDIR\plugins\${VERSION}\*.*"
 Delete "$INSTDIR\plugins\*.*"
 Delete "$INSTDIR\diameter\*.*"
@@ -200,6 +240,19 @@
 Delete "$SMPROGRAMS\Ethereal\*.*"
 Delete "$DESKTOP\Ethereal.lnk"
 
+!ifdef GTK2
+RMDir "$INSTDIR\etc\gtk-2.0"
+RMDir "$INSTDIR\etc\pango"
+RMDir "$INSTDIR\etc"
+RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\loaders"
+RMDir "$INSTDIR\lib\gtk-2.0\2.2.0\immodules"
+RMDir "$INSTDIR\lib\gtk-2.0\2.2.0"
+RMDir "$INSTDIR\lib\gtk-2.0"
+RMDir "$INSTDIR\lib\pango\1.2.0\modules"
+RMDir "$INSTDIR\lib\pango\1.2.0"
+RMDir "$INSTDIR\lib\pango"
+RMDir "$INSTDIR\lib"
+!endif
 RMDir "$SMPROGRAMS\Ethereal"
 RMDir "$INSTDIR\plugins\${VERSION}"
 RMDir "$INSTDIR\plugins"
Index: ethereal/config.nmake
===================================================================
RCS file: /cvsroot/ethereal/config.nmake,v
retrieving revision 1.53
diff -u -r1.53 config.nmake
--- ethereal/config.nmake	26 Jun 2003 08:41:33 -0000	1.53
+++ ethereal/config.nmake	21 Jul 2003 14:42:55 -0000
@@ -16,7 +16,7 @@
 WTAP_VERSION=0.0
 
 GTK_VERSION=1.3
-GLIB_VERSION=1.3
+GLIB_VERSION=2.0
 
 #
 # This presumes that GLib 1.3 developer's packages put header files and
@@ -92,12 +92,24 @@
 	$(GLIB_DIR)\lib\gmodule-$(GLIB_VERSION).lib \
 	$(GLIB_DIR)\lib\gobject-$(GLIB_VERSION).lib
 !ENDIF
+
 !IF "$(GTK_VERSION)" == "1.3"
+!IF "$(GLIB_VERSION)" == "1.3"
+# GTK 1.3 with GLIB 1.3
 GTK_CFLAGS=$(GLIB_CFLAGS) /I$(GTK_DIR) /I$(GTK_DIR)\gdk
 GTK_LIBS=$(GTK_DIR)\gtk\gtk-$(GTK_VERSION).lib \
 	$(GTK_DIR)\gdk\gdk-$(GTK_VERSION).lib \
 	$(GLIB_LIBS)
 !ELSE
+# GTK 1.3 with GLIB 2.0
+GTK_CFLAGS=$(GLIB_CFLAGS) /I$(GTK_DIR)\include /I$(GTK_DIR)\include\gdk \
+	/I$(GTK_DIR)\lib\gtk+\include
+GTK_LIBS=$(GTK_DIR)\lib\gtk.lib \
+	$(GTK_DIR)\lib\gdk.lib \
+	$(GLIB_LIBS)
+!ENDIF
+!ELSE
+# GTK 2.0
 GTK_CFLAGS=$(GLIB_CFLAGS) /I$(GTK_DIR)\include\gtk-$(GTK_VERSION) \
 	/I$(GTK_DIR)\lib\gtk-$(GTK_VERSION)\include \
 	/I$(GTK_DIR)\include\atk-1.0 \