blob: ba9d1c66b5526b48af10abefe69e123a56fb2bdd (
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
Rem Copyright (C) 2000-2020 Free Software Foundation, Inc.
Rem
Rem This configure script is free software; the Free Software Foundation
Rem gives unlimited permission to copy, distribute and modify it.
@echo off
echo Configuring GNU Groff for DJGPP v2.x...
Rem The SmallEnv tests protect against fixed and too small size
Rem of the environment in stock DOS shell.
Rem Find out where the sources are
set XSRC=.
if not "%XSRC%" == "." goto SmallEnv
if "%1" == "" goto InPlace
set XSRC=%1
if not "%XSRC%" == "%1" goto SmallEnv
redir -e /dev/null update %XSRC%/configure.orig ./configure
if not exist configure update %XSRC%/configure ./configure
:InPlace
Rem Update configuration files
echo Updating configuration scripts...
if not exist configure.orig update configure configure.orig
sed -f %XSRC%/arch/djgpp/config.sed configure.orig > configure
if errorlevel 1 goto SedError
Rem Make sure they have a config.site file
set CONFIG_SITE=%XSRC%/arch/djgpp/config.site
if not "%CONFIG_SITE%" == "%XSRC%/arch/djgpp/config.site" goto SmallEnv
Rem This is required because DOS/Windows are case-insensitive
Rem to file names, and "make install" will do nothing if Make
Rem finds a file called 'install'.
if exist INSTALL ren INSTALL INSTALL.txt
Rem Set HOSTNAME so it shows in config.status
if not "%HOSTNAME%" == "" goto hostdone
if "%windir%" == "" goto msdos
set OS=MS-Windows
if not "%OS%" == "MS-Windows" goto SmallEnv
goto haveos
:msdos
set OS=MS-DOS
if not "%OS%" == "MS-DOS" goto SmallEnv
:haveos
if not "%USERNAME%" == "" goto haveuname
if not "%USER%" == "" goto haveuser
echo No USERNAME and no USER found in the environment, using default values
set HOSTNAME=Unknown PC
if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv
:haveuser
set HOSTNAME=%USER%'s PC
if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv
goto userdone
:haveuname
set HOSTNAME=%USERNAME%'s PC
if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv
:userdone
set _HOSTNAME=%HOSTNAME%, %OS%
if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv
set HOSTNAME=%_HOSTNAME%
:hostdone
set _HOSTNAME=
set OS=
Rem install-sh is required by the configure script but clashes with the
Rem various Makefile install-foo targets, so we MUST have it before the
Rem script runs and rename it afterwards
test -f install-sh
if not errorlevel 1 goto noren1
test -f install-sh.sh
if not errorlevel 1 mv -f install-sh.sh install-sh
:noren1
echo Running the ./configure script...
sh ./configure --src=%XSRC% --disable-nls --without-x
if errorlevel 1 goto CfgError
test -f install-sh.sh
if not errorlevel 1 goto noren2
test -f install-sh
if not errorlevel 1 mv -f install-sh install-sh.sh
:noren2
echo Done.
goto End
:SedError
echo ./configure script editing failed!
goto End
:CfgError
echo ./configure script exited abnormally!
goto End
:SmallEnv
echo Your environment size is too small. Enlarge it and run me again.
echo Configuration NOT done!
:End
set XSRC=
set CONFIG_SITE=
set HOSTNAME=
|