summaryrefslogtreecommitdiffstats
path: root/djgpp/config.bat
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2002-02-15 17:37:28 +0000
committerBruno Haible <bruno@clisp.org>2009-06-22 01:22:56 +0200
commitb18664fbf3a20ddc8cdedfe74257271065be2ed1 (patch)
tree5e1ee3a20a49f862de5cd581593259aae99d3f1c /djgpp/config.bat
parentcfa1baa6e8e638f201001f8b97f88bb664485753 (diff)
downloadexternal_gettext-b18664fbf3a20ddc8cdedfe74257271065be2ed1.zip
external_gettext-b18664fbf3a20ddc8cdedfe74257271065be2ed1.tar.gz
external_gettext-b18664fbf3a20ddc8cdedfe74257271065be2ed1.tar.bz2
Update by Juan Manuel Guerrero.
Diffstat (limited to 'djgpp/config.bat')
-rwxr-xr-xdjgpp/config.bat245
1 files changed, 191 insertions, 54 deletions
diff --git a/djgpp/config.bat b/djgpp/config.bat
index cb37269..b5a1cdf 100755
--- a/djgpp/config.bat
+++ b/djgpp/config.bat
@@ -1,69 +1,143 @@
@echo off
echo Configuring GNU Gettext for DJGPP v2.x...
+
Rem The SmallEnv tests protect against fixed and too small size
Rem of the environment in stock DOS shell.
Rem Find out if NLS is wanted or not,
+Rem if dependency-tracking is wanted or not,
+Rem if caching is wanted or not
Rem if static or shared libraries are wanted
Rem and where the sources are.
Rem We always default to NLS support,
-Rem static libraries, and to in place configuration.
+Rem no dependency tracking, static library
+Rem and to in place configuration.
set ARGS=
set NLS=enabled
if not "%NLS%" == "enabled" goto SmallEnv
-set STATIC_LIBS=enabled
-if not "%STATIC_LIBS%" == "enabled" goto SmallEnv
+set CACHING=enabled
+if not "%CACHING%" == "enabled" goto SmallEnv
+set DEPENDENCY_TRACKING=disabled
+if not "%DEPENDENCY_TRACKING%" == "disabled" goto SmallEnv
+set LIBICONV_PREFIX=disabled
+if not "%LIBICONV_PREFIX%" == "disabled" goto SmallEnv
+set LIBINTL_PREFIX=disabled
+if not "%LIBINTL_PREFIX%" == "disabled" goto SmallEnv
+set STATIC_LIBRARY=enabled
+if not "%STATIC_LIBRARY%" == "enabled" goto SmallEnv
set XSRC=.
if not "%XSRC%" == "." goto SmallEnv
Rem Loop over all arguments.
-Rem Special arguments are: NLS, XSRC and STATIC_LIBS.
-Rem All other arguments are stored unchanged into ARGS.
+Rem Special arguments are: NLS, XSRC, CACHE, STATIC_LIBS, LIBICONV_PREFIX, LIBINTL_PREFIX and DEPS.
+Rem All other arguments are stored into ARGS.
:ArgLoop
-set ARGSFLAG=1
-if not "%ARGSFLAG%" == "1" goto SmallEnv
-if not "%1" == "NLS" if not "%1" == "nls" if not "%1" == "NO-NLS" if not "%1" == "no-NLS" if not "%1" == "no-nls" goto StaticLibsOpt
+if "%1" == "nls" goto NextArgument
+if "%1" == "NLS" goto NextArgument
+if "%1" == "no-nls" goto NoNLS
+if "%1" == "no-NLS" goto NoNLS
+if "%1" == "NO-NLS" goto NoNLS
+goto CachingOption
+:NoNLS
if "%1" == "no-nls" set NLS=disabled
if "%1" == "no-NLS" set NLS=disabled
if "%1" == "NO-NLS" set NLS=disabled
if not "%NLS%" == "disabled" goto SmallEnv
-set ARGSFLAG=0
-if not "%ARGSFLAG%" == "0" goto SmallEnv
-shift
-:StaticLibsOpt
-set ARGSFLAG=1
-if not "%ARGSFLAG%" == "1" goto SmallEnv
-if not "%1" == "static" if not "%1" == "STATIC" if not "%1" == "shared" if not "%1" == "SHARED" goto SrcDirOpt
-if "%1" == "shared" set STATIC_LIBS=disabled
-if "%1" == "SHARED" set STATIC_LIBS=disabled
-if not "%STATIC_LIBS%" == "disabled" goto SmallEnv
-set ARGSFLAG=0
-if not "%ARGSFLAG%" == "0" goto SmallEnv
-shift
-:SrcDirOpt
-set ARGSFLAG=1
-if not "%ARGSFLAG%" == "1" goto SmallEnv
+goto NextArgument
+:CachingOption
+if "%1" == "cache" goto NextArgument
+if "%1" == "CACHE" goto NextArgument
+if "%1" == "no-cache" goto NoCaching
+if "%1" == "no-CACHE" goto NoCaching
+if "%1" == "NO-CACHE" goto NoCaching
+goto DependencyOption
+:NoCaching
+if "%1" == "no-cache" set CACHING=disabled
+if "%1" == "no-CACHE" set CACHING=disabled
+if "%1" == "NO-CACHE" set CACHING=disabled
+if not "%CACHING%" == "disabled" goto SmallEnv
+goto NextArgument
+:DependencyOption
+if "%1" == "no-dep" goto NextArgument
+if "%1" == "no-DEP" goto NextArgument
+if "%1" == "NO-DEP" goto NextArgument
+if "%1" == "dep" goto DependecyTraking
+if "%1" == "DEP" goto DependecyTraking
+goto LibiconvPrefixOption
+:DependecyTraking
+if "%1" == "dep" set DEPENDENCY_TRACKING=enabled
+if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled
+if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv
+goto NextArgument
+:LibiconvPrefixOption
+if "%1" == "no-libiconvprefix" goto NextArgument
+if "%1" == "no-LIBICONVPREFIX" goto NextArgument
+if "%1" == "NO-LIBICONVPREFIX" goto NextArgument
+if "%1" == "libiconvprefix" goto WithLibiconvPrefix
+if "%1" == "LIBICONVPREFIX" goto WithLibiconvPrefix
+goto LibintlPrefixOption
+:WithLibiconvPrefix
+if "%1" == "libiconvprefix" set LIBICONV_PREFIX=enabled
+if "%1" == "LIBICONVPREFIX" set LIBICONV_PREFIX=enabled
+if not "%LIBICONV_PREFIX%" == "enabled" goto SmallEnv
+goto NextArgument
+:LibintlPrefixOption
+if "%1" == "no-libiconvprefix" goto NextArgument
+if "%1" == "no-LIBICONVPREFIX" goto NextArgument
+if "%1" == "NO-LIBICONVPREFIX" goto NextArgument
+if "%1" == "libintlprefix" goto _WithLibintlPrefix
+if "%1" == "LIBINTLPREFIX" goto _WithLibintlPrefix
+goto StaticLibraryOption
+:_WithLibintlPrefix
+if "%1" == "libintlprefix" set LIBINTL_PREFIX=enabled
+if "%1" == "LIBINTLPREFIX" set LIBINTL_PREFIX=enabled
+if not "%LIBINTL_PREFIX%" == "enabled" goto SmallEnv
+goto NextArgument
+:StaticLibraryOption
+if "%1" == "static" goto NextArgument
+if "%1" == "STATIC" goto NextArgument
+if "%1" == "shared" goto SharedLibrary
+if "%1" == "SHARED" goto SharedLibrary
+goto SrcDirOption
+:SharedLibrary
+if "%1" == "shared" set STATIC_LIBRARY=disabled
+if "%1" == "SHARED" set STATIC_LIBRARY=disabled
+if not "%STATIC_LIBRARY%" == "disabled" goto SmallEnv
+goto NextArgument
+:SrcDirOption
echo %1 | grep -q "/"
-if errorlevel 1 goto NextArg
+if errorlevel 1 goto CollectArgument
set XSRC=%1
if not "%XSRC%" == "%1" goto SmallEnv
-set ARGSFLAG=0
-if not "%ARGSFLAG%" == "0" goto SmallEnv
-:NextArg
-if "%ARGSFLAG%" == "1" set _ARGS=%ARGS% %1
-if "%ARGSFLAG%" == "1" if not "%_ARGS%" == "%ARGS% %1" goto SmallEnv
-set ARGS=%_ARGS%
+goto NextArgument
+:CollectArgument
+set _ARGS=%ARGS% %1
+if not "%_ARGS%" == "%ARGS% %1" if not "%_ARGS%" == "%ARGS%%1" goto SmallEnv
+echo %_ARGS% | grep -q "[^ ]"
+if not errorlevel 0 set ARGS=%_ARGS%
set _ARGS=
+:NextArgument
shift
if not "%1" == "" goto ArgLoop
-set ARGSFLAG=
-if "%STATIC_LIBS%" == "enabled" set _ARGS=--enable-static --disable-shared %ARGS%
-if not "%_ARGS%" == "--enable-static --disable-shared %ARGS%" goto SmallEnv
-if "%STATIC_LIBS%" == "disabled" set _ARGS=--disable-static --enable-shared %ARGS%
-if "%STATIC_LIBS%" == "disabled" if not "%_ARGS%" == "--disable-static --enable-shared %ARGS%" goto SmallEnv
-set ARGS=%_ARGS%
-set _ARGS=
+Rem Create an arguments file for the configure script.
+echo --srcdir=%XSRC% > arguments
+if "%CACHING%" == "enabled" echo --cache-file=%XSRC%/djgpp/config.cache >> arguments
+if "%DEPENDENCY_TRACKING%" == "enabled" echo --enable-dependency-tracking >> arguments
+if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> arguments
+if "%LIBICONV_PREFIX%" == "enabled" echo --with-libiconv-prefix >> arguments
+if "%LIBICONV_PREFIX%" == "disabled" echo --without-libiconv-prefix >> arguments
+if "%LIBINTL_PREFIX%" == "enabled" echo --with-libintl-prefix >> arguments
+if "%LIBINTL_PREFIX%" == "disabled" echo --without-libintl-prefix >> arguments
+if "%STATIC_LIBRARY%" == "enabled" echo --enable-static --disable-shared >> arguments
+if "%STATIC_LIBRARY%" == "disabled" echo --enable-shared --disable-static >> arguments
+if not "%ARGS%" == "" echo %ARGS% >> arguments
+set ARGS=
+set CACHING=
+set DEPENDENCY_TRACKING=
+set LIBICONV_PREFIX=
+set LIBINTL_PREFIX=
+set STATIC_LIBRARY=
if "%XSRC%" == "." goto InPlace
@@ -87,6 +161,10 @@ if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv
Rem Make sure crucial file names are not munged by unpacking
test -f %XSRC%/config.h.in
if not errorlevel 1 mv -f %XSRC%/config.h.in %XSRC%/config.h-in
+test -f %XSRC%/configh.in
+if not errorlevel 1 mv -f %XSRC%/config.h.in %XSRC%/config.h-in
+test -f %XSRC%/config.h-in
+if errorlevel 1 mv -f %XSRC%/config.h %XSRC%/config.h-in
test -f %XSRC%/po/Makefile.in.in
if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in
@@ -101,20 +179,56 @@ sed "s/po-gram-gen2.h/po-gram_gen2.h/g" %XSRC%/src/po-lex.orig > po-lex.tmp
if errorlevel 1 goto SedError
mv ./po-lex.tmp %XSRC%/src/po-lex.c
+Rem Starting with gettext-0.11 posix function unsetenv() is needed.
+Rem As long as djdev204 has not been released, we will provide
+Rem unsetenv.c from djdev204 CVS tree.
+test -f %XSRC%/lib/unsetenv.c
+if errorlevel 1 update %XSRC%/djgpp/unsetenv.c %XSRC%/lib/unsetenv.c
+
+Rem Starting with gettext-0.11 pw_gecos is needed.
+Rem As long as djdev204 has not been released, we will provide
+Rem getpwman.c and pwd.h (djpwd.h) from djdev204 CVS tree.
+test -f %XSRC%/lib/djpwd.h
+if errorlevel 1 update %XSRC%/djgpp/djpwd.h %XSRC%/lib/djpwd.h
+test -f %XSRC%/lib/getpwnam.c
+if errorlevel 1 update %XSRC%/djgpp/getpwnam.c %XSRC%/lib/getpwnam.c
+
+Rem src/msginit.c must use the distributed CVS tree pwd.h
+Rem instead of the system's one.
+test -f %XSRC%/src/msginit.orig
+if errorlevel 1 update %XSRC%/src/msginit.c %XSRC%/src/msginit.orig
+sed -f %XSRC%/djgpp/msginit.sed %XSRC%/src/msginit.orig > msginit.tmp
+if errorlevel 1 goto SedError
+mv ./msginit.tmp %XSRC%/src/msginit.c
+
+Rem POTFILES.in must be adjusted to reflect the changed names
+Rem according to fnchange.lst.
+test -f %XSRC%/po/POTFILES.orig
+if errorlevel 1 update %XSRC%/po/POTFILES.in %XSRC%/po/POTFILES.orig
+sed "s/format-librep/format_librep/;s/format-pascal/format_pascal/" %XSRC%/po/POTFILES.orig > POTFILES.tmp
+if errorlevel 1 goto SedError
+mv ./POTFILES.tmp %XSRC%/po/POTFILES.in
+
Rem This is required because DOS/Windows are case-insensitive
Rem to file names, and "make install" will do nothing if Make
Rem finds a file called `install'.
-if exist INSTALL mv -f INSTALL INSTALL.txt
+if exist INSTALL ren INSTALL INSTALL.txt
-Rem install-sh is required by the configure script but clashes with the
-Rem various Makefile install-foo targets, so we MUST have it before the
-Rem script runs and rename it afterwards
-test -f %XSRC%/install-sh
-if not errorlevel 1 goto NoRen0
-test -f %XSRC%/install-sh.sh
-if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh
-:NoRen0
+Rem Set SHELL to a sane default or some configure tests stop working
+Rem if the package is configured across partitions.
+if not "%SHELL%" == "" goto HomeName
+set SHELL=/bin/sh
+if not "%SHELL%" == "/bin/sh" goto SmallEnv
+echo No SHELL found in the environment, using default value
+
+:HomeName
+Rem Set HOME to a sane default so configure stops complaining.
+if not "%HOME%" == "" goto HostName
+set HOME=%XSRC%/djgpp
+if not "%HOME%" == "%XSRC%/djgpp" goto SmallEnv
+echo No HOME found in the environment, using default value
+:HostName
Rem Set HOSTNAME so it shows in config.status
if not "%HOSTNAME%" == "" goto hostdone
if "%windir%" == "" goto msdos
@@ -146,17 +260,37 @@ set HOSTNAME=%_HOSTNAME%
set _HOSTNAME=
set OS=
+Rem install-sh is required by the configure script but clashes with the
+Rem various Makefile install-foo targets, so we MUST have it before the
+Rem script runs and rename it afterwards
+test -f %XSRC%/install-sh
+if not errorlevel 1 goto NoRen0
+test -f %XSRC%/install-sh.sh
+if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh
+:NoRen0
+
if "%NLS%" == "disabled" goto WithoutNLS
-echo Running the ./configure script...
-sh ./configure --srcdir=%XSRC% --enable-nls --with-included-gettext %ARGS%
-if errorlevel 1 goto CfgError
-echo Done.
-goto ScriptEditing
+
+:WithNLS
+Rem Recreate the files in the %XSRC%/po subdir with our ported tools.
+redir -e /dev/null rm %XSRC%/po/*.gmo
+redir -e /dev/null rm %XSRC%/po/gettext.pot
+redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c
+redir -e /dev/null rm %XSRC%/po/stamp-cat-id
+
+Rem Update the arguments file for the configure script.
+echo --enable-nls --with-included-gettext >> arguments
+goto ConfigurePackage
:WithoutNLS
+Rem Update the arguments file for the configure script.
+echo --disable-nls >> arguments
+
+:ConfigurePackage
echo Running the ./configure script...
-sh ./configure --srcdir=%XSRC% --disable-nls %ARGS%
+sh ./configure @arguments
if errorlevel 1 goto CfgError
+rm arguments
echo Done.
:ScriptEditing
@@ -196,8 +330,11 @@ if not errorlevel 1 goto NoRen1
test -f %XSRC%/install-sh
if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh
:NoRen1
-set ARGS=
+if "%SHELL%" == "/bin/sh" set SHELL=
+if "%HOME%" == "%XSRC%/djgpp" set HOME=
set CONFIG_SITE=
set HOSTNAME=
set NLS=
+set CACHING=
+set DEPENDENCY_TRACKING=
set XSRC=