Ethereal-dev: Re: [Ethereal-dev] configure and win32

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: 13 Jul 2001 14:40:37 -0400
aferen@xxxxxxxxxxxx writes:

>         I played around a bit and came up with a kludgy work around.
>         For reasons that are not clear to me echo didn't exhibit the
>         same line too long behavior (perhaps because it is a builtin
>         or something like that?) that I saw when trying to run python.
>         Since sh didn't have any problem with the long command line
>         either I just echoed the command out to a file and then ran
>         the command with sh.

	*Blink* the light bulb goes on.  In looking at the new
	config.nmake file in 0.8.19 I noticed PYTHON defined as
	C:\Python21\python.exe.  

        Sure enough cygwin ships a version of Python that doesn't
        work.  My hack made it work for register.c, but ncp2222.py
        produced an empty file.  That was what was causing my link
        error.

>         While I was messing with the make file I noticed a comment
>         stating that it would be nice if we could execute python iff
>         the variable PYTHON was defined.  Otherwise run the sh
>         version.
> 
> 	I added the ifdef for nmake.  That works, but the sh script
> 	fails.  I didn't investigate further.
>         
> 	Now I am also seeing a link error, but I'll investigate that
> 	more tomorrow.  (Windows only...)

	Attached is a new patch that just adds the ifdefs.

Index: Makefile.nmake
===================================================================
RCS file: /cvsroot/ethereal/Makefile.nmake,v
retrieving revision 1.126
diff -u -r1.126 Makefile.nmake
--- Makefile.nmake	2001/07/12 20:16:28	1.126
+++ Makefile.nmake	2001/07/13 18:30:33
@@ -363,10 +363,13 @@
 
 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 using python...
+	@$(PYTHON) make-reg-dotc.py . $(DISSECTOR_SRC) >mkreg.sh
+!ELSE
+	@echo using sh...
+	@sh make-reg-dotc . $(DISSECTOR_SRC) >mkreg.sh
+!ENDIF
 
 text2pcap-scanner.c : text2pcap-scanner.l
 	$(LEX) -otext2pcap-scanner.c text2pcap-scanner.l
-- 
-Andrew Feren
 Cetacean Networks, Inc.
 Portsmouth, NH