Annotation of embedaddon/libiconv/libcharset/djgpp/config.bat, revision 1.1.1.1

1.1       misho       1: @echo off
                      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.
                      5: 
                      6: Rem Find out if NLS is wanted or not,
                      7: Rem if dependency-tracking is wanted or not,
                      8: Rem if caching is wanted or not
                      9: Rem and where the sources are.
                     10: Rem We always default to NLS support,
                     11: Rem no dependency tracking
                     12: Rem and to in place configuration.
                     13: set ARGS=
                     14: set NLS=disabled
                     15: if not "%NLS%" == "disabled" goto SmallEnv
                     16: set CACHING=enabled
                     17: if not "%CACHING%" == "enabled" goto SmallEnv
                     18: set DEPENDENCY_TRACKING=disabled
                     19: if not "%DEPENDENCY_TRACKING%" == "disabled" goto SmallEnv
                     20: set LIBICONV_PREFIX=disabled
                     21: if not "%LIBICONV_PREFIX%" == "disabled" goto SmallEnv
                     22: set LIBINTL_PREFIX=disabled
                     23: if not "%LIBINTL_PREFIX%" == "disabled" goto SmallEnv
                     24: set HTML=enabled
                     25: if not "%HTML%" == "enabled" goto SmallEnv
                     26: set XSRC=.
                     27: if not "%XSRC%" == "." goto SmallEnv
                     28: 
                     29: Rem Loop over all arguments.
                     30: Rem Special arguments are: NLS, XSRC, CACHE, STATIC_LIBS, LIBICONV_PREFIX, LIBINTL_PREFIX and DEPS.
                     31: Rem All other arguments are stored into ARGS.
                     32: :ArgLoop
                     33: if "%1" == "nls" goto NextArgument
                     34: if "%1" == "NLS" goto NextArgument
                     35: if "%1" == "no-nls" goto NoNLS
                     36: if "%1" == "no-NLS" goto NoNLS
                     37: if "%1" == "NO-NLS" goto NoNLS
                     38: goto CachingOption
                     39: :NoNLS
                     40: if "%1" == "no-nls" set NLS=disabled
                     41: if "%1" == "no-NLS" set NLS=disabled
                     42: if "%1" == "NO-NLS" set NLS=disabled
                     43: if not "%NLS%" == "disabled" goto SmallEnv
                     44: goto NextArgument
                     45: :CachingOption
                     46: if "%1" == "cache" goto NextArgument
                     47: if "%1" == "CACHE" goto NextArgument
                     48: if "%1" == "no-cache" goto NoCaching
                     49: if "%1" == "no-CACHE" goto NoCaching
                     50: if "%1" == "NO-CACHE" goto NoCaching
                     51: goto DependencyOption
                     52: :NoCaching
                     53: if "%1" == "no-cache" set CACHING=disabled
                     54: if "%1" == "no-CACHE" set CACHING=disabled
                     55: if "%1" == "NO-CACHE" set CACHING=disabled
                     56: if not "%CACHING%" == "disabled" goto SmallEnv
                     57: goto NextArgument
                     58: :DependencyOption
                     59: if "%1" == "no-dep" goto NextArgument
                     60: if "%1" == "no-DEP" goto NextArgument
                     61: if "%1" == "NO-DEP" goto NextArgument
                     62: if "%1" == "dep" goto DependecyTraking
                     63: if "%1" == "DEP" goto DependecyTraking
                     64: goto LibiconvPrefixOption
                     65: :DependecyTraking
                     66: if "%1" == "dep" set DEPENDENCY_TRACKING=enabled
                     67: if "%1" == "DEP" set DEPENDENCY_TRACKING=enabled
                     68: if not "%DEPENDENCY_TRACKING%" == "enabled" goto SmallEnv
                     69: goto NextArgument
                     70: :LibiconvPrefixOption
                     71: if "%1" == "no-libiconvprefix" goto NextArgument
                     72: if "%1" == "no-LIBICONVPREFIX" goto NextArgument
                     73: if "%1" == "NO-LIBICONVPREFIX" goto NextArgument
                     74: if "%1" == "libiconvprefix" goto WithLibiconvPrefix
                     75: if "%1" == "LIBICONVPREFIX" goto WithLibiconvPrefix
                     76: goto LibintlPrefixOption
                     77: :WithLibiconvPrefix
                     78: if "%1" == "libiconvprefix" set LIBICONV_PREFIX=enabled
                     79: if "%1" == "LIBICONVPREFIX" set LIBICONV_PREFIX=enabled
                     80: if not "%LIBICONV_PREFIX%" == "enabled" goto SmallEnv
                     81: goto NextArgument
                     82: :LibintlPrefixOption
                     83: if "%1" == "no-libiconvprefix" goto NextArgument
                     84: if "%1" == "no-LIBICONVPREFIX" goto NextArgument
                     85: if "%1" == "NO-LIBICONVPREFIX" goto NextArgument
                     86: if "%1" == "libintlprefix" goto _WithLibintlPrefix
                     87: if "%1" == "LIBINTLPREFIX" goto _WithLibintlPrefix
                     88: goto HTMLOption
                     89: :_WithLibintlPrefix
                     90: if "%1" == "libintlprefix" set LIBINTL_PREFIX=enabled
                     91: if "%1" == "LIBINTLPREFIX" set LIBINTL_PREFIX=enabled
                     92: if not "%LIBINTL_PREFIX%" == "enabled" goto SmallEnv
                     93: :HTMLOption
                     94: if "%1" == "withhtml" goto NextArgument
                     95: if "%1" == "withHTML" goto NextArgument
                     96: if "%1" == "WITHHTML" goto NextArgument
                     97: if "%1" == "withouthtml" goto _WithoutHTML
                     98: if "%1" == "withoutHTML" goto _WithoutHTML
                     99: if "%1" == "WITHOUTHTML" goto _WithoutHTML
                    100: goto SrcDirOption
                    101: :_WithoutHTML
                    102: if "%1" == "withouthtml" set HTML=disabled
                    103: if "%1" == "withoutHTML" set HTML=disabled
                    104: if "%1" == "WITHOUTHTML" set HTML=disabled
                    105: if not "%HTML%" == "disabled" goto SmallEnv
                    106: goto NextArgument
                    107: :SrcDirOption
                    108: echo %1 | grep -q "/"
                    109: if errorlevel 1 goto CollectArgument
                    110: set XSRC=%1
                    111: if not "%XSRC%" == "%1" goto SmallEnv
                    112: goto NextArgument
                    113: :CollectArgument
                    114: set _ARGS=#%ARGS%#%1#
                    115: if not "%_ARGS%" == "#%ARGS%#%1#" goto SmallEnv
                    116: echo %_ARGS% | grep -q "###"
                    117: if errorlevel 1 set ARGS=%ARGS% %1
                    118: set _ARGS=
                    119: :NextArgument
                    120: shift
                    121: if not "%1" == "" goto ArgLoop
                    122: 
                    123: Rem Create an arguments file for the configure script.
                    124: echo --srcdir=%XSRC% > arguments
                    125: if "%CACHING%" == "enabled"              echo --cache-file=%XSRC%/djgpp/config.cache >> arguments
                    126: if "%DEPENDENCY_TRACKING%" == "enabled"  echo --enable-dependency-tracking >> arguments
                    127: if "%DEPENDENCY_TRACKING%" == "disabled" echo --disable-dependency-tracking >> arguments
                    128: if "%LIBICONV_PREFIX%" == "enabled"      echo --with-libiconv-prefix >> arguments
                    129: if "%LIBICONV_PREFIX%" == "disabled"     echo --without-libiconv-prefix >> arguments
                    130: if "%LIBINTL_PREFIX%" == "enabled"       echo --with-libintl-prefix >> arguments
                    131: if "%LIBINTL_PREFIX%" == "disabled"      echo --without-libintl-prefix >> arguments
                    132: if "%HTML%" == "enabled"                 echo --enable-html >> arguments
                    133: if "%HTML%" == "disabled"                echo --disable-html >> arguments
                    134: if not "%ARGS%" == ""                    echo %ARGS% >> arguments
                    135: set ARGS=
                    136: set CACHING=
                    137: set DEPENDENCY_TRACKING=
                    138: set LIBICONV_PREFIX=
                    139: set LIBINTL_PREFIX=
                    140: set HTML=
                    141: 
                    142: Rem Find out where the sources are
                    143: if "%XSRC%" == "." goto InPlace
                    144: 
                    145: :NotInPlace
                    146: redir -e /dev/null update %XSRC%/configure.org ./configure
                    147: test -f ./configure
                    148: if errorlevel 1 update %XSRC%/configure ./configure
                    149: 
                    150: :InPlace
                    151: Rem Update configuration files
                    152: echo Updating configuration scripts...
                    153: test -f ./configure.org
                    154: if errorlevel 1 update ./configure ./configure.org
                    155: sed -f %XSRC%/djgpp/config.sed ./configure.org > configure
                    156: if errorlevel 1 goto SedError
                    157: 
                    158: Rem Make sure they have a config.site file
                    159: set CONFIG_SITE=%XSRC%/djgpp/config.site
                    160: if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto SmallEnv
                    161: 
                    162: Rem Make sure crucial file names are not munged by unpacking
                    163: test -f %XSRC%/config.h.in
                    164: if not errorlevel 1 redir -e /dev/null mv -f %XSRC%/config.h.in %XSRC%/config.h-in
                    165: test -f %XSRC%/config.h-in
                    166: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/config.h %XSRC%/config.h-in
                    167: test -f %XSRC%/config.h-in
                    168: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/configh.in %XSRC%/config.h-in
                    169: test -f %XSRC%/config.h-in
                    170: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/config_h.in %XSRC%/config.h-in
                    171: test -f %XSRC%/include/libcharset.h-in
                    172: if not errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/libcharset.h-in %XSRC%/include/libcharset.h-in
                    173: test -f %XSRC%/include/libcharset.h-in
                    174: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/libcharset.h %XSRC%/include/libcharset.h-in
                    175: test -f %XSRC%/include/libcharset.h-in
                    176: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/libcharseth.in %XSRC%/include/libcharset.h-in
                    177: test -f %XSRC%/include/libcharset.h-in
                    178: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/libcharset_h.in %XSRC%/include/libcharset.h-in
                    179: test -f %XSRC%/include/localcharset.h-in
                    180: if not errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/localcharset.h-in %XSRC%/include/localcharset.h-in
                    181: test -f %XSRC%/include/localcharset.h-in
                    182: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/localcharset.h %XSRC%/include/localcharset.h-in
                    183: test -f %XSRC%/include/localcharset.h-in
                    184: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/localcharseth.in %XSRC%/include/localcharset.h-in
                    185: test -f %XSRC%/include/localcharset.h-in
                    186: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/localcharset_h.in %XSRC%/include/localcharset.h-in
                    187: test -f %XSRC%/include/localcharset.h.build.in
                    188: if not errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/localcharset.h.build.in %XSRC%/include/localcharset.h-build-in
                    189: test -f %XSRC%/include/localcharset.h-build-in
                    190: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/localcharset.h %XSRC%/include/localcharset.h-build-in
                    191: test -f %XSRC%/include/localcharset.h-build-in
                    192: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/localcharseth.build %XSRC%/include/localcharset.h-build-in
                    193: test -f %XSRC%/include/localcharset.h-build-in
                    194: if errorlevel 1 redir -e /dev/null mv -f %XSRC%/include/localcharset_h.build %XSRC%/include/localcharset.h-build-in
                    195: 
                    196: Rem This is required because DOS/Windows are case-insensitive
                    197: Rem to file names, and "make install" will do nothing if Make
                    198: Rem finds a file called `install'.
                    199: if exist INSTALL mv -f INSTALL INSTALL.txt
                    200: 
                    201: Rem Set SHELL to a sane default or some configure tests stop working
                    202: Rem if the package is configured across partitions.
                    203: if not "%SHELL%" == "" goto HomeName
                    204: set SHELL=/bin/sh
                    205: if not "%SHELL%" == "/bin/sh" goto SmallEnv
                    206: echo No SHELL found in the environment, using default value
                    207: 
                    208: :HomeName
                    209: Rem Set HOME to a sane default so configure stops complaining.
                    210: if not "%HOME%" == "" goto HostName
                    211: set HOME=%XSRC%/djgpp
                    212: if not "%HOME%" == "%XSRC%/djgpp" goto SmallEnv
                    213: echo No HOME found in the environment, using default value
                    214: 
                    215: :HostName
                    216: Rem Set HOSTNAME so it shows in config.status
                    217: if not "%HOSTNAME%" == "" goto hostdone
                    218: if "%windir%" == "" goto msdos
                    219: set OS=MS-Windows
                    220: if not "%OS%" == "MS-Windows" goto SmallEnv
                    221: goto haveos
                    222: :msdos
                    223: set OS=MS-DOS
                    224: if not "%OS%" == "MS-DOS" goto SmallEnv
                    225: :haveos
                    226: if not "%USERNAME%" == "" goto haveuname
                    227: if not "%USER%" == "" goto haveuser
                    228: echo No USERNAME and no USER found in the environment, using default values
                    229: set HOSTNAME=Unknown PC
                    230: if not "%HOSTNAME%" == "Unknown PC" goto SmallEnv
                    231: goto userdone
                    232: :haveuser
                    233: set HOSTNAME=%USER%'s PC
                    234: if not "%HOSTNAME%" == "%USER%'s PC" goto SmallEnv
                    235: goto userdone
                    236: :haveuname
                    237: set HOSTNAME=%USERNAME%'s PC
                    238: if not "%HOSTNAME%" == "%USERNAME%'s PC" goto SmallEnv
                    239: :userdone
                    240: set _HOSTNAME=%HOSTNAME%, %OS%
                    241: if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto SmallEnv
                    242: set HOSTNAME=%_HOSTNAME%
                    243: :hostdone
                    244: set _HOSTNAME=
                    245: set OS=
                    246: 
                    247: Rem install-sh is required by the configure script but clashes with the
                    248: Rem various Makefile install-foo targets, so we MUST have it before the
                    249: Rem script runs and rename it afterwards
                    250: test -f %XSRC%/install-sh
                    251: if not errorlevel 1 goto NoRen0
                    252: test -f %XSRC%/install-sh.sh
                    253: if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh
                    254: :NoRen0
                    255: 
                    256: if "%NLS%" == "disabled" goto WithoutNLS
                    257: 
                    258: :WithNLS
                    259: test -d %XSRC%/po
                    260: if errorlevel 1 goto WithoutNLS
                    261: 
                    262: Rem Check for the needed libraries and binaries.
                    263: test -x /dev/env/DJDIR/bin/msgfmt.exe
                    264: if not errorlevel 0 goto MissingNLSTools
                    265: test -x /dev/env/DJDIR/bin/xgettext.exe
                    266: if not errorlevel 0 goto MissingNLSTools
                    267: test -f /dev/env/DJDIR/include/libcharset.h
                    268: if not errorlevel 0 goto MissingNLSTools
                    269: test -f /dev/env/DJDIR/lib/libcharset.a
                    270: if not errorlevel 0 goto MissingNLSTools
                    271: test -f /dev/env/DJDIR/include/iconv.h
                    272: if not errorlevel 0 goto MissingNLSTools
                    273: test -f /dev/env/DJDIR/lib/libiconv.a
                    274: if not errorlevel 0 goto MissingNLSTools
                    275: test -f /dev/env/DJDIR/include/libintl.h
                    276: if not errorlevel 0 goto MissingNLSTools
                    277: test -f /dev/env/DJDIR/lib/libintl.a
                    278: if not errorlevel 0 goto MissingNLSTools
                    279: 
                    280: Rem Recreate the files in the %XSRC%/po subdir with our ported tools.
                    281: redir -e /dev/null rm %XSRC%/po/*.gmo
                    282: redir -e /dev/null rm %XSRC%/po/libcharset.pot
                    283: redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c
                    284: redir -e /dev/null rm %XSRC%/po/stamp-cat-id
                    285: 
                    286: Rem Update the arguments file for the configure script.
                    287: Rem We prefer without-included-gettext because libintl.a from gettext package
                    288: Rem is the only one that is garanteed to have been ported to DJGPP.
                    289: echo --enable-nls --without-included-gettext >> arguments
                    290: goto ConfigurePackage
                    291: 
                    292: :MissingNLSTools
                    293: echo Needed libs/tools for NLS not found. Configuring without NLS.
                    294: :WithoutNLS
                    295: Rem Update the arguments file for the configure script.
                    296: echo --disable-nls >> arguments
                    297: 
                    298: :ConfigurePackage
                    299: echo Running the ./configure script...
                    300: sh ./configure @arguments
                    301: if errorlevel 1 goto CfgError
                    302: rm arguments
                    303: echo Done.
                    304: goto End
                    305: 
                    306: :SedError
                    307: echo ./configure script editing failed!
                    308: goto End
                    309: 
                    310: :CfgError
                    311: echo ./configure script exited abnormally!
                    312: goto End
                    313: 
                    314: :SmallEnv
                    315: echo Your environment size is too small.  Enlarge it and run me again.
                    316: echo Configuration NOT done!
                    317: 
                    318: :End
                    319: test -f %XSRC%/install-sh.sh
                    320: if not errorlevel 1 goto NoRen1
                    321: test -f %XSRC%/install-sh
                    322: if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh
                    323: :NoRen1
                    324: set CONFIG_SITE=
                    325: set HOSTNAME=
                    326: set XSRC=

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>