This is a port of GNU Sed 3.02.80 to MSDOS/DJGPP.

1.:     DJGPP specific changes.
        =======================

      - Changes needed for NLS support with DJGPP.
      - Eli Zaretskii contributed a patch to open the input stream in binary
        mode. This will allow to process files that contain embedded ^Z and
        lone ^M characters. This patch has already been submitted to the sed
        maintainer, so this feature may become part of the next official sed
        release. This port is based on the alpha release of GNU Sed available
        at:
          <ftp://alpha.gnu.org/gnu/sed/sed-3.02.80.tar.gz>
      - If you have no DJGPP port of Sed installed and you want to rebuild this
        package from sources, please read Eli Zaretskii's readme file called:
        README.ORIG located in the djgpp directory. This explicitely explains
        how to build the binaries from the source package if no sed executable
        is installed.
        As usual, all djgpp specific files (config.bat, diffs, readme files,
        etc.) are located in the djgpp subdir.
      - Two Sed programs are distributed. One with NLS support (size: 667KB)
        called sed.exe and a second one without NLS support (size: 58KB)
        called nnsed.exe. Both binaries have been compiled using the GNU regex
        functions that come with this Sed sources. Unfortunately, this Sed
        sources can *NOT* be recompiled using the DJGPP regex functions.


2.:     Installing the binary package.
        ==============================

2.1.:   Copy the binary distribution into the top DJGPP installation directory.
        If you are installing Sed on a dual DOS/WINDOWS 9X systems, you should
        first turn off the generation of numeric tails for 8.3 aliases Windows
        creats for long file names. For information about how to do this, read
        the DJGPP FAQ List V 2.30, chapter 22.19: "How to Set Up a Dual
        DOS/Windows Installation". Please note that you **MUST** turn off the
        numeric tail generation for short file names during installation of the
        binary package if you want to use the Sed program on both, in a DOS
        window on Win9X **AND** plain DOS. If this is not done, Sed will *NOT*
        be able to find the .mo files (the catalog files containing the
        translated strings) on plain DOS. After the installation has been
        finished you can turn on numeric tail generation again if you like.

2.2.:   Copy the binary distribution into the top DJGPP installation directory
        and unzip it running *ONE* of the following commands:
          unzip32 sed3028b.zip      or
          djtarx sed3028b.zip       or
          pkunzip -d sed3028b.zip

2.3.:   This port offers NLS, this means that you can expect the program to
        talk your mother tongue if supported. To activate this native language
        support (NLS) some new entries must be added to the global part of your
        djgpp.env file which is located in the top DJGPP installation directory.
        The global part of your djgpp.env is everything *BEFORE* the *FIRST*
        line that looks like:
[xxxx]
        where xxxx stands for the name of some DJGPP binary.
        Add the following line to the first part of your djgpp.env:

+LANG=xx
+LANGUAGE=yy:zz

        The line must be completely shifted to the left in your djgpp.env file.
        Please note the plus sign at the beginning of the line. This plus sign
        should **NOT** be omited or a lot of shell scripts, in this and in
        other packages, that try to reset this value will stop working. The
        LANG entry is obligatory, the LANGUAGE entry may be omited. The
        LANGUAGE variable allows you to select an alternate catalog than the
        one stipulated by LANG. Replace xx, yy and zz by the language code of
        the catalogs you want to use. It should be noticed that LANGUAGE has
        *ALWAYS* higher priority than LANG. The LANG variable not only selects
        a catalog, it also specifies the dos codepage that will be used as
        locale charset. All this means that the translation strings contained
        in the catalogs (.mo files) will be recoded at runtime to the dos
        codepage stipulated by the value of LANG. This runtime recoding is
        needed because the .mo files may have been written using a charset
        that is not compatible with the charset that will be used on the
        machine and OS where the .mo files contents will be displayed.
        The .po files of the GNU packages, from which the .mo files are
        generated, are typical examples of this. They have been written
        using some ISO-8859-nn charset (an unix charset) and shall be
        displayed on a DOS/WIN95 machine that uses some dos codepage.

        Some examples:
        If you only want to use the catalog containing the translations for
        your mother tongue (in my case the spanish translations) the above
        lines will only use the LANG variable and will look like this:

+LANG=es

        In this case, LANG defines the translation to be used and at the same
        time the locale charset (CP850 in this case) to be used for the on-the-fly
        recoding of the catalog (.mo file) contents.
        If you want to use the spanish (es) and german (de) catalogs the above
        lines will look like this:

+LANG=es
+LANGUAGE=es:de

        In this case a DJGPP binary that has been compiled with NLS support
        will first search for the spanish translation of a string. If a
        translation for that particular string can not be found in the spanish
        .mo file then it will search for a german translation of that string in
        the german .mo file and if a german translation of that string can also
        not been found it will default to display the build-in english string.
        No mather if a spanish, a german or an english build-in string is
        selected, the string is always recoded to the dos codepage stipulated
        by LANG. In this case: CP850.
        If you want to reverse this search order the above lines would look
        like this one:

+LANG=es
+LANGUAGE=de:es

        Now let us assume that an user wants to use the swedish catalogs on
        a machine that loads codepage CP437 when it is booted. It should be
        noticed that the locale charset for Sweden is CP850 and not CP437.
        In this case, the lines must look like this:

+LANG=en_US
+LANGUAGE=sv

        LANG reflects the available codepage/charset and LANGUAGE selects the
        wanted translation catalog. en_US means CP437. Now, the contents of the
        catalog are recoded to CP437 instead to CP850 because CP437 is the
        codepage used to display messages on screen. Of course, not every
        combination of catalogs and locale charset (dos codepages) makes sense.
        E.G.: selecting as locale charset chinese (LANG=zh_TW) and the french
        translations (LANGUAGE=fr) will certainly not generate an usefull
        screen output.

        The content of LANG is a language code. Examples are fr for french,
        en_US for US english, etc. This language code is an alias for the
        locale charset to be used for runtime recoding. The complete list of
        all available aliases can be found in %DJDIR%/lib/charset.alias. This
        file is a table with two entries: left entry is the alias (en_US,
        de_AT, etc.), right entry is the corresponding dos codepage that will
        be used for that language code (alias). It should be noticed that it is
        also possible to select a codepage directely. E.G.: Instead of setting:

+LANG=en_US

        you may directely set:

+LANG=CP437

        This overwrites any settings in charset.alias.
        Please note that if you omit the LANG environment variable,
        the LANGUAGE variable will not be honored at all. Because the
        information about what locale charset shall be used is needed,
        if LANG is omitted by the user LANGUAGE will be ignored and no
        translation will be done at all.
        If for some reason you want to disable NLS, then you should comment
        out the LANG variable or select 'C' as your catalog:

+LANG=C

        Users not familiar with djgpp.env should refer to kb.info.
        This document can be read running the command:
          info -f kb -n DJGPP.ENV

2.4.:   To create an entry for the gettext info docs in your dir file located
        info directory run the command:
          install-info --info-dir=/dev/env/DJDIR/info /dev/env/DJDIR/info/sed.info

2.5.:   The binaries distributed in this package have NLS support.
        E.G. run the command:
          sed
        and the binary should talk to you in your mother tonge, if supported.
        For futher information about GNU Sed please read the info docs.


3.:     Building the binaries from sources.
        ===================================

3.1.:   To build the binaries you will need the following binary packages:
          djdev203.zip (NOT a prior version)
          bsh204b.zip
          gcc2953b.zip, bnu2112b.zip, mak3791b.zip,
          fil40b.zip, shl112b.zip, txt20b.zip,
          txi40b.zip, grep24b.zip, sed302b.zip,
          gtxt039b.zip, licv17b.zip, dif272b.zip,
          gawk30b.zip, flx254b.zip and bsn128b.zip.

        All this packages can be found in the v2gnu directory of any Simtel.NET
        mirror. You will need bsh203b.zip and *NOT* a prior version or the build
        will fail. The same applies to djdev203.zip. You *MUST* use the updated
        version of shl112b.zip (timestamp: 2000-08-11).
        This updated version have been recompiled with djdev203.zip and know
        about the "/dev/env" functionality introduced with djdev203.zip. All
        the other packages are the ones I have used to build the binaries from
        this sources. Previuos versions of this packages may do the job as well
        but I have not tested this.

3.2.:   Create a temporary directory. Copy the source package: sed3028s.zip
        into the directory and unzip it runnig ONE of the following commands:
          unzip32 sed3028s.zip      or
          djtarx sed3028s.zip       or
          pkunzip -d sed3028s.zip

3.3.:   This package is preconfigured for NLS support and djdev203. This
        implies that you *MUST* install the GNU gettext library (gtxt039b.zip
        or later) *AND* the libiconv library (licv17b.zip or later) if you
        want to reconfigure and recompile this package. Of course, this must be
        done *BEFORE* reconfiguring and recompiling the package.
        The configuration batch file of this package, located in the djgpp dir,
        allows you to enable or disable NLS support and to compile from a
        different partition than from where the sources are located.
        config.bat always configures the package for NLS support enabled and
        for "in place" compilation if no options are given. The available NLS
        options are:
          NLS
          no-NLS

        If for some reason you want no NLS support you will have to reconfigure
        the package. For this purpose cd into the top srcdir (sed-3_02.80) and
        run the following commands:
          make distclean
          djgpp\config no-NLS

        Please note that you *MUST* use the "distclean" option or the file:
        config.cache will *NOT* be deleted. In this case you are *NOT* really
        reconfiguring because the configuration informations are read from the
        cache file instead of being newly computed.
        You *MUST* specify "no-NLS" or config.bat will default to the "NLS"
        option. To build the programs in a directory other than where the
        sources are, you must add the parameter that specifies the source
        directory,
        e.g:
          x:\src\gnu\sed-3_02.80\djgpp\config x:/src/gnu/sed-3_02.80 no-NLS

        Lets assume you want to build the binaries in a directory placed on a
        different drive (z:\build in this case) from where the sources are,
        then you will run the following commands:
          z:
          md \build
          cd \build
          x:\src\gnu\sed-3_02.80\djgpp\config x:/src/gnu/sed-3_02.80 no-NLS

        If you want NLS support you will omit the "no-NLS" option or replace it
        by the "NLS" option in the above examples. The order of the NLS option
        and the srcdir option does *NOT* matter. You *MUST* use forward slashes
        to specify the source directory.

        The batch file will set same environment variables, make MSDOS specific
        modifications to the Makefile.ins and supply all other needed options
        to the configure script. If NLS support is wanted the batch file will
        check if libiconv.a, libintl.a, msgfmt.exe and xgettext.exe are
        installed. If one of the above items is missed the batch file will
        automatically default to configure the package without NLS support.


3.4.:   To compile the package run from the top srcdir the command:
          make

3.5.:   Now you can run the tests if you like. From the top srcdir run the
        command:
          make check

        Non test should fail.

3.6.:   To install the binary, catalogs, info docs and man pages run the
        following command from the top srcdir:
          make install CATALOGS="xx.gmo yy.gmo zz.gmo"

        This will install the products into your DJGPP installation tree given
        by the default prefix "/dev/env/DJDIR". If you prefer to install them
        into some other directory you will have to set prefix to the appropiate
        value. Replace xx, yy and zz by the language codes of the catalogs you
        want to install.
        Example:
          make install CATALOGS="xx.gmo yy.gmo zz.gmo" prefix=z:/some/other/dir

3.7.:   Now you have to set the LANG and LANGUAGE environment variable.
        Please refer to 2.3.




        Send sed specific bug reports to <bug-gnu-utils@gnu.org>.
        Send suggestions and bug reports concerning the DJGPP port
        to comp.os.msdos.djgpp or <djgpp@delorie.com>.

Enjoy.

          Guerrero, Juan Manuel <st001906@hrz1.hrz.tu-darmstadt.de>
