2 echo Configuring GNU Gettext for DJGPP v2.x...
\r
4 Rem The SmallEnv tests protect against fixed and too small size
\r
5 Rem of the environment in stock DOS shell.
\r
7 Rem Find out if NLS is wanted or not,
\r
8 Rem if dependency-tracking is wanted or not,
\r
9 Rem if caching is wanted or not
\r
10 Rem if static or shared libraries are wanted
\r
11 Rem and where the sources are.
\r
12 Rem We always default to NLS support,
\r
13 Rem no dependency tracking, static library
\r
14 Rem and to in place configuration.
\r
17 if not "%NLS%" == "enabled" goto SmallEnv
\r
19 if not "%CACHING%" == "enabled" goto SmallEnv
\r
20 set DEPENDENCY_TRACKING=disabled
\r
21 if not "%DEPENDENCY_TRACKING%" == "disabled" goto SmallEnv
\r
22 set LIBICONV_PREFIX=disabled
\r
23 if not "%LIBICONV_PREFIX%" == "disabled" goto SmallEnv
\r
24 set LIBINTL_PREFIX=disabled
\r
25 if not "%LIBINTL_PREFIX%" == "disabled" goto SmallEnv
\r
26 set STATIC_LIBRARY=enabled
\r
27 if not "%STATIC_LIBRARY%" == "enabled" goto SmallEnv
\r
29 if not "%XSRC%" == "." goto SmallEnv
\r
31 Rem Loop over all arguments.
\r
32 Rem Special arguments are: NLS, XSRC, CACHE, STATIC_LIBS, LIBICONV_PREFIX, LIBINTL_PREFIX and DEPS.
\r
33 Rem All other arguments are stored into ARGS.
\r
35 if "%1" == "nls" goto NextArgument
\r
36 if "%1" == "NLS" goto NextArgument
\r
37 if "%1" == "no-nls" goto NoNLS
\r
38 if "%1" == "no-NLS" goto NoNLS
\r
39 if "%1" == "NO-NLS" goto NoNLS
\r
42 if "%1" == "no-nls" set NLS=disabled
\r
43 if "%1" == "no-NLS" set NLS=disabled
\r
44 if "%1" == "NO-NLS" set NLS=disabled
\r
45 if not "%NLS%" == "disabled" goto SmallEnv
\r
48 if "%1" == "cache" goto NextArgument
\r
49 if "%1" == "CACHE" goto NextArgument
\r
50 if "%1" == "no-cache" goto NoCaching
\r
51 if "%1" == "no-CACHE" goto NoCaching
\r
52 if "%1" == "NO-CACHE" goto NoCaching
\r
53 goto DependencyOption
\r
55 if "%1" == "no-cache" set CACHING=disabled
\r
56 if "%1" == "no-CACHE" set CACHING=disabled
\r
57 if "%1" == "NO-CACHE" set CACHING=disabled
\r
58 if not "%CACHING%" == "disabled" goto SmallEnv
\r
61 if "%1" == "no-dep" goto NextArgument
\r
62 if "%1" == "no-DEP" goto NextArgument
\r
63 if "%1" == "NO-DEP" goto NextArgument
\r
64 if "%1" == "dep" goto DependecyTraking
\r
65 if "%1" == "DEP" goto DependecyTraking
\r
66 goto LibiconvPrefixOption
\r
68 if "%1" == "dep" set DEPENDENCY_TRACKING=enabled
\r
69 if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled
\r
70 if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv
\r
72 :LibiconvPrefixOption
\r
73 if "%1" == "no-libiconvprefix" goto NextArgument
\r
74 if "%1" == "no-LIBICONVPREFIX" goto NextArgument
\r
75 if "%1" == "NO-LIBICONVPREFIX" goto NextArgument
\r
76 if "%1" == "libiconvprefix" goto WithLibiconvPrefix
\r
77 if "%1" == "LIBICONVPREFIX" goto WithLibiconvPrefix
\r
78 goto LibintlPrefixOption
\r
80 if "%1" == "libiconvprefix" set LIBICONV_PREFIX=enabled
\r
81 if "%1" == "LIBICONVPREFIX" set LIBICONV_PREFIX=enabled
\r
82 if not "%LIBICONV_PREFIX%" == "enabled" goto SmallEnv
\r
84 :LibintlPrefixOption
\r
85 if "%1" == "no-libiconvprefix" goto NextArgument
\r
86 if "%1" == "no-LIBICONVPREFIX" goto NextArgument
\r
87 if "%1" == "NO-LIBICONVPREFIX" goto NextArgument
\r
88 if "%1" == "libintlprefix" goto _WithLibintlPrefix
\r
89 if "%1" == "LIBINTLPREFIX" goto _WithLibintlPrefix
\r
90 goto StaticLibraryOption
\r
92 if "%1" == "libintlprefix" set LIBINTL_PREFIX=enabled
\r
93 if "%1" == "LIBINTLPREFIX" set LIBINTL_PREFIX=enabled
\r
94 if not "%LIBINTL_PREFIX%" == "enabled" goto SmallEnv
\r
96 :StaticLibraryOption
\r
97 if "%1" == "static" goto NextArgument
\r
98 if "%1" == "STATIC" goto NextArgument
\r
99 if "%1" == "shared" goto SharedLibrary
\r
100 if "%1" == "SHARED" goto SharedLibrary
\r
103 if "%1" == "shared" set STATIC_LIBRARY=disabled
\r
104 if "%1" == "SHARED" set STATIC_LIBRARY=disabled
\r
105 if not "%STATIC_LIBRARY%" == "disabled" goto SmallEnv
\r
108 echo %1 | grep -q "/"
\r
109 if errorlevel 1 goto CollectArgument
\r
111 if not "%XSRC%" == "%1" goto SmallEnv
\r
114 set _ARGS=%ARGS% %1
\r
115 if not "%_ARGS%" == "%ARGS% %1" if not "%_ARGS%" == "%ARGS%%1" goto SmallEnv
\r
116 echo %_ARGS% | grep -q "[^ ]"
\r
117 if not errorlevel 0 set ARGS=%_ARGS%
\r
121 if not "%1" == "" goto ArgLoop
\r
123 Rem Create an arguments file for the configure script.
\r
124 echo --srcdir=%XSRC% > arguments
\r
125 if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> arguments
\r
126 if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> arguments
\r
127 if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> arguments
\r
128 if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> arguments
\r
129 if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> arguments
\r
130 if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> arguments
\r
131 if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> arguments
\r
132 if "%STATIC_LIBRARY%" == "enabled" echo --enable-static --disable-shared >> arguments
\r
133 if "%STATIC_LIBRARY%" == "disabled" echo --enable-shared --disable-static >> arguments
\r
134 if not "%ARGS%" == "" echo %ARGS% >> arguments
\r
137 set DEPENDENCY_TRACKING=
\r
138 set LIBICONV_PREFIX=
\r
139 set LIBINTL_PREFIX=
\r
140 set STATIC_LIBRARY=
\r
142 if "%XSRC%" == "." goto InPlace
\r
145 redir -e /dev/null update %XSRC%/configure.orig ./configure
\r
146 test -f ./configure
\r
147 if errorlevel 1 update %XSRC%/configure ./configure
\r
150 Rem Update configuration files
\r
151 echo Updating configuration scripts...
\r
152 test -f ./configure.orig
\r
153 if errorlevel 1 update configure configure.orig
\r
154 sed -f %XSRC%/djgpp/config.sed configure.orig > configure
\r
155 if errorlevel 1 goto SedError
\r
157 Rem Make sure they have a config.site file
\r
158 set CONFIG_SITE=%XSRC%/djgpp/config.site
\r
159 if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv
\r
161 Rem Make sure crucial file names are not munged by unpacking
\r
162 test -f %XSRC%/config.h.in
\r
163 if not errorlevel 1 mv -f %XSRC%/config.h.in %XSRC%/config.h-in
\r
164 test -f %XSRC%/configh.in
\r
165 if not errorlevel 1 mv -f %XSRC%/config.h.in %XSRC%/config.h-in
\r
166 test -f %XSRC%/config.h-in
\r
167 if errorlevel 1 mv -f %XSRC%/config.h %XSRC%/config.h-in
\r
168 test -f %XSRC%/po/Makefile.in.in
\r
169 if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in
\r
171 Rem While building the binaries in src/ subdir an intermediary
\r
172 Rem file called po-gram-gen2.h is generated from po-gram-gen.h.
\r
173 Rem Both resolve to the same 8.3 filename. po-gram-gen2.h will
\r
174 Rem be renamed to po-gram_gen2.h and src/po-lex.c must be fixed
\r
176 test -f %XSRC%/src/po-lex.orig
\r
177 if errorlevel 1 update %XSRC%/src/po-lex.c %XSRC%/src/po-lex.orig
\r
178 sed "s/po-gram-gen2.h/po-gram_gen2.h/g" %XSRC%/src/po-lex.orig > po-lex.tmp
\r
179 if errorlevel 1 goto SedError
\r
180 mv ./po-lex.tmp %XSRC%/src/po-lex.c
\r
182 Rem Starting with gettext-0.11 posix function unsetenv() is needed.
\r
183 Rem As long as djdev204 has not been released, we will provide
\r
184 Rem unsetenv.c from djdev204 CVS tree.
\r
185 test -f %XSRC%/lib/unsetenv.c
\r
186 if errorlevel 1 update %XSRC%/djgpp/unsetenv.c %XSRC%/lib/unsetenv.c
\r
188 Rem Starting with gettext-0.11 pw_gecos is needed.
\r
189 Rem As long as djdev204 has not been released, we will provide
\r
190 Rem getpwman.c and pwd.h (djpwd.h) from djdev204 CVS tree.
\r
191 test -f %XSRC%/lib/djpwd.h
\r
192 if errorlevel 1 update %XSRC%/djgpp/djpwd.h %XSRC%/lib/djpwd.h
\r
193 test -f %XSRC%/lib/getpwnam.c
\r
194 if errorlevel 1 update %XSRC%/djgpp/getpwnam.c %XSRC%/lib/getpwnam.c
\r
196 Rem src/msginit.c must use the distributed CVS tree pwd.h
\r
197 Rem instead of the system's one.
\r
198 test -f %XSRC%/src/msginit.orig
\r
199 if errorlevel 1 update %XSRC%/src/msginit.c %XSRC%/src/msginit.orig
\r
200 sed -f %XSRC%/djgpp/msginit.sed %XSRC%/src/msginit.orig > msginit.tmp
\r
201 if errorlevel 1 goto SedError
\r
202 mv ./msginit.tmp %XSRC%/src/msginit.c
\r
204 Rem POTFILES.in must be adjusted to reflect the changed names
\r
205 Rem according to fnchange.lst.
\r
206 test -f %XSRC%/po/POTFILES.orig
\r
207 if errorlevel 1 update %XSRC%/po/POTFILES.in %XSRC%/po/POTFILES.orig
\r
208 sed "s/format-librep/format_librep/;s/format-pascal/format_pascal/" %XSRC%/po/POTFILES.orig > POTFILES.tmp
\r
209 if errorlevel 1 goto SedError
\r
210 mv ./POTFILES.tmp %XSRC%/po/POTFILES.in
\r
212 Rem This is required because DOS/Windows are case-insensitive
\r
213 Rem to file names, and "make install" will do nothing if Make
\r
214 Rem finds a file called `install'.
\r
215 if exist INSTALL ren INSTALL INSTALL.txt
\r
217 Rem Set SHELL to a sane default or some configure tests stop working
\r
218 Rem if the package is configured across partitions.
\r
219 if not "%SHELL%" == "" goto HomeName
\r
221 if not "%SHELL%" == "/bin/sh" goto SmallEnv
\r
222 echo No SHELL found in the environment, using default value
\r
225 Rem Set HOME to a sane default so configure stops complaining.
\r
226 if not "%HOME%" == "" goto HostName
\r
227 set HOME=%XSRC%/djgpp
\r
228 if not "%HOME%" == "%XSRC%/djgpp" goto SmallEnv
\r
229 echo No HOME found in the environment, using default value
\r
232 Rem Set HOSTNAME so it shows in config.status
\r
233 if not "%HOSTNAME%" == "" goto hostdone
\r
234 if "%windir%" == "" goto msdos
\r
236 if not "%OS%" == "MS-Windows" goto SmallEnv
\r
240 if not "%OS%" == "MS-DOS" goto SmallEnv
\r
242 if not "%USERNAME%" == "" goto haveuname
\r
243 if not "%USER%" == "" goto haveuser
\r
244 echo No USERNAME and no USER found in the environment, using default values
\r
245 set HOSTNAME=Unknown PC
\r
246 if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv
\r
249 set HOSTNAME=%USER%'s PC
\r
250 if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv
\r
253 set HOSTNAME=%USERNAME%'s PC
\r
254 if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv
\r
256 set _HOSTNAME=%HOSTNAME%, %OS%
\r
257 if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv
\r
258 set HOSTNAME=%_HOSTNAME%
\r
263 Rem install-sh is required by the configure script but clashes with the
\r
264 Rem various Makefile install-foo targets, so we MUST have it before the
\r
265 Rem script runs and rename it afterwards
\r
266 test -f %XSRC%/install-sh
\r
267 if not errorlevel 1 goto NoRen0
\r
268 test -f %XSRC%/install-sh.sh
\r
269 if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh
\r
272 if "%NLS%" == "disabled" goto WithoutNLS
\r
275 Rem Recreate the files in the %XSRC%/po subdir with our ported tools.
\r
276 redir -e /dev/null rm %XSRC%/po/*.gmo
\r
277 redir -e /dev/null rm %XSRC%/po/gettext.pot
\r
278 redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c
\r
279 redir -e /dev/null rm %XSRC%/po/stamp-cat-id
\r
281 Rem Update the arguments file for the configure script.
\r
282 echo --enable-nls --with-included-gettext >> arguments
\r
283 goto ConfigurePackage
\r
286 Rem Update the arguments file for the configure script.
\r
287 echo --disable-nls >> arguments
\r
290 echo Running the ./configure script...
\r
291 sh ./configure @arguments
\r
292 if errorlevel 1 goto CfgError
\r
297 Rem DJGPP specific editing of test scripts.
\r
298 test -f %XSRC%/tests/stamp-test
\r
299 if not errorlevel 1 goto End
\r
300 if "%XSRC%" == "." goto NoDirChange
\r
301 cd | sed "s|:.*$|:|" > cd_BuildDir.bat
\r
302 cd | sed "s|^.:|cd |" >> cd_BuildDir.bat
\r
303 mv -f cd_BuildDir.bat %XSRC%/cd_BuildDir.bat
\r
304 echo %XSRC% | sed -e "s|^/dev/||" -e "s|/|:|" -e "s|:.*$|:|g" > cd_SrcDir.bat
\r
305 echo %XSRC% | sed -e "s|^/dev/||" -e "s|/|:/|" -e "s|^.*:|cd |" -e "s|^\.\.|cd &|" -e "s|/|\\|g" >> cd_SrcDir.bat
\r
307 call djgpp\edtests.bat
\r
308 call cd_BuildDir.bat
\r
309 rm -f cd_SrcDir.bat cd_BuildDir.bat %XSRC%/cd_BuildDir.bat
\r
312 call djgpp\edtests.bat
\r
316 echo ./configure script editing failed!
\r
320 echo ./configure script exited abnormally!
\r
324 echo Your environment size is too small. Enlarge it and run me again.
\r
325 echo Configuration NOT done!
\r
328 test -f %XSRC%/install-sh.sh
\r
329 if not errorlevel 1 goto NoRen1
\r
330 test -f %XSRC%/install-sh
\r
331 if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh
\r
333 if "%SHELL%" == "/bin/sh" set SHELL=
\r
334 if "%HOME%" == "%XSRC%/djgpp" set HOME=
\r
339 set DEPENDENCY_TRACKING=
\r