Fix some memory leaks, found with valgrind.
[make.git] / configure.bat
blobc5690a64c1cfc586ffc5656f609a1184f1c93e72
1 @echo off\r
2 rem Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,\r
3 rem 2004, 2005, 2006, 2007 Free Software Foundation, Inc.\r
4 rem This file is part of GNU Make.\r
5 rem\r
6 rem GNU Make is free software; you can redistribute it and/or modify it under\r
7 rem the terms of the GNU General Public License as published by the Free\r
8 rem Software Foundation; either version 3 of the License, or (at your option)\r
9 rem any later version.\r
10 rem\r
11 rem GNU Make is distributed in the hope that it will be useful, but WITHOUT\r
12 rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
13 rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for.\r
14 rem more details.\r
15 rem\r
16 rem You should have received a copy of the GNU General Public License along\r
17 rem with this program.  If not, see <http://www.gnu.org/licenses/>.\r
19 echo Configuring MAKE for DJGPP\r
21 rem The SmallEnv trick protects against too small environment block,\r
22 rem in which case the values will be truncated and the whole thing\r
23 rem goes awry.  COMMAND.COM will say "Out of environment space", but\r
24 rem many people don't care, so we force them to care by refusing to go.\r
26 rem Where is the srcdir?\r
27 set XSRC=.\r
28 if not "%XSRC%"=="." goto SmallEnv\r
29 if "%1%"=="" goto SrcDone\r
30 set XSRC=%1\r
31 if not "%XSRC%"=="%1" goto SmallEnv\r
33 :SrcDone\r
35 update %XSRC%/configh.dos ./config.h\r
37 rem Do they have Make?\r
38 redir -o junk.$$$ -eo make -n -f NUL\r
39 rem REDIR will return 1 if it cannot run Make.\r
40 rem If it can run Make, it will usually return 2,\r
41 rem but 0 is also OK with us.\r
42 if errorlevel 2 goto MakeOk\r
43 if not errorlevel 1 goto MakeOk\r
44 if exist junk.$$$ del junk.$$$\r
45 echo No Make program found--use DOSBUILD.BAT to build Make.\r
46 goto End\r
48 rem They do have Make.  Generate the Makefile.\r
50 :MakeOk\r
51 del junk.$$$\r
52 update %XSRC%/Makefile.DOS ./Makefile\r
53 echo Done.\r
54 if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"\r
55 goto End\r
57 :SmallEnv\r
58 echo Your environment is too small.  Please enlarge it and run me again.\r
60 :End\r
61 set XRSC=\r