Ethereal-dev: [Ethereal-dev] patches for config.nmake and Makefile.nmake

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

From: aferen@xxxxxxxxxxxx (Andrew C. Feren)
Date: 24 Jan 2002 15:52:37 -0500
Attached are patches to, I hope, make the win32 build a bit more
forgiving of different environments. 

config.nmake:
changed POD2MAN=pod2man back to POD2MAN=$(PERL) $(UNIX_BIN)\pod2man

POD2MAN=pod2man only works by default in environments with a
pod2man.bat script.  The later should work with or without the
pod2man.bat.

Added the notion of TOP macro (requires cooperation from Makefiles) so
the wiretap DLL can be found in the current build directory rather
than an arbitrary hard coded path.

Used $(COMMONPROGRAMFILES)\gnu in the path to find iconv etc.  Since
this seems to be set by the system I figured it couldn't hurt to use
it.

Makefile.nmake:
There is currently a comment on the register.c target stating that it
would be nice to provide an ifdef to use python or sh.  I added one.
I also ifdefed out the ncp dissector since if python isn't defined
this couldn't be built either.

doc/Makefile.nmake:
added TOP=.. to make the PATH trick in config.nmake work.  Used $TOP
throughout the Makefile.  

TODO:
To be fully correct TOP=<relative path to top> needs to be to all
Makefile.nmake, but doc/Makefile.nmake is the only one that actually
requires this at the moment.  I can provide patches if desired.


Index: config.nmake
===================================================================
RCS file: /cvsroot/ethereal/config.nmake,v
retrieving revision 1.22
diff -u -r1.22 config.nmake
--- config.nmake	2002/01/04 21:20:16	1.22
+++ config.nmake	2002/01/24 20:13:59
@@ -18,15 +18,21 @@
 # Set PDB_FILE according to your VC++ version 
 PDB_FILE=vc*.pdb
 
-# Set path if you need to find some binary
-PATH=c:\cygnus\cygwin-b20\H-i586-cygwin32\bin;c:\python22;c:\ethereal\wiretap;c:\program files\common files\gnu;$(PATH)
-
+UNIX_BIN=c:\cygwin\bin
 PERL=perl
-POD2MAN=pod2man
-POD2HTML=pod2html
-PYTHON="C:/python22/python.exe"
+POD2MAN=$(PERL) $(UNIX_BIN)\pod2man
+POD2HTML=$(PERL) $(UNIX_BIN)\pod2html
+
+# Don't use the Cygwin python.  Last I checked cygwin python couldn't 
+# handle the line lengths that get passed in during the Ethereal build.
+PYTHON_BIN=c:\python22
+PYTHON=$(PYTHON_BIN)\python.exe
+
 LEX=flex
 YACC=bison
+
+# Set path if you need to find some binary or .dll
+PATH=$(UNIX_BIN);$(TOP)\wiretap;$(COMMONPROGRAMFILES)\gnu;$(PATH)
 
 # Set YACC_OPTS if cygnus bison can't find template file.
 #YACC_OPTS=-S t:\w32-ix86\cygnus\cygwin-b20\share\bison.simple 
Index: Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/Makefile.nmake,v
retrieving revision 1.165
diff -u -r1.165 Makefile.nmake
--- Makefile.nmake	2002/01/21 10:21:57	1.165
+++ Makefile.nmake	2002/01/24 20:14:04
@@ -3,6 +3,7 @@
 #
 # $Id: Makefile.nmake,v 1.165 2002/01/21 10:21:57 guy Exp $
 
+TOP=.
 include config.nmake
 include <win32.mak>
 
@@ -145,8 +146,10 @@
 	packet-mtp3.c \
 	packet-nbipx.c \
 	packet-nbns.c  \
+!IFDEF PYTHON
 	packet-ncp.c   \
 	packet-ncp2222.c   \
+!ENDIF
 	packet-ndmp.c \
 	packet-netbios.c \
 	packet-nfs.c   \
@@ -403,11 +406,13 @@
 	$(PYTHON) ncp2222.py > packet-ncp2222.c
 
 register.c: $(DISSECTOR_SRC)
-	@echo Making register.c
-	@$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
-#	How are ifdef's done in NMAKE? It would be nice
-#	to use python if PYTHON is defined, otherwise try to use shell.
-#	@sh make-reg-dotc . $(DISSECTOR_SRC)
+!IFDEF PYTHON
+	@echo Making register.c (using python)
+        @$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC)
+!ELSE
+	@echo Making register.c (using sh)
+        @sh make-reg-dotc register.c $(DISSECTOR_SRC)
+!ENDIF
 
 text2pcap-scanner.c : text2pcap-scanner.l
 	$(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
Index: Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/doc/Makefile.nmake,v
retrieving revision 1.7
diff -u -r1.7 Makefile.nmake
--- Makefile.nmake	2002/01/04 21:20:17	1.7
+++ Makefile.nmake	2002/01/24 20:14:09
@@ -24,89 +24,90 @@
 # We include dependencies on ../config.h in order to
 # capture when $(VERSION) changes.
 
-include ../config.nmake
+TOP=..
+include ..\config.nmake
 
 doc: ethereal.html tethereal.html editcap.html idl2eth.html \
 	mergecap.html text2pcap.html
 
-ethereal.1: ethereal.pod ../config.h
+ethereal.1: ethereal.pod $(TOP)\config.h
 	$(POD2MAN) ethereal.pod                     \
 	--center="The Ethereal Network Analyzer" \
 	--release=$(VERSION)			 \
 	> ethereal.1
 
-ethereal.html: ethereal.pod ../config.h
+ethereal.html: ethereal.pod $(TOP)\config.h
 	$(POD2HTML) ethereal.pod                     \
 	--title="The Ethereal Network Analyzer $(VERSION)" \
 	--noindex                                 \
 	> ethereal.html
 
-../tethereal.exe:
-	cd ..
+$(TOP)\tethereal.exe:
+	cd $(TOP)
 	$(MAKE) -f makefile.nmake tethereal.exe
 	cd doc
 
-ethereal.pod: ethereal.pod.template  ../tethereal.exe
-	..\\tethereal.exe -G | $(PERL) dfilter2pod.pl ethereal.pod.template > ethereal.pod
+ethereal.pod: ethereal.pod.template  $(TOP)\tethereal.exe
+	$(TOP)\tethereal.exe -G | $(PERL) dfilter2pod.pl ethereal.pod.template > ethereal.pod
 
-tethereal.1: tethereal.pod ../config.h
+tethereal.1: tethereal.pod $(TOP)\config.h
 	$(POD2MAN) tethereal.pod                     \
 	--center="The Ethereal Network Analyzer" \
 	--release=$(VERSION)			 \
 	> tethereal.1
 
-tethereal.html: tethereal.pod ../config.h
+tethereal.html: tethereal.pod $(TOP)\config.h
 	$(POD2HTML) tethereal.pod                     \
 	--title="The Ethereal Network Analyzer $(VERSION)" \
 	--noindex                                 \
 	> tethereal.html
 
-tethereal.pod: tethereal.pod.template  ../tethereal.exe
-	..\\tethereal.exe -G | $(PERL) dfilter2pod.pl tethereal.pod.template > tethereal.pod
+tethereal.pod: tethereal.pod.template  $(TOP)\tethereal.exe
+	$(TOP)\tethereal.exe -G | $(PERL) dfilter2pod.pl tethereal.pod.template > tethereal.pod
 
-editcap.1: editcap.pod ../config.h
+editcap.1: editcap.pod $(TOP)\config.h
 	$(POD2MAN) editcap.pod                     \
 	--center="The Ethereal Network Analyzer" \
 	--release=$(VERSION)			 \
 	> editcap.1
 
-editcap.html: editcap.pod ../config.h
+editcap.html: editcap.pod $(TOP)\config.h
 	$(POD2HTML) editcap.pod                     \
 	--title="The Ethereal Network Analyzer $(VERSION)" \
 	--noindex                                 \
 	> editcap.html
 
-mergecap.1: mergecap.pod ../config.h
+mergecap.1: mergecap.pod $(TOP)\config.h
 	$(POD2MAN) mergecap.pod                     \
 	--center="The Ethereal Network Analyzer" \
 	--release=$(VERSION)			 \
 	> mergecap.1
 
-mergecap.html: mergecap.pod ../config.h
+mergecap.html: mergecap.pod $(TOP)\config.h
 	$(POD2HTML) mergecap.pod                     \
 	--title="The Ethereal Network Analyzer $(VERSION)" \
 	--noindex                                 \
 	> mergecap.html
 
-idl2eth.1: idl2eth.pod ../config.h
+idl2eth.1: idl2eth.pod $(TOP)\config.h
 	$(POD2MAN) idl2eth.pod                       \
 	--center="The Ethereal Network Analyzer" \
 	--release=$(VERSION)			 \
 	> idl2eth.1
 
-idl2eth.html: idl2eth.pod ../config.h
+idl2eth.html: idl2eth.pod $(TOP)\config.h
 	$(POD2HTML) idl2eth.pod                     \
 	--title="The Ethereal Network Analyzer $(VERSION)" \
 	--noindex                                 \
 	> idl2eth.html
 
-text2pcap.1: text2pcap.pod ../config.h
+text2pcap.1: text2pcap.pod $(TOP)\config.h
 	$(POD2MAN) text2pcap.pod                     \
 	--center="The Ethereal Network Analyzer" \
 	--release=$(VERSION)			 \
 	> text2pcap.1
 
-text2pcap.html: text2pcap.pod ../config.h
+text2pcap.html: text2pcap.pod $(TOP)\config.h
 	$(POD2HTML) text2pcap.pod                     \
 	--title="The Ethereal Network Analyzer $(VERSION)" \
 	--noindex                                 \
-- 
-Andrew Feren
 Cetacean Networks, Inc.
 Portsmouth, NH