source: trunk/third/sed/djgpp/config.bat @ 17271

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