1 | @echo off
|
---|
2 | echo Configuring GNU Sed for DJGPP v2.x...
|
---|
3 |
|
---|
4 | Rem The SmallEnv tests protect against fixed and too small size
|
---|
5 | Rem of the environment in stock DOS shell.
|
---|
6 |
|
---|
7 | Rem Find out where the sources are.
|
---|
8 | set XSRC=.
|
---|
9 | if not "%XSRC%" == "." goto SmallEnv
|
---|
10 | if "%1" == "" goto InPlace
|
---|
11 | Rem Is the first parameter the source directory?
|
---|
12 | test -d %1
|
---|
13 | if errorlevel 1 goto InPlace
|
---|
14 | set XSRC=%1
|
---|
15 | if not "%XSRC%" == "%1" goto SmallEnv
|
---|
16 | shift
|
---|
17 | redir -e /dev/null update %XSRC%/configure.orig ./configure
|
---|
18 | if not exist configure update %XSRC%/configure ./configure
|
---|
19 |
|
---|
20 | :InPlace
|
---|
21 | Rem Update configuration files
|
---|
22 | echo Updating configuration scripts...
|
---|
23 | if not exist configure.orig update configure configure.orig
|
---|
24 | sed -f %XSRC%/djgpp/config.sed configure.orig > configure
|
---|
25 | if errorlevel 1 goto SedError
|
---|
26 |
|
---|
27 | Rem Make sure they have a config.site file
|
---|
28 | set CONFIG_SITE=%XSRC%/djgpp/config.site
|
---|
29 | if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv
|
---|
30 |
|
---|
31 | Rem Make sure 8.3-truncated file names do not clash with Makefile targets
|
---|
32 | if exist INSTALL ren INSTALL INSTALL.txt
|
---|
33 |
|
---|
34 | Rem Set HOSTNAME so it shows in config.status
|
---|
35 | if not "%HOSTNAME%" == "" goto hostdone
|
---|
36 | if "%windir%" == "" goto msdos
|
---|
37 | set OS=MS-Windows
|
---|
38 | if not "%OS%" == "MS-Windows" goto SmallEnv
|
---|
39 | goto haveos
|
---|
40 | :msdos
|
---|
41 | set OS=MS-DOS
|
---|
42 | if not "%OS%" == "MS-DOS" goto SmallEnv
|
---|
43 | :haveos
|
---|
44 | if not "%USERNAME%" == "" goto haveuname
|
---|
45 | if not "%USER%" == "" goto haveuser
|
---|
46 | echo No USERNAME and no USER found in the environment, using default values
|
---|
47 | set HOSTNAME=Unknown PC
|
---|
48 | if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv
|
---|
49 | :haveuser
|
---|
50 | set HOSTNAME=%USER%'s PC
|
---|
51 | if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv
|
---|
52 | goto userdone
|
---|
53 | :haveuname
|
---|
54 | set HOSTNAME=%USERNAME%'s PC
|
---|
55 | if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv
|
---|
56 | :userdone
|
---|
57 | set HOSTNAME=%HOSTNAME%, %OS%
|
---|
58 | if not "%HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv
|
---|
59 | :hostdone
|
---|
60 | set OS=
|
---|
61 |
|
---|
62 | Rem install-sh is required by the configure script but clashes with the
|
---|
63 | Rem various Makefile targets, so we MUST have it before the script runs
|
---|
64 | Rem and rename it afterwards
|
---|
65 | if not exist install-sh if exist install-sh.sh ren install-sh.sh install-sh
|
---|
66 | echo Running the ./configure script...
|
---|
67 | sh ./configure --srcdir:%XSRC% %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
68 | if errorlevel 1 goto CfgError
|
---|
69 | if not exist install-sh.sh if exist install-sh ren install-sh install-sh.sh
|
---|
70 | echo Done.
|
---|
71 | goto End
|
---|
72 |
|
---|
73 | :SedError
|
---|
74 | echo ./configure script editing failed!
|
---|
75 | goto End
|
---|
76 |
|
---|
77 | :CfgError
|
---|
78 | echo ./configure script exited abnormally!
|
---|
79 | goto End
|
---|
80 |
|
---|
81 | :SmallEnv
|
---|
82 | echo Your environment size is too small. Enlarge it and run me again.
|
---|
83 | echo Configuration NOT done!
|
---|
84 | :End
|
---|
85 | set XSRC=
|
---|