Add and update copyright messages.
[s-roff.git] / arch / djgpp / config.bat
blobc104ebc06a9ae81bda2a282699de8cf48878669b
1 Rem Copyright (C) 2000 Free Software Foundation, Inc.\r
2 Rem\r
3 Rem This configure script is free software; the Free Software Foundation\r
4 Rem gives unlimited permission to copy, distribute and modify it.\r
5 \r
6 @echo off\r
7 echo Configuring GNU Groff for DJGPP v2.x...\r
8 \r
9 Rem The SmallEnv tests protect against fixed and too small size\r
10 Rem of the environment in stock DOS shell.\r
12 Rem Find out where the sources are\r
13 set XSRC=.\r
14 if not "%XSRC%" == "." goto SmallEnv\r
15 if "%1" == "" goto InPlace\r
16 set XSRC=%1\r
17 if not "%XSRC%" == "%1" goto SmallEnv\r
18 redir -e /dev/null update %XSRC%/configure.orig ./configure\r
19 if not exist configure update %XSRC%/configure ./configure\r
21 :InPlace\r
22 Rem Update configuration files\r
23 echo Updating configuration scripts...\r
24 if not exist configure.orig update configure configure.orig\r
25 sed -f %XSRC%/arch/djgpp/config.sed configure.orig > configure\r
26 if errorlevel 1 goto SedError\r
28 Rem Make sure they have a config.site file\r
29 set CONFIG_SITE=%XSRC%/arch/djgpp/config.site\r
30 if not "%CONFIG_SITE%" == "%XSRC%/arch/djgpp/config.site" goto SmallEnv\r
32 Rem This is required because DOS/Windows are case-insensitive\r
33 Rem to file names, and "make install" will do nothing if Make\r
34 Rem finds a file called `install'.\r
35 if exist INSTALL ren INSTALL INSTALL.txt\r
37 Rem Set HOSTNAME so it shows in config.status\r
38 if not "%HOSTNAME%" == "" goto hostdone\r
39 if "%windir%" == "" goto msdos\r
40 set OS=MS-Windows\r
41 if not "%OS%" == "MS-Windows" goto SmallEnv\r
42 goto haveos\r
43 :msdos\r
44 set OS=MS-DOS\r
45 if not "%OS%" == "MS-DOS" goto SmallEnv\r
46 :haveos\r
47 if not "%USERNAME%" == "" goto haveuname\r
48 if not "%USER%" == "" goto haveuser\r
49 echo No USERNAME and no USER found in the environment, using default values\r
50 set HOSTNAME=Unknown PC\r
51 if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv\r
52 :haveuser\r
53 set HOSTNAME=%USER%'s PC\r
54 if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv\r
55 goto userdone\r
56 :haveuname\r
57 set HOSTNAME=%USERNAME%'s PC\r
58 if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv\r
59 :userdone\r
60 set _HOSTNAME=%HOSTNAME%, %OS%\r
61 if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv\r
62 set HOSTNAME=%_HOSTNAME%\r
63 :hostdone\r
64 set _HOSTNAME=\r
65 set OS=\r
67 Rem install-sh is required by the configure script but clashes with the\r
68 Rem various Makefile install-foo targets, so we MUST have it before the\r
69 Rem script runs and rename it afterwards\r
70 test -f install-sh\r
71 if not errorlevel 1 goto noren1\r
72 test -f install-sh.sh\r
73 if not errorlevel 1 mv -f install-sh.sh install-sh\r
74 :noren1\r
75 echo Running the ./configure script...\r
76 sh ./configure --src=%XSRC% --disable-nls --without-x\r
77 if errorlevel 1 goto CfgError\r
78 test -f install-sh.sh\r
79 if not errorlevel 1 goto noren2\r
80 test -f install-sh\r
81 if not errorlevel 1 mv -f install-sh install-sh.sh\r
82 :noren2\r
83 echo Done.\r
84 goto End\r
86 :SedError\r
87 echo ./configure script editing failed!\r
88 goto End\r
90 :CfgError\r
91 echo ./configure script exited abnormally!\r
92 goto End\r
94 :SmallEnv\r
95 echo Your environment size is too small.  Enlarge it and run me again.\r
96 echo Configuration NOT done!\r
97 :End\r
98 set XSRC=\r
99 set CONFIG_SITE=\r
100 set HOSTNAME=\r