httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [PATCH] flood: Fixed floodenv.bat environment problem in
Date Tue, 04 Feb 2003 02:32:55 GMT
  Fixed floodenv.bat environment problem in

This submission fixes the floodenv.bat environment problem.  This problem
occurs when tries to set up variables for use by external
prorams using floodenv.bat.  For example, invokes MSDEV
like this:
  msdev flood.dsw /useenv /make ...
The invocation of floodenv.bat and MSDEV occur in independent
environments, so MSDEV does not inherit the environment variables set
by floodenv.bat.  For the build to complete, you need to generate and
invoke floodenv.bat before building with NMAKE and
For example:
  nmake -f floodenv.bat
  nmake -f

This patch fixes the problem by allowing to tell floodenv.bat
to set up the environment variables and optionally run some commands in
the new environment.  When we need to invoke an external program like
DevStudio, we tell floodenv.bat to execute the program so that it gets
a properly initialized environment.  The arguments to floodenv.bat
are optional, so you can still set up your environment using just

NOTE: This patch is based on the patch for building without OpenSSL.
I sent this patch in an e-mail titled:
  [PATCH] flood: Fixed Win32 build when not using OpenSSL

Below is a summary of the file changes.

  * Added macro CFG_FLOOD to consolidate all the places
    that evaluate:
      flood - Win32 $(LONG)
    They now just reference $(CFG_FLOOD).
  * Added commentary to our floodenv.bat target.
  * The floodenv.bat target no longer inserts an:
      @echo off
    at the top of the file.  We now suppress the output
    of each line with a leading "@" symbol.  We do so
    because we want the line invoking the optional
    external command to echo the command so we can tell
    what arguments and options are used.
  * The floodenv.bat target now also writes to "$@", which
    is "floodenv.bat".  The usage helps minimize the places
    that use "floodenv.bat", thereby making it easier to
    maintain if we need to change the name in the future.
  * Changed floodenv.bat so that when we specify optional
    arguments to it, then it will execute the commands.
    If you do not specify arguments, you get the old
    behavior---floodenv.bat sets up your environment
    and then exits.
  * Created new macros to represent the different build
    tools we use:
      MAKE_FLOOD:   Uses NMAKE to invoke flood.mak
                    (you need to generate flood.mak from within
      MSDEV_FLOOD:  Uses MSDEV to invoke the VC6 flood.dsp
                    using the flood.dsw.
  * Consolidated the build and clean targets with the new
    These macros consolidate the usage between the build and
    clean targets.  Several of the redundancy spread across
    multiple lines are now in macros, and their uses are
    simpler single lines.
  * Added .a and .y files to the clean target.  They are
    "generated" files from the "install" target.

---	Mon Feb 03 13:55:57 2003
+++	Mon Feb 03 17:56:40 2003
@@ -101,16 +101,31 @@
+CFG_FLOOD = flood - Win32 $(LONG)
+# Floodenv.bat sets up environment variables and will optionally
+# execute any command in the new environment.  If we're guaranteed we
+# ran on Windows NT and newer versions, then we can make use of:
+#   goto :EOF
+# instead of:
+#   goto :end
+# and
+#   %*
+# instead of:
+#   %1 ... %9
+# See "goto /?" and "call /?" for details.
-	echo @echo off>floodenv.bat
-	echo set SRCLIB=$(SRCLIB)>>floodenv.bat
-	echo set APRPATH=$(APRPATH)>>floodenv.bat
-	echo set APRUTILPATH=$(APRUTILPATH)>>floodenv.bat
-	echo set OPENSSLPATH=$(OPENSSLPATH)>>floodenv.bat
-	echo set REGEXPATH=$(REGEXPATH)>>floodenv.bat
+	echo @set SRCLIB=$(SRCLIB)>$@
+	echo @set APRPATH=$(APRPATH)>>$@
+	echo @set REGEXPATH=$(REGEXPATH)>>$@
 !IF "$(HAVE_SSL)" == "1"
-	echo set LINKSSL=libeay32.lib ssleay32.lib /libpath:"$(SSLBIN)">>floodenv.bat
+	echo @set LINKSSL=libeay32.lib ssleay32.lib /libpath:"$(SSLBIN)">>$@
+	echo @if "%%1" == "" goto :end>>$@
+	echo call %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9 1>>$@
+	echo :end>>$@
 regex.h: $(REGEXPATH)\pcreposix.h
 	copy "$(REGEXPATH)\pcreposix.h" regex.h < <<
@@ -146,41 +161,28 @@
-!IF EXIST("flood.mak")
-	-floodenv.bat
-	$(MAKE) $(MAKEOPT) -f flood.mak CFG="flood - Win32 $(LONG)" RECURSE=0 CLEAN
-	del config.h floodenv.bat regex.h
-build: config.h
-	floodenv.bat
-	$(MAKE) $(MAKEOPT) -f flood.mak CFG="flood - Win32 $(LONG)" RECURSE=0
+DEVENV_FLOOD = call floodenv.bat devenv flood.sln /useenv
+MAKE_FLOOD   = call floodenv.bat $(MAKE) $(MAKEOPT) -f flood.mak \
+               "CFG=$(CFG_FLOOD)" "RECURSE=0"
+MSDEV_FLOOD  = call floodenv.bat msdev flood.dsw /useenv /make "$(CFG_FLOOD)"
+clean: floodenv.bat
+!IF EXIST("flood.mak")
 !ELSEIF EXIST("flood.sln")
-	-floodenv.bat
-	devenv flood.sln /useenv /clean $(LONG) /project flood
-	del config.h floodenv.bat regex.h
-build: config.h
-	floodenv.bat
-	devenv flood.sln /useenv /build $(LONG) /project flood
+	$(DEVENV_FLOOD) /clean $(LONG) /project flood
-	-floodenv.bat
-	msdev flood.dsw /USEENV /MAKE \
-		"flood - Win32 $(LONG)" /CLEAN
-	del config.h floodenv.bat regex.h
+	$(MSDEV_FLOOD) /clean
+	del .a .y config.h floodenv.bat regex.h
 build: config.h
-	floodenv.bat
-	msdev flood.dsw /USEENV /MAKE \
-		"flood - Win32 $(LONG)" 
+!IF EXIST("flood.mak")
+!ELSEIF EXIST("flood.sln")
+	$(DEVENV_FLOOD) /build $(LONG) /project flood

View raw message