summaryrefslogtreecommitdiff
path: root/configure.bat
blob: b5d54ebb4847e698a072efab298513b6b67963d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@echo off
rem Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
rem 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
rem This file is part of GNU Make.

rem GNU Make is free software; you can redistribute it and/or modify it under
rem the terms of the GNU General Public License as published by the Free
rem Software Foundation; either version 2, or (at your option) any later
rem version.

rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
rem FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
rem more details.

rem You should have received a copy of the GNU General Public License along
rem with GNU Make; see the file COPYING.  If not, write to the Free Software
rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

echo Configuring MAKE for DJGPP

rem The SmallEnv trick protects against too small environment block,
rem in which case the values will be truncated and the whole thing
rem goes awry.  COMMAND.COM will say "Out of environment space", but
rem many people don't care, so we force them to care by refusing to go.

rem Where is the srcdir?
set XSRC=.
if not "%XSRC%"=="." goto SmallEnv
if "%1%"=="" goto SrcDone
set XSRC=%1
if not "%XSRC%"=="%1" goto SmallEnv

:SrcDone

update %XSRC%/configh.dos ./config.h

rem Do they have Make?
redir -o junk.$$$ -eo make -n -f NUL
rem REDIR will return 1 if it cannot run Make.
rem If it can run Make, it will usually return 2,
rem but 0 is also OK with us.
if errorlevel 2 goto MakeOk
if not errorlevel 1 goto MakeOk
if exist junk.$$$ del junk.$$$
echo No Make program found--use DOSBUILD.BAT to build Make.
goto End

rem They do have Make.	Generate the Makefile.

:MakeOk
del junk.$$$
update %XSRC%/Makefile.DOS ./Makefile
echo Done.
if not "%XSRC%"=="." echo Invoke Make thus: "make srcdir=%XSRC%"
goto End

:SmallEnv
echo Your environment is too small.  Please enlarge it and run me again.

:End
set XRSC=