If we're going to use a handle for the data handle, we need to get a
[obnox/wireshark/wip.git] / Makefile.nmake
index eeba19e970b39abf1a78e8ab0d975eb9b59e7a62..84f49995eabf46b06bef5608e08a8d93876ae1f1 100644 (file)
@@ -16,32 +16,29 @@ LDFLAGS = /NOLOGO /INCREMENTAL:no /MACHINE:I386 $(LOCAL_LDFLAGS)
 CFLAGS=-DHAVE_CONFIG_H $(LOCAL_CFLAGS) $(GLIB_CFLAGS) /I. /Iwiretap \
        $(ZLIB_CFLAGS) /I$(PCAP_DIR)\include \
        /I$(NET_SNMP_DIR)\include /I$(NET_SNMP_DIR)\win32 \
-       $(ADNS_CFLAGS) $(PCRE_CFLAGS) -D_U_=""
+       $(ADNS_CFLAGS) $(PCRE_CFLAGS) -D_U_="" -D_NEED_VAR_IMPORT_
 
 CVARSDLL=-DWIN32 -DNULL=0 -D_MT -D_DLL
 
 .c.obj::
        $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
 
-PLATFORM_SRC = capture-wpcap.c
+PLATFORM_SRC = capture-wpcap.c capture_wpcap_packet.c
 
 include Makefile.common
 
-include epan\Makefile.common
-
-BUILT_SOURCES =        $(BUILT_SOURCES) \
-       svnversion.h
-
-DISSECTOR_SUPPORT_SRC = $(DISSECTOR_SUPPORT_SRC:../=)
-DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj)
-#DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_OBJECTS:../=)
-
 ethereal_OBJECTS = $(ethereal_SOURCES:.c=.obj)
 tethereal_OBJECTS = $(tethereal_SOURCES:.c=.obj)
 dftest_OBJECTS = $(dftest_SOURCES:.c=.obj)
 
+dumpcap_OBJECTS = $(dumpcap_SOURCES:.c=.obj)
+
 randpkt_OBJECTS = $(randpkt_SOURCES:.c=.obj)
 
+command_line_OBJECTS = 
+
+#setargv.obj
+
 EXTRA_OBJECTS = \
 #      snprintf.obj    \
 #      strerror.obj    \
@@ -50,7 +47,7 @@ EXTRA_OBJECTS = \
 
 ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        wsock32.lib user32.lib shell32.lib \
-       $(NET_SNMP_DIR)\win32\lib\netsnmp.lib \
+       $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
 !IFDEF ENABLE_LIBETHEREAL
        epan\libethereal.lib \
 !ELSE
@@ -66,7 +63,7 @@ ethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
 tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        wsock32.lib user32.lib \
        $(GLIB_LIBS) \
-       $(NET_SNMP_DIR)\win32\lib\netsnmp.lib \
+       $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
 !IFDEF ENABLE_LIBETHEREAL
        epan\libethereal.lib \
 !ELSE
@@ -78,7 +75,7 @@ tethereal_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        $(ZLIB_LIBS)
 !ENDIF
 
-capinfo_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
+capinfos_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        wsock32.lib user32.lib \
        $(GLIB_LIBS)
 
@@ -90,10 +87,14 @@ mergecap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        wsock32.lib user32.lib \
        $(GLIB_LIBS)
 
+dumpcap_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
+       wsock32.lib user32.lib \
+       $(GLIB_LIBS)
+
 dftest_LIBS=  wiretap\wiretap-$(WTAP_VERSION).lib \
        wsock32.lib user32.lib \
        $(GLIB_LIBS) \
-       $(NET_SNMP_DIR)\win32\lib\netsnmp.lib \
+       $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib \
 !IFDEF ENABLE_LIBETHEREAL
        epan\libethereal.lib \
 !ELSE
@@ -108,14 +109,14 @@ dftest_LIBS=  wiretap\wiretap-$(WTAP_VERSION).lib \
 randpkt_LIBS= wiretap\wiretap-$(WTAP_VERSION).lib \
        user32.lib \
        $(GLIB_LIBS) \
-       $(NET_SNMP_DIR)\win32\lib\netsnmp.lib
+       $(NET_SNMP_DIR)\win32\lib\release\netsnmp.lib
 
 EXECUTABLES=ethereal.exe ethereal-gtk2.exe tethereal.exe \
-       capinfo.exe editcap.exe mergecap.exe text2pcap.exe
+       capinfos.exe editcap.exe mergecap.exe text2pcap.exe randpkt.exe dumpcap.exe
 
 RESOURCES=image\ethereal.res image\libethereal.res image\tethereal.res \
-       image\capinfo.res image\editcap.res image\mergecap.res \
-       image\text2pcap.res image\wiretap.res
+       image\capinfos.res image\editcap.res image\mergecap.res \
+       image\text2pcap.res image\wiretap.res image\dumpcap.res
 
 all: config.h tools image wiretap epan $(EXECUTABLES) $(RESOURCES) doc
 
@@ -145,7 +146,7 @@ wiretap\wiretap-$(WTAP_VERSION).lib: wiretap
 !IFNDEF GTK1_DIR
 ethereal.exe   : 
 !ELSE
-ethereal.exe   : config.h svnversion.h $(ethereal_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
+ethereal.exe   : config.h svnversion.h $(ethereal_OBJECTS) $(command_line_OBJECTS) epan gtk image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk\libui.lib plugins
        @echo Linking $@
        $(LINK) @<<
                /OUT:ethereal.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK1_LIBS) gtk\libui.lib $(ethereal_OBJECTS) image\ethereal.res
@@ -155,53 +156,62 @@ ethereal.exe      : config.h svnversion.h $(ethereal_OBJECTS) epan gtk image\ethereal
 !IFNDEF GTK2_DIR
 ethereal-gtk2.exe      : 
 !ELSE
-ethereal-gtk2.exe      : config.h svnversion.h $(ethereal_OBJECTS) epan gtk2 image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk2.tmp\libui.lib plugins
+ethereal-gtk2.exe      : config.h svnversion.h $(ethereal_OBJECTS) $(command_line_OBJECTS) epan gtk2 image\ethereal.res wiretap\wiretap-$(WTAP_VERSION).lib gtk2.tmp\libui.lib plugins
        @echo Linking $@
        $(LINK) @<<
                /OUT:ethereal-gtk2.exe $(guiflags) $(guilibsdll) $(LDFLAGS) /SUBSYSTEM:windows $(ethereal_LIBS) $(GTK2_LIBS) gtk2.tmp\libui.lib $(ethereal_OBJECTS) image\ethereal.res
 <<
 !ENDIF
 
-tethereal.exe  : config.h svnversion.h $(tethereal_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
+tethereal.exe  : config.h svnversion.h $(tethereal_OBJECTS) $(command_line_OBJECTS) epan image\tethereal.res wiretap\wiretap-$(WTAP_VERSION).lib plugins
        @echo Linking $@
        $(LINK) @<<
-               /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) image\tethereal.res
+               /OUT:tethereal.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(tethereal_LIBS) $(tethereal_OBJECTS) $(command_line_OBJECTS) image\tethereal.res
 <<
 
-capinfo.exe    : config.h capinfo.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\capinfo.res
+capinfos.exe   : config.h capinfos.obj getopt.obj $(command_line_OBJECTS) wiretap\wiretap-$(WTAP_VERSION).lib image\capinfos.res
        @echo Linking $@
        $(LINK) @<<
-               /OUT:capinfo.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console capinfo.obj getopt.obj $(capinfo_LIBS) image\capinfo.res
+               /OUT:capinfos.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console capinfos.obj getopt.obj $(command_line_OBJECTS) $(capinfos_LIBS) image\capinfos.res
 <<
 
 editcap.exe    : config.h editcap.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\editcap.res
        @echo Linking $@
        $(LINK) @<<
-               /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(editcap_LIBS) image\editcap.res
+               /OUT:editcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console editcap.obj getopt.obj $(command_line_OBJECTS) $(editcap_LIBS) image\editcap.res
 <<
 
-mergecap.exe   : config.h svnversion.h mergecap.obj merge.obj getopt.obj wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
+mergecap.exe   : config.h svnversion.h mergecap.obj merge.obj getopt.obj $(command_line_OBJECTS) wiretap\wiretap-$(WTAP_VERSION).lib image\mergecap.res
        @echo Linking $@
        $(LINK) @<<
-               /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj getopt.obj $(mergecap_LIBS) image\mergecap.res
+               /OUT:mergecap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console mergecap.obj merge.obj getopt.obj $(command_line_OBJECTS) $(mergecap_LIBS) image\mergecap.res
 <<
 
-text2pcap.exe  : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
+text2pcap.exe  : config.h text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj $(command_line_OBJECTS) image\text2pcap.res
        @echo Linking $@
        $(LINK) @<<
-               /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj image\text2pcap.res
+               /OUT:text2pcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console text2pcap.obj text2pcap-scanner.obj getopt.obj strptime.obj $(command_line_OBJECTS) image\text2pcap.res
 <<
 
 dftest.exe     : $(dftest_OBJECTS) epan
+       @echo Linking $@
        $(LINK) @<<
                /OUT:dftest.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dftest_LIBS) $(dftest_OBJECTS)
 <<
 
-randpkt.exe    : $(randpkt_OBJECTS)
+randpkt.exe    : $(randpkt_OBJECTS) $(command_line_OBJECTS)
+       @echo Linking $@
+       $(LINK) @<<
+               /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS) $(command_line_OBJECTS)
+<<
+
+dumpcap.exe    : config.h svnversion.h $(dumpcap_OBJECTS) $(command_line_OBJECTS) mkstemp.obj wiretap\wiretap-$(WTAP_VERSION).lib image\dumpcap.res 
+       @echo Linking $@
        $(LINK) @<<
-               /OUT:randpkt.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(randpkt_LIBS) $(randpkt_OBJECTS)
+               /OUT:dumpcap.exe $(conflags) $(conlibsdll) $(LDFLAGS) /SUBSYSTEM:console $(dumpcap_LIBS) $(dumpcap_OBJECTS) $(command_line_OBJECTS) mkstemp.obj image\dumpcap.res
 <<
 
+
 config.h       : config.h.win32 config.nmake
        sed -e s/@VERSION@/$(VERSION)/ \
            -e "s/@HAVE_GNU_ADNS@/$(ADNS_CONFIG)/" \
@@ -229,9 +239,15 @@ svnversion.h:
 #
 # Build the short version of the authors file for the about dialog
 #
-AUTHORS-SHORT: AUTHORS make-authors-short.pl make-authors-short2.pl
-       $(PERL) make-authors-short.pl < AUTHORS > AUTHORS-SHORT
+AUTHORS-SHORT: AUTHORS make-authors-short.pl
+       $(PERL) perlnoutf.pl make-authors-short.pl < AUTHORS > AUTHORS-SHORT
 
+#
+# Build the short version of the authors file with formatting codes for
+# the man page
+#
+AUTHORS-SHORT-FORMAT: AUTHORS-SHORT make-authors-format.pl
+    $(PERL) perlnoutf.pl make-authors-format.pl < AUTHORS-SHORT > AUTHORS-SHORT-FORMAT
 
 #
 # Build "tethereal-tap-register.c", which contains a function 
@@ -262,11 +278,13 @@ gtk2_distclean:
 clean: gtk2_distclean
        rm -f $(ethereal_OBJECTS) $(tethereal_OBJECTS) $(EXTRA_OBJECTS) \
                $(EXECUTABLES) $(PDB_FILE) \
-               capinfo.obj editcap.obj mergecap.obj text2pcap.obj getopt.obj\
+               capinfos.obj editcap.obj mergecap.obj text2pcap.obj getopt.obj\
                text2pcap-scanner.obj text2pcap-scanner.c rdps.obj \
                rdps.pdb rdps.exe rdps.ilk config.h ps.c AUTHORS-SHORT \
-               dftest.obj dftest.exe randpkt.obj randpkt.ext doxygen.cfg \
-               $(RESOURCES)
+               AUTHORS-SHORT-FORMAT \
+               dftest.obj dftest.exe randpkt.obj randpkt.ext dumpcap.obj \
+               doxygen.cfg \
+               $(RESOURCES) libethereal.dll wiretap-$(WTAP_VERSION).dll
        cd wiretap
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
        cd ../gtk
@@ -287,11 +305,10 @@ clean: gtk2_distclean
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean
        cd ../..
 
-# Call distclean only, if you would like to remove ALL generated files.
-# Be sure to have python and perl installed to regenerate them.
+# "distclean" removes all files not part of the distribution.
+# It does not remove generated files that are part of the distribution.
 distclean: clean gtk2_distclean
-       rm -f $(BUILT_SOURCES) \
-               tethereal-tap-register.c 
+       rm -f config.h $(BUILT_SOURCES)
        cd wiretap
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
        cd ../gtk
@@ -312,6 +329,31 @@ distclean: clean gtk2_distclean
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean
        cd ../..
 
+# Make "maintainer-clean" only if you would like to remove ALL generated
+# files.
+# Be sure to have python and perl installed to regenerate them.
+maintainer-clean: distclean
+       rm -f $(GENERATED_FILES)
+       cd wiretap
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../gtk
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../epan
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../plugins
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../tools
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../image
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../doc
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../help
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../packaging/nsis
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean
+       cd ../..
+
 tools::
        cd tools
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
@@ -336,12 +378,15 @@ gtk:: help config.h svnversion.h AUTHORS-SHORT doxygen
 gtk2:: help config.h svnversion.h AUTHORS-SHORT
        if not exist gtk2.tmp mkdir gtk2.tmp
        cd gtk
-       cp --update --preserve Makefile.* *.c *.h ..\gtk2.tmp
+       set copycmd=/y
+       xcopy Makefile.* ..\gtk2.tmp /d
+       xcopy *.c        ..\gtk2.tmp /d
+       xcopy *.h        ..\gtk2.tmp /d
        cd ..\gtk2.tmp
        $(MAKE) /$(MAKEFLAGS) /f Makefile.nmake GTK_CFLAGS="$(GTK2_CFLAGS)" GTK_LIBS="$(GTK2_LIBS)" libui.lib
        cd ..
 
-epan:: $(DISSECTOR_SUPPORT_OBJECTS) $(EXTRA_OBJECTS) $(RESOURCES) $(BUILT_SOURCES) doxygen
+epan:: $(RESOURCES) $(BUILT_SOURCES) doxygen
        cd epan
        $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake
        cd ..
@@ -372,11 +417,25 @@ doxygen-run:
 
 doxygen: doxygen.cfg doxygen-run
 
+################################################################################
+# Prepare build environment by downloading and installing required libraries
+################################################################################
+
+# The required tools to build Ethereal.
+#
+# The 'find' tool is available both in \WINNT\System32 and in cygwin's /usr/bin.
+# We only need the cygwin version (for some shell scripts).
+# In the PATH, System32 is before cygwin's dir, so explicitly check for /usr/bin/find.
 REQUIRED_TOOLS=\
+       $(CC) \
+       $(LINK) \
+       nmake \
        $(SH)   \
        $(YACC) \
        $(LEX)  \
+       env     \
        grep    \
+       /usr/bin/find   \
        $(PERL) \
        $(PYTHON)       \
        sed     \
@@ -389,11 +448,21 @@ verify_tools:
 # Download and install all the required libraries into ETHEREAL_LIBS.
 # If you used this setup target before, consider doing a clean_setup.
 setup: verify_tools
-!IF "$(GTK2_INST_VERSION)" == "2.4"
+!IF "$(GTK2_INST_VERSION)" == "2.8"
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               glib gtk2.8/glib-2.8.4-20051212.zip
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
-               glib gtk2.4/glib-2.4.5-20040903.zip
+               glib gtk2.8/glib-dev-2.8.4-20051212.zip
+!ELSEIF "$(GTK2_INST_VERSION)" == "2.6"
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
-               glib gtk2.4/glib-dev-2.4.5.zip
+               glib gtk2.6/glib-2.6.6.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               glib gtk2.6/glib-dev-2.6.6.zip
+!ELSEIF "$(GTK2_INST_VERSION)" == "2.4"
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               glib gtk2.4/glib-2.4.7.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               glib gtk2.4/glib-dev-2.4.7.zip
 !ELSE
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
                glib glib-2.2.3-20040116.zip
@@ -412,30 +481,56 @@ setup: verify_tools
                gettext-runtime-0.13.1 gettext-runtime-0.13.1.zip
 !IFDEF NET_SNMP_DIR
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
-               . net-snmp-5.1.zip
+               . net-snmp-5.2.1.2.zip
 !ENDIF
 !IFDEF PCAP_DIR
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
-               . wpdpack_3_0.zip
+               . WpdPack_3_1.zip
 !ENDIF
 !IFDEF ADNS_DIR
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
-               . adns-1.0-win32-03.zip
+               . adns-1.0-win32-05.zip
 !ENDIF
 !IFDEF PCRE_DIR
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
-               . pcre-4.4.zip
+               pcre-6.4 pcre-6.4-bin.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               pcre-6.4 pcre-6.4-lib.zip
 !ENDIF
 !IFDEF ZLIB_DIR
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
-               zlib121-dll zlib121-dll.zip
+               zlib123-dll zlib123-dll.zip
 !ENDIF
 !IFDEF GTK2_DIR
-!IF "$(GTK2_INST_VERSION)" == "2.4"
+!IF "$(GTK2_INST_VERSION)" == "2.8"
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
-               gtk2 gtk2.4/gtk+-2.4.10-20041001.zip
+               gtk2 gtk2.8/gtk+-2.8.9.zip
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
-               gtk2 gtk2.4/gtk+-dev-2.4.10.zip
+               gtk2 gtk2.8/gtk+-dev-2.8.9.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.8/cairo-1.0.2.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.8/cairo-dev-1.0.2.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.8/atk-1.10.3.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.8/atk-dev-1.10.3.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.8/libpng-1.2.8-bin.zip
+!ELSEIF "$(GTK2_INST_VERSION)" == "2.6"
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.6/gtk+-2.6.9.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.6/gtk+-dev-2.6.9.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.6/atk-1.9.0.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.6/atk-dev-1.9.0.zip
+!ELSEIF "$(GTK2_INST_VERSION)" == "2.4"
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.4/gtk+-2.4.14.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.4/gtk+-dev-2.4.14.zip
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
                gtk2 gtk2.4/atk-1.6.0.zip
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
@@ -450,7 +545,17 @@ setup: verify_tools
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
                gtk2 gtk2/atk-dev-1.4.0.zip
 !ENDIF
-!IF "$(PANGO_INST_VERSION)" == "1.4"
+!IF "$(PANGO_INST_VERSION)" == "1.10"
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.8/pango-1.10.1.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.8/pango-dev-1.10.1.zip
+!ELSEIF "$(PANGO_INST_VERSION)" == "1.8"
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.6/pango-1.8.2.zip
+       @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
+               gtk2 gtk2.6/pango-dev-1.8.2.zip
+!ELSEIF "$(PANGO_INST_VERSION)" == "1.4"
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
                gtk2 gtk2.4/pango-1.4.1.zip
        @$(SH) tools\win32-setup.sh --download "$(ETHEREAL_LIBS)" \
@@ -476,12 +581,87 @@ clean_setup:
     rm -r -f $(ETHEREAL_LIBS)/gtk+
     rm -r -f $(ETHEREAL_LIBS)/libiconv-1.9.1.bin.woe32
     rm -r -f $(ETHEREAL_LIBS)/gettext-runtime-0.13.1
-    rm -r -f $(ETHEREAL_LIBS)/zlib121-dll
+    rm -r -f $(ETHEREAL_LIBS)/zlib123-dll
     rm -r -f $(ETHEREAL_LIBS)/gtk2
     rm -r -f $(ETHEREAL_LIBS)/gtk-wimp
 
-update_plugin_api: config.h
+################################################################################
+# Prepare the source tree for running (t)ethereal directly from there.
+################################################################################
+
+# "install-deps" will copy all dlls needed to run (t)ethereal
+# to the source tree, so you can run (t)ethereal directly from there.
+# Note that the gtk2 version of ethereal is called ethereal-gtk2.exe
+
+install-deps: clean-deps install-gtk1-deps install-gtk2-deps
        cd plugins
-       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake xyzzy
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake install-plugins
        cd ..
 
+install-gtk2-deps: install-required-deps
+!IFDEF GTK2_DIR
+       set copycmd=/y
+       xcopy $(GTK2_DIR)\bin\libgdk-win32-2.0-0.dll . /d
+       xcopy $(GTK2_DIR)\bin\libgdk_pixbuf-2.0-0.dll . /d
+       xcopy $(GTK2_DIR)\bin\libgtk-win32-2.0-0.dll . /d
+       xcopy $(GTK2_DIR)\bin\libatk-1.0-0.dll . /d
+       xcopy $(GTK2_DIR)\bin\libpango-1.0-0.dll . /d
+       xcopy $(GTK2_DIR)\bin\libpangowin32-1.0-0.dll . /d
+       mkdir etc
+       mkdir etc\gtk-2.0
+       mkdir etc\pango
+       mkdir lib
+       mkdir lib\gtk-2.0
+       mkdir lib\gtk-2.0\$(GTK2_LIB_DIR)
+       mkdir lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders
+       mkdir lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules
+       mkdir lib\pango
+       mkdir lib\pango\$(PANGO_LIB_DIR)
+       mkdir lib\pango\$(PANGO_LIB_DIR)\modules
+       xcopy $(GTK2_DIR)\etc\gtk-2.0\*.* etc\gtk-2.0 /d
+       xcopy $(GTK2_DIR)\etc\pango\pango.* etc\pango /d
+       xcopy $(GTK2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders\libpixbufloader-*.dll lib\gtk-2.0\$(GTK2_LIB_DIR)\loaders /d
+       xcopy $(GTK2_DIR)\lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules\im-*.dll lib\gtk-2.0\$(GTK2_LIB_DIR)\immodules /d
+       xcopy $(GTK2_DIR)\lib\pango\$(PANGO_LIB_DIR)\modules\pango-*.dll lib\pango\$(PANGO_LIB_DIR)\modules /d
+!IFDEF NEED_LIBPNG_DLL
+       xcopy $(GTK2_DIR)\bin\libpng13.dll . /d
+!ENDIF
+!ENDIF
+
+install-gtk1-deps: install-required-deps
+!IFDEF GTK1_DIR
+       set copycmd=/y
+       xcopy $(GTK1_DIR)\lib\libgtk-0.dll . /d
+       xcopy $(GTK1_DIR)\lib\libgdk-0.dll . /d
+!ENDIF
+
+install-required-deps:
+       set copycmd=/y
+       xcopy wiretap\wiretap-$(WTAP_VERSION).dll . /d
+!IFDEF ENABLE_LIBETHEREAL
+       xcopy epan\libethereal.dll . /d
+!ENDIF
+       xcopy $(GLIB_DIR)\bin\libglib-2.0-0.dll . /d
+       xcopy $(GLIB_DIR)\bin\libgmodule-2.0-0.dll . /d
+       xcopy $(GLIB_DIR)\bin\libgobject-2.0-0.dll . /d
+       xcopy $(ICONV_DIR)\bin\iconv.dll . /d
+       xcopy $(GETTEXT_DIR)\bin\intl.dll . /d
+!IFDEF ZLIB_DIR
+       xcopy $(ZLIB_DIR)\zlib1.dll . /d
+!ENDIF
+!IFDEF ADNS_DIR
+       xcopy $(ADNS_DIR)\adns_win32\LIB\adns_dll.dll . /d
+!ENDIF
+!IFDEF PCRE_DIR
+       xcopy $(PCRE_DIR)\bin\pcre.dll . /d
+!ENDIF
+
+clean-deps:
+       rm -f *.dll
+       rm -rf etc
+       rm -rf lib
+       cd plugins
+       $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean-deps
+       cd ..
+
+