2 echo Configuring GNU libiconv 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
16 if errorlevel 1 md libcharset
17 redir -e /dev/null update %XSRC%/libcharset/configure.orig ./libcharset/configure
18 test -f ./libcharset/configure
19 if errorlevel 1 update %XSRC%/libcharset/configure ./libcharset/configure
22 Rem Update configuration files
23 echo Updating configuration scripts...
24 test -f ./configure.orig
25 if errorlevel 1 update ./configure ./configure.orig
26 sed -f %XSRC%/djgpp/config.sed ./configure.orig > configure
27 if errorlevel 1 goto SedError
28 test -f ./libcharset/configure.orig
29 if errorlevel 1 update ./libcharset/configure ./libcharset/configure.orig
30 sed -f %XSRC%/djgpp/config.sed ./libcharset/configure.orig > configure.tmp
31 if errorlevel 1 goto SedError
32 Rem The following is needed because the toplevel configure script calls the
33 Rem %XSRC%/libcharset/configure script instead of ./libcharset/configure.
34 test -f %XSRC%/libcharset/configure.orig
35 if errorlevel 1 update %XSRC%/libcharset/configure %XSRC%/libcharset/configure.orig
36 update configure.tmp %XSRC%/libcharset/configure
39 Rem Make sure they have a config.site file
40 set CONFIG_SITE=%XSRC%/djgpp/config.site
41 if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv
43 Rem Make sure crucial file names are not munged by unpacking
44 test -f %XSRC%/config.h.in
45 if not errorlevel 1 mv -f %XSRC%/config.h.in %XSRC%/config.h-in
46 test -f %XSRC%/lib/config.h.in
47 if not errorlevel 1 mv -f %XSRC%/lib/config.h.in %XSRC%/lib/config.h-in
48 test -f %XSRC%/libcharset/config.h.in
49 if not errorlevel 1 mv -f %XSRC%/libcharset/config.h.in %XSRC%/libcharset/config.h-in
50 test -f %XSRC%/libcharset/include/libcharset.h.in
51 if not errorlevel 1 mv -f %XSRC%/libcharset/include/libcharset.h.in %XSRC%/libcharset/include/libcharset.h-in
52 test -f %XSRC%/include/iconv.h.in
53 if not errorlevel 1 mv -f %XSRC%/include/iconv.h.in %XSRC%/include/iconv.h-in
55 Rem All fixes needed to get the package configured, compiled and tested.
56 Rem 1: Change the stateless-check script so it knowns about the
58 Rem 2: Ditto for Makefile.in
59 Rem 3: Ditto for source files.
60 Rem 4: Change the files contained in the tests subdirectory from
61 Rem UNIX-style EOL into DOS-style EOL so the testsuit works.
63 test -f %XSRC%/stamp-djgppfixes
64 if not errorlevel 1 goto TestsuitFixed
65 Rem Fix the Makefile.ins.
66 test -f %XSRC%/lib/Makefile.orig
67 if errorlevel 1 update %XSRC%/lib/Makefile.in %XSRC%/lib/Makefile.orig
68 sed -f %XSRC%/djgpp/makefile.sed %XSRC%/lib/Makefile.in > Makefile.tmp
69 if errorlevel 1 goto SedError
70 update Makefile.tmp %XSRC%/lib/Makefile.in
72 test -f %XSRC%/tests/Makefile.orig
73 if errorlevel 1 update %XSRC%/tests/Makefile.in %XSRC%/tests/Makefile.orig
74 sed -f %XSRC%/djgpp/makefile.sed %XSRC%/tests/Makefile.in > Makefile.tmp
75 if errorlevel 1 goto SedError
76 update Makefile.tmp %XSRC%/tests/Makefile.in
79 Rem Fix the source files.
80 test -f %XSRC%/lib/iconv.orig
81 if errorlevel 1 update %XSRC%/lib/iconv.c %XSRC%/lib/iconv.orig
82 sed -f %XSRC%/djgpp/sources.sed %XSRC%/lib/iconv.c > iconv.tmp
83 if errorlevel 1 goto SedError
84 update iconv.tmp %XSRC%/lib/iconv.c
86 test -f %XSRC%/lib/converters.orig
87 if errorlevel 1 update %XSRC%/lib/converters.h %XSRC%/lib/converters.orig
88 sed -f %XSRC%/djgpp/sources.sed %XSRC%/lib/converters.h > converters.tmp
89 if errorlevel 1 goto SedError
90 update converters.tmp %XSRC%/lib/converters.h
92 test -f %XSRC%/lib/cns/11643.orig
93 if errorlevel 1 update %XSRC%/lib/cns/11643.h %XSRC%/lib/cns/11643.orig
94 sed -f %XSRC%/djgpp/sources.sed %XSRC%/lib/cns/11643.h > 11643.tmp
95 if errorlevel 1 goto SedError
96 update 11643.tmp %XSRC%/lib/cns/11643.h
98 test -f %XSRC%/lib/iso/ir165.orig
99 if errorlevel 1 update %XSRC%/lib/iso/ir165.h %XSRC%/lib/iso/ir165.orig
100 sed -f %XSRC%/djgpp/sources.sed %XSRC%/lib/iso/ir165.h > ir165.tmp
101 if errorlevel 1 goto SedError
102 update ir165.tmp %XSRC%/lib/iso/ir165.h
105 Rem Let libtool use _libs all the time.
106 test -f %XSRC%/autoconf/ltconfig.orig
107 if errorlevel 1 update %XSRC%/autoconf/ltconfig %XSRC%/autoconf/ltconfig.orig
108 sed "/objdir=/s|\.libs|_libs|" %XSRC%/autoconf/ltconfig > ltconfig.tmp
109 if errorlevel 1 goto SedError
110 update ltconfig.tmp %XSRC%/autoconf/ltconfig
111 test -f %XSRC%/libcharset/autoconf/ltconfig.orig
112 if errorlevel 1 update %XSRC%/libcharset/autoconf/ltconfig %XSRC%/libcharset/autoconf/ltconfig.orig
113 update ltconfig.tmp %XSRC%/libcharset/autoconf/ltconfig
116 Rem Change file's NL to CRLF.
117 utod %XSRC%/tests/*.txt
118 utod %XSRC%/tests/GEORGIAN/*.txt
119 utod %XSRC%/tests/ISO/*.txt
120 utod %XSRC%/tests/MAC/*.txt
122 Rem Fix the test scripts.
123 if "%XSRC%" == "." goto NoDirChange
124 cd | sed "s|:.*$|:|" > cd_BuildDir.bat
125 cd | sed "s|^.:|cd |" >> cd_BuildDir.bat
126 mv -f cd_BuildDir.bat %XSRC%/cd_BuildDir.bat
127 echo %XSRC% | sed -e "s|^/dev/||" -e "s|/|:|" -e "s|:.*$|:|g" > cd_SrcDir.bat
128 echo %XSRC% | sed -e "s|^/dev/||" -e "s|/|:/|" -e "s|^.*:|cd |" -e "s|^\.\.|cd &|" -e "s|/|\\|g" >> cd_SrcDir.bat
130 call djgpp\edtest.bat
132 rm -f cd_SrcDir.bat cd_BuildDir.bat %XSRC%/cd_BuildDir.bat
135 call djgpp\edtest.bat
137 touch %XSRC%/stamp-djgppfixes
139 Rem This is required because DOS/Windows are case-insensitive
140 Rem to file names, and "make install" will do nothing if Make
141 Rem finds a file called `install'.
142 if exist INSTALL mv -f INSTALL INSTALL.txt
144 Rem install-sh is required by the configure script but clashes with the
145 Rem various Makefile install-foo targets, so we MUST have it before the
146 Rem script runs and rename it afterwards
147 test -f %XSRC%/install-sh
148 if not errorlevel 1 goto NoRen0
149 test -f %XSRC%/install-sh.sh
150 if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh
153 Rem Set HOSTNAME so it shows in config.status
154 if not "%HOSTNAME%" == "" goto hostdone
155 if "%windir%" == "" goto msdos
157 if not "%OS%" == "MS-Windows" goto SmallEnv
161 if not "%OS%" == "MS-DOS" goto SmallEnv
163 if not "%USERNAME%" == "" goto haveuname
164 if not "%USER%" == "" goto haveuser
165 echo No USERNAME and no USER found in the environment, using default values
166 set HOSTNAME=Unknown PC
167 if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv
170 set HOSTNAME=%USER%'s PC
171 if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv
174 set HOSTNAME=%USERNAME%'s PC
175 if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv
177 set _HOSTNAME=%HOSTNAME%, %OS%
178 if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv
179 set HOSTNAME=%_HOSTNAME%
184 echo Running the ./configure script...
185 sh ./configure --src=%XSRC%
186 if errorlevel 1 goto CfgError
191 echo ./configure script editing failed!
195 echo ./configure script exited abnormally!
199 echo Your environment size is too small. Enlarge it and run me again.
200 echo Configuration NOT done!
203 test -f %XSRC%/install-sh.sh
204 if not errorlevel 1 goto NoRen1
205 test -f %XSRC%/install-sh
206 if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh