2 echo Configuring GNU libcharset for DJGPP v2.x...
3 Rem The SmallEnv tests protect against fixed and too small size
4 Rem of the environment in stock DOS shell.
6 Rem Find out where the sources are
8 if not "%XSRC%" == "." goto SmallEnv
9 if "%1" == "" goto InPlace
11 if not "%XSRC%" == "%1" goto SmallEnv
12 redir -e /dev/null update %XSRC%/configure.orig ./configure
14 if errorlevel 1 update %XSRC%/configure ./configure
17 Rem Update configuration files
18 echo Updating configuration scripts...
19 test -f ./configure.orig
20 if errorlevel 1 update ./configure ./configure.orig
21 sed -f %XSRC%/djgpp/config.sed ./configure.orig > configure
22 if errorlevel 1 goto SedError
24 Rem Make sure they have a config.site file
25 set CONFIG_SITE=%XSRC%/djgpp/config.site
26 if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv
28 Rem Make sure crucial file names are not munged by unpacking
29 test -f %XSRC%/config.h.in
30 if not errorlevel 1 mv -f %XSRC%/config.h.in %XSRC%/config.h-in
31 test -f %XSRC%/include/libcharset.h.in
32 if not errorlevel 1 mv -f %XSRC%/include/libcharset.h.in %XSRC%/include/libcharset.h-in
34 Rem Let libtool use _libs all the time.
35 test -f %XSRC%/autoconf/ltconfig.orig
36 if errorlevel 1 update %XSRC%/autoconf/ltconfig %XSRC%/autoconf/ltconfig.orig
37 sed "/objdir=/s|\.libs|_libs|" %XSRC%/autoconf/ltconfig > ltconfig.tmp
38 if errorlevel 1 goto SedError
39 update ltconfig.tmp %XSRC%/autoconf/ltconfig
42 Rem This is required because DOS/Windows are case-insensitive
43 Rem to file names, and "make install" will do nothing if Make
44 Rem finds a file called `install'.
45 if exist INSTALL mv -f INSTALL INSTALL.txt
47 Rem install-sh is required by the configure script but clashes with the
48 Rem various Makefile install-foo targets, so we MUST have it before the
49 Rem script runs and rename it afterwards
50 test -f %XSRC%/install-sh
51 if not errorlevel 1 goto NoRen0
52 test -f %XSRC%/install-sh.sh
53 if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh
56 Rem Set HOSTNAME so it shows in config.status
57 if not "%HOSTNAME%" == "" goto hostdone
58 if "%windir%" == "" goto msdos
60 if not "%OS%" == "MS-Windows" goto SmallEnv
64 if not "%OS%" == "MS-DOS" goto SmallEnv
66 if not "%USERNAME%" == "" goto haveuname
67 if not "%USER%" == "" goto haveuser
68 echo No USERNAME and no USER found in the environment, using default values
69 set HOSTNAME=Unknown PC
70 if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv
73 set HOSTNAME=%USER%'s PC
74 if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv
77 set HOSTNAME=%USERNAME%'s PC
78 if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv
80 set _HOSTNAME=%HOSTNAME%, %OS%
81 if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv
82 set HOSTNAME=%_HOSTNAME%
87 echo Running the ./configure script...
88 sh ./configure --src=%XSRC%
89 if errorlevel 1 goto CfgError
94 echo ./configure script editing failed!
98 echo ./configure script exited abnormally!
102 echo Your environment size is too small. Enlarge it and run me again.
103 echo Configuration NOT done!
106 test -f %XSRC%/install-sh.sh
107 if not errorlevel 1 goto NoRen1
108 test -f %XSRC%/install-sh
109 if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh