Project import generated by Copybara.

GitOrigin-RevId: 7435c2db6d4b7bb9a3e68345664ccb0a0f41da25
diff --git a/.hgignore b/.hgignore
deleted file mode 100644
index bc0bb6b..0000000
--- a/.hgignore
+++ /dev/null
@@ -1,7 +0,0 @@
-^autom4te.cache
-^build
-^FILES
-^core
-~$
-^.pc
-^patches
diff --git a/.release-checklist b/.release-checklist
index 414265c..276dd8a 100644
--- a/.release-checklist
+++ b/.release-checklist
@@ -2,18 +2,18 @@
 
 2)  "make check"!!!
 
-3)  Use "git log" to assemble release notes.
+3)  Use "git log" to assemble release notes and update RELEASE-NOTES symlink.
 
-4)  Run "(cd po; make e2fsprogs.pot-update)" to update the translation template.
-
-5)  Update files which contain version information
+4)  Update files which contain version information
 	version.h
 	README
-	RELEASE-NOTES
 	e2fsprogs.lsm
+	e2fsprogs.spec
 	doc/libext2fs.texinfo (three places)
 
-6)  Make source distribution
+5)  Run "(cd po; make e2fsprogs.pot-update)" to update the translation template.
 
-7)  Adjust sizes in e2fsprogs-VER.lsm; rebuild source files; rebuild RPM files
+6)  Make source tarfile
+
+7)  Adjust sizes in e2fsprogs-VER.lsm; rebuild source files; regenerate source tarfile
 
diff --git a/ABOUT-NLS b/ABOUT-NLS
index d528f9c..3cc8286 100644
--- a/ABOUT-NLS
+++ b/ABOUT-NLS
@@ -1,402 +1,1348 @@
-Notes on the Free Translation Project
-*************************************
+1 Notes on the Free Translation Project
+***************************************
 
-   Free software is going international!  The Free Translation Project
-is a way to get maintainers of free software, translators, and users all
-together, so that will gradually become able to speak many languages.
-A few packages already provide translations for their messages.
+Free software is going international!  The Free Translation Project is a
+way to get maintainers of free software, translators, and users all
+together, so that free software will gradually become able to speak many
+languages.  A few packages already provide translations for their
+messages.
 
-   If you found this `ABOUT-NLS' file inside a distribution, you may
-assume that the distributed package does use GNU `gettext' internally,
+   If you found this 'ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU 'gettext' internally,
 itself available at your nearest GNU archive site.  But you do _not_
-need to install GNU `gettext' prior to configuring, installing or using
+need to install GNU 'gettext' prior to configuring, installing or using
 this package with messages translated.
 
    Installers will find here some useful hints.  These notes also
 explain how users should proceed for getting the programs to use the
 available translations.  They tell how people wanting to contribute and
-work at translations should contact the appropriate team.
+work on translations can contact the appropriate team.
 
-   When reporting bugs in the `intl/' directory or bugs which may be
-related to internationalization, you should tell about the version of
-`gettext' which is used.  The information can be found in the
-`intl/VERSION' file, in internationalized packages.
+1.1 INSTALL Matters
+===================
 
-Quick configuration advice
-==========================
-
-   If you want to exploit the full power of internationalization, you
-should configure it using
-
-     ./configure --with-included-gettext
-
-to force usage of internationalizing routines provided within this
-package, despite the existence of internationalizing capabilities in the
-operating system where this package is being installed.  So far, only
-the `gettext' implementation in the GNU C library version 2 provides as
-many features (such as locale alias, message inheritance, automatic
-charset conversion or plural form handling) as the implementation here.
-It is also not possible to offer this additional functionality on top
-of a `catgets' implementation.  Future versions of GNU `gettext' will
-very likely convey even more functionality.  So it might be a good idea
-to change to GNU `gettext' as soon as possible.
-
-   So you need _not_ provide this option if you are using GNU libc 2 or
-you have installed a recent copy of the GNU gettext package with the
-included `libintl'.
-
-INSTALL Matters
-===============
-
-   Some packages are "localizable" when properly installed; the
-programs they contain can be made to speak your own native language.
-Most such packages use GNU `gettext'.  Other packages have their own
-ways to internationalization, predating GNU `gettext'.
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language.  Most such
+packages use GNU 'gettext'.  Other packages have their own ways to
+internationalization, predating GNU 'gettext'.
 
    By default, this package will be installed to allow translation of
 messages.  It will automatically detect whether the system already
-provides the GNU `gettext' functions.  If not, the GNU `gettext' own
-library will be used.  This library is wholly contained within this
-package, usually in the `intl/' subdirectory, so prior installation of
-the GNU `gettext' package is _not_ required.  Installers may use
-special options at configuration time for changing the default
-behaviour.  The commands:
+provides the GNU 'gettext' functions.  Installers may use special
+options at configuration time for changing the default behaviour.  The
+command:
 
-     ./configure --with-included-gettext
      ./configure --disable-nls
 
-will respectively bypass any pre-existing `gettext' to use the
-internationalizing routines provided within this package, or else,
-_totally_ disable translation of messages.
+will _totally_ disable translation of messages.
 
-   When you already have GNU `gettext' installed on your system and run
-configure without an option for your new package, `configure' will
-probably detect the previously built and installed `libintl.a' file and
-will decide to use this.  This might be not what is desirable.  You
-should use the more recent version of the GNU `gettext' library.  I.e.
-if the file `intl/VERSION' shows that the library which comes with this
-package is more recent, you should use
+   When you already have GNU 'gettext' installed on your system and run
+configure without an option for your new package, 'configure' will
+probably detect the previously built and installed 'libintl' library and
+will decide to use it.  If not, you may have to to use the
+'--with-libintl-prefix' option to tell 'configure' where to look for it.
 
-     ./configure --with-included-gettext
-
-to prevent auto-detection.
-
-   The configuration process will not test for the `catgets' function
-and therefore it will not be used.  The reason is that even an
-emulation of `gettext' on top of `catgets' could not provide all the
-extensions of the GNU `gettext' library.
-
-   Internationalized packages have usually many `po/LL.po' files, where
+   Internationalized packages usually have many 'po/LL.po' files, where
 LL gives an ISO 639 two-letter code identifying the language.  Unless
-translations have been forbidden at `configure' time by using the
-`--disable-nls' switch, all available translations are installed
-together with the package.  However, the environment variable `LINGUAS'
+translations have been forbidden at 'configure' time by using the
+'--disable-nls' switch, all available translations are installed
+together with the package.  However, the environment variable 'LINGUAS'
 may be set, prior to configuration, to limit the installed set.
-`LINGUAS' should then contain a space separated list of two-letter
+'LINGUAS' should then contain a space separated list of two-letter
 codes, stating which languages are allowed.
 
-Using This Package
-==================
+1.2 Using This Package
+======================
 
-   As a user, if your language has been installed for this package, you
-only have to set the `LANG' environment variable to the appropriate
-`LL_CC' combination.  Here `LL' is an ISO 639 two-letter language code,
-and `CC' is an ISO 3166 two-letter country code.  For example, let's
-suppose that you speak German and live in Germany.  At the shell
-prompt, merely execute `setenv LANG de_DE' (in `csh'),
-`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
-This can be done from your `.login' or `.profile' file, once and for
-all.
+As a user, if your language has been installed for this package, you
+only have to set the 'LANG' environment variable to the appropriate
+'LL_CC' combination.  If you happen to have the 'LC_ALL' or some other
+'LC_xxx' environment variables set, you should unset them before setting
+'LANG', otherwise the setting of 'LANG' will not have the desired
+effect.  Here 'LL' is an ISO 639 two-letter language code, and 'CC' is
+an ISO 3166 two-letter country code.  For example, let's suppose that
+you speak German and live in Germany.  At the shell prompt, merely
+execute 'setenv LANG de_DE' (in 'csh'), 'export LANG; LANG=de_DE' (in
+'sh') or 'export LANG=de_DE' (in 'bash').  This can be done from your
+'.login' or '.profile' file, once and for all.
 
    You might think that the country code specification is redundant.
 But in fact, some languages have dialects in different countries.  For
-example, `de_AT' is used for Austria, and `pt_BR' for Brazil.  The
+example, 'de_AT' is used for Austria, and 'pt_BR' for Brazil.  The
 country code serves to distinguish the dialects.
 
-   The locale naming convention of `LL_CC', with `LL' denoting the
-language and `CC' denoting the country, is the one use on systems based
-on GNU libc.  On other systems, some variations of this scheme are
-used, such as `LL' or `LL_CC.ENCODING'.  You can get the list of
-locales supported by your system for your country by running the command
-`locale -a | grep '^LL''.
+   The locale naming convention of 'LL_CC', with 'LL' denoting the
+language and 'CC' denoting the country, is the one use on systems based
+on GNU libc.  On other systems, some variations of this scheme are used,
+such as 'LL' or 'LL_CC.ENCODING'.  You can get the list of locales
+supported by your system for your language by running the command
+'locale -a | grep '^LL''.
 
    Not all programs have translations for all languages.  By default, an
 English message is shown in place of a nonexistent translation.  If you
 understand other languages, you can set up a priority list of languages.
 This is done through a different environment variable, called
-`LANGUAGE'.  GNU `gettext' gives preference to `LANGUAGE' over `LANG'
-for the purpose of message handling, but you still need to have `LANG'
+'LANGUAGE'.  GNU 'gettext' gives preference to 'LANGUAGE' over 'LANG'
+for the purpose of message handling, but you still need to have 'LANG'
 set to the primary language; this is required by other parts of the
-system libraries.  For example, some Swedish users who would rather
-read translations in German than English for when Swedish is not
-available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+system libraries.  For example, some Swedish users who would rather read
+translations in German than English for when Swedish is not available,
+set 'LANGUAGE' to 'sv:de' while leaving 'LANG' to 'sv_SE'.
 
-   In the `LANGUAGE' environment variable, but not in the `LANG'
-environment variable, `LL_CC' combinations can be abbreviated as `LL'
-to denote the language's main dialect.  For example, `de' is equivalent
-to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
-(Portuguese as spoken in Portugal) in this context.
+   Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from 'no' to 'nb' recently (in 2003).  During the
+transition period, while some message catalogs for this language are
+installed under 'nb' and some older ones under 'no', it's recommended
+for Norwegian users to set 'LANGUAGE' to 'nb:no' so that both newer and
+older translations are used.
 
-Translating Teams
-=================
+   In the 'LANGUAGE' environment variable, but not in the 'LANG'
+environment variable, 'LL_CC' combinations can be abbreviated as 'LL' to
+denote the language's main dialect.  For example, 'de' is equivalent to
+'de_DE' (German as spoken in Germany), and 'pt' to 'pt_PT' (Portuguese
+as spoken in Portugal) in this context.
 
-   For the Free Translation Project to be a success, we need interested
+1.3 Translating Teams
+=====================
+
+For the Free Translation Project to be a success, we need interested
 people who like their own language and write it well, and who are also
 able to synergize with other translators speaking the same language.
 Each translation team has its own mailing list.  The up-to-date list of
 teams can be found at the Free Translation Project's homepage,
-`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
-area.
+'http://translationproject.org/', in the "Teams" area.
 
    If you'd like to volunteer to _work_ at translating messages, you
 should become a member of the translating team for your own language.
 The subscribing address is _not_ the same as the list itself, it has
-`-request' appended.  For example, speakers of Swedish can send a
-message to `sv-request@li.org', having this message body:
+'-request' appended.  For example, speakers of Swedish can send a
+message to 'sv-request@li.org', having this message body:
 
      subscribe
 
-   Keep in mind that team members are expected to participate
-_actively_ in translations, or at solving translational difficulties,
-rather than merely lurking around.  If your team does not exist yet and
-you want to start one, or if you are unsure about what to do or how to
-get started, please write to `translation@iro.umontreal.ca' to reach the
+   Keep in mind that team members are expected to participate _actively_
+in translations, or at solving translational difficulties, rather than
+merely lurking around.  If your team does not exist yet and you want to
+start one, or if you are unsure about what to do or how to get started,
+please write to 'coordinator@translationproject.org' to reach the
 coordinator for all translator teams.
 
    The English team is special.  It works at improving and uniformizing
-the terminology in use.  Proven linguistic skill are praised more than
-programming skill, here.
+the terminology in use.  Proven linguistic skills are praised more than
+programming skills, here.
 
-Available Packages
-==================
+1.4 Available Packages
+======================
 
-   Languages are not equally supported in all packages.  The following
-matrix shows the current state of internationalization, as of August
-2002.  The matrix shows, in regard of each package, for which languages
-PO files have been submitted to translation coordination, with a
+Languages are not equally supported in all packages.  The following
+matrix shows the current state of internationalization, as of Jun 2014.
+The matrix shows, in regard of each package, for which languages PO
+files have been submitted to translation coordination, with a
 translation percentage of at least 50%.
 
-     Ready PO files    be bg ca cs da de el en eo es et fi fr
-                     +----------------------------------------+
-     a2ps            |             [] []             []    [] |
-     ap-utils        |                                        |
-     bash            |                []       [] []       [] |
-     bfd             |                            []       [] |
-     binutils        |                            []       [] |
-     bison           |                []          [] []    [] |
-     clisp           |                                        |
-     clisp           |                []    []    []       [] |
-     clisplow        |                                        |
-     cpio            |             [] []          []       [] |
-     darkstat        |             ()                         |
-     diffutils       |          [] [] []       [] []       [] |
-     enscript        |                []                   [] |
-     error           |                []          []       [] |
-     fetchmail       |       [] () [] []          []       () |
-     fileutils       |             [] []          [] []    [] |
-     findutils       |             [] []       [] [] []    [] |
-     flex            |       []    [] []          []       [] |
-     gas             |                            []       [] |
-     gawk            |                []          []       [] |
-     gcal            |       []                            [] |
-     gcc             |                            []       [] |
-     gettext         |       []    [] []          []       [] |
-     gnupg           |       []       [] []    [] [] []    [] |
-     gprof           |                            []       [] |
-     gpsdrive        |             () ()    ()    ()       () |
-     grep            |    [] []       [] []       [] [] [] [] |
-     gretl           |                            []          |
-     gthumb          |                ()          ()       () |
-     hello           |       []    [] [] []    [] [] [] [] [] |
-     id-utils        |             [] []                   [] |
-     indent          |       []       []       []    []    [] |
-     jpilot          |          () [] []                   [] |
-     jwhois          |                            []       [] |
-     kbd             |                []          []       [] |
-     ld              |                            []       [] |
-     libc            |       [] [] [] [] []       []    [] [] |
-     libiconv        |       []       []       [] []          |
-     lifelines       |                ()                   () |
-     lilypond        |             []                      [] |
-     lingoteach      |                         []          [] |
-     lingoteach_lessons|                ()          ()          |
-     lynx            |       [] [] [] []             []       |
-     m4              |          [] [] [] []                [] |
-     make            |             [] []          []       [] |
-     man-db          |       [] () () []          ()       () |
-     mysecretdiary   |                []          []       [] |
-     nano            |       [] () [] []          []       [] |
-     nano_1_0        |       [] () [] []          []       [] |
-     opcodes         |             []             []       [] |
-     parted          |       []    [] []          []       [] |
-     ptx             |             [] []       [] [] [] [] [] |
-     python          |                                        |
-     recode          |             [] [] []    [] []       [] |
-     sed             |       [] [] [] [] []    [] [] [] [] [] |
-     sh-utils        |                []          [] []    [] |
-     sharutils       |          [] [] [] []       [] []    [] |
-     sketch          |                ()          []       () |
-     soundtracker    |                []          []       [] |
-     sp              |                []                      |
-     tar             |          [] [] []          [] []    [] |
-     texinfo         |          [] [] []       []          [] |
-     textutils       |       []    [] []          []       [] |
-     util-linux      |          [] [] []          [] []    [] |
-     vorbis-tools    |                                     [] |
-     wastesedge      |                                        |
-     wdiff           |       []    [] []          [] []    [] |
-     wget            |    [] [] [] [] [] []       [] [] [] [] |
-                     +----------------------------------------+
-                       be bg ca cs da de el en eo es et fi fr
-                        0  2 19 10 30 44  9  1 12 44 17  6 53
-     
-                       gl he hr hu id it ja ko lv nb nl nn
-                     +-------------------------------------+
-     a2ps            |                ()    ()       []    |
-     ap-utils        |                                     |
-     bash            |          []                         |
-     bfd             |                   []                |
-     binutils        |                   []                |
-     bison           |       []       [] []          []    |
-     clisp           |                                     |
-     clisp           |                               []    |
-     clisplow        |                                     |
-     cpio            | []       []          []       []    |
-     darkstat        |                                     |
-     diffutils       | [] []    [] []    []                |
-     enscript        |       []                      []    |
-     error           |          []                         |
-     fetchmail       |                   []                |
-     fileutils       |          []    [] []                |
-     findutils       | []    [] [] [] [] [] []       []    |
-     flex            |                      []             |
-     gas             |                                     |
-     gawk            |    []                               |
-     gcal            |                                     |
-     gcc             |                   []                |
-     gettext         |                   [] []             |
-     gnupg           | []          [] [] []                |
-     gprof           |             []                      |
-     gpsdrive        |          []    ()             ()    |
-     grep            | [] [] [] [] [] [] []                |
-     gretl           |                                     |
-     gthumb          |                () ()                |
-     hello           | [] [] [] [] [] [] [] [] [] [] [] [] |
-     id-utils        |          []                   []    |
-     indent          | []       []       []          []    |
-     jpilot          |                   ()          ()    |
-     jwhois          |          [] []                      |
-     kbd             |                                     |
-     ld              |                                     |
-     libc            | []                [] []    []       |
-     libiconv        | []    [] []                         |
-     lifelines       |                                     |
-     lilypond        |                               []    |
-     lingoteach      |          []                         |
-     lingoteach_lessons|                                     |
-     lynx            |          []    [] []          []    |
-     m4              | []          []    []          []    |
-     make            | [] [] []          [] []       []    |
-     man-db          |                () ()                |
-     mysecretdiary   |             []                      |
-     nano            | []          [] []             []    |
-     nano_1_0        | []          [] []          []    [] |
-     opcodes         |             []                []    |
-     parted          | []                []             [] |
-     ptx             | []       [] []             [] []    |
-     python          |                                     |
-     recode          | [] []          []                   |
-     sed             | [] [] []    [] [] [] []       []    |
-     sh-utils        |                [] []       []       |
-     sharutils       | []                []          []    |
-     sketch          |                ()                   |
-     soundtracker    | []    []                            |
-     sp              |                                     |
-     tar             | []    []    [] [] []       []       |
-     texinfo         |    [] []          []                |
-     textutils       | []                [] []    []       |
-     util-linux      |                () []                |
-     vorbis-tools    |          []                         |
-     wastesedge      |                                     |
-     wdiff           | []       [] []                      |
-     wget            | [] [] [] []       []          []    |
-                     +-------------------------------------+
-                       gl he hr hu id it ja ko lv nb nl nn
-                       23  9 12 19 16 13 26  9  1  7 19  3
-     
-                       no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW
-                     +----------------------------------------------+
-     a2ps            | () () ()  []   []    [] [] []                | 10
-     ap-utils        |                               ()             |  0
-     bash            |           []                                 |  6
-     bfd             |                         [] []                |  5
-     binutils        |                         [] []                |  5
-     bison           |           []   []       [] []                | 12
-     clisp           |                                              |  0
-     clisp           |                                              |  5
-     clisplow        |                                              |  0
-     cpio            |    []     []   []       []                   | 12
-     darkstat        |           []            []        ()    ()   |  2
-     diffutils       |    []     []   []       [] []           []   | 17
-     enscript        |           []   []       [] []                |  8
-     error           |                   []       []           []   |  7
-     fetchmail       |    ()     ()               []                |  6
-     fileutils       |                []    [] [] []     []    []   | 14
-     findutils       |    []     []   [] [] [] [] []                | 21
-     flex            |                []       [] []                |  9
-     gas             |                            []                |  3
-     gawk            |                         [] []                |  6
-     gcal            |                         [] []                |  4
-     gcc             |                            []                |  4
-     gettext         |                [] [] [] [] []           []   | 13
-     gnupg           |    []                   [] []                | 14
-     gprof           |                         [] []                |  5
-     gpsdrive        |                   []    []                   |  3
-     grep            |    []     []   []    []    []                | 20
-     gretl           |                                              |  1
-     gthumb          |           ()   ()       []                   |  1
-     hello           | [] []          [] []    [] [] []             | 28
-     id-utils        |           []   []       [] []                |  9
-     indent          |           []   [] []    [] []                | 14
-     jpilot          | ()                      () []           []   |  5
-     jwhois          |           []   ()       () []           []   |  7
-     kbd             |                         [] []                |  5
-     ld              |                         [] []                |  4
-     libc            | [] []     []      []    [] []                | 18
-     libiconv        |           []   [] []    [] []                | 12
-     lifelines       |                         []                   |  1
-     lilypond        |                         []                   |  4
-     lingoteach      |           []            []                   |  5
-     lingoteach_lessons|                                   ()         |  0
-     lynx            |           []   []       [] []                | 13
-     m4              |    []     []   []       []                   | 13
-     make            |    []     []   []       [] []                | 15
-     man-db          |                                              |  3
-     mysecretdiary   |           []            [] []                |  7
-     nano            |    []          []       []    []             | 13
-     nano_1_0        |    []          []       []    []             | 14
-     opcodes         |           []            [] []                |  8
-     parted          |       []  []            [] []                | 12
-     ptx             | [] [] []  []   []       [] []                | 19
-     python          |                                              |  0
-     recode          |    []     []   []    [] [] []                | 15
-     sed             |           []   [] [] [] [] []                | 24
-     sh-utils        |                []          []                |  9
-     sharutils       |                []       [] []           []   | 14
-     sketch          |           []   ()       []                   |  4
-     soundtracker    |                         []                   |  6
-     sp              |                                              |  1
-     tar             | [] []     []      [] [] [] []                | 19
-     texinfo         |                []       []                   | 10
-     textutils       |                []    [] [] []           []   | 14
-     util-linux      |           []            [] []                | 10
-     vorbis-tools    |                         []                   |  3
-     wastesedge      |                                              |  0
-     wdiff           |           []   [] []    [] []                | 14
-     wget            |    []          [] [] [] [] [] []        []   | 24
-                     +----------------------------------------------+
-       37 teams        no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW
-       68 domains       4 15  2  28   28 12 10 49 43  4   1     9    609
+     Ready PO files       af am an ar as ast az be bg bn bn_IN bs ca crh cs
+                        +---------------------------------------------------+
+     a2ps               |                       []                []     [] |
+     aegis              |                                                   |
+     anubis             |                                                   |
+     aspell             |                []                       []     [] |
+     bash               |                          []             []     [] |
+     bfd                |                                                   |
+     binutils           |                                         []        |
+     bison              |                                                   |
+     bison-runtime      |                []                                 |
+     buzztrax           |                                                [] |
+     ccd2cue            |                                                   |
+     ccide              |                                                   |
+     cflow              |                                                   |
+     clisp              |                                                   |
+     coreutils          |                                         []     [] |
+     cpio               |                                                   |
+     cppi               |                                                   |
+     cpplib             |                                         []        |
+     cryptsetup         |                                                [] |
+     datamash           |                                                   |
+     denemo             |                                         []     [] |
+     dfarc              |                                         []        |
+     dialog             |       []                                []     [] |
+     dico               |                                                   |
+     diffutils          |                                                [] |
+     dink               |                                         []        |
+     direvent           |                                                   |
+     doodle             |                                                [] |
+     dos2unix           |                                                   |
+     dos2unix-man       |                                                   |
+     e2fsprogs          |                                         []     [] |
+     enscript           |                                         []        |
+     exif               |                                                [] |
+     fetchmail          |                                         []     [] |
+     findutils          |                                                [] |
+     flex               |                                         []        |
+     freedink           |                                         []     [] |
+     fusionforge        |                                                   |
+     gas                |                                                   |
+     gawk               |                                         []        |
+     gcal               |                                         []        |
+     gcc                |                                                   |
+     gdbm               |                                                   |
+     gettext-examples   | []             []        []             []     [] |
+     gettext-runtime    |                          []             []     [] |
+     gettext-tools      |                          []             []        |
+     gjay               |                                                   |
+     glunarclock        |                []        []                    [] |
+     gnubiff            |                                                [] |
+     gnubik             |          []                                       |
+     gnucash            |          ()              ()             []        |
+     gnuchess           |                                                   |
+     gnulib             |                                                [] |
+     gnunet             |                                                   |
+     gnunet-gtk         |                                                   |
+     gold               |                                                   |
+     gphoto2            |                                                [] |
+     gprof              |                          []                       |
+     gramadoir          |                                                   |
+     grep               |                          []             []     [] |
+     grub               |                                         []        |
+     gsasl              |                                                   |
+     gss                |                                                   |
+     gst-plugins-bad    |                          []                    [] |
+     gst-plugins-base   |                          []             []     [] |
+     gst-plugins-good   |                          []             []     [] |
+     gst-plugins-ugly   |                          []             []     [] |
+     gstreamer          |                []        []             []     [] |
+     gtick              |                                                [] |
+     gtkam              |                       []                       [] |
+     gtkspell           | []             []     []                []     [] |
+     guix               |                                                   |
+     guix-packages      |                                                   |
+     gutenprint         |                                         []        |
+     hello              |                                         []        |
+     help2man           |                                                   |
+     help2man-texi      |                                                   |
+     hylafax            |                                                   |
+     idutils            |                                                   |
+     iso_15924          |                                                [] |
+     iso_3166           | []          []        [] [] []  []   [] [] []  [] |
+     iso_3166_2         |                                                   |
+     iso_4217           |                                                [] |
+     iso_639            |             [] []     [] [] []  []      [] []  [] |
+     iso_639_3          |                []                          []     |
+     iso_639_5          |                                                   |
+     jwhois             |                                                   |
+     kbd                |                                                [] |
+     klavaro            |          []              [] []          []     [] |
+     ld                 |                          []                       |
+     leafpad            |                       [] []             []     [] |
+     libc               |                          []             []     [] |
+     libexif            |                       ()                          |
+     libextractor       |                                                   |
+     libgnutls          |                                                [] |
+     libgphoto2         |                                                [] |
+     libgphoto2_port    |                                                [] |
+     libgsasl           |                                                   |
+     libiconv           |                          []                    [] |
+     libidn             |                                                [] |
+     liferea            |          []    []                       []     [] |
+     lilypond           |                                         []     [] |
+     lordsawar          |                                         []        |
+     lprng              |                                                   |
+     lynx               |                                         []     [] |
+     m4                 |                                                [] |
+     mailfromd          |                                                   |
+     mailutils          |                                                   |
+     make               |                                                [] |
+     man-db             |                                         []     [] |
+     man-db-manpages    |                                                   |
+     midi-instruments   |          []                             []     [] |
+     minicom            |                                                [] |
+     mkisofs            |                                                [] |
+     myserver           |                                                [] |
+     nano               |                          []             []     [] |
+     opcodes            |                                                   |
+     parted             |                                                [] |
+     pies               |                                                   |
+     pnmixer            |                                                   |
+     popt               |                                                [] |
+     procps-ng          |                                                   |
+     procps-ng-man      |                                                   |
+     psmisc             |                                                [] |
+     pspp               |                                         []        |
+     pushover           |                                                [] |
+     pwdutils           |                                                   |
+     pyspread           |                                                   |
+     radius             |                                         []        |
+     recode             |                       []                []     [] |
+     recutils           |                                                   |
+     rpm                |                                                   |
+     rush               |                                                   |
+     sarg               |                                                   |
+     sed                |                []        []             []     [] |
+     sharutils          |                                                [] |
+     shishi             |                                                   |
+     skribilo           |                                                   |
+     solfege            |                                         []     [] |
+     solfege-manual     |                                                   |
+     spotmachine        |                                                   |
+     sudo               |                                         []     [] |
+     sudoers            |                                         []     [] |
+     sysstat            |                                                [] |
+     tar                |                          []             []     [] |
+     texinfo            |                                         []     [] |
+     texinfo_document   |                                         []     [] |
+     tigervnc           |                          []                       |
+     tin                |                                                   |
+     tin-man            |                                                   |
+     tracgoogleappsa... |                                                   |
+     trader             |                                                   |
+     util-linux         |                                                [] |
+     ve                 |                                                   |
+     vice               |                                                   |
+     vmm                |                                                   |
+     vorbis-tools       |                                                [] |
+     wastesedge         |                                                   |
+     wcd                |                                                   |
+     wcd-man            |                                                   |
+     wdiff              |                                         []     [] |
+     wget               |                                                [] |
+     wyslij-po          |                                                   |
+     xboard             |                                                   |
+     xdg-user-dirs      | []    []    [] []     [] []     []      [] []  [] |
+     xkeyboard-config   |                          []             []     [] |
+                        +---------------------------------------------------+
+                          af am an ar as ast az be bg bn bn_IN bs ca crh cs
+                           4  0  2  5  3 11   0  8 25  3   3    1 55  4  74
+
+                          da  de  el en en_GB en_ZA eo es et eu fa fi  fr 
+                        +--------------------------------------------------+
+     a2ps               | []  []  []     []         [] [] []       []  []  |
+     aegis              | []  []                       []              []  |
+     anubis             | []  []                       []          []  []  |
+     aspell             | []  []         []         [] []          []  []  |
+     bash               |                           [] []              []  |
+     bfd                | []                           []          []  []  |
+     binutils           |                              []          []  []  |
+     bison              | []  []  []                [] [] []       []  []  |
+     bison-runtime      | []  []  []                [] [] []       []  []  |
+     buzztrax           | []  []                                   []  []  |
+     ccd2cue            | []  []                    []                 []  |
+     ccide              | []  []                    [] []          []  []  |
+     cflow              | []  []                    []             []  []  |
+     clisp              | []  []     []                []              []  |
+     coreutils          | []  []                       [] []           []  |
+     cpio               | []  []                       []          []  []  |
+     cppi               | []  []                    []             []  []  |
+     cpplib             | []  []                    [] []          []  []  |
+     cryptsetup         | []  []                       []          []  []  |
+     datamash           | []  []                    []                 []  |
+     denemo             | []                                               |
+     dfarc              | []  []                    [] []          []  []  |
+     dialog             | []  []  []                [] []    [] [] []  []  |
+     dico               | []  []                                   []  []  |
+     diffutils          | []  []  []                [] []              []  |
+     dink               | []  []                    [] []          []  []  |
+     direvent           | []  []                    []                 []  |
+     doodle             | []  []                    []             []      |
+     dos2unix           | []  []                    [] []              []  |
+     dos2unix-man       |     []                       []              []  |
+     e2fsprogs          | []  []                    [] []              []  |
+     enscript           | []  []         []         []             []  []  |
+     exif               | []  []                    [] []          []  []  |
+     fetchmail          | []  ()  []     []         [] []              []  |
+     findutils          | []  []  []                [] [] []       []  []  |
+     flex               | []  []                    [] []          []  []  |
+     freedink           | []  []  []                [] []    []    []  []  |
+     fusionforge        |     []                       []              []  |
+     gas                |                              []          []  []  |
+     gawk               | []  []                       []          []  []  |
+     gcal               | []  []                       []              []  |
+     gcc                |     []                                           |
+     gdbm               | []  []                    []             []  []  |
+     gettext-examples   | []  []  []                [] []          []  []  |
+     gettext-runtime    | []  []                    [] []          []  []  |
+     gettext-tools      | []  []                       []          []  []  |
+     gjay               |     []                    []             []  []  |
+     glunarclock        | []  []                    []             []  []  |
+     gnubiff            |     ()                    []             []  ()  |
+     gnubik             | []  []                    []             []  []  |
+     gnucash            | []  ()  ()     ()            ()          ()  ()  |
+     gnuchess           |     []                    [] []              []  |
+     gnulib             | []  []                    [] [] []       []  []  |
+     gnunet             |                              []                  |
+     gnunet-gtk         |     []                                           |
+     gold               |                              []          []  []  |
+     gphoto2            | []  ()                    []                 []  |
+     gprof              | []  []                    [] []          []  []  |
+     gramadoir          | []  []                    []             []  []  |
+     grep               | []  []                    [] [] []       []  []  |
+     grub               | []  []                       []          []  []  |
+     gsasl              | []  []                    []             []  []  |
+     gss                | []  []                    []             []  []  |
+     gst-plugins-bad    | []  []                                       []  |
+     gst-plugins-base   | []  []  []                   []          []  []  |
+     gst-plugins-good   | []  []  []                   []    []    []  []  |
+     gst-plugins-ugly   | []  []  []                [] []    []    []  []  |
+     gstreamer          | []  []  []                   []    []    []  []  |
+     gtick              | []  ()                    []             []  []  |
+     gtkam              | []  ()                    [] []          []  []  |
+     gtkspell           | []  []  []                [] []    []    []  []  |
+     guix               | []                        []                     |
+     guix-packages      |                                                  |
+     gutenprint         | []  []                                   []  []  |
+     hello              | []  []  []                [] [] []       []  []  |
+     help2man           | []  []  []                [] []          []  []  |
+     help2man-texi      |     []                       []              []  |
+     hylafax            |     []                       []                  |
+     idutils            | []  []                    []             []  []  |
+     iso_15924          | []  ()                    [] []    ()    []  ()  |
+     iso_3166           | []  ()  []                [] [] [] ()    []  ()  |
+     iso_3166_2         | []  ()                             ()        ()  |
+     iso_4217           | []  ()  []                   [] [] ()    []  ()  |
+     iso_639            | []  ()                    [] []    ()    []  ()  |
+     iso_639_3          |     ()                             ()        ()  |
+     iso_639_5          |     ()                             ()        ()  |
+     jwhois             |     []                    [] []          []  []  |
+     kbd                | []  []  []                [] []              []  |
+     klavaro            | []  []  []                [] []    []        []  |
+     ld                 | []                           []          []  []  |
+     leafpad            | []  []  []                [] []    []    []  []  |
+     libc               | []  []                       []          []  []  |
+     libexif            | []  []         ()            []              []  |
+     libextractor       |     []                                           |
+     libgnutls          |     []                    []             []  []  |
+     libgphoto2         | []  ()                                       []  |
+     libgphoto2_port    | []  ()                       []    []    []  []  |
+     libgsasl           | []  []                    []             []  []  |
+     libiconv           | []  []                    [] [] []       []  []  |
+     libidn             | []  []                    []             []  []  |
+     liferea            | []  ()  []                   []    []    []  []  |
+     lilypond           | []  []  []                [] []              []  |
+     lordsawar          | []  []                                           |
+     lprng              |                                                  |
+     lynx               | []  []                    []    []       []  []  |
+     m4                 | []  []  []                []             []  []  |
+     mailfromd          |                                              []  |
+     mailutils          |     []                       []          []  []  |
+     make               | []  []                       []          []  []  |
+     man-db             | []  []                    []                 []  |
+     man-db-manpages    |     []                                       []  |
+     midi-instruments   | []  []  []                [] [] []    [] []  []  |
+     minicom            | []  []                       []          []  []  |
+     mkisofs            |                           []             []  []  |
+     myserver           |     []                    []             []  []  |
+     nano               | []  []                    [] []    []    []  []  |
+     opcodes            | []  []                       []          []  []  |
+     parted             | []  []                                       []  |
+     pies               |     []                                           |
+     pnmixer            |     []                                       []  |
+     popt               | []  []                    [] []          []  []  |
+     procps-ng          |     []                                       []  |
+     procps-ng-man      |     []                                       []  |
+     psmisc             | []  []  []                []       []    []  []  |
+     pspp               |     []                       []              []  |
+     pushover           |     ()                    [] []              []  |
+     pwdutils           | []  []                                       []  |
+     pyspread           | []  []                                       []  |
+     radius             |                              []              []  |
+     recode             | []  []  []                [] []          []  []  |
+     recutils           |     []                       []          []  []  |
+     rpm                | []  []                    []             []  []  |
+     rush               |     []                                   []  []  |
+     sarg               | []                                           []  |
+     sed                | []  []  []                [] [] []       []  []  |
+     sharutils          |     []                    []    []           []  |
+     shishi             |     []                                   []  []  |
+     skribilo           | []                           []              []  |
+     solfege            | []  []                    [] [] []    [] []  []  |
+     solfege-manual     |     []                    [] [] []           []  |
+     spotmachine        | []  []                    []             []  []  |
+     sudo               | []  []                    [] []          []  []  |
+     sudoers            | []  []  []                []             []  []  |
+     sysstat            | []  []                    [] []          []  []  |
+     tar                | []  []                    [] [] []       []  []  |
+     texinfo            | []  []                    [] []              []  |
+     texinfo_document   |     []                    [] []              []  |
+     tigervnc           | []  []  []                []             []  []  |
+     tin                | []  []                          []           []  |
+     tin-man            |                []                                |
+     tracgoogleappsa... | []  []                    []             []  []  |
+     trader             | []  []         []         []             []  []  |
+     util-linux         | []  []                       []              []  |
+     ve                 |     []                    [] []          []  []  |
+     vice               | ()  ()                                       ()  |
+     vmm                |     []                                   []      |
+     vorbis-tools       | []  []                    []                 []  |
+     wastesedge         | []                                               |
+     wcd                |     []                    [] []          []      |
+     wcd-man            |     []                                           |
+     wdiff              | []  []                    [] [] []       []  []  |
+     wget               |     []                    [] [] []       []  []  |
+     wyslij-po          |     []                    []             []  []  |
+     xboard             | []  []                       []              []  |
+     xdg-user-dirs      | []  []  []                [] [] [] [] [] []  []  |
+     xkeyboard-config   | []  []  []                [] []          []  []  |
+                        +--------------------------------------------------+
+                          da  de  el en en_GB en_ZA eo es et eu fa fi  fr 
+                          119 131 32  1   6     0   94 95 22 13  4 102 139
+
+                          ga gd gl gu he hi hr hu hy ia id is it ja ka kk
+                        +-------------------------------------------------+
+     a2ps               |                   []          []    [] []       |
+     aegis              |                                     []          |
+     anubis             |                   [] []       []    []          |
+     aspell             | []                []          []    [] []       |
+     bash               |                      []       []    [] []       |
+     bfd                |                               []       []       |
+     binutils           |                               []    [] []       |
+     bison              |                   []                            |
+     bison-runtime      | []    []          [] []    [] []    [] []       |
+     buzztrax           |                                                 |
+     ccd2cue            |                      []                         |
+     ccide              |                   [] []                         |
+     cflow              | []                []          []                |
+     clisp              |                                                 |
+     coreutils          |                      []                []       |
+     cpio               | []                [] []       []    [] []       |
+     cppi               |       []          [] []             [] []       |
+     cpplib             |                               []       []       |
+     cryptsetup         |                                     []          |
+     datamash           |                                                 |
+     denemo             |                                     []          |
+     dfarc              |                   [] []             []          |
+     dialog             | [] [] []          [] []    [] [] [] [] []       |
+     dico               |                                                 |
+     diffutils          |                      []       []    [] []       |
+     dink               |                      []                         |
+     direvent           |                      []                         |
+     doodle             | []                                  []          |
+     dos2unix           |                      []                []       |
+     dos2unix-man       |                                                 |
+     e2fsprogs          |                      []       []                |
+     enscript           | []                []          []                |
+     exif               |       []          []          [] [] [] []       |
+     fetchmail          |                               []    [] []       |
+     findutils          | []    []          [] []       []    [] []       |
+     flex               | []                                              |
+     freedink           |                   [] []       []    []          |
+     fusionforge        |                                                 |
+     gas                |                               []                |
+     gawk               |                               []    () []       |
+     gcal               |                                                 |
+     gcc                |                                                 |
+     gdbm               |                                                 |
+     gettext-examples   | []    []          [] []       []    [] []       |
+     gettext-runtime    | []    []          [] []       []    [] []       |
+     gettext-tools      |                               []    [] []       |
+     gjay               |       []                                        |
+     glunarclock        | []    []          [] []       []    []          |
+     gnubiff            |                      []       []    ()          |
+     gnubik             |       []          []                []          |
+     gnucash            |          () () ()    ()             ()          |
+     gnuchess           |                                                 |
+     gnulib             | []    []             []             [] []       |
+     gnunet             |                                                 |
+     gnunet-gtk         |                                                 |
+     gold               |                               []    []          |
+     gphoto2            |                      []       []    [] []       |
+     gprof              | []                   []       []    []          |
+     gramadoir          | []                   []       []                |
+     grep               | []    []          [] []       []    [] []       |
+     grub               |       []             []             []          |
+     gsasl              | []                [] []       []    []          |
+     gss                | []                [] []       []    []          |
+     gst-plugins-bad    |                   [] []       []                |
+     gst-plugins-base   |       []          [] []       []                |
+     gst-plugins-good   |       []          [] []       []    [] []       |
+     gst-plugins-ugly   |       []          [] []       []    [] []       |
+     gstreamer          |       []          [] []       []    []          |
+     gtick              | []    []             []       []    []          |
+     gtkam              |                      []       [] [] [] []       |
+     gtkspell           | []    []    []    [] [] []    [] [] [] []       |
+     guix               |                                                 |
+     guix-packages      |                                                 |
+     gutenprint         |       []             []             []          |
+     hello              | []    []          [] []       []                |
+     help2man           |                   []                [] []       |
+     help2man-texi      |                                                 |
+     hylafax            |                               []                |
+     idutils            |                      []       []                |
+     iso_15924          |       []             []    [] [] [] []          |
+     iso_3166           | []    [] [] [] [] [] []    [] [] [] [] []    [] |
+     iso_3166_2         |                               []    []          |
+     iso_4217           |                   [] []       [] [] [] []       |
+     iso_639            | []    [] []       [] []       [] [] [] []       |
+     iso_639_3          |       []                            []          |
+     iso_639_5          |                                                 |
+     jwhois             |       []             []       []    []          |
+     kbd                |                      []       []    []          |
+     klavaro            |       []          [] []             []       [] |
+     ld                 | []                            []    [] []       |
+     leafpad            | []    []    []    [] []       []    [] ()       |
+     libc               |       []          []          []    [] []       |
+     libexif            |                                     []          |
+     libextractor       |                                                 |
+     libgnutls          |                                     []          |
+     libgphoto2         |                                     [] []       |
+     libgphoto2_port    |                                     [] []       |
+     libgsasl           | []                   []       []    []          |
+     libiconv           | []    []          [] []       []    [] []       |
+     libidn             |                   [] []       []    []          |
+     liferea            |       []    []       []             [] []       |
+     lilypond           |                                     []          |
+     lordsawar          |                                                 |
+     lprng              |                               []                |
+     lynx               |                      []       []    [] []       |
+     m4                 | []    []          []          []       []       |
+     mailfromd          |                                                 |
+     mailutils          |                                                 |
+     make               |                   []          []    [] []       |
+     man-db             |                               []       []       |
+     man-db-manpages    |                               []       []       |
+     midi-instruments   |       []    []    [] [] []    [] [] [] []       |
+     minicom            |                      []       []       []       |
+     mkisofs            |                               []    []          |
+     myserver           |                                     []          |
+     nano               | []    []          [] []             [] []       |
+     opcodes            | []                            []    []          |
+     parted             |       []             []       []    [] []       |
+     pies               |                                                 |
+     pnmixer            |                   []                []          |
+     popt               | []    [] []       [] []    [] [] [] [] []       |
+     procps-ng          |                                                 |
+     procps-ng-man      |                                                 |
+     psmisc             |                   [] []       []    []          |
+     pspp               |       []                               []       |
+     pushover           |                                     []          |
+     pwdutils           |                               []                |
+     pyspread           |                                                 |
+     radius             |                               []                |
+     recode             | []    []    []    [] []       []    []          |
+     recutils           |                                                 |
+     rpm                |                               []                |
+     rush               |       []                                        |
+     sarg               |                                                 |
+     sed                | []    []          [] []       []    [] []       |
+     sharutils          |                                                 |
+     shishi             |                                                 |
+     skribilo           |                      []                         |
+     solfege            |       []                            []          |
+     solfege-manual     |                                                 |
+     spotmachine        |                                                 |
+     sudo               |       []          []                [] []       |
+     sudoers            |                   []                [] []       |
+     sysstat            |                   [] []       []       []       |
+     tar                | []                [] []       []    [] []       |
+     texinfo            |                   []          []    []          |
+     texinfo_document   |                   [] []             []          |
+     tigervnc           |                                                 |
+     tin                |                                                 |
+     tin-man            |                                                 |
+     tracgoogleappsa... |       []    []    [] []                         |
+     trader             |                   [] []                         |
+     util-linux         |                                        []       |
+     ve                 |                                     []          |
+     vice               |                      ()             ()          |
+     vmm                |                                                 |
+     vorbis-tools       |                   []          []                |
+     wastesedge         |                                     []          |
+     wcd                |                                                 |
+     wcd-man            |                                                 |
+     wdiff              |       []             []             []          |
+     wget               |                   [] []             [] []       |
+     wyslij-po          |       []          []          []                |
+     xboard             |                                                 |
+     xdg-user-dirs      | [] [] [] [] [] [] [] []    [] [] [] [] []    [] |
+     xkeyboard-config   |       []          [] []       []    [] []       |
+                        +-------------------------------------------------+
+                          ga gd gl gu he hi hr hu hy ia id is it ja ka kk
+                          35  2 47  4  8  2 60 71  2  6 81 11 87 57  0  3
+
+                          kn ko ku ky lg lt lv mk ml mn mr ms mt nb ne nl 
+                        +--------------------------------------------------+
+     a2ps               |                                  []          []  |
+     aegis              |                                              []  |
+     anubis             |                                  []    []    []  |
+     aspell             |                            []                []  |
+     bash               |                                        []    []  |
+     bfd                |                                                  |
+     binutils           |                                                  |
+     bison              |                                              []  |
+     bison-runtime      |          []    [] []             []    []    []  |
+     buzztrax           |                                                  |
+     ccd2cue            |                                                  |
+     ccide              |                   []                         []  |
+     cflow              |                                              []  |
+     clisp              |                                              []  |
+     coreutils          |                                        []    []  |
+     cpio               |                                              []  |
+     cppi               |                                                  |
+     cpplib             |                                              []  |
+     cryptsetup         |                                              []  |
+     datamash           |                                        []    []  |
+     denemo             |                                                  |
+     dfarc              |                      []                      []  |
+     dialog             |       []       [] []             []    []    []  |
+     dico               |                                                  |
+     diffutils          |                   []                   []    []  |
+     dink               |                                              []  |
+     direvent           |                                              []  |
+     doodle             |                                              []  |
+     dos2unix           |                                        []    []  |
+     dos2unix-man       |                                              []  |
+     e2fsprogs          |                                              []  |
+     enscript           |                                              []  |
+     exif               |    []             []                         []  |
+     fetchmail          |                                              []  |
+     findutils          |                                        []    []  |
+     flex               |                                              []  |
+     freedink           |                                        []    []  |
+     fusionforge        |                                                  |
+     gas                |                                                  |
+     gawk               |                                              []  |
+     gcal               |                                                  |
+     gcc                |                                                  |
+     gdbm               |                                                  |
+     gettext-examples   |          []       []             [] [] []    []  |
+     gettext-runtime    |    []                                  []    []  |
+     gettext-tools      |    []                                            |
+     gjay               |                                                  |
+     glunarclock        |                   []                         []  |
+     gnubiff            |                                              []  |
+     gnubik             |                                        []    []  |
+     gnucash            | () ()          () ()          ()       () () []  |
+     gnuchess           |                                        []    []  |
+     gnulib             |                                              []  |
+     gnunet             |                                                  |
+     gnunet-gtk         |                                                  |
+     gold               |                                                  |
+     gphoto2            |                                              []  |
+     gprof              |                                  []          []  |
+     gramadoir          |                                              []  |
+     grep               |                                        []    []  |
+     grub               |                []                      []    []  |
+     gsasl              |                                              []  |
+     gss                |                                                  |
+     gst-plugins-bad    |                   []                   []    []  |
+     gst-plugins-base   |                   []                   []    []  |
+     gst-plugins-good   |                [] []                   []    []  |
+     gst-plugins-ugly   |                   []             [] [] []    []  |
+     gstreamer          |                []                      []    []  |
+     gtick              |                                              []  |
+     gtkam              |                                        []    []  |
+     gtkspell           |          []    [] []       []    []    []    []  |
+     guix               |                                                  |
+     guix-packages      |                                                  |
+     gutenprint         |                                              []  |
+     hello              |                   []                   []    []  |
+     help2man           |                                        []        |
+     help2man-texi      |                                                  |
+     hylafax            |                                              []  |
+     idutils            |                                              []  |
+     iso_15924          |                () []                         []  |
+     iso_3166           | [] [] []       () [] [] []    []       []    []  |
+     iso_3166_2         |                ()                            []  |
+     iso_4217           |                () []                   []    []  |
+     iso_639            | [] []          () []    []    []             []  |
+     iso_639_3          | []             ()             []                 |
+     iso_639_5          |                ()                                |
+     jwhois             |                   []                         []  |
+     kbd                |                                              []  |
+     klavaro            |                                        []    []  |
+     ld                 |                                                  |
+     leafpad            |    []    []    [] []                         []  |
+     libc               |    []                                        []  |
+     libexif            |                                              []  |
+     libextractor       |                                              []  |
+     libgnutls          |                                  []          []  |
+     libgphoto2         |                                              []  |
+     libgphoto2_port    |                                              []  |
+     libgsasl           |                                              []  |
+     libiconv           |                []                            []  |
+     libidn             |                                              []  |
+     liferea            |                [] []                         []  |
+     lilypond           |                                              []  |
+     lordsawar          |                                                  |
+     lprng              |                                                  |
+     lynx               |                                              []  |
+     m4                 |                                              []  |
+     mailfromd          |                                                  |
+     mailutils          |                                                  |
+     make               |    []                                        []  |
+     man-db             |                                              []  |
+     man-db-manpages    |                                              []  |
+     midi-instruments   |    [] []       []          []    []       [] []  |
+     minicom            |                                        []        |
+     mkisofs            |                                              []  |
+     myserver           |                                                  |
+     nano               |                                  []    []    []  |
+     opcodes            |                                              []  |
+     parted             |    []                                        []  |
+     pies               |                                                  |
+     pnmixer            |                                              []  |
+     popt               | [] []             []                   []    []  |
+     procps-ng          |                                                  |
+     procps-ng-man      |                                                  |
+     psmisc             |                                              []  |
+     pspp               |                []                            []  |
+     pushover           |                                                  |
+     pwdutils           |                                              []  |
+     pyspread           |                                                  |
+     radius             |                                              []  |
+     recode             |                                        []    []  |
+     recutils           |                                              []  |
+     rpm                |                                              []  |
+     rush               |                                              []  |
+     sarg               |                                                  |
+     sed                |                                        []    []  |
+     sharutils          |                                              []  |
+     shishi             |                                                  |
+     skribilo           |                                                  |
+     solfege            |                                        []    []  |
+     solfege-manual     |                                              []  |
+     spotmachine        |                                              []  |
+     sudo               |    []                                  []    []  |
+     sudoers            |    []                                  []    []  |
+     sysstat            |                                        []    []  |
+     tar                |          []                            []    []  |
+     texinfo            |                                              []  |
+     texinfo_document   |                                              []  |
+     tigervnc           |                                              []  |
+     tin                |                                                  |
+     tin-man            |                                                  |
+     tracgoogleappsa... |                   []                   []    []  |
+     trader             |                                        []        |
+     util-linux         |                                              []  |
+     ve                 |                                              []  |
+     vice               |                                              []  |
+     vmm                |                                              []  |
+     vorbis-tools       |                                              []  |
+     wastesedge         |                                              []  |
+     wcd                |                                              []  |
+     wcd-man            |                                              []  |
+     wdiff              |                                              []  |
+     wget               |                                        []    []  |
+     wyslij-po          |                                              []  |
+     xboard             |                                              []  |
+     xdg-user-dirs      | [] [] [] []    [] [] [] []    []       []    []  |
+     xkeyboard-config   |    []          []                            []  |
+                        +--------------------------------------------------+
+                          kn ko ku ky lg lt lv mk ml mn mr ms mt nb ne nl 
+                           5 15  4  6  0 13 23  3  3  3  4 11  2 42  1 125
+
+                          nn or pa pl  ps pt pt_BR ro ru rw sk sl sq sr 
+                        +------------------------------------------------+
+     a2ps               |          []     []  []   [] []       []    []  |
+     aegis              |                     []      []                 |
+     anubis             |          []                 []             []  |
+     aspell             |          []         []   [] []    [] []    []  |
+     bash               |          []         []      []    [] []    []  |
+     bfd                |                             []             []  |
+     binutils           |                             []             []  |
+     bison              |          []         []                     []  |
+     bison-runtime      |          []     []  []   [] []       [] [] []  |
+     buzztrax           |                     []                         |
+     ccd2cue            |                     []                     []  |
+     ccide              |          []                 []             []  |
+     cflow              |          []         []                     []  |
+     clisp              |                             []                 |
+     coreutils          |          []                 []       []    []  |
+     cpio               |          []                 []             []  |
+     cppi               |          []         []                     []  |
+     cpplib             |                     []      []             []  |
+     cryptsetup         |          []         []                     []  |
+     datamash           |                     []                     []  |
+     denemo             |                                                |
+     dfarc              |          []         []                     []  |
+     dialog             |          []         []   [] []    [] []    []  |
+     dico               |          []                                    |
+     diffutils          |          []         []                     []  |
+     dink               |                                                |
+     direvent           |          []         []                     []  |
+     doodle             |                                         [] []  |
+     dos2unix           |          []         []      []             []  |
+     dos2unix-man       |          []         []                         |
+     e2fsprogs          |          []                                    |
+     enscript           |          []         []   [] []       []    []  |
+     exif               |          []         []   [] []    []       []  |
+     fetchmail          |          []                 []          []     |
+     findutils          |          []         []      []    [] []    []  |
+     flex               |          []         []   [] []             []  |
+     freedink           |          []         []      []       []    []  |
+     fusionforge        |                                                |
+     gas                |                                                |
+     gawk               |          []                                    |
+     gcal               |                                                |
+     gcc                |                                                |
+     gdbm               |          []         []                     []  |
+     gettext-examples   |          []     []  []   [] []    [] []    []  |
+     gettext-runtime    | []       []     []  []   [] []    [] []    []  |
+     gettext-tools      |          []         []   [] []    [] []    []  |
+     gjay               |                                            []  |
+     glunarclock        |          []         []   []       [] []    []  |
+     gnubiff            |                                            []  |
+     gnubik             |          []         []               []    []  |
+     gnucash            |          ()     ()  ()   () ()             []  |
+     gnuchess           |                     []                     []  |
+     gnulib             |          []         []      []       []    []  |
+     gnunet             |                                                |
+     gnunet-gtk         |                                                |
+     gold               |                                                |
+     gphoto2            |          []         []   [] []             []  |
+     gprof              |                     []   [] []             []  |
+     gramadoir          |                                   []       []  |
+     grep               |          []         []      []    [] []    []  |
+     grub               |          []         []      []       []    []  |
+     gsasl              |          []                       []       []  |
+     gss                |          []              []       []       []  |
+     gst-plugins-bad    |          []         []      []    []       []  |
+     gst-plugins-base   |          []         []      []    [] []    []  |
+     gst-plugins-good   |          []         []   [] []    [] []    []  |
+     gst-plugins-ugly   |          []         []   [] []    [] []    []  |
+     gstreamer          |          []         []   [] []    [] []    []  |
+     gtick              |          []         []      []    []       []  |
+     gtkam              |       [] []         []      []    []       []  |
+     gtkspell           |          []     []  []   [] []    [] [] [] []  |
+     guix               |                                                |
+     guix-packages      |                                                |
+     gutenprint         |                                   [] []        |
+     hello              |          []         []      []    [] []    []  |
+     help2man           |          []         []      []             []  |
+     help2man-texi      |          []                                    |
+     hylafax            |                                                |
+     idutils            |          []                 []             []  |
+     iso_15924          |          []     ()       [] []       []    []  |
+     iso_3166           | [] [] [] []     ()  []   [] [] [] [] [] [] []  |
+     iso_3166_2         |          []     ()                         []  |
+     iso_4217           | []       []     ()       [] [] []    []    []  |
+     iso_639            |    [] [] []     ()       [] [] [] [] []    []  |
+     iso_639_3          |       []        ()                             |
+     iso_639_5          |                 ()                         []  |
+     jwhois             |          []         []   []                []  |
+     kbd                |          []                 []                 |
+     klavaro            |       [] []         []      []       []        |
+     ld                 |                                                |
+     leafpad            | []       []     []  []      []    [] []    []  |
+     libc               |          []                 []    []           |
+     libexif            |          []         ()            []           |
+     libextractor       |          []                                    |
+     libgnutls          |          []                                    |
+     libgphoto2         |          []                                    |
+     libgphoto2_port    |          []         []      []    []       []  |
+     libgsasl           |          []              []       []       []  |
+     libiconv           |          []         []            [] []    []  |
+     libidn             |          []         []                     []  |
+     liferea            |          []     []  []   [] ()    []    []     |
+     lilypond           |                                                |
+     lordsawar          |                                                |
+     lprng              |          []                                    |
+     lynx               |                     []      []                 |
+     m4                 |          []         []   [] []             []  |
+     mailfromd          |          []                                    |
+     mailutils          |          []                                    |
+     make               |          []         []      []                 |
+     man-db             |          []                 []             []  |
+     man-db-manpages    |          []                 []             []  |
+     midi-instruments   |          []     []  []   [] []    [] []    []  |
+     minicom            |          []         []   [] []                 |
+     mkisofs            |          []                 []             []  |
+     myserver           |                                      []    []  |
+     nano               |          []         []   [] []       []    []  |
+     opcodes            |                                                |
+     parted             |          []         []      []    [] []    []  |
+     pies               |          []                                    |
+     pnmixer            |                             []                 |
+     popt               |          []     []  []      []       []    []  |
+     procps-ng          |          []                                    |
+     procps-ng-man      |          []                                    |
+     psmisc             |          []         []      []             []  |
+     pspp               |          []                 []                 |
+     pushover           |                                                |
+     pwdutils           |          []                                    |
+     pyspread           | []                  []                         |
+     radius             |          []                 []                 |
+     recode             |          []     []  []   [] []    [] []    []  |
+     recutils           |                     []                     []  |
+     rpm                |          []                                    |
+     rush               |          []         []                     []  |
+     sarg               |                     []      []                 |
+     sed                |          []     []  []   [] []    [] []    []  |
+     sharutils          |          []         []                     []  |
+     shishi             |          []                                []  |
+     skribilo           |                                            []  |
+     solfege            |          []         []      []                 |
+     solfege-manual     |          []         []                         |
+     spotmachine        |                     []                     []  |
+     sudo               |          []         []      []    [] []    []  |
+     sudoers            |          []         []               []    []  |
+     sysstat            |          []         []      []    []       []  |
+     tar                |          []         []      []       []    []  |
+     texinfo            |          []         []      []                 |
+     texinfo_document   |          []         []                         |
+     tigervnc           |                     []      []             []  |
+     tin                |                             []                 |
+     tin-man            |                                                |
+     tracgoogleappsa... |          []         []      []             []  |
+     trader             |                             []             []  |
+     util-linux         |          []         []                         |
+     ve                 |          []         []                     []  |
+     vice               |                                                |
+     vmm                |                                                |
+     vorbis-tools       |          []                          []    []  |
+     wastesedge         |                                                |
+     wcd                |                                                |
+     wcd-man            |                                                |
+     wdiff              |          []         []      []       []    []  |
+     wget               |          []         []      []    []       []  |
+     wyslij-po          | []       []         []                     []  |
+     xboard             |          []                 []             []  |
+     xdg-user-dirs      | [] [] [] []  [] []  []   [] []    [] [] [] []  |
+     xkeyboard-config   |          []         []      []       []        |
+                        +------------------------------------------------+
+                          nn or pa pl  ps pt pt_BR ro ru rw sk sl sq sr 
+                           7  3  6 114  1 12  88   32 82  3 40 45  7 101
+
+                          sv  sw ta te tg th tr uk  ur vi  wa wo zh_CN
+                        +----------------------------------------------+
+     a2ps               | []              [] [] []     []              |
+     aegis              |                              []              |
+     anubis             | []                 [] []     []              |
+     aspell             | []                    []     []  []     []   |
+     bash               | []                    []     []         []   |
+     bfd                | []                    []     []              |
+     binutils           | []                    []     []              |
+     bison              | []                    []     []         []   |
+     bison-runtime      | []              [] [] []     []         []   |
+     buzztrax           | []                           []         []   |
+     ccd2cue            |                       []     []         []   |
+     ccide              | []                    []     []         []   |
+     cflow              | []                    []     []         []   |
+     clisp              |                                              |
+     coreutils          | []                    []     []              |
+     cpio               | []                 [] []     []         []   |
+     cppi               | []                    []     []         []   |
+     cpplib             | []                 [] []     []         []   |
+     cryptsetup         |                       []     []         []   |
+     datamash           | []                    []     []              |
+     denemo             |                                         []   |
+     dfarc              | []                           []              |
+     dialog             | []  []          []           []  []     []   |
+     dico               |                       []                     |
+     diffutils          | []                 [] []     []         []   |
+     dink               | []                                           |
+     direvent           |                       []     []              |
+     doodle             | []                           []              |
+     dos2unix           | []                    []     []         []   |
+     dos2unix-man       | []                    []                []   |
+     e2fsprogs          | []                    []     []         []   |
+     enscript           | []                 [] []     []              |
+     exif               | []                 [] []     []         []   |
+     fetchmail          | []                 []        []         []   |
+     findutils          | []                 [] []     []         []   |
+     flex               | []                 []        []         []   |
+     freedink           | []              []           []              |
+     fusionforge        |                                              |
+     gas                |                       []                     |
+     gawk               | []                           []         []   |
+     gcal               | []                 []                   []   |
+     gcc                | []                                           |
+     gdbm               |                       []     []              |
+     gettext-examples   | []                 [] []     []         []   |
+     gettext-runtime    | []                 [] []     []         []   |
+     gettext-tools      | []                 [] []     []         []   |
+     gjay               |                 []           []         []   |
+     glunarclock        | []                           []  []     []   |
+     gnubiff            | []                           []              |
+     gnubik             | []                    []     []         []   |
+     gnucash            |        () ()              () ()         []   |
+     gnuchess           |                       []     []         []   |
+     gnulib             | []                    []     []         []   |
+     gnunet             |                                              |
+     gnunet-gtk         |                                              |
+     gold               |                       []     []              |
+     gphoto2            | []                    []     []         []   |
+     gprof              | []                 [] []     []              |
+     gramadoir          | []                           []         []   |
+     grep               | []              []    []     []         []   |
+     grub               | []                 [] []     []              |
+     gsasl              | []                    []     []         []   |
+     gss                | []                           []         []   |
+     gst-plugins-bad    | []                 [] []     []         []   |
+     gst-plugins-base   | []                 [] []     []         []   |
+     gst-plugins-good   | []                 [] []     []         []   |
+     gst-plugins-ugly   | []                 [] []     []         []   |
+     gstreamer          | []                 [] []     []         []   |
+     gtick              |                       []     []         []   |
+     gtkam              | []                    []     []         []   |
+     gtkspell           | []              [] [] []     []  []     []   |
+     guix               |                                              |
+     guix-packages      |                                              |
+     gutenprint         |                    [] []     []         []   |
+     hello              | []              [] [] []     []         []   |
+     help2man           |                       []     []         []   |
+     help2man-texi      |                       []                     |
+     hylafax            |                              []              |
+     idutils            |                       []     []         []   |
+     iso_15924          | []              () [] []     ()         []   |
+     iso_3166           | []        []    () [] []     ()  []     []   |
+     iso_3166_2         |                 () [] []     ()         []   |
+     iso_4217           | []              () [] []     ()         []   |
+     iso_639            | []     [] []    () [] []     ()  []     []   |
+     iso_639_3          |        []       () [] []     ()              |
+     iso_639_5          |                 ()    []     ()              |
+     jwhois             | []                 []        []         []   |
+     kbd                | []                    []     []         []   |
+     klavaro            | []                    []  [] []     []  []   |
+     ld                 | []                 [] []     []         []   |
+     leafpad            | []              [] [] []     []         []   |
+     libc               | []                 [] []     []         []   |
+     libexif            | []                           []         ()   |
+     libextractor       |                       []     []              |
+     libgnutls          | []                    []     []         []   |
+     libgphoto2         | []                    []     []              |
+     libgphoto2_port    | []                    []     []         []   |
+     libgsasl           | []                    []     []         []   |
+     libiconv           | []                    []     []  []     []   |
+     libidn             | ()                    []     []         []   |
+     liferea            | []                 [] []     []         []   |
+     lilypond           |                              []              |
+     lordsawar          |                                              |
+     lprng              |                              []              |
+     lynx               | []                 [] []     []              |
+     m4                 | []                           []         []   |
+     mailfromd          |                       []     []              |
+     mailutils          |                              []              |
+     make               | []                    []     []         []   |
+     man-db             | []                           []         []   |
+     man-db-manpages    | []                                      []   |
+     midi-instruments   | []              [] [] []     []         []   |
+     minicom            | []                           []              |
+     mkisofs            |                       []     []         []   |
+     myserver           |                              []              |
+     nano               | []                    []     []         []   |
+     opcodes            |                       []     []         []   |
+     parted             | []                 [] []     []         []   |
+     pies               |                       []     []              |
+     pnmixer            |                       []     []         []   |
+     popt               | []     []       [] [] []     []         []   |
+     procps-ng          |                       []     []              |
+     procps-ng-man      |                       []                     |
+     psmisc             | []                    []     []         []   |
+     pspp               |                    [] []                []   |
+     pushover           | []                                           |
+     pwdutils           | []                           []              |
+     pyspread           |                       []                     |
+     radius             |                       []     []              |
+     recode             | []                 []        []         []   |
+     recutils           | []                    []     []              |
+     rpm                | []                    []     []         []   |
+     rush               |                       []     []              |
+     sarg               |                                              |
+     sed                | []                 [] []     []         []   |
+     sharutils          | []                    []     []         []   |
+     shishi             |                              []         []   |
+     skribilo           | []                    []                     |
+     solfege            | []                 []        []         []   |
+     solfege-manual     |                    []                        |
+     spotmachine        | []                    []     []              |
+     sudo               | []                 [] []     []         []   |
+     sudoers            | []                    []     []         []   |
+     sysstat            | []                 [] []     []         []   |
+     tar                | []                 [] []     []         []   |
+     texinfo            |                    [] []     []              |
+     texinfo_document   |                       []                     |
+     tigervnc           | []                    []                []   |
+     tin                |                                         []   |
+     tin-man            |                                              |
+     tracgoogleappsa... | []              []    []     []         []   |
+     trader             | []                                           |
+     util-linux         | []                    []     []         []   |
+     ve                 | []                    []     []         []   |
+     vice               | ()                 ()                        |
+     vmm                |                                              |
+     vorbis-tools       | []                           []              |
+     wastesedge         |                                              |
+     wcd                |                       []     []         []   |
+     wcd-man            |                       []                     |
+     wdiff              | []                    []     []         []   |
+     wget               |                       []     []         []   |
+     wyslij-po          |                       []     []              |
+     xboard             |                       []                []   |
+     xdg-user-dirs      | []     [] []    [] [] []     []         []   |
+     xkeyboard-config   | []                 [] []     []              |
+                        +----------------------------------------------+
+                          sv  sw ta te tg th tr uk  ur vi  wa wo zh_CN
+                          106  1  4  3  0 13 51 115  1 125  7  1  100 
+
+                          zh_HK zh_TW
+                        +-------------+
+     a2ps               |             | 30
+     aegis              |             |  9
+     anubis             |             | 19
+     aspell             |             | 29
+     bash               |        []   | 23
+     bfd                |             | 11
+     binutils           |             | 12
+     bison              |        []   | 18
+     bison-runtime      |        []   | 38
+     buzztrax           |             |  9
+     ccd2cue            |             | 10
+     ccide              |             | 17
+     cflow              |             | 16
+     clisp              |             | 10
+     coreutils          |             | 18
+     cpio               |             | 20
+     cppi               |             | 17
+     cpplib             |        []   | 19
+     cryptsetup         |             | 14
+     datamash           |             | 11
+     denemo             |             |  5
+     dfarc              |             | 17
+     dialog             |        []   | 42
+     dico               |             |  6
+     diffutils          |             | 22
+     dink               |             | 10
+     direvent           |             | 11
+     doodle             |             | 12
+     dos2unix           |        []   | 18
+     dos2unix-man       |             |  9
+     e2fsprogs          |             | 15
+     enscript           |             | 21
+     exif               |             | 27
+     fetchmail          |             | 19
+     findutils          |             | 29
+     flex               |        []   | 19
+     freedink           |             | 24
+     fusionforge        |             |  3
+     gas                |             |  5
+     gawk               |             | 13
+     gcal               |             |  8
+     gcc                |             |  2
+     gdbm               |             | 10
+     gettext-examples   |  []    []   | 40
+     gettext-runtime    |  []    []   | 35
+     gettext-tools      |        []   | 24
+     gjay               |             |  9
+     glunarclock        |        []   | 27
+     gnubiff            |             |  9
+     gnubik             |             | 19
+     gnucash            |        ()   |  6
+     gnuchess           |             | 11
+     gnulib             |             | 23
+     gnunet             |             |  1
+     gnunet-gtk         |             |  1
+     gold               |             |  7
+     gphoto2            |        []   | 19
+     gprof              |             | 21
+     gramadoir          |             | 14
+     grep               |        []   | 31
+     grub               |             | 21
+     gsasl              |        []   | 19
+     gss                |             | 17
+     gst-plugins-bad    |             | 21
+     gst-plugins-base   |             | 27
+     gst-plugins-good   |             | 32
+     gst-plugins-ugly   |             | 34
+     gstreamer          |        []   | 32
+     gtick              |             | 19
+     gtkam              |             | 24
+     gtkspell           |  []    []   | 48
+     guix               |             |  2
+     guix-packages      |             |  0
+     gutenprint         |             | 15
+     hello              |        []   | 30
+     help2man           |             | 18
+     help2man-texi      |             |  5
+     hylafax            |             |  5
+     idutils            |             | 14
+     iso_15924          |        []   | 23
+     iso_3166           |  []    []   | 58
+     iso_3166_2         |             |  9
+     iso_4217           |  []    []   | 28
+     iso_639            |  []    []   | 46
+     iso_639_3          |             | 10
+     iso_639_5          |             |  2
+     jwhois             |        []   | 20
+     kbd                |             | 17
+     klavaro            |             | 30
+     ld                 |        []   | 15
+     leafpad            |        []   | 39
+     libc               |        []   | 24
+     libexif            |             | 10
+     libextractor       |             |  5
+     libgnutls          |             | 13
+     libgphoto2         |             | 10
+     libgphoto2_port    |        []   | 19
+     libgsasl           |             | 18
+     libiconv           |        []   | 29
+     libidn             |             | 17
+     liferea            |             | 29
+     lilypond           |             | 11
+     lordsawar          |             |  3
+     lprng              |             |  3
+     lynx               |             | 19
+     m4                 |        []   | 22
+     mailfromd          |             |  4
+     mailutils          |             |  6
+     make               |             | 19
+     man-db             |             | 15
+     man-db-manpages    |             | 10
+     midi-instruments   |        []   | 43
+     minicom            |        []   | 17
+     mkisofs            |             | 13
+     myserver           |             |  9
+     nano               |        []   | 30
+     opcodes            |             | 12
+     parted             |        []   | 23
+     pies               |             |  4
+     pnmixer            |             |  9
+     popt               |        []   | 36
+     procps-ng          |             |  5
+     procps-ng-man      |             |  4
+     psmisc             |        []   | 22
+     pspp               |             | 13
+     pushover           |             |  6
+     pwdutils           |             |  8
+     pyspread           |             |  6
+     radius             |             |  9
+     recode             |             | 31
+     recutils           |             | 10
+     rpm                |        []   | 13
+     rush               |             | 10
+     sarg               |             |  4
+     sed                |        []   | 35
+     sharutils          |             | 13
+     shishi             |             |  7
+     skribilo           |             |  7
+     solfege            |             | 21
+     solfege-manual     |             |  9
+     spotmachine        |             | 11
+     sudo               |             | 26
+     sudoers            |             | 22
+     sysstat            |             | 23
+     tar                |        []   | 30
+     texinfo            |             | 17
+     texinfo_document   |             | 13
+     tigervnc           |             | 14
+     tin                |        []   |  7
+     tin-man            |             |  1
+     tracgoogleappsa... |        []   | 22
+     trader             |             | 12
+     util-linux         |             | 13
+     ve                 |             | 14
+     vice               |             |  1
+     vmm                |             |  3
+     vorbis-tools       |             | 13
+     wastesedge         |             |  3
+     wcd                |             |  8
+     wcd-man            |             |  3
+     wdiff              |        []   | 23
+     wget               |             | 21
+     wyslij-po          |             | 14
+     xboard             |             | 10
+     xdg-user-dirs      |  []    []   | 68
+     xkeyboard-config   |        []   | 28
+                        +-------------+
+       89 teams           zh_HK zh_TW
+      166 domains           7    42    2809
 
    Some counters in the preceding matrix are higher than the number of
 visible blocks let us expect.  This is because a few extra PO files are
@@ -404,32 +1350,30 @@
 dialects.
 
    For a PO file in the matrix above to be effective, the package to
-which it applies should also have been internationalized and
-distributed as such by its maintainer.  There might be an observable
-lag between the mere existence a PO file and its wide availability in a
-distribution.
+which it applies should also have been internationalized and distributed
+as such by its maintainer.  There might be an observable lag between the
+mere existence a PO file and its wide availability in a distribution.
 
-   If August 2002 seems to be old, you may fetch a more recent copy of
-this `ABOUT-NLS' file on most GNU archive sites.  The most up-to-date
-matrix with full percentage details can be found at
-`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
+   If Jun 2014 seems to be old, you may fetch a more recent copy of this
+'ABOUT-NLS' file on most GNU archive sites.  The most up-to-date matrix
+with full percentage details can be found at
+'http://translationproject.org/extra/matrix.html'.
 
-Using `gettext' in new packages
-===============================
+1.5 Using 'gettext' in new packages
+===================================
 
-   If you are writing a freely available program and want to
-internationalize it you are welcome to use GNU `gettext' in your
-package.  Of course you have to respect the GNU Library General Public
-License which covers the use of the GNU `gettext' library.  This means
-in particular that even non-free programs can use `libintl' as a shared
-library, whereas only free software can use `libintl' as a static
-library or use modified versions of `libintl'.
+If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU 'gettext' in your
+package.  Of course you have to respect the GNU Lesser General Public
+License which covers the use of the GNU 'gettext' library.  This means
+in particular that even non-free programs can use 'libintl' as a shared
+library, whereas only free software can use 'libintl' as a static
+library or use modified versions of 'libintl'.
 
    Once the sources are changed appropriately and the setup can handle
-to use of `gettext' the only thing missing are the translations.  The
+the use of 'gettext' the only thing missing are the translations.  The
 Free Translation Project is also available for packages which are not
 developed inside the GNU project.  Therefore the information given above
 applies also for every other Free Software Project.  Contact
-`translation@iro.umontreal.ca' to make the `.pot' files available to
-the translation teams.
-
+'coordinator@translationproject.org' to make the '.pot' files available
+to the translation teams.
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..79dd58e
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,28 @@
+// Copyright 2017 The Android Open Source Project
+
+cc_defaults {
+    name: "e2fsprogs-defaults",
+    cflags: ["-Wall", "-Werror"],
+    target: {
+        darwin: {
+            // Still has unfixed/unsuppressed warnings.
+            cflags: ["-Wno-error"],
+        },
+        windows: {
+            cflags: [
+                "-Wno-typedef-redefinition",
+                "-Wno-unused-parameter",
+                "-Wno-unused-variable",
+            ],
+        },
+    },
+}
+
+subdirs = [
+    "contrib",
+    "debugfs",
+    "e2fsck",
+    "lib",
+    "misc",
+    "resize",
+]
diff --git a/Android.mk b/Android.mk
index 5053e7d..da272e2 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1 +1,27 @@
-include $(call all-subdir-makefiles)
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := e2fsck
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
+LOCAL_SRC_FILES := prebuilt/$(TARGET_ARCH_VARIANT)/$(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := mke2fs
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
+LOCAL_SRC_FILES := prebuilt/$(TARGET_ARCH_VARIANT)/$(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := badblocks
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
+LOCAL_SRC_FILES := prebuilt/$(TARGET_ARCH_VARIANT)/$(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
+
+include $(call all-makefiles-under, $(LOCAL_PATH))
diff --git a/COPYING b/COPYING
deleted file mode 100644
index dd1227b..0000000
--- a/COPYING
+++ /dev/null
@@ -1,849 +0,0 @@
-This package, the EXT2 filesystem utilities, are made available under
-the GNU Public License version 2, with the exception of the lib/ext2fs
-and lib/e2p libraries, which are made available under the GNU Library
-General Public License Version 2, the lib/uuid library which is made
-available under a BSD-style license and the lib/et and lib/ss
-libraries which are made available under an MIT-style license.  Please
-see lib/uuid/COPYING for more details for the license for the files
-comprising the libuuid library, and the source file headers of the
-libet and libss libraries for more information.
-
-The most recent officially distributed version can be found at
-http://e2fsprogs.sourceforge.net.  If you need to make a distribution,
-that's the one you should use.  If there is some reason why you'd like
-a more recent version that is still in ALPHA testing (i.e., either
-using the "WIP" test distributions or one from the hg or git
-repository from the development branch, please contact me
-(tytso@mit.edu) before you ship.  The release schedules for this
-package are flexible, if you give me enough lead time.
-
-
-					Theodore Ts'o
-					23-June-2007
-
-----------------------------------------------------------------------
-
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year  name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-----------------------------------------------------------------------
-
-		  GNU LIBRARY GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1991 Free Software Foundation, Inc.
-    		    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the library GPL.  It is
- numbered 2 because it goes with version 2 of the ordinary GPL.]
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Library General Public License, applies to some
-specially designated Free Software Foundation software, and to any
-other libraries whose authors decide to use it.  You can use it for
-your libraries, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if
-you distribute copies of the library, or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link a program with the library, you must provide
-complete object files to the recipients so that they can relink them
-with the library, after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  Our method of protecting your rights has two steps: (1) copyright
-the library, and (2) offer you this license which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  Also, for each distributor's protection, we want to make certain
-that everyone understands that there is no warranty for this free
-library.  If the library is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original
-version, so that any problems introduced by others will not reflect on
-the original authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that companies distributing free
-software will individually obtain patent licenses, thus in effect
-transforming the program into proprietary software.  To prevent this,
-we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
-  Most GNU software, including some libraries, is covered by the ordinary
-GNU General Public License, which was designed for utility programs.  This
-license, the GNU Library General Public License, applies to certain
-designated libraries.  This license is quite different from the ordinary
-one; be sure to read it in full, and don't assume that anything in it is
-the same as in the ordinary license.
-
-  The reason we have a separate public license for some libraries is that
-they blur the distinction we usually make between modifying or adding to a
-program and simply using it.  Linking a program with a library, without
-changing the library, is in some sense simply using the library, and is
-analogous to running a utility program or application program.  However, in
-a textual and legal sense, the linked executable is a combined work, a
-derivative of the original library, and the ordinary General Public License
-treats it as such.
-
-  Because of this blurred distinction, using the ordinary General
-Public License for libraries did not effectively promote software
-sharing, because most developers did not use the libraries.  We
-concluded that weaker conditions might promote sharing better.
-
-  However, unrestricted linking of non-free programs would deprive the
-users of those programs of all benefit from the free status of the
-libraries themselves.  This Library General Public License is intended to
-permit developers of non-free programs to use free libraries, while
-preserving your freedom as a user of such programs to change the free
-libraries that are incorporated in them.  (We have not seen how to achieve
-this as regards changes in header files, but we have achieved it as regards
-changes in the actual functions of the Library.)  The hope is that this
-will lead to faster development of free libraries.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, while the latter only
-works together with the library.
-
-  Note that it is possible for a library to be covered by the ordinary
-General Public License rather than by this special one.
-
-		  GNU LIBRARY GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library which
-contains a notice placed by the copyright holder or other authorized
-party saying it may be distributed under the terms of this Library
-General Public License (also called "this License").  Each licensee is
-addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-  
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also compile or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    c) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    d) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the source code distributed need not include anything that is normally
-distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Library General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-			    NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/CleanSpec.mk b/CleanSpec.mk
index ded4ceb..8331dae 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -49,3 +49,4 @@
 # ************************************************
 
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libext2_uuid_intermediates)
+$(call add-clean-step, rm -rf $(TARGET_RECOVERY_OUT)/root/sbin)
diff --git a/INSTALL b/INSTALL
index b5afd2f..2dd08f5 100644
--- a/INSTALL
+++ b/INSTALL
@@ -56,7 +56,7 @@
 this is that the getmntent() library routine interprets those missing
 fields as "0", and a pass number of 0 is documented as meaning that
 fsck should not check that particular filesystem.  If your entries in
-your /etc/fstab file look liks this:
+your /etc/fstab file look like this:
 
 /dev/hda4       /        ext2        defaults
 
diff --git a/INSTALL.elfbin b/INSTALL.elfbin
index 3f54aa1..9c2c600 100644
--- a/INSTALL.elfbin
+++ b/INSTALL.elfbin
@@ -35,7 +35,7 @@
 this is that the getmntent() library routine interprets those missing
 fields as "0", and a pass number of 0 is documented as meaning that
 fsck should not check that particular filesystem.  If your entries in
-your /etc/fstab file look liks this:
+your /etc/fstab file look like this:
 
 /dev/hda4       /        ext2        defaults
 
diff --git a/MCONFIG b/MCONFIG
new file mode 100644
index 0000000..676d2dc
--- /dev/null
+++ b/MCONFIG
@@ -0,0 +1,335 @@
+# Beginning of file MCONFIG
+
+all::
+
+all-static::
+
+check::
+
+fullcheck::
+
+SHELL = /bin/sh
+
+COMPRESS_EXT = gz bz2 bz Z
+
+prefix = /usr
+root_prefix = 
+exec_prefix = ${prefix}
+root_bindir = ${root_prefix}/bin
+root_sbindir = ${root_prefix}/sbin
+root_libdir = ${root_prefix}/lib
+datarootdir = ${prefix}/share
+bindir = ${exec_prefix}/bin
+sbindir = ${exec_prefix}/sbin
+libdir = ${exec_prefix}/lib
+datadir= ${datarootdir}
+localedir = $(datadir)/locale
+root_sysconfdir= ${root_prefix}/etc
+includedir = ${prefix}/include
+mandir = ${datarootdir}/man
+man1dir = $(mandir)/man1
+man3dir = $(mandir)/man3
+man5dir = $(mandir)/man5
+man8dir = $(mandir)/man8
+infodir = ${datarootdir}/info
+datadir = ${datarootdir}
+pkgconfigdir = $(libdir)/pkgconfig
+pkglibdir = $(libdir)/e2fsprogs
+
+HAVE_UDEV = yes
+UDEV_RULES_DIR = /lib/udev/rules.d
+HAVE_CROND = yes
+CROND_DIR = /etc/cron.d
+HAVE_SYSTEMD = yes
+SYSTEMD_SYSTEM_UNIT_DIR = /lib/systemd/system
+
+
+
+ V =
+ ifeq ($(strip $(V)),)
+ #  E = @echo
+ #  ES = echo
+ #  Q = @
+    E = @echo
+    ES = echo
+    Q = @
+ else
+    E = @\#
+    ES = \#
+    Q =
+ endif
+
+# E = @echo
+# ES = echo
+# Q = @
+
+ CHECK=sparse
+ CHECK_OPTS=-Wsparse-all -Wno-transparent-union -Wno-return-void -Wno-undef -Wno-non-pointer-null
+ CPPCHECK=cppcheck
+ CPPCHECK_OPTS=--force --enable=all --quiet
+ ifeq ("$(C)", "2")
+   CHECK_CMD=$(CHECK) $(CHECK_OPTS) -Wbitwise -D__CHECK_ENDIAN__
+   CPPCHECK_CMD=$(CPPCHECK) $(CPPCHECK_OPTS)
+ else
+   ifeq ("$(C)", "1")
+     CHECK_CMD=$(CHECK) $(CHECK_OPTS)
+     CPPCHECK_CMD=$(CPPCHECK) $(CPPCHECK_OPTS)
+    else
+     CHECK_CMD=@true
+     CPPCHECK_CMD=@true
+   endif
+ endif
+
+# CHECK_CMD=true
+# CPPCHECK_CMD=true
+
+SANITIZER_CFLAGS =    
+SANITIZER_LDFLAGS =    
+
+CC = /bin/clang
+BUILD_CC = /bin/clang
+PTHREAD_CFLAGS = -pthread
+PTHREAD_LIBS = 
+CFLAGS = -g -O2
+CFLAGS_SHLIB = -g -O2
+CFLAGS_STLIB = -g -O2
+CPPFLAGS = -I. -I$(top_builddir)/lib -I$(top_srcdir)/lib
+ALL_CFLAGS = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS) $(PTHREAD_CFLAGS) $(CFLAGS_WARN) -DHAVE_CONFIG_H $(LOCAL_CFLAGS)
+ALL_CFLAGS_SHLIB = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS_SHLIB) $(PTHREAD_CFLAGS) $(CFLAGS_WARN) -DHAVE_CONFIG_H $(LOCAL_CFLAGS)
+ALL_CFLAGS_STLIB = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS_STLIB) $(PTHREAD_CFLAGS) $(CFLAGS_WARN) -DHAVE_CONFIG_H $(LOCAL_CFLAGS)
+LDFLAGS = $(SANITIZER_LDFLAGS) $(PTHREAD_CFLAGS) 
+LDFLAGS_SHLIB = $(SANITIZER_LDFLAGS) $(PTHREAD_CFLAGS) 
+ALL_LDFLAGS = $(LDFLAGS) 
+LDFLAGS_STATIC = $(SANITIZER_LDFLAGS) $(PTHREAD_CFLAGS)  -static
+BUILD_CFLAGS = $(SANITIZER_CFLAGS) -g -O2  -I. -I$(top_builddir)/lib -I$(top_srcdir)/lib -DHAVE_CONFIG_H
+BUILD_LDFLAGS = $(SANITIZER_LDFLAGS) 
+RDYNAMIC = -rdynamic
+LINK_BUILD_FLAGS = 
+LINK_INSTALL_FLAGS = -f
+RM = /bin/rm
+LN = /bin/ln
+LN_S = ln -s
+MV = /bin/mv
+CP = /bin/cp
+CHMOD = /bin/chmod
+AR = ar
+AWK = gawk
+SED = /bin/sed
+PERL = /bin/perl
+RANLIB = ranlib
+STRIP = strip
+LD = $(PURE) /bin/clang
+ARUPD = $(AR) r
+ARGEN = $(AR) rc
+LDCONFIG = /usr/sbin/ldconfig
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_SCRIPT = ${INSTALL}
+
+#
+# Library definitions
+#
+LIB = $(top_builddir)/lib
+LIBSS = $(LIB)/libss.a  -ldl
+LIBCOM_ERR = $(LIB)/libcom_err.a  -lpthread
+LIBE2P = $(LIB)/libe2p.a
+LIBEXT2FS = $(LIB)/libext2fs.a
+LIBUUID = $(LIB)/libuuid.a 
+LIBMAGIC = -ldl
+LIBFUSE = 
+LIBSUPPORT = $(LIBINTL) $(LIB)/libsupport.a
+LIBBLKID = $(LIB)/libblkid.a  $(LIBUUID)
+LIBINTL = 
+SYSLIBS =  
+DEPLIBSS = $(LIB)/libss.a
+DEPLIBCOM_ERR = $(LIB)/libcom_err.a
+DEPLIBUUID = $(LIB)/libuuid.a
+DEPLIBSUPPORT = $(LIB)/libsupport.a
+DEPLIBBLKID = $(LIB)/libblkid.a  $(DEPLIBUUID)
+TESTENV = LD_LIBRARY_PATH="$(LIB):$${LD_LIBRARY_PATH}" DYLD_LIBRARY_PATH="$(LIB):$${DYLD_LIBRARY_PATH}"
+
+STATIC_LIBSS = $(LIB)/libss.a -ldl
+STATIC_LIBCOM_ERR = $(LIB)/libcom_err.a -lpthread
+STATIC_LIBE2P = $(LIB)/libe2p.a
+STATIC_LIBEXT2FS = $(LIB)/libext2fs.a
+STATIC_LIBUUID = $(LIB)/libuuid.a 
+STATIC_LIBSUPPORT = $(LIBINTL) $(LIBSUPPORT)
+STATIC_LIBBLKID = $(LIB)/libblkid.a $(STATIC_LIBUUID)
+DEPSTATIC_LIBSS = $(LIB)/libss.a
+DEPSTATIC_LIBCOM_ERR = $(LIB)/libcom_err.a
+DEPSTATIC_LIBUUID = $(LIB)/libuuid.a
+DEPSTATIC_LIBSUPPORT = $(DEPLIBSUPPORT)
+DEPSTATIC_LIBBLKID = $(LIB)/libblkid.a $(DEPSTATIC_LIBUUID)
+
+PROFILED_LIBSS = $(LIB)/libss.a -ldl
+PROFILED_LIBCOM_ERR = $(LIB)/libcom_err.a -lpthread
+PROFILED_LIBE2P = $(LIB)/libe2p.a
+PROFILED_LIBEXT2FS = $(LIB)/libext2fs.a
+PROFILED_LIBUUID = $(LIB)/libuuid.a 
+PROFILED_LIBSUPPORT = $(LIBINTL) $(LIB)/libsupport.a
+PROFILED_LIBBLKID = $(LIB)/libblkid.a $(PROFILED_LIBUUID)
+DEPPROFILED_LIBSS = $(LIB)/libss.a
+DEPPROFILED_LIBCOM_ERR = $(LIB)/libcom_err.a
+DEPPROFILED_LIBUUID = $(LIB)/libuuid.a
+DEPPROFILED_LIBSUPPORT = $(PROFILED_LIBSUPPORT)
+DEPPROFILED_LIBBLKID = $(LIB)/libblkid.a $(DEPPROFILED_LIBUUID)
+
+#
+# A fast substitution command for fixing up man pages, shell scripts, etc.
+#
+SUBST_CONF=$(top_builddir)/util/subst.conf
+SUBSTITUTE= $(top_builddir)/util/subst -f $(SUBST_CONF)
+SUBSTITUTE_UPTIME= $(top_builddir)/util/subst -t -f $(SUBST_CONF)
+DEP_SUBSTITUTE= $(top_builddir)/util/subst $(SUBST_CONF)
+
+$(top_builddir)/util/subst:
+	cd $(top_builddir)/util ; $(MAKE) subst
+
+#
+# Script for generating utf8data.h
+#
+MKUTF8DATA=$(top_builddir)/util/mkutf8data
+
+$(top_builddir)/util/mkutf8data:
+	 $(MAKE) -C $(top_builddir)/util mkutf8data
+
+#
+# Script for installing symlinks (for shared libraries)
+#
+$(top_builddir)/util/install-symlink: $(top_srcdir)/util/install-symlink.in \
+			      $(top_builddir)/config.status
+	cd $(top_builddir); CONFIG_FILES=util/install-symlink ./config.status
+	chmod +x $(top_builddir)/util/install-symlink
+
+$(top_builddir)/util/symlinks:
+	cd $(top_builddir)/util ; $(MAKE) symlinks
+
+INSTALL_SYMLINK = /bin/sh $(top_builddir)/util/install-symlink \
+			 \
+			--symlinks=$(top_builddir)/util/symlinks
+DEP_INSTALL_SYMLINK = $(top_builddir)/util/install-symlink \
+			$(top_builddir)/util/symlinks
+
+#
+# Warning flags
+#
+# Run make gcc-wall to do a build with warning messages.
+#
+#
+WFLAGS=		-std=gnu99 -D_XOPEN_SOURCE=600 -D_GNU_SOURCE $(WFLAGS_EXTRA) \
+			-Wall -W -Wwrite-strings -Wpointer-arith \
+			-Wcast-qual -Wcast-align -Wno-variadic-macros \
+			-Wstrict-prototypes -Wmissing-prototypes \
+			-Wformat-security  -Wformat-nonliteral \
+			-Wmissing-format-attribute -O2 -Wstrict-aliasing \
+			-Wnested-externs -Winline -DNO_INLINE_FUNCS -Wshadow \
+			-UENABLE_NLS
+
+gcc-wall-new:
+	($(MAKE) CFLAGS_WARN="$(WFLAGS)" > /dev/null) 2>&1
+
+gcc-wall:
+	$(MAKE) clean > /dev/null
+	$(MAKE) gcc-wall-new
+
+static-check:
+	($(MAKE) C=1 V=1 CFLAGS="$(ALL_CFLAGS) $(WFLAGS)") 2>&1
+
+static-check-all:
+	$(MAKE) clean > /dev/null
+	$(MAKE) static-check
+
+#
+# Installation user and groups
+#
+BINGRP=		bin
+BINOWN=		bin
+BINMODE=	555
+INCGRP=		bin
+INCOWN=		bin
+INCMODE=	444
+LIBOWN=		bin
+LIBGRP=		bin
+LIBMODE=	444
+MANGRP=		bin
+MANOWN=		bin
+MANMODE=	444
+
+#
+# Autoconf magic...
+#
+
+DEP_LIB_MAKEFILES = $(top_srcdir)/lib/Makefile.library \
+	$(top_srcdir)/lib/Makefile.elf-lib  \
+	$(top_srcdir)/lib/Makefile.bsd-lib \
+	$(top_srcdir)/lib/Makefile.darwin-lib \
+	$(top_srcdir)/lib/Makefile.solaris-lib \
+	$(top_srcdir)/lib/Makefile.profile
+
+$(top_builddir)/config.status: $(top_srcdir)/configure
+	cd $(top_builddir); ./config.status --recheck
+
+$(top_builddir)/MCONFIG: $(top_srcdir)/MCONFIG.in $(top_builddir)/config.status
+	cd $(top_builddir); CONFIG_FILES=MCONFIG ./config.status
+
+$(top_builddir)/lib/config.h: $(top_srcdir)/lib/config.h.in \
+			      $(top_builddir)/config.status
+	cd $(top_builddir); CONFIG_FILES=lib/config.h ./config.status
+
+$(top_builddir)/lib/dirpaths.h: $(DEP_SUBSTITUTE) $(top_srcdir)/lib/dirpaths.h.in
+	$(E) "	SUBST $@"
+	$(Q) $(SUBSTITUTE) $(top_srcdir)/lib/dirpaths.h.in $@
+
+$(top_builddir)/lib/substitute_sh: $(top_srcdir)/lib/substitute_sh.in \
+		$(top_builddir)/config.status
+	cd $(top_builddir); CONFIG_FILES=lib/substitute_sh ./config.status
+
+$(top_builddir)/util/subst.conf: $(top_srcdir)/util/subst.conf.in \
+		$(top_builddir)/config.status
+	cd $(top_builddir); CONFIG_FILES=util/subst.conf ./config.status
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/MCONFIG \
+		$(DEP_MAKEFILE) $(top_builddir)/config.status
+	cd $(top_builddir); CONFIG_FILES=$(my_dir)/Makefile ./config.status
+
+#$(top_srcdir)/configure: $(top_srcdir)/configure.ac
+#	cd $(top_srcdir) && autoheader && autoconf
+
+coverage.txt: Makefile $(SRCS)
+	if test -n "$(SRCS)"; then \
+		gcov -s $(top_srcdir) -o . $(SRCS) > coverage.txt 2>&1 ; \
+	fi
+
+clean::
+	$(RM) -f *.gcda *.gcov *.gcno coverage.txt
+
+#
+# Make depend magic...
+#
+
+.depend: Makefile $(SRCS) $(top_srcdir)/depfix.sed $(top_srcdir)/wordwrap.pl
+	if test -n "$(SRCS)" ; then \
+		$(CC) -M $(ALL_CFLAGS) $(DEPEND_CFLAGS) $(SRCS) | \
+			$(SED) -f $(top_srcdir)/depfix.sed \
+			    -e 's; $(srcdir)/; $$(srcdir)/;g' \
+			    -e 's; $(top_srcdir)/; $$(top_srcdir)/;g' \
+			    -e 's; $(top_builddir)/; $$(top_builddir)/;g' \
+			    -e 's; \./; ;g' \
+			    -e '/^#/d' \
+			    -e '/^ *\\$$/d' | \
+			$(PERL) $(top_srcdir)/wordwrap.pl > .depend; \
+	else :; fi
+
+depend:: .depend
+	if test -n "$(SRCS)" ; then \
+		sed -e '/^# +++ Dependency line eater +++/,$$d' \
+			< $(srcdir)/Makefile.in | cat - .depend \
+			> $(srcdir)/Makefile.in.new; \
+	if cmp -s $(srcdir)/Makefile.in $(srcdir)/Makefile.in.new ; then \
+		$(RM) $(srcdir)/Makefile.in.new ; \
+	else \
+		$(MV) $(srcdir)/Makefile.in $(srcdir)/Makefile.in.old; \
+		$(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \
+	fi ; else :; fi
+
+# End of file MCONFIG
diff --git a/MCONFIG.in b/MCONFIG.in
index 557b37a..3fede36 100644
--- a/MCONFIG.in
+++ b/MCONFIG.in
@@ -2,8 +2,12 @@
 
 all::
 
+all-static::
+
 check::
 
+fullcheck::
+
 SHELL = /bin/sh
 
 COMPRESS_EXT = gz bz2 bz Z
@@ -29,6 +33,15 @@
 man8dir = $(mandir)/man8
 infodir = @infodir@
 datadir = @datadir@
+pkgconfigdir = $(libdir)/pkgconfig
+pkglibdir = $(libdir)/e2fsprogs
+
+HAVE_UDEV = @have_udev@
+UDEV_RULES_DIR = @pkg_udev_rules_dir@
+HAVE_CROND = @have_crond@
+CROND_DIR = @crond_dir@
+HAVE_SYSTEMD = @have_systemd@
+SYSTEMD_SYSTEM_UNIT_DIR = @systemd_system_unit_dir@
 
 @SET_MAKE@
 
@@ -52,28 +65,44 @@
 
 @ifGNUmake@ CHECK=sparse
 @ifGNUmake@ CHECK_OPTS=-Wsparse-all -Wno-transparent-union -Wno-return-void -Wno-undef -Wno-non-pointer-null
+@ifGNUmake@ CPPCHECK=cppcheck
+@ifGNUmake@ CPPCHECK_OPTS=--force --enable=all --quiet
 @ifGNUmake@ ifeq ("$(C)", "2")
 @ifGNUmake@   CHECK_CMD=$(CHECK) $(CHECK_OPTS) -Wbitwise -D__CHECK_ENDIAN__
+@ifGNUmake@   CPPCHECK_CMD=$(CPPCHECK) $(CPPCHECK_OPTS)
 @ifGNUmake@ else
 @ifGNUmake@   ifeq ("$(C)", "1")
 @ifGNUmake@     CHECK_CMD=$(CHECK) $(CHECK_OPTS)
+@ifGNUmake@     CPPCHECK_CMD=$(CPPCHECK) $(CPPCHECK_OPTS)
 @ifGNUmake@    else
 @ifGNUmake@     CHECK_CMD=@true
+@ifGNUmake@     CPPCHECK_CMD=@true
 @ifGNUmake@   endif
 @ifGNUmake@ endif
 
-@ifNotGNUmake@ CHECK_CMD=@true
+@ifNotGNUmake@ CHECK_CMD=true
+@ifNotGNUmake@ CPPCHECK_CMD=true
 
-CC = @CC@
+SANITIZER_CFLAGS = @lto_cflags@ @ubsan_cflags@ @addrsan_cflags@ @threadsan_cflags@
+SANITIZER_LDFLAGS = @lto_ldflags@ @ubsan_ldflags@ @addrsan_ldflags@ @threadsan_ldflags@
+
+CC = @PTHREAD_CC@
 BUILD_CC = @BUILD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
 CFLAGS = @CFLAGS@
+CFLAGS_SHLIB = @CFLAGS_SHLIB@
+CFLAGS_STLIB = @CFLAGS_STLIB@
 CPPFLAGS = @INCLUDES@
-ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
-LDFLAGS = @LDFLAGS@
+ALL_CFLAGS = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS) $(PTHREAD_CFLAGS) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS)
+ALL_CFLAGS_SHLIB = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS_SHLIB) $(PTHREAD_CFLAGS) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS)
+ALL_CFLAGS_STLIB = $(CPPFLAGS) $(SANITIZER_CFLAGS) $(CFLAGS_STLIB) $(PTHREAD_CFLAGS) $(CFLAGS_WARN) @DEFS@ $(LOCAL_CFLAGS)
+LDFLAGS = $(SANITIZER_LDFLAGS) $(PTHREAD_CFLAGS) @LDFLAGS@
+LDFLAGS_SHLIB = $(SANITIZER_LDFLAGS) $(PTHREAD_CFLAGS) @LDFLAGS_SHLIB@
 ALL_LDFLAGS = $(LDFLAGS) @LDFLAG_DYNAMIC@
-LDFLAGS_STATIC = $(LDFLAGS) @LDFLAG_STATIC@
-BUILD_CFLAGS = @BUILD_CFLAGS@
-BUILD_LDFLAGS = @BUILD_LDFLAGS@
+LDFLAGS_STATIC = $(SANITIZER_LDFLAGS) $(PTHREAD_CFLAGS) @LDFLAGS_STATIC@
+BUILD_CFLAGS = $(SANITIZER_CFLAGS) @BUILD_CFLAGS@
+BUILD_LDFLAGS = $(SANITIZER_LDFLAGS) @BUILD_LDFLAGS@
 RDYNAMIC = @RDYNAMIC@
 LINK_BUILD_FLAGS = @LINK_BUILD_FLAGS@
 LINK_INSTALL_FLAGS = @LINK_INSTALL_FLAGS@
@@ -96,7 +125,6 @@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
-MKINSTALLDIRS = @MKINSTALLDIRS@
 
 #
 # Library definitions
@@ -107,26 +135,30 @@
 LIBE2P = $(LIB)/libe2p@LIB_EXT@
 LIBEXT2FS = $(LIB)/libext2fs@LIB_EXT@
 LIBUUID = @LIBUUID@ @SOCKET_LIB@
-LIBQUOTA = @STATIC_LIBQUOTA@
+LIBMAGIC = @MAGIC_LIB@
+LIBFUSE = @FUSE_LIB@
+LIBSUPPORT = $(LIBINTL) $(LIB)/libsupport@STATIC_LIB_EXT@
 LIBBLKID = @LIBBLKID@ @PRIVATE_LIBS_CMT@ $(LIBUUID)
 LIBINTL = @LIBINTL@
+SYSLIBS = @LIBS@ @PTHREAD_LIBS@
 DEPLIBSS = $(LIB)/libss@LIB_EXT@
 DEPLIBCOM_ERR = $(LIB)/libcom_err@LIB_EXT@
 DEPLIBUUID = @DEPLIBUUID@
-DEPLIBQUOTA = @DEPSTATIC_LIBQUOTA@
+DEPLIBSUPPORT = $(LIB)/libsupport@STATIC_LIB_EXT@
 DEPLIBBLKID = @DEPLIBBLKID@ @PRIVATE_LIBS_CMT@ $(DEPLIBUUID)
+TESTENV = LD_LIBRARY_PATH="$(LIB):$${LD_LIBRARY_PATH}" DYLD_LIBRARY_PATH="$(LIB):$${DYLD_LIBRARY_PATH}"
 
 STATIC_LIBSS = $(LIB)/libss@STATIC_LIB_EXT@ @DLOPEN_LIB@
 STATIC_LIBCOM_ERR = $(LIB)/libcom_err@STATIC_LIB_EXT@ @SEM_INIT_LIB@
 STATIC_LIBE2P = $(LIB)/libe2p@STATIC_LIB_EXT@
 STATIC_LIBEXT2FS = $(LIB)/libext2fs@STATIC_LIB_EXT@
 STATIC_LIBUUID = @STATIC_LIBUUID@ @SOCKET_LIB@
-STATIC_LIBQUOTA = @STATIC_LIBQUOTA@
+STATIC_LIBSUPPORT = $(LIBINTL) $(LIBSUPPORT)
 STATIC_LIBBLKID = @STATIC_LIBBLKID@ $(STATIC_LIBUUID)
 DEPSTATIC_LIBSS = $(LIB)/libss@STATIC_LIB_EXT@
 DEPSTATIC_LIBCOM_ERR = $(LIB)/libcom_err@STATIC_LIB_EXT@
 DEPSTATIC_LIBUUID = @DEPSTATIC_LIBUUID@
-DEPSTATIC_LIBQUOTA = @DEPSTATIC_LIBQUOTA@
+DEPSTATIC_LIBSUPPORT = $(DEPLIBSUPPORT)
 DEPSTATIC_LIBBLKID = @DEPSTATIC_LIBBLKID@ $(DEPSTATIC_LIBUUID)
 
 PROFILED_LIBSS = $(LIB)/libss@PROFILED_LIB_EXT@ @DLOPEN_LIB@
@@ -134,12 +166,12 @@
 PROFILED_LIBE2P = $(LIB)/libe2p@PROFILED_LIB_EXT@
 PROFILED_LIBEXT2FS = $(LIB)/libext2fs@PROFILED_LIB_EXT@
 PROFILED_LIBUUID = @PROFILED_LIBUUID@ @SOCKET_LIB@
-PROFILED_LIBQUOTA = @PROFILED_LIBQUOTA@
+PROFILED_LIBSUPPORT = $(LIBINTL) $(LIB)/libsupport@PROFILED_LIB_EXT@
 PROFILED_LIBBLKID = @PROFILED_LIBBLKID@ $(PROFILED_LIBUUID)
 DEPPROFILED_LIBSS = $(LIB)/libss@PROFILED_LIB_EXT@
 DEPPROFILED_LIBCOM_ERR = $(LIB)/libcom_err@PROFILED_LIB_EXT@
 DEPPROFILED_LIBUUID = @PROFILED_LIBUUID@
-DEPPROFILED_LIBQUOTA = @PROFILED_LIBQUOTA@
+DEPPROFILED_LIBSUPPORT = $(PROFILED_LIBSUPPORT)
 DEPPROFILED_LIBBLKID = @PROFILED_LIBBLKID@ $(DEPPROFILED_LIBUUID)
 
 #
@@ -154,6 +186,14 @@
 	cd $(top_builddir)/util ; $(MAKE) subst
 
 #
+# Script for generating utf8data.h
+#
+MKUTF8DATA=$(top_builddir)/util/mkutf8data
+
+$(top_builddir)/util/mkutf8data:
+	 $(MAKE) -C $(top_builddir)/util mkutf8data
+
+#
 # Script for installing symlinks (for shared libraries)
 #
 $(top_builddir)/util/install-symlink: $(top_srcdir)/util/install-symlink.in \
@@ -176,8 +216,7 @@
 # Run make gcc-wall to do a build with warning messages.
 #
 #
-WFLAGS=		-std=c99 -D_XOPEN_SOURCE=600 -D_GNU_SOURCE \
-			-pedantic $(WFLAGS_EXTRA) \
+WFLAGS=		-std=gnu99 -D_XOPEN_SOURCE=600 -D_GNU_SOURCE $(WFLAGS_EXTRA) \
 			-Wall -W -Wwrite-strings -Wpointer-arith \
 			-Wcast-qual -Wcast-align -Wno-variadic-macros \
 			-Wstrict-prototypes -Wmissing-prototypes \
@@ -187,11 +226,18 @@
 			-UENABLE_NLS
 
 gcc-wall-new:
-	(make CFLAGS="@CFLAGS@ $(WFLAGS)" > /dev/null) 2>&1 | sed -f $(top_srcdir)/util/gcc-wall-cleanup 
+	($(MAKE) CFLAGS_WARN="$(WFLAGS)" > /dev/null) 2>&1
 
 gcc-wall:
-	make clean > /dev/null
-	make gcc-wall-new
+	$(MAKE) clean > /dev/null
+	$(MAKE) gcc-wall-new
+
+static-check:
+	($(MAKE) C=1 V=1 CFLAGS="$(ALL_CFLAGS) $(WFLAGS)") 2>&1
+
+static-check-all:
+	$(MAKE) clean > /dev/null
+	$(MAKE) static-check
 
 #
 # Installation user and groups
@@ -215,8 +261,9 @@
 
 DEP_LIB_MAKEFILES = $(top_srcdir)/lib/Makefile.library \
 	$(top_srcdir)/lib/Makefile.elf-lib  \
-	$(top_srcdir)/lib/Makefile.bsd-lib $(top_srcdir)/lib/Makefile.darwin-lib \
-	$(top_srcdir)/lib/Makefile.solaris-lib $(top_srcdir)/lib/Makefile.checker \
+	$(top_srcdir)/lib/Makefile.bsd-lib \
+	$(top_srcdir)/lib/Makefile.darwin-lib \
+	$(top_srcdir)/lib/Makefile.solaris-lib \
 	$(top_srcdir)/lib/Makefile.profile
 
 $(top_builddir)/config.status: $(top_srcdir)/configure
@@ -245,16 +292,24 @@
 		$(DEP_MAKEFILE) $(top_builddir)/config.status
 	cd $(top_builddir); CONFIG_FILES=$(my_dir)/Makefile ./config.status
 
-@MAINTAINER_CMT@$(top_srcdir)/configure: $(top_srcdir)/configure.in
+@MAINTAINER_CMT@$(top_srcdir)/configure: $(top_srcdir)/configure.ac
 @MAINTAINER_CMT@	cd $(top_srcdir) && autoheader && autoconf
 
+coverage.txt: Makefile $(SRCS)
+	if test -n "$(SRCS)"; then \
+		gcov -s $(top_srcdir) -o . $(SRCS) > coverage.txt 2>&1 ; \
+	fi
+
+clean::
+	$(RM) -f *.gcda *.gcov *.gcno coverage.txt
+
 #
 # Make depend magic...
 #
 
 .depend: Makefile $(SRCS) $(top_srcdir)/depfix.sed $(top_srcdir)/wordwrap.pl
 	if test -n "$(SRCS)" ; then \
-		$(CC) -M $(ALL_CFLAGS) $(SRCS) | \
+		$(CC) -M $(ALL_CFLAGS) $(DEPEND_CFLAGS) $(SRCS) | \
 			$(SED) -f $(top_srcdir)/depfix.sed \
 			    -e 's; $(srcdir)/; $$(srcdir)/;g' \
 			    -e 's; $(top_srcdir)/; $$(top_srcdir)/;g' \
diff --git a/Makefile.in b/Makefile.in
index f327d19..d412dfb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -4,6 +4,7 @@
 top_builddir = .
 my_dir = .
 INSTALL = @INSTALL@
+MKDIR_P = @MKDIR_P@
 
 @MCONFIG@
 
@@ -13,36 +14,46 @@
 @DEBUGFS_CMT@DEBUGFS_DIR= debugfs
 @UUID_CMT@UUID_LIB_SUBDIR= lib/uuid
 @BLKID_CMT@BLKID_LIB_SUBDIR= lib/blkid
-QUOTA_LIB_SUBDIR= lib/quota
+@E2SCRUB_CMT@E2SCRUB_DIR= scrub
+@ALL_CMT@SUPPORT_LIB_SUBDIR= lib/support
+@ALL_CMT@E2P_LIB_SUBDIR= lib/e2p
+@ALL_CMT@EXT2FS_LIB_SUBDIR= lib/ext2fs
 
-LIB_SUBDIRS=lib/et lib/ss lib/e2p $(UUID_LIB_SUBDIR) lib/ext2fs $(BLKID_LIB_SUBDIR) $(QUOTA_LIB_SUBDIR) intl
-PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po
+LIB_SUBDIRS=lib/et lib/ss $(E2P_LIB_SUBDIR) $(UUID_LIB_SUBDIR) \
+	$(BLKID_LIB_SUBDIR) $(SUPPORT_LIB_SUBDIR) $(EXT2FS_LIB_SUBDIR)
+
+PROG_SUBDIRS=e2fsck $(DEBUGFS_DIR) misc $(RESIZE_DIR) tests/progs po \
+	$(E2SCRUB_DIR)
+
 SUBDIRS=util $(LIB_SUBDIRS) $(PROG_SUBDIRS) tests
 
-SUBS= util/subst.conf lib/config.h lib/dirpaths.h \
+SUBS= util/subst.conf lib/config.h $(top_builddir)/lib/dirpaths.h \
 	lib/ext2fs/ext2_types.h lib/blkid/blkid_types.h lib/uuid/uuid_types.h
 
 TAR=tar
 
 all:: subs
 	$(MAKE) libs
-	$(MAKE) progs
-	$(MAKE) docs
+@ALL_CMT@	$(MAKE) progs
+@ALL_CMT@	$(MAKE) docs
+
+all-static::
+	$(MAKE) libs
+@ALL_CMT@	$(MAKE) static-progs
 
 subs: $(DEP_SUBSTITUTE)
 	@for i in $(SUBS) ; do if test -d `dirname $$i` ; \
 		then $(MAKE) $$i || exit $$? ; fi ; done
 	@(if test -d lib/et ; then cd lib/et && $(MAKE) compile_et; fi)
 	@(if test -d lib/ext2fs ; then cd lib/ext2fs && $(MAKE) ext2_err.h; fi)
+	@(if test -d lib/support ; then cd lib/support && $(MAKE) prof_err.h; fi)
 
 progs: all-progs-recursive
+static-progs: all-static-progs-recursive
 libs: all-libs-recursive
-all-progs-recursive all-libs-recursive: subs
+all-progs-recursive all-libs-recursive:: subs
 
-e2fsprogs.spec: $(DEP_SUBSTITUTE) e2fsprogs.spec.in
-	cd $(top_builddir); CONFIG_FILES=./e2fsprogs.spec ./config.status
-
-rpm: e2fsprogs.spec
+rpm:
 	sh contrib/build-rpm
 
 docs:
@@ -62,7 +73,7 @@
 
 install: subs all-libs-recursive install-progs-recursive \
   install-shlibs-libs-recursive install-doc-libs
-	if test ! -d e2fsck && test ! -d debugfs && test ! -d misc && test ! -d ext2ed ; then $(MAKE) install-libs ; fi
+@SUBSET_CMT@	$(MAKE) install-libs
 
 install-strip: subs all-libs-recursive install-strip-progs-recursive \
   install-shlibs-strip-libs-recursive install-doc-libs
@@ -73,10 +84,13 @@
 
 uninstall-libs: uninstall-libs-recursive
 
+coverage.txt: coverage.txt-recursive
+
 check-recursive: all
 
-TAGS clean-recursive distclean-recursive depend-recursive check-recursive \
-  mostlyclean-recursive realclean-recursive:
+TAGS clean-recursive distclean-recursive depend-recursive fullcheck-recursive \
+  check-recursive mostlyclean-recursive realclean-recursive \
+  coverage.txt-recursive:
 	@for subdir in $(SUBDIRS); do \
 	  if test -d $$subdir ; then \
 	    target=`echo $@|$(SED) 's/-recursive//'`; \
@@ -86,18 +100,24 @@
 	done
 
 all-progs-recursive install-progs-recursive install-strip-progs-recursive \
-  uninstall-progs-recursive: all-libs-recursive
-	@for subdir in $(PROG_SUBDIRS); do \
-	  if test -d $$subdir ; then \
-	    target=`echo $@|$(SED) 's/-progs-recursive//'`; \
-	    echo making $$target in $$subdir; \
-	    (cd $$subdir && $(MAKE) $$target) || exit 1; \
-	  fi ; \
-	done
+  uninstall-progs-recursive coverage.txt-progs-recursive:: all-libs-recursive
+
+
+@ALL_CMT@all-progs-recursive all-static-progs-recursive install-progs-recursive \
+@ALL_CMT@  install-strip-progs-recursive uninstall-progs-recursive \
+@ALL_CMT@  coverage.txt-progs-recursive:: all-libs-recursive
+@ALL_CMT@	@for subdir in $(PROG_SUBDIRS); do \
+@ALL_CMT@	  if test -d $$subdir ; then \
+@ALL_CMT@	    target=`echo $@|$(SED) 's/-progs-recursive//'`; \
+@ALL_CMT@	    echo making $$target in $$subdir; \
+@ALL_CMT@	    (cd $$subdir && $(MAKE) $$target) || exit 1; \
+@ALL_CMT@	  fi ; \
+@ALL_CMT@	done
 
 all-libs-recursive install-libs-recursive install-strip-libs-recursive \
   uninstall-libs-recursive install-shlibs-libs-recursive \
-  install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive:
+  install-shlibs-strip-libs-recursive uninstall-shlibs-libs-recursive \
+  coverage.txt-libs-recursive::
 	@for subdir in $(LIB_SUBDIRS); do \
 	  if test -d $$subdir ; then \
 	    target=`echo $@|$(SED) 's/-libs-recursive//'`; \
@@ -108,11 +128,12 @@
 
 mostlyclean: mostlyclean-recursive mostlyclean-local
 
-clean: clean-recursive clean-local clean-doc
+clean:: clean-recursive clean-local clean-doc
 	$(RM) -f $(SUBS) 
 
 distclean: distclean-doc distclean-recursive
-	$(RM) -rf autom4te.cache e2fsprogs.spec ext2ed/Makefile po/stamp-po
+	$(RM) -rf autom4te.cache ext2ed/Makefile po/stamp-po \
+		asm_types.h config.log public_config.h parse-types.log
 	$(MAKE) distclean-local 
 
 realclean: realclean-recursive realclean-local
@@ -146,3 +167,4 @@
 
 check::	all check-recursive
 
+fullcheck:: all fullcheck-recursive
diff --git a/NOTICE b/NOTICE
index dd1227b..da98a3e 100644
--- a/NOTICE
+++ b/NOTICE
@@ -27,7 +27,7 @@
 		       Version 2, June 1991
 
  Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -330,7 +330,7 @@
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 
 
 Also add information on how to contact you by electronic and paper mail.
@@ -370,7 +370,7 @@
 		       Version 2, June 1991
 
  Copyright (C) 1991 Free Software Foundation, Inc.
-    		    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    		    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -832,7 +832,7 @@
 
     You should have received a copy of the GNU Library General Public
     License along with this library; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 
 Also add information on how to contact you by electronic and paper mail.
 
diff --git a/README b/README
index 85645a6..fa4d997 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-	This is the new version (1.42.9) of the second extended file
+	This is the new version (1.46.2) of the second extended file
 system management programs.
 
 	From time to time, I release new versions of e2fsprogs, to fix
diff --git a/README.subset b/README.subset
deleted file mode 100644
index 70ed4b2..0000000
--- a/README.subset
+++ /dev/null
@@ -1,15 +0,0 @@
-This distribution contains a subset of the e2fsprogs package; it
-contains the base libraries (ss, et, uuid, blkid) which may be used by
-other non-ext2-related applications.
-
-This may be useful for non-Linux operating systems that need these
-libraries for GNOME, but who do not need the ext2/ext3 filesystem
-utilities.
-
-The full e2fsprogs distributions can be found at the e2fsprogs web
-page, which is:
-
-	http://e2fsprogs.sourceforge.net
-
-In case of bugs in these libraries, please contact Ted Ts'o at
-tytso@mit.edu or tytso@alum.mit.edu.
diff --git a/README.version b/README.version
deleted file mode 100644
index 851c4e8..0000000
--- a/README.version
+++ /dev/null
@@ -1,3 +0,0 @@
-URL: https://www.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.42.9/e2fsprogs-1.42.9.tar.gz
-Version: 1.42.9
-BugComponent: 95221
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
deleted file mode 100644
index e3db1b0..0000000
--- a/RELEASE-NOTES
+++ /dev/null
@@ -1,7487 +0,0 @@
-E2fsprogs 1.42.9 (December 28, 2013)
-====================================
-
-Mke2fs will detect an attempt to create a file system on a loop
-mounted file and complain without the -FF option.  Also fixed mke2fs
-so it allows the creation of a file system on a mounted device with
-two -F options, as documented in the man page, instead of three -F
-options.
-
-Fixed a large number of bugs in resize2fs, e2fsck, debugfs, and
-libext2fs to correctly handle bigalloc and 64-bit file systems.  There
-were many corner cases that had not been noticed in previous uses of
-these file systems, since they are not as common.  Some of the bugs
-could cause file system corruption or data loss, so users of 64-bit or
-bigalloc file systems are strongly urged to upgrade to e2fsprogs
-1.42.9.
-
-The tune2fs program will now not allow changing the uuid on a mounted
-file system which has the uninit_bg feature enabled.  This avoids a
-nasty race where the kernel and tune2fs are both retrying rewrite the
-group descriptors at the same time, with different ideas about what
-the UUID should be.
-
-When e2fsck is rehashing an extent-mapped directory, it's possible
-(although very rare) that an extent block will need to be allocated;
-fix e2fsck to make sure that the block gets marked as used.
-
-Mke2fs will now properly set the LARGE_FILE feature when creating a
-journal >= 2GB --- which can happen when using 64k block size.
-
-Fixed debugfs so that its freei command will correctly handle a request
-to free a range of consecutive inodes.
-
-Fixed 2fsck so it will not erroneously complain that an external journal
-is invalid if it is exactly 2**32 blocks.
-
-Fixed e2fsck so it won't try checking for, and adding, a missing
-lost+found directory when running in read-only mode.
-
-Fixed e2image to avoid some buffer overruns which would cause it to when
-creating a "standard (non-raw, non-qcow2) image file.  Standard
-e2image files are actually very rarely used, so we didn't notice when
-the changes to enable the qcow2 format broke this e2image mode.
-
-Fixed mke2fs so that the extended option "-E resize=NNN" will not turn
-on the resize_inode feature when the meta_bg feature is set, since
-these two features can not be set at the same time.
-
-Fixed tune2fs so that when it disables the quota feature, it updates all
-of the backup superblocks.
-
-Fixed dumpe2fs that would cause it to abort when run using an image file
-when trying to print the journal information (which is not present in
-an e2image created image file).
-
-Fixed a potential integer overflow in e2reefrag.
-(Addresses-Debian-Bug: #718205)
-
-Enhance debugfs so that when copying a sparse file from a native file
-system into the file system image using the "write" command, it will
-create a sparse file into the destination file system.
-
-Enhanced debugfs so it can support a command line which is up to 8k
-long.
-
-E2image will refuse (unless the -f option is specified to force the
-issue) to create a raw or qcow image using a mounted file system,
-unless the -f option is specified to force the issue.
-
-E2image has been optimized for using it to efficiently copy a file
-system by only copying the allocated blocks, by using the options -ra.
-New options (-o and -O) have been added so that a source and
-destination offset can be given.  The -p option will print progress
-information so the user will know how far along the copy is going.
-And finally, the new option -c is useful for updating a file system on
-an SSD, by avoiding unnecessary writes.  E2image can also shift a file
-system image by doing an in place move.
-
-Fix a regression introduced in 1.42.8 which would cause e2fsck to
-erroneously report uninitialized extents past the EOF (as determined by
-i_size) to be invalid.
-
-Fixed resize2fs so under a corner case when an inode has a complex
-extent tree, it will not corrupt an interior node in the extent tree.
-
-Fixed resize2fs which would sometimes corrupt a file system when
-shrinking a file system to a minimum size using resize2fs -M.
-(Addresses Debian Bug: #660793)
-
-Fixed resize2fs so that it will relocate inode table blocks if this
-becomes necessary when shrinking the file system.
-
-Fixed resize2fs and e2fsck so they will not crash when hit a failure
-while operating on a file system with the MMP feature enabled.
-
-Fixed a bug in debugfs which caused it create an invalid inode when
-trying to write a zero-length file.
-
-E2fsck will no longer crash if it tries to delete an invalid
-extent-mapped symlink.
-
-E2fsck will no longer crash if it comes across an directory which is
-larger than 2GB (which is not allowed in valid file systems).
-
-Fixed debugfs's help texts to fully document all options and otherwise
-be more helpful.
-
-Updated/fixed various man pages.  (Addresses Debian Bugs: #586218,
-#669730, #698076)
-
-Fixed various Debian Packaging Issues (#698879, #721365)
-
-
-Programmer's Notes
-------------------
-
-Fix sparse, gcc -Wall and clang nits.
-
-Update config.{guess,sub} to the latest version
-
-Fixed various memory and file descriptor leaks on various error paths,
-as well as some missing error return checks, which were found using
-Coverity.
-
-Run sparse against source files when building e2fsprogs with 'make
-C=1'.  If instead C=2, it configures basic ext2 types for bitwise
-checking with sparse, which can help find the (many many) spots where
-conversion errors are (possibly) happening.
-
-Allow the regression test to be run in chrooted environments where
-/etc/mtab might be missing.
-
-The ext2fs_punch() function, which was introduced in 1.42, was broken
-in many ways, but this was never noticed since it wasn't used for
-anything significant.  Some of the bugs include failing when trying to
-punch a completely sparse file, failing when punching an extent-mapped
-inode when the starting block was at the beginning of the inode, and
-not being able to punch a single block (where start_blk == end_block).
-It also didn't handle being passed an invalid, too-large ending block
-number, and didn't handle properly terminate at the right place when
-operating on an indirect-mapped inode.
-
-Fixed some minor typo's in the error catalog for libext2fs.
-
-Fixed ext2fs_file_set_size2() so that if it truncates an inode by
-setting the file size, to zero the rest of the block to the end of the
-file, so that if an ext4 FUSE driver tries to extended the file, that
-we don't avoid stale data from being returned.
-
-Fixed ext2fs_bmap() to disallow clients from trying to map or set
-logical blocks which are larger than what an extent-mapped or indirect
-block-mapped inode can allow.
-
-If debugfs (or some userspace program using libext2fs) creates a file
-which is larger than 2GB, make sure the large_file feature flag gets
-set.
-
-Fix a bug in ext2fs_link() where if there is multiple empty slots in the
-directory which are large enough, the directory entry could get
-inserted more than once in the directory.
-
-If quota support is disabled (which is the default), make sure that
-all traces of the quota support is removed from usage messages, man
-pages, and tune2fs must not be able to enable the quota file system
-feature.  (Addresses Red Hat Bugzilla: #1010709)
-
-The ext2fs_file_write() now updates i_size on a successful write,
-instead of only updating i_size wen the file is closed via
-ext2fs_file_close().
-
-Added a shell script, populate-extfs.sh which uses debugfs to populate
-an ext2/3/4 file system image from a given directory.  It is similar
-to the genext2fs program, but it supports ext3 and ext4 file system.
-
-Add changes to the libext2fs library to support block group
-descriptors larger than 64 bytes (for future compatibility).
-
-Fixed an off-by-one bug in ext2fs_file_set_size2() so that it will not
-leave an extra block in the file when truncating the file down to
-size.
-
-The html version info pages are now built using makeinfo --html
-instead of the unmaintained and now-obsolete texi2html program.
-
-
-E2fsprogs 1.42.8 (June 20, 2013)
-================================
-
-As a part of mke2fs's option parsing cleanup, the use of the -R option
-will give a warning that it is depreated (it has been so documented
-since 2005) and -E should be used instead.
-
-Mke2fs will not give warnings about the bigalloc and quota options in
-quiet mode.
-
-If an invalid journal size is given to mke2fs, it will now complain
-and exit sooner.
-
-Debugfs was erroneously giving spurious error messages for certain
-extent_inode subcommands which take arguments (split_node,
-replace_node, and insert_node).  This has been fixed.
-
-Fix the parsing of the 's' (sectors) in parse_num_blocks2, which among
-other programs is used by mke2fs.
-
-Change mke2fs so that it does not set the root directory to the real
-uid/gid of the mke2fs process.  Add the extended option root_owner to
-override this behavior.
-
-Fix resize2fs when shrinking file systems to make sure that bitmap
-blocks aren't left outside the bounds of the shrunken file system.
-This could happen with flex_bg file systems that were grown using
-the old online resizing algorithm.
-
-E2fsck will now detect and repair corrupted extent trees which contain
-invalid extents at the end of the extent tree leaf block.
-
-E2fsck will now longer complain about zero length extended attribute
-values.
-
-Fix a regression introduced in e2fsprogs v1.42 which caused e2image -s
-to crash.
-
-Add safety check so tune2fs will not attempt to set the inode size to
-be larger than the block size.
-
-Fix e2fsck so it can check a read-only root file system with an
-external journal.  (Addresses Debian Bug: #707030
-
-Fix off-line resizing of file systems with flex_bg && !resize_inode
-(Addresses Debian Bug: #696746)
-
-Fix e2image with large (> 32-bit) file systems (Addresses Debian Bug:
-#703067)
-
-Enhance chattr to allow clearing the extent flag if the kernel allows
-migrating extent based files to use indirect blocks.
-
-Update German translation.
-
-Updated/fixed various man pages.  (Addresses Debian Bugs: #712429,
-#712430, #707609)
-
-Fixed various Debian Packaging Issues (Addresses Debian Bug #708307)
-
-Programmer's Notes
-------------------
-
-Use secure_getenv() in preference to __secure_getenv().
-
-Optimize CPU utilization of ext2fs_bg_has_super().
-
-Fix ext2fs_llseek() on 32-bit i386 systems to work correctly when
-SEEK_CUR is used with large files.
-
-The ext2fs_read_inode_full() function will no longer use
-fs->read_inode() if the caller has requested more than the base 128
-byte inode structure and the inode size is greater than 128 bytes.
-
-Fix build failure with --enable-jbd-debug.
-
-Clean up filtering of outputs for the regression tests by using a
-common sed script.
-
-Fix gcc -Wall and clang nits.
-
-
-E2fsprogs 1.42.7 (January 21, 2013)
-===================================
-
-Add warnings to mke2fs, resize2fs, and tune2fs that the bigalloc and
-quota features are still under development.  For more information
-please see:
-    * https://ext4.wiki.kernel.org/index.php/Bigalloc
-    * https://ext4.wiki.kernel.org/index.php/Quota
-
-Add some new options to filefrag from Lustre's patches to e2fsprogs:
-    * add -k option to print extents in kB-sized units (like df -k)
-    * add -b {blocksize} to print extents in blocksize units
-    * add -e option to print extent format, even when FIBMAP is used
-    * add -X option to print extents in hexadecimal format
-
-Fix resize2fs so that it can handle off-line resizes of file systems
-with the flex_bg feature but without a resize_inode (or if we run out
-of reserved gdt blocks).  This also fixes a problem where if the user
-creates a filesystem with a restricted number of reserved gdt blocks,
-an off-line resize which grows the file system could potentially
-result in file system corruption.
-
-Fix a resize2fs bug which could cause it to corrupt bigalloc file
-systems when doing an off-line resize.
-
-Further optimize resize2fs so it doesn't use quite as much CPU when
-resizing very large file systems. 
-
-Fixed 32-bit overflow bugs which could cause resize2fs to fail and
-possibly corrupt the file system while resizing 64-bit file systems.
-
-Fix a bug in mke2fs where parsing "-E resize=NNN" will result in a
-mke2fs crash due to a divide-by-zero if the 64bit file system feature
-is enabled.
-
-Add better error checking to mke2fs to check for invalid parameters
-when creating bigalloc file system.
-
-When creating bigalloc filesystems, the -g option to mke2fs will now
-specify the number of clusters per block group.
-
-Add to debugfs the functionality to corrupt a specific file system
-block via the "zap_block" command.
-
-Add to debugfs the functionality to print out a hex dump of a block in
-the file system via the "block_dump" command.
-
-Add to debugfs the functionality to manipulate the extent tree
-directly via the "extent_open" command.
-
-Fixed debugfs's mknod command so that it updates the block group
-statistics.
-
-Fix e2fsck so it can detect and fix inconsistencies in the interior
-nodes of an inode's extent tree.
-
-Fix a potential memory corruption failure in e2fsck's error path if
-the call to ext2fs_open2() fails.
-
-Fix e2fsck if its logging function is enabled in e2fsck.conf, and the
-resulting file name for the log file is longer than 100 bytes, that it
-properly handles this situation instead of crashing.
-
-E2fsck will now report the amount of memory that it attempted to
-allocate when a memory allocation request fails, to make it easier to
-track down the problem.
-
-Fix mke2fs's handling of the mmp_update_interval option.  (Addresses
-Lustre Bug: LU-1888)
-
-E2image can now include all data blocks in the e2image output file
-when the user specifies the -a option.
-
-If e2fsprogs is compiled without --enable-quota, make sure that
-tune2fs can not turn on the feature for new-style quota support, since
-afterwards, none of the e2fsprogs tools will be willing to touch that
-file system.
-
-Optimize e2fsck's so that it uses much less CPU for large file
-systems.  This can result in significant speedups, especially on
-CPU-constrained systems.  This was primarily done by optimizing
-libext2fs's bitmap functions.  (Addresses Google Bug: #7534813)
-
-Fix debugfs's htree command so that all its messages are sent through
-the pager.
-
-Fixed debugfs's "dump_file" and "cat" functions work correctly
-on file systems whose block size is greater than 8k.
-
-Fix e2freefrag so it works on 64-bit file systems, and so it uses much
-less memory.  (Addresses Google Bug: 7269948)
-
-Update the spd_readdir.c file in the contrib directory to include some
-additions which were made in 2008 that didn't get folded into the
-version which we checked into the e2fsprogs source tree.  These
-enhancements include thread safety, support for readdir64_r(), and
-safe_getenv() support in case spd_readdir.so is used for setuid binaries.
-
-Update Czech, Dutch, French, German, Polish, Sweedish, and Vietnamese
-translations
-
-Add a command to debugfs to create symlinks.
-
-Document the bigalloc feature in the mke2fs man page.  (Addresses
-Debian Bug: #669730)
-
-
-Programmer's Notes
-------------------
-
-Fix gcc -Wall nits.
-
-Fix a spelling typo in the libext2fs texinfo documentation.
-
-Change the output from "make check" so that tools such as emacs's "M-x
-compile" does not mistake the output as containing a compiler error.
-
-Export two new functions from libext2fs: ext2fs_extent_node_split()
-and ext2fs_extent_goto2().
-
-The ext2fs_extents_fix_parents() was fixed so it does not modify the
-location of the extent handle if its current location is at an
-interior node, rather than a leaf node of an inode's extent tree.
-
-Add a regression test to assure that e2fsck can correctly fix an
-inconsistent interior node in an inode's extent tree.
-
-The ext2fs_{mark,unmark,test}_block_bitmap_range2() functions now
-correctly support bigalloc file systems which use store block usage
-information in units of clusters.
-
-Fixed the help text in the configure script for --enable-quota.
-
-The m68k-specific bitops code has been removed since they were
-incorrectly treating bit numbers with the high bit set as signed
-integers.  Furthermore, modern compilers do a good enough job
-optimizing the generic code there is no point in having the m68k
-specific asm statements.
-
-Fixed how we link the test programs so they always use the static
-libraries, so that we test using the libraries which we have just
-built.
-
-Update config.guess and config.sub to the latest versions from the GNU
-project.
-
-Fixed the com_err.texinfo file so that it can produce a valid
-postscript/pdf printed output.
-
-Add a regression test which checks debugfs's ability to create
-symlinks, named FIFO's, and device nodes.
-
-Add a function ext2fs_symlink(), which creates symlinks to the
-libext2fs library.
-
-Add debugging code so we can test old kernel interfaces for online
-resize to resize2fs.  This backwards compatibility checking is keyed
-off of the RESIZE2FS_KERNEL_VERSION, which is designed to allow us to
-test the functionality of the kernel's older resize ioctls without
-needing to install an old version of resize2fs, and to also test a
-modern resize2fs's ability to work with older kernels without having
-to install an older version of the kernel.
-
-
-E2fsprogs 1.42.6 (September 21, 2012)
-=====================================
-
-When mke2fs creates file systems with lazy itable initialization, the
-progress updates for writing the inode table happens so quickly that
-on a serial console, the time to write the progress updates can be the
-bottleneck.  So mke2fs will now only update its progress indicators
-once a second.
-
-Resize2fs will skip initializing the inode tables if the kernel
-supports lazy_itable_init, which speeds up growing off-line growth of
-uninit_bg file systems significantly.  Resize2fs will now also
-correctly set the itable_unused field in the block group descriptor to
-speed up the first e2fsck after the file system is grown.
-
-Resize2fs has been fixed so that on-line resizing of meta_bg file
-systems work correctly.  This is needed to grow file system which are
-larger than 16T.
-
-Resize2fs will now correctly handle resizing file systems to 16TB on
-32-bit file systems when "16TB" is specified on the command line.
-
-Fix mke2fs so that it will be careful to set the reserved blocks ratio
-larger than 50%; this can happen when creating small file systems and
-when the last block group is dropped because there are not enough
-blocks to support the metadata blocks in the last block group.
-
-Fixed spelling mistake in debugfs's help message.
-
-Fixed a potential seg fault in e2fsck when there is an I/O error while
-reading the superblock.
-
-Fixed various Debian Packaging Issues (Addresses Debian Bug #677497)
-
-Updated/fixed various man pages.  (Addresses Sourceforge Bug:
-#3559210)
-
-Programmer's Notes
-------------------
-
-The configure option --enable-relative-symlink was broken so that it
-needed to be --enable-symlink-relative-symlinks.  We will support both
-for at least two years, but then the worng configure option will be
-removed.
-
-Fixed a regression introduced in 1.42.5 so the link order for
-e2fsprogs' libraries will be correct for both static and shared
-linking.  (Addresses Sourceforge Bug: #3554345)
-
-Add support for e2fsprogs to be compiled using clang/LLVM.
-
-Fix portability problems on non-Linux systems: avoid compile failures
-on systems that don't have malloc.h
-
-Fix f_mmp regression test suite so that debugfs gets killed if the
-test is interrupted.
-
-
-
-E2fsprogs 1.42.5 (July 29, 2012)
-================================
-
-Fixed a bug with mke2fs where if there is only 8 inodes per block
-group, the calculation of the number of uninitialized inodes in the
-first block group would go negative.  This resulted in "mke2fs -N 256
--t ext4 /tmp/foo.img 256m" trying to write so many blocks that /tmp
-would run out of space.  (Addresses Sourceforge Bug: #3528892)
-
-Fixed a bug in how e2fsck would uniquify directory entry names.
-(AddressesSourceforge Bug: #3540545)
-
-Previously, e2fsck would only allow a mounted file system to be
-checked if it was the root file system and it was mounted read-only.
-Now it will allow any file system mounted read-only to be checked if
-the -f option is specified.  This makes it easier to test how e2fsck
-handles checking file systems which are mounted without having to test
-on the root file system.
-
-Fixed a problem if e2fsck where if the root file system is mounted
-read-only, e2fsck would not clear an error indication in the journal
-superblock.  Combined with a kernel bug, this would cause the e2fsck
-to check the file system after every single boot.
-
-The e4defrag program can now handle device symlinks, such as
-/dev/mapper/testvg-testlv, instead of insisting on a less
-human-friendly name such as /dev/dm-2.  (Addresses Red Hat Bugzilla:
-#707209)
-
-Fixed filefrag so it will not crash with a segfault on files from a
-virtual file system such as /proc.  (e.g., "filefrag
-/proc/partitions")
-
-Fixed filefrag so that it correctly reports the number of extents.
-(Addresses Red Hat Bugzilla: #840848)
-
-Fixed a file descriptor leak in logsave which could cause it to hang.
-(Addresses Debian Bug: #682592)
-
-Fixed e2fsck so that the file system is marked as containing an error
-if the user chooses not to fix the quota usage information.
-
-Fixed tune2fs so that it correctly removes the quota feature when the
-last quota inode is removed.
-
-Fix tune2fs so that after removing a quota inode, the block bitmap is
-updated; otherwise, e2fsck would complain after running 'tune2fs -O
-^quota <dev>'.
-
-Fix tune2fs so that when converting a file system from using legacy
-quota files to the new quota file system feature with hidden quota
-files, the accounting for these files is handled correctly so that
-e2fsck doesn't complain.
-
-Improved e2fsck's verbose reporting statistics, and allow the more
-verbose reporting to be enabled via /etc/e2fsck.conf.
-
-Fixed various Debian Packaging Issues (Addresses Debian Bug #678395)
-
-Updated/fixed various man pages.  (Addresses Debian Bugs: #680114)
-
-
-Programmer's Notes
-------------------
-
-Fixed portability problems on other operating systems (e.g., Hurd and
-FreeBsd) caused by the attempted inclusion of <sys/quota.h>.
-
-Make sure that shared libraries link with the shared libraries built
-in the build tree, instead of the system provided libraries.
-Previously, libraries and executables were linked with the system
-libraries if present, and possibly using static archives instead of
-shared libraries.  This was also problematic since if libext2fs.so is
-linked with a static libcom_err.a from system, the build system would
-attempt to link without -lpthread.  (Addresses Sourceforge Bug:
-#3542572)
-
-
-E2fsprogs 1.42.4 (June 12, 2012)
-================================
-
-Fixed more 64-bit block number bugs (which could end up corrupting
-file systems!) in e2fsck, debugfs, and libext2fs.
-
-Fixed e2fsck's handling of the journal's s_errno field.  E2fsck was
-not properly propagating the journal's s_errno field to the superblock
-field; it was not checking this field if the journal had already been
-replayed, and if the journal *was* being replayed, the "error bit"
-wasn't getting flushed out to disk.
-
-Fixed a false positive complaint by e2fsck if all of the extents in
-the last extent tree block are uninitalized and located after the end
-of the file as defined by i_size.
-
-The dumpe2fs will now display the journal's s_errno field if it is
-non-zero, and it will also display the journal's 64-bit feature flag
-if present.
-
-Fix e2fsck so that it always opens the device file in exclusive mode
-when it might need to modify the file system, and never if the -n
-option is specified.  (Previously, there were a few corner cases where
-it might get things wrong in either direction.)
-
-E2fsck now correctly truncates or deallocates extent-mapped inodes on
-the orphan list.  The root cause was a bug in libext2fs's block
-iterator which could end up skipping an extent when the last block in
-an extent is removed, causing the current extent to be removed from
-the extent tree.
-
-E2fsck now correctly sets the global free block and inode counts when
-truncating or removing inodes on the orphan list in preen mode.
-Previously, it would leave these values would be set incorrectly,
-which is largely a cosmetic issue since the kernel no longer pays
-attention to those fields, but it can cause spurious complaints in
-subsequent e2fsck runs.
-
-Fix i_blocks accounting when the libext2fs library needs to add or
-remove an extent tree block  on bigalloc file systems.
-
-The lsattr and chattr programs now support the No_COW flag for the
-benefit of btrfs.
-
-Debugfs now interprets date strings of the form @ddd as ddd seconds
-after the beginning of the epoch.  This is handy when setting an inode
-number into the d_time field when debugging orphan list handling.
-
-Fix a precedence bug with built-in quota support which might result in
-e2fsck paying attention to the quota inode field even if the built-in
-quota feature flag is not set.  Fortunately, in practice that
-superblock field should be zero for non-built-in quota file systems,
-so it's unlikely this bug would have caused problems.
-
-Updated/fixed various man pages.  (Addresses Debian Bugs: #674453,
-#674694)
-
-Programmer's Notes
-------------------
-
-The regression test suite can now run the integration tests in the
-tests directory in parallel, via "make -jN check".
-
-Add new test, f_zero_extent_length which tests e2fsck's handling of
-the case where all of the extents in the last extent tree block are
-uninitialized extents after i_size.
-
-Add a new test, f_jnl_errno, which checks handling of an error
-indication set in the journal superblock.
-
-Fix the test f_jnl_64bit so that it properly checks e2fsck's handling
-of a 64-bit journal.
-
-Add two tests, f_orphan_indirect_inode and f_orphan_extent_inode which
-tests e2fsck's handling of orphan inodes in preen mode, and truncation
-of extent inodes on the orphan list.
-
-Fixed more OS X portability issues.
-
-
-E2fsprogs 1.42.3 (May 14, 2012)
-===============================
-
-Fix a bug in the Unix I/O manager which could cause corruption of file
-systems with more than 16TB when e2fsprogs is compiled in 32-bit mode
-(i.e., when unsigned long is 32-bits).  Also fix a bug which caused
-dumpe2fs to incorrectly display block numbers > 32-bits.
-
-Improve the support for integrated quota files (where quota is a first
-class supported feature using hidden files in the ext4 file system).
-Previously the quota file was getting rewritten even when it was not
-necessary, and e2fsck would erroneously try to hide quota files which
-were already hidden.
-
-Quiet complaints in e2fsck when the total free blocks or inodes are
-incorrect in the superblock after an system crash, since we don't
-update nor depend on the superblock summaries at each commit boundary.
-
-Fixed a regression introduced in 1.42.2 which would cause applications
-outside of e2fsprogs which did not pass the EXT2_FLAG_64BIT (and so
-would were still using the legacy 32-bit bitmaps) to crash.  This was
-due to missing 32-bit compat code in side the function
-ext2fs_find_first_zero_generic_bmap().  (Addresses Red Hat Bugzilla:
-#808421)
-    
-Fix a bug which would cause mke2fs to fail creating the journal if
-/etc/mtab and /proc/mounts are missing.  (Addresses Sourceforge Bug:
-#3509398)
-    
-Updated/fixed various man pages.
-
-Update Czech, Dutch, French, German, Polish, Sweedish, and Vietnamese
-translations
-
-Fixed various Debian Packaging issues.
-
-
-Programmer's Notes
-------------------
-
-Change the nonsensically wrong types in the function signature of the
-inline function ext2fs_find_first_zero_block_bitmap2().  This was
-caused by a cut and paste error; fortunately no code in e2fsprogs used
-this inline function, and there are any users of this functions
-outside of e2fsprogs.
-
-Add support for systems which have valloc(), but which do have
-posix_memalign() nor memalign() (such as MacOS 10.5).
-
-Refactor and clean up the allocation of aligned buffers for Direct I/O
-support.  Previously some allocations were requesting a greater
-alignment factor that what was strictly necessary.  Also optimize
-reading and writing bitmaps using Direct I/O when the size of the
-bitmap did not fully cover the file system blocksize.
-
-Reserve the codepoints for the INCOMPAT features LARGEDATA and
-INLINEDATA.
-
-Improved the regression test suite by adding some new integration
-tests (f_jnl_32bit, f_jnl_64bit) which detect breakage of the on-disk
-jbd2 format, as well as f_eofblocks which tests the new handling of
-uninitialized and initialized blocks beyond i_size.  Also add a new
-unit test which verifies 32-bit bitmaps support and the new
-find_first_zero primitives.
-
-Add a few dependencies to fix parallel (make -j) builds.
-
-Removed bash'isms which were breaking the regression test suite on
-systems where /bin/sh is not bash.
-
-The config.guess and config.sub have been updated to the 2012-02-10
-version.
-    
-Fix a portability problem caused by assuming the present of mntent.h
-means that setmntent() exists.  Instead, explicitly test for this in
-the configure script.
-
-If the sys/signal.h header file does not exist, don't try to include
-it, since it's not available on all systems.
-
-Add support for systems that do not support getpwuid_r()
-    
-The configure script now supports a new option,
---enable-relative-symlinks, which will install relative symlinks for
-the ELF shared library files.  (Addresses Sourceforge Bug: #3520767).
-    
-When building BSD shared libraries make sure the LDFLAGS variable is
-passed to the linker.  Fixing this allows, for example, e2fsprogs to
-be built in 32-bit mode on Mac OS X Lion (Addresses Sourceforge Bug:
-#3517272)
-    
-Fix gcc -Wall nitpicks
-
-
-E2fsprogs 1.42.2 (March 27, 2012)
-=================================
-
-The resize2fs program uses much less CPU and is much faster for very
-large file systems.  (Addresses Debian Bug: #663237)
-
-The seti and freei commands in debugfs can now take an optional length
-argument to set and clear a contiguous range of inodes.
-
-E2fsck will now make explicit checks for the EOFBLOCKS_FL, since we
-plan to remove support for it from the kernel file system driver.  It
-really wasn't very useful and was causing more problems than it
-solves.  Since e2fsck will complain if inodes that should have
-EOFBLOCKS_FL do not have the flag set, we are going to remove this
-check from e2fsprogs first, and then only remove the flag from the
-kernel much later.
-
-The mke2fs program can now use direct I/O via "mke2fs -D".  This will
-slow down the mke2fs, but it makes it more polite on a loaded server
-by limiting the amount of memory that gets dirtied by mke2fs when it
-is using buffered I/O.
-
-E2fsck was needlessly closing and re-opening the file system as a side
-effect of adding Multiple Mount Protection (MMP).  This isn't
-necessary for non-MMP file systems, so drop it.
-
-Print errors returned by ext2fs_open2() and ext2fs_check_desc() so we
-can more easily diagnose memory allocation failures caused by
-insufficient memory.  E2fsck will now abort if there are memory
-allocation failures when the file system is initially opened and
-during the block group descriptor checks.  (Addresses Google Bug:
-#6208183)
-
-If there are incorrect block group checks, e2fsck will now report the
-incorrect and corrected checksum values.
-
-The e2fsck progam can now write log files containing the details of
-the problems that were found and fixed directly, via configuration
-parameters in /etc/e2fsck.conf.
-
-Added the ability to limit the number of messages reported by e2fsck
-for a given problem type.  This avoids a potential bottleneck if there
-is a serial console which can cause a boot sequence to take a long
-time if e2fsck needs to report many, many file system errors.
-
-The dumpe2fs, debugfs, and tune2fs now use rbtree bitmaps, which cause
-them to use much less memory for large file systems.
-
-The dumpe2fs program will now print the expected block group checksum
-if it is incorrect.  This helps to diagnose problems caused by
-incorrect block group checksums.
-
-E2fsck now checks for extents with a zero length, since the kernel
-will oops if it comes accross such a corrupted data structure.  (See
-https://bugzilla.kernel.org/show_bug.cgi?id=42859)
-
-E2fsck has a number of bugs relating to discard that have been fixed.
-(1) Fixed a bug which could cause e2fsck to discard portions of the
-inode table which were actually in use.  (2) E2fsck will now avoid
-using discard if the block device doesn't zero data on discard, since
-otherwise this could cause problems if the file system gets corrupted
-in the future.  (3) E2fsck will now avoid using discard when it is run
-in read-only mode.  (4) Fixed a bug which caused e2fsck to not issue
-discards in the last block group.
-
-E2fsck's CPU utilization in pass 5 has been optimized, which will
-speed up e2fsck slightly.
-
-E2image will now skip copying uninitialized bitmap and inode table
-blocks.
-
-Fixed mke2fs -S so it does not corrupt the first block group's
-information.
-
-E2fsck will now check the new sysfs interface to determine if we are
-using the battery or AC mains.  (Addresses SourceForge Bug: #3439277)
-
-Updated/fixed various man pages.  (Addresses Debian Bug: #665427)
-
-Fixed various Debian Packaging issues.  (Addresses Debian Bug: #665885)
-
-Programmer's Notes
-------------------
-
-Fixed various portability issues for non-Linux systems, particularly
-MacOS X, as well as Linux systems running with the just-released glibc
-2.15.
-
-Fix file descriptor leak in ext2fs_close() if the file system with
-uninit_bg is opened read/only with a backup superblock.  (Addresses
-SourceForge Bug: #3444351)
-
-Fixed an invalid return in a non-void function in the quota code.
-(Addresses SourceForge Bug: #3468423)
-
-Fixed the debian rules file so that the calls to dpkg-buildflags works
-when the shell is dash.
-
-The debian package build now uses V=1 so that there is more
-information about potential build failures in debian buildd logs.
-
-If the uninit flags get cleared by functions such as
-ext2fs_new_inode() or ext2fs_new_block2(), we now make sure the
-superblock is marked dirty and the block group descriptor checksum is
-updated if necessary.
-
-The debian rules file will now try to load debian/rules.custom of it
-exists.  This flie can skip various builds for speed reasons if there
-is no need for the e2fsck-static or udeb packages.  Available
-customizations in the rules file includes SKIP_STATIC=yes,
-SKIP_BF=yes, and SKIP_DIETLIBC=yes.
-
-In addition, if the file misc/mke2fs.conf.custom.in exists in the
-source tree, it will be used instead of the standard misc.conf file in
-the upstream sources.  This makes it easier for Debian-derived systems
-to distribute a custom mke2fs.conf file without having to worry about
-merge issues if future versions of e2fsprogs makes changes in the
-upstream default version of mke2fs.conf.
-
-
-E2fsprogs 1.42.1 (February 17, 2012)
-===================================
-
-The mke2fs and e2fsck now use significantly less memory when creating
-or checking very large file systems.  This was enabled by adding
-extent-based bitmaps which are stored using a red-block tree, since
-block and inode allocations tend to be contiguous.
-
-The command mke2fs -S is used as a last ditch recovery command to
-write new superblock and block group descriptors, but _not_ to destroy
-the inode table in hopes of recovering from a badly corrupted file
-system.  So if the uninit_bg feature is enabled, mke2fs -S will now
-set the unused inodes count field to zero.  Otherwise, e2fsck -fy
-after using mke2fs -S would leave the file system completely empty.
-
-Since mke2fs recognizes mke3fs in argv[0] to mean "mkfs.ext3", also
-honor "mke4fs" to work the same as "mke2fs.ext4", since RHEL5 has
-installed an mke2fs binary using that name.
-
-The usage and help messages for the -G, -t and -T options in mke2fs
-have been fixed.
-
-If e2fsck needs to use the backup group descriptors, the
-ext2fs_open2() function clears the UNINIT bits to ensure all of the
-inodes in the file systems get scanned.  However, the code which reset
-the UNINIT flags did not also recalculate the checksum, which produced
-many spurious (and scary) e2fsck messages.  This has been fixed by
-resetting cheksums when the UNINIT bits are cleared.
-
-Relax a check in e2fsck which required that the block bitmap to be
-initialized when the inode bitmap is in use.  This will allow us to
-eventually eliminate code from the kernel which forcibly initialized
-the block bitmap when the inode bitmap is first used, requiring an
-extra journal credit and disk write.  (Addresses Google Bug: #5944440)
-    
-Make sure rdebugfs (which may be installed setuid or setgid disk) does
-not honor environment variables if euid != uid or egid != gid.
-
-Debugfs's ncheck command has been optimized and now is much more
-robust with faced with corrupted file systems.  The ncheck command
-also now has a -c option which will verify the file type information
-in the directory entry to see if matches the inode's mode bits.  This
-is extremely useful when trying to use debugsfs to determine which
-parts of the file system metadata can be trusted.
-
-E2image will try to use ftruncate64() to set the i_size for raw
-images, instead of writing a single null byte.  This avoid allocating
-an extra block to the raw image, for those file systems and/or
-operating systems that support this.  (Linux does.)  In addition, fix
-a logic bug that caused the file to not be properly extended if the
-size of the last hole was exactly an multiple of a megabyte.
-
-Fixed a bug in resize2fs where for 1k and 2k file systems, where
-s_first_data_block is non-zero, this wasn't taken into account when
-calculate the minimum file system size for use with the -M option.
-
-Fixed the badblocks program to honor the -s flag when in read-only -t
-mode.  (Addresses Debian Bug #646629)
-
-Update Czech, Dutch, French, Polish, and Sweedish translation from the
-Translation Project.
-
-Fixed various Debian Packaging issues so that dpkg-buildflags is used
-if present, which allows e2fsprogs to be built with security hardening
-flags.  (Addresses Debian Bugs: #654457)
-
-Programmer's Notes
-------------------
-
-Fix a bug in ext2fs_clear_generic_bmap() when used for 32-bit bitmaps.
-This was only an issue for programs compiled against e2fsprogs 1.41
-that manipulate bitmaps directly.  (Addresses Sourceforge Bugs:
-#3451486)
-
-The libext2fs library now uses sysconf() to fetch the page size, instead
-of the deprecated getpagesize().
-
-The ext2fs_get_pathname() function will return a partial path if an a
-directory in the path is not a directory, displaying it as an inode
-number in angle brackets instead of giving up and displaying an error.
-This is much more helpful when a user is trying to debug a corrupted
-file system.
-
-Codepoints for the RO_COMPAT_REPLICA feature has been reserved.
-
-Added a new library function, ext2fs_file_get_inode_num(), for use by
-fuse2fs.
-
-Fixed a bug in ext2fs_file_set_size2() so that when it is truncating a
-file, it actually works.
-
-The block iterator now properly honors the BLOCK_ABORT flag for
-extent-based flags.  Previously, it didn't, which generally made code
-be less efficient, but it could cause bugs in ext2fs_link(), for
-example, by causing it to insert multiple directory entries.
-
-Fixed an (harmless other than causing a compiler warning) use of an
-uninitialized variable in e2fsck's MMP code.
-
-
-E2fsprogs 1.42 (November 29, 2011)
-==================================
-
-This release of e2fsprogs has support for file systems > 16TB.  Online
-resize requires kernel support which will hopefully be in Linux
-version 3.2.  Offline support is not yet available for > 16TB file
-systems, but will be coming.
-
-This release of e2fsprogs has support for clustered allocation.  This
-reduces the number of block (now cluster) bitmaps by allocating and
-deallocating space in contiguous power-of-2 collections of blocks,
-which are called clustered.  This is a file system level feature,
-called 'bigalloc', which must be enabled when the file system is
-initially formatted.  It is not backwards compatible with older
-kernels.
-
-Added support for the Multi-Mount Protection (MMP) feature.
-
-E2fsck more efficiently uses scratch files for really big file
-systems.  (This is a feature that has to be turned on explicitly; see
-[scratch_files] in the e2fsck.conf man page.)
-
-Fix a bug in e2fsck where if the free blocks and inodes counts are
-incorrect, e2fsck would fix them without printing an error message.
-This would cause a "*** FILE SYSTEM WAS MODIFIED ***" message without
-any explanation of what was fixed.
-
-E2fsck will no longer attempt to clone an extended attribute block in
-pass1b handling if the file system does not support extended
-attributes.
-
-E2fsck will be more careful accidentally asking the user to continue
-if the file system is mounted, so that an escape sequence won't cause
-a false positive.  (Addresses Debian Bug: #619859)
-
-E2fsck now uses less cpu time in pass 5 when large portions of the
-bitmaps are uninitialized.
-
-E2fsck will no longer segault when a corrupted file system has a bad
-extent, and removing it leads to a block needing to be deallocated.
-(Addresses SourceForge Bug: #2971800)
-
-E2fsck will catch termination signals (segfaults, bus errors, sigfpe)
-and print debugging information to make it easier to find potential
-problems.
-
-E2fsck will check to see if the bad block inode looks insane, and will
-skip trying to use if it certain fields which should be zero look
-non-zero.  This is to avoid a corrupted bad block inode causing e2fsck
-to get confused and do more harm than good.
-
-If e2fsck modifies certain superblock fields which the kernel doesn't
-look at, it will now mark the superblock as dirty without marking the
-file system as changed.  This avoids signalling the init scripts that
-a reboot is necessary, since the kernel isn't going to look at those
-fields, so it won't care if they have been changed.
-
-Fixed a bug in the libext2fs library (in the binary search routine of
-the icount abstraction) that could (very, very rarely) cause e2fsck to
-die in the middle of pass 1 or pass 2 processing.
-
-E2fsck will not try to do a discard operation if the -n option was
-specified on the command line.
-
-E2fsck now supports an extended "discard" option which will cause
-e2fsck to attempt discard all unused blocks after a full, successful
-file system check.
-
-E2fsck will check for the bad block inode to make sure it looks sane
-before trusting it, to avoid causing more harm than good to the file
-system.
-
-E2fsck now returns additional status bits in its exit code if it
-aborts early in the e2fsck run.
-
-E2fsck now correctly calculates the maximum file size in the case of
-the huge_file file system feature enabled without extents.
-
-The mke2fs and e2fsck programs now tries to use the punch hole command
-as a "discard" when operating on normal files.
-
-The e2image program now supports the qcow2 format, which is a more
-efficient way of capturing file system dumps.
-
-Mke2fs now supports the [devices] stanza in mke2fs.conf which allows
-per-device defaults to be specified in the configuration file.
-
-Mke2fs now supports the reserved_ratio relation in the [defaults] and
-[fs_types] section in mke2fs.conf.
-
-Mke2fs now creates extent-mapped directories for the root and
-lost+found directories.
-
-Mke2fs will skip zero'ing the journal if the extended option
-"lazy_journal_init" is specified.  This can save a lot of time, but it
-does add a small amount of risk if the system crashes before the
-journal is overwritten entirely once.  It is epsecially useful for
-testing.
-
-Mke2fs will now create file systems that enable user namespace
-extended attributes and with time- and mount count-based file
-system checks disabled.
-
-Mke2fs will not set a stride or strip size of one block based on block
-device attributes obtained from sysfs.
-
-Mke2fs now displays a progress report during the discard process.
-
-Mke2fs now handles extreme file system parameters correctly which
-previously caused the inodes per group to drop below 8, leading to a
-segfault.  (The inodes per group must be a multiple of 8, but the code
-didn't correctly deal with an inodes per group count less than 8.)
-
-Mke2fs and tune2fs previously would give an error if the user tried
-setting the stride and stripe-width parameters to zero; but this is
-necessary to disable the stride and stripe-width settings.  So allow
-setting these superblock fields to zero.  (Addresses Google Bug:
-#4988557)
-
-Mke2fs now gives a warning if the auto-detected block size exceeds the
-system's page size.
-
-If the enable_periodic_fsck option is false in /etc/mke2fs.conf (which
-is the default), mke2fs will now set the s_max_mnt_count superblock
-field to -1, instead of 0.  Kernels older then 3.0 will print a
-spurious message on each mount then they see a s_max_mnt_count set to
-0, which will annoy users.  (Addresses Debian Bug: #632637)
-    
-The default mke2fs.conf now has entries for "big" and "huge", which
-are needed for very big file systems.
-
-The resize2fs program now has support for a new online resize ioctl
-that can support file systems > 16TB, once it arrives in v3.x kernels.
-
-Fixed bug which caused resize2fs to fail when shrinking an empty file
-system down to its minimal size.  (Addresses Sourceforge Bug #3404051)
-
-Fixed tune2fs's mount options parsing.  (Addresses Debian Bug: #641667)
-
-Allow tune2fs to remove external journals if the device can not be
-found.
-
-Debugfs's icheck will now correctly find inodes which use the
-searched-for block as an extended attribute block.
-
-Debugfs now has a new "punch" command which remove blocks from the
-middle of an inode.
-
-Debugfs now has a new "e2freefrag" command which analyzes the free
-space fragmentation of the file system, using the same code as the
-e2freefrag program.
-
-Debugfs now has a "filefrag" command which displays information about
-a file's fragmentation.
-
-Add support to build a metadata-only, read-only, stripped-down version
-of debugfs called rdebugfs.
-
-Fixed a potential stack overrun bug in debugfs.
-
-The badblocks program now correctly recovers from I/O errors when
-direct I/O is being used.  The badblocks command now also supports a
--B option which forces the use of buffered I/O, and the -v option will
-provide a more detailed breakdown of read, write, and failed
-comparison errors.
-
-Added e4defrag tool which uses the EXT4_IOC_MOVE_EXT ioctl.
-
-Added support for journals larger than 2GB.
-
-Support using both hard links and symlinks when installing e2fsprogs.
-
-Add overflow checking to tune2fs -i's fsck interval, which must fit in
-a 32-bit field.
-
-The debugfs command now has a new 'blocks' command which prints out
-data blocks of a particular inode in a format which is useful for
-scripting.
-
-Filefrag will report 0 extents correctly in verbose mode.  (Addresses
-RedHat Bugzilla: #653234)
-
-Filefrag has been fixed so its -v report prints the correct expected
-block number (previously there had been an off-by-one error).  In
-addition, it will now display the number of contiguous extents when -v
-is not specified.  This makes it consistent with the number of extents
-printed when the -v option was specified.  In addition, the number of
-contiguous extents is far more interesting/useful than the number of
-physical extents for very large files.  (Addresses Debian Bug:
-#631498, #644792)
-    
-Logsave's usage message has been fixed.  (Addresses Debian Bug:
-#619788)
-
-Avoid an infinite loop in ext2fs_find_block_device() if there are
-symlink loops in /dev caused by a buggy udev.
-
-Added a useful "fallocate" program to the contrib directory.
-
-Fixed an ABI compatibility problem in libext2fs which broke the dump
-program.  Also added back some macros which dump needed so it could
-compile against the latest version of ext2_fs.h (Addresses Debian Bug:
-#636418)
-
-Fixed parsing of MNTOPT_ options for tune2fs and debugfs (Addresses
-Debian Bug: #641667)
-
-Added internationalization support for libcom_err error table strings.
-
-Fixed various spelling mistakes found in various output strings found
-by I18N translators.
-
-Update translations: French, Chinese, Germany, Indonesian, Swedish,
-Vietnamese, Polish, Dutch, Czech.  (Addresses Debian Bugs: #520985,
-#620659)
-
-Fixed various Debian Packaging issues.  (Addresses Debian Bugs:
-#614662, #632169, #641838, #627535, #629355)
-
-Updated/clarified man pages.  (Addresses Debian Bugs: #639411,
-#642193, #634883)
-
-Programmer's Notes
-------------------
-
-Initial support for quota as an integrated feature, where the quota
-files are hidden system files that are automatically maintained by
-e2fsck is present, although disabled by default.  It must be enabled
-by using the configure option --enable-quota.
-
-Reserved the on-disk fields for the metadata checksum and snapshot
-features, which are currently in development.
-
-The ext2fs library now has the new functions ext2fs_punch(),
-ext2fs_get_memzero() and ext2fs_file_get_inode().
-
-The ext2fs library now has support for calculating the crc32c checksum
-(via the new functions ext2fs_crc32c_be and ext2fs_crc32c_le).
-
-The I/O manager now supports the discard operation.
-
-Reserved file system code points for new 1st class quota feature.
-
-Shortened the compilation lines by moving the autoconf defines to
-a config.h header file.
-
-Fixed a potential free of an unitialized pointer in
-ext2fs_update_bb_inode().
-
-Fixed miscellaneous gcc -Wall and coverity warnings.
-
-Fixed portability issues for Mac OS X, Hurd, and FreeBSD.
-
-Fixed a build failure when OMIT_COM_ERR is defined.
-
-Improved error checking and fixed memory leaks caused by error return
-paths.
-
-Add ext2fs_flush2() and ext2fs_close2() which takes a flag to allow
-the fsync() to be skipped.
-
-Added a test for extent-mapped journals by mke2fs and tune2fs.
-
-Added a test for creating a large (over 4GB) journal using mke2fs.
-
-Added a test to make sure the inode size remains constant.
-
-The regression test script now prints the list of which tests failed.
-
-The regression test system now uses /tmp for its scratch files, which
-is often a tmpfs mounted file system and hence much faster.
-
-The i_e2image test was fixed so it works with valgrind.
-
-Tests that rely on debugfs are now skipped if debugfs wasn't built.
-
-Fixed the dependencies for "make check" so all required dependencies
-are built before running the gression tests.
-
-A link to com_err.h is installed in $(includedir) during a "make install".
-
-The po/*.gmo files are automatically rebuilt if they are missing or
-out of date.  This helps out Debian packaging.
-
-Allow ext2fs_get_memalign() to compile on systems that don't have
-posix_memalign().
-
-Fixed a namespace leak in libext2fs (tdb_null).
-
-
-E2fsprogs 1.41.14 (December 22, 2010)
-=====================================
-
-Fix spurious complaint in mke2fs where it would complain if the file
-system type "default" is not defined in mke2fs.conf.
-
-The resize2fs program will no longer clear the resize_inode feature
-when the number reserved group descriptor blocks reaches zero.  This
-allows for subsequent shrinks of the file system to work cleanly for
-flex_bg file systems.
-
-The resize2fs program now handles devices which are exactly 16T;
-previously it would give an error saying that the file system was too
-big.
-
-E2fsck (and the libext2fs library) will not use the extended rec_len
-encoding for file systems whose block size is less than 64k, for
-consistency with the kernel.
-
-Programming notes
------------------
-
-E2fsprogs 1.41.13 would not compile on big-endian systems.  This has
-been fixed.  (Addresses Sourceforge Bug: #3138115)
-
-The ext2fs_block_iterator2() function passed an incorrect ref_offset
-to its callback function in the case of sparse files.  (Addresses
-Sourceforge Bug: #3081087)
-    
-Fix some type-punning warnings generated by newer versions of gcc.
-
-
-E2fsprogs 1.41.13 (December 13, 2010)
-=====================================
-
-E2fsck now supports the extended option "-E journal_only", which
-causes it to only do a journal replay.  This is useful for scripts
-that want to first replay the journal and then check to see if it
-contains errors.
-
-E2fsck will now support UUID= and LABEL= specifiers for the -j option
-(which specifies where to find the external journal).  (Addresses
-Debian Bug #559315)
-
-E2fsck now has support for the problems/<problem code>/force_no
-configuration option in e2fsck.conf, which forces a problem to not be
-fixed.
-
-Dumpe2fs will now avoid printing large negative offsets for the bitmap
-blocks and instead print a message which is a bit more helpful for
-flex_bg file systems.
-
-Mke2fs will now check the file system type (specified with the -t
-option) to make sure it is defined in the mke2fs.conf file; if it is
-not, it will print an error and abort.  If the usage type (specified
-with the -T option) is not defined in mke2fs.conf, mke2fs will print a
-warning but will continue.  (Addresses Debian Bug #594609)
-
-Clarified error message from resize2fs clarifying that on-line
-shrinking is not supported at all.  (Addresses Debian Bug #599786)
-    
-Fix an e2fsck bug that could cause a PROGRAMMING BUG error to be
-displayed.  (Addresses Debian Bug #555456)
-
-E2fsck will open the external journal in exclusive mode, to prevent
-the journal from getting truncated while it is in use due to a user
-accidentally trying to run e2fsck on a snapshotted file system volume.
-(Addresses Debian Bug #587531)
-
-Fix a bug in e2fsck so it has the correct test for the EOFBLOCKS_FL
-flag.
-
-The tune2fs program can now set the uninit_bg feature without
-requiring an fsck.
-
-The tune2fs, dumpe2fs, and debugfs programs now support the new ext4
-default mount options settings which were added in 2.6.35.
-
-The e2fsck and dumpe2fs programs now support the new ext4 superblock
-fields which track where and when the first and most recent file
-system errors occurred.  These fields are displayed by dumpe2fs and
-cleared by e2fsck.  These new superblock fields were added in 2.6.36.
-
-Debugfs now uses a more concicse format for listing extents in its
-stat command.  This format also includes the interior extent tree
-blocks, which previously was missing from stat's output for
-extent-based files.
-
-Debugfs has a new option, -D, which will request Direct I/O access of
-the file system.
-
-Mke2fs will skip initializing the inode table if a device supports
-discard and the discard operation will result in zero'ed blocks.
-
-Badblocks will now correctly backspace over UTF-8 characters when
-displaying its progress bar.  (Addresses Gentoo Bug #309909; Addresses
-Debian Bugs #583782 and #587834)
-
-E2freefrag will now display the total number of free extents.
-
-Resize2fs -P no longer requires a freshly checked filesystem before
-printing the minimum resize size.
-
-Fixed a floating point precision error in a binary tree search routine
-that can lead to seg fault in e2fsck and resize2fs.
-
-Fixed a bug in e2fsck where if both the original and backup superblock
-are invalid in some way, e2fsck will fail going back to the original
-superblock because it didn't close the backup superblock first, and
-the exclusive open prevented the file system from being reopened.
-
-Fixed a big in e2freefrag which caused getopt parsing to fail on
-architectures with unsigned chars.  (Addresses Gentoo Bug: #299386)
-
-Clarified an mke2fs error message so a missed common in an -E option
-(i.e., mke2fs -t ext4 -E stride=128 stripe-width=512 /dev/sda1")
-results in a more understandable explanation to the user.
-
-Mke2fs now displays the correct valid inode ratio range when
-complaining about an invalid inode ratio specified by the user.
-
-Mke2fs now understands the extended option "discard" and "nodiscard",
-and the older option -K is deprecated.  The default of whether
-discards are enabled by default can be controled by the mke2fs.conf
-file.
-
-Mke2fs's handling of logical and physical sector sizes has been
-improved to reflect the fact that there will be some SSD's with 8k and
-16k physical sectors arriving soon.  Mke2fs will no longer force block
-size to be the physical sector size, since there will be devices where
-the physical sector size is larger than the system's page size, and
-hence larger than the maximal supported block size.  In addition, if
-the minimal and optimal io size are not exported by the device, and
-the physical sector size is larger than the block size, the physical
-sector size will be used to set the Raid I/O optimization hints in the
-superblock.
-
-E2fsck will now display a better, more specific error message when the
-user enters a typo'ed device name, instead of blathering on about
-alternate superblocks.
-
-Fixed various Debian Packaging Issues
-
-Updated/clarified man pages (Addresses Debian Bugs: #580236, #594004,
-#589345, #591083; Addresses Launchpad Bug: #505719)
-
-Update the Chinese, Chzech, Dutch, French, Germany, Indonesian,
-Polish, Swedish, and Vietnamese translations.
-
-
-Programmer's Notes
-------------------
-
-Fix a dependency definition for the static and profiled blkid
-libraries which could cause compile failures in some configurations.
-(Addresses Debian Bug: #604629)
-    
-Add support for Direct I/O in the Unix I/O access layer.
-
-Fixed a memory leak in the Unix I/O layer when changing block sizes.
-
-Fixed minor memory leaks in mke2fs.
-
-Added a new function to the ext2fs library, ext2fs_get_memalign().
-
-The tst_super_size test program will check to make sure the superblock
-fields are correctly aligned and will print them out so they can be
-manually checked for correctness.
-
-Fixed some makefile dependencies for test programs in lib/ext2fs.
-
-Reserved the feature flags and superblock fields needed for the Next3
-snapshot feature.
-
-Reserved the feature flags for EXT4_FEATURE_INCOMPAT_DIRDATA and
-EXT4_INCOMPAT_EA_INODE.
-
-
-E2fsprogs 1.41.12 (May 17, 2010)
-================================
-
-Mke2fs now gives a correct error message if the external journal
-device is not found.  (Addresses Red Hat Bug #572935)
-
-Resize2fs -P will now refuse to print a minimum size if the file
-system is not clean.  Previously it would go ahead and print a minimum
-size anyway, which might not be correct, leading to user confusion.
-
-E2fsck now tests for extents that begin at physical block 0 and
-rejects them as invalid.  (Addresses Google Bug: #2573806)
-    
-Fixed a bug in e2fsck which could cause it to crash when trying to
-remove an invalid extent and the block bitmaps hadn't yet been loaded.
-(Addresses SourceForge Bug: #2971800)
-    
-E2fsck now will completely skip time-based checks if the system clock
-looks insane or the option broken_system_clock is set in
-/etc/e2fsck.conf.
-
-E2fsck would previously report an i_blocks corruption for a 4T file
-created using posix_fallocate; this bug has been fixed.
-
-E2fsck will now correctly mark a sparse journal as invalid and will
-delete and recreate the journal to address the problem.
-
-E2fsck would previously incorrectly ask the user whether she would
-like to abort the file system check after finding a problem --- and
-then abort regardless of the user's answer.  This is annoying, and
-has been fixed.
-
-E2fsck can now continue even if it fails to recreate the resize
-inode; previously it would just abort the file system check
-altogether.
-
-E2fsck could potentially remove directory entries for inodes found in
-the unused region of the inode table; this would generally happen on
-ext4 file systems that do not use journaling.  This bug has been fixed
-by not clearing these directory entries once it has been established
-that bg_unused_inodes may not be trustworthy; once pass #2 has been
-completed, e2fsck will restart the file system check from the
-beginning, and then it will be safe to delete any directory entries
-pointing to inodes that appear to be deleted.  (Addresses Google Bug:
-#2642165)
-    
-E2fsck will not try to set the block group checksums if the user
-cancels the fsck with a control-C.  It's a bad idea to set the
-checksums if e2fsck hasn't been completed, and it often results an the
-error message, "Inode bitmap not loaded while setting block group
-checksum info".  (Addresses Launchpad Bug: #582035)
-
-The mke2fs program now queries the kernel for the physical as well as
-the logical sector size, and will not allow a blocksize below the
-logical, and will strongly encourage a blocksize at least as big as
-the physical blocksize.  This is needed for 4k sector drives that
-emulate 512 byte sector sizes.
-
-Mke2fs will now allow a flex_bg size of 1.  This is unusual, and
-rarely needed, but it is a legal value.
-
-E2fsck will check for cases where the EOFBLOCKS_FL is set when it is
-not needed, and offer to clear it; this is a sign of a kernel bug, but
-more importantly, some released kernels may crash when this situation
-is encountered on ext4 file systems.  (Addresses Google Bug: #2604224)
-    
-E2fsck will use the EOFBLOCKS_FL flag exclusively to check whether
-i_size is correct.  (Kernels starting with 2.6.34 will set
-EOFBLOCKS_FL.)
-
-The com_err library will now only output ^M (a CR character) when the
-tty is in raw mode.
-
-Update the Czech, Chinese, Dutch, French, Germany, Indonesian, Polish,
-and Vietnamese translations.
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bugs: #571247, #563487)
-
-
-Programmer's Notes
-------------------
-
-The regression test suite now uses its own mke2fs.conf file, so that
-downstream distributions want change the mke2fs.conf file which is
-distributed in the RPM or dpkg file, without worrying about screwing
-up the regression test results.
-
-Always build namei.o so that building with configure --disable-debugfs
-works correctly.  Long-term, if we care about reduced e2fsprogs
-builds, we need a more general solution for deciding what .o files are
-needed for a particular build.  Given that install floppies are going
-(gone?) the way the dodo bird, we probably don't care, though.
-(Addresses Sourceforge Bug: #2911433)
-
-Add configure options --enable-symlink-build and
---enable-symlink-install, which allow e2fsprogs be built using
-symlinks instad of hard links, and to be installed using symlinks
-instead of hard links, respectively.  It is useful when the file
-system where the build is taking place, or the file system where
-e2fsprogs is installed, can't handle hard links for some reason.
-(Addresses Sourceforge Bug: #1436294)
-
-Fixed compile warning in mke2fs.c.
-
-    
-E2fsprogs 1.41.11 (March 14, 2010)
-==================================
-
-E2fsck will no longer give a fatal error and abort if the physical
-device has been resized beyond 2**32 blocks.  (Addresses Launchpad
-Bug: #521648)
-
-Debugfs has a bug fixed so that "logdump -b <blk>" now properly shows
-the allocation status of the block <blk>.  (Addresses Debian Bug:
-#564084)
-    
-E2fsck now prints a much more emphatic and hopefully scary message
-when a file system is detected as mounted while doing a read/write
-check of the filesystem.  Hopefully this will dissuade users from
-thinking, "surely that message doesn't apply to *me*" :-(
-
-E2fsck -n will now always open the file system read-only.  We now
-disallow certain combination of options which previously were manual
-exceptions; this is bad because it causes users to think they are
-smarter than they really are.  So "-n -c", "-n -l", "-n -L", and "-n
--D" are no longer supported.  (Addresses Launchpad Bug: #537483)
-    
-In e2fsprogs 1.41.10, mke2fs would ask for confirmation to proceed if
-it detected a badly aligned partition.  Unfortunately, this broke some
-distribution installation scripts, so it now just prints the warning
-message and proceeds.  (Addresses Red Hat Bug: #569021. Addresses
-Launchpad Bug: #530071)
-    
-Mke2fs would take a long time to create very large journal files for
-ext4.  This was caused by a bug in ext2fs_block_iterate2(), which is
-now fixed.
-
-E2fsck now understands the EOFBLOCKS_FL flag which will be used in
-2.6.34 kernels to make e2fsck not complain about blocks deliberately
-fallocated() beyond an inode's i_size.
-
-E2fsprogs 1.41.10 introduced a regression (in commit b71e018) where
-e2fsck -fD can corrupt non-indexed directories when are exists one or
-more file names which alphabetically sort before ".".  This can happen
-with ext2 filesystems or for small directories (take less than a lock)
-which contain filenames that begin with a space or some other
-punctuation mark.  (Addresses Debian Bug: #573923, Addresses Launchpad
-Bug: #525114)
-
-
-Programmer's Notes
-------------------
-
-Add new test, f_rehash_dir, which checks to make sure e2fsck -D works
-correctly.
-
-The libcom_err function now has support for Heimdal's com_right_r
-function().  (Addresses Sourceforge Bug: #2963865, Addresses Debian
-Bug: #558910)
-
-
-E2fsprogs 1.41.10 (February 7, 2010)
-====================================
-
-Fix resize2fs bug which causes it to access invalid memory.
-
-Add libss support for libreadline.so.6.
-    
-Fix e2fsck's check for extent-mapped directory with an incorrect file
-type.
-
-Add new e2fsck.conf configuration option, default/broken_system_clock
-to support systems with broken CMOS hardware clocks.  Also, since too
-many distributions seem to have broken virtualization scripts now,
-e2fsck will by default accept dates which are off by up to 24 hours by
-default.  (Addresses Debian Bugs: #559776, #557636)
-
-Fix a bug where mke2fs may not use the best placement of the inode
-table when there is only room for a single block group in the last
-flex_bg.
-
-E2fsck is now smarter when it needs to allocate blocks in the course
-of fixing file system problems.  This reduces the number of spurious
-differences found in pass #5.
-
-E2fsck will no longer rehash directories which fit in a single
-directory block.
-
-E2fsck now correctly handles holes in extent-mapped directories (i.e.,
-sparse directories which use extents).
-
-Fix big-endian problems with ext2fs_bmap() and ext2fs_bmap2().
-
-Fix a bug in filefrag where on platforms which can allow file systems
-with 8k blocks, that it doesn't core dump when it sees a file system
-with 8k block sizes.  (Thanks to Mikulas Patocka for pointing this
-out.)
-
-E2fsck will correctly fix directories that are have an inaccurate
-i_size as well as other problems in a single pass, instead of
-requiring two e2fsck runs before the file system is fully fixed.
-
-Fix e2fsck so it will correctly find and detect duplicate directory
-entries for non-indexed directories.  ( Addresses Sourceforge Bug:
-#2862551)
-    
-Mke2fs will use BLKDISCARD to pre-discard all blocks on an SSD or
-thinly-provisioned storage device.  This can be disabled using the -K
-option.
-
-Enhance libext2fs so it works around bug in Linux version 2.6.19
-and earlier where the /proc/swaps file was missing the header on
-the first line.
-
-Fix bug in Linux version 2.6.19 and earlier where the /proc/swaps file
-was missing the header on the first line.
-
-Fix some big-endian bugs in e2fsck and libext2fs.
-
-Fix resize2fs so it works correctly on file systems with external
-journals instead of failing early with the error "Illegal inode
-number".
-
-Fix libss so that it does not seg fault when using a readline library
-which does not supply a readline_shutdown() function.
-
-Updated dumpe2fs's usage message so it correctly gives the right
-arguments summary for "-o superblock=<num>" and "-o blocksize=<num>".
-(Addresses Launchpad Bug: #448099)
-   
-Teach libext2fs to ignore the high 32 bits of the i_blocks field
-when huge_file file system feature is set, but the inode does not
-have the HUGE_FILE_FL flag set.
-
-Fix e2fsck's handling of 64-bit i_blocks fields.
-
-E2fsck will now print "Illegal indirect block", "Illegal
-double-indirect block", etc., instead of "Illegal block #-1" or
-"Illegal block #-2", etc.  This makes it easier for users to
-understand what has gone wrong.  (Addresses SourceForge Bug: #2871782)
-
-Mke2fs now will obtain get device topology information from blkid and
-use it to populate the superblock stride and stripe sizes.  It will
-also warn if the block device is misaligned
-
-Fix file descriptor leaks in fsck and debugfs.  (Addresses Novell Bug:
-##524526)
-
-Fix the libext2fs library code to round up the bitmap size to a 4-byte
-boundary, to prevent spurious seg faults caused by the x86
-architecture.  This doesn't affect Linux systems, but was a major
-problem on a number of *BSD systems.  (Addresses Sourceforge Bug:
-#2328708)
-
-Fix resize2fs's minimum size required for a file system so it doesn't
-fail when "resize2fs -M" is run.  (Addresses RedHat Bugzilla: #519131)
-    
-Dumpe2fs now prints summary information about the contents of the
-journal.
-    
-Avoid printing scary error messages when e2fsck starts running
-problems on low-memory systems, as it tends to panic and mislead the
-user.  (Addresses Debian Bug: #509529)
-
-Fix blkid's modules.dep parser so it handles compressed (.ko.gz)
-modules files.  (Address Red Hat Bug: #518572)
-    
-Fix tune2fs so it can add a journal when an extent-enabled file system
-is mounted.  (Addresses Launchpad bug: #416648)
-
-Update Czech, Indonesian, Polish and Vietnamese translations (from the
-Translation Project).
-    
-Update/clarify man pages.  (Addresses Sourceforge Bug: #2822186)
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bugs: #540111)
-
-Programmer's Notes
-------------------
-
-The configure script supports the --with-cc, --with-ccopts, and
---with-ldopts options.  Instead, the more standard use of CC=,
-CCFLAGS=, and LDFLAGS= in the configure command line is used instead.
-Also, --with-ld, which never worked, was also removed.
-(Addresses Sourceforge Bug: #2843248)
-
-The in-tree header files are only used if the in-tree uuid or blkid
-libraries are used.  Otherwise, use the system-provided uuid or blkid
-header files if using the system-provided libraries.
-
-Fix some build failures caused by --disable-* configure options.
-
-Work around a bug in autoconf 2.64.
-
-
-E2fsprogs 1.41.9 (August 22, 2009)
-==================================
-
-Fix a bug in e2fsck routines for reallocating an inode table which
-could cause it to loop forever on an ext4 filesystem with the FLEX_BG
-filesystem feature with a relatively rare (and specific) filesystem
-corruption.  This fix causes e2fsck to try to find space for a new
-portion of the inode table in the containing flex_bg, and if that
-fails, the new portion of the inode table will be allocated in any
-free space available in the filesystem.
-
-Make e2fsck less annoying by only asking for permission to relocate a
-block group's inode table once, instead of for every overlapping
-block.  Similarly, only ask once to recompute the block group
-checksums, instead of once for each corrupted block group's checksum.
-
-Fix filefrag to avoid print the extent header if the FIEMAP ioctl is
-not present, and it needs to fall back to using the FIBMAP ioctl.
-
-Fix filefrag to correctly print the number of extents for zero-length
-files.  (Addresses Debian Bug: #540376)
-
-Filefrag now has a -B option which forces the use of the FIBMAP ioctl
-to more easily debug the FIBMAP code.
-
-Fixed filefrag for non-extent based files.
-
-Add a new program, e2freefrag, which displays information about the
-free space fragmentation in an ext2/3/4 filesystem.
-
-Fix inode resizing via tune2fs -I so that it works correctly in the
-face of non-empty bad blocks inodes, and if the filesystem was
-formatted using the "mke2fs -E stride=N" option for RAID arrays.
-
-Fix regression in ext2fs_extent_set_bmap() caused e2fsck -fD to fail
-and corrupt large directories if the directory needs to shrink by more
-than one block.  (Addresses Debian Bug: #537510)
-    
-Fix e2fsck's buggy_init_scritps=1 so that the if the last write and/or
-last mount times are in the future, they are corrected even if
-buggy_init_scripts is set.  This is needed because otherwise resize2fs
-will refuse to resize the filesystem, even after running "e2fsck -f".
-(Addresses Launchpad bug: #373409)
-
-E2fsck will now print much fuller information when the last mount time
-or last written time is in the future, since most people can't seem to
-believe their distribution has buggy init scripts, or they have a
-failed CMOS/RTS clock battery.
-
-Enhance dumpe2fs to dump the extent information via the 'stat'
-command, and more detailed extent information via the new command
-'dump_extents'.
-    
-Update French, Polish, Czech, and Sweedish translation from the
-Translation Project.
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.
-
-Programmer's Notes
-------------------
-
-Fixed miscellaneous gcc -Wall warnings.
-
-Fixed memory leak in error path in ext2fs_block_iterate2()
-
-Fixed non-Linux build of the intl directory by adding support for the
-E/Q/V macros.
-
-The bitmap read/write functions now treat uninitialized bitmaps as
-unallocated; this fixes a number of problems in all e2fsprogs for ext4
-filesystems when there is a need to allocate new blocks or inodes, and
-there aren't any free blocks or inodes in the already-used block
-groups.
-
-Improve ext2fs_extent_set_bmap() to avoid creating new extents which
-get inserted into the extent tree when they are not needed.
-    
-
-E2fsprogs 1.41.8 (July 11, 2009)
-================================
-
-Fix resize2fs's online resizing, fixing a regression which in
-e2fpsrogs 1.41.7.   (Addresses Debian Bug: #535452)
-
-Fix potential filesystem corruptions caused by using resize2fs to
-shrinking ext4 filesystems with extents enabled.  (Addresses Red Hat
-Bug: #510379)
-
-Optimize uuid_generate() to avoid running uuidd if it is not setuid or
-setgid and the currently running program doesn't have write access to
-the uuidd work directory.
-
-Add safety checks (for non-Linux systems) so that uuidd isn't run with
-file descriptors 0, 1, and 2 closed; and if they are closed, uuidd
-will be careful not to close the file descriptor for its unix domain
-socket when it detaches itself from the controlling tty.  Also add
-safety checks so that if the unix domain socket between the uuid
-library and uuidd program is closed for any reason, both the library
-and the uuidd will return an appropriate error code instead of looping
-in an infinite loop.
-
-The e2croncheck script, which creates an LVM snapshot and then checks
-the ext3/4 filesystem via the LVM snapshot, has been added to the
-contrib directory.
-
-Fix filefrag program for files that have more than 144 extents.
-
-Update French, Polish, Czech, Indonsian, and Sweedish translation from
-the Translation Project.
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bug #535530)
-
-Update/clarify man pages.
-
-Programmer's Notes
-------------------
-
-Fix compilation problem when configured with --disable-uuid.
-
-Don't build uuidgen if configured with --disable-uuid.
-
-Add the new library function ext2fs_test_inode_bitmap_range(), and
-optimized ext2fs_test_block_bitmap_range(), which will be needed for
-future optimizations for e2fsck.
-
-Fix makefile dependencies for libcom_err so that the Makefiles work
-well on non-GNU make program.  (Addresses Sourceforge Patches: #2813809)
-
-Enhance the build system so that the full set of commands executed by
-the Makefiles are displayed, instead of the Linux kernel summary
-output, if the build was configured with --enable-verbose-makecmds, or
-if GNU make is in use and the V variable is non-null, i.e., via "make
-V=1".
-
-
-E2fsprogs 1.41.7 (June 29, 2009)
-================================
-
-Fix a bug in libext2fs which can cause e2fsck and resize2fs to write
-uninitalized data into the portion of the inode beyond the first 128
-bytes when operating on inodes mapped via extents; potentially
-corrupting filesystems.
-
-Fix memory leaks in e2fsprogs, including a very large memory leak
-which can cause e2fsck to run out of memory when checking very large
-filesystems using extents.
-
-The logsave program will now filter out the ^A and ^B characters when
-writing to the console.
-
-Harden ext2fs_validate_entry() so that lsdel will not read beyond the
-end of the block even if the directory block is corrupted.
-
-Fix debugfs from core dumping if the logdump command fails to open the
-output file.
-
-Enhance badblocks to print the currently tested block number when
-interrupted with ^C.
-
-Fix lsattr to exit with a non-zero status when it encounters errors.
-(Addresses RedHat Bugzilla #489841)
-
-Fix e2fsprogs to use the same encoding for rec_len in 64k (and larger)
-filesystems as the kernel when encoding rec_len >= 64k.  For 64k
-filesystems (currently all that is supported by e2fsprogs, this is
-only a minor corner case).
-
-Resize2fs will now update the journal backup fileds in the sup0erblock
-if the journal is moved; this avoids an unnecessary full fsck after
-resizing the filesystem.  (Addresses RedHat Bugzilla: #505339)
-    
-Fix libext2fs to properly initialize i_extra_size when creating the
-journal and resize inodes.
-
-Change badblocks to allow block sizes larger than 4k.
-
-Fix filefrag progam so it correctly checks for errors from the fiemap ioctl.
-
-Update Chinese and Czech translation from the Translation Project.
-
-Clean up various man pages.  (Addresses Debian Bug #531385 and #523063)
-
-
-Programmer's Notes
-------------------
-
-Add --disable-libuuid option to configure which uses an in-system
-installed version of libuuid; the private version is enabled by
-default.
-
-Add --valgrind-leakcheck option to the test_script program which runs
-valgrind with the appropriate options to find memory leaks.
-
-
-E2fsprogs 1.41.6 (May 30, 2009)
-===============================
-
-Fix a critical regression in e2fsck introduced version 1.41.5 which
-can undo updates to the block group descriptors after a journal replay.
-
-If e2fsck receives an I/O error while replaying the journal, prompt
-the user whether they want to ignore the error or not; if e2fsck is
-run in preen mode, force fsck to abort the preen pass.
-
-Fix a bug which would cause e2fsck to core dump if the filesystem
-contains a corrupt extent header, and the user declines to clear the
-inode.  (Addresses Sourceforge Bug: #2791794)
-    
-Fix e2fsck to restart only once in the case of multiple block groups
-which inodes in use that are in the uninitialized part of the block
-group's inode table.
-
-To reduce user confusion, if the /etc/mtab file is missing
-ext2fs_check_mount_point and ext2fs_check_if_mounted will return a
-new, explicit error code to indicate this case.  This will cause
-e2fsck to give a clearer error message when the user is using buggy
-rescue CD's that don't properly set up /etc/mtab.  (Addresses Debian
-Bug: #527859)
-    
-Fix e2fsck so that if the primary group descriptors are corrupted, but
-the backup superblock is entirely invalid, to go back to using (and
-fixing) the priary group descriptors instead of completely giving up
-on the filesystem.  (Addresses Debian Bug: #516820)
-    
-Change e2fsck to not abort a preen pass if an inode is found to have
-i_file_acl_hi non-zero.  Ext3 filesystems don't care, and newer
-kernels (post 2.6.29) will ignore this field.  So let's fix it
-automatically during the preen pass instead of forcing the user to fix
-this up manually.  (Addresses Debian Bug: #526524)
-    
-Add resource tracking for e2fsck passes 1b through 1d.
-
-Speed up e2fsck by eliminating unnecessary journal checks if the
-filesystem is already mounted and doesn't need recovery (since the
-kernel would have run the journal when the filesystem was mounted.)
-Also speed up e2fsck by avoiding unnecessary block group descriptor
-updates in ext2fs_close().
-
-Add support to chattr to migrate inodes from using direct/indirect
-blocks to extents.
-
-Avoid corrupting the filesystem if there is an attempt to shrink a
-filesystem using resize2fs smaller than posible by making
-ext2fs_set_bmap() more careful not to delete the old block until the
-new block can be inserted.  In addition, fix a bug in how the minimum
-size of the filesystem (plus a safety margin) is calculated, and
-modify resize2fs to refuse to shrink the filesystem below that minimum
-size without the force flag.
-
-Teach blkid to try to figure out DM device names using take advantage
-of information in sysfs when running on kernels (2.6.29 and later)
-which provide this information in /sys/block/dm-<N>/dm/name; this is
-much faster than scanning for the devncie number in /dev/mapper.
-
-Fix blkid to prefer /dev/mapper/<name> device names instad of the
-private /dev/dm-X names.
-
-Add an -a option to debugfs's close_filesys command which writes any
-changes to the superblock or block group descriptors to all of the
-backup superblock locations.
-    
-Add support to the filefrag program to use the FIEMAP ioctl.
-
-Update Chinese translation from the Translation Project.
-
-Clean up various man pages.  (Addresses Red Hat Bugzilla: #502971 and
-Launchpad Bug: #381854)
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bug #506064)
-
-
-Programmer's Notes
-------------------
-
-Add test code to make sure e2fsck's problem.c doesn't have two problem
-codes assigned to duplicate values.
-
-Avoid using a hard-coded path for /bin/rm in block's test_probe.in.
-(Addresses Sourceforge Bug: #2780205)
-
-Clean up e2fsck by removing #ifdef RESOURCE_TRACK by adding an empty
-function declaration for init_resource_track() and
-print_resource_track() when RESOURCE_TRACK is not defined.
-
-The test code which is used to build the tst_csum progam has been
-moved from from tst_csum.c into csum.c under an #ifdef DEBUG to to
-avoid compile problems caused by not having a prototype for
-ext2fs_group_desc_csum().  (Addresses Sourceforge Bug #2484331)
-
-Update the config.guess and config.sub file to the latest from the
-FSF, to allow e2fsprogs to build on the avr32 platform.  (Addresses
-Debian Bug: #528330)
-
-Add a new function, ext2fs_extent_open2(), which behaves like
-pext2fs_extent_open(), but uses the user-supplied inode structure
-when opening an extent instead of reading the inode from disk.
-
-
-E2fsprogs 1.41.5 (April 23, 2009)
-=================================
-
-Fix a number of filesystem corruption bugs in resize2fs when growing
-or shrinking ext4 filesystems off-line (i.e., when the ext4 filesystem
-is not mounted).
-
-Debugfs can now set i_file_acl_high via the set_inodes_field command,
-and print a 64-bit file acl.  This is useful for debugging filesystem
-corruptions where the high bits of i_file_acl_high are set.  E2fsck
-will detect and fix non-zero i_file_acl_high on 32-bit filesystems
-since some Linux kernel versions pay attention to this field even when
-they shouldn't.
-
-Speed up e2fsck when checking clean filesystems by avoiding
-unnecessary block reads, and coalescing the block group descriptor
-blocks so they are read using a single read operation.
-
-The libuuid library will now close all file descriptors before running
-uuidd.  This avoids problems when the calling program has open sockets
-which then never get closed because uuidd is a long-running helper
-daeomn.  (Addresses Launchpad bug: #305057)
-
-In order to avoid unnecessary full filesystem checks by e2fsck after
-an on-line resize, e2fsck will ignore the NEEDS_RECOVERY flag set on
-the backup superblocks.  (Addresses Red Hat Bugzilla: #471925)
-
-Mke2fs will avoid trying to create the journal when run in
-superblock-only mode (mke2fs -S), since the left-over journal in the
-inode table will cause mke2fs to fail.
-
-Fix a bug in libext2fs functions that check to see if a particular
-device or filesystem image is mounted, which would cause these
-functions to report that a file identical to the (relative) pathname
-used by a pseudo-filesystem was mounted when in fact it was not.
-
-Update Czech translation from the Translation Project.
-
-Add Chinese (simplified) translation from the Translation Project.
-
-Fix support for external journals (which was broken in e2fsprogs
-1.41.4).
-
-Fix a regression in debugfs where the "stat" command when no
-filesystem was open would cause debugfs to crash with a segmentation
-violation.
-
-Starting in the 2.6.29 linux kernel, the ext4 filesystem driver can be
-used to support filesystems without a journal.  Update the blkid
-library so it understands this.
-
-The blkid library will remove an entry from the blkid cache
-representing the entire disk if partitions are found, since presuambly
-the device previously had no partition table, but has now transitioned
-to using a partition table.
-
-Add a check to mke2fs and tune2fs that the argument to the -m option
-(which specifies the reserved ratio) must be greater than zero.
-(Addresses Debian Bug: #517015)
-
-Add support for tracking the number kilobytes written to the
-filesystem via the superblock field s_kbytes_written.  It will be
-updated by the kernel as well as by e2fsprogs programs which write to
-the filesystem.  This is useful for tracking the wear to filesystems
-on Solid Sstate Drives.
-
-Fix compatibility issue in the libext2fs info file and makeinfo
-version 4.12.  (Addresses Red Hat Bugzilla: #481620)
-
-Update/clarify man pages.  (Addresses Debian Bug: #515693, #365619)
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details. (Addresses Debian Bug: #506279)
-
-Programmer's Notes
-------------------
-
-Fix Hurd compilation problem in e2fsck and tune2fs (Addresses Debian
-Bug: #521602)
-
-Fix various gcc compilation warnings and other programming cleanups.
-(Addresses Red Hat Bugzilla: #486997)
-
-Add support for building the blkid command statically.
-
-Add support for disabling the built-in blkid library in favor of a
-system-installed blkid implementation via the configure option
---disable-libblkid.
-
-
-E2fsprogs 1.41.4 (January 27, 2009)
-===================================
-
-Fixed a bug which could sometimes cause blkid to return an exit value
-of zero for a non-existent device (Addresses Debian Bug: #502541)
-
-Blkid will now recognize ext3 filesystems that have the test_fs flag
-set as ext3 filesystems.
-
-The blkid library will now recognize btrfs filesystems and swap
-devices currently used by user-level software suspend.
-
-Tune2fs now updates the block group checksums when changing the UUID
-to avoid causing e2fsck to complain vociferously at the next reboot.
-
-Tune2fs's inode size resizing algorithms have been fixed so it is not
-vastly inefficient for moderate-to-large filesystems, due to some
-O(n**2) and O(n*m) algorithms that didn't scale well at all.
-
-Fix tune2fs's inode resizing algorithm so it will not corrupt
-filesystems laid out for RAID filesystems; in addition, tune2fs will
-refuse to change the inode size for filesystems that have the flex_bg
-feature enabled.  (This is a limitation in the current implementation
-of tune2fs -I.)
-
-E2fsprogs 1.41 broke debugfs's logdump command for normal ext3/4
-filesystems with 32-bit block numbers, when the headers for 64-bit
-block numbers was added.  This regression has been fixed.
-
-Debugfs's ncheck command has been fixed to avoid printing garbage
-characters at the end of file names.
-
-Fix resize2fs for ext4 filesystems.  Some blocks that that need moving
-when shrinking filesystems with uninit_bg feature would not be moved.
-In addition, blocks and inode table blocks were not being correctly
-freed when shrinking filesystems with the flex_bg feable, which caused
-resize2fs -M to fail.  Finally, when blocks are moved, make sure the
-uninitialized flag in extents is preserved.
-
-Fix bug which caused dumpe2fs to abort with an error if run on a
-filesystem that contained an external journal.
-
-Some distributions used "mke3fs" as an alias for "mkfs.ext3"; check
-for this in argv[0] to provide better legacy support for these
-distributions.  This is a practice that should NOT be continued,
-however.
-
-Mke2fs now has a new option -U, which allows the user to specify the
-UUID that should be used for the new filesystem.
-
-Mke2fs will treat devices that are exactly 16TB as if they were 16TB
-minus one block.  This allows users who have read that ext3 supports
-up to 16TB filesystems and who create a 16TB LVM to not get confused,
-since the true limit is really 16TB minus one block.
-
-E2fsck will no longer abort an fsck run if block group has an errant
-INODE_UNINIT flag.
-
-E2fsck now distinguishes between fragmented directories and fragmented
-files in verbose mode statistics and in the fragcheck report.
-
-Fix a bug in e2fsck which casued it double count non-contiguous
-extent-based inodes.
-
-E2fsck will leave some slack space when repacking directories to allow
-room for a few directory entries to be added without causing leaf
-nodes to be split right away.
-
-Fix a bug which caused e2fsck to crash when it comes across a
-corrupted interior node in an extent tree with the error message:
-"Error1: Corrupt extent header on inode XXXXXX"
-
-E2fsck problem descriptions involving the journal are no longer
-referred to as "ext3" problems, since ext4 filesystems also have
-journals.
-
-Fix a long-standing bug in e2fsck which would cause it to crash when
-replying journals for filesystems with block sizes greater than 8k.
-
-Update Catalan translation from the Translation Project.
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details. (Addresses Debian Bugs: #503057, #502323, #511207)
-
-Programmer's Notes
-------------------
-
-Fix build of e2fsck.profiled, and add support for building profiled
-binaries in the misc directory if configured with --enable-profile.
-
-The ext2fs_open() function now performs more sanity checks on the
-superblock to avoid potential divide by zero errors by other parts of
-library.
-
-The ext2fs_read_inode_full() function now has a safety check to avoid
-a segmentation fault on corrupted filesystems.
-
-The ext2fs_new_inode() function now has a sanity check so that if the
-s_first_inode field in the superblock is insane, it will return
-EXT2_ET_INODE_ALLOC_FAIL instead of returning an invalid inode number.
-
-To avoid segmentation faults, ext2fs_block_alloc_stats() and
-ext2fs_inode_alloc_stats() now validates the passed inode or block
-number to avoid overrunning an array boundary.
-
-Various signed/unsigned errors for variables containing block numbers
-have been fixed.
-
-Accomodations for gcc's stupidity in not realizing that constant
-strings that do not contain a '%' character are safe to use in format
-strings have been made so that distributions that want to compile
-e2fsprogs with -Werror=format-security have an easier time doing so.
-
-Added a new 64-bit getsize interface, ext2fs_get_device_size2().
-
-Added the utility make-sparse.c to the contrib directory.
-
-The ext2fs_block_iterate2() function now reflects errors from
-ext2fs_extent_set_bmap() to the caller, if the callback tries to
-change a block on an extent-based file, and ext2fs_extent_set_bmap()
-fails for some reason (for example, there isn't enough disk space to
-split a node and expand the extent tree.
-
-The ext2fs_block_iterate2() function will preserve the uninit flag in
-extents when the callback function modifies a block in an extent-based
-file.
-
-E2fsck will now flag filesystems that have an insane s_first_ino field
-in their superblock, and attempt to use a backup superblock to repair
-the filesystem.
-
-
-E2fsprogs 1.41.3 (October 12, 2008)
-===================================
-
-E2fsck has been fixed so it prints the correct inode number for
-uinit_bg related problems.
-
-E2fsck will now offer to clear the test_fs flag if the ext4 filesystem
-is available on linux.  This can be disabled via a configuration
-option in /etc/e2fsck.conf.
-
-Fix a file descriptor leak in libblkid when checking to see if an ext4
-or ext4dev module exists.
-
-Fix a bug in e2fsck where in preen mode, if there are disk I/O errors
-while trying to close a filesystem can lead to infinite loops.
-(Addresses Red Hat Bugzilla #465679)
-    
-Fix a bug in resize2fs where passing in a bogus new size of 0 blocks
-will cause resize2fs to drop into an infinite loop.  (Addresses Red
-Hat Bugzilla: #465984)
-    
-Add a check in the Unix I/O functions in libext2fs so that when a
-device is opened read/write, return an error if the device is
-read-only using the BLKROGET ioctl.
-
-Fix debugfs's ncheck command so that it prints all of the names of
-hardlinks in the same directory.
-
-Fix a bug in libblkid so it correctly detects whether the ext4 and
-ext4dev filesystems are available, so that the ext4dev->ext4
-fallback code works correctly.
-
-Programmer's Notes
-------------------
-
-Fix a parallel build problem by making sure util/subst is built before
-trying to build the lib/et directory.  (Addresses Sourceforge Bug:
-#2143281)
-
-Updated "make depend" information for crc16.o
-    
-
-E2fsprogs 1.41.2 (October 2, 2008)
-==================================
-
-Fix e2fsck's automatic blocksize detection.  This fixes a regression
-from e2fsprogs 1.40.7 which caused e2fsck to fail if the user
-specifies a block number using the -b option if the blocksize option
-isn't also specified using -B.  Unfortunately, users very commonly
-invoke e2fsck using "e2fsck -b 32768 /dev/hdXXX" to use the backup
-superblock; in fack e2fsck will often suggest this kind of command
-line.  Oops.
-
-Enhance the debugfs's "ncheck" command so it will print all of the
-pathnames for the specified inodes.  (Previously, in some cases ncheck
-might not print a pathname for an inode at all if some of the other
-inodes had multiple hard links.)
-
-Enhance debugfs's "hash" command so the hash seed can be specified via
-a command-line option.  In addition, allow the hash algorithm to be
-specified by name instead of just by number.
-
-Fix e2fsck so that we don't accidentally print the translation file's
-header when asking the user a custom question so there is no prompt
-defined for a particular problem record.  For example, the question
-"Run journal anyway" will get the PO header tacked on because e2fsck
-erroneously passed the null string to _().  (Addresses Launchpad Bug:
-#246892)
-
-Enhance badblocks so that it can test a normal file which is greater
-than 2GB.
-
-Enhance the badblocks command so that it displays the time and
-percentage complete when in verbose mode.  (Addresses Debian Bug:
-#429739)
-
-Fix a potential memory leak in a error handling path in debugfs's
-ncheck function.
-
-Fix a potential memory corruption problem if a memory allocation fails
-in resize2fs.
-
-Fix the usage message for debugfs's logdump command to be consistent
-with its man manpage.
-
-Update Polish, French, Vietnamese, Dutch, Indonesian, German, Czech,
-and Sweedish translation from the Translation Project.
-
-Add documentation for the file I/O functions to the libext2fs.texinfo
-file.  (Addresses Debian Bug: #484877)
-    
-Update and clarified various man pages.  (Addresses Launchpad Bug
-#275272; Addresses Debian Bugs: #498100, #498101, #498102, #498103)
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details. (Addresses Debian Bug: #497619)
-
-Programmer's Notes
-------------------
-
-Fix a potential file descriptor leack in libcom_err by setting the
-close-on-exec flag for a fd used for debugging.  (Addresses Red Hat
-Bugzilla #464689)
-
-Fix a potential race in libcom_err by using sem_post/sem_init.  SuSE
-has been carrying a patch for a long time to prevent a largely
-theoretical race condition if a multi-threaded application adds and
-removes error tables in multiple threads.  Unfortunately SuSE's
-approach breaks compatibility by forcing applications to link and
-compile with the -pthread option; using pthread mutexes has
-historically been problematic.  We fix this by using sem_post/sem_init
-instead.
-
-Fix e2fsprogs-libs build failure due to 'subs' target.  (Addresses
-Sourceforge Bug: #2087502)
-
-Avoid linking e2initrd_helper, debugfs, blkid, and fsck with unneeded
-libraries when using ELF shared libraries.
-
-Fix ELF shared library when building on systems that don't already
-have the e2fsprogs shared libraries already installed.  (Addresses
-Sourceforge Bug: #2088537)
-
-Fix the pkg-config files so they work correctly when linking with
-static libraries and fix the include directory so programs don't have
-to use #include <ext2fs/ext2fs.h>, but can use #include <ext2fs.h>
-instead.  (Addresses Sourceforge Bug: #2089537)
-    
-Make sure ext2fs_swab64() is compiled for all platforms, and not just
-for x86.  (Addresses Debian Bug: #497515)
-    
-Remove the unused ext2fs_find_{first,ext}_bit_set() functions for all
-non-x86 platforms.  (They had been removed for x86 earlier.)
-
-Fix diet libc compilation support, which had bitrotted due to lack of
-TLC.  Fixing this improves general portability.
-
-When installing the link library when using ELF shared libraries,
-avoid using absolute pathnames if the link library and the shared
-library are installed in the same directory.  (Addresses Sourceforge
-Bug: #1782913)
-
-Fix gen-tarball so it will work even if the top-level directory has
-been renamed to something other than "e2fsprogs".  Also make
-gen-tarball print the size of the resulting tar.gz file.
-
-
-E2fsprogs 1.41.1 (September 1, 2008)
-====================================
-
-Many people are forgetting to update their mke2fs.conf file, and this
-causes ext3, ext4, and ext4dev filesystems won't get created with the
-proper features enabled.  We address this in two ways.  First, mke2fs
-will issue a warning if there is not definition for an ext3, ext4, or
-ext4dev filesystem and the user is trying to create such a filesystem
-type.  Secondly, when installing from a source build, "make install"
-will provide basic configuration file handling for /etc/mke2fs.conf.
-If it exists, and does not mention ext4dev, it will be moved aside to
-/etc/mke2fs.conf.e2fpsrogs-old and the new /etc/mke2fs.conf file will
-be installed.  If the existing /etc/mke2fs.conf file does mention
-ext4dev, then "make install" will install official mke2fs.conf file as
-/etc/mke2fs.conf.e2fsprogs-new and issue a message to the user that
-they should look to see if any changes need to be merged.
-
-The mke2fs program will now create the journal in the middle of the
-filesystem, since this minimizes seek times on average for fsync-heavy
-workloads.  In addition, mke2fs will now create journals using extents
-for filesystems that support them.  This results in a more efficient
-encoding for the journal since it eliminates the need for using
-indirect blocks.
-
-The mke2fs program will avoid allocating an extra block to the
-journal.  (Addresses Sourceforge Bug: #1483791)
-
-Mke2fs will correctly enforce the prohibition against features
-(specifically read-only features) in revision 0 filesystems.  (Thanks
-to Benno Schulenberg for noticing this problem.)
-
-Mke2fs previously would occasionaly create some slightly non-optimally
-placed inode tables; this bug has been fixed.
-
-The mke2fs and tune2fs programs now print the correct usage message
-describing the maximum journal size.  (Addresses Debian Bug: #491620)
-
-Add support for setting the default hash algorithm used in b-tree
-directories in tune2fs (from a command-line option) or mke2fs (via
-mke2fs.conf).  In addition, change the default hash algorithm to
-half_md4, since it is faster and better.
-
-The blkid library will now recognize MacOS hfsx filesystems, and
-correctly extract the label and uuid for hfs, hfsx, and hfsplus
-filesystems.  (Addresses Sourceforge Feature Requests: #2060292)
-
-The blkid library has improved detection of JFS and HPFS filesystems.
-(Addresses Launchpad Bug: #255255)
-
-The blkid library is now much more efficiently handling devicemapper
-devices, mainly by no longer using the devicemapper library.  This can
-speed up access for systems with a large number of device mapper
-devices.
-
-Blkid had a number of cache validation bugs in libblkid that have been
-fixed.   (Addresses Debian Bug: #493216)
-
-Resize2fs will now properly close out the "updating inode references"
-progress bar so there is a newline printed before printing the final
-"resize is successful" message.
-
-Resize2fs will now correctly handle filesystems with extents and/o
-uninitialized block groups correctly when file/directory blocks need
-to relocated (i.e., when shrinking a filesystem or if the resize_inode
-is not present).  To support this, the ext2fs library now supports
-initializing inode and block bitmaps that are not yet initialized when
-allocating them using ext2fs_new_block() and ext2fs_new_inode().  In
-addition, e2fs_block_iterate2() can now support changing the location
-of interior nodes of an extent tree, and ext2fs_extent_set_bmap() has
-been optimized to avoid creating unnecessary new extents when updating
-the location of blocks in the extent tree.  This will also help out
-e2fsck's recovery of obscurely corrupted filesystems with extents,
-when blocks are claimed by multiple inodes.
-
-Add support for on-line resizing ext4 filesystem with the flex_bg
-filesystem feature.  The method for doing so is not optimal, but to do
-a better job will require kernel support.
-
-E2fsprogs 1.41.0 intrduced a bug in libext2fs which casued e2image and
-debugfs programs to not be able to read e2image files; the signed
-vs. unsigned bug in the code which read bitmaps from the e2image has
-been fixed.   (Addresses Debian Bug: #495830)
-
-Resize2fs is now correctly managing the directory in-use counts when
-shrinking filesystems and directory inodes needed to be moved from one
-block group to another.  This bug has been around since e2fsprogs
-1.26, and is largely harmless, but does cause a filesystem corruption
-which will be flagged by e2fsck after the filesystem has been shrunk.
- 
-E2fsck will no longer issue spurious complaints about the inode size
-caused by very large extent-based files, and by blocks reallocated
-using fallocate() with the FALLOC_FL_KEEP_SIZE option.  (Addresses
-Kernel Bugzilla: #11341)
-
-Mke2fs will now set the creation timestamp on the lost+found directory
-and the root directory.  (More generally, all new inodes created using
-the ext2fs library will correctly set the creation timestamp.)
-
-E2fsck now correctly calculates ind/dind/tind statistics in the
-presence of extent-based files.  In addition, "e2fsck -v" will report
-statistics of the depth of extent trees in the filesystem.  E2fsck can
-also give an inode fragmentation report using "e2fsck -E fragcheck"
-which can be useful when debugging the kernel block allocation
-routines.
-
-Fix support for empty directory blocks in ext4 filesystems with 64k
-blocksize filesystems.
-
-E2fsck will now print the depth of corrupt htree directories.
-
-Debugfs's htree command now correctly understands extent-based
-directories.  It will also print out the minor hash as well as the
-major hash.
-
-Debugfs has a new command which will print the supported features of
-e2fsprogs, to enable scripts to know whether the installed version of
-e2fsprogs can support a specific feature.
-
-Debugfs will now write files using extents for filesystems that
-support them.
-
-The error message printed by "tune2fs -I" if the inode size was too
-small was rather confusing, so it has been improved.  Also, we won't
-try to create an undo log until we know that command-line-specified
-parameters such as "tune2fs -I <inode size>" are valid.
-
-Given some filesystems found "in the wild" that had non-zero block
-group checksums even though the uninit_bg/gdt_sum feature was not
-enabled, e2fsck would issue spurious error messages.  Teach
-ext2fs_group_desc_csum_verify() to ignore the block group checksum
-entirely if the feature flag is not set.  (Addresses Debian Bug:
-#490637)
-
-The blkid program will now print out a user-friendly listing of all of
-the block devices in the system and what they contain when given the
--L option.  (Addresses Debian Bug: #490527)
-
-The filefrag program now has a more accurate calculation for the
-number of ideal extents.  (Addresses Debian Bug: #458306)
-
-The test I/O manager is now enabled by default, but its overhead is
-only incurred when it would be enabled via the TEST_IO_FLAGS or
-TEST_IO_BLOCK environment variables.
-
-Typographical errors in various program strings and usage messages
-have been fixed; most of these were pointed out by the e2fsprogs
-message catalog translators.  (Thanks, translators!)
-
-Update and clarified various man pages, as well as some typographical
-errors in the libext2fs texinfo file.
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.
-
-Add Indonesian and update French, Polish, Dutch, German, Sweedish,
-Czech, and Vietnamese Translations.  (Addresses Debian Bugs: #313697,
-#401092)
-
-Programmer's Notes
-------------------
-
-Fix portability problem with the badblocks group; for systems that
-don't have nanosleep(), try using usleep() instead.
-
-The "make check" target in the e2fsck directory now sets
-LD_LIBRARY_PATH before running the various e2fsck internal library
-regression tests.
-
-The crc32 regression test in the e2fsck library is now portable to
-greater varienty of environments, including big-endian systems and
-when cross-building e2fsprogs for embedded systems.  (Addresses
-Sourceforge Bug: #2019287)
-
-The ext2fs_extent_set_bmap() had some bugs when setting the first
-block in a file, or when replacing a single block extent.  Those cases
-fortunately were came up relatively rarely when e2fsck was checking
-files, but caused some problems when resize2fs was shrinking
-extent-based files.
-
-Fix a potential core-dumping bug in libe2p's iterate_on_dir()
-function.
-
-Various ext2fs library functions --- ext2fs_block_iterate2(),
-ext2fs_initialize() and ext2fs_extent_open() --- now correctly free
-allocated memory to avoid memory leaks in all of their error return
-paths.
-
-Ext2ed was failing to build because masix support had been removed in
-the rest of e2fsprogs, so ext2ed no longer has masix support, either.
-
-The configure script now respects the LDFLAGS environment variable if
-it is set when configure is called.  (Addresses Sourceforge Feature
-Request: #1937287)
-
-Libuuid is now more portable to the Windows platform.  (Addresses
-Sourceforge Feature Request: #1937287)
-
-The configure script now uses AC_MSG_{RESULT,WARN,ERROR} instead of
-bare echo commands so that configure flags such as --quiet work
-correctly.  (Addresses Sourceforge Patches: #2058794)
-
-A few uses of sprintf have been removed from the ext2fs library to
-make life easier for bootloaders with a limited libc environment.
-(Addresses Sourceforge Bug: #2049120)
-
-The ext2fs_read_inode() checks the validity of the inode number passed
-to it earlier, to avoid doing some needless work when it would fail
-anyway.
-
-The ext2fs_open() checks the validity of the blocksize parameter
-passed to it earlier, to avoid doing some needless work when it would
-fail anyway.
-
-Disable a very annoying automatic "%.sh -> %" GNU make rule in the
-top-level Makefile.  That automatic rule is used to better support
-SCCS, but it caused problems for a particular niche distribution which
-likes to use configure.sh files to store the configure options used to
-build a package.  Unfortuntaely GNU make will use the configure.sh to
-replace the configure script, resulting in a self-inflicted fork bomb
-leading to an out-of-memory crash.
-
-To support old GNU C compilers don't use C99/C++ comments, but only
-K&R style comments, and don't try to use __builtin_expect if __GNUC__
-is less than 3.  (__builtin_expect is only supported for gcc versions
-2.96 and up, and it's tricky to check for gcc 2.95 vs gcc 2.96; since
-this is an optimization, we only try to use __builtin_expect for gcc 3
-and up.)
-
-In e2fsck's crc routines, make sure we use WORDS_BIGENDIAN instead of
-__LITTLE_ENDIAN, which are only defined by glibc's header files and
-hence isn't portable.
-
-For the convenience for some distributions that need a static tune2fs,
-the Makefile for misc/ now has a tune2fs.static target.
-
-The ext2fs_block_iterate2() function now supports BLOCK_FLAG_APPEND
-for extent-based files
-
-The ext2fs_bmap() function now supports BMAP_ALLOC for extent-based
-files.
-
-All source files no longer have any trailing white space.
-
-The io_channel_read_blk64() and io_channel_write_blk64() functions are
-now functions instead of C preprocessor macros to provide better
-forward compatibility.
-
-The e2fpsrogs translation template now expands the @x abbrevation.
-
-Various namespace leackages in libblkid, libe2p, and libext2fs have
-been fixed.
-
-Fix a parallel build problem in e2fsprogs.
-
-E2fsprogs is now more portable to Solaris.
-  * blkid no longer assumes that the TIOCGSIZE and TIOCGWINSZ ioctl's
-    are always present.
-  * Scripts do not assume that /bin/true is always in /bin
-  * Don't use __FUNCTION__ since Solaris's C99 doesn't support it.
-  * Flush stdio handles before calling setbuf(), since Solaris will
-    discard any pending output to the stream.
-  * Define _XOPEN_SOURCE to 600 since Solaris's header files are very
-    picky about which C compiler can beused for SUSv3 conformance.
-    Use of C99 is not compatible with SUSv2 (_XOPEN_SOURCE=500),
-    and C89 is not compatible with SUSv3 (_XOPEN_SOURCE=600).
-    Since we need some SUSv3 functions, consistently use SUSv3 so
-    that e2fsprogs will build on Solaris using c99.
-  * Solaris C99 does not support varargs C preprocessor macros
-  * Solaris header files pollute the C namespace if in/netinet.h
-    is included, which conflicts with e2fsprogs' use of the kmem_cache_t
-    typedef.
-  * Solaris ships with a pathetically ancient shell in /bin/sh so we
-    avoid the use of various more avanced shell constructs such as $().
-
-The "make rpm" command will now take some extra configure optiosn from
-the build environment without needing to patch the source tree.
-
-The ext2fs_add_dir_block() function will now grow the dblist more
-aggressively as an optimization to avoid copying the array too often.
-
-The e2fsck_write_bitmaps() will write the block and inode bitmaps
-together instead of in two passes.
-
-
-E2fsprogs 1.41 (July 10, 2008)
-==============================
-
-Add support for ext4 filesystem features, in particular extents,
-uninit_bg, flex_bg, huge_file, and dir_nlink features.  Also add
-support for checking journal checksums.  Debugfs will print new
-superblock and inode fields that were defined for ext4.  For example,
-the nanosecond and i_version fields of an inode, and the
-s_min_extra_isize and s_wanted_extra_isize fields from the superblock.
-Note: Resize2fs doesn't currently support the combination of flex_bg
-and !resize_inode.  (Addresses Debian Bug: #388452, #425477)
-
-Tune2fs can support migrating a filesystem from using 128 byte inodes
-to 256 byte inodes, so it can take advantage of the full features of
-ext4.
-
-Add support for "undo" support.  E2fsck and mke2fs can optionally
-record an undo log which can replayed by the program e2undo.
-
-E2fsck could damage a filesystem by trying to relocate inode tables
-due to corrupted block group descriptors, where the attempted inode
-table relocation would do far more harm than good.  E2fsck has been
-fixed to detect this these sorts of corrupted block group descriptors
-much earlier in e2fsck processing, so it can try to use the backup
-superblock and block group descriptors first.  This should be a much
-better strategy for recovering these types of corrupted filesystems.
-(Addresses Sourceforge Bug: #1840291)
-
-E2fsck will display a more understandable message when the last check
-field in the superblock is in the future.  (Addresses Debian Bug:
-#446005).
-
-E2fsck now performs more extensive and careful checks of extended
-attributes stored in the inode.
-
-Enhance mke2fs to print a more explanatory error message when
-ext2fs_get_device_size() returns EFBIG.  (Addresses Debian Bug:
-#488663)
-
-Fix mke2fs to use a default block size of 4k when formatting an
-external journal device.  This is done by using a fixed filesystem
-type list that consists only of the single filesystem type "journal"
-when looking up configuration keys in /etc/mke2fs.conf.  (Addresses
-Debian Bug: #488663)
-
-Speed up how mke2fs writes the journal data blocks by writing the disk
-blocks in larger chunks.
-
-Fix blkid handling of stale devices.  Fix a bug which could cause a
-core dump while garbage collecting the blkid cache, and assure that
-blkid_find_dev_with_tag() never returns a non-existent device.  Also,
-if a filesystem is found at a new /dev location, eliminate any
-duplicate stale entries which can not be verified.
-(Addresses Debian Bugs: #487758, #487783)
-    
-Add more paranoid checks for LVM volumes and swap partitions in
-blkid's probe function, to reduce the chances of false positives.
-
-The mke2fs program now has a much more sophisticated system for
-controlling configuration parameters of a newly created filesystem
-based on a split filesystem and usage type system.  The -t option to
-mke2fs was a deprecated alias to -c; it now specifies a filesystem
-type (ext2, ext3, ext4, etc.), while the -T option can now be a comma
-separated usage list.  The filesystem type information and type
-information is used to extract configuration parameters from the
-/etc/mke2fs.conf file.
-
-The mke2fs program will no longer complain and request the -f option
-when the user tries to create a filesystem with greater than 2**31
-blocks.
-
-When creating a filesystem for the GNU Hurd use a fs-type of Hurd and
-adjust the mke2fs.conf file so filesystems for the Hurd are created
-with a blocksize of 4096 and inode size of 128, which is all it knows
-how to handle.  (Addresses Debian Bug: #471977)
-    
-Mke2fs will always make sure that lost+found always has at least 2
-blocks, even for filesystems with very large blocksizes (i.e., 64kb).
-
-Resize2fs will now print the minimum needed filesystem size if given
-the -P option, and will resize the filesystem to the smallest possible
-size if given the -M option.
-
-Fix resize2fs to clean up the resize_inode if all of the reserved gdt
-blocks are consumed during an off-line resize.
-
-The "ls" command in debugfs now supports the -p option, which causes
-it to quote the filenames so that spaces or tabs in directory entries
-are easily visible.  (Addresses Red Hat Bugzilla: #149480; Addresses
-Sourceforge Feature Request: #1201667)
-
-Fix a potential off-by-one buffer oveflow in the fs_device_name in an
-e2image file.
-
-The chattr program will return a non-zero exit code in case of
-failures, and error messages can be suppressed with the -f option.
-(Addresses Red Hat Bugzilla: #180596)
-
-Fix a bug in badblocks which caused it to overrun an array and likely
-crash if more than 8 test patterns are specified using the -t option.
-(Addresses Debian Bug: #487298)
-    
-Add support to badblocks to limit how quickly it reads from the disk
-drive (so it can be used for background scrubbing), and so it will
-abort after finding a given number of errors.
-
-Remove support for the legacy big-endian filesystem format which only
-existed on extremely long-dead PowerPC kernels almost a decade ago.
-
-Remove MASIX support from e2fsprogs.
-
-Add I/O statistics reporting to e2fsck.
-
-Update Vietnamese, Polish, French, Spanish, German, Catalan, Dutch,
-Czech translations.
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bugs: #487443, #487675, #490003)
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages.
-(Addresses Debian Bugs: #393313, #487849, #440983, #440981)
-
-Programmer's Notes
-------------------
-
-Factor out bitmap code in preparation for adding 64-bit new-style
-bitmaps.
-
-Fix gcc -Wall warnings
-
-Fix the pkg-config files so that private librares are specified in
-"Libs.private:".
-
-Fix the libext2fs.texinfo manual so it builds with modern versions of
-texinfo.
-
-Silence the makefile from showing the awk command used to build the
-
-Clean up the badblocks group so to make it more portable and robust.
-
-Avoid using predictable filenames in /tmp in blkid's regression test
-suite.  Also remove bashism's in the regression test script.
-
-If the configure script is given --with-diet-libc, don't use thread
-local storage, since diet libc doesn't support TLS.  (Addresses
-Sourceforge Bug: #2000654)
-    
-Fix the blkid regression test suite to tolerate older versions of
-mkswap that don't support the -U option.
-
-A few library routines have been converted to support 64-bit block
-numbers; in particular, the I/O manager functions, the test_io,
-inode_io, and unix_io managers have all be converted to support 64-bit
-operation.
-
-Debugfs can now be extended for use by test programs.  See
-lib/ext2fs/extents.c for an example for how it can be used.  The test
-program links against the debugfs object files, and provides
-additional commands by defining an auxiliary libss command table.
-
-The lazy_bg filesystem feature, which was only used by developer's
-testing, has been removed since it has been largely supplanted by
-uninit_bg.  This also simplifies the code.
-
-
-E2fsprogs 1.40.11 (June 17, 2008)
-=================================
-
-Mke2fs, tune2fs, and resize2fs now use floating point to calculate the
-percentage of reserved blocks.  (Addresses Debian Bug: #452639)
-
-Updated Spanish and Catalan translations.
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bugs: #483962, #483023)
-
-Add detection for ZFS volumes to the libblkid library.
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages.
-(Addresses Debian Bug: #486463)
-
-Programmer's notes:
--------------------
-
-Fix marginal C code in probe_lvm2() function to the blkid library more
-portable for older compilers.
-
-Fix build problems on MacOS X.  (Addresses Sourceforge Bug: #1972473)
-
-Fix ext2fs_swap{16,32,64} functions so they can be used by external
-applications on big-endian machines.  (Addresses Debian Bug: #484879)
-    
-
-E2fsprogs 1.40.10 (May 21, 2008)
-================================
-
-When deciding whether or not to revalidate a blkid cache entry, if the
-device's mtime is newer than the last time the cached entry was
-validated, force a revalidation.
-
-Fix a potential data corruption bug in e2fsck in the journal replay.
-The chances of this is happening is extremely remote, especially the
-default data=ordered or data=writeback modes.  However, if a block
-which has been journalled starts with the first four bytes 0xc03b3998,
-when e2fsck replays the journal, those four bytes will be replaced
-with zero's.  Fortunately, it is highly, highly unlikely for e2fsck
-metadata to begin with those fatal 4 byte sequence, and unless
-data=ordered mode is in use, data blocks are never journaled.
-
-Updated German, Dutch, Sweedish, and Vietnamese translations.
-
-Programmer's notes:
--------------------
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.
-
-Remove default sizes of types when cross compiling, since autoconf
-2.50 can figure this out automatically now.
-
-
-E2fsprogs 1.40.9 (April 27, 2008)
-=================================
-
-SuSE's security team audited uuidd and came up with a few minor
-issues.  None of them are serious given that uuidd runs setuid as a
-unprivileged user which has no special access other than libuuid
-directory, but it's good to get them fixed.
-
-One additional fix in ext2fs_swap_inode_full() needed for resize2fs to
-work correctly with in-inode extended attributes.
-
-Updated German, Czech, Dutch, French, Polish, Sweedish, and Vietnamese
-translations.
-
-Debugfs will avoid using a pager if the standard output is not a tty.
-
-Fix debugfs and tune2fs to correctly handle daylight savings time when
-parsing a time string.
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages.
-
-Fix fsck completion bars when multiple filesystems were being checked
-in parallel.  (Addresses Debian Bug: #432865, Addresses Launchpad Bug:
-#203323, Addresses Sourceforge Bug: #1926023)
-
-Fix fsck so that progress information is sent back correctly when
-multiple filesystems are being check and the output of fsck is being
-redirected to a file descriptor.  Also, include the device name (w/o
-spaces) in the progress information sent back via a file descriptor.
-(Addresses Launchpad Bug: #203323, Addresses Sourceforge Bug:
-#1926023)
-
-Teach fsck to treat "ext4" and "ext4dev" as ext* filesystems.
-
-If logsave receives a SIGTERM or SIGINT signal, it will now pass that
-signal to its child process.
-
-Fix mke2fs's creation of are resize inode when there is a non-standard
-s_first_data_block setting.
-
-Fix bug in blkid when run by an unprivileged user; most devices were
-not reported correctly.  9Addresses Launchpad Bug: #220275)
-
-Mke2fs will not allow the logically incorect combination of
-resize_inode and meta_bg, which had previously caused mke2fs to create
-a corrupt fileystem.
-
-Fix fsck in German locales so that a 'j' means yes.
-(Addresses Sourceforge Bug: #1947683)
-
-
-Programmer's notes:
--------------------
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.
-
-Update valgrind options in test_script to work with valgrind 3.2.3
-
-Update texinfo.tex to a much newer version from the FSF.
-
-Remove bashism for configure script and from the lib/ss Makefile.
-Addresses Sourceforge Bug: 1921969
-
-Fix some silently broken tests: m_no_opt, m_meta_bg, and m_raid_opt.
-
-Fix build system so that if texinfo is not installed, it won't print a
-(harmless) error message.
-
-
-E2fsprogs 1.40.8 (March 13, 2008)
-=================================
-
-Fixed e2image -I so it works on image files which are larger than 2GB.
-
-Fixed e2fsck's handling of directory inodes with a corrupt size field.  If
-the size is larger than the number of blocks found in the inode, don't
-try to allocate extra empty blocks at the end of the directory to make
-up the difference; there's no point to doing that.  In addition, if
-the size is not a multiple of a blocksize, always fix it.
-
-E2fsck handled a pass 2 "should never happen error" by not giving
-enough information and then core dumping.  Unfortunately, it was all
-too easy to trigger the "should never happen" situation if a
-directory's inode size was not correct.  This has been fixed, but
-e2fsck has also been taught how to handle this situation more
-gracefully, by simply removing the inode hash tree information, so
-that it can be rebuilt again after e2fsck's pass 3.  (Addresses
-Launchpad Bug: #129395)
-
-Resize2fs had a bug resizing large inodes with extended attributes
-that was fixed in 1.40.6; unfortunately, it turned out it wasn't fixed
-completely on big-endian systems such as PowerPC.  The bug should be
-completely fixed now.  Yay for regression test suites.  (Addresses Red
-Hat Bugzilla: #434893)
-    
-Updated German, Czech, Dutch, Polish, Sweedish, and Vietnamese
-translations.  Many thanks to Philipp Thomas from Novell for stepping
-up to become the new German translation maintainer!  (Addresses Debian
-Bugs: #302512, #370247, #401092, #412882).
-
-When e2fsck is clearing a corrupt inode's HTREE directory information,
-make it clear that it is just clearing the HTREE information, not the
-entire inode.
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages.  
-
-Programmer's notes
-------------------
-
-Add new functions, ext2fs_dblist_get_last() and
-ext2fs_dblist_drop_last(), which allows the caller to examine the last
-directory block entry added to the list, and to drop if it necessary.
-
-Fixed a portability problem in libblkid with DJGPP.
-
-Fix an obvious typo in an "internal error" message in e2fsck.  Thanks
-to Philipp Thomas for pointing this out.
-
-If the info files are not built, change "make install" so it doesn't
-fail with an error code.
-
-
-E2fsprogs 1.40.7 (February 28, 2008)
-====================================
-
-Remove support for clearing the SPARSE_SUPER feature from tune2fs, and
-depreciate the -s option, since it can result in filesystems which
-e2fsck can't fix easily.  There are very good reasons for wanting to
-disable sparse_super; users who wants to turn off sparse_super can use
-debugfs.  (Addresses Sourceforge Bug: #1840286)
-    
-Add missing options to mke2fs's usage message.  (Addresses Sourceforge
-Bug: #1751393)
-    
-Fix bug in resize2fs when large (greater than 128 byte) inodes are
-moved when a filesystem is shrunk; it was only moving the first 128
-bytes, so extended attributes were not getting moved.  (Addresses Red
-Hat Bugzilla: #434893)
-
-E2fsck now prints an explicit message when the bad block inode is
-updated, to avoid confusion about why the filesystem was modified.
-(Addresses Sourceforge Bug: #756460)
-    
-Allow mke2fs and tune2fs manipulate the large_file feature.
-Previously we just let the kernel and e2fsck do this automatically,
-but e2fsck will no longer automatically clear the large_file feature.
-It still isn't really necessary to worry about this feature flag
-explicitly, but some users seem to care.  (Addresses Red Hat Bugzilla:
-#258381)
-    
-Suppress message about an old-style fstab if the fstab file is empty.
-(Addresses Debian Bug: #468176)
-    
-Fix (really minor) bug in debugfs's find_free_block so it avoids
-reporting a free block more than once if there are too few free blocks
-in the filesystem.  (Addresses Sourceforge Bug: #1096315)
-    
-Change e2fsck to no longer clear the LARGE_FILES feature flag
-automatically, when there are no more > 2GB files in the filesystem.
-It's been almost a decade since there have been kernels that don't
-support this flag, and e2fsck clears it quietly without telling the
-user why the filesystem has been changed.
-    
-Fix bug which could cause libblkid to seg fault if a device mapper
-volume disappears while it is being probed.  (Addresses RedHat
-Bugzilla: #433857)
-    
-Inhance e2fsck's reporting of unsupported filesystem feature flags.
-(Addresses Sourceforge Feature Request: #1175808)
-    
-Fix option syntax in dumpe2fs for explicit superblock and blocksize
-parameters.  What was currently documented in the man page has been
-broken for some time, due to getopt() implementation changes.  The
-option sytax has been changed to one which is can be more portable
-supported and which is consistent with the format for extended options
-in mke2fs and tune2fs.  (Addresses Sourceforge Bug: #1830994)
-    
-Add support to tune2fs to clear the resize_inode feature.  This
-requires an fsck afterwards.  (Addresses Red Hat Bugzilla: #167816)
-
-Teach blkid to detect LVM2 physical volumes.  (Addresses Red Hat
-Bugzilla: #409321)
-
-Add support for setting RAID stride and stripe-width via mke2fs and
-tune2fs.  Teach dumpe2fs to print the RAID parameters.
-
-Add support for setting new superblock fields to debugfs's
-set_super_value.
-
-Add support for printing "mostly-printable" extended attributes in
-Debugfs.
-
-Add support for the -M option to fsck, which causes it to ignore
-mounted filesystem.
-
-Fix uuidd so that it creates the pid file with the correct pid number.
-(Addresses Sourceforge Bug: #1893244)
-
-Fix various gcc -Wall warnings.
-
-Update Czech, Dutch, Polish, Sweedish, and Vietnamese translations
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages.  
-(Addresses Sourceforge Patch: #1399325)
-
-
-Programmer's notes:
--------------------
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bug: #466929)
-
-Add new flag EXT2_FLAG_NONFREE_ON_ERROR ext2fs_open2() which returns a
-partially filled-in filesystem object on an error, so that e2fsck can
-print more intelligent error messages.
-    
-Add a new function e2p_edit_feature2() which allows the caller to
-specify which feature flags are OK to set or clear, and which returns
-more specific information about feature flags which are not allowed to
-be set/cleared.
-    
-Set the C locale in the test_script driver since it uses [A-Za-z].
-(Addresses Sourceforge Bug: #1890526)
-
-Use fcntl locking instead of lockf in libuuid since Cygwin doesn't
-support lockf().
-
-Change configure.in to avoid using the 'dc' command unless it is
-absolutely needed. (i.e., when using parsing a WIP-style version
-number)  (Addresses Sourceforge Bug: #1893024)
-
-Add portability checks to support compilation under DJGPP.
-
-Update to the latest samba tdb code before the LGPLv3 change, which
-fixes a realloc() leak on failure.
-
-Fix memory leak in ext2fs_alloc_block().
-
-Fix makefile dependency issues for various install targets.
-(Addresses-Sourceforge-Patches: #1903484, #1903466, #1903456)
-    
-Improve descriptions for the r_move_itable and r_resize_inode tests.
-
-
-E2fsprogs 1.40.6 (February 9, 2008)
-===================================
-
-Add support for returning labels for UDF filesystems in the blkid
-library.
-
-Fix bug in the blkid library where cached filesystems was not being
-flushed when opening USB devices returned the error ENOMEDIUM.
-(Addresses Debian Bug: #463787)
-
-Added logic to the blkid library to automatically choose whether a
-filesystem should be mounted as ext4 or ext4dev, as appropriate.
-
-Allow tune2fs to set and clear the test_fs flag on ext4 filesystems.
-
-Fix a bug in e2fsck which caused it to core dump if e2fsprogs had been
-configured with --enable-jbd-debug.
-
-Document the BLKID_FILE environment variable in the libblkid man page
-
-Programmer's Notes:
--------------------
-
-Update e2fsprogs translation template and Vietnamese and Czech translations
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bugs: #436058)
-
-Don't try to create $DESTDIR/etc/init.d as part of make install as we
-don't install the init.d script (and it's not the recommended way to
-start uuidd anyway).  (Addresses Sourceforge Bug: #1885085)
-
-Use thread local storage to fix a theoretical race condition if two
-threads try to format an unknown error code at the same time in the
-com_err library.
-
-
-E2fsprogs 1.40.5 (January 27, 2008)
-===================================
-
-Fix a potential overflow big in e2image if the device name is too
-long.
-
-Mke2fs will now create new filesystems with 256 byte inodes and the
-ext_attr feature flag by default.  This allows for much better future
-compatibity with ext4 and speeds up extended attributes even on ext3
-filesystems.
-
-Teach e2fsck to ignore certain "safe" filesystem features which are
-set automatically by the kernel.  Having the kernel set features
-automagically behind the user's back is a bad idea, and we should try
-to break the kernel of this habit, especially for the newer ext4
-feature flags.  But for now, we will try to avoid needless full checks
-which can annoy users who are doing fresh installs.
-
-Add support in tune2fs and mke2fs for making a filesystem as being "ok
-to be used with test kernel code".  This will be needed for using test
-filesystems with the latest ext4 kernel code.
-
-Change e2fsck -fD so that it sorts non-htree directories by inode
-numbers instead of by name, since that optimizes performances much
-more significantly.  (Addresses-Sourceforge-Feature-Request: #532439)
-
-If e2image fills the disk, fix it so it exits right away instead of
-spewing large numbers of error messages.
-(Addresses-Sourceforge-Feature-Request: #606508)
-
-If ftruncate64() is not available for resize2fs, let it use ftrucate()
-instead, but have it check to see if the size would get truncated, and
-skip calling ftruncate in that case.
-
-Add support for detecting HFS+ filesystems in the blkid library.
-
-Add supprt in the blkid library for ext4/ext4dev filesystems.
-
-Fix a bug in blkid where it could die on a floating point exception
-when presented with a corrupt reiserfs image.
-
-Fix blkid's handling of ntfs UUID's so that leading zeros are printed
-such that UUID string is a fixed length.
-
-Add sample python bindings for the uuid library to the contrib
-directory.  (Addresses-Sourceforge-Patches: #778817)
-
-Fix debugfs's 'lsdel' command so it uses ext2fs_block_iterate2 so it
-will work with large files.  (Addresses Sourceforge Feature Request:
-#1257500 and Sourceforge Support Request: #1253511)
-    
-Allow the debugfs 'undel' command to undelete an inode without linking
-it to a specific destination directory, since this might require
-allocating blocks that could overwrite some yet-to-be-recovered
-deleted files.  (Addresses-Sourceforge-Feature-Request: #967141)
-
-Update Swedish translations from the Translation Project.
-
-Programmer's Notes:
--------------------
-
-Fix configure handling of --sbindir (which should rarely be used, but
-someone did complain, so let's fix it).  (Addresses Sourceforge Bug:
-#498381)
-
-Updated e2fsprogs.spec file to include a new uuidd package
-
-Use pkg-config to determine where to find the devmapper library so we
-can find out where it is located on different distributions.
-
-Fix Makefile race so that "make -j3 distclean" works correctly
-
-Fix portability problems on non-Linux/non-Hurd/non-Masix systems,
-especially on MacOS X systems.  (Addresses Sourceforge Bugs: #1861633,
-#1819034, #1863819)
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages.
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bugs: #459403, #459475, #459614)
-
-Remove the --enable-dynamic-static configure option, and build e2fsck
-dynamically by default.  If the user wants e2fsck.static, he/she will
-need to build it via "make -C e2fsck e2fsck.static"
-
-Fix various build warnings due to missing prototypes.
-(Addresses Sourceforge Patch: #1861663, #1861659)
-
-
-E2fsprogs 1.40.4 (December 31, 2007)
-====================================
-
-Improve time-based UUID generation.  A new daemon uuidd, is started
-automatically by libuuid if necessary.  This daemon is setuid to allow
-updates to /var/lib/libuuid, so the clock sequence number can be
-stored and so if the clock is set backwards, it can be detected.
-(Addresses Sourceforge Bug: #1529672, Addresses Red Hat Bugzilla:
-#233471)
-
-Filter out the NEEDS_RECOVERY feature flag when writing out the backup
-superblocks.  This avoids e2fsck from concluding that a full
-filesystem check is required before backing up the superblock due to
-changes in the feature flags.  (Addresses Debian Bug: #454926)
-
-Fix fsck to only treat the '#' character as a comment at the beginning
-of the line in /etc/fstab.  Otherwise fstabs for the fuse filesystem
-will cause fsck to issue an bogus warning message.
-(Addresses Gentoo bug: #195405, Addresses Sourceforge bug: #1826147)
-
-Format control characters and characters with the high eighth bit set
-when printing the contents of the blkid cache, to prevent filesystems
-with garbage labels from sending escape sequences to the user's screen
-that might, for example place it in graphics mode.  (Addresses Ubuntu
-Bug: #78087)
-
-Fix sign-extension problem on 64-bit systems in in the com_err
-library.  (Addresses Sourceforge Bug: #1809658)
-
-Avoid division by zero error when probing an invalid FAT filesystem in
-the blkid library.  (Addresses Sourceforge Bug: #1831627)
-
-Update Dutch, Polish, and Vietnamese translations from the Translation
-Project.  Remove the Rwandan translation upon advice of the
-Translation Project.
-
-Programmer's Notes:
--------------------
-
-Fix the libss "make check" regression test so that it works if the
-current directory is not in the user's path or if the libss shared
-library is not installed.  (Addresses Sourceforge Bug: #1848974)
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages.
-(Addresses Debian Bugs: #444883, #441872)
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bugs: #437720, #451172, #458017)
-
-Fix build failure on non-Linux/non-Hurd/non-Masix systems.
-(Addresses Sourceforge Bug: #1859778)
-
-Fix Hurd portability issues.  (Addresses Debian Bug: #437720)
-
-
-E2fsprogs 1.40.3 (December 5, 2007)
-===================================
-
-Fix a potential security vulnerability where an untrusted filesystem
-can be corrupted in such a way that a program using libext2fs will
-allocate a buffer which is far too small.  This can lead to either a
-crash or potentially a heap-based buffer overflow crash.  No known
-exploits exist, but main concern is where an untrusted user who
-possesses privileged access in a guest Xen environment could corrupt a
-filesystem which is then accessed by the pygrub program, running as
-root in the dom0 host environment, thus allowing the untrusted user to
-gain privileged access in the host OS.  Thanks to the McAfee AVERT
-Research group for reporting this issue.  (Addresses CVE-2007-5497.)
-
-Fix hueristics in blkid which could cause a disk without partitions to
-be incorrectly skipped when a loopback device is present.  (Addresses
-Red Hat Bugzilla #400321.)
-
-Fix e2image so that in raw mode it does not create an image file which
-is one byte too large.
-
-Change mke2fs's usage message so it recommends the preferred -E option
-instead of the deprecated -R option.
-
-Enhance the blkid library so it will recognize squashfs filesystems.
-(Addresses Red Hat Bugzilla #305151.)
-
-Enhance e2fsck so it will force the backup superblocks to be backed up
-if the filesystem is consistent and key constants have been changed
-(i.e., by an on-line resize) or by e2fsck in the course of its
-operations.
-
-Enhance blkid's detection of FAT filesystems; so that USB disks with
-only a single bootable partition will not get missed.
-
-E2fsck will no longer mark a filesystem as invalid if it has time
-errors (i.e., if superblock mount time or last write time is in the
-future) and the user refuses to fix the problem.
-
-The Ubuntu init scripts don't properly set the system time correctly
-from hardware clock if the hardware clock is configured to tick local
-time instead of GMT time.  Work around this as best as we can by
-providing an option, buggy_init_scripts, in /etc/e2fsck.conf which can
-be set on Ubuntu systems.  (Addresses Debian Bug #441093, and Ubuntu
-Bug #131201.)
-
-Fix fsck to ignore /etc/fstab entries for bind mounts.  (Addresses Red
-Hat Bugzilla #151533.)
-
-Fix e2fsck so that if the superblock is corrupt, but still looks
-vaguely like an ext2/3/4 superblock, that it automatically tries to
-fall back to the backup superblock, instead of failing with a hard
-error.
-
-Make the e2fsprogs program more robust so that they will not crash
-when opening a corrupt filesystem where s_inode_size is zero.
-
-Change e2fsck so it uses sscanf() instead of atoi() so it non-numeric
-arguments are detected as such and the parse error is reported to the
-user.   (Addresses Debian Bug #435381.)
-
-Change e2fsck so it will not complain if a file has blocks reallocated
-up to the next multiple of a system's page size.
-
-Fix bug in ext2fs_check_desc() which will cause e2fsck to complain
-about (valid) filesystems where the inode table extends to the last
-block of the block group.  (Addresses Red Hat Bugzilla #214765.)
-
-Fix a bug in ext2fs_initialize() which causes mke2fs to fail while
-allocating inode tables for some relatively rare odd disk sizes.
-(Addresses Red Hat Bugzilla #241767.)
-
-Add Catalan translation and update Dutch and Swedish translations
-from the Translation Project.
-
-Fix big-endian byte-swapping bug in ext2fs_swap_inode_full().  We
-still had an issue when trying to figure out whether we need to
-byte-swap fast symlinks that contained extended attributes.
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages.
-(Addresses SourceForge Bug #1821333.)
-
-
-Programmer's Notes:
--------------------
-
-Fix mke2fs tests to avoid needing any significant ^M (CR) characters
-
-Add "make check" to the RPM spec file
-
-Fix "make install" and 'make unstall" in misc/Makefile.in so that it
-works correctly when the prefix is not the root directory.
-
-Fix the resize2fs tests, r_move_itable and r_resize_inode, so they
-clena up after themselves by deleting the test.img temporary file
-after completing the test.
-
-Fixed a corner case bug ext2fs_unlink() when trying to delete the
-first directory entry in a directory block and the last directory
-entry in the previous directory block is not in use.  Fortunately
-ext2fs_unlink() is only used by debugfs and e2fsck, and in e2fsck in
-places where it is extremely unlikely to run into this corner case.
-
-Fix missing dependency which would cuase parallel builds to fail.
-(Addresses Sourceforge Bug #1842331.)
-
-Fix a build error on newer gcc caused by lib/ext2fs/ismounted.c
-calling open(O_CREATE) with a missing mode parameter.
-
-Fix the test_ss.c in lib/ss so it can be used as an example
-application program for the library as well as a regression test
-suite.
-
-Fix ext2fs_dblist_dir_iterate() so that error codes and abort codes
-are properly passed back up through the call stack.
-
-E2fsprogs 1.40.2 (July 12, 2007)
-================================
-
-A recent change to e2fsck_add_dir_info() to use tdb files to check
-filesystems with a very large number of filesystems had a typo which
-caused us to resize the wrong data structure.  This would cause a
-array overrun leading to malloc pointer corruptions and segfaults.
-Since we normally can very accurately predict how big the the dirinfo
-array needs to be, this bug only got triggered on very badly corrupted
-filesystems.
-
-Fix a bug in e2fsck which caused it to incorrectly salvange
-directories when the last entry's rec_len is bogusly too big.  This
-resulted in a nonsense filesystem corruption to be reported, and
-required a second run of e2fsck to fully fix up the directory.
-
-Update tune2fs man page to include more discussion of reserved blocks
-(Addresses Launchpad bug #47817)
-
-Update Turkish, Polish, Dutch, and Vietnamese PO files from the
-Translation Project
-    
-
-E2fsprogs 1.40.1 (July 7, 2007)
-===============================
-
-Fix bug which could cause libblkid to loop forever.  When revalidating
-a partition where there is obsolete information in /etc/blkid.tab, we
-end up freeing a the type tag without clearing dev->bid_type, causing
-blkid_verify() to loop forever.  (Addresses Debian Bug: #432052)
-    
-The Turkish translation has a bug in it where it has the translation
-of "E@e '%Dn' in %p (%i)" to "E@E".  This causes @E to be expanded at
-@E, recursively, forever, until the stack fills up and e2fsck core
-dumps.  We fix this by making e2fsck stop @-expansions after a
-recursive depth of 10, which is far more than we need.
-(Addresses Sourceforge Bug: #1646081)
-    
-Compile the default mke2fs.conf into mke2fs program.  People are
-getting surprised by mke2fs creating filesystems with different
-defaults than earlier versions of mke2fs if mke2fs.conf is not
-present.  So we now create a built in version of mke2fs.conf file
-which is used by mke2fs if the /etc/mke2fs.conf is not present.
-(Addresses SourceforgeBug: #1745818)
-
-Improve the config/parse_types.sh helper script.  Fix a potential
-security problem if e2fsprogs is built as root (as Gentoo does!).  In
-addition fix the script and how it is called from the configure script
-so that it does the right thing when cross-compiling.  (Fixes Gentoo
-bug: #146903)
-    
-Update Vietnamese, French, and Dutch PO files from the Translation
-Project.  Also created a new e2fsprogs.pot file for translator.
-    
-Fix bogus strip permission errors when building under Debian.  When
-building the e2fsprogs dpkg's, the dh_strip command emits a large
-number of error messages caused by the permissions not being right.
-So run dh_fixperms before running dh_strip.
-
-Programmer's Notes:
--------------------
-
-Add new function: profile_set_default().  This function sets the value
-of the pseudo file "<default>".  If the file "<default>" had
-previously been passed to profile_init(), then def_string parameter
-will be parsed and used as the profile information for the "<default>"
-file.
-    
-Fix mk_cmds's error reporting so that it is unambiguous that it is the
-mk_cmds script which is generating the error.  (Obviates Gentoo patch:
-e2fsprogs-1.32-mk_cmds-cosmetic.patch)
-    
-Fix the test suite to use LC_ALL instead of LANG.  LC_ALL is the "high
-priority" environment variable that overrides all others, where as
-LANG is the lowest priorty environment variable.  If LC_ALL is set, it
-doesn't matter whether LANG, LANGUAGE, LC_COLLATE, LC_MESSAGES, and
-the all the rest are set.  This will assure that the locale when
-running the test suites is the "C" locale.  (Obviates Gentoo patch:
-e2fsprogs-1.38-tests-locale.patch)
-    
-
-E2fsprogs 1.40 (June 29, 2007)
-==============================
-
-Fix divide by zero error in blkid's NTFS probing logic.
-
-Add new blkid -g option which causes the blkid cache to be garbage
-collected.
-
-Fix a bug in libblkid which could cause the internal field bid_type to
-become corrupted.  Fortunately bid_type isn't used much, and bid_label
-and bid_uuid is only used by debugging code, so the impact of this bug
-was very minor.
-
-Mke2fs will now store the RAID stride value when a filesystem is
-created with a requested RAID stride, and then use it automatically in
-resize2fs.
-
-Mke2fs has a sanity check added to make sure (inode_size * num_inodes)
-isn't too big.  In some cases Lustre users have tried specifying an
-inode size of 4096 bytes, while keeping an inode ratio of one inode
-per 4096 bytes.  
-
-Improve sanity check in e2fsck's algorithm for finding a backup
-superblock, so that it won't accidentally find a superblock that was
-located in the journal, and then later reject it as being not a valid
-backup superblock.
-
-Fix e2fsck get_size logic so that it will work with the Linux floppy
-driver.  The Linux floppy driver is a bit different from the other
-block device drivers, in that if the device has been opened with
-O_EXCL, it disallows another open(), even if the second open() does
-not have the O_EXCL flag.  (Addresses Debian Bug: #410569)
-
-Fix error checking of badblock's last-block and start-block arguments.
-(Addresses Debian Bug: #416477)
-
-Fix e2fsck so that it doesn't overwrite the backup superblocks when
-recovering a journal until the master superblock has been confirmed as
-being sane.
-
-Change the blkid library to be much more paranoid about concluding
-that a partition contains an NTFS filesystem, and fetch the UUID and
-LABEL information from NTFS filesystems.  (Addresses Launchpad Bug:
-#110138)
-
-Factor out the code which sets the default journal size and move it
-into libext2fs.
-
-Enhance e2fsck so it will recreate the ext3 journal if the original
-journal inode was cleared to due it being corrupt after finishing the
-filesystem check.
-
-Fix e2fsck so that it updates the journal inode if it is corrupted and
-the backup journal information from the superblock was successfully
-used to recover the filesystem.
-
-Fix e2fsck so that it checks all of the blocks in the journal inode
-for validity.  The original code only checked the direct blocks to
-make sure the journal inode was sane.  Unfortunately, if some or all
-of the indirect or doubly indirect blocks were corrupted, this would
-not be caught.
-
-Add support in blkid to detect LUKS encrypted partitions.
-
-Add extra sanity checks for extended attributes in the case where the
-size is zero but the offset is very large.
-
-Fix byte-swapping issues for large inodes in ext2fs_read_inode_full()
-and ext2fs_get_next_inode_full().
-
-Clarify the copyright licenses used by the various libraries in
-the top-level COPYING  file (Red Hat Bugzilla: 166058)
-
-Make mke2fs's defaults when /etc/mke2fs.conf doesn't exist more sane.
-
-Fix mke2fs and debugfs to support large (> 16 bit) uid's and gid's.
-
-Remove check in e2fsck which requires EA's in inodes to be sorted;
-they don't need to be sorted, and e2fsck was previously wrongly
-clearing unsorted EA's stored in the inode structure.
-
-Allow mke2fs or tune2fs to create a substantially larger journal (up
-to 10,240,000 blocks).
-
-Fix MD superblock detection, and make sure the correct UUID is
-reported from the MD superblock.
-
-Fix a signed vs. unsigned bug in debugfs.
-
-Enhance debugfs's date parser so that it accepts integer values.
-
-Fix e2fsck's pass1c accounting so it doesn't terminate too early if a
-file with multiply claimed blocks is hard linked. or not at all if the
-root directory contains shared blocks
-
-Enhance debugfs so it can modify the block group descriptors using the
-command set_block_group_descriptor.
-
-Improve e2fsck's reporting of I/O errors so it's clearer what it was
-trying to do when an error happens
-
-Fix a bug in in how e2fsprogs byte swaps inodes containing fast
-symlinks that have extended attributes.  (Addresses Red Hat Bugzilla:
-#232663 and LTC Bugzilla: #27634)
-
-Fix potential file descriptor leak in ext2fs_get_device_size() in an
-error case.
-
-Add libreadline.so.5 support to libss.
-
-Impove badblocks -n/-w exclusive usage message.
-
-Fix dump_unused segfault in debugfs when a filesystem is not open
-
-Fix memory leak in blkid library.  (Addresses Debian Bug: #413661)
-
-Allow the debugfs lcd command to work w/o a filesystem being open.
-(Addresses LTC Bugzilla #27513)
-
-Fix e2fsck to clear i_size for special devices with a bogus i_blocks
-field on the first pass.
-
-Fix e2fsck to set the file type of the '..' entry when connecting
-a directory to lost+found.  (Addresses Lustre Bug: #11645)
-
-Enhance e2fsck to recover directories whose modes field were corrupted
-to look like special files.  This is probably only useful in
-artificial test cases, but it will be useful if we ever do the "inodes
-in directory" idea for ext4.
-
-Allow debugfs to dump (and rdump) > 2GB files.  (Addresses Debian Bug:
-#412614)
-
-Fix resize2fs parsing of size parameter (in sector units).  This was
-actually a bug in libe2p's parse_num_blocks() function.  When handling
-the 's' suffix, it was ignoring the blocksize information passed in
-from the caller and always interpreting the number in terms of a 1k
-blocksize.  (Addresses Debian Bug: #408298)
-
-There was a floating point precision error which could cause e2fsck to
-loop forever on really big filesystems with a large inode count.
-(Addresses Debian Bug: #411838)
-
-Fix memory leak in ext2fs_write_new_inode()
-
-Add support for using a scratch files directory to reduce e2fsck's
-memory utilization on really big filesystems.  This uses the TDB
-library.  See the [scratch_files] section of the e2fsck.conf man page
-for more details.
-
-Fixed type-punning bug which caused dumpe2fs to crash on the Arm
-platform (Addresses Debian Bug: #397044)
-
-Add explanatory message to badblocks that -n and -w are mutually exclusive
-(Addresses Debian Bug: #371869)
-
-Allow debugfs and dumpe2fs to support fs features under development.
-
-Add support for the new flag EXT2_FLAG_SOFTSUPP_FEATURES flag to
-ext2fs_open() , which allows application to open filesystes with features
-which are currently only partially supported by e2fsprogs.
-
-Allow unix_io to support offsets greater than 2G (Addresses
-SourceForge Bug: #1547922)
-
-Fixed overflow and signed/unsigned problems caused by the number of
-blocks or inodes exceeding 2**31 or being close to 2**32-1.
-
-Add support for unsigned directory hash calculations with hints in the
-superblock to fix cross-architectural portability for htree
-directories with filenames where the high 8th bit is set.  (Addresses
-Debian: #389772)
-
-Fix resize2fs so that it gives user-intelligible error messages if the
-filesystem or the kernel does not support on-line resizing.
-(Addresses Debian Bug: #380548)
-
-Require mke2fs -F -F for really dangerous operations, since -F is
-needed for less dangerous operations such as creating filesystems
-images in regular files, or creating filesystems on whole block
-devices.  These relatively innocuous usages should NOT be confused
-with running mke2fs on an apparently-mounted or in-use filesystem.
-
-Allow the default inode size to be specified into the mke2fs.conf
-file.
-
-Make the smallest default journal size is big enough so that on-line
-resizing should always work.
-
-Fix silly spelling error in e2fsck.  (Addresses SourceForge bug:
-#1531372)
-
-Fix debugfs coredump when lsdel is run without an open filesystem
-(Addresses Debian Bug: #378335)
-
-Fix debugfs display bug us that bytes that have the high bit set are
-displayed as "ec" instead of "ffffffec".
-
-Add support in lsattr so it will display the EXT4_EXTENTS_FL flag.
-
-Device mapper scanning wasn't working in the blkid library because the
-pathnames had an extra "/dev" when they were being probed.
-
-Add GFS/GFS2 support to the blkid library.
-
-Fix blkid support of empty FAT filesystem labels.
-
-Avoid recursing forever (or for a long time) when the blkid library
-searches for a device and there are symlinks to directories in /dev.
-
-Avoid unaligned halfword access in blkid when accessing FAT
-superblocks, as this will cause Sparc/Solaris systems to throw a
-SIGBUS error.
-
-The latest devmapper libraries requires pthreads, add -lpthreads to
-the static link libraries for e2fsck.static if devmapper is enabled.
-(Addresses Debian bug: #388718)
-
-Improve the (non-installed, for experts only) findsuper program by
-printing the uuid and label from the superblocks, as well as the
-starting and ending offsets of the filesystem given the information in
-the superblock.  Omit by default printing superblocks that are likely
-found in located in an ext3 journal unless an explicit -j option is
-given.
-
-Updated Spanish, French and Dutch translations and added Catalan
-translation.  (Addresses Debian bug: #411562)
-
-Use FreeBSD's DIOCGMEDIASIZE and DIOCGDINFO ioctls if available when
-determining a partition's size, since binary searching to determine
-the device doesn't work on FreeBSD.
-
-Documentation about UUID's is available in enough places, and it's
-awkward to deal with debian-legal's insanities.  So I'm caving in the
-"more-lunatic-than-RMS" wing of Debian by removing RFC-4122 so we
-don't have do the dfsg tarball.  Also remove the rule that only tried
-to install RFC-4122 on Ubuntu, since Ubuntu seems to want to fetch
-e2fsprogs exclusively from Debian.  (Addresses Debian Bug: #407107)
-
-Fix the info-dir line so that the menu name does not contain a .info
-prefix.  First of all, it's ugly, secondly, it causes the install-info
-command to fail to remove the com_err info file from the
-/usr/share/info/dir file when the comerr-dev package is removed and
-purged.  (Addresses Debian Bug: #401711)
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages.
-(Addresses Debian Bug: #369761, #373004, #379695)
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bugs #389554, #390664, #413208, #419605,
-#408352, #415560, #399155)
-
-
-Programmer's notes:
--------------------
-
-E2fsck now supports the %It expansion when printing a problem report.
-It will print the type of the inode in the problem context.
-
-Fix misc/Makefile.in so that it builds even if e2fsck hasn't been built yet
-(Addresses Sourceforge Bug: #1565561)
-
-Remove unused variables and other lint/gcc -Wall cleanups
-
-Add check to ext2fs_get_device_size() so it will return EFBIG for for
-filesystems contained in regular files where the filesystem image size
-is returned by stat64().
-
-Set local environment variables to C so mk_cmds and compile_et always
-work.  (Addresses SourceForge Bug: #1532177)
-
-Added the 64-bit byte swapping function ext2fs_swab64().
-
-Added two new helper functions to prevent 2**31/2**32-1 overflow
-problems: ext2fs_div_ceil() and e2p_percent().
-
-Create new ext2fs library inline functions ext2fs_group_first_block()
-and ext2fs_group_last_block() in order to calculate the starting and
-ending blocks in a block group.
-
-Create the generated files read-only to remind developers not to edit them.
-
-Add support for autoconf 2.60 (with backwards compatibility for older
-versions of autoconf).
-
-Added an "make rpm" target to top-level Makefile
-
-Added various FreeBSD portability fixes.
-
-Exclude mercurial files from the RPM build tree to speed up copy/build.
-
-Use root_sysconfdir to define the locations of mke2fs.conf and
-e2fsck.conf instead of using a hard-coded /etc pathname.
-
-Prevent e2fsck.h and ext2_ext_attr.h from getting included multiple times.
-
-Fixed "make clean" in blkid's Makefile.in file from removing tst_*.c files.
-
-If diff -u is supported, use it to report test failures.
-
-Updates/improvements to RPM spec file
-
-Add on-disk format definitions for the following new features:
-EXT4_FEATURE_RO_COMPAT_HUGE_FILE, EXT4_FEATURE_RO_COMPAT_GDT_CSUM,
-EXT4_FEATURE_RO_COMPAT_DIR_NLINK, EXT4_FEATURE_INCOMPAT_64BIT,
-EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE
-
-Add a new make target "checked-failed" in the tests directory which
-reruns any failed tests
-
-Update draft-leach-uuids-guids-01.txt with rfc4122.txt
-
-Fix miscellaneous bugs reported by Coverity: Dead code, potential nul
-pointer dereferences, memory leaks, etc.  None were security-criticial
-problems.
-
-Fix up usage and decrement error messages in the test_icount program
-
-Add debugging code to the com_err library; if the environment variable
-COMERR_DEBUG is set to 1, print out debugging messages as error tables
-are added and removed from the com_err library.  If the
-COMERR_DEBUG_FILE environment variable is set (and the process is not
-setuid) the debugging messages may be redirected to a file.
-
-Change all of the e2fsprogs programs to use the newer add_error_table()
-and remove_error_table() interfaces instead of the much older
-initialize_*_error_table() function.
-
-Add TDB support into the ext2fs library.  This allows us to have a
-guaranteed library we can count on always being present so we can
-store data in an on-disk database.
-
-Add support for using TDB to store the icount data, so we don't run out
-of memory when checking really large filesystems.
-
-Change the regression test suite so that it skips empty test directories.
-
-Define the l_i_iversion field in ext2_inode.  The l_i_version field is
-now defined from the old l_i_reserved1 field in the ext2 inode.  This
-field will be used to store high 32 bits of the 64-bit inode version
-number.
-
-Add Makefile production rule for e2fsprogs.spec in case it gets
-deleted.
-
-Add new function profile_get_uint() to allow for a clean way to fetch
-unsigned integers from the context.
-
-Add test to make sure the ext2 superblock structure is 1024 bytes.
-
-Fix typo in name of f_dup4 regression test
-
-Add new function blkid_gc_cache() which performs a garbage collection
-pass on the /etc/blkid.tab file.
-
-The ext2fs_open() function now sets EXT2_FLAG_MASTER_SB_ONLY.  In
-general, only e2fsck (after the filesystem is clean), tune2fs, and
-resize2fs should change the backup superblocks by default.  Most
-callers of ext2fs_open() should not be touching any superblock fields
-which require the backups to be touched.
-
-Add new function to libext2fs, ext2fs_default_journal_size(), which
-returns the default journal size.
-
-
-E2fsprogs 1.39 (May 29, 2006) 
-=============================
-
-Fix 32-bit cleanliness in e2fsprogs so that we can support filesystems
-between 2**31 and 2**32 blocks.
-
-Change mke2fs to use /etc/mke2fs.conf as a configuration file to
-configure the filesystem features, blocksize, and inode_ratio for
-different filesystem types.
-
-Mke2fs will now create filesystems hash trees and on-line resizing
-enabled by default, based on the new /etc/mke2fs.conf file.
-
-The e2fsprogs tools (resize2fs, e2fsck, mke2fs) will open the
-filesystem device node in exclusive mode to prevent accidents by
-system administrators.  In the case of resize2fs and mke2fs, it will
-only use exclusive mode if the filesystem is not mounted.
-
-Fixed a bug in mke2fs which caused it to to fail when creating the
-resize inode for large filesystems.  (Addresses Debian Bug #346580)
-
-When allocating space for the RAID filesystems with the stride
-parameter, mke2fs will now place each portion of the group's inode
-table right up after the superblock (if present) in order to minimize
-fragmentation of the freespace.
-
-Speed up mke2fs and e2fsck by writing inode and block bitmaps more
-efficiently by writing the inode and block bitmaps in one pass, thus
-reducing the number of disk seeks required.
-
-Add support for on-line resizing to resize2fs.
-
-Fix blkid library so that logic to determine whether or not a device's
-cached information in /etc/blkid.tab needs to be verified or not
-doesn't get confused by a system clock which is insane (for example,
-if the battery is dead on a Macintosh running PPC Linux.  (Addresses
-Red Hat Bug: #182188)
-
-The blkid library will now store the UUID of the external journal used
-by ext3 filesystems, so that in the future, the userspace mount binary
-can use this to find the location of the external journal and pass
-this information to the kernel.
-
-E2fsck will now consult a configuration file, /etc/e2fsck.conf to
-control how various options should be handled.  See the e2fsck.conf
-man page for more details.   (Addresses Debian Bug: #150295)
-
-E2fsck now prints an explanatory message when delaying a filesystem
-check when the system is running on battery.  (Addresses Debian Bug:
-#350306)
-
-E2fsck will detect if the superblock's last mount field or last write
-field is in the future, and offer to fix if so.  (Addresses Debian Bug
-#327580) These problems will be fixed automatically in preen mode
-since Debian's boot sequence bogusly doesn't set the time correctly
-until potentially very late in the bootup process, and this can cause
-false positives which will cause users' systems to fail to boot.
-(Addresses Debian Bugs #343662 and #343645)
-
-E2fsck now checks to see if the superblock hint for the location of
-the external journal is incorrect, and if so, offer to update it.
-(Addresses Debian Bug: #355644)
-
-Fix e2fsck from segfaulting on disconnected inodes that contain one or
-more extended attributes.  (Addresses Debian Bug: #316736, #318463)
-
-E2fsck will stop and print a warning if the user tries running a
-read/write badblocks test on a read-only mounted root filesystem.
-
-Fix a memory leak in e2fsck's error paths.  (Thanks to Michael
-C. Thompson for pointing these out; they were originally found using
-Coverity.)
-
-When resizing a file containing a filesystem, resize2fs will expand or
-truncate a file as necessary.  (Addresses Debian Bug: #271607)
-
-Resize2fs will now automatically determine the RAID stride parameter that
-had been used to create the filesystem, and use that for newly created
-block groups.   The RAID stride parameter may also be manually specified
-on the command line using the new -S option to resize2fs.
-
-Fix mke2fs so that it correctly creates external journals on
-big-endian machines (such as a S/390).  
-
-Fix a bug in the e2p library which could cause dumpe2fs to (rarely)
-fail to print out the journal or hash seed UUID.  (Thanks to Guillaume
-Chambraud for pointing this out.)
-
-Dumpe2fs will now print the size of the journal (if present).
-
-Fix debugfs's set_inode_field command so it can properly set the frag,
-fsize, uid_high, gid_high, and author fields in the inode instead of
-silently failing, and so that setting the i_size actually sets i_size
-correctly.
-
-Add a new debugfs command, set_current_time, which sets fs->now so
-that regression test suites can repeatedly modify the filesystem's
-last_write fields.
-
-Fix a bug in debugfs's icheck which would incorrectly report the owner
-of an extended attribute block.
-
-Fix the debugfs commands htree_dump, dx_hash, and list_dir so they print a
-print a usage message when an illegal option character is given.
-
-Fix debugfs's dump_unsued command on filesystems with a 64k blocksize
-so it won't core dump.  (Addresses SourceForge bug #1424311)
-
-Fix mklost+found so that it creates a full-sized directory on
-filesystems with larger block sizes.
-
-Fix a file descriptor leak in blkid library.
-
-Fix a display bug in "badblocks -sv" so that the done message properly
-clears the block number at the end of the test.  (Addresses Debian Bug
-#322231)
-
-Allow fractional percentages to the -m option in mke2fs and tune2fs
-(Addresses Debian Bug: #80205)
-
-Use fstat/fstat64 in getsize.c if the the target is a regular file,
-instead of attempting to do a binary search.  Fix some fd leaks in
-error cases.
-
-Add support for device mapper library to the blkid library to ensure
-that the "best" (i.e., leaf) device is probed by the blkid library.
-
-Fix the blkid library so that it notices when an ext2 filesystem is
-upgraded to ext3.
-
-Improve the blkid's library VFAT/FAT detection; it now understands
-labels stored in the root directory, and is more paranoid about
-checking the FAT superblock values.
-
-Fixed a fd leak in the uuid library which was causing problems for the
-LVM tools.  (Addresses Debian Bug: #345832)
-
-Add support for the reiser4 and software suspend partitions to the
-blkid library.  Also add support for extract the label from iso9660
-filesystems.
-
-Fix a compile_et bug which miscount the number of error messages if
-continuations are used in the .et file.
-
-Add extra sanity checks to protect users from unusual cirucmstances
-where /etc/mtab may not be sane, by checking to see if the device is
-reported busy (works on Linux 2.6) kernels.  (Addresses Debian Bug
-#319002)
-
-Updated French, Dutch, Polish, and Swedish translations.  (Addresses Debian
-Bug: #343149, #341911, #300871, #316604, #316782, #330789)
-
-Fix use-after-free bug in e2fsck when finishing up the use of the
-e2fsck context structure.
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages and
-documentation.  (Addresses Debian Bugs: #329859, #322188, #316811,
-#312515, #351268, #357951, #347295, #316040, #368392, #368393, #368394,
-#368179)
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bugs #317862, #320389, #290429, #310950,
-#310428, #330737, #330736, #329074, #356293, #360046, #366017, #364516,
-#362544, #362970)
-
-
-Programmer's notes:
--------------------
-
-Update config.guess and config.sub to latest version (2006-02-23) from
-FSF.
-
-Fix asm_types.h type conflicts on AMD 64 platforms.  (Addresses Debian
-Bugs: #360661, #360317)
-
-Fixed the Makefile so that they work correctly on newer versions of
-GNU make (i.e., 3.81).
-
-Add valgrind support to the regression test suites, and eliminate
-false positives from valgrind.
-
-Add a regression test suite for the blkid library.
-
-Fix a fencepost error in resize2fs caught by valgrind.  
-
-Fix compiler warnings about missing memcpy prototypes.
-
-We no longer have the sparc assembly code in the header file any more,
-so we shouldn't set _EXT2_HAVE_HAS_BITOPS_ for the sparc.  This would
-break compiles on the sparc architectures when using gcc.
-
-In the libext2fs library, add the new field fs->now which if non-zero
-is used instead of the system time when setting various filesystem
-fields (last modified time, last write time, etc.)
-
-Fix gcc 4.01 complaints by adding a missing #include <string.h> to
-ext2fs.h which is needed since the inline functions use memcpy().
-(Addresses Sourceforge Bug #1251062)
-
-Use BUILD_CFLAGS and BUILD_LDFLAGS instead of CFLAGS and LDFLAGS in
-the build system when building files in the util directory which are
-needed during the build process.  This avoids potential problems when
-cross-compiling and some of the options specified in CFLAGS or LDFLAGS
-are not recognized as valid by the host compiler.  (Addresses
-Sourceforge Bug #1261547)
-
-Clean up the blkid library by making the superblock and generic i/o
-functions to be more generic.  Clean up interface to the probe
-function, and fix memory leak.  Finallly, remove an unneeded reference
-to probe.h in the lib/blkid/resolve.c
-
-Add an ext2fs_read_bb_FILE regression test to confirm proper detection
-of invalid block #'s.
-
-The x86 asm constraints for ext2fs_{set/clear}_bit have been fixed to
-indicate that the the function read/writes the memory location.
-
-Fix various gcc -Wall complaints.
-
-Add a dependency to make sure that the subdirectories are created
-before creating all of the object files, in order to address parallel
-build problem in the library Makefiles.  (Addresses Sourceforge Bug:
-#1261553)
-
-Add $(LDFLAGS) to the command line argument when generating an ELF or
-Solaris shared library, to allow cross-compile and other builds that
-might need to specify -L paths to needed libraries.  (Addresses
-Sourceforge Bug #1261549)
-
-Add a new feature, EXT2_FEATURE_COMPAT_LAZY_BG, which is initially
-intended for testing purposes.  It allows an ext2/ext3 developer to
-create very large filesystems using sparse files where most of the
-block groups are not initialized and so do not require much disk
-space.  Eventually it could be used as a way of speeding up mke2fs and
-e2fsck for large filesystem, but that would be best done by adding an
-RO_COMPAT extension to the filesystem to allow the inode table to be
-lazily initialized on a per-block basis, instead of being entirely
-initialized or entirely unused on a per-blockgroup basis.
-
-Fix backwards compatibility so e2fsprogs will better compile on Linux
-2.0.35 systems.
-
-Make test scripts more robust against locale-related environment variables
-
-Fix type warning problem with sizeof() in ext2fs_open2().
-
-Fix type warning problem with time_t in debugfs.
-
-
-E2fsprogs 1.38 (June 30, 2005)
-==============================
-
-Fix blkid's test programs (built with "make check") compile correctly
-even without "configure --enable-blkid-debug".
-
-Fix ia64 core dump bug caused by e2fsprogs running afoul of C99 strict
-type aliasing rules on newer gcc compilers.  (Addresses Red Hat
-Bugzilla ##161183.)
-
-Fix com_err library to make it more compatible with recent changes
-made to the com_err library in MIT Kerberos V5 version 1.4.
-(Addresses Sourcefroge Bug #1150146)
-
-General cleanup of messages printed by e2fsprogs programs for grammar,
-consistency, and to make life easier for translators.  Fixed a few
-strings containing English that had not been marked as needing
-translations.  Removed strings that do not need to be translated, to
-make life easier for translators.
-
-Mke2fs and badblocks will take advantage of a feature in Linux 2.6 to
-test to see if a device appears to be in use instead of just relying
-on /proc/mounts and /etc/mtab.  (Addresses Debian Bug #308594).
-
-Fix portability problem in the filefrag program affecting platforms
-where the size of an integer is smaller than the size of a long.
-(Addresses Debian Bug #309655)
-
-Mke2fs will now use a larger journal by default for filesystems
-greater than 4GB.  (128 MB instead of 32MB).
-
-Mke2fs will refuse to create filesystems greater than 2**31-1 blocks,
-unless forced.  This is to avoid signed vs. unsigned kernel bugs in
-block numbers that still need to be fixed.
-
-The blkid program has a new option which will more efficiently search
-for device when it is known (or expected) that only one matching
-device will be found in the system, such as when doing a lookup by
-UUID.
-
-Debian's e2fsprogs-specific initrd fragment will avoid including
-unnecessary libraries into the initrd ramdisk by unsetting LD_PRELOAD
-and LD_LIBRARY_PATH, and filtering out libraries found in
-/etc/ld.so.preload.  (Addresses Debian Bug: #304003)
-
-Fixed a potential portability issue in the blkid programs for
-architectures where the char type is unsigned.  (Addresses Sourceforge
-Bug: #1180585)
-
-Fix a bug in filefrag so that it doesn't falsely count an extra
-discontinuity when the first block found is an indirect block.
-(Addresses Debian Bug #307607).
-
-Fix blkid's recognition of cramfs filesystems, and enhance it to be
-able to handle cramfs labels.
-
-Fix debugfs's stat command to not core dump when a filesystem is not
-open.
-
-Fix e2fsck's handling of error conditions caused by the resize inode
-claiming blocks that are also used by other inodes, a filesystem
-corruption which was commonly caused by a bug in Fedora Core 3's
-resize2fs program.
-
-Fixed bug in filefrag which caused it to fail on non-ext2/3
-filesystems.  (Addresses Debian Bug: #303509)
-
-If the superblock last mount time indicates that the system clock may
-not be accurate, then e2fsck will omit checking inodes' deletion time
-field for indications of a potential corrupted orphaned inode list.
-(Previously e2fsck only ommited these LOW_DTIME checks when the
-superblock's last write time looked insane.)
-
-Fixed a IA64 core dump bug in the e2p library which affected dumpe2fs.
-(Addresses Debian bug #302200)
-
-Make the blkid library more paranoid about being run from setgid
-programs, and to use __secure_getenv() from libc if it is available.
-
-Fixed spelling mistakes, typos, and otherwise clarified man pages.
-(Addresses Debian Bugs: #304591, #304592, #304594, #304597, #304593
-and Sourceforge Bug: #1189803)
-
-Updated and fixed translations.
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.
-
-Programmer's notes:
--------------------
-
-Ext2fs_set_bit(), ext2fs_clear_bit(), and ext2fs_test_bit( have been
-changed to take an unsigned int for the bit number.  Negative bit
-numbers were never allowed (and didn't make any sense), so this should
-be a safe change.  This is needed to allow safe use of block numbers
-greater than or equal to 2**31.
-
-The compile_et program will avoid recreating generated foo_err.c and
-foo_err.h files if no changes are necessary.  The compile_et program
-will also atomically replace these files to avoid a potential parallel
-build race problem on SMP systems.  (Addresses Sourceforge Bug:
-#1157933)
-
-Added a new function to the blkid library, blkid_probe_all_new(),
-which only probes newly added disk devices, and change
-blkid_find_dev_with_tag() to use this function so that when a
-requested tag is not found, devices that were previously not checked
-are searched before searching all devices in the system.
-
-Added new functions to the blkid library, blkid_dev_set_search() and
-blkid_dev_has_tag().
-
-E2fsck's problem strings can now use @m and @n as abbrevations for
-"multiply-claimed" and "invalid", respectively.
-
-The e2fsprog.pot file now has an explanation of how the @-expansion
-and %-expansion works, and strings in e2fsck/problem.c which contain @
-characters now have comments in e2fsprogs.pot with the @-expansion to
-make life easier for translators.
-
-Fixed missing return values in the ext2fs library which could cause it
-to return random garbage in certain error conditions.
-
-Allow the current time to be overriden via the E2FSCK_TIME environment
-variable for use in regression tests.
-
-The test scrpit driver program now exits with a non-zero status if
-there any of its test that it ran failed.
-
-Fixed problems with parabuilds on SMP systems.  (Addresses Sourceforge
-Bug: #1157933)
-
-Fixed "make check" so that it compiles correctly even when e2fsprogs'
-header files have not be installed in the system include directories.
-(Addresses Sourceforge Bug: #1180572)
-
-Fixed gcc -Wall nits.
-
-
-E2fsprogs 1.37 (March 21, 2005)
-===============================
-
-Add support for checking the validity of Extended Attributes stored in
-inodes to e2fsck.
-
-Add support for dumping the contents of large inodes to debugfs,
-including the extended attributes stored in inodes.
-
-Fix mke2fs, e2fsck, debugfs, and the ext2fs_mkdir function so that
-when we create a new inode we make sure that the extra information in
-the inode (any extra fields in a large inode and any ea-in-inode
-information) is initialized correctly.  This can take place when
-mke2fs creates the root and lost+found directory, when e2fsck creates
-a new root inode or a new lost+found directory, and when the user uses
-the debugfs write, mknod, or mkdir commands.  Otherwise, the newly
-create inode could inherit garbage (or old EA information) from a
-previously deleted inode.
-
-Fixed a bug in e2fsck so it would notice if a file with an extended
-attribute block was exactly 2**32 blocks, such that i_blocks wrapped
-to zero.
-
-Added support to filefrag to detect files which are using the new
-experimental file extents format, and use the non-ext2 algorithm in
-that case.  Fixed a bug to avoid reporting a false discontinuity if
-there is one or more unallocated blocks at the beginning of a file.
-
-Duplicated a check for noticing whether or not the number of blocks
-(given a certain blocksize) is greater than 2**32 when the
-BLKGETSIZE64 ioctl is not available to ext2fs_get_device_size().  This
-allows mke2fs to automatically use a larger blocksize when creating a
-filesystem on a very large device when run on systems that do not
-support BLKGETSIZE64.
-
-Fix the I18N build which was broken in e2fsprogs 1.36 because the
-build system had been switched to treat the .gmo files as shipped
-files (for backwards compatibility with systems that have older GNU
-I18N tools installed), but the gen_tarball.in script was still
-removing the .gmo files from the official source distribution.
-
-Fixed various Debian packaging issues --- see debian/changelog for
-details.  (Addresses Debian Bugs ##296769, #299341)
-
-Programmer's notes:
--------------------
-
-Added new functions to the e2p library which convert between a string
-and os_type: e2p_os2string() and e2p_string2os(), and used them to
-make the generated binaries more compact.
-
-Fixed a compile-time error on Darwin systems.
-
-Cleaned up the lib/ext2fs Makefile slightly.
-
-
-E2fsprogs 1.36 (February 4, 2005)
-=================================
-
-All of the patches that were applied to Fedore Core 3's
-e2fsprogs-1.35-11.2 have been integrated, although sometimes with a
-lot of bug fixes first.  Users of Fedora Core 3 are strongly
-encouraged to upgrade to e2fsprogs 1.36 as soon as possible.
-
-Add support for filesystem with the online resizing via resize inode
-feature.  Fixed numerous bugs from the Fedora patches.  The Fedora
-patches also didn't bother to do any consistency checking on the
-resize inode, or add any tests to the regression test suite.  The "-R
-resize=4g" option to mke2fs was a no-op in the Fedora patches, despite
-being listed in mke2fs's usage message.  All of these shortcomings
-have been corrected.
-
-E2fsck can also also fix filesystems trashed by Fedora's resize2fs
-program.  In order to do this, the user must run the commands:
-
-	debugfs -w /dev/hdXXX -R "features ^resize_inode"
-        e2fsck -f /dev/hdXXX
-
-Optionally, the ext2prepare command can be used to re-enable online
-resizing after the filesystem has been fixed.
-
-The fsck program will now accept an optional filedescriptor argument
-to the -C option.  (The Fedora version of this patch would sometimes
-cause fsck to ignore a parameter on fsck's command line in some rare
-cases, sigh.)
-
-Make sure e2fsprogs doesn't write garbage into the reserved portion of
-large inodes.
-
-Make sure resize2fs releases the blocks belonging to the old inode
-table blocks when moving the inode table.  (Addresses Debian Bug:
-#290894)
-
-Skip the r_resize_inode test if resize2fs is not compiled (due to
-configure --disable-resizer)
-
-E2fsck now checks the summary filesystem accounting information, and
-if any of the information is obviously wrong, it will force a full
-filesystem check.  (Addresses Debian Bug #291571)
-
-Fix e2fsck to not complain when the resize_inode feature is enabled,
-s_reserved_gdt_blocks is zero, and there is no DIND block allocated in
-the resize inode.
-
-Fix e2fsck to note delete symlinks that contain an extended attribute
-after the ext_attr feature flag has been cleared.  (Addresses Red Hat
-Bugzilla #146284).
-
-Add new utility program, copy_sparse.c, which is very useful
-for dealing with large sparse files (such as e2image files).
-
-Add support for jnl_blocks[] for debugfs's set_super_value.
-
-Fix filefrag so that it works correctly with sparse files.
-
-Filefrag -v will print first and last blocks.
-
-Add interpretation of OS Creator values for FreeBSD and Lites in mke2fs
-and dumpe2fs.
-
-Add mke2fs support so that it can support filesystems larger than 4TB
-automatically, by retrying with a 4k blocksize if the device size is
-too big to be expressed using a 1k blocksize.  (Addresses Sourceforge
-bug #1106631)
-
-Change blkid to test for NTFS first because Windows sometimes doesn't
-clear enough of the parition to confuse the probing routines into
-thinking the old filesystem type is still valid.  (Addresses Debian
-Bug #291990)
-
-Add support for swap partition label and uuid's in the blkid library.
-
-Add support to the blkid library to recognize Oracle ASM volumes.
-
-Make blkid -t display all devices that match the specified criteria,
-not just the first one, and work more consistently when the blkid
-cache file is not available or set to /dev/null.  (Addresses Debian
-Bug #290530 and #292425)
-
-Badblocks will now correctly display block numbers greater than
-999,999,999 in its progress display.
-
-The tune2fs program will not allow the user from setting a ridiculous
-number of reserved blocks which would cause e2fsck to assume the
-superblock was corrupt.  E2fsck's standards for what is a ridiculous
-number of reserved block has also been relaxed to 50% of the blocks in
-the filesystem.
-
-The blkid library will return vfat in preference to msdos, and ext3 in
-preference to ext2 (if the journalling flag is set) so that mount will
-do the right thing.  (Addresses Debian bug #287455)
-  
-Mke2fs will now use the -E option for extended options; the old -R
-(raid options) option is still accepted for backwards compatibility.
-Fix a double-free problem in resize2fs.  (Red Hat Bugzilla #132707)
-
-Mke2fs will now accept a size in megabytes, gigabytes, and other units
-(via "32m" or "4g" on the command line) if the user finds this more
-convenient than specifying a block count.
-
-Fix an obscure, hard-to find bug in "e2fsck -S" caused by an inode
-cache conherency problem.
-
-Debugfs now supports a new command, set_inode_field, which allows a
-user to manually set a specific inode field more conveniently, as well
-as set entries in the indirect block map.
-
-Debugfs's set_super_value command has been enhanced so that the user
-can set most superblock fields, including the date/time fields and
-some of the more newsly added superblock fields.
-
-E2fsprogs programs now accept an offset to be passed to the file
-specifiers, via the syntax: "/tmp/test.img?offset=1024".
-
-E2fsprogs programs will now accept blocksizes up to 65536; kernel
-support on the x86 doesn't exist for now, but it can be useful on
-other architectures with page sizes greater than 4k.  There are 2.6
-kernel patches out there which enable this, but they are of this
-writing still experimental.
-
-The e2image command now takes the -s option which will scramble
-directory entries for raw image files.
-
-Fix a file descriptor leak in the filefrag program.
-
-Make sure e2fsck doesn't crash when /proc/acpi/ac_adapter is not
-present.
-
-Fix bug in debugfs where kill_file would lead to errors when deleting
-devices and symlinks.  (Sourceforge Bugs #954741 and #957244)
-
-Fix bug in the blkid library when detecting the ocfs1 filesystem 
-
-Remove obsolete EVMS 1.x and a.out DLL support.
-
-E2fsck will attempt to recover from a journal containing illegal blocks.
-
-Fixed two potential ordering constraint problems in e2fsck which might
-cause the filesystem to be corrupted if e2fsck is interrupted during a
-(extremely narrow) race window.  Thanks to Junfeng Yang from the
-Stanford Metacompilation group for pointing this out.
-
-Fixed bug in e2fsck where it would not accurately detect whether or
-not the system is running on adaptor if the ACPI device representing
-the AC adapter didn't correspond to the what was used on IBM
-Thinkpads.
-
-Change e2fsck to accept directories greater than 32MB.
-
-Fix e2fsck so that a checkinterval of zero disables a time-based check
-of the filesystem.
-
-Debugfs will check the DEBUGFS_PAGER enviroment variable in preference
-to the PAGER environment variable.  (Addresses Debian Bug #239547)
-
-Tune2fs will not mark rewrite the superblock if the feature bitmasks 
-are not modified.
-
-The debugfs program will set the filetype information when creating a
-link.
-
-Add debugfs -d option to use a separate source of data blocks when
-reading from an e2image file.
-
-Add e2image -I option which allows the e2image metadata to be
-installed into a filesystem.
-
-Fixed bug in the badblocks program which caused "done" to always
-appear in english even when a translation was available.  (Addresses
-Debian Bug #252836)
-
-The blkid program has a new option -o which controls the output format
-of the blkid program; this is makes blkid more convenient to use in
-shell scripts.
-
-Fix a minor bug in uuid library, which was not using the full 14 bits
-of clock sequence when generating UUID's.
-
-Fix a Y8.8888K problem in the uuid library.
-
-Logsave now creates a new session id for itself to avoid getting
-killed by init whan transitioning between init levels.
-
-Change the licensing of the UUID library to be the 3-clause BSD-style
-license; this allows Apple to use the uuid library in Darwin.
-
-Add ocfs and ocfs2 probe support into the blkid library.
-
-Fix a memory and file descriptor leak in the blkid library.
-
-The blkid library will revalidate the device if the system time is
-earlier than last verification time of the device, since that
-indicates that the system time is probably nottrustworthy.
-
-The blkid library will override the default location of the blkid.tab
-file by the BLKID_FILE environment variable, if it is available.
-
-Change the getsize functions to use the BLKGETSIZE64 ioctl on Linux 2.6.
-
-Add various portability fixes for lame new versions of glibc, Darwin
-and GNU/KFreeBSD, as well as removing XSI:ism's.  (Addresses Debian
-Bugs #239934, #264630, #269044, #255589, #289133)
-
-Add support for Windows 9x/NT under Cygwin.
-
-Updated and clarified various man pages.  (Addresses Debian Bugs #236383,
-	#241940, #238741, #242995, #256669, #268148, #256760, #273679)
-
-Updated and fixed translations.   (Addresses Debian bugs #244105, #262836)
-
-Update the rpm spec files so that it works better with Fedora core 2
-and RH9.
-
-Fixed various Debian packaging issues (see debian/changelog).  In
-particular, fixed the Debian initrd scripts.  (#241183, #248050,
-#253595, #247775)
-
-
-Programmer's notes: 
--------------------
-
-Fixed various gcc -Wall warnings.
-
-The uuid library now has new functions uuid_unparse_upper() and
-uuid_unparse_lower() which forces the case of the hex digits to be
-upper case, or lower case.
-
-The build process has been speeded up by enhancing the subst program
-to update the modtime on the generated files even when the generated
-file hasn't changed.
-
-The uuid library now uses C99 stdint.h types instead of custom types.
-
-Updated config.guess and config.sub with newer versions from the FSF.
-
-Removed out of date .cvsignore files from the source distribution.
-
-The ext2fs_unlink() function will return an error if both the name and
-inode number are unspecified, to avoid doing something surprising
-(such as unconditionally deleting the first directory entry).
-Directory entries are now deleted by coalescing them with the previous
-directory entry if possible, to avoid directory fragmentation.  This
-is not an issue with the e2fsprogs suite, but may be a problem for
-some of the users of libext2fs, such as e2tools.
-
-Add support for version numbers of the form "1.36-rc1".
-
-Fix build of mke2fs.static.
-
-Add basic ext2fs library support for large (EA in inode) inodes.
-
-The test_io mechanism can now abort after n reads or writes to a
-particular block.  The block is specified by TEST_IO_BLOCK environment
-variable, and the read/write count by the TEST_IO_READ_ABORT and
-TEST_IO_WRITE_ABORT environment variables.  The block data is now only
-dumped if the 0x10 bit is set in TEST_IO_FLAGS.
-
-UUID_DEFINE() in the uuid library now creates a static variable, with
-__attribute__ ((unused)) if we are using GCC, so that UUID_DEFINE can
-be used in header files.
-
-Add support for the install-strip and install-shlibs-strip targets, as
-suggested by the GNU coding guielines.  "make install" no longer
-strips the binaries which are installed.
-
-Remove support for the --enable-old-bitops configure option which was
-only for very old sparc systems.
-
-Remove support for --enable-clear-htree; this was only needed during
-the early development of the htree patch.
-
-Use Linux-kernel-style makefile output so it is easier to see compiler
-warnings.
-
-Update gettext files to version 0.14.1.
-
-Update to use autoconf 2.5x.
-
-Improved support for compiling e2fsprogs under dietlibc.
-
-Make e2fsprogs portable to Solaris and FreeBSD systems.
-
-Add blkid_verify(), blkid_get_library_version(), and
-blkid_parse_version_string() functions to the blkid library.
-
-Add pkg-config files for e2fsprogs's libraries.
-
-Fix "make uninstall" to so that it removes everything that is installed.
-
-Add a configure --enable-maintainer-mode option which enables the
-makefile rules to rebuild the configure script from configure.in, and
-to reubuild the .gmo files in po directory.
-
-Drop the sparc assembly bitwise operations; it's less efficient
-than the GCC 3.4 compile code and triggers compiler warnings on
-sparc64.  Thanks to Matthias Andree for his analysis and suggestions.
-(Addresses Debian Bug #232326)
-
-
-E2fsprogs 1.35 (February 28, 2004) 
-==================================
-
-E2fsck has a new -k option, which in conjunction with the -c options,
-preserves the existing badblocks list.
-
-Cleaned up e2fsck's preen-mode messages during the passes 1b, 1c, and 1d.
-
-E2fsprogs will now deal correctly with symlinks that contain
-extended attribute information, which can be created using SE Linux.
-(Addresses Debian Bug #232328)
-                                                                               
-Remove a double longjump into an invalid stack frame bug in e2fsck.
-(This was during an abort sequence, which normally worked on Linux and
-caused a core dump on other operating systems.)
-
-Fix NLS bug in e2fsck, by avoiding trying to expand an empty string
-(the NLS library will replace "" with the .po header information).
- 
-Fix a bug in mke2fs which caused -T largefile or -T largefile4 to core
-dump due to a division by zero error.  (Addresses Debian bug #207082)
-
-Fixed a bug in e2fsck which caused it to incorrectly fix a filesystem
-when reconnecting a directory requires creating a lost+found
-directory.  (Addresses Debian bug #219640).
-
-Fixed a bug where e2fsck would bomb out if a journal needed to be
-replayed when using an alternate superblock.
- 
-E2fsck will give an extra grace period before actually forcing a check
-if the laptop is running on battery.  The next time fsck runs while
-the system is on the AC mains, or after the grace period is exceeded,
-the filesystem will be checked.  (Addresses Debian bug #205177)
-
-E2fsck will inform the user when there are 5 or fewer mounts before a
-filesystem check will be forced.  (Addresses Debian bug #157194)
-
-Fix e2fsck's handling of corrupted indirect blocks in the bad block.
-We now correctly handle the case where there is an overlap between a
-block group descriptor or a superblock and a bad block indirect block.
-In the case where the indirect block is corrupted, we now suggest
-"e2fsck -c".
-
-Fix byte swap bugs in e2fsck that caused the journal backup location 
-in the superblock and symlinks created by SE Linux to be cleared
-by e2fsck on big-endian machines.  (Addresses Debian bug #228723)
-
-E2fsck -c now replaces the current list of bad blocks with the ones
-found by badblocks.
-
-Fix bugs in e2fsck and tune2fs which could cause a core dump if a
-non-existent LABEL or UUID specifier is to e2fsck or tune2fs.
-
-Fix a potential bug in e2fsck which could cause it to core dump when
-trying to print the location of the backup superblock.
-
-Protect against a potential core dump in e2fsck when printing a
-message about backup superblocks.
-
-Add support for backing up the journal inode location in the
-superblock.  E2fsck will automatically save the journal information in
-the superblock if it is not there already, and will use it if the
-journal inode appears to be corrupted.  ext2fs_add_journal_inode()
-will also save the backup information, so that new filesystems created
-by mke2fs and filesystems that have journals added via tune2fs will
-also have journal location written to the superblock as well.
-Debugfs's logdump command has been enhanced so that it can use the
-journal information in the superblock.
-
-E2fsck will now update all superblocks when moving the journal inode.
-  
-Shrink the size of the e2fsck executable by moving some initialized
-variables to the BSS segment.
-
-E2fsck will avoid printing the ^A and ^B characters which bracket the
-progress bar when stdout and stdin are a tty device instead of a pipe
-to another program.  (Addresses Debian bug #204137)
-
-Debugfs's mkdir command will automatically expand the directory if
-necessary.  (Addresses Debian Bug: #217892)
- 
-Fixed a bug in debugfs so that copying a file from /dev/null uses the
-correct mode bits.  (Addresses Debian Bug: #217456)
- 
-If the environment variables DEBUFS_PAGER and PAGER are not set,
-debugfs now searches for the appropriate pager to use, beginning with
-/usr/bin/pager, and then falling back to 'more' and 'less'.
-(Addresses Debian bug #221977)
-
-Debugfs will now support 2.6 device numbers where the major or minor
-number may be larger than 255.  (Addresses Sourceforge bug #865289)
- 
-Fix debugging printf in resize2fs.  (Addresses Debian Bug #271605)
-
-Chattr now stops processing options when it sees '--'.  (Addresses
-Debian bug #225188)
-
-Fix regression tests so they work correctly when e2fsprogs is compiled
-with configure --disable-htree.
-
-Fix bug in uuid library when there is no network card and the library
-is generating a time-based uuid.  The random MAC address was not
-correctly generated to be a multicast address.
- 
-Add compile_et extensions from Heimdall that were missed the first time
-around.
-
-Fix bug in badblocks when using O_DIRECT; we need to make sure that
-we're reading from an offset which is page aligned.  For read-only and
-read-write tests, we try to recover after an error so that we can
-continue reading on page-aligned boundaries.  (Addresses Debian Bug
-#203713)
-  
-Badblocks now checks 64 blocks at a time instead of 16.  (Addresses
-Debian bug #232240)
- 
-Updated and clarified various man pages.  (Addresses Debian Bug
-#206845, #222606, #214920, #232406)
-
-Updated and fixed translations.   (Addresses Debian bugs #200086, #214633)
-
-Fixed various Debian packaging issues (see debian/changelog).
-
-Programmer's notes: 
--------------------
-
-Fixed a build problem so that e2fsprogs would compile with the
---enable-profile option to configure selected.  (Addresses Sourceforge
-bug #811408)
- 
-Fixed C++ problems with the ext2fs.h header.  (Addresses Red Hat
-Bugzilla Bug #112448)
-                                                                               
-Centralize code which calculates the location of the superblock
-and block group descriptors so that it is in a single library routine.
-
-Added two new functions, ext2fs_file_open2() and
-ext2fs_inode_io_intern2() which take a pointer to an inode structure.
-
-Fix compile_et to output the correct prototype for
-initialize_xxx_err_table_r() in the header file.  (Addresses Debian
-bug #204332)
-
-In the lib/et makefile, make sure com_err.info is deleted on "make clean".
-  
-Fix 64-bit warnings in e2fsprogs pass1b by using inttypes.h if
-present.  This is for when we try stuffing an int into void * pointer.
-
-Fix type-punning which can cause gcc 3.x to miscompile code by getting
-confused about pointer aliasing.  ext2fs_getmem(), ext2fs_free_mem(),
-and ext2fs_resize_mem() all now take a 'void *' instead of a 'void
-**'.  The EVMS code uses an ugly union approach since we don't want to
-modify the EVMS interfaces. 
-
-Make sure all Makefiles use $(MAKE) rather than hardcoded "make", to
-aid build process on systems can use invoke GNU make as "gmake".
-
-Added regression testing for mke2fs.
-
-Fixed gcc -Wall nitpicks.
-
-Fixed various compiler warnings.
-
-Add portability fixes for FreeBSD and for using fsctl under Darwin to
-support ext2 ioctl's.
-
-
-E2fsprogs 1.34 (July 25, 2003)
-===============================
-
-Fixed a bug introduced in E2fsprogs 1.30 which caused fsck to spin in
-a tight loop while waiting for a child fsck to exit in some cases.
-This burns CPU times which slows down the low-level filesystem check.
-
-Added code to mke2fs to assure that the default block size for a
-filesystem is at least as big as the sector size of the device, if it
-can be determined.
-
-Changed mke2fs and resize2fs to round the default size of a filesystem
-to be an even multiple of the VM pagesize in order to avoid a Linux
-kernel bug introduced when the storage of the buffer cache was moved
-into the page cache.
-
-Mke2fs will warn the user when creating a filesystem with journaling
-and a blocksize greater than 4096.  (Addresses Debian bug #193773)
-
-Fixed a bug in resize2fs which caused it to fail on filesystems with a
-non-empty bad block list.  Resize2fs now discards any blocks on the
-badblock list which are no longer part of the filesystem as the result
-of a filesystem shrink.  (Note: this means that shrinking and then
-enlarging a filesystem is no longer a reversible operation;
-information about bad blocks in the part of the filesystem which is to
-be chopped off will be lost.)
-
-Changed resize2fs so the user can use prefixes to specify the units of
-the new filesystem size (sectors, kilobytes, megabytes, or gigabytes),
-and to make the error and informational messages explicitly display
-the blocksize used by the filesystem, in order to avoid confusion.
-(Addresses Debian bug: #189814)
-
-Added a new debugfs command, dump_unused, which dumps the contents of
-all unused blocks to stdout.  (Useful as an emergency try-to-find
-deleted data command.)
-
-Added a new debugfs command, imap, which prints the location of a
-specified inode in the inode table.
-
-Fixed a bug in the badblocks program which caused it to use one bit of
-randomness in its non-destructive read/write test, instead of using a
-full 8 bits of randomness.
-
-Added a new option (-t) to badblocks, which allows the user to control
-the test pattern(s) used when checking a disk.
-
-The blkid probe function now more correctly detects UDF filesystems.
-
-Fixed a bug in the blkid library which caused it to not update its
-cache if a filesystem changes from having a label to not having a
-label.
-
-Fixed a bug in the blkid library wihch could avoid an infinite loop
-in blkid_find_dev_with_tag() if /proc is not mounted and there the
-/etc/blkid.tab file has not yet been created.
-
-Fixed the badblocks program so that the destructive read/write test
-honors the -c option, and to use O_DIRECT when possible to avoid
-thrashing the system block buffer cache.
-
-Fixed various NLS issues.
- - Added Czech and Swedish translations
- - Removed testing NYC translation
- - Fixed NLS support for message abbrevations in e2fsck
- - Remove de-utf.po, since we shouldn't have two versions using different
-	charset encodings.
- - Used ngettext() (abbreivated with the macro P_(str1, str2, n)) to 
-	simplify the statistics reporting in e2fsck.
-
-Changed configure.in so that its defaults for *BSD systems no longer
-build an fsck wrapper, and not to install in /usr/local by default.
-
-Fixed some minor spelling errors/typo's in e2fsck and the configure
-script.
-
-Fixed various Debian packaging issues (see debian/changelog). 
-
-Updated and clarified man pages.  (Addresses Debian Bug #195616)
-
-Programmer's notes: 
--------------------
-
-Fix gcc -Wall nitpicks.
-
-Updated gettext implementation used by e2fsprogs to 0.11.5, and enable
-NLS support by default.  (Added partial workaround for gettext/Darwin
-incompatibility problems.)
-
-Added full MIT KRB5 and Himdall compaibility support to the com_err
-library and the compile_et program.  (Addresses Debian bug #191900)
-
-Added the blkid_known_fstype() function to the blkid library, which
-returns true if it is passed a filesystem type which is recognized by
-the blkid probing functions.
-
-Improved the documentation for the blkid library.
-
-Added the ext2fs_get_device_sectsize() function the the ext2fs library, which
-returns the hardware sector size of a device, if it is available.
-
-Added a dependency in the blkid library's .so file to the uuid
-library, since the former uses the latter.  (Addresses Debian bug
-#194094)
-
-Added --with-diet-libc and --disable-evms to the configure script.
-
-Fixed a minor memory leak in the badblocks program.
-
-Fixed a portability problem in tune2fs --- not all systems have strptime().
-
-Fixed a portability problem in debugfs with the use of getopt() more
-than once.  Old-style BSD, new-style BSD, and Linux C libraries all do
-things differently.
-
-Add support Windows support to ext2fs_get_device_size().
-
-Added (normally disabled) debugging code to the Unix I/O manager which
-causes it to disable all userspace caching if the NO_IO_CACHE is
-defined.
-
-Changed the test I/O manager so it can always be linked into e2fsck,
-mke2fs, and tune2fs if enabled via --enable-test-io-debug to the
-configure script.  The test I/O manager will only print any debugging
-information if the TEST_IO_FLAGS or TEST_IO_BLOCK environment
-variables are set, which specifies which I/O operations are logged and
-a block number to watch, respectively.  The log messages are sent to
-stderr by default, unless a filename is specified via the
-TEST_IO_LOGFILE environment variable.
-
-
-E2fsprogs 1.33 (April 21, 2003)
-===============================
-
-Added a new utility program, logsave, which captures the output of a
-command in a log file, even if the containing directory hasn't been
-mounted yet (in which case the it saves the output in memory until it
-can write out the logfile).  This is useful for capturing the
-output of fsck during the boot sequence.
-
-Fixed some portability problems that were causing problems under
-the Cygwin32 environment.
-
-Mke2fs now interprets a negative number to the -b option as a minimum
-block size.
-
-Fixed a bug in mke2fs which was incorrectly checking the argument to
-the -g option if the default block size was used.  (Addresses Debian
-bug #188319)
-
-Fsck now explicitly ignores tmpfs and devpts, and it will complain if
-it can not find filesystem checkers for jfs, reseirfs, and xfs.
-
-E2fsck now updates the global free block and inode counters from the
-block group specific counters quietly.  This is needed for an
-experimental patch which eliminates locking the entire filesystem when
-allocating blocks or inodes; if the filesystem is not unmounted
-cleanly, the global counts may not be accurate.
-
-Imported bug fixes to the EVMS plugin from the EVMS 2.0 tree.  (EVMS
-2.0 is not yet supported; this only pulled in the bug fixes: fixed
-possible hangs caused by bugs in calling waitpid, and not setting the
-pipe to non-blocking mode; also fixed a file descriptor leak; made
-sure all functions call log entry/exit functions.)
-
-Badblocks now flushes its output file as bad blocks are discovered.
-
-The uuid library is now more paranoid about assuming the correctness
-of the /dev/random device; it mixes in a stream of bytes from
-random/srandom, just in case.
-
-Update Debian files to reflect the fact that I am now the Debian
-maintainer of e2fsprogs.  Other various Debian-specific packaging
-cleanups.
-
-Move the source tarball generation functions from the top-level
-makefile to the util/gen-tarball script.  
-
-Updated the Turkish .po translation file.
-
-Added Heimdal and MIT krb5 extensions to the com_err library to make
-it more compatible with com_err libraries from those distributions.
-
-Changed dumpe2fs to always display the superblock fields relating to
-the journalling and/or directory indexing feature even if those
-features are not enabled.
-
-Updated and clarify copyright statement vis-a-vis alpha releases of
-e2fsprogs.
-
-The ss library will now try to dynamically link to the readline
-library and use it if it is present in the system.  This means that
-the debugfs program now has line editing and history features.  The
-SS_READLINE_PATH environment variable is used to find a readline or
-readline-compatible library.
-
-E2fsck now finds most duplicate filenames (all when rebuilding all
-directories via the -D option) and offers to delete or rename
-duplicate filenames/directory entries.  (Addresses Debian Bug #176814).
-
-Fix bug in e2image.  When writing out a raw image file, include data
-blocks from symlinks that do not store the symlink within the inode.
-
-Fix bug in resize2fs which incorrectly moved the block and inode
-bitmaps for sparse superblock filesystems and incorrectly marked
-blocks as in use.  (Addresses Debian bug #174766)
- 
-Added a new shared library, the blkid library, which efficiently
-allows fsck, mke2fs, e2fsck, and tune2fs to be able to look up LABEL
-and UUID filesystem specifiers without needing to search all of the
-devices in the system.  Instead, the device is looked up in a cache
-file, and then verified to make sure the blkid cache is correct.
-
-Tune2fs and e2label will accept LABEL=xxx and UID=yyy specifiers for
-the device name, using the blkid library.  (Addresses Debian bugs
-#166048, #179671)
-
-Fsck now supports backslash escapes in /etc/fstab so that \040 can be
-used for spaces in device labels.
-
-Removed 32-bit limitations for debugfs's dump command.
-
-If the user specifies a large number of inodes, Mke2fs will
-automatically adjust the number of blocks per group to find a valid
-set of filesystem parameters.
-
-Add workaround to detect broken MD devices where when some of the
-underlying devices are marked read-only, writes to the MD device are
-silently dropped.  E2fsck will detect if there is an attempt to run
-the journal twice, and abort with an error if this is the case.
-(Addresses IBM Bugzilla bug #1226)
-
-E2fsck will print an error if more than one of the -p/-a, -n or -y
-options are specified.
-
-E2fsck will fix HTREE corruptions in preen mode, without stopping the
-boot process.  This is needed because the 2.4 ext2 filesystem
-accidentally had the INDEX_FL backwards compatibility code removed.
-
-Mke2fs no longer creates filesystems with the dir_index flag set by
-default; the user has to specifically request it.
-
-Update and clarified various man pages. (Addresses Debian bugs
-#173612, #175233, #175113, and #170497, #185945, #188318)
-
-Created man page for the mk_cmds program (from the libss library).
-
-Programmer's notes: 
--------------------
-
-Fix various gcc -Wall nits.
-
-Fixed a lot of portability problems that caused e2fsprogs not to build
-successfully under Solaris and Apple/Darwin.
-
-Fixed a Makefile dependency to allow building e2fsprogs using parallel
-make jobs.
-
-Changes to create a subset distribution which consists only of the
-et, ss, uuid, and blkid libraries.  The configure script and top-level
-makefile were changed to support working with a subset distribution.
-
-Removed EXT2_FEATURE_RO_COMPAT_BTREE_DIR mention of since it's not
-actually used, and might people who are looking for
-EXT2_FEATURE_COMPAT_DIR_INDEX, which is in use.
-
-Updated debian files to fix a number of Lintian warnings.
-
-Updated config.guess and config.sub with newer versions from the FSF.
-
-Removed unnecessary libraries from being linked into the fsck, lsattr, 
-chattr, and blkid executables.
-
-E2fsprogs 1.32 (Nomvember 9, 2002)
-==================================
-
-Fixed a bug in the Unix I/O routines which caused needless writebacks
-of clean blocks from the unix_io cache (they were erroneously marked
-as being dirty, so they were getting written back to disk before
-getting evicted from the disk cache).  This was harmless, but it
-significantly slowed down e2fsck.
-
-Made some other minor optimizations to the Unix I/O routines to save a
-small amount of CPU time.
-
-Updated internationalization files.
-
-
-E2fsprogs 1.31 (Nomvember 8, 2002)
-==================================
-
-Update EVMS ext2fsim plugin with EVMS 1.2.  (We still support
-compiling the fsim plugin with EVMS 1.0 and 1.1.)  Add better error
-handling for child process that die unexpectly.  Add a hack to force
-mkfs to create filesystems that won't cause problems with hardware
-that has 2k or 4k minimum blocksize requirements.  Read from child
-processes in non-blocking mode, so that the GUI continues to update.
-
-Fix e2fsck so that it returns the appropriate exit code when the root
-filesystem has been changed, so that system's rc scripts will be told that 
-the system needs to be rebooted.
-
-Fix a bug in ext2fs_flush/ext2fs_close; when the MASTER_SB_ONLY flag
-was set, some of the descriptor blocks that should have been written
-out were getting skipped.
-
-Changed e2fsck to force out changes to the backup copies of the
-superblock and block group descriptors when important changes are made
-to those data structures.
-
-Fix a bug where e2fsck could erroneously mark a filesystem as being
-clean if a check of dirty filesystem is interrupted with a ^C.  (Bug
-introduced in e2fsprogs 1.28.)
-
-If journal debuging is enabled using --enable-jbd-debug, the debugging
-level is now set via the E2FSCK_JBD_DEBUG environment variable.
-
-If byteswapping support is disabled using configure --disable-swapfs,
-skip the tests which depend on byte-swapping, so that "make check"
-won't bomb out.
-
-Lshattr will now display the indexed directory flag.  Also, some of
-the more esoteric compression flags are supressed unless compression
-support has been enabled.
-
-Update man pages.
-
-
-E2fsprogs 1.30 (October 31, 2002)
-=================================
-
-When resizing a filesystem, and inodes need to moved, resize2fs will
-update the inode's ctime field, and the mtime field of the containing
-directories, so that incremental backups using dump/restore will work
-correctly.
-
-In order to avoid spurious errors, e2fsck wil check the last
-superblock write time to determine whether or not it can safely use
-the LOW_DTIME checks to determine if there are inodes on the orphan
-inode linked list that had somehow gotten disconnected.  (Addresses
-Sourceforge bug #620980)
-
-Partition in /proc/partitions that being with the string "lvm" are
-considered real partitions even if they do not end with a number.
-
-Fixed a bug in the the uuid generation function, where if /dev/urandom
-is not present, but /dev/random is, and there isn't sufficient
-entropy, the get_random_byte function could spin a loop forever.
-
-E2fsck, mke2fs, etc. will now reliably notice when image files are
-mounted using the loopback interface.  (Addresses Sourceforge bug
-#619119)
-
-When flushing buffers (as is done by badblocks, for example) check to
-see if the BLKFLSBUF ioctl succeeds, and if so, avoid using the
-FDFLUSH ioctl which causes the MD device driver which causes confusing
-syslog messages about obselete ioctl messages.  (Addresses Sourceforge
-bug #545832).
-
-Debugfs's write command now checks to see if the destination filename
-exists before creating it.  (Addresses Sourceforge bug #478195.)
-
-When installing man pages, search for compressed man pages using all
-commonly used compression extensions (i.e., .Z, .gz, .bz2, etc.)
-
-Fixed a bug in fsck where multiple filesystems specified on the
-command were not being checked in parallel due to a logic bug
-introduced to support the FSCK_MAX_INST environment variable.
-
-We have added a new superblock field, s_mkfs_time, which indicates
-when a filesystem was created.  It is set via mke2fs, and printed out
-by dumpe2fs, but is not actually touched by the kernel.
-
-Dumpe2fs has been made more robust by not aborting if there is an
-error reading the block/inode bitmaps; instead it will still print out
-the location of the block/inode bitmaps and inode table.
-
-Add support for the an alternative block group descriptor layout which
-allows for on-line resizing without needing to prepare the filesystem
-in advance.  (This is the incomat feature flag meta_bg.)
-
-Add support for storing default mount options in the superblock, so
-that the filesystem can be mounted with specific mount options without
-needing to specify them on the mount command line or in the /etc/fstab
-file.
-
-Add support for a new inode flag, which is to be used for indicating
-the top of directory hierarchies for the Orlov block allocator.
-
-Fix e2fsck so that if it creates the lost+found directory, it does so
-with the more apporpriate permissions of 0700.  Also change
-mklost+found so that it also creates the directory 0700.
-
-Fixed format bug in e2fsck if NLS is in use.
-  
-Add a German translation for e2fsprogs's NLS support.
-
-Fixed e2fsck so that it more handles BAD_BLOCK_IN_INODE_TABLE even at
-the beginning of the inode table.  This won't matter much, since if
-there is a bad block at the beginning of the inode table, the root
-directory won't be available.  But at least e2fsck won't crash in this
-case.
-
-Fixed endian problems in the htree code for e2fsck and debugfs.
-  
-When byte-swapping a filesystem on a PPC architecture, byte-swap the
-bitmaps since the historical big-endian ext2 variant had byte-swapped
-bitmaps, and the ext2fs library assumes this.  This fixes the
-regression test suite on PPC machines.
-
-Fix e2image so that it handles a bad block in the inode table
-appropriately.
-
-E2fsck now uses a more sophisticated algorithm to salvage corrupted
-directories that recovers more information in the corrupted directory
-block.
-
-E2fsck now performs additional consistency checks on indexed (HTREE)
-directories.
-
-Fix bug where efsck might get confused about whether a completely
-empty directory block is an empty leaf block or an interior htree
-node.  This could cause e2fsck to get confused into think that a valid
-indexed directory was corrupted.
-
-E2fsck no longer creates an empty directory entry at the end of a
-directory block when optimizing a directory.  This would cause some
-earlier versions of the dxdir kernel code to corrupt the directory
-when attempting to split a node containing an empty directory entry.
-
-E2fsck could sometimes in rare circumstances leave the indexed flag
-set after a small directory was optimized by compressing it instead of
-indexing it.  (This should never happen in real life, since
-directories that small wouldn't have been indexed, but better safe
-than sorry.)
-
-E2fsck now only updates the master superblock in all cases.  This
-slightly shortens its run time.
-
-Ext2ed can deal with directory entries of length 0; previously it
-would get stuck in an infinite loop.
-
-Fsck now has support for reiserfs volumes when parsing LABEL= and UUID=
-specifiers.  (Sourceforge patch #613447)
-
-Badblocks will now work correctly on read-only devices such as
-CD-ROM's.  (Sourceforge patch #600451)
-
-Updated and clarified man pages.  (Addresses Debian bug #167108)
-
-
-E2fsprogs 1.29 (September 24, 2002)
-===================================
-
-Fixed a bug in e2fsck which could corrupt a directory when optimizing
-it (via the -D option) or rebuiliding the hash tree index with a 1 in
-512 probability, due to a fence post error.
-
-Fixed a bug in the LVM support code which caused LABEL='xxx' not to
-work correctly.
-
-Mke2fs now enables the directory indexing flag by default.  (Since
-this is a compatible feature flag, it's safe to do so.)
-
-Tune2fs will support setting the directory indexing feature flag.  It
-will automatically set up the default hash algorithm and hash seed
-fields in the superblock.
-
-If the bone-headed user enters the root filesystem twice in
-/etc/fstab, the -R option which skips the root filesystem will skip
-all of them.  (Addresses Debian bug #159423).  Note!  This is not a
-precedent for dealing intelligently with any other kind of doubled
-entry in /etc/fstab!
-
-
-Programmer's notes: 
--------------------
-
-Removed perror declaration in lib/et/internal.h.  All modern systems
-can be expected to define perror() these days.  Besides, the lib/et
-code wasn't using perror at all anyway.  :-)
-
-
-E2fsprogs 1.28 (August 31, 2002)
-================================
-
-Add support for the Hashed-Tree Directory Indexing to e2fsck.  Support
-for setting the htree flag is not included yet, although it can be
-manually turned on via the debugfs program.
-
-Clarified e2fsck error message which is printed when it cannot find
-sufficient contiguous block when relcating filesystem metadata.
-
-Added support for building an EVMS plugin module for ext2/3.  This
-module is substantially the same as the EVMS module shipping with EVMS
-1.1, with one or two bugfixes.  E2fsprogs can also build this plugin
-for use with EVMS 1.0 (which did not include the ext2 plugin module),
-if the configure --enable-old-evms flag is given.
-
-Fsck will search through EVMS volumes when trying to resolve
-filesystem specifications such as LABEL=xxx or UUID=xxx.
-  
-Added a new utility program, /sbin/findfs, which will return
-filesystem specifications such as LABEL=xxx or UUID=xxx, and prints
-the device name.
-
-Update and clarified various man pages. (addresses Debian Bug #145044,
-#146437, #131350, #151990, #144621, #141938)
-
-If there are no filesystems specified on fsck's command line, fsck now
-treat that as if the -As options were given.  Previously it would
-simply do nothing.  (Addresses Debian Bug #153102)
-
-Mke2fs no longer treats a failure to be able to clear the MD signature
-at the end of the filesystem as a fatal error.  (Addresses Debian Bug
-#155007)
-
-The e2p library functions (which are used by lsattr and chattr) now
-double check to make sure the file is a regular file or directory
-before attempting to use the ext2 ioctls.  Some device drivers
-unfortunately respond to the ext2 ioctl's with unknown behaviour.
-(Addresses Debian Bug #152029).
-
-The extended attribute handling has been updated to correspond with
-the latest V2 bestbits ACL code.
-
-Fixed bug in e2fsck which caused it to not clear the dtime field when
-processing truncated inodes on the orphan list.  This could cause data
-loss(!) if a filesystem is rebooted before a truncate has been
-committed.
-
-E2fsck now uses red/black trees in pass1b, which removes some O(n**2)
-algorithms.  This makes e2fsck much faster in the case of severely
-corrupted filesystems where a large number of blocks are claimed by a
-large number of inodes.  (Thanks to the 2.5 IDE device driver for
-inspiring this work.)
-
-Resize2fs has been significantly sped up when shrinking and expanding
-a filesystem by a very small number of blocks (for example, when EVMS
-is converting a partition to be an EVMS legacy volume).
-
-Added a new option to e2fsck, -D, which will optimize or compress all
-of the directories in the filesystem.
-
-E2fsck now catches SIGINT and SIGTERM to make sure it will can
-properly clean up and only exit at safe points.  Fsck will pass
-SIGINT/SIGTERM to its child processes, and wait until they have all
-exited before it exits.
-
-The uuid parsing code in the uuid library now properly complains when
-an illegally formated uuid is presented to it.  (Addresses Debian bug
-#152891)
-
-Restrict use of the 2.4 setrlimit ABI f*ckup to kernels between 2.4.10
-and 2.4.17, since the workaround can cause problems when using a 2.4
-kernel with an old version of glibc built with the 2.2 headers.
-
-Fixed a bug in mke2fs where it wasn't properly clearing the initial
-superblock used by other filesystems.  (Addresses Debian bug #147256.)
-
-Added support for the synchronous directory feature written by Andrew
-Morton.
-
-The debugfs program can delete directories using the rmdir command.
-
-Add support for 8k and 16k filesystems (for systems with page sizes
-that are greater or equal to 8k or 16k, respectively).  Note that
-these filesystems can not be mounted on x86 systems, or other systems
-with only 4k page sizes, due to limitations in the current Linux VM
-code.
-
-Resize2fs requires that the filesystem state be valid and have no
-errors; otherwise, e2fsck -f must be run first.  (Previously it simply
-required that the last fsck time be greater than the last mount time.)
-
-Configure now defaults the man pages directory to /usr/share/man on
-Linux systems.
-
-E2fsck now offers to truncate inodes which contain too many blocks (so
-that i_blocks would overflow.  Also fixed handling of large sparse
-files.
-
-E2fsck now more completely checks for symlink validity, including
-requiring NULL termination and length checks.
-
-E2fsck will offer to try forcing a disk write to remap a bad block
-after finding a read error when reading a filesystem metadata block.
-
-Fixed a bug in debugfs which caused the -b and -s options to crash
-debugfs, as well as breaking the testb, setb, and clearb functions.
-
-Added a bmap command to debugfs which calculates the logical to
-physical block mapping for a particular inode.
-
-Fixed a bug in code which checked to see if a device was mounted which
-sometimes (rarely) failed in the case of a plain file.
-
-Fixed a bug in resize2fs where when it reported an error, it would
-print a message erroneously indicating that the filesystem had been
-resized before it aborted.
-
-When resizing a plain file which is smaller than the requested size,
-resize2fs will attempt to extended the file so that programs like
-e2fsck will not complain that the file is too small.
-
-Resize2fs will print the actual new size of the filesystem when it is
-finished resizing.
-
-Fixed a bug in debugfs where "ls -l" would report incorrectl file type
-information on big-endian systems.
-
-
-Programmer's notes:
--------------------
-
-Fixed collisions with C++ reserved words.
-
-Added portability fixes for building e2fsprogs on the HURD and AIX.
-
-Added the ext2ed program for creation of test cases.  (ext2ed has many
-limitations and bugs which make it unsuitable for production use.)
-
-The ext2fs_read_dir_block2 and ext2fs_write_dir_block now take a new
-flag, EXT2_DIRBLOCK_V2_STRUCT, which will will reverse when the
-name_len field is byte swampped on big-endian machines, since in the
-V2 structure, name_len is a char field which is doesn't need to be
-byte swapped --- except if an old-style kernel had byte-swapped the
-name_len field as part of the V1 structure.
-  
-
-E2fsprogs 1.27 (March 8, 2002)
-==============================
-
-The warning messages for mke2fs now go to standard error.
-
-Fixed to make sure "make check" runs all of the test programs with
-LD_LIBRARY_PATH set, so that we test the libraries in the build tree.
-
-The mke2fs program checks the boot sector for the BSD disk label, and
-avoids erasing it if it is there.
-
-Fixed a bug in e2fsck which caused it to core dump if the journal
-inode was missing when it was supposed to be there.
-
-E2fsck now prints ranges in pass 5 when printing deltas for the block
-and inode bitmaps.
-
-Debugfs's "ls -l" command now will print out the file type information
-in the directory entry.
-
-Create man pages and hard links for fsck.ext3 and mkfs.ext3.  If
-mke2fs is invoked as mkfs.ext3, create the filesystem with a journal.
-
-Debugfs can now examine the experimental directory indexing
-information.
-
-Fixed bug in debugfs which caused it to core dump if modify_inode is
-called without an open filesystem.
-
-The debugfs lsdel command now runs its output through a pager first.
-
-When installing manual pages, remove the compressed manual pages first.
-
-Synchronized with Debian's packaging information for e2fsprogs-1.26-1.
-
-Fix the 2.4 resource limitation workaround introduced in 1.26 which
-actually broke things on mips32, sparc32, and Alpha platforms.
-
-Updated the I18N code so that calls to setlocate(LC_CTYPE, 0) are made
-(which is required by the newer libintl libraries).
-
-Programmer's notes:
--------------------
-
-Fixed various gcc -Wall complaints.
-
-Fixed a few memory leaks in the e2fsck journaling code, and in the
-ismounted code checking for a swap device.
-
-Add new inode I/O abstraction interface which exports an inode as
-an I/O object.
-  
-Exported ext2_file_flush as a public interface.
-  
-In ext2_file_write, we now mark the buffer void * argument as a const, since ext2_file_write doesn't modify the buffer.
-
-Lots of small random portability fixes to make e2fsprogs build under
-AIX --- even without the 5L compatibility toolkit, and even using the
-uber-crippled AIX native C compiler.
-
-
-E2fsprogs 1.26 (February 3, 2002)
-=================================
-
-Dumpe2fs will keep going now if the bad block inode can't be read.
-(Previously it stopped with a fatal error.)
-
-E2fsck will now give an opportunity to run the journal even if the
-recovery flag is not set.  This is the default behaviour if e2fsck is
-using a backup superblock, since the needs_recovery flag will never be
-set in the backup superblock copies.
-
-E2fsck now automatically finds the backup superblock/group descriptors
-even when the primary superblock is completely destroyed for 2k and 4k
-filesystems.  (Previously it just guessed/assumed that we were dealing
-with a 1k filesystem in that case, and users had to manually specify
-the backup superblock number.)
-
-Fixed a bug in e2fsck where it dereferences a null pointer when there
-is a problem opening a filesystem in preen mode.
-
-E2fsck now handles external journals correctly; previously it trashed
-the external journal device if the journal needed to be replayed.
-
-Work around ulimit incompatibility problem caused by recent 2.4
-kernels; the unix IO module will automatically try to set any resource
-limits to be infinite on startup.
-
-Fixed a bug in e2fsck where it wasn't allocating a new block or inode
-bitmap if it wasn't present and the blocksize was 2k or 4k.
- (Addresses Debian Bug #116975)
-
-E2fsck will check and fix botched ext3 V1 to V2 superblock updates by
-clearing the new V2 fields if they do not make sense or if the ext3
-superblock is version 1 superblock.
-
-E2fsck will automatically relocate the ext3 journal from a visible
-file (i.e., /.journal) to an hidden inode if the filesystem has been
-opened read/write.  This allows the users to add a journal while the
-filesystem is mounted, but the next time the system is rebooted, the
-journal file will disappear.  This avoids problems with backups,
-stupid operators with superuser bits, etc.
-
-Fix a bug in fsck where it would not support a filesystem type of
-"auto" if the device was specified in terms of LABEL=xxx or UUID=xxx.
-
-Fsck now supports fstab entries of the form "ext3,ext2".  It will also
-automatically identify reiserfs filesystems.
-
-The number of processes spawned by fsck can now be limited using the
-FSCK_MAX_INST environment variable.
-
-Fsck now searchs the LVM proc hierarchy to find logical volumes which
-should be searched for  UUID and label information.
-
-Work around a bug in 2.4.10+ kernels by trying to unset the filesize
-limit if at all possible, when opening a block device.  (The filesize
-limit shouldn't be applied against writes to a block device.)
-
-In mke2fs and e2fsck, specifying the -c option twice will now do
-a read/write test on the disk.  Update the man pages to encourage
-using the -c option, and to discouraging running badblocks separately,
-since users tend to forget to set the blocksize when running 
-badblocks.
-
-Mke2fs now automatically clears the immutable attribute on a
-pre-existing .journal file left over from a previous failed attempt to
-add a journal to an alreadyy-mounted filesystem.
-
-Fixed mke2fs's exit codes to consistently indicate when the mke2fs
-operation failed.
-
-Mke2fs now creates the lost+found directory with permissions of 0700,
-so that files that had previously lived in protected directory are
-safe if they get dropped in lost+found and the system administrator
-doesn't deal with immediately.  (Addresses Debian #bug 118443)
-
-Mke2fs and e2fsck (and all programs that use the
-ext2fs_check_if_mounted function) will now properly identify that a
-device is mounted, even in cases where devfs has confused things with
-multiple devices names with the same identity, or if a dim-witted
-system administrator has done something stupid like creating device
-file aliases in their home directory.  Also now checks for swap devices
-by using /proc/swaps.  (Addresses Debian bug #106622)
-
-Added a new option (-T) to tune2fs which sets the time a filesystem
-was last checked.
-
-Speed up e2image when creating sparse raw image files by optimizing
-away excess lseek() system calls.
-
-Fix support of large (> 2GB) files when used as a filesystem in
-mke2fs, tune2fs, debugfs, and findsuper.
-
-Debugfs's stat and icheck commands now properly deals with large (>
-2GB) files.
-
-Debugfs's set_super_value command now prints out the list of valid
-superblock fields which can be set using the command.
-
-Debugfs's rm and kill_file command now updates the superblock free block
-and inode counts, thus keeping the filesystem consistent.
-
-Debugfs's lsdel command now takes an optional argument which allows
-the user to only see the most recently deleted files.
-
-A new command (undel) was added to debugfs which automates
-undeleting a deleted inode and linking it back to a directory.
-
-Debugfs's ls command now takes a new option, -d, which lists 
-deleted directory entries.
-
-Debugfs's testb, freeb, setb, and find_free_block commands now take an
-optional count argument.
-
-Add support for a new ext2 file attribute, EXT2_NOTAIL_FL, which will
-be used to signal that a particular inode should not be eligible for
-tail-merging --- this is needed for programs like LILO.
-
-The findsuper (an unreleased, uninstalled utility program) has been
-improved to add extra validity checks and to add a progress meter.
-(It is still an unsupported program; the officially supported way to
-recover from a trashed partition table is to use gpart; findsuper is
-for wizards only.  :-)
-
-Debugfs was fixed to compile with "configure --disable-swapfs".
-
-Cleaned up various manual pages.   (Addresses Debian bug #119624, #120171)
-
-Added new translation file for Turkish.
-
-Programmer's notes:
--------------------
-
-Fix general gcc -Wall complaints.
-
-E2fsprogs (mostly) works with the dietlibc.
-
-The programming texinfo file has been expanded to include description
-of additional libext2fs functions.  (Still not compeltely done, but a
-lot of the more important functions have been documented.)
-
-Added a umask structure to struct_ext2_filsys, which currently only
-modifies the behaviour of ext2fs_mkdir(), but if we add any file
-creation functions to libext2fs, we should also make sure they respect
-the umask setting.
-
-The build-rpm script was fixed to be a bit more safe.
-
-The tests' Makefile now has a way of automating test case creation 
-for e2fsck, using "make testnew".
-
-Created a new function, ext2fs_dir_iterate2 which passes more
-information to the callback function (identical to the one used by
-ext2fs_dblist_dir_iterate).  The directory iterator functions take a
-new flag, DIRENT_FLAG_INCLUDE_REMOVED, which will return deleted
-directory entries.  If the directory entry is deleted, the callback
-function will be called with the entry paraemter set to
-DIRENT_DELETED_FILE.
-  
-Added new functions, ext2fs_inode_alloc_stats and
-ext2fs_block_alloc_stats, which takes updates block/inode allocation
-statistics in the bitmaps, block group descriptors, and superblock
-when inodes or blocks are allocated or deallocated.
-
-
-E2fsprogs 1.25 (September 20, 2001)
-===================================
-
-This is primarily a bug-fix release; no new features were added, but
-there are a number of embarassing bug fixes and cleanups applied.
-
-Fix a bug mke2fs which causes stack garbage to be written to disk when
-zapping disk sectors.  (This bug could cause mke2fs to core dump for
-some kernels, I suspect with security enhancement patches.)
-
-Remove unneeded #include of <linux/config.h> which was breaking
-building e2fsprogs on the Hurd.  (Addresses Debian bug #112414.)
-
-Updated tune2fs man page to reflect the fact that adding or removing a
-journal doesn't require running e2fsck.
-
-Remove use of AC_REQUIRE from autoconf which had been used to prevent
-AC_CANONICAL_HOST from being called twice; unfortunately this causes
-recent autoconf to bomb out since they don't allow AC_REQUIRE to be
-used outside of autoconf macros.  Fortunately, it doesn't seem to be
-necessary any more, anyway.
-
-E2fsck will now not fall back to an alternate superblock if the user
-specifies the superblock location explicitly on the command-line.
-This allows easier recovery from a situation where the primary
-superblock and block groups are slightly corrupted, but the backup
-superblocks are completely broken.  
-
-Fix problem which caused compile_et and mk_cmds to blow up if
-e2fsprogs was in a directory with a pathname that contained spaces.
-
-We are now more paranoid about checking the entry in /etc/mtab to make
-sure the filesystem is really mounted, since some broken distributions
-(read: Slackware) don't initialize /etc/mtab before checking non-root
-filesystems.  (Slackware also doesn't check the root filesystem
-separately, and reboot if the root filesystem had changes applied to
-it, which is dangerous and broken, but there's nothing I can do about
-that.)
-
-Make UUID library C++ friendly by adding appropriate extern "C"
-declarations and using const in the function declarations.
-
-Fix up the com_err texinfo file so that it can product a valid info
-file (previously, it could only be used to generate paper
-documentation using texinfo.tex).
-
-
-E2fsprogs 1.24a (September 2, 2001)
-===================================
-
-Fix brown-paper bug in mke2fs which caused it to segfault when
-printing the version string.
-
-
-E2fsprogs 1.24 (August 30, 2001)
-================================
-
-Revert the BLKGETSIZE64 support, since for some distributions, this
-ioctl has been used by an unofficial kernel patch to update the last
-sector on the disk, and this was causing disk corruption problems as a
-result.
-
-Mke2fs is now more careful about zapping swap space signatures and
-other filesystem/raid superblock magic values so that programs like
-mount who try to use hueristics to determine the filesystem type of a
-partition are less likely to be confused.
-
-E2fsck will no longer complain if the the mode of EXT2_RESIZE_INO is a
-regular file (since Andreas Dilger's on-line resizing tools will set
-its mode bits).
-
-Fixed some minor texinfo, man pages nits for spelling errors,
-texinfo warnings, etc.  (Addresses Debian bug #110621.)
-
-E2fsprogs program no longer print the filesystem version number
-(i.e. 0.5b), since it only confuses people and doesn't serve any real
-purpose.
-
-E2fsck will once again compile under libc5, since it will supply its
-own version of strnlen if necesssary.
-
-mke2fs and tune2fs will allow the use of UUID= or LABEL= specifiers
-when specifying the external journal device.  tune2fs will also search
-devices looking for the externla journal debice when removing.  
-
-E2fsprogs 1.23 (August 15, 2001)
-================================
-
-Add initial support for extended attributes (EA); e2fsck will
-correctly handle a filesystem with EA's and check the EA blocks for
-corruptions.
-
-E2fsck's symlink sanity checking has been cleaned up.  It now checks
-the i_size value of fast symlinks, and checks for immutable flags
-being set of symlinks, etc.
-
-E2fsck now offers to clear inodes which are special files that have a
-non-zero i_blocks or i_size field.  (The i_size field check was in the
-previous version of the code, but due to a bug it didn't offer to
-clear the inode unless i_size and i_size_high were both non-zero.)
-
-E2image can now create "raw" image files, which only contain the
-filesystem metadata placed in a spare file so that e2fsck, dumpe2fs,
-debugfs, etc., can be run directly on the raw image file.
-
-Add support for the 64-bit block device patches.
-
-Fixed bugs in creating external journals with a 1k blocksize.
-
-Add initial support for external journals (so long as the external
-journal only supports a single filesystem) in e2fsck.
-
-Remove requirement for needing to run fsck on a filesystem after
-removing a journal (either internal or external).
-
-The man pages now document how to create and manage external journals.
-
-Speed up the check of an ext3 filesystems by avoiding a needless flush
-of all of the superblock and block group descriptors.
-
-Speed up creating an internal journal using tune2fs in the case where
-the filesystem has a lot blocks already allocated.
-
-Tune2fs has been fixed to make sure that only error messages go to
-stderr, and normal message go to stdout. (Addresses Debian bug #108555)
-
-Fixed a minor bug in mke2fs; if -O none is passed to mke2fs, it will
-now not set the sparse_super feature.  (Addresses Debian bug #108165)
-
-Add support in fsck for the filesystem type "auto".
-
-Fsck -A will not try to interpret device names for filesystems which
-have a pass number is 0.  (Addresses Debian bug #106696).
-
-Fsck prints a warning message if now valid filesystems are passed to
-it.  (Addresses Debian Bug #107458.)
-
-E2fsck now gives an explicit warning if there filesystem still has
-errors at the end of the run. (Addresses Debian bug #104502)
-
-E2fsck will set the EXT2_ERROR_FS flag if the journal superblock
-reflects an error.  E2fsck will also not run the orphan list if the
-filesystem contains errors, since the orphan list might be corrupted.
-
-E2fsck now prints the number of large files when given the -v option.
-
-Fixed minor memory leaks in e2fsck.
-
-Some minor man pages updates. (Addresses Debian bug #30833, #108174)
-
-
-E2fsprogs 1.22 (June 22, 2001)
-==============================
-
-Fixed a bug in e2fsck's handling of orphan inodes which are special
-files (i.e., block/character device files, named FIFO's, etc.).
-
-Fixed a bug accidentally introduced in e2fsprogs 1.21 which caused
-tune2fs to fail at adding a journal to a mounted filesystem.
-
-Fixed a few big-endian bugs in e2fsprogs
-	* The directory block functions were accidentally reporting
-		some directories as corrupted when they weren't.
-	* If e2fsprogs is compiled --disable-swapfs, the C language 
-		equivalents weren't being included for big-endian platforms.
-		(Fixes Debian bug #101686).
-
-Fixed a Hurd compilation problem.  (Addresses Debian bug #101361)
-
-Programmer's notes:
--------------------
-
-Use platform independent method of defining the BLKFLSBUF and FDFLUSH
-ioctls, and allow them to be defined for non-i386 platforms.
-
-The uuid.h header file is now protected against multiple inclusions.
-
-E2fsprogs is now being developed using BitKeeper.  Changed the test
-scripts to deal with BK's stripping CR characgters from text files,
-and changed the top-level Makefile.in to avoid including BitKeeper
-files when generating the source tarball.
-
-
-E2fsprogs 1.21 (June 15, 2001)
-==============================
-
-Added new configure flags which allow a subset e2fsprogs to be built;
-this is most useful for boot floopies, since the resulting shared
-libraries and programs are slimmed down by removing features that
-aren't necessary for a boot floppy.  The new flags that were added
-are: --disable-swapfs, which removes support for byte swapping old
-legacy PPC/68k filesystems, --disable-debugfs, which removes support
-for debugfs from the libext2fs library, --disable-imager, which
-removes support for the e2image program, and --disable-resizer, which
-removes support for resize2fs.
-
-E2fsck now prints the number of mounts or days elapsed since the last
-check when e2fsck is forced to check an otherwise clean filesystem.
-
-Tune2fs now prints an informative message about how often a filesystem
-will be checked when adding a journal to the filesystem, to remind the
-user that he/she may want to adjust those parameters using tune2fs
--c/-i.
-
-Worked around hurd brain-damage which causes e2fsck to sometimes
-believe a filesystem is the root filesystem based on device numbers
-(since Hurd doesn't have dev_t's, which is arguably a POSIX.1
-violation).
-
-Fixed a bug introduced in 1.20 which caused e2fsck to abort with an
-erroneous error with the -F option was specified.
-
-Fixed a ext3 recovery bug in the revoke handling; synchronized with
-ext3 0.7a.
-
-Fixed two bugs in e2fsck's handling of dup block handling, dealing
-with relatively uncommon edge cases: a directory with an indirect
-block which is claimed by another file, and when the last inode in the
-filesystem has blocks claimed by another file.
-
-E2fsck now checks to see if the i_size field of a fast symlink is too
-big, and offers to clear the symlink if so.
-
-E2fsck now checks to see if i_size_high of special files is non-zero,
-and offers to clear i_size_high.
-
-Fix e2fsck's handling of incompatible journal flags so that the user
-has chance to abort, and then has the option to clear out the journal
-entirely.  (Addresses Debian bug #98527.)
-
-Fixed a bug in fsck which could cause it to core dump if a mix of
-standard and non-standard device names are used in /etc/fstab.
-(Debian bug #100559)
-
-Fixed a bug in debugfs which caused read errors when copying a file to
-not be noticed.
-
-The debugfs set_super_value command can now modify the s_lastcheck field.
-
-Fixed a bug in lsattr and chattr which was accidentally introduced in
-1.20 to support > 2GB files; both lsattr and chattr wasn't reading
-directories correctly because the change modified the layout of struct
-dirent to be incompatible with the libe2p shared library.
-
-Cleaned up the mke2fs manual page and included a discussion about why
-it's good to periodically check the filesystem even when journaling is
-enabled.
-
-Programmer's notes:
--------------------
-
-Fix general gcc -Wall complaints.
-
-The types needed by the ext2 header files are now provided by
-lib/ext2fs/ext2_types.h, instead of include/asm/types.h.
-
-Integers are now preferred to longs when trying to find a 32-bit type
-in ext2_types.h.  Also, if linux/types.h has already been defined,
-don't try to redefine the types.
-
-Fixed make depend script so that it automatically corrects the
-pathname cleanups performed by make -M, so I don't have to fix them up
-by hand.
-
-Fixed the d_loaddump test case to be more robust, and not depend on
-bash'isms.
-
-Removed debugfs's dependence on pread(), which was accidentally
-intrudced in e2fsprogs 1.20
-
-Fixed a performance bug in the libext2fs's icount routine; the size
-estimate of the icount array was incorrectly being calculated.
-
-Removed use of the badblocks compatibility functions in the e2fsprogs
-programs.
-
-Added paranoia code which protects against strange cases where /etc
-isn't on the root filesystem, or if /etc/mtab doesn't exist.
-
-The header file ext2_types.h is now installed.
-
-Autoconf is used to determine when we are on big-endian machines,
-instead of doing run-time tests, to save a few bytes of code.
-
-The ext2fs_mark_generic_bitmap and ext2fs_unmark_generic_bitmap
-functions are no longer inline functions, which saves space and
-doesn't really cost any real performance.
-
-The ext2fs library no longer depends on the e2p library.  (What need
-there was of it --- namely, fsetflags, was coded in-line).
-
-Fixed the makefile so that lib/ext2fs/ext2_types.h is generated even
-when the user is stupid and tries compiling the package using "make
-install" as root.
-
-Miscellaneous code cleanups:
-	* Added missing files from Makefile.in's SRCS file, so that 
-		their dependencies would be properly calculated.
-	* Removed redundant code
-	* Fixed comments in code
-	* Removed no-longer unneeded argsused #pragma.
-
-
-E2fsprogs 1.20 (May 20, 2001)
-=============================
-
-Add support for replaying the ext3 journal purely in user mode,
-including handling the orphaned inode list.  Used code contributed by
-Andreas Dilger, with bug fixes and the orphaned inode handling done
-by Theodore Ts'o.
-
-The mke2fs and tune2fs programs can create or modify a filesystem to
-include an ext3 journal.  Tune2fs also can be used to remove an ext3
-journal from a filesystem.
-
-E2fsck will now check for the existence of a linked list of orphan
-inodes in the superblock, and clear those inodes before starting the
-rest of the filesystem check (but after the journal playback).
-
-E2fsck now validates the file descriptor passed to the -C option,
-which saves against the completion bar getting written to an
-unexpected location, such as the disk being checked.  (Debian
-bug/wishlist #55220)
-
-E2fsck will now bump the filesystem revision number from zero to one
-if any of the compatibility bits are set.
-
-Fixed a bug where a badly corrupted directory on a big endian system
-could cause e2fsck to die with a bus error.  The
-ext2fs_read_dir_block() and ext2fs_process_dir_block() functions in
-the ext2 library now does alignment sanity checks on the rec_len field
-of the directory entry before using it.
-
-The ext2 library has been enhanced to make tune2fs safe to run on
-mounted filesystems.  (Users could usually get away with using tune2fs
-on mounted filesystems before, but with the advent of ext3 and
-journaling, it became important to make tune2fs was *really* safe for
-use even when the filesystem being modified is mounted.)  E2label is
-now implemented by tune2fs using an argv[0] dispatch, so that e2label
-is also now safe for use on mounted filesystems.
-
-Added a new program, e2image, which creates a backup of critical ext2
-filesystem data structures.  The generated image file can be examined
-using dumpe2fs and debugfs.  In the future, e2fsck will be able to use
-the image file to help recover very badly damaged filesystems.
-
-Fixed a number of LFS bugs in e2fsck; very, very large (> 2**42) files
-no longer cause e2fsck to bomb out.  Also treat files > 2GB as being
-large file when deciding whether or not the filesystem has large files.
-
-Fixed lsattr and chattr so that they work correctly on large files.
-(Fixes Debian bug #72690.)
-
-Removed limitation in get_device_size() which imposed a one terrabyte
-filesystem limitation.  (Most 2.2 kernels still have a signed int
-problem which cause 1 TB block device limitation.  Fortunately, the
-kernel patches to fix this are much easier than fixing the 2TB
-limitation in the kernel.  :-)
-
-A max_mount_count of zero is now treated as if no mount count were
-set.  (Previously, no mount count was indicated by using -1, and a
-mount count of zero caused e2fsck to always be run.)
-
-Mke2fs supports two new filesystem types largefile and largefile4.
-
-Mke2fs now adds some randomness in s_max_mount_count so that multiple
-filesystems won't be all checked at the same time under normal
-operations.
-
-Fixed bug in the progress bar printing code which could cause e2fsck
-to core dump on an illegal filesystem.
-
-Fixed bug in fsck which could allow more than one instance of e2fsck
-to be printing a progress bar.  (Debian bug #65267)
-
-Fsck using a UUID or a LABEL specifier will work even if devfs is
-compiled into the kernel and not mounted.  If the pathnames in
-/proc/partitions are incorrect, fsck will search /dev for the correct
-device (using the new ext2fs_find_block_device library function).
-Fsck now also checks the RAID devices first so that they are properly
-found when they are in use.  Support has also been added to support
-additional IDE disks and the DAC 960 device names.  (Debian bug #94159)
-
-Fixed a bug in fsck which caused it not deal properly with 16
-byte long filesystem labels.
-
-Fsck's -t option has been made a lot more flexible.  The semantics for
-what happens if a comma-separated list to fsck has been regularized,
-and it is now possible to filter what filesystems will get checked
-based what is in the filesystem's fstab entry's option field.  (Debian
-bug #89483.)
-
-The dumpe2fs program can now print out the group description
-information in hex, and also prints the location of the superblock and
-block group descriptor for those block groups that have them.
-
-Mke2fs now clears the ext2 superblock before it starts creating a
-filesystem, so that the superblock magic number is only written if the
-filesystem creation process successfully completes.
-
-The debugfs program's stat command now pretty-prints the blocks used
-by an inode so that it's more compact and informative.
-
-The debugfs stats command now uses the same libe2p code (which is used
-by dumpe2fs) to print the superblock header information.  This is more
-complete, and it avoids a bit of code duplication.
-
-Added a new debugfs command, set_super_value (ssv) which allows the
-user to set arbitrary superblock fields.
-
-Debugfs was extended to support inode numbers in hex (by prefixing
-them with 0x), and so that modify_inode can set the inode generation
-number.  Also, there is now a new function command called logdump
-which will dump an ext3 journal.
-
-Fixed a bug in debugfs so that quitting out of the pager doesn't kill
-debugfs.
-
-Debugfs's dump command now stops immediately upon reporting a disk
-read error.  (Fixed a bug in ext2fs_file_read library routine which
-caused debugfs not to stop.)  (Debian bug #79163)
-
-On systems with /proc/mounts (mainly Linux systems), /proc/mounts is
-checked before /etc/mtab is used, since /proc/mounts is more likely to
-be accurate.
-
-Added portability fixes for Solaris and Linux/ia64.
-
-Various manual pages were clarified and cleaned up.  (Fixed debian
-bugs #63442, #67446, and #87216)
-
-
-Programmer's notes:
--------------------
-
-The e2fsck message printer now supports %Iu and %Ig, which will print
-out the inode's user and group owners, respectively.
-
-E2fsprogs now includes its own version of include/linux/ext2_fs.h, so
-that no longer dependent on the system having the correct version of
-the kernel header files.
-
-Added a new function to libext2, ext2fs_find_block_device(), which
-searches the system (i.e., /dev, /devfs, /devices) for a pathname to a
-device given its device number.
-
-Added a new function to libext2, ext2fs_sync_device, which centralizes
-all of the places which might try to use the BLKFLSBUF or FDFLUSH
-ioctls (and usually failing to define them since the system header
-files don't usually do this for us, and we're trying to avoid usage of
-kernel include files now).
-
-Added new utility programs in tests/progs: random_exercise and
-hold_inode.  They aren't built by default; they're useful for
-exercising ext3 filesystem code.
-
-Added a new ext2 filesystem flag, EXT2_FLAG_SUPER_ONLY, which causes
-the filesystem close functions to only update the superblock, and to
-not touch the block group descriptors.  Needed by tune2fs when
-modifying a mounted filesystem.
-
-Got rid of struct ext2fs_sb and replaced it with the standard struct
-ext2_super_block from include/linux/ext2_fs.h.  Note: this may break
-source (but not binary) compatibility of some users of the ext2
-library.  Those applications should just simply do a global search and
-replace of struct ext2fs_sb with struct ext2_super_block, and include
-the new header file <ext2fs/ext2_fs.h> which defines it.
-
-The ino_t type has been renamed ext2_ino_t to protect applications
-that attempt to compile -D_FILE_OFFSET_BITS=64, since this
-inexplicably changes ino_t(!?).  So we use ext2_ino_t to avoid an
-unexpected ABI change.
-
-The Makefiles have been reworked so that "make check" can be run from
-the top-level Makefile.
-
-Fix general gcc -Wall complaints and removed dead code.
-
-Remove use of NOARGS, because we assume everyone does ANSI C these
-days.
-
-Added build-rpm script from sct.
-
-New functions ext2fs_image_{inode,super,bitmap}_{read,write} added 
-to support e2image.
-
-New function ext2fs_flush_icache which must be called if the
-application program modifies the inode table blocks without going
-through ext2fs_write_inode() interface.
-
-New ext2fs_check_mount_point() function, which will return the mount
-point of a device if mounted.
-
-The io_channel abstraction now has an optional interface,
-io_channel_write_range, which allows specific byte ranges to be
-written.  
-
-The unix_io IO channel now supports write-through caching, so that
-journal creation is more efficient.
-
-Added x86 assembly language routines to support byte swapping, to
-reduce executable size.
-
-Fixed bug in the utility program subst so that it's possible to
-replace a substitution variable with a zero-length string.
-
-Fixed numbering e2fsck pass1 problem numbers; an extra zero had
-slipped into some of the problem number.
-
-E2fsprogs 1.19 (July 13, 2000)
-==============================
-
-Release the resize2fs program since the timeout before it could
-be released under the GPL has finally expired.
-
-Add experimental support needed for the ext2 compression patches.
-This requires compiling e2fsprogs with the --enable-compression flag
-to the configure script.
-
-Added ext3 journalling support.  E2fsck will run the journal (if
-necessary) by temporarily mounting the filesystem.  /sbin/fsck.ext3 is
-installed as a symlink to e2fsck.  Fsck has been taught about ext3,
-and treats it the same as ext2 in terms of the progress bar logic.
-Dumpe2fs will display the superblock journaling information if the
-filesystem has a journal.  The ext2 library will now permit opening an
-ext3 filesystem with the recovery flag set.  This is necessary for
-on-line dump's to work correctly, but there may be issues with this
-working well since ext3 is much less agressive about syncing blocks to
-the filesystem, since they're safe on the journal.
-
-Tune2fs and e2fsck have been changed to allow the mount_count check to
-be disabled by setting max_mount_count to -1.  (This was already
-supported by the kernel.)
-
-Create a symbolic link for fsck.ext3, since the e2fsprogs utilities
-are used for ext3 as well.
-
-Added internationalization support for e2fsprogs; must be enabled
-by passing --enable-nls to configure.
-
-Always use the provided ext2fs header files to insulate ourselves from
-kernel version changes.  Which include files are used by e2fsprogs
-have also been cleaned up to improve portability.
-
-Limit the number of times that e2fsck updates the progress bar so that
-people who are booting using a 9600 baud console don't get swampped by
-too many updates.
-
-Improved the loop detection algorithm in e2sck's pass #3 so that it is
-much, much faster for large filesystems with a large number of
-directories.
-
-The memory footprint for e2fsck is now slightly smaller than before.
-
-E2fsck now checks if special devices have a non-zero size, and offers
-to clear the size field if it finds such an inode.  
-
-E2fsck now checks if special devices have the append-only flag set,
-and offers to clear the inode.
-
-E2fsck now properly handles some "should never fail" cases during a
-bitmap copy in pass5.
-
-E2fsck now properly prints control characters in filenames as ^A .. ^Z.
-
-E2fsck now calculates the correct location of the backup superblock in
-the case of filesystem blocksizes > 1k.
-
-Fixed a bug in e2fsck's calculation of the number of inodes_per_block
-which normally didn't cause problems under most filesystem parameters,
-but could cause a valid superblock to be rejected in extreme cases.
-Other checks for validating superblock values were made more
-stringent.
-
-Added non-destructive write testing to the badblocks program, courtesy
-of David Beattie.  The badblocks also now has an option to input the
-current set of bad blocks, so that known bad blocks are skipped to
-speed up the badblocks test.  There is also a persistent rescan
-feature which causes badblocks to run until it has completed some
-number of passes without discovering any new bad blocks.
-
-Badblocks now checks to see if the device is mounted and refuses to do
-the tests involving writing to the device if it is mounted.  Also,
-badblocks now allows the number of blocks to be checked to be
-defaulted to the size of the partition.
-
-Fixed a bug in fsck which didn't allow non-root users to be able to
-check filesystems if there were any LABEL= or UUID= entries in
-/etc/fstab.
-
-The Hurd doesn't support the filetype filesystem feature.  The mke2fs
-program now makes sure that for the Hurd, the filestype feature is
-turned off.  E2fsck will check to see if the filetype feature is
-turned on for Hurd filesystems, and offer to turn off the feature.
-
-Mke2fs now has a safety check to make sure the number of blocks do not
-exceed 32 bits even on a 64 bit platform.
-
-Really fixed a bug in fsck to allow "fsck -As" to run interactive
-fsck's.  (For those people who like to do interactive fsck's in the
-/etc/rc scripts!?!)
-
-Debugfs has a few new features: the rdump command, which will do a
-recursive dump of a directory and all of its contents, and the lcd
-command which does a local chdir (much like the ftp command of the
-same name).  In addition, the debugfs program and the open_filesystem
-command now takes three new options: -b and -s, which allows the
-blocksize and superblock location to be specified, and the -c option
-which is used in catastrophic situations where the block group
-descriptors are corrupt.  If the -c option is specified, debugfs will
-skip trying to read in the block and inode bitmaps.
-
-Debufs's lsdel command was fixed to handle bad blocks in the inode
-table.
-
-A Y2K bug in debugfs's "ls -l" handling was fixed by switching to use
-4 digit years.
-
-General improvements in error messages
-
-  - Mke2fs prints a sane error message if the partition size is zero
-	(usually because the partition table wasn't reread by the
-	kernel due to the partition being busy), instead of "invalid
-	argument passed to ext2 library while initializing superblock".
-
-  - Fsck now prints more self-explanatory message if an invalid UUID=
-	or LABEL= specification is passed to it.
-
-UUID library changed to use the LGPL.
-
-Fixed a bug in the UUID library where very rapid calls to the
-time-based UUID generator could cause duplicate UUID's to be returned.
-This was not a problem for e2fsprogs, but it could be a problem for
-other users of the library.
-
-Make the UUID library more robust in the face of missing or an
-improper /dev/urandom or /dev/random files.
-
-Added some random portability fixes for Solaris.
-
-Some minor man page updates.
-
-Fixed a memory leak in the ss library.
-
-
-Programmer's notes:
--------------------
-
-We now try to use lseek64 and open64 from the LFS if possible.
-
-The 3rd parameter in e2p's print_flags is now a flags word, instead of
-a boolean option.
-
-The mark and unmark bitmap functions now return the previous state of
-the bit that was being changed, which is useful for some speed
-optimizations.
-
-The following functions have been added to enhance the badblocks list
-handling in libext2fs: ext2fs_write_bb_FILE, ext2fs_read_bb_FILE2, and
-ext2fs_badblocks_equal.
-
-The ext2 header files now have the latest journalling fields to the
-superblock.
-
-The ext2fs_mkdir function in libext2fs now properly backs out of error
-conditions robustly.
-
-Cleaned up makefiles:
-  - to cleanly  compile with the -j flag.
-  - so distclean removes all generated files.
-  - so in case of an error while installing header files, the make aborts.
-
-Fix test_script so that it works correctly when compiling in the
-source directory.
-
-The random UUID generation routine has been made slightly better in
-the case where /dev/random doesn't exist.  (Use of randomly-based UUID
-is still not recommended if /dev/random doesn't exist, however; it's
-better to use the time/ethernet MAC address UUID in this case.)
-
-Clean up the build process so it's more friendly in case of missing
-directories.
-
-The ext2fs header file can now be #include'd into C++ programs.
-
-The e2p.h header file is now installed.
-
-Added workaround to a gawk 3.0.5 bug in lib/ss/mk_cmds.
-
-
-
-E2fsprogs 1.18 (November 10, 1999)
-==================================
-
-Fix a core dumping bug in e2fsck if an imagic inode is present or
-(more rarely) if the filesystem is badly corrupted enough that e2fsck
-has to restart pass 1 processing.  E2fsck now closes the filesystem
-before freeing a large number of its data structures, so in the case
-of future memory faults, at least the fixed filesystem will be fully
-written out.
-
-If a filesystem doesn't support imagic inodes, and e2fsck discovers an
-imagic inode, it will offer to clear the imagic flag.
-
-E2fsck will now offer to clear the immutable flag on special files
-(device/socket/fifos) when running it in non-preen mode.
-
-E2fsck will now set the filetype when creating /lost+found, and when
-connected orphaned inodes to /lost+found.
-
-Debugfs's ncheck and icheck commands now handles the case where there
-are bad blocks in the inode table without bombing out.
-
-The badblocks list processing code has been made more efficiently for
-appending a large number of (ordered) badblocks to the badblocks list.
-
-Some minor man page updates.
-
-Fsck now allows interactive e2fsck's when using fsck -As (not a common
-mode, but some people like to do this in boot scripts for silly reasons).
-
-Programmer's notes:
--------------------
-
-The internal e2fsck problem code for PR_2_SPLIT_DOT was fixed to meet
-with the problem code convention.
-
-The badblocks list regression test program has been updated to work
-with previously made API name changes.
-
-The ext2fs_free() command now uses the new badblocks API to avoid
-using the compatibility layer.
-
-Added new regression test cases; the run_e2fsck test script now
-supports the ability for a test case to run a prepratory command
-before running e2fsck.
-
-E2fsprogs 1.17 (October 26, 1999)
-=================================
-
-Fixed nasty typo in fsck which caused parallelized fsck's to go into an
-infinite loop.
-
-Fixed a bug in fsck where it used strncmp to compare a binary UUID,
-thus potentially causing problems if a binary UUID contained a NULL
-character.
-
-E2fsck now uses stricter checks for directory entries in pass 2:
-zero-length filenames are not allowed; neither are 8 byte long
-directory entries.
-
-The debugfs "dirty" command now clears the filesystem valid bit.
-(Previously this just set the dirty-as-in-needs-writing-out-to-disk
-bit in the in-core superblock image.  The new functionality is more
-what the user expects, and is more useful.)
-
-Added a debugging hook to test parallel fsck; if the environment
-variable FSCK_FORCE_ALL_PARALLEL, then filesystems on the same drive
-will be checked in parallel when they normally would not be.
-
-Programmer's notes:
--------------------
-
-Fixed some #ifdef's for compilation under the Hurd OS.
-
-Fixed minor W2K compatibility problems.
-
-Fixed some miscellaneous GCC warnings.
-
-
-E2fsprogs 1.16 (October 22, 1999)
-=================================
-
-Fixed a race condition bug in fsck; when printing a progress bar, if
-checking multiple filesystems in parallel, it was possible for fsck to
-send e2fsck a SIGUSR1 signal before e2fsck had installed its signal
-handler, which would cause it to terminate with a signal 10.
-
-E2fsck now properly handles filesystems that have the
-INCOMPAT_FILETYPE feature turned on.  It can be used to convert a
-filesystem into using or not using FILETYPE feature.
-
-E2fsck now properly handles filesystems that have the IMAGIC feature
-turned on (this is used on Linux AFS servers).
-
-The mke2fs program now creates filesystems that have the filetype and
-sparse_superblock features enabled by default, unless it is run on a
-pre-2.2 kernel.  These features are not supported by a pre-2.2 kernel,
-so there is now a new flag -O which allows the user to specify with
-which features she would like to create the filesystem; "mke2fs -O
-none" will create a filesystsem compatible with 2.0 kernels.
-
-The tune2fs program now has a -O option which allows the user to set
-and reset "safe" filesystem features.  Currently, the only ones which
-allows to be modified are the filetype and sparse_superblock features.
-Note setting or clearing either feature will require running e2fsck on
-the filesystem afterwards.  (n.b. Clearing the sparse_superblock feature
-requires that there is enough free space on the filesystem for the
-extra superblocks which will be created by e2fsck.)
-
-Debugfs can now set and print filesystem features in the superblock
-using the "features" command.  Dumpe2fs will print out the complete
-set of features when listing the superblock.
-
-Dumpe2fs has new options -f (force) and -h (header-only).
-
-Fixed a bug in e2fsck which could cause the PROGRAMMING ERROR/bonehead
-message to come up.  This could happen when decrementing or
-incrementing a link count could result in an overflow.
-
-Fixed a bug in e2fsck where the block count on the lost+found
-directory would not be properly incremented when the directory was
-expanded to the point where an indirect block needed to be allocated.
-
-E2fsck now makes some additional sanity checks on the superblock to
-avoid crashing or giving a memory allocation error if some of the
-values in the superblock are unresonable (but the superblock otherwise
-looks valid).
-
-Fixed a bug in e2fsck where a very badly corrupted filesystem might
-require two passes to completely fix the filesystem.  This happened if
-an inode claimed blocks that was part of the filesystem metadata
-(typically, when garbage was written into an inode table or indirect
-block, since this kind of filesystem corruption normally doesn't
-happen otherwise).
-
-On the Alpha, glibc declares st_flags although it isn't actually used;
-the configure script was improved to detect this case so that
-e2fsprogs can avoid using the non-functional stat field.
-
-The manual pages were updated to use a more consistent formatting
-style consistent with standard Unix man pages.  Mke2fs's man page
-added documentation for a few previously undocumented options.
-
-Fixed minor display bugs in tune2fs and mke2fs.
-
-Programmer's notes:
--------------------
-
-Improved portability of e2fsprogs to non-Unix systems (in particular, NT).
-
-Added features to parse and print feature strings into the e2p library.  
-(e2p_feature2string, e2p_string2feature, e2p_edit_feature).
-
-ext2fs_mkdir() and ext2fs_new_dir_block() now creates directories
-whose directory entries contain proper filetype information if the
-filesystem supports it.
-
-ext2fs_link() now uses the low 3 bits of its flags parameter to pass
-the directory entry filetype information.  This is used to set the
-directory entry filetype information if the filesystem supports it.
-
-Fixed a bug in ext2fs_expand_dir() where the block count in a
-directory's inode would not be properly incremented when the directory
-was expanded to the point where an indirect block needed to be
-allocated.
-
-
-E2fsprogs 1.15 (July 18, 1999)
-==============================
-
-Add configuration checks so that e2fsprogs will compile cleanly on
-Linux 2.3 kernels that have renamed i_version to i_generation.
-
-E2fsck now prints a progress/completion bar (and not just a simple
-spinner) if the -C0 option is requested or if it receives a SIGUSR1
-signal.  Fsck will automatically manage the (potentially muliple)
-e2fsck processes to print completion bars if it is given a -C option,
-with the right thing happening if multiple filesystems are being
-checked in parallel.
-
-Mke2fs now has better automatic hueristics to determine the filesystem
-parameters to be used for a particular filesystem.  Added a new option
--T which allows the user to specify how the filesystem is to be used,
-which helps mke2fs do a better job selecting the filesystem parameters.
-
-Mke2fs now creates revision 1 filesystems by default, and with the
-sparse superblock feature enabled.  The sparse superblock feature is
-not understood by Linux 2.0 kernels, so they will only allow read-only
-mounts of filesystems with this sparse superblocks.
-
-Fix bug where if /dev/null couldn't be opened (should never happen),
-e2fsck would hang in a tight loop.
-
-Make e2fsck handle the case where /lost+found isn't a directory.
-
-E2fsck now uses mallinfo if it exists to get accurate statistics about
-its memory usage.
-
-Fix bug in e2fsck where it wouldn't check to see if a disconnected
-inode had any problems before connecting it to /lost+found.
-
-Add check to e2fsck so it makes sure that total number of inodes in
-the filesystem is a sane number.
-
-Fix fencepost error when clearing an the end of the block bitmap which
-caused the last block in the bitmap not to get cleared.
-
-Cleaned up a number of messages in e2fsck:
-	* The message "Group's #'s copy of the group descriptor..."
-		was fixed so that the correct number would be displayed.
-	* Added missing space in the "disk write-protected" error messsage
-	* Cleaned up the error message printed when a non-interactive
-		e2fsck needs to abort a check because the filesystem
-		appears to be mounted.
-
-Added a new command-line utility, uuidgen, which will create and print
-a UUID.
-
-Make debugfs's icheck command more robust by checking to make sure an
-inode has valid blocks before interarting over the inode's blocks.
-
-UUID generation now uses a random-based scheme whenever possible to
-prevent potential privacy problems.
-
-Man pages for all of the UUID functions in the lirbary were added.
-
-Fixed bug in fsck so it won't coredump if a filesystem not in
-/etc/fstab is given to it.
-
-Fsck now understands the UUID=xxxx and LABEL=yyyy forms in /etc/fstab
-that most of the other mount utilities understands.
-
-Mke2fs will make a filesystem even if it appears mounted if the force
-option is given.
-
-Dumpe2fs has new command-line options which allow a filesystem expert
-to specify the superblock and blocksize when opening a filesystem.
-This is mainly useful when examining the remains of a toasted
-filesystem.
-
-The badblocks program has been updated to display correctly on disks
-with large block numbers.
-
-The badblocks program no longer gives spurious errors when errors
-occur on non-block boundaries, which is common if the blocksize is
-larger than 1k.
-
-Mke2fs will sync the disk device every MKE2FS_SYNC block groups if the
-MKE2FS_SYNC environment variable is set.  This is to work around a VM
-bug in the 2.0 kernel.  I've heard a report that a RAID user was able
-to trigger it even using a 2.2 kernel, but hopefully it will not be
-needed for most Linux 2.2 users.
-
-Fixed miscellaneous documentation and man pages.
-
-Programmer's notes:
--------------------
-
-Cleaned up functions such as pass1_get_blocks, pass1_read_inode which
-in e2fsck's pass1.c really should have been static.
-
-The return value of the uuid_compare() function was changed to make it
-match with the convetions used by strcmp, memcmp, and Paul Leach's
-UUID sample document.
-
-The "make depend" process has now been made more automated; it now
-automatically word-wraps the dependencies, and only replaces source
-Makefile.in if there has been a change in the dependencies.  Also, a
-top-level "make depend" now recurses through all the subdirectories
-automatically.
-
-The Makefile in .../util has been changed so that subst is built using
-the native C compiler during a cross-compilation, since the subst
-program is only used during the build process.  Also add an explicit
-rule to build util/subst by cd'ing to the correct directory and
-running Makefile.
-
-The man directories are defined in terms mandir, so that the configure
-script can override the location of the manual pages.
-
-The config files have been updated to recognize new machine types for
-both the i386 and alpha families.
-
-Fsck has been modified so that it will accurately create an
-fsck_instance even when the noexecute flag is set.  This allows for
-accurate debugging of the fsck pass structure.  Also, when the verbose
-flag is given twice, fsck will print debugging information about when
-fsck is waiting for jobs to finish.
-
-
-E2fsprogs 1.14 (January 9, 1999)
-================================
-
-Fix the fstab parsing code so that it can handle blank lines and
-comment characters.  Also, missing pass numbers need to be treated as
-zero.
-
-Fixed a bug in e2fsck where under some circumstances (when e2fsck
-needs to restart processing after fixing an egregious inconsistency)
-it would try to access already freed memory.
-
-E2fsck now prints non-printable characters in directory entries and
-pathnames using '^' and 'M-' notation.
-
-Fixed chattr so that it will ignore symbolic links when doing
-recursive descent traversals.  For both chattr and lsattr, no longer
-print the version string unless the -V option is given.
-
-Allow the system administrator to directly specify the number of
-inodes desired in the filesystem, for some special cases where this is
-necessary.
-
-Fix portability problems so that e2fsprogs can be compiled under Linux
-1.2 systems and Solaris systems.
-
-Update the config.guess file with a more recent version that will
-identify newer Linux platforms.
-
-Programmer's notes
-------------------
-
-Ext2fs_read_inode and ext2fs_write_inode will now return an error if
-an inode number of zero is passed to them.
-
-E2fsprogs 1.13 (December 15, 1998)
-==================================
-
-Fixed a bug in debugfs where an error messages weren't getting printed
-when the ext2 library routines to read inodes returned errors in the
-stat, cmri and rm commands.
-
-Fixed a bug in mke2fs so that if a ridiculous inode ratio parameter is
-provided, it won't create an inode table smaller than the minimum
-number of inodes required for a proper ext2 filesystem.
-
-Fsck now parses the /etc/fstab file directly (instead of using
-getmntent()), so that it can distinguish between a missing pass number
-field and pass number field of zero.  This caused problems for
-diskless workstations where all of the filesystems in /etc/fstab have
-an explicit pass number of zero, and fsck could not distinguish this
-from a /etc/fstab file with missing pass numbers.
-
-E2fsck will create a /lost+found directory if there isn't one in the
-filesystem, since it's safer to create the lost+found directory before
-it's needed.
-
-Fixed e2fsck so that it would detect bogus immutable inodes which
-happen to be sockets and FIFO files, and offer to clear them.
-
-If a filesystem has multiple reasons why it needs to be checked, and
-one of the reasons is that it is uncleanly mounted, e2fsck will print
-that as the reason why the filesystem is being checked.
-
-Cleaned up the output routines of mke2fs so that it doesn't overflow
-an 80 column display when formating really big filesystems.
-
-Added a sanity check to e2fsck to make sure that file descriptors 0,
-1, 2 are open before opening the hard disk.  This avoids a problem
-where a broken program might exec e2fsck with those file descriptors
-closed, which would cause disastrous results if the kernel returns a
-file descriptor for the block device which is also used by FILE *
-stdout.
-
-Fixed up the e2fsck progress reporting functions so that the values
-reliably reach 100% at the completion of all of the e2fsck passes.
-
-Fixed minor documentation bugs in man pages and usage messages.
-
-Programmer's notes:
--------------------
-
-Fixed a number of lint warnings in the ext2fs library and potential
-portability problems from other OS's header files that might define
-CPP macros for names like "max" and "min".
-
-ext2fs_badblocks_list_add() has been made more efficient when it needs
-to grow the bad blocks list.
-
-Fixed a bug in e2fsck which caused it to dereference a freed pointer
-just before exiting.
-
-Fixed the substition process for generating the mk_cmds and compile_et
-scripts so that they will work outside of the build tree.
-
-Add sanity check to e2fsck so that if an internal routine
-(ext2fs_get_dir_info) returns NULL, avoid dereferencing the pointer
-and causing a core dump.  This should never happen, but...
-
-E2fsprogs 1.12 (July 9, 1998)
-==================================
-
-E2fsprogs now works with glibc (at least with the version shipped wtih
-RedHat 5.0).  The ext2fs_llseek() function should now work even with
-i386 ELF shared libraries and if llseek() is not present.  We also
-explicitly do a configure test to see if (a) llseek is in libc, and
-(b) if llseek is declared in the system header files.  (See standard
-complaints about libc developers don't understand the concept of
-compatibility with previous versions of libc.)
-
-The ext2fs library now writes out the block group number in each of
-the superblock copies.  This makes it easier to automatically
-determine the starting block group of the filesystem when the block
-group information is trashed.
-
-Added support for the EXT2_FEATURE_INCOMPAT_FILETYPE feature,
-which means that e2fsprogs will ignore the high 8 bits of the
-directory entry's name_len field, so that it can be used for other
-purposes.
-
-Added support for the EXT2_FEATURE_RO_COMPAT_LARGE_FILE feature.
-E2fsprogs will now support filesystems with 64-bit sized files.
-
-Added support for the EXT2_FEATURE_COMPAT_DIR_PREALLOC feature.
-
-Added new program "e2label", contributed by Andries Brouwer.  E2label
-provides an easy-to-use interface to modify the filesystem label.
-
-Fixed bug so that lsattr -v works instead of producing a core dump.
-
-Fixed a minor bug in mke2fs so that all groups with bad superblock
-backup blocks are printed (not just the first one).
-
-Mke2fs will check the size of the device, and if the user specifies a
-filesystem size larger than the apparent size of the device it will
-print a warning message and ask if the user wants to proceed.
-
-E2fsck has a new option -C, which sends completion information to the
-specified file descriptor.  For the most part, this is intended for
-programs to use, although -C 0 will print a spinning character to the
-stdout device, which may be useful for users who want to see something
-happening while e2fsck goes about its business.
-
-Fixed a bug in e2fsck which could cause a core dump when it needs to
-expand the /lost+found directory, and sometimes the bitmaps haven't
-been merged in.  Also fixed a related bug where ext2fs_write_dir_block
-was used to write out a non-directory block.  (Which would be bad on a
-non-Intel platform with byte swapping going on.)
-
-Fixed bug in e2fsck where it would print a "programming error" message
-instead of correctly identifying where a bad block was in used when
-the bad block was in a non-primary superblock or block group
-descriptor.  Also fixed a related bug when sparse superblocks are in
-use and there is a bad block where a superblock or block group
-descriptor would have been in a group that doesn't include a
-superblock.
-
-Fixed a bug in e2fsck (really in libext2fs's dblist function) where if
-the block group descriptor table is corrupt, it was possible to try to
-allocate a huge array, fail, and then abort e2fsck.
-ext2fs_get_num_dirs() now sanity checks the block group descriptor,
-and subsitutes reasonable values if the descriptors are obviously bogus.
-
-If e2fsck finds a device file which has the immutable flag set and the
-i_blocks beyond the normal device number are non-zero, e2fsck will
-offer to remove it, since it's probably caused by garbage in the inode
-table.
-
-When opening a filesystem, e2fsck specially checks for the EROFS error
-code, and prints a specific error message to the user which is more
-user friendly.
-
-If the filesystem revision is too high, change the e2fsck to print
-that this is either because e2fsck is out of date, or because the
-superblock is corrupt.  
-
-E2fsck now checks for directories that have duplicate '.' and '..'
-entries, and fixes this corruption.
-
-E2fsck no longer forces a sync of the filesystem (with attendant sleep
-calls) at all times.  The ext2fs_flush() function now performs a sync
-only if it needed to write data blocks to disk.
-
-Fixed a minor bug in e2fsck's pass1b's file cloning function, where
-certain errors would not be properly reported.
-
-Updated and expanded a few points in the man pages which users
-complained wheren't explicit enough.
-
-Added special case byte-swapping code if compiling on the PowerPC, to
-accomodate the strange big-endian variant of the ext2 filesystem that
-was previously used on the PowerPC port.
-
-
-Programmer's notes:
--------------------
-
-Removed C++ keywords from the ext2fs libraries so that it could be
-compiled with C++.
-
-E2fsck's internal organization has now been massively reorganized so
-that pass*.c don't have any printf statements.  Instead, all problems
-are reported through the fix_problem() abstraction interface.  E2fsck
-has also been revamped so that it can be called as a library from a
-application.
-
-Added new fileio primitives in libext2fs for reading and writing
-files on an unmounted ext2 filesystem.  This interface is now used by
-debugfs.
-
-Added a new libext2fs function for mapping logical block numbers of
-a file to a physical block number.
-
-Added a new libext2fs function, ext2fs_alloc_block(), which allocates
-a block, zeros it, and updates the filesystem accounting records
-appropriately.
-
-Added a new libext2fs function, ext2fs_set_bitmap_padding(), which
-sets the padding of the bitmap to be all one's.  Used by e2fsck pass 5.
-
-The libext2fs functions now use a set of memory allocation wrapper
-functions: ext2fs_get_mem, ext2fs_free_mem, and ext2fs_resize_mem,
-instead of malloc, free, and resize.  This makes it easier for us to
-be ported to strange environments where malloc, et. al. aren't
-necessarily available.
-
-Change the libext2fs fucntion to return ext2-specific error codes
-(EXT2_DIR_EXISTS and EXT2_DB_NOT_FOUND, for example) instead of using
-and depending on the existence of system error codes (such as EEXIST
-and ENOENT).
-
-Renamed io.h to ext2_io.h to avoid collision with other OS's header
-files.
-
-Add protection against ext2_io.h and ext2fs.h being included multiple
-times.
-
-The types used for memory lengths, etc. have been made more portable.
-In generla, the code has been made 16-bit safe.  Added Mark
-Habersack's contributed DOS disk i/o routines.
-
-Miscellaneous portability fixes, including not depending on char's
-being signed.
-
-The io_channel structure has a new element, app_data, which is
-initialized by the ext2fs routines to contain a copy of the filesystem
-handle.
-
-ext2fs_check_directory()'s callback function may now return the error
-EXT2_ET_CALLBACK_NOTHANDLED if it wishes ext2fs_check_directory() to
-really do the checking, despite the presence of the callback function.
-
-
-E2fsprosg 1.11 (June 17, 1997)
-==============================
-
-Fixed e2fsck to detect (previously ignored) conflicts between the
-superblock or block group descriptors and block bitmaps, inode
-bitmaps, and inode tables.
-
-Fixed bug in e2fsck so that when the message printed out when a block
-or inode bitmap conflicts with other data, it has the correct group
-number.
-
-Fixed bug in e2fsck and mke2fs where the blocksize wasn't being passed
-to badblocks.  This meant that not all of the filesystem was being
-tested for bad blocks! 
-
-Fixed an array boundary overrun case which cropped up in
-ext2fs_badblocks_list_test when a user tried running "mke2fs -c 
--b 4096".
-
-Adjusted the number of columns printed by mke2fs when displaying the
-superblock backups to avoid running over 80 columns when making a
-really big filesystem.
-
-Fixed up the man pages for e2fsck, debugfs, badblocks, chattr,
-dumpe2fs, fsck, mke2fs, and tune2fs (typos and other minor grammar
-fixes), thanks to some suggestions from Bill Hawes (whawes@star.net).
-
-Programmer's notes:
--------------------
-
-Fixed install rule in lib/ss so that ss_err.h is actually getting
-installed.
-
-Fixed bug in ext2fs_copy_bitmap; the destination bitmap wasn't getting
-bassed back to the caller.
-
-Fixed bug in ext2fs_inode_scan_goto_blockgroup; it had not been
-setting the current inode number (which meant this function wasn't
-working at all).
-
-Fixed bug in ext2fs_resize_generic_bitmap; it had not be zeroing all
-blocks in the bitmap when increasing the size of the bitmap.
-
-Changed the initial number of blocks allocated by ext2fs_init_dblist()
-to be more realistic.
-
-Added a new function ext2fs_allocate_group_table, which sets up the
-group descriptor information (and allocates inode and block bitmaps,
-and inode tables for a particular group).  The function was created by
-factoring out code form ext2fs_allocate_tables().
-
-Added a new function ext2fs_move_blocks which takes a bitmap of the
-blocks to be moved, and moves them to another location on the
-boardboard.
-
-Make the unix_io channel's io_channel_flush implementation calls sync()
-to to flush the kernel buffers to disk.
-
-Added a new function ext2fs_dblist_count returns the number of
-directory blocks in dblist.
-
-
-E2fsprogs 1.10 (April 24, 1997)
-===============================
-
-Mke2fs once again defaults to creating revision #0 filesystems, since
-people were complaining about breaking compatibility with 1.2 kernels.
-Warning messages were added to the mke2fs and tune2fs man pages that
-the sparse superblock option isn't supported by most kernels yet (1.2
-and 2.0 both don't support parse superblocks.)
-
-Added new flag to mke2fs, -R <raid options>, which allows the user to
-tell mke2fs about the RAID configuration of the filesystem.  Currently
-the only supported raid option is "stride" which specifies the width
-of the RAID stripe.
-
-Fixed bug in e2fsck where pass1b would bomb out if there were any
-blocks marked bad in the inode table.
-
-Fixed rare bug in mke2fs where if the user had a very unlucky number
-of blocks in a filesystem (probability less than .002) the resulting
-filesystem would be corrupt in the last block group.
-
-Fixed bug where if e2fsck tried to allocate a block to fix a
-filesystem corruption problem and the filesystem had no free blocks,
-ext2fs_new_block() would loop forever.
-
-The configure script now checks explicitly to see if "-static" works,
-since that can't be assumed to be true --- RedHat doesn't install
-libc-static by default.
-
-Fixed bug in libext2's block iterator functions where under some
-cirmcustances, file with holes would cause the bcount parameter to the
-callback function to be incorrect.  This bug didn't affect any of
-e2fsprogs programs, but it was discovered by Paul Mackerras, the
-author of the PPC boot loader.
-
-Removed use of static variables to store the inode cache in libext2fs.
-This caused problems if more than one filesystem was accessed via
-libext2fs (static variables in libraries are generally a bad idea).
-Again, this didn't affect e2fsprogs programs, but it was discovered by
-Paul Mackerras.
-
-Fixed minor bugs and version code drift to assure that e2fsprogs 1.10
-will compile cleanly with 1.2.13 kernels (even with a.out shared
-libraries!)
-
-Programmer's notes:
--------------------
-
-Added new functions to duplicate an ext2 filesystem handle, and its
-associated substructure.  New functions: ext2fs_dup_handle(),
-ext2fs_copy_dblist(), ext2fs_badblocks_copy(), ext2fs_copy_bitmap().
-Other structures, such as the io_channel and the inode_cache, now have
-a ref count so that they only get freed when they are no longer used
-by any filesystem handle.  (These functions were added as part of the
-development effort for an ext2 resizer).
-
-E2fsprogs 1.09 (April 14, 1997)
-===============================
-
-Fixed bug in mke2fs (really in lib/ext2fs/initialize.c) which was
-accidentally introduced in the 1.08 release.  The overhead calculation
-was accidentally removed, which caused ext2fs_initialize() to not
-notice when the filesystem size needed to be adjusted down because
-there wasn't enough space in the last block group.
-
-Fixed bug in version parsing library routine; it was always parsing
-the library version string, instead of using the passed-in string.
-
-Clarified chattr man page.
-
-E2fsprogs 1.08 (April 10, 1997)
-===============================
-
-E2fsck 1.07 was very slow when checking very large filesystems with a
-lot of files that had hard links (i.e., news spools).  This was fixed
-by seriously revamping the icount abstraction.  Added a formal test
-suite for the icount abstraction.
-
-Debugfs now has a "-l" option to the "ls" command, which lists the
-inode number, permissions, owner, group, size, and name of the files
-in the directory.
-
-Fix a bug in e2fsck where when a directory had its blocks moved to
-another location during the pass 1b processing, the directory block
-list wasn't updated, so pass 2 wouldn't check (and correct) the
-correct directory block.
-
-E2fsck will now treat inodes which contain blocks which are claimed by
-the filesystem metadata by treating them as multiply claimed blocks.
-This way, the data in those blocks can be copied to a new block during
-the pass 1b--1d processing.
-
-E2fsck will attempt to determine the correct superblock number and
-display it in the diagnostic and warning messages if possible.
-
-Add support for a new (incompatible) feature, "sparse_super".  This
-feature reduces the number of blocks which contain copies of backup
-superblocks and block group descriptors.  (It is only an incompatible
-feature because of a bug in ext2_free_blocks.)  mke2fs and tune2fs now
-support a new -s option; e2fsck will recognize filesystems built with
-this feature turned on.
-
-E2fsck now checks the library to make sure is the correct version,
-using new library functions.  (This helps to diagnose incorrectly
-installed e2fsprogs distributions.)
-
-Dumpe2fs now prints more information; its now prints the the
-filesystem revision number, the filesystem sparse_super feature (if
-present), the block ranges for each block group, and the offset from
-the beginning of the block group.
-
-Mke2fs now distributes the inode and block bitmap blok so that the
-won't be concentrated in one or two disks in RAID/striping setups.
-Also, if the user chooses a 2k or 4k block group, mke2fs will try to
-choose the largest blocks per group that be chosen.  (For 2k blocks,
-you can have up to 16384 blocks/group; for 4k blocks, you can have up
-to 32768 blocks/group.)  Previously mke2fs would not allow
-specification of more than 8192 blocks per group, even if you were
-using a 2k or 4k block group.
-
-Programmer's notes:
--------------------
-
-Added a new function ext2fs_create_icount2() which takes a "hint"
-argument.  This hint argument presets the icount array with the list
-of inodes which actually need to be in the icount array.  This really
-helps to speed up e2fsck.
-
-Added a new function ext2fs_icount_validate() which checks the rep
-invariant for the icount structure.  This is used mostly for testing.
-
-The error mesasage given when a bad inode number is passed to
-test_generic_bitmap to reflect EXT2FS_TEST_ERROR (instead of
-EXT2FS_UNMARK_ERROR).
-
-Added a new function ext2fs_set_dir_block which sets the block of a
-dblist entry, given the directory inode and blockcnt.
-
-Added a new function ext2fs_get_library_version() which returns the
-current library version, and ext2fs_parse_version_string() which
-returns a version number based on a e2fsprogs version string.
-
-The icount functions will return EINVAL if the passed in inode number
-is out of bounds.
-
-E2fsprogs 1.07 (March 9, 1997)
-==============================
-
-E2fsck is now uses much less memory when checking really large
-filesystems (or rather, filesystems with a large number of inodes).
-Previously a filesystem with 1 million inodes required 4 megabytes of
-memory to store inode count statistics; that storage requirement has
-now been reduced to roughly half a megabyte.
-
-E2fsck can now properly deal with bad blocks appearing inside the
-inode table.  Instead of trying to relocate the inode table (which
-often failed because there wasn't enough space), the inodes in the bad
-block are marked as in use.
-
-E2fsck will automatically try to use the backup superblocks if the
-primary superblocks have a bad magic number or have missing meta-data
-blocks (or meta-data blocks which are out of range).
-
-E2fsck's pass 3 has been made more efficient; most noticeable on
-filesystems with a very large number of directories.
-
-Completely revamped e2fsck's system of printing problem reports.  It
-is now table driven, to make them more easily customizeable and
-extendable.  Error messages which can be printed out during preen mode
-are now one line long.
-
-Fixed e2fsck's filesystem swapping code so that it won't try to swap
-fast symbolic links or deleted files.
-
-Fixed e2fsck core dumping when fixing a filesystem which has no
-directories (not even a root directory).
-
-Added a check to e2fsck to make sure that the length of every
-directory entry is a multiple of 4 (since the kernel complains if it
-isn't).
-
-Added a check to e2fsck to make sure that a directory entry isn't a
-link to the root directory, since that isn't allowed.
-
-Added a check to e2fsk to now make sure the '.' and '..' directory
-entries are null terminated, since the 2.0 kernel requires it.
-
-Added check to write_bitmaps() to make sure the superblock doesn't get
-trashed if the inode or block bitmap is marked as being block zero.
-
-Added checking of the new feature set fields in the superblock, to
-avoid dealing with new filesystem features that this package wasn't
-set up to handle.
-
-Fixed a fencepost error in ext2fs_new_block() which would occasionally
-try to allocate a block beyond the end of a filesystem.
-
-When the UUID library picks a random IEEE 802 address (because it
-can't find one from a network card), it sets the multicast bit, to
-avoid conflicting with a legitimate IEEE 802 address.
-
-Mke2fs now sets the root directory's owner to be the real uid of the
-user running mke2fs.  If the real uid is non-zero, it also sets
-the group ownership of the root directory to be the real group-id of
-the user running mke2fs.
-
-Mke2fs now has more intelligent error checking when it is given a
-non-existent device.
-
-When badblocks is given the -vv option, it now updates the block that
-it is currently testing on every block.
-
-Fixed a bug in fsck where it wouldn't modify the PATH envirnoment
-currently correctly if PATH wasn't already set.
-
-Shared libraries now built with dependencies.  This allows the shared
-library files to be used with dlopen(); it also makes the transition
-to libc 6 easier, since ld.so can tell which libc a particular shared
-library expects to use.
-
-Programmer's notes:
--------------------
-
-Added new abstraction (defined in dblist.c) for maintaining a list of
-blocks which belongs to directories.  This is used in e2fsck and other
-programs which need to iterate over all directories.
-
-Added new functions which test to see if a contiguous range of blocks
-(or inodes) are available.  (ext2fs_*_bitmap_range).
-
-Added new function (ext2_inode_has_valid_blocks) which returns true if
-an inode has valid blocks.  (moved from e2fsck code).
-
-Added new function (ext2fs_allocate_tables) which allocates the
-meta-data blocks as part of initializing a filesystem.  (moved from
-mke2fs code).
-
-Added a new I/O manager for testing purposes.  It will either allow a
-program to intercept I/O requests, or print debugging messages to
-trace the activity of a program using the I/O manager.
-
-The badblocks_list functions now store the bad blocks in a sorted
-order, and use a binary search to speed up badblocks_list_test.
-
-The inode scan function ext2fs_get_next_inode() may now return a soft
-error returns: MISSING_INODE_TABLE and BAD_BLOCK_IN_INODE_TABLE in
-those cases where part of an inode table is missing or there is a bad
-block in the inode table.  
-
-Added a new function (ext2fs_block_iterate2) which adds new arguments to
-the callback function to return a pointer (block and offset) to the
-reference of the block.
-
-Added new function (ext2fs_inode_scan_goto_blockgroup) which allows an
-application to jump to a particular block group while doing an inode
-scan.
-
-The badblocks list functions were renamed from badblocks_* to
-ext2fs_badblocks_*.  Backwards compatibility functions are available
-for now, but programs should be modified to use the new interface.
-
-Some of the library functions were reorganized into separate files to
-reduce the size of some programs which statically link against the
-ext2 library.
-
-Put in some miscellaneous fixes for the Alpha platform.
-
-
-E2fsprogs 1.06 (October 7, 1996)
-================================
-
-Fixed serious bug in e2fsck: if the block descriptors are bad, don't
-smash the backup copies in ext2fs_close().  (The problem was that when
-e2fsck -p discovered the problem, while it was closing the filesystem
-and exiting, it was also blowing away the backup superblocks on the
-disk, which was less than friendly.)  We now make it the case that we
-only write out the backup superblock and the back block descriptors if
-the filesystem is completely free from problems.
-
-Fixed a bug in block_interate in the lib/ext2fs library which caused
-e2fsck to fail on GNU Hurd-created filesystems.
-
-Add support for Linux/FT's bootloader, which actually uses
-EXT2_BOOT_LOADER, and sets its mode bits which caused e2fsck to want
-to clear the inode.
-
-Add support for the "A" (no atime update) attribute.  (Note: this
-attribute is not yet in production kernels.)
-
-The test suite is not automatically run when doing a "make all" from
-the top level directory.  Users should manually run "make check" if
-they wish to run the test suite.
-
-Upon a preenhalt(), make the printed message more explicit that
-running e2fsck "MANAULLY" means without the -p or -a options.
-
-In e2fsck, if a disconnected inode is zero-length, offer to clear it
-instead of offering to connect it to lost+found.
-
-In e2fsck, if a filesystem was just unmounted uncleanly, and needs
-e2fsck to be run over it, change e2fsck to explicitly display this
-fact.
-
-For dumpe2fs and e2fsck, cause the -V option to print out which
-version of the ext2fs library is actually getting used.  (This will
-help detect mismatches of using a 1.06 utility with a 1.05 library,
-etc.)
-
-Programmers' notes:
--------------------
-
-EXT2_SWAP_BYTES was changed to EXT2_FLAG_SWAP_BYTES, which better fits
-the naming convention.
-
-In ext2fs_initialize(), make sure the description for the inode bitmap
-is correctly initialize.
-
-Fixed minor type typo in ext2fs_allocate_generic_bitmap();
-
-E2fsprogs 1.05 (September 7, 1996)
-==================================
-
-Add support for new fields in the ext2 superblock --- volume name,
-volume UUID, and last mounted field.  Dumpe2fs displays these fields,
-tune2fs and mke2fs allows you to set them.  E2fsck will automatically
-generate a UUID for those volumes that don't have them.  
-
-Put in support for e2fsck to recognize HURD specific ext2 features ---
-most notably, the translator block.  The e2fsprogs tools will now use
-the creator_os field in the superblock to correctly handle different
-OS-specific variants of the ext2 filesystem.
-
-E2fsck now fixes inodes which have a the deletion time set, but which
-have a non-zero i_link_count field by offering to clear the deletion
-time.  Previously e2fsck assumed that the inode was deleted (per 0.3c
-ext2 kernel behavior) and offered to unlink the file.
-
-If e2fsck sets the clean bit, but nothing else, set the exit code
-FSCK_NONDESTRUCT.  After all, e2fsck did fix a filesystem error --- it
-set the filesystem valid bit when it was previously cleared.  :-) This
-was needed to make the HURD fsck driver happy.
-
-If the  user  refuses to attach an  unattached  inode, e2fsck  will no
-longer set the inode's link count.  Otherwise, the  inode would end up
-getting marked as unused, which might cause loss of data later.
-
-Make the message issued by e2fsck when the superblock is corrupt less
-confusing for users.  It now mentions that another reason for the
-"corrupt superblock" message might be that the partition might not be
-an ext2 filesystem at all (it might swap, msdos filesystem, ufs, etc.)
-
-Make the libext2 library more robuest so that e2fsck won't coredump on
-an illegal superblock where the blocksize is zero.  (f_crashdisk is
-the test case).
-
-By default, create filesystems where the default checkinterval is 6
-months (180 days).  Linux servers can be robust enough that 20 reboots
-can be a long, long time.
-
-Added configure flag --enable-old-bitops, which forces the bitops to
-use the old (native) bitmask operations.  By default on the sparc
-platform, the standard ext2 bit ordering is now used.
-
-Added a new feature to e2fsck to byte-swap filesystems; this can be
-used to convert old m68k filesystems to use the standard byte-order
-storage for the superblock, inodes, and directory blocks.  This
-function is invoked by using the '-s' option to e2fsck.
-
-Debugfs's "dump" command has been enhanced so that it writes out the
-exact size of the file so that the nulls at the end of the file are
-eliminated.  The command also accept a new "-p" option which will
-attempt preserve to preserve the ownernship, permissions, and
-file modification/access times.
-
-Debugfs has two new options, -f and -R.  The -R option allows the user
-to execute a single debugfs command from the command line.  The -f
-option allows the user to specify a "command file" containing debugfs
-commands which will get executed.
-
-Dumpe2fs now pretty prints the check interval, instead of just
-printing the check interval as a number of seconds.
-
-Fix bugs in debugfs: the params command when no filesystem is opened
-no longer causes a core dump.  It is now possible to unlink a file
-when a pathame containing a '/' is specified.
-
-Tune2fs has a new -C option which sets the number of times the
-filesystem has been mounted.
-
-Fix the chattr '-v' option so that it actually works.  Chattr was
-being buggy about the -v option parsing.
-
-Programmers' notes:
--------------------
-
-The directory lib/uuid contains a set of library routines to generate
-DCE compatible UUIDs.  
-
-Extended ext2fs_namei() to handle symbolic links.  Added new function
-ext2fs_nami_follow() which will follow last symbolic link in the case
-where the pathname points to a sym link.
-
-The ext2fs_block_iterate function will now return the HURD translator
-block, if present.  The new flag BLOCK_FLAG_DATA_ONLY will cause the
-iterator to return data blocks only.  The ext2fs.h file now defines
-constants BLOCK_COUNT_IND, BLOCK_COUNT_DIND, BLOCK_COUNT_TIND, and
-BLOCK_COUNT_TRANSLATOR, which are the magic values passed in the block
-count field of the iterator callback function.
-
-The test script driver now takes an optional second argument, which is
-the test case to be run.  This allows you to run a test case without
-needing to run the entire test suite.
-
-On Linux ELF systems, install the .so files in the correct places
-(/usr/lib).  The .so files must be stored in the same directory as the
-.a files.
-
-Fixed miscellaneous HURD compilation issues with header file being
-included in the right order.
-
-Fixed debugfs so that it resets optind to zero, not one, since setting
-optind to zero is more correct.
-
-
-E2fsprogs 1.04 (May 16, 1996)
-=============================
-
-First "official" (1.03 was a limited release only) to support building
-e2fsprogs under Linux 2.0 kernels (as well as late model 1.3 and 1.99
-kernels).
-
-This package includes a RPM specs file, that it can be built using the
-RedHat Package Manager.
-
-E2fsck now prints a hint that if there are lots of incorrectly located
-inode bitmaps, block bitmaps, and inode table blocks, the user might
-want to try using e2fsck -b 8193 first, to see if that fares any
-better.
-
-For ext2 filesystem written with the hurd, debugfs will now print out
-the translator field when printing an inode structure.
-
-Lots of miscellaneous linking/installation cleanups:
-
-  Libraries are now linked using a relative pathname, instead of
-  relying on -L working correct.  It doesn't, in many cases, including
-  current versions of GNU ld.  This guarantees that the build tree is
-  linking with the right libraries, instead of the ones installed in
-  /usr/lib.
-
-  Header files, man pages, and the et/ss shell scripts are now
-  generated using a custom substitution script, instead of relying on
-  the configure script.  This prevents needless recompilation of
-  files; in addition, the custom substitution script is much faster.
-
-  e2fsck may now be linked dynamically, by using the
-  --enable-dynamic-e2fsck flag to configure.  This is not recommended,
-  since it increases e2fsck's dependence on other files, but some
-  people need to save disk space, and other critical programs on their
-  systems were being linked dynamically anyway.
-
-  Programs such as fsck which didn't need to be linked against
-  libext2fs (or mke2fs which didn't need to be linked against libe2p)
-  only link against libraries they actually need.  Otherwise, those
-  programs would require the presense of libraries that otherwise
-  could be removed from a rescuse diskette.
-
-  The ss include files are now installed correctly so they can
-  actually be used by another package.
-
-  If the profiling libraries are built, they are now installed on a
-  "make install-libs".
-
-
-E2fsprogs 1.03 (March 27, 1996)
-===============================
-
-Change the m68k bit numbering for bitmasks to match the bit numbering
-used by all other ext2 implementations.  (This change was requested by
-the m68k kernel development team.)
-
-Support (in-development) filesystem format revision which supports
-(among other things) dynamically sized inodes.
-
-Fixed a bug in the ext2 library so that an intelligent error is
-returned if mke2fs is run with a ridiculously small number of blocks
-for a partition.
-
-Fixed a bug in the ext2 library which required that the device be
-openable in read/write mode in order to determine its size.  This
-caused e2fsck -n to require read/write access when it was not
-previously necessary.
-
-Fixed a bug in e2fsck which casued it to occasionally fail the test
-suite depending on which version of the floating point library it was
-using.
-
-Fixed a bug in e2fsck so that it now halts with a fatal error when
-certain superblock consistency checks fail.  Previously it continued
-running e2fsck, with some potential confusing/damaging consequences.
-
-Added new flag to fsck which allows the root to be checked in parallel
-with other filesytems.  This is not the safest thing in the world to
-do, but some system administrators really wanted it.
-
-Fixed -Wall flames in lib/ss.
-
-
-E2fsprogs 1.02 (January 16, 1996)
-=================================
-
-Fix to allow e2fsprogs to be compiled on recent 1.3 (pl45+) kernels.
-
-Change e2fsck to print statistics of how many non-contiguous files are
-on the system.  Note that a file which is larger than 8k blocks, it is
-guaranteed to be non-contiguous.
-
-In mke2fs, print a warning message if a user tries to format a whole
-disk (/dev/hda versus /dev/hda1).  If a user really wants to format a
-whole disk, the -F (force) option forces mke2fs to format a whole disk
-as a filesytem.
-
-Fix a bug in fsck where in some cases it might start checking
-partitions in the next pass before it finishes checking partitions in
-the current pass.  This still won't cause two partitions on the same
-disk will be checked, so it's rarely a problem in real life.
-
-Patch lsattr so that it won't hang when checking a named pipe.
-
-Minor compilation fixes:
-	* Fix the order of libraries that were linked in debugfs.
-	* Allow the sources to be compiled with -ansi turned on.
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
new file mode 120000
index 0000000..a0e8f57
--- /dev/null
+++ b/RELEASE-NOTES
@@ -0,0 +1 @@
+doc/RelNotes/v1.46.2.txt
\ No newline at end of file
diff --git a/TODO b/TODO
deleted file mode 100644
index d531d17..0000000
--- a/TODO
+++ /dev/null
@@ -1,277 +0,0 @@
-Need to process the bad block inode *before* doing the inode scan.
-
-Also check to see if the first block of the inode table is not on the
-bad block scan, and fix that.  We need to check for an inaccurate
-blocks, and fix them before we start doing anything else with the
-filesystem!
-
----------------------------------------------------
-User request:
-
-BTW: Could you please add some sort of deleted and possibly corrupted file
-     and inode list to e2fsck report. There should be filenames deleted
-     from directory inodes, files with duplicate blocks e.t.c.
-     It's pretty annoying to filter this information from e2fsck output
-     by hand :-
-
-------------------------------------------
-
-Add a "answer Yes always to this class of question" response.
-
-----------------------------------
-
-ext2fs_flush() should return a different error message for primary
-versus backup superblock flushing, so that mke2fs can print an
-appropriate error message.
-
----------------------------------
-Date: Mon, 08 Mar 1999 21:46:14 +0100
-From: Sergio Polini <s.polini@mclink.it>
-
-
-I'm reading the sorce code of e2fsck 1.14.
-In pass2.c, lines 352-357, I read:
-
-if ((dirent->name_len & 0xFF) > EXT2_NAME_LEN) {
-        if (fix_problem(ctx, PR_2_FILENAME_LONG, &cd->pctx)) {
-                dirent->name_len = EXT2_NAME_LEN;
-                dir_modified++;
-        }
-}
-
-I think that I'll never see any messages about too long filenames,
-because "whatever & 0xFF" can never be "> 0xFF".
-Am I wrong?
---------------------------------------
-
-Add chmod command to debugfs.
-
-------------------------------------------
-
-Date: Tue, 18 Jan 2000 17:54:53 -0800 (PST)
-From: Alan Blanchard <alan@abraxas.to>
-To: tytso@MIT.EDU
-Subject: DEBUGFS - thanks and a feature idea
-Content-Type: TEXT/PLAIN; charset=US-ASCII
-
-Theodore:
-
-First, let me thank you for writing debugfs. Recently, my Linux box
-(RH 6.0, 400 MHz PIII, on a DSL line) was hacked into.  The intruder did
-an "rm -Rf" on a 34 GB drive with about 5GB of data on it.  I was able to
-restore essentially the entire thing with debugfs and a bit of C code and Perl.
-Actually, I could have done the entire thing with debugfs and Perl, but I
-thought it would be too slow.
-
-During this exercise, I noticed that one small feature was lacking that would
-have made my job a bit easier.  The length of a deleted directory is
-reported as 0, hence debugfs won't dump the contents of the directory to a
-file using the "dump" command.  The only thing that saved me was that the
-list of disk blocks is not zeroed out.  I was able to dump the contents of the
-directories by using debugfs to get the relevant block numbers, then
-using dd to get the actual data.
-
-If debugfs had a feature where it ignored the size of a directory reported by
-the inode and instead just dumped all the blocks, it would have facilited
-things a bit. This seems like a very easy feature to add.
-
-Again, thanks for writing debugfs (and all the other Linux stuff you've written!).
-
-Cheers,
-Alan Blanchard
-alan@abraxas.to
-
-
--------------------------------------------------------------------
-
-Date: Fri, 21 Jan 2000 14:07:12 -0800
-From: "H. Peter Anvin" <hpa@www.transmeta.com>
-Subject: mkfs -cc and fsck -c
-
-b) An option to mkfs to zero the partition.  Yes, it can be done with
-dd, but it would be a nicer way of doing it.
-
-------------------------------------------------------------------
-
-Add support for in ext2fs_block_iterate() for a returning the
-compressed flag blocks to block_iterate.  Change default to not return
-EXT2_COMPRESSED_BLKADDR.  Change e2fsck to pass this flag in.
-
-(The old compression patches did this by default all the time, which
-is bad, since it meant e2fsck never saw the EXT2_COMPRESSED_BLKADDR
-flagword.
-
-------------------------------------------------------------
-
-E2fsck should offer to clear all the blocks in an indirect block, not
-the entire inode, so there's better recovery for when an indirect
-block gets trashed.
-
-
--------------------------------------------------------------
-
-From: Yann Dirson - LOGATIQUE <Yann.Dirson@France.Sun.COM>
-Date: Thu, 2 Mar 2000 13:52:13 +0100 (MET)
-
-During my experiments on the broken system, I noticed the following in
-the badblocks program (which I'm aware is not designed for IDE drives)
-- I'd probably have already fixed them if my home system was up :(
-
-* the syntax summary documents 2nd arg as blocks_count, which should
-probably read something like end_count.
-
-* testing past end of device is not detected, and lists those blocks
-as bad, whereas they simply do not exist.
-
-
-I think I'll probably add a "max count" option to findsuper(8), so
-that I do not have to wait for the whole disk to be scanned when the
-system had to be launched with "init=/bin/sh", in which case Ctrl-[CZ]
-and friends appear to be absolutely ignored.
-
-
-Somewhat unrelated, I just noticed the
-http://web.mit.edu/tytso/www/linux/ext2.html could be updated:
-
-- could mention SGI xfs (http://oss.sgi.com/projects/xfs/ - they just
-  release 0.03 snapshot)
-
-----------------------------------------------------------------
-
-Return-Path: <tytso@MIT.EDU>
-Date: Thu, 10 Feb 2000 13:20:14 -0500
-From: "Theodore Y. Ts'o" <tytso@MIT.EDU>
-To: R.E.Wolff@BitWizard.nl
-In-Reply-To: Rogier Wolff's message of Thu, 10 Feb 2000 08:46:30 +0100 (MET),
-	<200002100746.IAA24573@cave.bitwizard.nl>
-Subject: Re: e2fsck request for enhancement.
-Phone: (781) 391-3464
-
-   Date: Thu, 10 Feb 2000 08:46:30 +0100 (MET)
-   From: R.E.Wolff@BitWizard.nl (Rogier Wolff)
-
-   Lately, while trying to recover a broken disk, my system froze (twice,
-   until I tried something else) while copying the disk.
-
-   So I had a file of about 50Mb that was growing frantically at the
-   moment of the crash.
-
-   e2fsck, then finds an indirect block that is completely bogus. It
-   starts by asking me if it's ok to clear a few of the referenced
-   blocks. I say yes. Then it comes to the conclusion: 
-
-      too many invalid blocks. Clear inode?
-
-   and then I get the option to delete the whole file. Not to truncate
-   the file to a "working" size.
-
-
-   I'd MUCH rather have e2fsck say something like:
-
-      inode 1234 references an invalid block 134345454. Hmm.
-      inode 1234 references 567 out of 50176 invalid blocks, 
-			  all near the end. Truncate file to 49152 blocks?
-
-   Here you can see that of the 1024 blocks near the end of the file,
-   only 567 were detected as invalid. However now 48Mb of the file will
-   be recovered, instead of thrown away.
-
-That's a good point.  Actually, the right thing is for e2fsck to offer
-to clear all of the bad blocks in a particular indirect block.  I don't
-know how hard it would be to do that, but I'll put it on my e2fsprogs
-TODO list.
-
-							- Ted
-
----------------------------------------------------------------
-From e2fsprogs Debian TODO file as of 1.10-13.
-
-* Maybe make -dbg packages. Look at how others do it.
-
----------------------------------------------------------------
-
-Add --lba option to debian icheck command, and have ways of making it
-easier to translate LBA to filesystem block numbers.
-
--------------------------------------------------------
-
-
-
-List of projects for e2fsprogs:
-
-
-1) Make debugfs's "ncheck <inode>" command list all of the pathnames
-to an inode, not just only the first link to the inode which is found.
-(A good "intro to libext2fs programming interfaces project)
-
-	Difficulty: Low		Priority: Low
-
-2) Use a code coverage tool such as Rational's PureCoverage to see
-what kind of code coverage we have for e2fsck, and try to add test
-cases to increase the code coverage for e2fsck.
-
-	Difficulty: Medium	Priorty: Low
-
-3) Use a code coverage tool such as Rational's PureCoverage to see
-what kind of code coverage we have for resize2fs, and try to add test
-cases to increase the code coverage for resize2fs.
-
-	Difficulty: Medium	Priorty: Medium
-
-4) Create a new I/O manager (i.e., test_io.c, unix_io.c, et.al.) which
-layers on top of an existing I/O manager which provides copy-on-write
-functionality.  This COW I/O manager takes will take two open I/O
-managers, call them "base" and "changed".  The "base" I/O manager is
-opened read/only, so any changes are written instead to the "changed"
-I/O manager, in a compact, non-sparse format containing the intended
-modification to the "base" filesystem.  
-
-This will allow resize2fs to figure out what changes need to made to
-extend a filesystem, or expand the size of inodes in the inode table,
-and the changes can be pushed the filesystem in one fell swoop.  (If
-the system crashes; the program which runs the "changed" file can be
-re-run, much like a journal replay.  My assumption is that the COW
-file will contain the filesystem UUID in a the COW superblock, and the
-COW file will be stored in some place such as /var/state/e2fsprogs,
-with an init.d file to automate the replay so we can recover cleanly
-from a crash during the resize2fs process.)
-
-	Difficulty: Medium	Priority: Medium
-
-5) Create a new I/O manager (i.e., test_io.c, unix_io.c, et.al.) which
-layers on top of an existing I/O manager which provides an "undo"
-functionality.  This undo I/O manager takes will take two open I/O
-managers, call them "base" and "undo".  The "base" I/O manager is be
-opened read/write, and when any writes are sent to the I/O manager,
-the I/O manager will check the "undo" I/O manager, using a file format
-identical to the one found in (5) above.  
-
-This is useful for allowing e2fsck to create an "undo" file, which
-would make things like "e2fsck -y" much safer.
-
-	Difficulty: Low (once 5 is done)  Priority: Low
-
-6) Modify resize2fs so that it can relocate and reorganize the
-filesystem in the following ways: (1) increase the inode size, so that
-an existing filesystem can use the EA-in-inode kernel patch, (2)
-reserve blocks in the resize inode to allow for on-line resizing.  Use
-the COW I/O manager described in (5) in order to provide robustness in
-case of a crash during the resize/reorganization operation.  
-
-	Difficulty: High	Priority: Medium
-
-7) Review the EA-in-inode patches to e2fsck for correctness/code
-cleanliness.  (I will probably have to do this myself -- Ted)
-
-	Difficulty: High	Priorty: Medium
-
-8) Add support for extent maps to e2fsprogs.  I need to review the
-extent maps first/in parallel. 
-
-	Difficulty: High	Priority: Medium
-
-----------------------------------
-
-Need to deal with the case where the resize inode overlaps with the
-bad blocks inode.
-
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..13b1e02
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,178 @@
+# from http://autoconf-archive.cryp.to/ax_tls.html
+#
+# This was licensed under the GPL with the following exception:
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you make
+# and distribute a modified version of the Autoconf Macro, you may
+# extend this special exception to the GPL to apply to your modified
+# version as well.
+#
+AC_DEFUN([AX_TLS], [
+  AC_MSG_CHECKING(for thread local storage (TLS) class)
+  AC_CACHE_VAL(ac_cv_tls, [
+    ax_tls_keywords="__thread __declspec(thread) none"
+    for ax_tls_keyword in $ax_tls_keywords; do
+       case $ax_tls_keyword in
+          none) ac_cv_tls=none ; break ;;
+          *)
+             AC_TRY_COMPILE(
+                [#include <stdlib.h>
+                 static void
+                 foo(void) {
+                 static ] $ax_tls_keyword [ int bar;
+                 exit(1);
+                 }],
+                 [],
+                 [ac_cv_tls=$ax_tls_keyword ; break],
+                 ac_cv_tls=none
+             )
+          esac
+    done
+])
+
+  if test "$ac_cv_tls" != "none"; then
+    dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
+    AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
+  fi
+  AC_MSG_RESULT($ac_cv_tls)
+])
+
+# ===========================================================================
+#         http://www.nongnu.org/autoconf-archive/check_gnu_make.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   CHECK_GNU_MAKE()
+#
+# DESCRIPTION
+#
+#   This macro searches for a GNU version of make. If a match is found, the
+#   makefile variable `ifGNUmake' is set to the empty string, otherwise it
+#   is set to "#". This is useful for including a special features in a
+#   Makefile, which cannot be handled by other versions of make. The
+#   variable _cv_gnu_make_command is set to the command to invoke GNU make
+#   if it exists, the empty string otherwise.
+#
+#   Here is an example of its use:
+#
+#   Makefile.in might contain:
+#
+#       # A failsafe way of putting a dependency rule into a makefile
+#       $(DEPEND):
+#               $(CC) -MM $(srcdir)/*.c > $(DEPEND)
+#
+#       @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
+#       @ifGNUmake@ include $(DEPEND)
+#       @ifGNUmake@ endif
+#
+#   Then configure.in would normally contain:
+#
+#       CHECK_GNU_MAKE()
+#       AC_OUTPUT(Makefile)
+#
+#   Then perhaps to cause gnu make to override any other make, we could do
+#   something like this (note that GNU make always looks for GNUmakefile
+#   first):
+#
+#       if  ! test x$_cv_gnu_make_command = x ; then
+#               mv Makefile GNUmakefile
+#               echo .DEFAULT: > Makefile ;
+#               echo \  $_cv_gnu_make_command \$@ >> Makefile;
+#       fi
+#
+#   Then, if any (well almost any) other make is called, and GNU make also
+#   exists, then the other make wraps the GNU make.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
+#
+# Note: Modified by Ted Ts'o to add @ifNotGNUMake@
+
+AC_DEFUN(
+        [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
+                _cv_gnu_make_command='' ;
+dnl Search all the common names for GNU make
+                if test -n "$FORCE_NATIVE_MAKE" ; then
+                   MAKES="make"
+                else
+                   MAKES="make gmake gnumake"
+                fi
+                for a in "$MAKE" $MAKES ; do
+                        if test -z "$a" ; then continue ; fi ;
+                        if  ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
+                                _cv_gnu_make_command=$a ;
+                                break;
+                        fi
+                done ;
+        ) ;
+dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
+        if test  "x$_cv_gnu_make_command" != "x"  ; then
+                ifGNUmake='' ;
+                ifNotGNUmake='#' ;
+        else
+                ifGNUmake='#' ;
+                ifNotGNUmake='' ;
+                AC_MSG_RESULT("Not found");
+        fi
+        AC_SUBST(ifGNUmake)
+        AC_SUBST(ifNotGNUmake)
+] )
+
+# AX_CHECK_MOUNT_OPT: an autoconf macro to check for generic filesystem-
+# agnostic 'mount' options. Written by Nicholas Clark. Looks for constants in
+# sys/mount.h to predict whether the 'mount' utility will support a specific
+# mounting option.
+#
+# This macro can be used to check for the presence of 'nodev' (or other mount
+# options), which isn't uniformly implemented in the BSD family at the time of
+# this writing. Tested on FreeBSD, NetBSD, OpenBSD, and Linux.
+#
+# Usage:
+#
+# AX_CHECK_MOUNT_OPT(option)
+#
+# Defines HAVE_MOUNT_$OPTION (in uppercase) if the option exists, and sets
+# ac_cv_mount_$option (in original case) otherwise.
+#
+# Copyright (c) 2018 Nicholas Clark <nicholas.clark@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty or attribution requirement.
+
+AC_DEFUN([AX_CHECK_MOUNT_OPT], [__AX_CHECK_MOUNT_OPT(m4_tolower([$1]),m4_toupper([$1]))])
+AC_DEFUN([__AX_CHECK_MOUNT_OPT],
+[
+    AS_ECHO_N("checking for mount '$1' option... ")
+    AC_TRY_COMPILE(
+        [#include <sys/mount.h>],
+        [void *temp = (void *)(MS_$2); (void) temp;],
+        [AC_DEFINE(HAVE_MOUNT_$2, 1, [Define to 1 if mount supports $1.])
+         AS_VAR_SET(ac_cv_mount_$1, yes)
+         AS_ECHO("yes")],
+        [AC_TRY_COMPILE(
+            [#include <sys/mount.h>],
+            [void *temp = (void *)(MNT_$2); (void) temp;],
+            [AC_DEFINE(HAVE_MOUNT_$2, 1, [Define to 1 if mount supports $1.])
+             AS_VAR_SET(ac_cv_mount_$1, yes)
+             AS_ECHO("yes")],
+            [AS_VAR_SET(ac_cv_mount_$1, no)
+             AS_ECHO("no")]
+        )]
+    )
+])
diff --git a/aclocal.m4 b/aclocal.m4
index 6fd4652..0f39d30 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,66 +1,539 @@
-# codeset.m4 serial AM1 (gettext-0.10.40)
-dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
 
-dnl From Bruno Haible.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 
-AC_DEFUN([AM_LANGINFO_CODESET],
-[
-  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
-    [AC_TRY_LINK([#include <langinfo.h>],
-      [char* cs = nl_langinfo(CODESET);],
-      am_cv_langinfo_codeset=yes,
-      am_cv_langinfo_codeset=no)
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+# ===========================================================================
+#        https://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+#   This macro figures out how to build C programs using POSIX threads. It
+#   sets the PTHREAD_LIBS output variable to the threads library and linker
+#   flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+#   flags that are needed. (The user can also force certain compiler
+#   flags/libs to be tested by setting these environment variables.)
+#
+#   Also sets PTHREAD_CC to any special C compiler that is needed for
+#   multi-threaded programs (defaults to the value of CC otherwise). (This
+#   is necessary on AIX to use the special cc_r compiler alias.)
+#
+#   NOTE: You are assumed to not only compile your program with these flags,
+#   but also to link with them as well. For example, you might link with
+#   $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+#   If you are only building threaded programs, you may wish to use these
+#   variables in your default LIBS, CFLAGS, and CC:
+#
+#     LIBS="$PTHREAD_LIBS $LIBS"
+#     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#     CC="$PTHREAD_CC"
+#
+#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+#   has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
+#   that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+#   Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
+#   PTHREAD_PRIO_INHERIT symbol is defined when compiling with
+#   PTHREAD_CFLAGS.
+#
+#   ACTION-IF-FOUND is a list of shell commands to run if a threads library
+#   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+#   is not found. If ACTION-IF-FOUND is not specified, the default action
+#   will define HAVE_PTHREAD.
+#
+#   Please let the authors know if this macro fails on any platform, or if
+#   you have any other suggestions or comments. This macro was based on work
+#   by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+#   from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+#   Alejandro Forero Cuervo to the autoconf macro repository. We are also
+#   grateful for the helpful feedback of numerous users.
+#
+#   Updated for Autoconf 2.68 by Daniel Richard G.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
+#   Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 24
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_SED])
+AC_LANG_PUSH([C])
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on Tru64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
+        ax_pthread_save_CC="$CC"
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
+        AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
+        AC_MSG_RESULT([$ax_pthread_ok])
+        if test "x$ax_pthread_ok" = "xno"; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        CC="$ax_pthread_save_CC"
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
+#           (Note: HP C rejects this with "bad form for `-t' option")
+# -pthreads: Solaris/gcc (Note: HP C also rejects)
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads and
+#      -D_REENTRANT too), HP C (must be checked before -lpthread, which
+#      is present but should not be used directly; and before -mthreads,
+#      because the compiler interprets this as "-mt" + "-hreads")
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case $host_os in
+
+        freebsd*)
+
+        # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+        # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+
+        ax_pthread_flags="-kthread lthread $ax_pthread_flags"
+        ;;
+
+        hpux*)
+
+        # From the cc(1) man page: "[-mt] Sets various -D flags to enable
+        # multi-threading and also sets -lpthread."
+
+        ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
+        ;;
+
+        openedition*)
+
+        # IBM z/OS requires a feature-test macro to be defined in order to
+        # enable POSIX threads at all, so give the user a hint if this is
+        # not set. (We don't define these ourselves, as they can affect
+        # other portions of the system API in unpredictable ways.)
+
+        AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
+            [
+#            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
+             AX_PTHREAD_ZOS_MISSING
+#            endif
+            ],
+            [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
+        ;;
+
+        solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed. (N.B.: The stubs are missing
+        # pthread_cleanup_push, or rather a function called by this macro,
+        # so we could check for that, but who knows whether they'll stub
+        # that too in a future libc.)  So we'll check first for the
+        # standard Solaris way of linking pthreads (-mt -lpthread).
+
+        ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
+        ;;
+esac
+
+# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
+
+AS_IF([test "x$GCC" = "xyes"],
+      [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
+
+# The presence of a feature test macro requesting re-entrant function
+# definitions is, on some systems, a strong hint that pthreads support is
+# correctly enabled
+
+case $host_os in
+        darwin* | hpux* | linux* | osf* | solaris*)
+        ax_pthread_check_macro="_REENTRANT"
+        ;;
+
+        aix*)
+        ax_pthread_check_macro="_THREAD_SAFE"
+        ;;
+
+        *)
+        ax_pthread_check_macro="--"
+        ;;
+esac
+AS_IF([test "x$ax_pthread_check_macro" = "x--"],
+      [ax_pthread_check_cond=0],
+      [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
+
+# Are we compiling with Clang?
+
+AC_CACHE_CHECK([whether $CC is Clang],
+    [ax_cv_PTHREAD_CLANG],
+    [ax_cv_PTHREAD_CLANG=no
+     # Note that Autoconf sets GCC=yes for Clang as well as GCC
+     if test "x$GCC" = "xyes"; then
+        AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
+            [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
+#            if defined(__clang__) && defined(__llvm__)
+             AX_PTHREAD_CC_IS_CLANG
+#            endif
+            ],
+            [ax_cv_PTHREAD_CLANG=yes])
+     fi
     ])
-  if test $am_cv_langinfo_codeset = yes; then
-    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
-      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
-  fi
-])
-# gettext.m4 serial 28 (gettext-0.13)
-dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
+
+ax_pthread_clang_warning=no
+
+# Clang needs special handling, because older versions handle the -pthread
+# option in a rather... idiosyncratic way
+
+if test "x$ax_pthread_clang" = "xyes"; then
+
+        # Clang takes -pthread; it has never supported any other flag
+
+        # (Note 1: This will need to be revisited if a system that Clang
+        # supports has POSIX threads in a separate library.  This tends not
+        # to be the way of modern systems, but it's conceivable.)
+
+        # (Note 2: On some systems, notably Darwin, -pthread is not needed
+        # to get POSIX threads support; the API is always present and
+        # active.  We could reasonably leave PTHREAD_CFLAGS empty.  But
+        # -pthread does define _REENTRANT, and while the Darwin headers
+        # ignore this macro, third-party headers might not.)
+
+        PTHREAD_CFLAGS="-pthread"
+        PTHREAD_LIBS=
+
+        ax_pthread_ok=yes
+
+        # However, older versions of Clang make a point of warning the user
+        # that, in an invocation where only linking and no compilation is
+        # taking place, the -pthread option has no effect ("argument unused
+        # during compilation").  They expect -pthread to be passed in only
+        # when source code is being compiled.
+        #
+        # Problem is, this is at odds with the way Automake and most other
+        # C build frameworks function, which is that the same flags used in
+        # compilation (CFLAGS) are also used in linking.  Many systems
+        # supported by AX_PTHREAD require exactly this for POSIX threads
+        # support, and in fact it is often not straightforward to specify a
+        # flag that is used only in the compilation phase and not in
+        # linking.  Such a scenario is extremely rare in practice.
+        #
+        # Even though use of the -pthread flag in linking would only print
+        # a warning, this can be a nuisance for well-run software projects
+        # that build with -Werror.  So if the active version of Clang has
+        # this misfeature, we search for an option to squash it.
+
+        AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
+            [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
+            [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
+             # Create an alternate version of $ac_link that compiles and
+             # links in two steps (.c -> .o, .o -> exe) instead of one
+             # (.c -> exe), because the warning occurs only in the second
+             # step
+             ax_pthread_save_ac_link="$ac_link"
+             ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
+             ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
+             ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
+             ax_pthread_save_CFLAGS="$CFLAGS"
+             for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
+                AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
+                CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
+                ac_link="$ax_pthread_save_ac_link"
+                AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
+                    [ac_link="$ax_pthread_2step_ac_link"
+                     AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
+                         [break])
+                    ])
+             done
+             ac_link="$ax_pthread_save_ac_link"
+             CFLAGS="$ax_pthread_save_CFLAGS"
+             AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
+             ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
+            ])
+
+        case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
+                no | unknown) ;;
+                *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
+        esac
+
+fi # $ax_pthread_clang = yes
+
+if test "x$ax_pthread_ok" = "xno"; then
+for ax_pthread_try_flag in $ax_pthread_flags; do
+
+        case $ax_pthread_try_flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -mt,pthread)
+                AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
+                PTHREAD_CFLAGS="-mt"
+                PTHREAD_LIBS="-lpthread"
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
+                PTHREAD_CFLAGS="$ax_pthread_try_flag"
+                ;;
+
+                pthread-config)
+                AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
+                AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+                ;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
+                PTHREAD_LIBS="-l$ax_pthread_try_flag"
+                ;;
+        esac
+
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
+#                       if $ax_pthread_check_cond
+#                        error "$ax_pthread_check_macro must be defined"
+#                       endif
+                        static void routine(void *a) { a = 0; }
+                        static void *start_routine(void *a) { return a; }],
+                       [pthread_t th; pthread_attr_t attr;
+                        pthread_create(&th, 0, start_routine, 0);
+                        pthread_join(th, 0);
+                        pthread_attr_init(&attr);
+                        pthread_cleanup_push(routine, 0);
+                        pthread_cleanup_pop(0) /* ; */])],
+            [ax_pthread_ok=yes],
+            [])
+
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+
+        AC_MSG_RESULT([$ax_pthread_ok])
+        AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = "xyes"; then
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+        AC_CACHE_CHECK([for joinable pthread attribute],
+            [ax_cv_PTHREAD_JOINABLE_ATTR],
+            [ax_cv_PTHREAD_JOINABLE_ATTR=unknown
+             for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+                 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
+                                                 [int attr = $ax_pthread_attr; return attr /* ; */])],
+                                [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
+                                [])
+             done
+            ])
+        AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
+               test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
+               test "x$ax_pthread_joinable_attr_defined" != "xyes"],
+              [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
+                                  [$ax_cv_PTHREAD_JOINABLE_ATTR],
+                                  [Define to necessary symbol if this constant
+                                   uses a non-standard name on your system.])
+               ax_pthread_joinable_attr_defined=yes
+              ])
+
+        AC_CACHE_CHECK([whether more special flags are required for pthreads],
+            [ax_cv_PTHREAD_SPECIAL_FLAGS],
+            [ax_cv_PTHREAD_SPECIAL_FLAGS=no
+             case $host_os in
+             solaris*)
+             ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
+             ;;
+             esac
+            ])
+        AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
+               test "x$ax_pthread_special_flags_added" != "xyes"],
+              [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
+               ax_pthread_special_flags_added=yes])
+
+        AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
+            [ax_cv_PTHREAD_PRIO_INHERIT],
+            [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
+                                             [[int i = PTHREAD_PRIO_INHERIT;]])],
+                            [ax_cv_PTHREAD_PRIO_INHERIT=yes],
+                            [ax_cv_PTHREAD_PRIO_INHERIT=no])
+            ])
+        AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
+               test "x$ax_pthread_prio_inherit_defined" != "xyes"],
+              [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
+               ax_pthread_prio_inherit_defined=yes
+              ])
+
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+
+        # More AIX lossage: compile with *_r variant
+        if test "x$GCC" != "xyes"; then
+            case $host_os in
+                aix*)
+                AS_CASE(["x/$CC"],
+                    [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
+                    [#handle absolute path differently from PATH based program lookup
+                     AS_CASE(["x$CC"],
+                         [x/*],
+                         [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
+                         [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
+                ;;
+            esac
+        fi
+fi
+
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+AC_SUBST([PTHREAD_LIBS])
+AC_SUBST([PTHREAD_CFLAGS])
+AC_SUBST([PTHREAD_CC])
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test "x$ax_pthread_ok" = "xyes"; then
+        ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
+        :
+else
+        ax_pthread_ok=no
+        $2
+fi
+AC_LANG_POP
+])dnl AX_PTHREAD
+
+# gettext.m4 serial 71 (gettext-0.20.2)
+dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
 
 dnl Macro to add for using GNU gettext.
 
 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
-dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
-dnl    default (if it is not specified or empty) is 'no-libtool'.
-dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
-dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl INTLSYMBOL must be one of 'external', 'use-libtool'.
+dnl    INTLSYMBOL should be 'external' for packages other than GNU gettext, and
+dnl    'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'.
 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
-dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
-dnl    $(top_builddir)/intl/libintl.a will be created.
+dnl    AM-DISABLE-SHARED).
 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
 dnl    implementations (in libc or libintl) without the ngettext() function
 dnl    will be ignored.  If NEEDSYMBOL is specified and is
 dnl    'need-formatstring-macros', then GNU gettext implementations that don't
 dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
 dnl INTLDIR is used to find the intl libraries.  If empty,
-dnl    the value `$(top_builddir)/intl/' is used.
+dnl    the value '$(top_builddir)/intl/' is used.
 dnl
 dnl The result of the configuration is one of three cases:
 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
@@ -82,14 +555,19 @@
 AC_DEFUN([AM_GNU_GETTEXT],
 [
   dnl Argument checking.
-  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], ,
     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
-])])])])])
+])])])])
+  ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+    [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported.
+])])
   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
 ])])])])
-  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
-  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
+  define([gt_included_intl],
+    ifelse([$1], [external], [no], [yes]))
+  gt_NEEDS_INIT
+  AM_GNU_GETTEXT_NEED([$2])
 
   AC_REQUIRE([AM_PO_SUBDIRS])dnl
   ifelse(gt_included_intl, yes, [
@@ -103,20 +581,22 @@
   dnl Sometimes libintl requires libiconv, so first search for libiconv.
   dnl Ideally we would do this search only after the
   dnl      if test "$USE_NLS" = "yes"; then
-  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+  dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
   dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
   dnl the configure script would need to contain the same shell code
   dnl again, outside any 'if'. There are two solutions:
   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
-  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
-  dnl documented, we avoid it.
+  dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it.
   ifelse(gt_included_intl, yes, , [
     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
   ])
 
+  dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
+  gt_INTL_MACOSX
+
   dnl Set USE_NLS.
-  AM_NLS
+  AC_REQUIRE([AM_NLS])
 
   ifelse(gt_included_intl, yes, [
     BUILD_INCLUDED_LIBINTL=no
@@ -126,16 +606,25 @@
   LTLIBINTL=
   POSUB=
 
+  dnl Add a version number to the cache macros.
+  case " $gt_needs " in
+    *" need-formatstring-macros "*) gt_api_version=3 ;;
+    *" need-ngettext "*) gt_api_version=2 ;;
+    *) gt_api_version=1 ;;
+  esac
+  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
   dnl If we use NLS figure out what method
   if test "$USE_NLS" = "yes"; then
     gt_use_preinstalled_gnugettext=no
     ifelse(gt_included_intl, yes, [
       AC_MSG_CHECKING([whether included gettext is requested])
-      AC_ARG_WITH(included-gettext,
+      AC_ARG_WITH([included-gettext],
         [  --with-included-gettext use the GNU gettext library included here],
         nls_cv_force_use_gnu_gettext=$withval,
         nls_cv_force_use_gnu_gettext=no)
-      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+      AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
 
       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
@@ -144,28 +633,46 @@
         dnl to use.  If GNU gettext is available we use this.  Else we have
         dnl to fall back to GNU NLS library.
 
-        dnl Add a version number to the cache macros.
-        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
-        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
-        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
-
-        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
-         [AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+        if test $gt_api_version -ge 3; then
+          gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
 #endif
 changequote(,)dnl
 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
 changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
-extern int *_nl_domain_bindings;],
-            [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
-            gt_cv_func_gnugettext_libc=yes,
-            gt_cv_func_gnugettext_libc=no)])
+'
+        else
+          gt_revision_test_code=
+        fi
+        if test $gt_api_version -ge 2; then
+          gt_expression_test_code=' + * ngettext ("", "", 0)'
+        else
+          gt_expression_test_code=
+        fi
 
-        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
+        AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+         [AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+               ]],
+               [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+               ]])],
+            [eval "$gt_func_gnugettext_libc=yes"],
+            [eval "$gt_func_gnugettext_libc=no"])])
+
+        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
           dnl Sometimes libintl requires libiconv, so first search for libiconv.
           ifelse(gt_included_intl, yes, , [
             AM_ICONV_LINK
@@ -176,53 +683,63 @@
           dnl even if libiconv doesn't exist.
           AC_LIB_LINKFLAGS_BODY([intl])
           AC_CACHE_CHECK([for GNU gettext in libintl],
-            gt_cv_func_gnugettext_libintl,
+            [$gt_func_gnugettext_libintl],
            [gt_save_CPPFLAGS="$CPPFLAGS"
             CPPFLAGS="$CPPFLAGS $INCINTL"
             gt_save_LIBS="$LIBS"
             LIBS="$LIBS $LIBINTL"
             dnl Now see whether libintl exists and does not depend on libiconv.
-            AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
+            AC_LINK_IFELSE(
+              [AC_LANG_PROGRAM(
+                 [[
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
-const char *_nl_expand_alias ();],
-              [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
-              gt_cv_func_gnugettext_libintl=yes,
-              gt_cv_func_gnugettext_libintl=no)
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+                 ]],
+                 [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+                 ]])],
+              [eval "$gt_func_gnugettext_libintl=yes"],
+              [eval "$gt_func_gnugettext_libintl=no"])
             dnl Now see whether libintl exists and depends on libiconv.
-            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
+            if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
               LIBS="$LIBS $LIBICONV"
-              AC_TRY_LINK([#include <libintl.h>
-]ifelse([$2], [need-formatstring-macros],
-[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-], [])[extern int _nl_msg_cat_cntr;
+              AC_LINK_IFELSE(
+                [AC_LANG_PROGRAM(
+                   [[
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
-const char *_nl_expand_alias ();],
-                [bindtextdomain ("", "");
-return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
-               [LIBINTL="$LIBINTL $LIBICONV"
-                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
-                gt_cv_func_gnugettext_libintl=yes
-               ])
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+                   ]],
+                   [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+                   ]])],
+                [LIBINTL="$LIBINTL $LIBICONV"
+                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                 eval "$gt_func_gnugettext_libintl=yes"
+                ])
             fi
             CPPFLAGS="$gt_save_CPPFLAGS"
             LIBS="$gt_save_LIBS"])
@@ -232,8 +749,8 @@
         dnl use it.  But if this macro is used in GNU gettext, and GNU
         dnl gettext is already preinstalled in libintl, we update this
         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
-        if test "$gt_cv_func_gnugettext_libc" = "yes" \
-           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
+        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
                 && test "$PACKAGE" != gettext-runtime \
                 && test "$PACKAGE" != gettext-tools; }; then
           gt_use_preinstalled_gnugettext=yes
@@ -256,11 +773,12 @@
         dnl Mark actions used to generate GNU NLS library.
         BUILD_INCLUDED_LIBINTL=yes
         USE_INCLUDED_LIBINTL=yes
-        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
-        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
+        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD"
+        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD"
         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
       fi
 
+      CATOBJEXT=
       if test "$gt_use_preinstalled_gnugettext" = "yes" \
          || test "$nls_cv_use_gnu_gettext" = "yes"; then
         dnl Mark actions to use GNU gettext tools.
@@ -268,9 +786,18 @@
       fi
     ])
 
+    if test -n "$INTL_MACOSX_LIBS"; then
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Some extra flags are needed during linking.
+        LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+      fi
+    fi
+
     if test "$gt_use_preinstalled_gnugettext" = "yes" \
        || test "$nls_cv_use_gnu_gettext" = "yes"; then
-      AC_DEFINE(ENABLE_NLS, 1,
+      AC_DEFINE([ENABLE_NLS], [1],
         [Define to 1 if translation of program messages to the user's native language
    is requested.])
     else
@@ -283,7 +810,7 @@
   if test "$USE_NLS" = "yes"; then
     AC_MSG_CHECKING([where the gettext function comes from])
     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
-      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
         gt_source="external libintl"
       else
         gt_source="libc"
@@ -297,16 +824,16 @@
   if test "$USE_NLS" = "yes"; then
 
     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
-      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
+      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
         AC_MSG_CHECKING([how to link with libintl])
         AC_MSG_RESULT([$LIBINTL])
         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
       fi
 
       dnl For backward compatibility. Some packages may be using this.
-      AC_DEFINE(HAVE_GETTEXT, 1,
+      AC_DEFINE([HAVE_GETTEXT], [1],
        [Define if the GNU gettext() function is already present or preinstalled.])
-      AC_DEFINE(HAVE_DCGETTEXT, 1,
+      AC_DEFINE([HAVE_DCGETTEXT], [1],
        [Define if the GNU dcgettext() function is already present or preinstalled.])
     fi
 
@@ -315,238 +842,731 @@
   fi
 
   ifelse(gt_included_intl, yes, [
-    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
-    dnl to 'yes' because some of the testsuite requires it.
-    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
-      BUILD_INCLUDED_LIBINTL=yes
-    fi
+    dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes'
+    dnl because some of the testsuite requires it.
+    BUILD_INCLUDED_LIBINTL=yes
 
     dnl Make all variables we use known to autoconf.
-    AC_SUBST(BUILD_INCLUDED_LIBINTL)
-    AC_SUBST(USE_INCLUDED_LIBINTL)
-    AC_SUBST(CATOBJEXT)
-
-    dnl For backward compatibility. Some configure.ins may be using this.
-    nls_cv_header_intl=
-    nls_cv_header_libgt=
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    DATADIRNAME=share
-    AC_SUBST(DATADIRNAME)
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    INSTOBJEXT=.mo
-    AC_SUBST(INSTOBJEXT)
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    GENCAT=gencat
-    AC_SUBST(GENCAT)
-
-    dnl For backward compatibility. Some Makefiles may be using this.
-    if test "$USE_INCLUDED_LIBINTL" = yes; then
-      INTLOBJS="\$(GETTOBJS)"
-    fi
-    AC_SUBST(INTLOBJS)
-
-    dnl Enable libtool support if the surrounding package wishes it.
-    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
-    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
+    AC_SUBST([BUILD_INCLUDED_LIBINTL])
+    AC_SUBST([USE_INCLUDED_LIBINTL])
+    AC_SUBST([CATOBJEXT])
   ])
 
   dnl For backward compatibility. Some Makefiles may be using this.
   INTLLIBS="$LIBINTL"
-  AC_SUBST(INTLLIBS)
+  AC_SUBST([INTLLIBS])
 
   dnl Make all documented variables known to autoconf.
-  AC_SUBST(LIBINTL)
-  AC_SUBST(LTLIBINTL)
-  AC_SUBST(POSUB)
+  AC_SUBST([LIBINTL])
+  AC_SUBST([LTLIBINTL])
+  AC_SUBST([POSUB])
 ])
 
 
-dnl Checks for all prerequisites of the intl subdirectory,
-dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
-dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
-AC_DEFUN([AM_INTL_SUBDIR],
+dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
+m4_define([gt_NEEDS_INIT],
 [
-  AC_REQUIRE([AC_PROG_INSTALL])dnl
-  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
-  AC_REQUIRE([AC_PROG_CC])dnl
-  AC_REQUIRE([AC_CANONICAL_HOST])dnl
-  AC_REQUIRE([AC_PROG_RANLIB])dnl
-  AC_REQUIRE([AC_ISC_POSIX])dnl
-  AC_REQUIRE([AC_HEADER_STDC])dnl
-  AC_REQUIRE([AC_C_CONST])dnl
-  AC_REQUIRE([bh_C_SIGNED])dnl
-  AC_REQUIRE([AC_C_INLINE])dnl
-  AC_REQUIRE([AC_TYPE_OFF_T])dnl
-  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
-  AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
-  AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
-  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
-  AC_REQUIRE([gt_TYPE_WINT_T])dnl
-  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
-  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
-  AC_REQUIRE([gt_TYPE_INTMAX_T])
-  AC_REQUIRE([gt_PRINTF_POSIX])
-  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
-  AC_REQUIRE([AC_FUNC_MMAP])dnl
-  AC_REQUIRE([jm_GLIBC21])dnl
-  AC_REQUIRE([gt_INTDIV0])dnl
-  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
-  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
-  AC_REQUIRE([gt_INTTYPES_PRI])dnl
-  AC_REQUIRE([gl_XSIZE])dnl
-
-  AC_CHECK_TYPE([ptrdiff_t], ,
-    [AC_DEFINE([ptrdiff_t], [long],
-       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
-    ])
-  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
-stdlib.h string.h unistd.h sys/param.h])
-  AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
-mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
-strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
-__fsetlocking])
-
-  dnl Use the _snprintf function only if it is declared (because on NetBSD it
-  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
-  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
-  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
-
-  dnl Use the *_unlocked functions only if they are declared.
-  dnl (because some of them were defined without being declared in Solaris
-  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
-  dnl on Solaris 2.5.1 to run on Solaris 2.6).
-  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
-  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
-  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
-  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
-
-  case $gt_cv_func_printf_posix in
-    *yes) HAVE_POSIX_PRINTF=1 ;;
-    *) HAVE_POSIX_PRINTF=0 ;;
-  esac
-  AC_SUBST([HAVE_POSIX_PRINTF])
-  if test "$ac_cv_func_asprintf" = yes; then
-    HAVE_ASPRINTF=1
-  else
-    HAVE_ASPRINTF=0
-  fi
-  AC_SUBST([HAVE_ASPRINTF])
-  if test "$ac_cv_func_snprintf" = yes; then
-    HAVE_SNPRINTF=1
-  else
-    HAVE_SNPRINTF=0
-  fi
-  AC_SUBST([HAVE_SNPRINTF])
-  if test "$ac_cv_func_wprintf" = yes; then
-    HAVE_WPRINTF=1
-  else
-    HAVE_WPRINTF=0
-  fi
-  AC_SUBST([HAVE_WPRINTF])
-
-  AM_ICONV
-  AM_LANGINFO_CODESET
-  if test $ac_cv_header_locale_h = yes; then
-    AM_LC_MESSAGES
-  fi
-
-  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
-  dnl because plural.y uses bison specific features. It requires at least
-  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
-  dnl compile.
-  dnl bison is only needed for the maintainer (who touches plural.y). But in
-  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
-  dnl the rule in general Makefile. Now, some people carelessly touch the
-  dnl files or have a broken "make" program, hence the plural.c rule will
-  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
-  dnl present or too old.
-  AC_CHECK_PROGS([INTLBISON], [bison])
-  if test -z "$INTLBISON"; then
-    ac_verc_fail=yes
-  else
-    dnl Found it, now check the version.
-    AC_MSG_CHECKING([version of bison])
-changequote(<<,>>)dnl
-    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-    case $ac_prog_version in
-      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
-changequote([,])dnl
-         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-    esac
-    AC_MSG_RESULT([$ac_prog_version])
-  fi
-  if test $ac_verc_fail = yes; then
-    INTLBISON=:
-  fi
+  m4_divert_text([DEFAULTS], [gt_needs=])
+  m4_define([gt_NEEDS_INIT], [])
 ])
 
 
-dnl gt_CHECK_DECL(FUNC, INCLUDES)
-dnl Check whether a function is declared.
-AC_DEFUN([gt_CHECK_DECL],
+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
+AC_DEFUN([AM_GNU_GETTEXT_NEED],
 [
-  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
-    [AC_TRY_COMPILE([$2], [
-#ifndef $1
-  char *p = (char *) $1;
-#endif
-], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
-  if test $ac_cv_have_decl_$1 = yes; then
-    gt_value=1
-  else
-    gt_value=0
-  fi
-  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
-    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
+  m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
 ])
 
 
 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
-# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
-dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
 
-# Test for the GNU C Library, version 2.1 or newer.
-# From Bruno Haible.
 
-AC_DEFUN([jm_GLIBC21],
-  [
-    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
-      ac_cv_gnu_library_2_1,
-      [AC_EGREP_CPP([Lucky GNU user],
-	[
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-  Lucky GNU user
- #endif
+dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
+
+# host-cpu-c-abi.m4 serial 13
+dnl Copyright (C) 2002-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible and Sam Steingold.
+
+dnl Sets the HOST_CPU variable to the canonical name of the CPU.
+dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
+dnl C language ABI (application binary interface).
+dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
+dnl config.h.
+dnl
+dnl This canonical name can be used to select a particular assembly language
+dnl source file that will interoperate with C code on the given host.
+dnl
+dnl For example:
+dnl * 'i386' and 'sparc' are different canonical names, because code for i386
+dnl   will not run on SPARC CPUs and vice versa. They have different
+dnl   instruction sets.
+dnl * 'sparc' and 'sparc64' are different canonical names, because code for
+dnl   'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
+dnl   contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
+dnl   instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
+dnl   mode, but not both.
+dnl * 'mips' and 'mipsn32' are different canonical names, because they use
+dnl   different argument passing and return conventions for C functions, and
+dnl   although the instruction set of 'mips' is a large subset of the
+dnl   instruction set of 'mipsn32'.
+dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
+dnl   different sizes for the C types like 'int' and 'void *', and although
+dnl   the instruction sets of 'mipsn32' and 'mips64' are the same.
+dnl * The same canonical name is used for different endiannesses. You can
+dnl   determine the endianness through preprocessor symbols:
+dnl   - 'arm': test __ARMEL__.
+dnl   - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
+dnl   - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
+dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
+dnl   (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
+dnl   - Instructions that do not exist on all of these CPUs (cmpxchg,
+dnl     MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
+dnl     assembly language source files use such instructions, you will
+dnl     need to make the distinction.
+dnl   - Speed of execution of the common instruction set is reasonable across
+dnl     the entire family of CPUs. If you have assembly language source files
+dnl     that are optimized for particular CPU types (like GNU gmp has), you
+dnl     will need to make the distinction.
+dnl   See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
+AC_DEFUN([gl_HOST_CPU_C_ABI],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_C_ASM])
+  AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
+    [case "$host_cpu" in
+
+changequote(,)dnl
+       i[34567]86 )
+changequote([,])dnl
+         gl_cv_host_cpu_c_abi=i386
+         ;;
+
+       x86_64 )
+         # On x86_64 systems, the C compiler may be generating code in one of
+         # these ABIs:
+         # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+         # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+         #   with native Windows (mingw, MSVC).
+         # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if (defined __x86_64__ || defined __amd64__ \
+                     || defined _M_X64 || defined _M_AMD64)
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if defined __ILP32__ || defined _ILP32
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
+              [gl_cv_host_cpu_c_abi=x86_64-x32],
+              [gl_cv_host_cpu_c_abi=x86_64])],
+           [gl_cv_host_cpu_c_abi=i386])
+         ;;
+
+changequote(,)dnl
+       alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
+changequote([,])dnl
+         gl_cv_host_cpu_c_abi=alpha
+         ;;
+
+       arm* | aarch64 )
+         # Assume arm with EABI.
+         # On arm64 systems, the C compiler may be generating code in one of
+         # these ABIs:
+         # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+         # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#ifdef __aarch64__
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                [[#if defined __ILP32__ || defined _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+              [gl_cv_host_cpu_c_abi=arm64-ilp32],
+              [gl_cv_host_cpu_c_abi=arm64])],
+           [# Don't distinguish little-endian and big-endian arm, since they
+            # don't require different machine code for simple operations and
+            # since the user can distinguish them through the preprocessor
+            # defines __ARMEL__ vs. __ARMEB__.
+            # But distinguish arm which passes floating-point arguments and
+            # return values in integer registers (r0, r1, ...) - this is
+            # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
+            # passes them in float registers (s0, s1, ...) and double registers
+            # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
+            # sets the preprocessor defines __ARM_PCS (for the first case) and
+            # __ARM_PCS_VFP (for the second case), but older GCC does not.
+            echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
+            # Look for a reference to the register d0 in the .s file.
+            AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+            if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
+              gl_cv_host_cpu_c_abi=armhf
+            else
+              gl_cv_host_cpu_c_abi=arm
+            fi
+            rm -f conftest*
+           ])
+         ;;
+
+       hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+         # On hppa, the C compiler may be generating 32-bit code or 64-bit
+         # code. In the latter case, it defines _LP64 and __LP64__.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#ifdef __LP64__
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=hppa64],
+           [gl_cv_host_cpu_c_abi=hppa])
+         ;;
+
+       ia64* )
+         # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+         # 32-bit code. In the latter case, it defines _ILP32.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#ifdef _ILP32
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=ia64-ilp32],
+           [gl_cv_host_cpu_c_abi=ia64])
+         ;;
+
+       mips* )
+         # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+         # at 32.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=mips64],
+           [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
+            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
+            # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
+            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
+            AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if (_MIPS_SIM == _ABIN32)
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
+              [gl_cv_host_cpu_c_abi=mipsn32],
+              [gl_cv_host_cpu_c_abi=mips])])
+         ;;
+
+       powerpc* )
+         # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+         # No need to distinguish them here; the caller may distinguish
+         # them based on the OS.
+         # On powerpc64 systems, the C compiler may still be generating
+         # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+         # be generating 64-bit code.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __powerpc64__ || defined _ARCH_PPC64
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [# On powerpc64, there are two ABIs on Linux: The AIX compatible
+            # one and the ELFv2 one. The latter defines _CALL_ELF=2.
+            AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if defined _CALL_ELF && _CALL_ELF == 2
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
+              [gl_cv_host_cpu_c_abi=powerpc64-elfv2],
+              [gl_cv_host_cpu_c_abi=powerpc64])
+           ],
+           [gl_cv_host_cpu_c_abi=powerpc])
+         ;;
+
+       rs6000 )
+         gl_cv_host_cpu_c_abi=powerpc
+         ;;
+
+       riscv32 | riscv64 )
+         # There are 2 architectures (with variants): rv32* and rv64*.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if __riscv_xlen == 64
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [cpu=riscv64],
+           [cpu=riscv32])
+         # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+         # Size of 'long' and 'void *':
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __LP64__
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [main_abi=lp64],
+           [main_abi=ilp32])
+         # Float ABIs:
+         # __riscv_float_abi_double:
+         #   'float' and 'double' are passed in floating-point registers.
+         # __riscv_float_abi_single:
+         #   'float' are passed in floating-point registers.
+         # __riscv_float_abi_soft:
+         #   No values are passed in floating-point registers.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __riscv_float_abi_double
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [float_abi=d],
+           [AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if defined __riscv_float_abi_single
+                     int ok;
+                   #else
+                     error fail
+                   #endif
+                 ]])],
+              [float_abi=f],
+              [float_abi=''])
+           ])
+         gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
+         ;;
+
+       s390* )
+         # On s390x, the C compiler may be generating 64-bit (= s390x) code
+         # or 31-bit (= s390) code.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __LP64__ || defined __s390x__
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=s390x],
+           [gl_cv_host_cpu_c_abi=s390])
+         ;;
+
+       sparc | sparc64 )
+         # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+         # C compiler still generates 32-bit code.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __sparcv9 || defined __arch64__
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=sparc64],
+           [gl_cv_host_cpu_c_abi=sparc])
+         ;;
+
+       *)
+         gl_cv_host_cpu_c_abi="$host_cpu"
+         ;;
+     esac
+    ])
+
+  dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
+  HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
+  HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
+  AC_SUBST([HOST_CPU])
+  AC_SUBST([HOST_CPU_C_ABI])
+
+  # This was
+  #   AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
+  #   AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
+  # earlier, but KAI C++ 3.2d doesn't like this.
+  sed -e 's/-/_/g' >> confdefs.h <<EOF
+#ifndef __${HOST_CPU}__
+#define __${HOST_CPU}__ 1
 #endif
-	],
-	ac_cv_gnu_library_2_1=yes,
-	ac_cv_gnu_library_2_1=no)
-      ]
-    )
-    AC_SUBST(GLIBC21)
-    GLIBC21="$ac_cv_gnu_library_2_1"
-  ]
-)
-# iconv.m4 serial AM4 (gettext-0.11.3)
-dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+#ifndef __${HOST_CPU_C_ABI}__
+#define __${HOST_CPU_C_ABI}__ 1
+#endif
+EOF
+  AH_TOP([/* CPU and C ABI indicator */
+#ifndef __i386__
+#undef __i386__
+#endif
+#ifndef __x86_64_x32__
+#undef __x86_64_x32__
+#endif
+#ifndef __x86_64__
+#undef __x86_64__
+#endif
+#ifndef __alpha__
+#undef __alpha__
+#endif
+#ifndef __arm__
+#undef __arm__
+#endif
+#ifndef __armhf__
+#undef __armhf__
+#endif
+#ifndef __arm64_ilp32__
+#undef __arm64_ilp32__
+#endif
+#ifndef __arm64__
+#undef __arm64__
+#endif
+#ifndef __hppa__
+#undef __hppa__
+#endif
+#ifndef __hppa64__
+#undef __hppa64__
+#endif
+#ifndef __ia64_ilp32__
+#undef __ia64_ilp32__
+#endif
+#ifndef __ia64__
+#undef __ia64__
+#endif
+#ifndef __m68k__
+#undef __m68k__
+#endif
+#ifndef __mips__
+#undef __mips__
+#endif
+#ifndef __mipsn32__
+#undef __mipsn32__
+#endif
+#ifndef __mips64__
+#undef __mips64__
+#endif
+#ifndef __powerpc__
+#undef __powerpc__
+#endif
+#ifndef __powerpc64__
+#undef __powerpc64__
+#endif
+#ifndef __powerpc64_elfv2__
+#undef __powerpc64_elfv2__
+#endif
+#ifndef __riscv32__
+#undef __riscv32__
+#endif
+#ifndef __riscv64__
+#undef __riscv64__
+#endif
+#ifndef __riscv32_ilp32__
+#undef __riscv32_ilp32__
+#endif
+#ifndef __riscv32_ilp32f__
+#undef __riscv32_ilp32f__
+#endif
+#ifndef __riscv32_ilp32d__
+#undef __riscv32_ilp32d__
+#endif
+#ifndef __riscv64_ilp32__
+#undef __riscv64_ilp32__
+#endif
+#ifndef __riscv64_ilp32f__
+#undef __riscv64_ilp32f__
+#endif
+#ifndef __riscv64_ilp32d__
+#undef __riscv64_ilp32d__
+#endif
+#ifndef __riscv64_lp64__
+#undef __riscv64_lp64__
+#endif
+#ifndef __riscv64_lp64f__
+#undef __riscv64_lp64f__
+#endif
+#ifndef __riscv64_lp64d__
+#undef __riscv64_lp64d__
+#endif
+#ifndef __s390__
+#undef __s390__
+#endif
+#ifndef __s390x__
+#undef __s390x__
+#endif
+#ifndef __sh__
+#undef __sh__
+#endif
+#ifndef __sparc__
+#undef __sparc__
+#endif
+#ifndef __sparc64__
+#undef __sparc64__
+#endif
+])
+
+])
+
+
+dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
+dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
+dnl one, or to 'unknown' if unknown.
+dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
+AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
+    [if test -n "$gl_cv_host_cpu_c_abi"; then
+       case "$gl_cv_host_cpu_c_abi" in
+         i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+           gl_cv_host_cpu_c_abi_32bit=yes ;;
+         x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+           gl_cv_host_cpu_c_abi_32bit=no ;;
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown ;;
+       esac
+     else
+       case "$host_cpu" in
+
+         # CPUs that only support a 32-bit ABI.
+         arc \
+         | bfin \
+         | cris* \
+         | csky \
+         | epiphany \
+         | ft32 \
+         | h8300 \
+         | m68k \
+         | microblaze | microblazeel \
+         | nds32 | nds32le | nds32be \
+         | nios2 | nios2eb | nios2el \
+         | or1k* \
+         | or32 \
+         | sh | sh[1234] | sh[1234]e[lb] \
+         | tic6x \
+         | xtensa* )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         # CPUs that only support a 64-bit ABI.
+changequote(,)dnl
+         alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+         | mmix )
+changequote([,])dnl
+           gl_cv_host_cpu_c_abi_32bit=no
+           ;;
+
+changequote(,)dnl
+         i[34567]86 )
+changequote([,])dnl
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         x86_64 )
+           # On x86_64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+           # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+           #   with native Windows (mingw, MSVC).
+           # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if (defined __x86_64__ || defined __amd64__ \
+                       || defined _M_X64 || defined _M_AMD64) \
+                      && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         arm* | aarch64 )
+           # Assume arm with EABI.
+           # On arm64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+           # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+           # On hppa, the C compiler may be generating 32-bit code or 64-bit
+           # code. In the latter case, it defines _LP64 and __LP64__.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#ifdef __LP64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         ia64* )
+           # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+           # 32-bit code. In the latter case, it defines _ILP32.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#ifdef _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=yes],
+             [gl_cv_host_cpu_c_abi_32bit=no])
+           ;;
+
+         mips* )
+           # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+           # at 32.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         powerpc* )
+           # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+           # No need to distinguish them here; the caller may distinguish
+           # them based on the OS.
+           # On powerpc64 systems, the C compiler may still be generating
+           # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+           # be generating 64-bit code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __powerpc64__ || defined _ARCH_PPC64
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         rs6000 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         riscv32 | riscv64 )
+           # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+           # Size of 'long' and 'void *':
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __LP64__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         s390* )
+           # On s390x, the C compiler may be generating 64-bit (= s390x) code
+           # or 31-bit (= s390) code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __LP64__ || defined __s390x__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         sparc | sparc64 )
+           # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+           # C compiler still generates 32-bit code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __sparcv9 || defined __arch64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown
+           ;;
+       esac
+     fi
+    ])
+
+  HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+])
+
+# iconv.m4 serial 21
+dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
@@ -565,6 +1585,7 @@
 [
   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
   dnl those with the standalone portable GNU libiconv installed).
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
   dnl accordingly.
@@ -573,34 +1594,185 @@
   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
   dnl because if the user has installed libiconv and not disabled its use
   dnl via --without-libiconv-prefix, he wants to use it. The first
-  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
+  dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
   am_save_CPPFLAGS="$CPPFLAGS"
   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
 
-  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
+  AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
-    AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-      [iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);],
-      am_cv_func_iconv=yes)
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[
+#include <stdlib.h>
+#include <iconv.h>
+         ]],
+         [[iconv_t cd = iconv_open("","");
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);]])],
+      [am_cv_func_iconv=yes])
     if test "$am_cv_func_iconv" != yes; then
       am_save_LIBS="$LIBS"
       LIBS="$LIBS $LIBICONV"
-      AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
-        [iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);],
-        am_cv_lib_iconv=yes
-        am_cv_func_iconv=yes)
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
+#include <stdlib.h>
+#include <iconv.h>
+           ]],
+           [[iconv_t cd = iconv_open("","");
+             iconv(cd,NULL,NULL,NULL,NULL);
+             iconv_close(cd);]])],
+        [am_cv_lib_iconv=yes]
+        [am_cv_func_iconv=yes])
       LIBS="$am_save_LIBS"
     fi
   ])
   if test "$am_cv_func_iconv" = yes; then
-    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
+    AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
+      dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
+      dnl Solaris 10.
+      am_save_LIBS="$LIBS"
+      if test $am_cv_lib_iconv = yes; then
+        LIBS="$LIBS $LIBICONV"
+      fi
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        AC_RUN_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[
+#include <iconv.h>
+#include <string.h>
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+             ]],
+             [[int result = 0;
+  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
+     returns.  */
+  {
+    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+    if (cd_utf8_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_utf8_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
+      }
+  }
+  /* Test against Solaris 10 bug: Failures are not distinguishable from
+     successful returns.  */
+  {
+    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+    if (cd_ascii_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\263";
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_ascii_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
+      }
+  }
+  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304";
+        static char buf[2] = { (char)0xDE, (char)0xAD };
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = 1;
+        char *outptr = buf;
+        size_t outbytesleft = 1;
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#if 0 /* This bug could be worked around by the caller.  */
+  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        char buf[50];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if ((int)res > 0)
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#endif
+  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+     provided.  */
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
+  return result;
+]])],
+          [am_cv_func_iconv_works=yes], ,
+          [case "$host_os" in
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac])
+        test "$am_cv_func_iconv_works" = no || break
+      done
+      LIBS="$am_save_LIBS"
+    ])
+    case "$am_cv_func_iconv_works" in
+      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+      *)   am_func_iconv=yes ;;
+    esac
+  else
+    am_func_iconv=no am_cv_lib_iconv=no
+  fi
+  if test "$am_func_iconv" = yes; then
+    AC_DEFINE([HAVE_ICONV], [1],
+      [Define if you have the iconv() function and it works.])
   fi
   if test "$am_cv_lib_iconv" = yes; then
     AC_MSG_CHECKING([how to link with libiconv])
@@ -612,453 +1784,370 @@
     LIBICONV=
     LTLIBICONV=
   fi
-  AC_SUBST(LIBICONV)
-  AC_SUBST(LTLIBICONV)
+  AC_SUBST([LIBICONV])
+  AC_SUBST([LTLIBICONV])
 ])
 
-AC_DEFUN([AM_ICONV],
+dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
+dnl avoid warnings like
+dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
+dnl This is tricky because of the way 'aclocal' is implemented:
+dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
+dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
+dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
+dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
+dnl   warnings.
+m4_define([gl_iconv_AC_DEFUN],
+  m4_version_prereq([2.64],
+    [[AC_DEFUN_ONCE(
+        [$1], [$2])]],
+    [m4_ifdef([gl_00GNULIB],
+       [[AC_DEFUN_ONCE(
+           [$1], [$2])]],
+       [[AC_DEFUN(
+           [$1], [$2])]])]))
+gl_iconv_AC_DEFUN([AM_ICONV],
 [
   AM_ICONV_LINK
   if test "$am_cv_func_iconv" = yes; then
     AC_MSG_CHECKING([for iconv declaration])
-    AC_CACHE_VAL(am_cv_proto_iconv, [
-      AC_TRY_COMPILE([
+    AC_CACHE_VAL([am_cv_proto_iconv], [
+      AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
 #include <stdlib.h>
 #include <iconv.h>
 extern
 #ifdef __cplusplus
 "C"
 #endif
-#if defined(__STDC__) || defined(__cplusplus)
+#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
 #else
 size_t iconv();
 #endif
-], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
+           ]],
+           [[]])],
+        [am_cv_proto_iconv_arg1=""],
+        [am_cv_proto_iconv_arg1="const"])
       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
-    AC_MSG_RESULT([$]{ac_t:-
-         }[$]am_cv_proto_iconv)
-    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
-      [Define as const if the declaration of iconv() needs const.])
+    AC_MSG_RESULT([
+         $am_cv_proto_iconv])
+  else
+    dnl When compiling GNU libiconv on a system that does not have iconv yet,
+    dnl pick the POSIX compliant declaration without 'const'.
+    am_cv_proto_iconv_arg1=""
   fi
-])
-# intdiv0.m4 serial 1 (gettext-0.11.3)
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([gt_INTDIV0],
-[
-  AC_REQUIRE([AC_PROG_CC])dnl
-  AC_REQUIRE([AC_CANONICAL_HOST])dnl
-
-  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
-    gt_cv_int_divbyzero_sigfpe,
-    [
-      AC_TRY_RUN([
-#include <stdlib.h>
-#include <signal.h>
-
-static void
-#ifdef __cplusplus
-sigfpe_handler (int sig)
-#else
-sigfpe_handler (sig) int sig;
-#endif
-{
-  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
-  exit (sig != SIGFPE);
-}
-
-int x = 1;
-int y = 0;
-int z;
-int nan;
-
-int main ()
-{
-  signal (SIGFPE, sigfpe_handler);
-/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
-#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
-  signal (SIGTRAP, sigfpe_handler);
-#endif
-/* Linux/SPARC yields signal SIGILL.  */
-#if defined (__sparc__) && defined (__linux__)
-  signal (SIGILL, sigfpe_handler);
-#endif
-
-  z = x / y;
-  nan = y / y;
-  exit (1);
-}
-], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
-        [
-          # Guess based on the CPU.
-          case "$host_cpu" in
-            alpha* | i[34567]86 | m68k | s390*)
-              gt_cv_int_divbyzero_sigfpe="guessing yes";;
-            *)
-              gt_cv_int_divbyzero_sigfpe="guessing no";;
-          esac
-        ])
+  AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+    [Define as const if the declaration of iconv() needs const.])
+  dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+  m4_ifdef([gl_ICONV_H_DEFAULTS],
+    [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+     if test -n "$am_cv_proto_iconv_arg1"; then
+       ICONV_CONST="const"
+     fi
     ])
-  case "$gt_cv_int_divbyzero_sigfpe" in
-    *yes) value=1;;
-    *) value=0;;
-  esac
-  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
-    [Define if integer division by zero raises signal SIGFPE.])
 ])
-# intmax.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
 
-dnl From Bruno Haible.
-dnl Test whether the system has the 'intmax_t' type, but don't attempt to
-dnl find a replacement if it is lacking.
-
-AC_DEFUN([gt_TYPE_INTMAX_T],
-[
-  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
-  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
-  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
-    [AC_TRY_COMPILE([
-#include <stddef.h> 
-#include <stdlib.h>
-#if HAVE_STDINT_H_WITH_UINTMAX
-#include <stdint.h>
-#endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-#include <inttypes.h>
-#endif
-], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
-  if test $gt_cv_c_intmax_t = yes; then
-    AC_DEFINE(HAVE_INTMAX_T, 1,
-      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
-  fi
-])
-# inttypes.m4 serial 1 (gettext-0.11.4)
-dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
-# <sys/types.h>.
-
-AC_DEFUN([gt_HEADER_INTTYPES_H],
-[
-  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
-  [
-    AC_TRY_COMPILE(
-      [#include <sys/types.h>
-#include <inttypes.h>],
-      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
-  ])
-  if test $gt_cv_header_inttypes_h = yes; then
-    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
-      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
-  fi
-])
-# inttypes_h.m4 serial 5 (gettext-0.12)
-dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
-# doesn't clash with <sys/types.h>, and declares uintmax_t.
-
-AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
-[
-  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
-#include <inttypes.h>],
-    [uintmax_t i = (uintmax_t) -1;],
-    jm_ac_cv_header_inttypes_h=yes,
-    jm_ac_cv_header_inttypes_h=no)])
-  if test $jm_ac_cv_header_inttypes_h = yes; then
-    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
-      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
-       and declares uintmax_t. ])
-  fi
-])
-# inttypes-pri.m4 serial 1 (gettext-0.11.4)
-dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
-# macros to non-string values.  This is the case on AIX 4.3.3.
-
-AC_DEFUN([gt_INTTYPES_PRI],
-[
-  AC_REQUIRE([gt_HEADER_INTTYPES_H])
-  if test $gt_cv_header_inttypes_h = yes; then
-    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
-      gt_cv_inttypes_pri_broken,
-      [
-        AC_TRY_COMPILE([#include <inttypes.h>
-#ifdef PRId32
-char *p = PRId32;
-#endif
-], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
-      ])
-  fi
-  if test "$gt_cv_inttypes_pri_broken" = yes; then
-    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
-      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
-  fi
-])
-# isc-posix.m4 serial 2 (gettext-0.11.2)
-dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
-
-# This test replaces the one in autoconf.
-# Currently this macro should have the same name as the autoconf macro
-# because gettext's gettext.m4 (distributed in the automake package)
-# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
-# give these diagnostics:
-#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
-#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
-
-undefine([AC_ISC_POSIX])
-
-AC_DEFUN([AC_ISC_POSIX],
-  [
-    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
-    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
-  ]
-)
-# lcmessage.m4 serial 3 (gettext-0.11.3)
-dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+# intlmacosx.m4 serial 8 (gettext-0.20.2)
+dnl Copyright (C) 2004-2014, 2016, 2019-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
-dnl Authors:
-dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
-
-# Check whether LC_MESSAGES is available in <locale.h>.
-
-AC_DEFUN([AM_LC_MESSAGES],
+dnl Checks for special options needed on Mac OS X.
+dnl Defines INTL_MACOSX_LIBS.
+AC_DEFUN([gt_INTL_MACOSX],
 [
-  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
-    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
-       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
-  if test $am_cv_val_LC_MESSAGES = yes; then
-    AC_DEFINE(HAVE_LC_MESSAGES, 1,
-      [Define if your <locale.h> file defines LC_MESSAGES.])
+  dnl Check for API introduced in Mac OS X 10.4.
+  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
+    [gt_cv_func_CFPreferencesCopyAppValue],
+    [gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <CoreFoundation/CFPreferences.h>]],
+          [[CFPreferencesCopyAppValue(NULL, NULL)]])],
+       [gt_cv_func_CFPreferencesCopyAppValue=yes],
+       [gt_cv_func_CFPreferencesCopyAppValue=no])
+     LIBS="$gt_save_LIBS"])
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
+      [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
   fi
+  dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
+  dnl because in macOS 10.13.4 it has the following behaviour:
+  dnl When two or more languages are specified in the
+  dnl "System Preferences > Language & Region > Preferred Languages" panel,
+  dnl it returns en_CC where CC is the territory (even when English is not among
+  dnl the preferred languages!).  What we want instead is what
+  dnl CFLocaleCopyCurrent returned in earlier macOS releases and what
+  dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
+  dnl first among the preferred languages and CC is the territory.
+  AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
+    [gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <CoreFoundation/CFLocale.h>]],
+          [[CFLocaleCopyPreferredLanguages();]])],
+       [gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
+       [gt_cv_func_CFLocaleCopyPreferredLanguages=no])
+     LIBS="$gt_save_LIBS"])
+  if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+    AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
+      [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
+  fi
+  INTL_MACOSX_LIBS=
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+     || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+  fi
+  AC_SUBST([INTL_MACOSX_LIBS])
 ])
-# lib-ld.m4 serial 3 (gettext-0.13)
-dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+
+# lib-ld.m4 serial 9
+dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 
 dnl Subroutines of libtool.m4,
-dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
-dnl with libtool.m4.
+dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
+dnl collision with libtool.m4.
 
-dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
 AC_DEFUN([AC_LIB_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
-  acl_cv_prog_gnu_ld=yes ;;
+  acl_cv_prog_gnu_ld=yes
+  ;;
 *)
-  acl_cv_prog_gnu_ld=no ;;
+  acl_cv_prog_gnu_ld=no
+  ;;
 esac])
 with_gnu_ld=$acl_cv_prog_gnu_ld
 ])
 
-dnl From libtool-1.4. Sets the variable LD.
+dnl From libtool-2.4. Sets the variable LD.
 AC_DEFUN([AC_LIB_PROG_LD],
-[AC_ARG_WITH(gnu-ld,
-[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
+[AC_REQUIRE([AC_PROG_CC])dnl
 AC_REQUIRE([AC_CANONICAL_HOST])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+        [assume the C compiler uses GNU ld [default=no]])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by GCC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]* | [A-Za-z]:[\\/]*)]
-      [re_direlt='/[^/][^/]*/\.\./']
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
+
+if test -n "$LD"; then
+  AC_MSG_CHECKING([for ld])
+elif test "$GCC" = yes; then
+  AC_MSG_CHECKING([for ld used by $CC])
 elif test "$with_gnu_ld" = yes; then
   AC_MSG_CHECKING([for GNU ld])
 else
   AC_MSG_CHECKING([for non-GNU ld])
 fi
-AC_CACHE_VAL(acl_cv_path_LD,
-[if test -z "$LD"; then
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break ;;
-      *)
-	test "$with_gnu_ld" != yes && break ;;
+if test -n "$LD"; then
+  # Let the user override the test with a path.
+  :
+else
+  AC_CACHE_VAL([acl_cv_path_LD],
+  [
+    acl_cv_path_LD= # Final result of this test
+    ac_prog=ld # Program to search in $PATH
+    if test "$GCC" = yes; then
+      # Check if gcc -print-prog-name=ld gives a path.
+      case $host in
+        *-*-mingw*)
+          # gcc leaves a trailing carriage return which upsets mingw
+          acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+        *)
+          acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+      esac
+      case $acl_output in
+        # Accept absolute paths.
+        [[\\/]]* | ?:[[\\/]]*)
+          re_direlt='/[[^/]][[^/]]*/\.\./'
+          # Canonicalize the pathname of ld
+          acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+          while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+            acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+          done
+          # Got the pathname. No search in PATH is needed.
+          acl_cv_path_LD="$acl_output"
+          ac_prog=
+          ;;
+        "")
+          # If it fails, then pretend we aren't using GCC.
+          ;;
+        *)
+          # If it is relative, then search for the first ld in PATH.
+          with_gnu_ld=unknown
+          ;;
       esac
     fi
-  done
-  IFS="$ac_save_ifs"
-else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
+    if test -n "$ac_prog"; then
+      # Search for $ac_prog in $PATH.
+      acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+      for ac_dir in $PATH; do
+        IFS="$acl_save_ifs"
+        test -z "$ac_dir" && ac_dir=.
+        if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+          acl_cv_path_LD="$ac_dir/$ac_prog"
+          # Check to see if the program is GNU ld.  I'd rather use --version,
+          # but apparently some variants of GNU ld only accept -v.
+          # Break only if it was the GNU/non-GNU ld that we prefer.
+          case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+            *GNU* | *'with BFD'*)
+              test "$with_gnu_ld" != no && break
+              ;;
+            *)
+              test "$with_gnu_ld" != yes && break
+              ;;
+          esac
+        fi
+      done
+      IFS="$acl_save_ifs"
+    fi
+    case $host in
+      *-*-aix*)
+        AC_COMPILE_IFELSE(
+          [AC_LANG_SOURCE(
+             [[#if defined __powerpc64__ || defined _ARCH_PPC64
+                int ok;
+               #else
+                error fail
+               #endif
+             ]])],
+          [# The compiler produces 64-bit code. Add option '-b64' so that the
+           # linker groks 64-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -b64 "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+           esac
+          ], [])
+        ;;
+      sparc64-*-netbsd*)
+        AC_COMPILE_IFELSE(
+          [AC_LANG_SOURCE(
+             [[#if defined __sparcv9 || defined __arch64__
+                int ok;
+               #else
+                error fail
+               #endif
+             ]])],
+          [],
+          [# The compiler produces 32-bit code. Add option '-m elf32_sparc'
+           # so that the linker groks 32-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -m elf32_sparc "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+           esac
+          ])
+        ;;
+    esac
+  ])
+  LD="$acl_cv_path_LD"
 fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+if test -n "$LD"; then
+  AC_MSG_RESULT([$LD])
+else
+  AC_MSG_RESULT([no])
+  AC_MSG_ERROR([no acceptable ld found in \$PATH])
+fi
 AC_LIB_PROG_LD_GNU
 ])
-# lib-link.m4 serial 4 (gettext-0.12)
-dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+
+# lib-link.m4 serial 31
+dnl Copyright (C) 2001-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
+AC_PREREQ([2.61])
+
 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 dnl the libraries corresponding to explicit and implicit dependencies.
 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
 dnl augments the CPPFLAGS variable.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 AC_DEFUN([AC_LIB_LINKFLAGS],
 [
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
   AC_REQUIRE([AC_LIB_RPATH])
-  define([Name],[translit([$1],[./-], [___])])
-  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([Name],[m4_translit([$1],[./+-], [____])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
     AC_LIB_LINKFLAGS_BODY([$1], [$2])
     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
   ])
   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
   AC_SUBST([LIB]NAME)
   AC_SUBST([LTLIB]NAME)
+  AC_SUBST([LIB]NAME[_PREFIX])
   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
   dnl results of this search when this library appears as a dependency.
   HAVE_LIB[]NAME=yes
-  undefine([Name])
-  undefine([NAME])
+  popdef([NAME])
+  popdef([Name])
 ])
 
-dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
 dnl searches for libname and the libraries corresponding to explicit and
 dnl implicit dependencies, together with the specified include files and
-dnl the ability to compile and link the specified testcode. If found, it
-dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
-dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl the ability to compile and link the specified testcode. The missing-message
+dnl defaults to 'no' and may contain additional hints for the user.
+dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
+dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 [
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
   AC_REQUIRE([AC_LIB_RPATH])
-  define([Name],[translit([$1],[./-], [___])])
-  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  pushdef([Name],[m4_translit([$1],[./+-], [____])])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
 
   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
   dnl accordingly.
@@ -1072,13 +2161,26 @@
 
   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
     ac_save_LIBS="$LIBS"
-    LIBS="$LIBS $LIB[]NAME"
-    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
+    dnl because these -l options might require -L options that are present in
+    dnl LIBS. -l options benefit only from the -L options listed before it.
+    dnl Otherwise, add it to the front of LIBS, because it may be a static
+    dnl library that depends on another static library that is present in LIBS.
+    dnl Static libraries benefit only from the static libraries listed after
+    dnl it.
+    case " $LIB[]NAME" in
+      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
+      *)       LIBS="$LIB[]NAME $LIBS" ;;
+    esac
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM([[$3]], [[$4]])],
+      [ac_cv_lib[]Name=yes],
+      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
     LIBS="$ac_save_LIBS"
   ])
   if test "$ac_cv_lib[]Name" = yes; then
     HAVE_LIB[]NAME=yes
-    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
     AC_MSG_CHECKING([how to link with lib[]$1])
     AC_MSG_RESULT([$LIB[]NAME])
   else
@@ -1088,24 +2190,34 @@
     CPPFLAGS="$ac_save_CPPFLAGS"
     LIB[]NAME=
     LTLIB[]NAME=
+    LIB[]NAME[]_PREFIX=
   fi
   AC_SUBST([HAVE_LIB]NAME)
   AC_SUBST([LIB]NAME)
   AC_SUBST([LTLIB]NAME)
-  undefine([Name])
-  undefine([NAME])
+  AC_SUBST([LIB]NAME[_PREFIX])
+  popdef([NAME])
+  popdef([Name])
 ])
 
 dnl Determine the platform dependent parameters needed to use rpath:
-dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
-dnl hardcode_direct, hardcode_minus_L.
+dnl   acl_libext,
+dnl   acl_shlibext,
+dnl   acl_libname_spec,
+dnl   acl_library_names_spec,
+dnl   acl_hardcode_libdir_flag_spec,
+dnl   acl_hardcode_libdir_separator,
+dnl   acl_hardcode_direct,
+dnl   acl_hardcode_minus_L.
 AC_DEFUN([AC_LIB_RPATH],
 [
+  dnl Complain if config.rpath is missing.
+  AC_REQUIRE_AUX_FILE([config.rpath])
   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
-  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
+  AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
     . ./conftest.sh
@@ -1113,34 +2225,66 @@
     acl_cv_rpath=done
   ])
   wl="$acl_cv_wl"
-  libext="$acl_cv_libext"
-  shlibext="$acl_cv_shlibext"
-  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-  hardcode_direct="$acl_cv_hardcode_direct"
-  hardcode_minus_L="$acl_cv_hardcode_minus_L"
+  acl_libext="$acl_cv_libext"
+  acl_shlibext="$acl_cv_shlibext"
+  acl_libname_spec="$acl_cv_libname_spec"
+  acl_library_names_spec="$acl_cv_library_names_spec"
+  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  acl_hardcode_direct="$acl_cv_hardcode_direct"
+  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
   dnl Determine whether the user wants rpath handling at all.
-  AC_ARG_ENABLE(rpath,
+  AC_ARG_ENABLE([rpath],
     [  --disable-rpath         do not hardcode runtime library paths],
     :, enable_rpath=yes)
 ])
 
+dnl AC_LIB_FROMPACKAGE(name, package)
+dnl declares that libname comes from the given package. The configure file
+dnl will then not have a --with-libname-prefix option but a
+dnl --with-package-prefix option. Several libraries can come from the same
+dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
+dnl macro call that searches for libname.
+AC_DEFUN([AC_LIB_FROMPACKAGE],
+[
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+  define([acl_frompackage_]NAME, [$2])
+  popdef([NAME])
+  pushdef([PACK],[$2])
+  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+  define([acl_libsinpackage_]PACKUP,
+    m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
+  popdef([PACKUP])
+  popdef([PACK])
+])
+
 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
 dnl the libraries corresponding to explicit and implicit dependencies.
 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 [
-  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
-                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
+                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
+  pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
+                                     [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
+  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
   dnl By default, look in $includedir and $libdir.
   use_additional=yes
   AC_LIB_WITH_FINAL_PREFIX([
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
+    eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+    eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
   ])
-  AC_LIB_ARG_WITH([lib$1-prefix],
-[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
-  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
+  AC_ARG_WITH(PACK[-prefix],
+[[  --with-]]PACK[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
+  --without-]]PACK[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
 [
     if test "X$withval" = "Xno"; then
       use_additional=no
@@ -1149,18 +2293,32 @@
         AC_LIB_WITH_FINAL_PREFIX([
           eval additional_includedir=\"$includedir\"
           eval additional_libdir=\"$libdir\"
+          eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+          eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
         ])
       else
         additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
+        additional_libdir="$withval/$acl_libdirstem"
+        additional_libdir2="$withval/$acl_libdirstem2"
+        additional_libdir3="$withval/$acl_libdirstem3"
       fi
     fi
 ])
+  if test "X$additional_libdir2" = "X$additional_libdir"; then
+    additional_libdir2=
+  fi
+  if test "X$additional_libdir3" = "X$additional_libdir"; then
+    additional_libdir3=
+  fi
   dnl Search the library and its dependencies in $additional_libdir and
   dnl $LDFLAGS. Using breadth-first-seach.
   LIB[]NAME=
   LTLIB[]NAME=
   INC[]NAME=
+  LIB[]NAME[]_PREFIX=
+  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
+  dnl computed. So it has to be reset here.
+  HAVE_LIB[]NAME=
   rpathdirs=
   ltrpathdirs=
   names_already_handled=
@@ -1180,7 +2338,7 @@
         names_already_handled="$names_already_handled $name"
         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
         dnl or AC_LIB_HAVE_LINKFLAGS call.
-        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
         eval value=\"\$HAVE_LIB$uppername\"
         if test -n "$value"; then
           if test "$value" = yes; then
@@ -1200,22 +2358,61 @@
           found_la=
           found_so=
           found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
+          else
+            shrext=
+          fi
           if test $use_additional = yes; then
-            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
-              found_dir="$additional_libdir"
-              found_so="$additional_libdir/lib$name.$shlibext"
-              if test -f "$additional_libdir/lib$name.la"; then
-                found_la="$additional_libdir/lib$name.la"
-              fi
-            else
-              if test -f "$additional_libdir/lib$name.$libext"; then
-                found_dir="$additional_libdir"
-                found_a="$additional_libdir/lib$name.$libext"
-                if test -f "$additional_libdir/lib$name.la"; then
-                  found_la="$additional_libdir/lib$name.la"
+            for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+              if test "X$found_dir" = "X"; then
+                eval dir=\$$additional_libdir_variable
+                if test -n "$dir"; then
+                  dnl The same code as in the loop below:
+                  dnl First look for a shared library.
+                  if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                  dnl Then look for a static library.
+                  if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                 fi
               fi
-            fi
+            done
           fi
           if test "X$found_dir" = "X"; then
             for x in $LDFLAGS $LTLIB[]NAME; do
@@ -1223,21 +2420,46 @@
               case "$x" in
                 -L*)
                   dir=`echo "X$x" | sed -e 's/^X-L//'`
-                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
-                    found_dir="$dir"
-                    found_so="$dir/lib$name.$shlibext"
-                    if test -f "$dir/lib$name.la"; then
-                      found_la="$dir/lib$name.la"
-                    fi
-                  else
-                    if test -f "$dir/lib$name.$libext"; then
+                  dnl First look for a shared library.
+                  if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
                       found_dir="$dir"
-                      found_a="$dir/lib$name.$libext"
-                      if test -f "$dir/lib$name.la"; then
-                        found_la="$dir/lib$name.la"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
                       fi
                     fi
                   fi
+                  dnl Then look for a static library.
+                  if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                   ;;
               esac
               if test "X$found_dir" != "X"; then
@@ -1252,7 +2474,10 @@
               dnl Linking with a shared library. We attempt to hardcode its
               dnl directory into the executable's runpath, unless it's the
               dnl standard /usr/lib.
-              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+              if test "$enable_rpath" = no \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
                 dnl No hardcoding is needed.
                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
               else
@@ -1271,12 +2496,12 @@
                   ltrpathdirs="$ltrpathdirs $found_dir"
                 fi
                 dnl The hardcoding into $LIBNAME is system dependent.
-                if test "$hardcode_direct" = yes; then
+                if test "$acl_hardcode_direct" = yes; then
                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
                   dnl resulting binary.
                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
                 else
-                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
                     dnl Use an explicit option to hardcode DIR into the resulting
                     dnl binary.
                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
@@ -1307,13 +2532,13 @@
                     if test -z "$haveit"; then
                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
                     fi
-                    if test "$hardcode_minus_L" != no; then
+                    if test "$acl_hardcode_minus_L" != no; then
                       dnl FIXME: Not sure whether we should use
                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
                       dnl here.
                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
                     else
-                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
                       dnl here, because this doesn't fit in flags passed to the
                       dnl compiler. So give up. No hardcoding. This affects only
                       dnl very old systems.
@@ -1338,8 +2563,25 @@
             dnl Assume the include files are nearby.
             additional_includedir=
             case "$found_dir" in
-              */lib | */lib/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                if test "$name" = '$1'; then
+                  LIB[]NAME[]_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem2 | */$acl_libdirstem2/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+                if test "$name" = '$1'; then
+                  LIB[]NAME[]_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem3 | */$acl_libdirstem3/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+                if test "$name" = '$1'; then
+                  LIB[]NAME[]_PREFIX="$basedir"
+                fi
                 additional_includedir="$basedir/include"
                 ;;
             esac
@@ -1356,7 +2598,7 @@
                 if test "X$additional_includedir" = "X/usr/local/include"; then
                   if test -n "$GCC"; then
                     case $host_os in
-                      linux*) haveit=yes;;
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
                     esac
                   fi
                 fi
@@ -1392,20 +2634,24 @@
               for dep in $dependency_libs; do
                 case "$dep" in
                   -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+                    dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                    dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME.
                     dnl But don't add it
                     dnl   1. if it's the standard /usr/lib,
                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
                     dnl   3. if it's already present in $LDFLAGS or the already
                     dnl      constructed $LIBNAME,
                     dnl   4. if it doesn't exist as a directory.
-                    if test "X$additional_libdir" != "X/usr/lib"; then
+                    if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
                       haveit=
-                      if test "X$additional_libdir" = "X/usr/local/lib"; then
+                      if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
                         if test -n "$GCC"; then
                           case $host_os in
-                            linux*) haveit=yes;;
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
                           esac
                         fi
                       fi
@@ -1413,29 +2659,29 @@
                         haveit=
                         for x in $LDFLAGS $LIB[]NAME; do
                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LIBNAME.
-                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                            dnl Really add $dependency_libdir to $LIBNAME.
+                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir"
                           fi
                         fi
                         haveit=
                         for x in $LDFLAGS $LTLIB[]NAME; do
                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LTLIBNAME.
-                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                            dnl Really add $dependency_libdir to $LTLIBNAME.
+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir"
                           fi
                         fi
                       fi
@@ -1501,18 +2747,18 @@
     done
   done
   if test "X$rpathdirs" != "X"; then
-    if test -n "$hardcode_libdir_separator"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
       dnl Weird platform: only the last -rpath option counts, the user must
       dnl pass all path elements in one option. We can arrange that for a
       dnl single library, but not when more than one $LIBNAMEs are used.
       alldirs=
       for found_dir in $rpathdirs; do
-        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
       done
-      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
+      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
       acl_save_libdir="$libdir"
       libdir="$alldirs"
-      eval flag=\"$hardcode_libdir_flag_spec\"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
       libdir="$acl_save_libdir"
       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
     else
@@ -1520,7 +2766,7 @@
       for found_dir in $rpathdirs; do
         acl_save_libdir="$libdir"
         libdir="$found_dir"
-        eval flag=\"$hardcode_libdir_flag_spec\"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
         libdir="$acl_save_libdir"
         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
       done
@@ -1533,6 +2779,10 @@
       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
     done
   fi
+  popdef([PACKLIBS])
+  popdef([PACKUP])
+  popdef([PACK])
+  popdef([NAME])
 ])
 
 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
@@ -1555,23 +2805,95 @@
     fi
   done
 ])
-# lib-prefix.m4 serial 3 (gettext-0.13)
-dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+  AC_REQUIRE([AC_LIB_RPATH])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  $1=
+  if test "$enable_rpath" != no; then
+    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+      dnl Use an explicit option to hardcode directories into the resulting
+      dnl binary.
+      rpathdirs=
+      next=
+      for opt in $2; do
+        if test -n "$next"; then
+          dir="$next"
+          dnl No need to hardcode the standard /usr/lib.
+          if test "X$dir" != "X/usr/$acl_libdirstem" \
+             && test "X$dir" != "X/usr/$acl_libdirstem2" \
+             && test "X$dir" != "X/usr/$acl_libdirstem3"; then
+            rpathdirs="$rpathdirs $dir"
+          fi
+          next=
+        else
+          case $opt in
+            -L) next=yes ;;
+            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+                 dnl No need to hardcode the standard /usr/lib.
+                 if test "X$dir" != "X/usr/$acl_libdirstem" \
+                    && test "X$dir" != "X/usr/$acl_libdirstem2" \
+                    && test "X$dir" != "X/usr/$acl_libdirstem3"; then
+                   rpathdirs="$rpathdirs $dir"
+                 fi
+                 next= ;;
+            *) next= ;;
+          esac
+        fi
+      done
+      if test "X$rpathdirs" != "X"; then
+        if test -n ""$3""; then
+          dnl libtool is used for linking. Use -R options.
+          for dir in $rpathdirs; do
+            $1="${$1}${$1:+ }-R$dir"
+          done
+        else
+          dnl The linker is used for linking directly.
+          if test -n "$acl_hardcode_libdir_separator"; then
+            dnl Weird platform: only the last -rpath option counts, the user
+            dnl must pass all path elements in one option.
+            alldirs=
+            for dir in $rpathdirs; do
+              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
+            done
+            acl_save_libdir="$libdir"
+            libdir="$alldirs"
+            eval flag=\"$acl_hardcode_libdir_flag_spec\"
+            libdir="$acl_save_libdir"
+            $1="$flag"
+          else
+            dnl The -rpath options are cumulative.
+            for dir in $rpathdirs; do
+              acl_save_libdir="$libdir"
+              libdir="$dir"
+              eval flag=\"$acl_hardcode_libdir_flag_spec\"
+              libdir="$acl_save_libdir"
+              $1="${$1}${$1:+ }$flag"
+            done
+          fi
+        fi
+      fi
+    fi
+  fi
+  AC_SUBST([$1])
+])
+
+# lib-prefix.m4 serial 17
+dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
-dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
-dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
-dnl require excessive bracketing.
-ifdef([AC_HELP_STRING],
-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
-[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
-
 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
 dnl to access previously installed libraries. The basic assumption is that
 dnl a user will want packages to use other packages he previously installed
@@ -1583,6 +2905,7 @@
   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
   dnl By default, look in $includedir and $libdir.
   use_additional=yes
@@ -1590,9 +2913,9 @@
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
   ])
-  AC_LIB_ARG_WITH([lib-prefix],
-[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
-  --without-lib-prefix    don't search for libraries in includedir and libdir],
+  AC_ARG_WITH([lib-prefix],
+[[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+  --without-lib-prefix    don't search for libraries in includedir and libdir]],
 [
     if test "X$withval" = "Xno"; then
       use_additional=no
@@ -1604,7 +2927,7 @@
         ])
       else
         additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
+        additional_libdir="$withval/$acl_libdirstem"
       fi
     fi
 ])
@@ -1628,7 +2951,7 @@
         if test "X$additional_includedir" = "X/usr/local/include"; then
           if test -n "$GCC"; then
             case $host_os in
-              linux*) haveit=yes;;
+              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
             esac
           fi
         fi
@@ -1646,7 +2969,7 @@
     dnl   2. if it's already present in $LDFLAGS,
     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
     dnl   4. if it doesn't exist as a directory.
-    if test "X$additional_libdir" != "X/usr/lib"; then
+    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
       haveit=
       for x in $LDFLAGS; do
         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
@@ -1656,7 +2979,7 @@
         fi
       done
       if test -z "$haveit"; then
-        if test "X$additional_libdir" = "X/usr/local/lib"; then
+        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
           if test -n "$GCC"; then
             case $host_os in
               linux*) haveit=yes;;
@@ -1710,139 +3033,523 @@
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 ])
-# longdouble.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
 
-dnl From Bruno Haible.
-dnl Test whether the compiler supports the 'long double' type.
-dnl Prerequisite: AC_PROG_CC
-
-AC_DEFUN([gt_TYPE_LONGDOUBLE],
+dnl AC_LIB_PREPARE_MULTILIB creates
+dnl - a function acl_is_expected_elfclass, that tests whether standard input
+dn;   has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
+dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
+dnl   the basename of the libdir to try in turn, either "lib" or "lib64" or
+dnl   "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
 [
-  AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
-    [if test "$GCC" = yes; then
-       gt_cv_c_long_double=yes
-     else
-       AC_TRY_COMPILE([
-         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
-         long double foo = 0.0;
-         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
-         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
-         ], ,
-         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
-     fi])
-  if test $gt_cv_c_long_double = yes; then
-    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
+  dnl There is no formal standard regarding lib, lib32, and lib64.
+  dnl On most glibc systems, the current practice is that on a system supporting
+  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on
+  dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go
+  dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib.
+  dnl We determine the compiler's default mode by looking at the compiler's
+  dnl library search path. If at least one of its elements ends in /lib64 or
+  dnl points to a directory whose absolute pathname ends in /lib64, we use that
+  dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default,
+  dnl namely "lib".
+  dnl On Solaris systems, the current practice is that on a system supporting
+  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
+  dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
+  dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
+
+  AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
+    [AC_EGREP_CPP([Extensible Linking Format],
+       [#ifdef __ELF__
+        Extensible Linking Format
+        #endif
+       ],
+       [gl_cv_elf=yes],
+       [gl_cv_elf=no])
+     ])
+  if test $gl_cv_elf; then
+    # Extract the ELF class of a file (5th byte) in decimal.
+    # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+    if od -A x < /dev/null >/dev/null 2>/dev/null; then
+      # Use POSIX od.
+      func_elfclass ()
+      {
+        od -A n -t d1 -j 4 -N 1
+      }
+    else
+      # Use BSD hexdump.
+      func_elfclass ()
+      {
+        dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+        echo
+      }
+    fi
+changequote(,)dnl
+    case $HOST_CPU_C_ABI_32BIT in
+      yes)
+        # 32-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          test "`func_elfclass | sed -e 's/[ 	]//g'`" = 1
+        }
+        ;;
+      no)
+        # 64-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          test "`func_elfclass | sed -e 's/[ 	]//g'`" = 2
+        }
+        ;;
+      *)
+        # Unknown.
+        acl_is_expected_elfclass ()
+        {
+          :
+        }
+        ;;
+    esac
+changequote([,])dnl
+  else
+    acl_is_expected_elfclass ()
+    {
+      :
+    }
   fi
+
+  dnl Allow the user to override the result by setting acl_cv_libdirstems.
+  AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
+    [acl_cv_libdirstems],
+    [dnl Try 'lib' first, because that's the default for libdir in GNU, see
+     dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>.
+     acl_libdirstem=lib
+     acl_libdirstem2=
+     acl_libdirstem3=
+     case "$host_os" in
+       solaris*)
+         dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+         dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>.
+         dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
+         dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
+         dnl symlink is missing, so we set acl_libdirstem2 too.
+         if test $HOST_CPU_C_ABI_32BIT = no; then
+           acl_libdirstem2=lib/64
+           case "$host_cpu" in
+             sparc*)        acl_libdirstem3=lib/sparcv9 ;;
+             i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
+           esac
+         fi
+         ;;
+       *)
+         dnl If $CC generates code for a 32-bit ABI, the libraries are
+         dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
+         dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries
+         dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32.
+         dnl Find the compiler's search path. However, non-system compilers
+         dnl sometimes have odd library search paths. But we can't simply invoke
+         dnl '/usr/bin/gcc -print-search-dirs' because that would not take into
+         dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS.
+         searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+                     | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+         if test $HOST_CPU_C_ABI_32BIT != no; then
+           # 32-bit or unknown ABI.
+           if test -d /usr/lib32; then
+             acl_libdirstem2=lib32
+           fi
+         fi
+         if test $HOST_CPU_C_ABI_32BIT != yes; then
+           # 64-bit or unknown ABI.
+           if test -d /usr/lib64; then
+             acl_libdirstem3=lib64
+           fi
+         fi
+         if test -n "$searchpath"; then
+           acl_save_IFS="${IFS= 	}"; IFS=":"
+           for searchdir in $searchpath; do
+             if test -d "$searchdir"; then
+               case "$searchdir" in
+                 */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+                 */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+                 */../ | */.. )
+                   # Better ignore directories of this form. They are misleading.
+                   ;;
+                 *) searchdir=`cd "$searchdir" && pwd`
+                    case "$searchdir" in
+                      */lib32 ) acl_libdirstem2=lib32 ;;
+                      */lib64 ) acl_libdirstem3=lib64 ;;
+                    esac ;;
+               esac
+             fi
+           done
+           IFS="$acl_save_IFS"
+           if test $HOST_CPU_C_ABI_32BIT = yes; then
+             # 32-bit ABI.
+             acl_libdirstem3=
+           fi
+           if test $HOST_CPU_C_ABI_32BIT = no; then
+             # 64-bit ABI.
+             acl_libdirstem2=
+           fi
+         fi
+         ;;
+     esac
+     test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+     test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+     acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
+    ])
+  dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
+  dnl acl_libdirstem3.
+changequote(,)dnl
+  acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+  acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+  acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
+changequote([,])dnl
 ])
-# longlong.m4 serial 4
-dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
 
-dnl From Paul Eggert.
-
-# Define HAVE_LONG_LONG if 'long long' works.
-
-AC_DEFUN([jm_AC_TYPE_LONG_LONG],
-[
-  AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
-  [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
-    [long long llmax = (long long) -1;
-     return ll << i | ll >> i | llmax / ll | llmax % ll;],
-    ac_cv_type_long_long=yes,
-    ac_cv_type_long_long=no)])
-  if test $ac_cv_type_long_long = yes; then
-    AC_DEFINE(HAVE_LONG_LONG, 1,
-      [Define if you have the 'long long' type.])
-  fi
-])
-# nls.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+# nls.m4 serial 6 (gettext-0.20.2)
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2020 Free
+dnl Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
+AC_PREREQ([2.50])
+
 AC_DEFUN([AM_NLS],
 [
   AC_MSG_CHECKING([whether NLS is requested])
   dnl Default is enabled NLS
-  AC_ARG_ENABLE(nls,
+  AC_ARG_ENABLE([nls],
     [  --disable-nls           do not use Native Language Support],
     USE_NLS=$enableval, USE_NLS=yes)
-  AC_MSG_RESULT($USE_NLS)
-  AC_SUBST(USE_NLS)
+  AC_MSG_RESULT([$USE_NLS])
+  AC_SUBST([USE_NLS])
 ])
 
-AC_DEFUN([AM_MKINSTALLDIRS],
-[
-  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
-  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
-  dnl Try to locate it.
-  MKINSTALLDIRS=
-  if test -n "$ac_aux_dir"; then
-    case "$ac_aux_dir" in
-      /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
-      *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
-    esac
-  fi
-  if test -z "$MKINSTALLDIRS"; then
-    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
-  fi
-  AC_SUBST(MKINSTALLDIRS)
-])
-# po.m4 serial 3 (gettext-0.14)
-dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
+
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=m4_default([$1], [0.9.0])
+	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		AC_MSG_RESULT([yes])
+	else
+		AC_MSG_RESULT([no])
+		PKG_CONFIG=""
+	fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes ],
+		     [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $2])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+        else
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+	m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+        AC_MSG_RESULT([no])
+	m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+	$3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
+
+# po.m4 serial 31 (gettext-0.20.2)
+dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
+AC_PREREQ([2.60])
+
 dnl Checks for all prerequisites of the po subdirectory.
 AC_DEFUN([AM_PO_SUBDIRS],
 [
   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
   AC_REQUIRE([AC_PROG_INSTALL])dnl
-  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
+  AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+  AC_REQUIRE([AC_PROG_SED])dnl
   AC_REQUIRE([AM_NLS])dnl
 
+  dnl Release version of the gettext macros. This is used to ensure that
+  dnl the gettext macros and po/Makefile.in.in are in sync.
+  AC_SUBST([GETTEXT_MACRO_VERSION], [0.20])
+
   dnl Perform the following tests also if --disable-nls has been given,
   dnl because they are needed for "make dist" to work.
 
@@ -1850,59 +3557,64 @@
   dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
   dnl The second test excludes FreeBSD msgfmt.
   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
-    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
+    [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
     :)
-  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+  AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
+
+  dnl Test whether it is GNU msgfmt >= 0.15.
+changequote(,)dnl
+  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+    *) GMSGFMT_015=$GMSGFMT ;;
+  esac
+changequote([,])dnl
+  AC_SUBST([GMSGFMT_015])
 
   dnl Search for GNU xgettext 0.12 or newer in the PATH.
   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
   dnl The second test excludes FreeBSD xgettext.
   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
-    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
+    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
      (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
     :)
   dnl Remove leftover from FreeBSD xgettext call.
   rm -f messages.po
 
+  dnl Test whether it is GNU xgettext >= 0.15.
+changequote(,)dnl
+  case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+    *) XGETTEXT_015=$XGETTEXT ;;
+  esac
+changequote([,])dnl
+  AC_SUBST([XGETTEXT_015])
+
   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
-    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
+    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
-  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
-  dnl Test whether we really found GNU msgfmt.
-  if test "$GMSGFMT" != ":"; then
-    dnl If it is no GNU msgfmt we define it as : so that the
-    dnl Makefiles still can work.
-    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
-       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
-      : ;
+  dnl Test whether it is GNU msgmerge >= 0.20.
+  if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then
+    MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt'
+  else
+    dnl Test whether it is GNU msgmerge >= 0.12.
+    if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then
+      MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet'
     else
-      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
-      AC_MSG_RESULT(
-        [found $GMSGFMT program is not GNU msgfmt; ignore it])
-      GMSGFMT=":"
+      dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is
+      dnl slow. But this is not a big problem, as such old gettext versions are
+      dnl hardly in use any more.
+      MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet'
     fi
   fi
+  AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION])
 
-  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
-  dnl Test whether we really found GNU xgettext.
-  if test "$XGETTEXT" != ":"; then
-    dnl If it is no GNU xgettext we define it as : so that the
-    dnl Makefiles still can work.
-    if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
-       (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
-      : ;
-    else
-      AC_MSG_RESULT(
-        [found xgettext program is not GNU xgettext; ignore it])
-      XGETTEXT=":"
-    fi
-    dnl Remove leftover from FreeBSD xgettext call.
-    rm -f messages.po
-  fi
+  dnl Support for AM_XGETTEXT_OPTION.
+  test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+  AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
 
-  AC_OUTPUT_COMMANDS([
+  AC_CONFIG_COMMANDS([po-directories], [[
     for ac_file in $CONFIG_FILES; do
       # Support "outfile[:infile[:infile...]]"
       case "$ac_file" in
@@ -1912,7 +3624,7 @@
       case "$ac_file" in */Makefile.in)
         # Adjust a relative srcdir.
         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
-        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
         # In autoconf-2.13 it is called $ac_given_srcdir.
         # In autoconf-2.50 it is called $srcdir.
@@ -1922,10 +3634,14 @@
           /*) top_srcdir="$ac_given_srcdir" ;;
           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
         esac
+        # Treat a directory as a PO directory if and only if it has a
+        # POTFILES.in file. This allows packages to have multiple PO
+        # directories under different names or in different locations.
         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
           rm -f "$ac_dir/POTFILES"
           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
-          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ 	]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+          gt_tab=`printf '\t'`
+          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
           POMAKEFILEDEPS="POTFILES.in"
           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
           # on $ac_dir but don't depend on user-specified configuration
@@ -1935,13 +3651,11 @@
             if test -n "$OBSOLETE_ALL_LINGUAS"; then
               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
             fi
-            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
-            # Hide the ALL_LINGUAS assigment from automake.
-            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+            ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
           else
             # The set of available languages was given in configure.in.
-            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+            ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
           fi
           # Compute POFILES
           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
@@ -2010,11 +3724,10 @@
         fi
         ;;
       esac
-    done],
+    done]],
    [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
-    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
-    # from automake.
-    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS.
+    OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS"
     # Capture the value of LINGUAS because we need it to compute CATALOGS.
     LINGUAS="${LINGUAS-%UNSET%}"
    ])
@@ -2032,7 +3745,7 @@
 changequote(,)dnl
   # Adjust a relative srcdir.
   ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
-  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+  ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
   ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
   # In autoconf-2.13 it is called $ac_given_srcdir.
   # In autoconf-2.50 it is called $srcdir.
@@ -2060,6 +3773,7 @@
   fi
 
   # A sed script that extracts the value of VARIABLE from a Makefile.
+  tab=`printf '\t'`
   sed_x_variable='
 # Test if the hold space is empty.
 x
@@ -2067,9 +3781,9 @@
 x
 ta
 # Yes it was empty. Look if we have the expected variable definition.
-/^[	 ]*VARIABLE[	 ]*=/{
+/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
   # Seen the first line of the variable definition.
-  s/^[	 ]*VARIABLE[	 ]*=//
+  s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
   ba
 }
 bd
@@ -2099,7 +3813,7 @@
 changequote([,])dnl
 
   # Set POTFILES to the value of the Makefile variable POTFILES.
-  sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
+  sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
   POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
   # Compute POTFILES_DEPS as
   #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
@@ -2114,15 +3828,13 @@
   fi
   if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
     # The LINGUAS file contains the set of available languages.
-    ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+    ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
     POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
   else
     # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
-    sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
-    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+    sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
+    ALL_LINGUAS=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
   fi
-  # Hide the ALL_LINGUAS assigment from automake.
-  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
   # Compute POFILES
   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
   # Compute UPDATEPOFILES
@@ -2132,9 +3844,9 @@
   # Compute GMOFILES
   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
   # Compute PROPERTIESFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties)
   # Compute CLASSFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class)
   # Compute QMFILES
   # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
   # Compute MSGFILES
@@ -2159,12 +3871,12 @@
     UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
     DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
     GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
-    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
-    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+    PROPERTIESFILES="$PROPERTIESFILES \$(srcdir)/\$(DOMAIN)_$lang.properties"
+    CLASSFILES="$CLASSFILES \$(srcdir)/\$(DOMAIN)_$lang.class"
     QMFILES="$QMFILES $srcdirpre$lang.qm"
     frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
     MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
-    frobbedlang=`echo $lang | sed -e 's/_/-/g'`
+    frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
     RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
   done
   # CATALOGS depends on both $ac_dir and the user's LINGUAS
@@ -2205,31 +3917,32 @@
       QTCATALOGS="$QTCATALOGS $lang.qm"
       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
       TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
-      frobbedlang=`echo $lang | sed -e 's/_/-/g'`
+      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
       CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
     done
   fi
 
   sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+  tab=`printf '\t'`
   if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
     # Add dependencies that cannot be formulated as a simple suffix rule.
     for lang in $ALL_LINGUAS; do
       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
       cat >> "$ac_file.tmp" <<EOF
 $frobbedlang.msg: $lang.po
-	@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
-	\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 EOF
     done
   fi
   if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
     # Add dependencies that cannot be formulated as a simple suffix rule.
     for lang in $ALL_LINGUAS; do
-      frobbedlang=`echo $lang | sed -e 's/_/-/g'`
+      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
       cat >> "$ac_file.tmp" <<EOF
 $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
-	@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
-	\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 EOF
     done
   fi
@@ -2240,72 +3953,40 @@
   fi
   mv "$ac_file.tmp" "$ac_file"
 ])
-# printf-posix.m4 serial 2 (gettext-0.13.1)
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
 
-dnl From Bruno Haible.
-dnl Test whether the printf() function supports POSIX/XSI format strings with
-dnl positions.
-
-AC_DEFUN([gt_PRINTF_POSIX],
+dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
+AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
 [
-  AC_REQUIRE([AC_PROG_CC])
-  AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
-    gt_cv_func_printf_posix,
-    [
-      AC_TRY_RUN([
-#include <stdio.h>
-#include <string.h>
-/* The string "%2$d %1$d", with dollar characters protected from the shell's
-   dollar expansion (possibly an autoconf bug).  */
-static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
-static char buf[100];
-int main ()
-{
-  sprintf (buf, format, 33, 55);
-  return (strcmp (buf, "55 33") != 0);
-}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
-      [
-        AC_EGREP_CPP(notposix, [
-#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
-  notposix
-#endif
-        ], gt_cv_func_printf_posix="guessing no",
-           gt_cv_func_printf_posix="guessing yes")
-      ])
-    ])
-  case $gt_cv_func_printf_posix in
-    *yes)
-      AC_DEFINE(HAVE_POSIX_PRINTF, 1,
-        [Define if your printf() function supports format strings with positions.])
-      ;;
-  esac
+  XGETTEXT_EXTRA_OPTIONS=
 ])
-# progtest.m4 serial 3 (gettext-0.12)
-dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
+
+dnl Registers an option to be passed to xgettext in the po subdirectory.
+AC_DEFUN([AM_XGETTEXT_OPTION],
+[
+  AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
+])
+
+# progtest.m4 serial 8 (gettext-0.20.2)
+dnl Copyright (C) 1996-2003, 2005, 2008-2020 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
 dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
 
+AC_PREREQ([2.50])
+
 # Search path for a program which passes the given test.
 
 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
@@ -2315,15 +3996,14 @@
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
 
 # Find out how to test for executable files. Don't use a zero-byte file,
@@ -2343,7 +4023,7 @@
 # Extract the first word of "$2", so it can be a program name with args.
 set dummy $2; ac_word=[$]2
 AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_path_$1,
+AC_CACHE_VAL([ac_cv_path_$1],
 [case "[$]$1" in
   [[\\/]]* | ?:[[\\/]]*)
     ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
@@ -2355,6 +4035,7 @@
       test -z "$ac_dir" && ac_dir=.
       for ac_exec_ext in '' $ac_executable_extensions; do
         if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
           if [$3]; then
             ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
             break 2
@@ -2371,407 +4052,11 @@
 esac])dnl
 $1="$ac_cv_path_$1"
 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
-  AC_MSG_RESULT([$]$1)
+  AC_MSG_RESULT([$][$1])
 else
-  AC_MSG_RESULT(no)
+  AC_MSG_RESULT([no])
 fi
-AC_SUBST($1)dnl
-])
-# signed.m4 serial 1 (gettext-0.10.40)
-dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([bh_C_SIGNED],
-[
-  AC_CACHE_CHECK([for signed], bh_cv_c_signed,
-   [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
-  if test $bh_cv_c_signed = no; then
-    AC_DEFINE(signed, ,
-              [Define to empty if the C compiler doesn't support this keyword.])
-  fi
-])
-# size_max.m4 serial 2
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([gl_SIZE_MAX],
-[
-  AC_CHECK_HEADERS(stdint.h)
-  dnl First test whether the system already has SIZE_MAX.
-  AC_MSG_CHECKING([for SIZE_MAX])
-  result=
-  AC_EGREP_CPP([Found it], [
-#include <limits.h>
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef SIZE_MAX
-Found it
-#endif
-], result=yes)
-  if test -z "$result"; then
-    dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
-    dnl than the type 'unsigned long'.
-    dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
-    dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
-    _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
-      [#include <stddef.h>], result=?)
-    _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
-      [#include <stddef.h>], result=?)
-    _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
-      [#include <stddef.h>], result=?)
-    if test "$fits_in_uint" = 1; then
-      dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
-      dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
-      AC_TRY_COMPILE([#include <stddef.h>
-        extern size_t foo;
-        extern unsigned long foo;
-        ], [], fits_in_uint=0)
-    fi
-    if test -z "$result"; then
-      if test "$fits_in_uint" = 1; then
-        result="$res_hi$res_lo"U
-      else
-        result="$res_hi$res_lo"UL
-      fi
-    else
-      dnl Shouldn't happen, but who knows...
-      result='~(size_t)0'
-    fi
-  fi
-  AC_MSG_RESULT([$result])
-  if test "$result" != yes; then
-    AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
-      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
-  fi
-])
-# stdint_h.m4 serial 3 (gettext-0.12)
-dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
-# doesn't clash with <sys/types.h>, and declares uintmax_t.
-
-AC_DEFUN([jm_AC_HEADER_STDINT_H],
-[
-  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
-  [AC_TRY_COMPILE(
-    [#include <sys/types.h>
-#include <stdint.h>],
-    [uintmax_t i = (uintmax_t) -1;],
-    jm_ac_cv_header_stdint_h=yes,
-    jm_ac_cv_header_stdint_h=no)])
-  if test $jm_ac_cv_header_stdint_h = yes; then
-    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
-      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
-       and declares uintmax_t. ])
-  fi
-])
-# uintmax_t.m4 serial 7 (gettext-0.12)
-dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-AC_PREREQ(2.13)
-
-# Define uintmax_t to 'unsigned long' or 'unsigned long long'
-# if it is not already defined in <stdint.h> or <inttypes.h>.
-
-AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
-[
-  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
-  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
-  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
-    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
-    test $ac_cv_type_unsigned_long_long = yes \
-      && ac_type='unsigned long long' \
-      || ac_type='unsigned long'
-    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
-      [Define to unsigned long or unsigned long long
-       if <stdint.h> and <inttypes.h> don't define.])
-  else
-    AC_DEFINE(HAVE_UINTMAX_T, 1,
-      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
-  fi
-])
-# ulonglong.m4 serial 3
-dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Paul Eggert.
-
-# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
-
-AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
-[
-  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
-  [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
-    [unsigned long long ullmax = (unsigned long long) -1;
-     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
-    ac_cv_type_unsigned_long_long=yes,
-    ac_cv_type_unsigned_long_long=no)])
-  if test $ac_cv_type_unsigned_long_long = yes; then
-    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
-      [Define if you have the 'unsigned long long' type.])
-  fi
-])
-# wchar_t.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-dnl Test whether <stddef.h> has the 'wchar_t' type.
-dnl Prerequisite: AC_PROG_CC
-
-AC_DEFUN([gt_TYPE_WCHAR_T],
-[
-  AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
-    [AC_TRY_COMPILE([#include <stddef.h>
-       wchar_t foo = (wchar_t)'\0';], ,
-       gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
-  if test $gt_cv_c_wchar_t = yes; then
-    AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
-  fi
-])
-# wint_t.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl From Bruno Haible.
-dnl Test whether <wchar.h> has the 'wint_t' type.
-dnl Prerequisite: AC_PROG_CC
-
-AC_DEFUN([gt_TYPE_WINT_T],
-[
-  AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
-    [AC_TRY_COMPILE([#include <wchar.h>
-       wint_t foo = (wchar_t)'\0';], ,
-       gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
-  if test $gt_cv_c_wint_t = yes; then
-    AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
-  fi
-])
-# xsize.m4 serial 2
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software, distributed under the terms of the GNU
-dnl General Public License.  As a special exception to the GNU General
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-AC_DEFUN([gl_XSIZE],
-[
-  dnl Prerequisites of lib/xsize.h.
-  AC_REQUIRE([gl_SIZE_MAX])
-  AC_CHECK_HEADERS(stdint.h)
+AC_SUBST([$1])dnl
 ])
 
-# from http://autoconf-archive.cryp.to/ax_tls.html
-#
-# This was licensed under the GPL with the following exception:
-#
-# As a special exception, the respective Autoconf Macro's copyright
-# owner gives unlimited permission to copy, distribute and modify the
-# configure scripts that are the output of Autoconf when processing
-# the Macro. You need not follow the terms of the GNU General Public
-# License when using or distributing such scripts, even though
-# portions of the text of the Macro appear in them. The GNU General
-# Public License (GPL) does govern all other use of the material that
-# constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the
-# Autoconf Macro released by the Autoconf Macro Archive. When you make
-# and distribute a modified version of the Autoconf Macro, you may
-# extend this special exception to the GPL to apply to your modified
-# version as well.
-#
-AC_DEFUN([AX_TLS], [
-  AC_MSG_CHECKING(for thread local storage (TLS) class)
-  AC_CACHE_VAL(ac_cv_tls, [
-    ax_tls_keywords="__thread __declspec(thread) none"
-    for ax_tls_keyword in $ax_tls_keywords; do
-       case $ax_tls_keyword in
-          none) ac_cv_tls=none ; break ;;
-          *)
-             AC_TRY_COMPILE(
-                [#include <stdlib.h>
-                 static void
-                 foo(void) {
-                 static ] $ax_tls_keyword [ int bar;
-                 exit(1);
-                 }],
-                 [],
-                 [ac_cv_tls=$ax_tls_keyword ; break],
-                 ac_cv_tls=none
-             )
-          esac
-    done
-])
-
-  if test "$ac_cv_tls" != "none"; then
-    dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
-    AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
-  fi
-  AC_MSG_RESULT($ac_cv_tls)
-])
-
-# Excerpted from pkg.m4 - Macros to locate and utilise pkg-config
-#
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-fi
-if test -n "$PKG_CONFIG"; then
-        _pkg_min_version=m4_default([$1], [0.9.0])
-        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
-        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-                AC_MSG_RESULT([yes])
-        else
-                AC_MSG_RESULT([no])
-                PKG_CONFIG=""
-        fi
-               
-fi[]dnl
-])# PKG_PROG_PKG_CONFIG
-# ===========================================================================
-#         http://www.nongnu.org/autoconf-archive/check_gnu_make.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   CHECK_GNU_MAKE()
-#
-# DESCRIPTION
-#
-#   This macro searches for a GNU version of make. If a match is found, the
-#   makefile variable `ifGNUmake' is set to the empty string, otherwise it
-#   is set to "#". This is useful for including a special features in a
-#   Makefile, which cannot be handled by other versions of make. The
-#   variable _cv_gnu_make_command is set to the command to invoke GNU make
-#   if it exists, the empty string otherwise.
-#
-#   Here is an example of its use:
-#
-#   Makefile.in might contain:
-#
-#       # A failsafe way of putting a dependency rule into a makefile
-#       $(DEPEND):
-#               $(CC) -MM $(srcdir)/*.c > $(DEPEND)
-#
-#       @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
-#       @ifGNUmake@ include $(DEPEND)
-#       @ifGNUmake@ endif
-#
-#   Then configure.in would normally contain:
-#
-#       CHECK_GNU_MAKE()
-#       AC_OUTPUT(Makefile)
-#
-#   Then perhaps to cause gnu make to override any other make, we could do
-#   something like this (note that GNU make always looks for GNUmakefile
-#   first):
-#
-#       if  ! test x$_cv_gnu_make_command = x ; then
-#               mv Makefile GNUmakefile
-#               echo .DEFAULT: > Makefile ;
-#               echo \  $_cv_gnu_make_command \$@ >> Makefile;
-#       fi
-#
-#   Then, if any (well almost any) other make is called, and GNU make also
-#   exists, then the other make wraps the GNU make.
-#
-# LICENSE
-#
-#   Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved.
-#
-# Note: Modified by Ted Ts'o to add @ifNotGNUMake@
-
-AC_DEFUN(
-        [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
-                _cv_gnu_make_command='' ;
-dnl Search all the common names for GNU make
-                for a in "$MAKE" make gmake gnumake ; do
-                        if test -z "$a" ; then continue ; fi ;
-                        if  ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
-                                _cv_gnu_make_command=$a ;
-                                break;
-                        fi
-                done ;
-        ) ;
-dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
-        if test  "x$_cv_gnu_make_command" != "x"  ; then
-                ifGNUmake='' ;
-                ifNotGNUmake='#' ;
-        else
-                ifGNUmake='#' ;
-                ifNotGNUmake='' ;
-                AC_MSG_RESULT("Not found");
-        fi
-        AC_SUBST(ifGNUmake)
-        AC_SUBST(ifNotGNUmake)
-] )
+m4_include([acinclude.m4])
diff --git a/asm_types.h b/asm_types.h
new file mode 100644
index 0000000..322a79f
--- /dev/null
+++ b/asm_types.h
@@ -0,0 +1,8 @@
+#define __S8_TYPEDEF __signed__ char
+#define __U8_TYPEDEF unsigned char
+#define __S16_TYPEDEF __signed__ short
+#define __U16_TYPEDEF unsigned short
+#define __S32_TYPEDEF __signed__ int
+#define __U32_TYPEDEF unsigned int
+#define __S64_TYPEDEF __signed__ long long
+#define __U64_TYPEDEF unsigned long long
diff --git a/config.status b/config.status
new file mode 100755
index 0000000..4e16da0
--- /dev/null
+++ b/config.status
@@ -0,0 +1,1473 @@
+#! /bin/sh
+# Generated by configure.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+# Files that config.status was made for.
+config_files="  MCONFIG Makefile util/Makefile util/subst.conf util/gen-tarball util/install-symlink lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile lib/ext2fs/Makefile lib/ext2fs/ext2_types.h lib/uuid/Makefile lib/uuid/uuid.pc lib/uuid/uuid_types.h lib/blkid/Makefile lib/blkid/blkid.pc lib/blkid/blkid_types.h lib/support/Makefile lib/ss/ss.pc lib/et/com_err.pc lib/e2p/e2p.pc lib/ext2fs/ext2fs.pc misc/Makefile ext2ed/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile tests/progs/Makefile resize/Makefile doc/Makefile po/Makefile.in scrub/Makefile"
+config_headers=" lib/config.h"
+config_commands=" po-directories"
+
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+ac_cs_config="'--enable-libuuid' '--enable-libblkid' 'CC=/bin/clang' 'CFLAGS=-g -O2'"
+ac_cs_version="\
+config.status
+configured by ./configure, generated by GNU Autoconf 2.69,
+  with options \"$ac_cs_config\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='/usr/local/google/home/jmhuang/eurekasource/external/e2fsprogs'
+srcdir='.'
+INSTALL='/bin/install -c'
+MKDIR_P='/bin/mkdir -p'
+AWK='gawk'
+test -n "$AWK" || AWK=awk
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+if $ac_cs_recheck; then
+  set X /bin/sh './configure'  '--enable-libuuid' '--enable-libblkid' 'CC=/bin/clang' 'CFLAGS=-g -O2' $ac_configure_extra_args --no-create --no-recursion
+  shift
+  $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6
+  CONFIG_SHELL='/bin/sh'
+  export CONFIG_SHELL
+  exec "$@"
+fi
+
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+#
+# INIT-COMMANDS
+#
+# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS.
+    OBSOLETE_ALL_LINGUAS=""
+    # Capture the value of LINGUAS because we need it to compute CATALOGS.
+    LINGUAS="%UNSET%"
+
+
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h" ;;
+    "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
+    "$outlist") CONFIG_FILES="$CONFIG_FILES $outlist" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
+  ac_cs_awk_getline=:
+  ac_cs_awk_pipe_init=
+  ac_cs_awk_read_file='
+      while ((getline aline < (F[key])) > 0)
+	print(aline)
+      close(F[key])'
+  ac_cs_awk_pipe_fini=
+else
+  ac_cs_awk_getline=false
+  ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
+  ac_cs_awk_read_file='
+      print "|#_!!_#|"
+      print "cat " F[key] " &&"
+      '$ac_cs_awk_pipe_init
+  # The final `:' finishes the AND list.
+  ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
+fi
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+cat >>"$ac_tmp/subs1.awk" <<\_ACAWK &&
+F["MCONFIG"]="./MCONFIG"
+F["MAKEFILE_ELF"]="/dev/null"
+F["MAKEFILE_BSDLIB"]="/dev/null"
+F["MAKEFILE_PROFILE"]="/dev/null"
+F["MAKEFILE_LIBRARY"]="./lib/Makefile.library"
+F["ASM_TYPES_HEADER"]="./asm_types.h"
+F["PUBLIC_CONFIG_HEADER"]="./public_config.h"
+_ACAWK
+cat >>"$ac_tmp/subs1.awk" <<\_ACAWK &&
+S["LTLIBOBJS"]=""
+S["LIBOBJS"]=""
+S["OS_IO_FILE"]="unix_io"
+S["systemd_system_unit_dir"]="/lib/systemd/system"
+S["have_systemd"]="yes"
+S["systemd_LIBS"]=""
+S["systemd_CFLAGS"]=""
+S["crond_dir"]="/etc/cron.d"
+S["have_crond"]="yes"
+S["pkg_udev_rules_dir"]="/lib/udev/rules.d"
+S["have_udev"]="yes"
+S["udev_LIBS"]=""
+S["udev_CFLAGS"]=""
+S["LDFLAGS_SHLIB"]=""
+S["CFLAGS_STLIB"]="-g -O2"
+S["CFLAGS_SHLIB"]="-g -O2"
+S["BUILD_LDFLAGS"]=""
+S["BUILD_CFLAGS"]="-g -O2  -I. -I$(top_builddir)/lib -I$(top_srcdir)/lib -DHAVE_CONFIG_H"
+S["INCLUDES"]="-I. -I$(top_builddir)/lib -I$(top_srcdir)/lib"
+S["DO_TEST_SUITE"]="check"
+S["LDFLAGS_STATIC"]=" -static"
+S["root_sysconfdir"]="${root_prefix}/etc"
+S["root_libdir"]="${root_prefix}/lib"
+S["root_sbindir"]="${root_prefix}/sbin"
+S["root_bindir"]="${root_prefix}/bin"
+S["root_prefix"]=""
+S["E2SCRUB_CMT"]=""
+S["UNIX_CMT"]=""
+S["CYGWIN_CMT"]="#"
+S["LINUX_CMT"]=""
+S["threadsan_ldflags"]=""
+S["threadsan_cflags"]=""
+S["have_threadsan"]=""
+S["addrsan_ldflags"]=""
+S["addrsan_cflags"]=""
+S["have_addrsan"]=""
+S["ubsan_ldflags"]=""
+S["ubsan_cflags"]=""
+S["have_ubsan"]=""
+S["lto_ldflags"]=""
+S["lto_cflags"]=""
+S["have_lto"]=""
+S["gcc_ranlib"]=""
+S["gcc_ar"]=""
+S["UNI_DIFF_OPTS"]="-u"
+S["SEM_INIT_LIB"]="-lpthread"
+S["FUSE_CMT"]="#"
+S["FUSE_LIB"]=""
+S["CLOCK_GETTIME_LIB"]="-lrt"
+S["MAGIC_LIB"]="-ldl"
+S["SOCKET_LIB"]=""
+S["SIZEOF_TIME_T"]="8"
+S["SIZEOF_OFF_T"]="8"
+S["SIZEOF_LONG_LONG"]="8"
+S["SIZEOF_LONG"]="8"
+S["SIZEOF_INT"]="4"
+S["SIZEOF_SHORT"]="2"
+S["DD"]="dd"
+S["BUILD_CC"]="/bin/clang"
+S["MAKEINFO"]="makeinfo"
+S["STRIP"]="strip"
+S["RANLIB"]="ranlib"
+S["AR"]="ar"
+S["LDCONFIG"]="/usr/sbin/ldconfig"
+S["PERL"]="/bin/perl"
+S["AWK"]="gawk"
+S["CHMOD"]="/bin/chmod"
+S["RM"]="/bin/rm"
+S["CP"]="/bin/cp"
+S["MV"]="/bin/mv"
+S["LN_S"]="ln -s"
+S["mkdir_p"]="/bin/mkdir -p"
+S["LN"]="/bin/ln"
+S["ifNotGNUmake"]="#"
+S["ifGNUmake"]=""
+S["BINARY_TYPE"]="bin"
+S["POSUB"]="po"
+S["LTLIBINTL"]=""
+S["LIBINTL"]=""
+S["INTLLIBS"]=""
+S["LTLIBICONV"]="-liconv"
+S["LIBICONV"]="-liconv"
+S["INTL_MACOSX_LIBS"]=""
+S["XGETTEXT_EXTRA_OPTIONS"]=""
+S["MSGMERGE_FOR_MSGFMT_OPTION"]="--for-msgfmt"
+S["MSGMERGE"]="/bin/msgmerge"
+S["XGETTEXT_015"]="/bin/xgettext"
+S["XGETTEXT"]="/bin/xgettext"
+S["GMSGFMT_015"]="/bin/msgfmt"
+S["GMSGFMT"]="/bin/msgfmt"
+S["MSGFMT"]="/bin/msgfmt"
+S["GETTEXT_MACRO_VERSION"]="0.20"
+S["USE_NLS"]="yes"
+S["MKDIR_P"]="/bin/mkdir -p"
+S["INSTALL_DATA"]="${INSTALL} -m 644"
+S["INSTALL_SCRIPT"]="${INSTALL}"
+S["INSTALL_PROGRAM"]="${INSTALL}"
+S["SET_MAKE"]=""
+S["VERSION"]="0.14.1"
+S["PACKAGE"]="e2fsprogs"
+S["GETTEXT_PACKAGE"]="e2fsprogs"
+S["TDB_MAN_COMMENT"]=""
+S["TDB_CMT"]=""
+S["UUIDD_CMT"]=""
+S["PTHREAD_CFLAGS"]="-pthread"
+S["PTHREAD_LIBS"]=""
+S["PTHREAD_CC"]="/bin/clang"
+S["ax_pthread_config"]=""
+S["SED"]="/bin/sed"
+S["E2INITRD_MAN"]="e2initrd_helper.8"
+S["E2INITRD_PROG"]="e2initrd_helper"
+S["FSCK_MAN"]="fsck.8"
+S["FSCK_PROG"]="fsck"
+S["DEFRAG_CMT"]=""
+S["RESIZER_CMT"]=""
+S["IMAGER_CMT"]=""
+S["DEBUGFS_CMT"]=""
+S["SUBSET_CMT"]=""
+S["ALL_CMT"]=""
+S["BLKID_CMT"]=""
+S["DEPPROFILED_LIBBLKID"]="$(LIB)/libblkid.a"
+S["PROFILED_LIBBLKID"]="$(LIB)/libblkid.a"
+S["DEPSTATIC_LIBBLKID"]="$(LIB)/libblkid.a"
+S["STATIC_LIBBLKID"]="$(LIB)/libblkid.a"
+S["DEPLIBBLKID"]="$(LIB)/libblkid.a"
+S["LIBBLKID"]="$(LIB)/libblkid.a"
+S["UUID_CMT"]=""
+S["DEPPROFILED_LIBUUID"]="$(LIB)/libuuid.a"
+S["PROFILED_LIBUUID"]="$(LIB)/libuuid.a"
+S["DEPSTATIC_LIBUUID"]="$(LIB)/libuuid.a"
+S["STATIC_LIBUUID"]="$(LIB)/libuuid.a"
+S["DEPLIBUUID"]="$(LIB)/libuuid.a"
+S["LIBUUID"]="$(LIB)/libuuid.a"
+S["PKG_CONFIG_LIBDIR"]=""
+S["PKG_CONFIG_PATH"]=""
+S["PKG_CONFIG"]="/bin/pkg-config"
+S["DEV_FEATURES_CMT"]=""
+S["TEST_IO_CMT"]=""
+S["PRIVATE_LIBS_CMT"]=""
+S["LDFLAG_DYNAMIC"]=""
+S["PROFILED_LIB_EXT"]=".a"
+S["STATIC_LIB_EXT"]=".a"
+S["LIB_EXT"]=".a"
+S["PROFILE_CMT"]="#"
+S["BSDLIB_CMT"]="#"
+S["ELF_CMT"]="#"
+S["Q"]="@"
+S["ES"]="echo"
+S["E"]="@echo"
+S["LINK_BUILD_FLAGS"]=""
+S["SYMLINK_RELATIVE"]=""
+S["LINK_INSTALL_FLAGS"]="-f"
+S["MAINTAINER_CMT"]="#"
+S["EGREP"]="/bin/grep -E"
+S["GREP"]="/bin/grep"
+S["CPP"]="/bin/clang -E"
+S["RDYNAMIC"]="-rdynamic"
+S["DLOPEN_LIB"]="-ldl"
+S["OBJEXT"]="o"
+S["EXEEXT"]=""
+S["ac_ct_CC"]="/bin/clang"
+S["CPPFLAGS"]=""
+S["LDFLAGS"]=""
+S["CFLAGS"]="-g -O2"
+S["CC"]="/bin/clang"
+S["host_os"]="linux-gnu"
+S["host_vendor"]="pc"
+S["host_cpu"]="x86_64"
+S["host"]="x86_64-pc-linux-gnu"
+S["build_os"]="linux-gnu"
+S["build_vendor"]="pc"
+S["build_cpu"]="x86_64"
+S["build"]="x86_64-pc-linux-gnu"
+S["E2FSPROGS_DATE"]="28-Feb-2021"
+S["E2FSPROGS_PKGVER"]="1.46.2"
+S["E2FSPROGS_VERSION"]="1.46.2"
+S["E2FSPROGS_DAY"]="28"
+S["E2FSPROGS_MONTH"]="February"
+S["E2FSPROGS_YEAR"]="2021"
+S["target_alias"]=""
+S["host_alias"]=""
+S["build_alias"]=""
+S["LIBS"]=""
+S["ECHO_T"]=""
+S["ECHO_N"]="-n"
+S["ECHO_C"]=""
+S["DEFS"]="-DHAVE_CONFIG_H"
+S["mandir"]="${datarootdir}/man"
+S["localedir"]="${datarootdir}/locale"
+S["libdir"]="${exec_prefix}/lib"
+S["psdir"]="${docdir}"
+S["pdfdir"]="${docdir}"
+S["dvidir"]="${docdir}"
+S["htmldir"]="${docdir}"
+S["infodir"]="${datarootdir}/info"
+S["docdir"]="${datarootdir}/doc/${PACKAGE}"
+S["oldincludedir"]="/usr/include"
+S["includedir"]="${prefix}/include"
+S["runstatedir"]="${localstatedir}/run"
+S["localstatedir"]="${prefix}/var"
+S["sharedstatedir"]="${prefix}/com"
+S["sysconfdir"]="${prefix}/etc"
+S["datadir"]="${datarootdir}"
+S["datarootdir"]="${prefix}/share"
+S["libexecdir"]="${exec_prefix}/libexec"
+S["sbindir"]="${exec_prefix}/sbin"
+S["bindir"]="${exec_prefix}/bin"
+S["program_transform_name"]="s,x,x,"
+S["prefix"]="/usr"
+S["exec_prefix"]="${prefix}"
+S["PACKAGE_URL"]=""
+S["PACKAGE_BUGREPORT"]=""
+S["PACKAGE_STRING"]=""
+S["PACKAGE_VERSION"]=""
+S["PACKAGE_TARNAME"]=""
+S["PACKAGE_NAME"]=""
+S["PATH_SEPARATOR"]=":"
+S["SHELL"]="/bin/sh"
+_ACAWK
+cat >>"$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+  $ac_cs_awk_pipe_init
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+  if (nfields == 3 && !substed) {
+    key = field[2]
+    if (F[key] != "" && line ~ /^[	 ]*@.*@[	 ]*$/) {
+      $ac_cs_awk_read_file
+      next
+    }
+  }
+  print line
+}
+$ac_cs_awk_pipe_fini
+_ACAWK
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+D["PACKAGE_NAME"]=" \"\""
+D["PACKAGE_TARNAME"]=" \"\""
+D["PACKAGE_VERSION"]=" \"\""
+D["PACKAGE_STRING"]=" \"\""
+D["PACKAGE_BUGREPORT"]=" \"\""
+D["PACKAGE_URL"]=" \"\""
+D["STDC_HEADERS"]=" 1"
+D["HAVE_SYS_TYPES_H"]=" 1"
+D["HAVE_SYS_STAT_H"]=" 1"
+D["HAVE_STDLIB_H"]=" 1"
+D["HAVE_STRING_H"]=" 1"
+D["HAVE_MEMORY_H"]=" 1"
+D["HAVE_STRINGS_H"]=" 1"
+D["HAVE_INTTYPES_H"]=" 1"
+D["HAVE_STDINT_H"]=" 1"
+D["HAVE_UNISTD_H"]=" 1"
+D["__EXTENSIONS__"]=" 1"
+D["_ALL_SOURCE"]=" 1"
+D["_GNU_SOURCE"]=" 1"
+D["_POSIX_PTHREAD_SEMANTICS"]=" 1"
+D["_TANDEM_SOURCE"]=" 1"
+D["CONFIG_TESTIO_DEBUG"]=" 1"
+D["CONFIG_BUILD_FINDFS"]=" 1"
+D["TLS"]=" __thread"
+D["HAVE_PTHREAD_PRIO_INHERIT"]=" 1"
+D["HAVE_PTHREAD"]=" 1"
+D["USE_UUIDD"]=" 1"
+D["CONFIG_MMP"]=" 1"
+D["CONFIG_TDB"]=" 1"
+D["ENABLE_BMAP_STATS"]=" 1"
+D["PACKAGE"]=" \"e2fsprogs\""
+D["VERSION"]=" \"0.14.1\""
+D["ENABLE_NLS"]=" 1"
+D["HAVE_GETTEXT"]=" 1"
+D["HAVE_DCGETTEXT"]=" 1"
+D["HAVE_DIRENT_H"]=" 1"
+D["HAVE_ERRNO_H"]=" 1"
+D["HAVE_EXECINFO_H"]=" 1"
+D["HAVE_GETOPT_H"]=" 1"
+D["HAVE_MALLOC_H"]=" 1"
+D["HAVE_MNTENT_H"]=" 1"
+D["HAVE_PATHS_H"]=" 1"
+D["HAVE_PTHREAD_H"]=" 1"
+D["HAVE_SEMAPHORE_H"]=" 1"
+D["HAVE_SETJMP_H"]=" 1"
+D["HAVE_SIGNAL_H"]=" 1"
+D["HAVE_STDARG_H"]=" 1"
+D["HAVE_STDINT_H"]=" 1"
+D["HAVE_STDLIB_H"]=" 1"
+D["HAVE_TERMIOS_H"]=" 1"
+D["HAVE_TERMIO_H"]=" 1"
+D["HAVE_UNISTD_H"]=" 1"
+D["HAVE_UTIME_H"]=" 1"
+D["HAVE_LINUX_FALLOC_H"]=" 1"
+D["HAVE_LINUX_FD_H"]=" 1"
+D["HAVE_LINUX_FSMAP_H"]=" 1"
+D["HAVE_LINUX_MAJOR_H"]=" 1"
+D["HAVE_LINUX_LOOP_H"]=" 1"
+D["HAVE_LINUX_TYPES_H"]=" 1"
+D["HAVE_NETINET_IN_H"]=" 1"
+D["HAVE_SYS_FILE_H"]=" 1"
+D["HAVE_SYS_IOCTL_H"]=" 1"
+D["HAVE_SYS_MMAN_H"]=" 1"
+D["HAVE_SYS_MOUNT_H"]=" 1"
+D["HAVE_SYS_PRCTL_H"]=" 1"
+D["HAVE_SYS_RESOURCE_H"]=" 1"
+D["HAVE_SYS_SELECT_H"]=" 1"
+D["HAVE_SYS_SOCKET_H"]=" 1"
+D["HAVE_SYS_STAT_H"]=" 1"
+D["HAVE_SYS_SYSCALL_H"]=" 1"
+D["HAVE_SYS_SYSMACROS_H"]=" 1"
+D["HAVE_SYS_TIME_H"]=" 1"
+D["HAVE_SYS_TYPES_H"]=" 1"
+D["HAVE_SYS_UN_H"]=" 1"
+D["HAVE_SYS_WAIT_H"]=" 1"
+D["HAVE_SYS_XATTR_H"]=" 1"
+D["HAVE_NET_IF_H"]=" 1"
+D["HAVE_VPRINTF"]=" 1"
+D["HAVE_RECLEN_DIRENT"]=" 1"
+D["HAVE_STRUCT_STAT_ST_ATIM"]=" 1"
+D["HAVE_TYPE_SSIZE_T"]=" 1"
+D["HAVE_LSEEK64_PROTOTYPE"]=" 1"
+D["SIZEOF_SHORT"]=" 2"
+D["SIZEOF_INT"]=" 4"
+D["SIZEOF_LONG"]=" 8"
+D["SIZEOF_LONG_LONG"]=" 8"
+D["SIZEOF_OFF_T"]=" 8"
+D["SIZEOF_TIME_T"]=" 8"
+D["HAVE_INTTYPES_H"]=" 1"
+D["HAVE_INTPTR_T"]=" 1"
+D["HAVE_BACKTRACE"]=" 1"
+D["HAVE_DLOPEN"]=" 1"
+D["HAVE_FALLOCATE"]=" 1"
+D["HAVE_FALLOCATE64"]=" 1"
+D["HAVE_FCHOWN"]=" 1"
+D["HAVE_FCNTL"]=" 1"
+D["HAVE_FDATASYNC"]=" 1"
+D["HAVE_FSTAT64"]=" 1"
+D["HAVE_FSYNC"]=" 1"
+D["HAVE_FTRUNCATE64"]=" 1"
+D["HAVE_FUTIMES"]=" 1"
+D["HAVE_GETCWD"]=" 1"
+D["HAVE_GETDTABLESIZE"]=" 1"
+D["HAVE_GETHOSTNAME"]=" 1"
+D["HAVE_GETPWUID_R"]=" 1"
+D["HAVE_GETRLIMIT"]=" 1"
+D["HAVE_GETRUSAGE"]=" 1"
+D["HAVE_JRAND48"]=" 1"
+D["HAVE_LLISTXATTR"]=" 1"
+D["HAVE_LSEEK64"]=" 1"
+D["HAVE_MALLINFO"]=" 1"
+D["HAVE_MBSTOWCS"]=" 1"
+D["HAVE_MEMALIGN"]=" 1"
+D["HAVE_MEMPCPY"]=" 1"
+D["HAVE_MMAP"]=" 1"
+D["HAVE_MSYNC"]=" 1"
+D["HAVE_NANOSLEEP"]=" 1"
+D["HAVE_OPEN64"]=" 1"
+D["HAVE_PATHCONF"]=" 1"
+D["HAVE_POSIX_FADVISE"]=" 1"
+D["HAVE_POSIX_FADVISE64"]=" 1"
+D["HAVE_POSIX_MEMALIGN"]=" 1"
+D["HAVE_PRCTL"]=" 1"
+D["HAVE_PREAD"]=" 1"
+D["HAVE_PWRITE"]=" 1"
+D["HAVE_PREAD64"]=" 1"
+D["HAVE_PWRITE64"]=" 1"
+D["HAVE_SECURE_GETENV"]=" 1"
+D["HAVE_SETMNTENT"]=" 1"
+D["HAVE_SETRESGID"]=" 1"
+D["HAVE_SETRESUID"]=" 1"
+D["HAVE_SNPRINTF"]=" 1"
+D["HAVE_SRANDOM"]=" 1"
+D["HAVE_STPCPY"]=" 1"
+D["HAVE_STRCASECMP"]=" 1"
+D["HAVE_STRDUP"]=" 1"
+D["HAVE_STRNLEN"]=" 1"
+D["HAVE_STRPTIME"]=" 1"
+D["HAVE_STRTOULL"]=" 1"
+D["HAVE_SYNC_FILE_RANGE"]=" 1"
+D["HAVE_SYSCONF"]=" 1"
+D["HAVE_USLEEP"]=" 1"
+D["HAVE_UTIME"]=" 1"
+D["HAVE_UTIMES"]=" 1"
+D["HAVE_VALLOC"]=" 1"
+D["HAVE_PTHREAD_H"]=" 1"
+D["HAVE_SEM_INIT"]=" 1"
+D["HAVE_EXT2_IOCTLS"]=" 1"
+D["HAVE_MOUNT_NOSUID"]=" 1"
+D["HAVE_MOUNT_NODEV"]=" 1"
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ {
+  line = $ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+  ac_datarootdir_hack='
+  s&@datadir@&${datarootdir}&g
+  s&@docdir@&${datarootdir}/doc/${PACKAGE}&g
+  s&@infodir@&${datarootdir}/info&g
+  s&@localedir@&${datarootdir}/locale&g
+  s&@mandir@&${datarootdir}/man&g
+  s&\${datarootdir}&${prefix}/share&g' ;;
+esac
+ac_sed_extra="/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[	 ]*$//
+}
+
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
+if $ac_cs_awk_getline; then
+  $AWK -f "$ac_tmp/subs.awk"
+else
+  $AWK -f "$ac_tmp/subs.awk" | $SHELL
+fi \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "po-directories":C)
+    for ac_file in $CONFIG_FILES; do
+      # Support "outfile[:infile[:infile...]]"
+      case "$ac_file" in
+        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+      esac
+      # PO directories have a Makefile.in generated from Makefile.in.in.
+      case "$ac_file" in */Makefile.in)
+        # Adjust a relative srcdir.
+        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
+        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+        # In autoconf-2.13 it is called $ac_given_srcdir.
+        # In autoconf-2.50 it is called $srcdir.
+        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+        case "$ac_given_srcdir" in
+          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+          /*) top_srcdir="$ac_given_srcdir" ;;
+          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
+        esac
+        # Treat a directory as a PO directory if and only if it has a
+        # POTFILES.in file. This allows packages to have multiple PO
+        # directories under different names or in different locations.
+        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+          rm -f "$ac_dir/POTFILES"
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+          gt_tab=`printf '\t'`
+          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+          POMAKEFILEDEPS="POTFILES.in"
+          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+          # on $ac_dir but don't depend on user-specified configuration
+          # parameters.
+          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+            # The LINGUAS file contains the set of available languages.
+            if test -n "$OBSOLETE_ALL_LINGUAS"; then
+              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+            fi
+            ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+          else
+            # The set of available languages was given in configure.in.
+            ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
+          fi
+          # Compute POFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+          # Compute UPDATEPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+          # Compute DUMMYPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+          # Compute GMOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+          case "$ac_given_srcdir" in
+            .) srcdirpre= ;;
+            *) srcdirpre='$(srcdir)/' ;;
+          esac
+          POFILES=
+          UPDATEPOFILES=
+          DUMMYPOFILES=
+          GMOFILES=
+          for lang in $ALL_LINGUAS; do
+            POFILES="$POFILES $srcdirpre$lang.po"
+            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+          done
+          # CATALOGS depends on both $ac_dir and the user's LINGUAS
+          # environment variable.
+          INST_LINGUAS=
+          if test -n "$ALL_LINGUAS"; then
+            for presentlang in $ALL_LINGUAS; do
+              useit=no
+              if test "%UNSET%" != "$LINGUAS"; then
+                desiredlanguages="$LINGUAS"
+              else
+                desiredlanguages="$ALL_LINGUAS"
+              fi
+              for desiredlang in $desiredlanguages; do
+                # Use the presentlang catalog if desiredlang is
+                #   a. equal to presentlang, or
+                #   b. a variant of presentlang (because in this case,
+                #      presentlang can be used as a fallback for messages
+                #      which are not translated in the desiredlang catalog).
+                case "$desiredlang" in
+                  "$presentlang"*) useit=yes;;
+                esac
+              done
+              if test $useit = yes; then
+                INST_LINGUAS="$INST_LINGUAS $presentlang"
+              fi
+            done
+          fi
+          CATALOGS=
+          if test -n "$INST_LINGUAS"; then
+            for lang in $INST_LINGUAS; do
+              CATALOGS="$CATALOGS $lang.gmo"
+            done
+          fi
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+            if test -f "$f"; then
+              case "$f" in
+                *.orig | *.bak | *~) ;;
+                *) cat "$f" >> "$ac_dir/Makefile" ;;
+              esac
+            fi
+          done
+        fi
+        ;;
+      esac
+    done ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
diff --git a/config/config.guess b/config/config.guess
old mode 100644
new mode 100755
index 9afd676..45001cf
--- a/config/config.guess
+++ b/config/config.guess
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2020 Free Software Foundation, Inc.
 
-timestamp='2013-11-29'
+timestamp='2020-01-01'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -24,12 +24,12 @@
 # program.  This Exception is an additional permission under section 7
 # of the GNU General Public License, version 3 ("GPLv3").
 #
-# Originally written by Per Bothner.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 #
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
 
 
 me=`echo "$0" | sed -e 's,.*/,,'`
@@ -39,7 +39,7 @@
 
 Output the configuration name of the system \`$me' is run on.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -50,7 +50,7 @@
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2020 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@
   exit 1
 fi
 
-trap 'exit 1' 1 2 15
-
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 # compiler to aid in system detection is discouraged as it requires
 # temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,40 @@
 
 # Portable tmp directory creation inspired by the Autoconf team.
 
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-	for c in cc gcc c89 c99 ; do
-	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-	     CC_FOR_BUILD="$c"; break ;
-	  fi ;
-	done ;
-	if test x"$CC_FOR_BUILD" = x ; then
-	  CC_FOR_BUILD=no_compiler_found ;
-	fi
-	;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+    # prevent multiple calls if $tmp is already set
+    test "$tmp" && return 0
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039
+    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+	,,)    echo "int x;" > "$dummy.c"
+	       for driver in cc gcc c89 c99 ; do
+		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+		       CC_FOR_BUILD="$driver"
+		       break
+		   fi
+	       done
+	       if test x"$CC_FOR_BUILD" = x ; then
+		   CC_FOR_BUILD=no_compiler_found
+	       fi
+	       ;;
+	,,*)   CC_FOR_BUILD=$CC ;;
+	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+    esac
+}
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
 	PATH=$PATH:/.attbin ; export PATH
 fi
 
@@ -132,14 +136,14 @@
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
 Linux|GNU|GNU/*)
 	# If the system lacks a compiler, then just pick glibc.
 	# We could probably try harder.
 	LIBC=gnu
 
-	eval $set_cc_for_build
-	cat <<-EOF > $dummy.c
+	set_cc_for_build
+	cat <<-EOF > "$dummy.c"
 	#include <features.h>
 	#if defined(__UCLIBC__)
 	LIBC=uclibc
@@ -149,13 +153,20 @@
 	LIBC=gnu
 	#endif
 	EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+	# If ldd exists, use it to detect musl libc.
+	if command -v ldd >/dev/null && \
+		ldd --version 2>&1 | grep -q ^musl
+	then
+	    LIBC=musl
+	fi
 	;;
 esac
 
 # Note: order is significant - the case branches are not exclusive.
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:NetBSD:*:*)
 	# NetBSD (nbsd) targets should (where applicable) match one or
 	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -168,21 +179,31 @@
 	# Note: NetBSD doesn't particularly care about the vendor
 	# portion of the name.  We always set it to "unknown".
 	sysctl="sysctl -n hw.machine_arch"
-	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
-	case "${UNAME_MACHINE_ARCH}" in
+	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+	    "/sbin/$sysctl" 2>/dev/null || \
+	    "/usr/sbin/$sysctl" 2>/dev/null || \
+	    echo unknown)`
+	case "$UNAME_MACHINE_ARCH" in
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
 	    sh5el) machine=sh5le-unknown ;;
-	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	    earmv*)
+		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+		machine="${arch}${endian}"-unknown
+		;;
+	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
-	# to ELF recently, or will in the future.
-	case "${UNAME_MACHINE_ARCH}" in
+	# to ELF recently (or will in the future) and ABI.
+	case "$UNAME_MACHINE_ARCH" in
+	    earm*)
+		os=netbsdelf
+		;;
 	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-		eval $set_cc_for_build
+		set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
 		then
@@ -197,43 +218,72 @@
 		os=netbsd
 		;;
 	esac
+	# Determine ABI tags.
+	case "$UNAME_MACHINE_ARCH" in
+	    earm*)
+		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
+		;;
+	esac
 	# The OS release
 	# Debian GNU/NetBSD machines have a different userland, and
 	# thus, need a distinct triplet. However, they do not need
 	# kernel version information, so it can be replaced with a
 	# suitable tag, in the style of linux-gnu.
-	case "${UNAME_VERSION}" in
+	case "$UNAME_VERSION" in
 	    Debian*)
 		release='-gnu'
 		;;
 	    *)
-		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
 		;;
 	esac
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}"
+	echo "$machine-${os}${release}${abi-}"
 	exit ;;
     *:Bitrig:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
 	exit ;;
     *:OpenBSD:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
+	exit ;;
+    *:LibertyBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+	exit ;;
+    *:MidnightBSD:*:*)
+	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
 	exit ;;
     *:ekkoBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
 	exit ;;
     *:SolidBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+	exit ;;
+    *:OS108:*:*)
+	echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
 	exit ;;
     macppc:MirBSD:*:*)
-	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
 	exit ;;
     *:MirBSD:*:*)
-	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
+	exit ;;
+    *:Sortix:*:*)
+	echo "$UNAME_MACHINE"-unknown-sortix
+	exit ;;
+    *:Twizzler:*:*)
+	echo "$UNAME_MACHINE"-unknown-twizzler
+	exit ;;
+    *:Redox:*:*)
+	echo "$UNAME_MACHINE"-unknown-redox
+	exit ;;
+    mips:OSF1:*.*)
+	echo mips-dec-osf1
 	exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
@@ -251,63 +301,54 @@
 	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
 	case "$ALPHA_CPU_TYPE" in
 	    "EV4 (21064)")
-		UNAME_MACHINE="alpha" ;;
+		UNAME_MACHINE=alpha ;;
 	    "EV4.5 (21064)")
-		UNAME_MACHINE="alpha" ;;
+		UNAME_MACHINE=alpha ;;
 	    "LCA4 (21066/21068)")
-		UNAME_MACHINE="alpha" ;;
+		UNAME_MACHINE=alpha ;;
 	    "EV5 (21164)")
-		UNAME_MACHINE="alphaev5" ;;
+		UNAME_MACHINE=alphaev5 ;;
 	    "EV5.6 (21164A)")
-		UNAME_MACHINE="alphaev56" ;;
+		UNAME_MACHINE=alphaev56 ;;
 	    "EV5.6 (21164PC)")
-		UNAME_MACHINE="alphapca56" ;;
+		UNAME_MACHINE=alphapca56 ;;
 	    "EV5.7 (21164PC)")
-		UNAME_MACHINE="alphapca57" ;;
+		UNAME_MACHINE=alphapca57 ;;
 	    "EV6 (21264)")
-		UNAME_MACHINE="alphaev6" ;;
+		UNAME_MACHINE=alphaev6 ;;
 	    "EV6.7 (21264A)")
-		UNAME_MACHINE="alphaev67" ;;
+		UNAME_MACHINE=alphaev67 ;;
 	    "EV6.8CB (21264C)")
-		UNAME_MACHINE="alphaev68" ;;
+		UNAME_MACHINE=alphaev68 ;;
 	    "EV6.8AL (21264B)")
-		UNAME_MACHINE="alphaev68" ;;
+		UNAME_MACHINE=alphaev68 ;;
 	    "EV6.8CX (21264D)")
-		UNAME_MACHINE="alphaev68" ;;
+		UNAME_MACHINE=alphaev68 ;;
 	    "EV6.9A (21264/EV69A)")
-		UNAME_MACHINE="alphaev69" ;;
+		UNAME_MACHINE=alphaev69 ;;
 	    "EV7 (21364)")
-		UNAME_MACHINE="alphaev7" ;;
+		UNAME_MACHINE=alphaev7 ;;
 	    "EV7.9 (21364A)")
-		UNAME_MACHINE="alphaev79" ;;
+		UNAME_MACHINE=alphaev79 ;;
 	esac
 	# A Pn.n version is a patched version.
 	# A Vn.n version is a released version.
 	# A Tn.n version is a released field test version.
 	# A Xn.n version is an unreleased experimental baselevel.
 	# 1.2 uses "1.2" for uname -r.
-	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
 	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
 	exitcode=$?
 	trap '' 0
 	exit $exitcode ;;
-    Alpha\ *:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# Should we change UNAME_MACHINE based on the output of uname instead
-	# of the specific Alpha model?
-	echo alpha-pc-interix
-	exit ;;
-    21064:Windows_NT:50:3)
-	echo alpha-dec-winnt3.5
-	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
 	echo m68k-unknown-sysv4
 	exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-amigaos
+	echo "$UNAME_MACHINE"-unknown-amigaos
 	exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-	echo ${UNAME_MACHINE}-unknown-morphos
+	echo "$UNAME_MACHINE"-unknown-morphos
 	exit ;;
     *:OS/390:*:*)
 	echo i370-ibm-openedition
@@ -319,7 +360,7 @@
 	echo powerpc-ibm-os400
 	exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-	echo arm-acorn-riscix${UNAME_RELEASE}
+	echo arm-acorn-riscix"$UNAME_RELEASE"
 	exit ;;
     arm*:riscos:*:*|arm*:RISCOS:*:*)
 	echo arm-unknown-riscos
@@ -346,38 +387,38 @@
 	    sparc) echo sparc-icl-nx7; exit ;;
 	esac ;;
     s390x:SunOS:*:*)
-	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
 	exit ;;
     sun4H:SunOS:5.*:*)
-	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
 	exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-	echo i386-pc-auroraux${UNAME_RELEASE}
+	echo i386-pc-auroraux"$UNAME_RELEASE"
 	exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-	eval $set_cc_for_build
-	SUN_ARCH="i386"
+	set_cc_for_build
+	SUN_ARCH=i386
 	# If there is a compiler, see if it is configured for 64-bit objects.
 	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
 	# This test works for both compilers.
-	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
 	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
-		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
 		grep IS_64BIT_ARCH >/dev/null
 	    then
-		SUN_ARCH="x86_64"
+		SUN_ARCH=x86_64
 	    fi
 	fi
-	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:6*:*)
 	# According to config.sub, this is the proper way to canonicalize
 	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
 	# it's likely to be more like Solaris than SunOS4.
-	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     sun4*:SunOS:*:*)
 	case "`/usr/bin/arch -k`" in
@@ -386,25 +427,25 @@
 		;;
 	esac
 	# Japanese Language versions have a version number like `4.1.3-JL'.
-	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
 	exit ;;
     sun3*:SunOS:*:*)
-	echo m68k-sun-sunos${UNAME_RELEASE}
+	echo m68k-sun-sunos"$UNAME_RELEASE"
 	exit ;;
     sun*:*:4.2BSD:*)
 	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
 	case "`/bin/arch`" in
 	    sun3)
-		echo m68k-sun-sunos${UNAME_RELEASE}
+		echo m68k-sun-sunos"$UNAME_RELEASE"
 		;;
 	    sun4)
-		echo sparc-sun-sunos${UNAME_RELEASE}
+		echo sparc-sun-sunos"$UNAME_RELEASE"
 		;;
 	esac
 	exit ;;
     aushp:SunOS:*:*)
-	echo sparc-auspex-sunos${UNAME_RELEASE}
+	echo sparc-auspex-sunos"$UNAME_RELEASE"
 	exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -415,44 +456,44 @@
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint"$UNAME_RELEASE"
 	exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint"$UNAME_RELEASE"
 	exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-	echo m68k-atari-mint${UNAME_RELEASE}
+	echo m68k-atari-mint"$UNAME_RELEASE"
 	exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-	echo m68k-milan-mint${UNAME_RELEASE}
+	echo m68k-milan-mint"$UNAME_RELEASE"
 	exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-	echo m68k-hades-mint${UNAME_RELEASE}
+	echo m68k-hades-mint"$UNAME_RELEASE"
 	exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-	echo m68k-unknown-mint${UNAME_RELEASE}
+	echo m68k-unknown-mint"$UNAME_RELEASE"
 	exit ;;
     m68k:machten:*:*)
-	echo m68k-apple-machten${UNAME_RELEASE}
+	echo m68k-apple-machten"$UNAME_RELEASE"
 	exit ;;
     powerpc:machten:*:*)
-	echo powerpc-apple-machten${UNAME_RELEASE}
+	echo powerpc-apple-machten"$UNAME_RELEASE"
 	exit ;;
     RISC*:Mach:*:*)
 	echo mips-dec-mach_bsd4.3
 	exit ;;
     RISC*:ULTRIX:*:*)
-	echo mips-dec-ultrix${UNAME_RELEASE}
+	echo mips-dec-ultrix"$UNAME_RELEASE"
 	exit ;;
     VAX*:ULTRIX*:*:*)
-	echo vax-dec-ultrix${UNAME_RELEASE}
+	echo vax-dec-ultrix"$UNAME_RELEASE"
 	exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-	echo clipper-intergraph-clix${UNAME_RELEASE}
+	echo clipper-intergraph-clix"$UNAME_RELEASE"
 	exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	set_cc_for_build
+	sed 's/^	//' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
 	int main (int argc, char *argv[]) {
@@ -461,23 +502,23 @@
 #endif
 	#if defined (host_mips) && defined (MIPSEB)
 	#if defined (SYSTYPE_SYSV)
-	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
 	#endif
 	#if defined (SYSTYPE_SVR4)
-	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
 	#endif
 	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
 	#endif
 	#endif
 	  exit (-1);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c &&
-	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
 	    { echo "$SYSTEM_NAME"; exit; }
-	echo mips-mips-riscos${UNAME_RELEASE}
+	echo mips-mips-riscos"$UNAME_RELEASE"
 	exit ;;
     Motorola:PowerMAX_OS:*:*)
 	echo powerpc-motorola-powermax
@@ -503,17 +544,17 @@
     AViiON:dgux:*:*)
 	# DG/UX returns AViiON for all architectures
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
 	then
-	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+	       [ "$TARGET_BINARY_INTERFACE"x = x ]
 	    then
-		echo m88k-dg-dgux${UNAME_RELEASE}
+		echo m88k-dg-dgux"$UNAME_RELEASE"
 	    else
-		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
 	    fi
 	else
-	    echo i586-dg-dgux${UNAME_RELEASE}
+	    echo i586-dg-dgux"$UNAME_RELEASE"
 	fi
 	exit ;;
     M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
@@ -530,7 +571,7 @@
 	echo m68k-tektronix-bsd
 	exit ;;
     *:IRIX*:*:*)
-	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
 	exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
 	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
@@ -542,14 +583,14 @@
 	if [ -x /usr/bin/oslevel ] ; then
 		IBM_REV=`/usr/bin/oslevel`
 	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
 	fi
-	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
 	exit ;;
     *:AIX:2:3)
 	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-		eval $set_cc_for_build
-		sed 's/^		//' << EOF >$dummy.c
+		set_cc_for_build
+		sed 's/^		//' << EOF > "$dummy.c"
 		#include <sys/systemcfg.h>
 
 		main()
@@ -560,7 +601,7 @@
 			exit(0);
 			}
 EOF
-		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
 		then
 			echo "$SYSTEM_NAME"
 		else
@@ -574,26 +615,27 @@
 	exit ;;
     *:AIX:*:[4567])
 	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
 		IBM_ARCH=rs6000
 	else
 		IBM_ARCH=powerpc
 	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
+	if [ -x /usr/bin/lslpp ] ; then
+		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
-		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
 	fi
-	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
 	exit ;;
     *:AIX:*:*)
 	echo rs6000-ibm-aix
 	exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
 	echo romp-ibm-bsd4.4
 	exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
 	exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
 	echo rs6000-bull-bosx
@@ -608,28 +650,28 @@
 	echo m68k-hp-bsd4.4
 	exit ;;
     9000/[34678]??:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	case "${UNAME_MACHINE}" in
-	    9000/31? )            HP_ARCH=m68000 ;;
-	    9000/[34]?? )         HP_ARCH=m68k ;;
+	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+	case "$UNAME_MACHINE" in
+	    9000/31?)            HP_ARCH=m68000 ;;
+	    9000/[34]??)         HP_ARCH=m68k ;;
 	    9000/[678][0-9][0-9])
 		if [ -x /usr/bin/getconf ]; then
 		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
 		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-		    case "${sc_cpu_version}" in
-		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
-		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+		    case "$sc_cpu_version" in
+		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
 		      532)                      # CPU_PA_RISC2_0
-			case "${sc_kernel_bits}" in
-			  32) HP_ARCH="hppa2.0n" ;;
-			  64) HP_ARCH="hppa2.0w" ;;
-			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+			case "$sc_kernel_bits" in
+			  32) HP_ARCH=hppa2.0n ;;
+			  64) HP_ARCH=hppa2.0w ;;
+			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
 			esac ;;
 		    esac
 		fi
-		if [ "${HP_ARCH}" = "" ]; then
-		    eval $set_cc_for_build
-		    sed 's/^		//' << EOF >$dummy.c
+		if [ "$HP_ARCH" = "" ]; then
+		    set_cc_for_build
+		    sed 's/^		//' << EOF > "$dummy.c"
 
 		#define _HPUX_SOURCE
 		#include <stdlib.h>
@@ -662,13 +704,13 @@
 		    exit (0);
 		}
 EOF
-		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
 		    test -z "$HP_ARCH" && HP_ARCH=hppa
 		fi ;;
 	esac
-	if [ ${HP_ARCH} = "hppa2.0w" ]
+	if [ "$HP_ARCH" = hppa2.0w ]
 	then
-	    eval $set_cc_for_build
+	    set_cc_for_build
 
 	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
 	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -679,23 +721,23 @@
 	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
 	    # => hppa64-hp-hpux11.23
 
-	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
 		grep -q __LP64__
 	    then
-		HP_ARCH="hppa2.0w"
+		HP_ARCH=hppa2.0w
 	    else
-		HP_ARCH="hppa64"
+		HP_ARCH=hppa64
 	    fi
 	fi
-	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
 	exit ;;
     ia64:HP-UX:*:*)
-	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-	echo ia64-hp-hpux${HPUX_REV}
+	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux"$HPUX_REV"
 	exit ;;
     3050*:HI-UX:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	set_cc_for_build
+	sed 's/^	//' << EOF > "$dummy.c"
 	#include <unistd.h>
 	int
 	main ()
@@ -720,11 +762,11 @@
 	  exit (0);
 	}
 EOF
-	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
 		{ echo "$SYSTEM_NAME"; exit; }
 	echo unknown-hitachi-hiuxwe2
 	exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
 	echo hppa1.1-hp-bsd
 	exit ;;
     9000/8??:4.3bsd:*:*)
@@ -733,7 +775,7 @@
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
 	echo hppa1.0-hp-mpeix
 	exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
 	echo hppa1.1-hp-osf
 	exit ;;
     hp8??:OSF1:*:*)
@@ -741,9 +783,9 @@
 	exit ;;
     i*86:OSF1:*:*)
 	if [ -x /usr/sbin/sysversion ] ; then
-	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	    echo "$UNAME_MACHINE"-unknown-osf1mk
 	else
-	    echo ${UNAME_MACHINE}-unknown-osf1
+	    echo "$UNAME_MACHINE"-unknown-osf1
 	fi
 	exit ;;
     parisc*:Lites*:*:*)
@@ -768,130 +810,123 @@
 	echo c4-convex-bsd
 	exit ;;
     CRAY*Y-MP:*:*:*)
-	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*[A-Z]90:*:*:*)
-	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
 	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
 	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 	      -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*TS:*:*:*)
-	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*T3E:*:*:*)
-	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     CRAY*SV1:*:*:*)
-	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     *:UNICOS/mp:*:*)
-	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
 	exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
-	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
 	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     5000:UNIX_System_V:4.*:*)
-	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
-	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
 	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 	exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
 	exit ;;
     sparc*:BSD/OS:*:*)
-	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	echo sparc-unknown-bsdi"$UNAME_RELEASE"
 	exit ;;
     *:BSD/OS:*:*)
-	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+	exit ;;
+    arm:FreeBSD:*:*)
+	UNAME_PROCESSOR=`uname -p`
+	set_cc_for_build
+	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_PCS_VFP
+	then
+	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi
+	else
+	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf
+	fi
 	exit ;;
     *:FreeBSD:*:*)
 	UNAME_PROCESSOR=`/usr/bin/uname -p`
-	case ${UNAME_PROCESSOR} in
+	case "$UNAME_PROCESSOR" in
 	    amd64)
-		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-	    *)
-		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+		UNAME_PROCESSOR=x86_64 ;;
+	    i386)
+		UNAME_PROCESSOR=i586 ;;
 	esac
+	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
 	exit ;;
     i*:CYGWIN*:*)
-	echo ${UNAME_MACHINE}-pc-cygwin
+	echo "$UNAME_MACHINE"-pc-cygwin
 	exit ;;
     *:MINGW64*:*)
-	echo ${UNAME_MACHINE}-pc-mingw64
+	echo "$UNAME_MACHINE"-pc-mingw64
 	exit ;;
     *:MINGW*:*)
-	echo ${UNAME_MACHINE}-pc-mingw32
+	echo "$UNAME_MACHINE"-pc-mingw32
 	exit ;;
-    i*:MSYS*:*)
-	echo ${UNAME_MACHINE}-pc-msys
-	exit ;;
-    i*:windows32*:*)
-	# uname -m includes "-pc" on this system.
-	echo ${UNAME_MACHINE}-mingw32
+    *:MSYS*:*)
+	echo "$UNAME_MACHINE"-pc-msys
 	exit ;;
     i*:PW*:*)
-	echo ${UNAME_MACHINE}-pc-pw32
+	echo "$UNAME_MACHINE"-pc-pw32
 	exit ;;
     *:Interix*:*)
-	case ${UNAME_MACHINE} in
+	case "$UNAME_MACHINE" in
 	    x86)
-		echo i586-pc-interix${UNAME_RELEASE}
+		echo i586-pc-interix"$UNAME_RELEASE"
 		exit ;;
 	    authenticamd | genuineintel | EM64T)
-		echo x86_64-unknown-interix${UNAME_RELEASE}
+		echo x86_64-unknown-interix"$UNAME_RELEASE"
 		exit ;;
 	    IA64)
-		echo ia64-unknown-interix${UNAME_RELEASE}
+		echo ia64-unknown-interix"$UNAME_RELEASE"
 		exit ;;
 	esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-	echo i${UNAME_MACHINE}-pc-mks
-	exit ;;
-    8664:Windows_NT:*)
-	echo x86_64-pc-mks
-	exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-	# UNAME_MACHINE based on the output of uname instead of i386?
-	echo i586-pc-interix
-	exit ;;
     i*:UWIN*:*)
-	echo ${UNAME_MACHINE}-pc-uwin
+	echo "$UNAME_MACHINE"-pc-uwin
 	exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-	echo x86_64-unknown-cygwin
-	exit ;;
-    p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin
+	echo x86_64-pc-cygwin
 	exit ;;
     prep*:SunOS:5.*:*)
-	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
 	exit ;;
-    i*86:Minix:*:*)
-	echo ${UNAME_MACHINE}-pc-minix
+    *:Minix:*:*)
+	echo "$UNAME_MACHINE"-unknown-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     alpha:Linux:*:*)
-	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
 	  EV5)   UNAME_MACHINE=alphaev5 ;;
 	  EV56)  UNAME_MACHINE=alphaev56 ;;
 	  PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -901,129 +936,169 @@
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     arc:Linux:*:* | arceb:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     arm*:Linux:*:*)
-	eval $set_cc_for_build
+	set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+	exit ;;
+    e2k:Linux:*:*)
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     i*86:Linux:*:*)
-	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+	exit ;;
+    k1om:Linux:*:*)
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
+	set_cc_for_build
+	IS_GLIBC=0
+	test x"${LIBC}" = xgnu && IS_GLIBC=1
+	sed 's/^	//' << EOF > "$dummy.c"
 	#undef CPU
-	#undef ${UNAME_MACHINE}
-	#undef ${UNAME_MACHINE}el
+	#undef mips
+	#undef mipsel
+	#undef mips64
+	#undef mips64el
+	#if ${IS_GLIBC} && defined(_ABI64)
+	LIBCABI=gnuabi64
+	#else
+	#if ${IS_GLIBC} && defined(_ABIN32)
+	LIBCABI=gnuabin32
+	#else
+	LIBCABI=${LIBC}
+	#endif
+	#endif
+
+	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+	CPU=mipsisa64r6
+	#else
+	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+	CPU=mipsisa32r6
+	#else
+	#if defined(__mips64)
+	CPU=mips64
+	#else
+	CPU=mips
+	#endif
+	#endif
+	#endif
+
 	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-	CPU=${UNAME_MACHINE}el
+	MIPS_ENDIAN=el
 	#else
 	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-	CPU=${UNAME_MACHINE}
+	MIPS_ENDIAN=
 	#else
-	CPU=
+	MIPS_ENDIAN=
 	#endif
 	#endif
 EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`"
+	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
 	;;
-    or1k:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+    mips64el:Linux:*:*)
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
-    or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+    openrisc*:Linux:*:*)
+	echo or1k-unknown-linux-"$LIBC"
+	exit ;;
+    or32:Linux:*:* | or1k*:Linux:*:*)
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-${LIBC}
+	echo sparc-unknown-linux-"$LIBC"
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-${LIBC}
+	echo hppa64-unknown-linux-"$LIBC"
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-	  *)    echo hppa-unknown-linux-${LIBC} ;;
+	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+	  *)    echo hppa-unknown-linux-"$LIBC" ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-${LIBC}
+	echo powerpc64-unknown-linux-"$LIBC"
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-${LIBC}
+	echo powerpc-unknown-linux-"$LIBC"
 	exit ;;
     ppc64le:Linux:*:*)
-	echo powerpc64le-unknown-linux-${LIBC}
+	echo powerpc64le-unknown-linux-"$LIBC"
 	exit ;;
     ppcle:Linux:*:*)
-	echo powerpcle-unknown-linux-${LIBC}
+	echo powerpcle-unknown-linux-"$LIBC"
+	exit ;;
+    riscv32:Linux:*:* | riscv64:Linux:*:*)
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1037,34 +1112,34 @@
 	# I am not positive that other SVR4 systems won't match this,
 	# I just have to hope.  -- rms.
 	# Use sysv4.2uw... so that sysv4* matches it.
-	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
 	exit ;;
     i*86:OS/2:*:*)
 	# If we were able to find `uname', then EMX Unix compatibility
 	# is probably installed.
-	echo ${UNAME_MACHINE}-pc-os2-emx
+	echo "$UNAME_MACHINE"-pc-os2-emx
 	exit ;;
     i*86:XTS-300:*:STOP)
-	echo ${UNAME_MACHINE}-unknown-stop
+	echo "$UNAME_MACHINE"-unknown-stop
 	exit ;;
     i*86:atheos:*:*)
-	echo ${UNAME_MACHINE}-unknown-atheos
+	echo "$UNAME_MACHINE"-unknown-atheos
 	exit ;;
     i*86:syllable:*:*)
-	echo ${UNAME_MACHINE}-pc-syllable
+	echo "$UNAME_MACHINE"-pc-syllable
 	exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-	echo i386-unknown-lynxos${UNAME_RELEASE}
+	echo i386-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     i*86:*DOS:*:*)
-	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	echo "$UNAME_MACHINE"-pc-msdosdjgpp
 	exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+    i*86:*:4.*:*)
+	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
 	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
 	else
-		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
 	fi
 	exit ;;
     i*86:*:5:[678]*)
@@ -1074,12 +1149,12 @@
 	    *Pentium)	     UNAME_MACHINE=i586 ;;
 	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 	esac
-	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
 	exit ;;
     i*86:*:3.2:*)
 	if test -f /usr/options/cb.name; then
 		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
 	elif /bin/uname -X 2>/dev/null >/dev/null ; then
 		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1089,9 +1164,9 @@
 			&& UNAME_MACHINE=i686
 		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
 			&& UNAME_MACHINE=i686
-		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
 	else
-		echo ${UNAME_MACHINE}-pc-sysv32
+		echo "$UNAME_MACHINE"-pc-sysv32
 	fi
 	exit ;;
     pc:*:*:*)
@@ -1099,7 +1174,7 @@
 	# uname -m prints for DJGPP always 'pc', but it prints nothing about
 	# the processor, so we play safe by assuming i586.
 	# Note: whatever this is, it MUST be the same as what config.sub
-	# prints for the "djgpp" host, or else GDB configury will decide that
+	# prints for the "djgpp" host, or else GDB configure will decide that
 	# this is a cross-build.
 	echo i586-pc-msdosdjgpp
 	exit ;;
@@ -1111,9 +1186,9 @@
 	exit ;;
     i860:*:4.*:*) # i860-SVR4
 	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
 	else # Add other i860-SVR4 vendors below as they are discovered.
-	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
 	fi
 	exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1133,9 +1208,9 @@
 	test -r /etc/.relid \
 	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 	  && { echo i486-ncr-sysv4; exit; } ;;
@@ -1144,28 +1219,28 @@
 	test -r /etc/.relid \
 	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
 	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	echo m68k-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     mc68030:UNIX_System_V:4.*:*)
 	echo m68k-atari-sysv4
 	exit ;;
     TSUNAMI:LynxOS:2.*:*)
-	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	echo sparc-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     rs6000:LynxOS:2.*:*)
-	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
 	exit ;;
     SM[BE]S:UNIX_SV:*:*)
-	echo mips-dde-sysv${UNAME_RELEASE}
+	echo mips-dde-sysv"$UNAME_RELEASE"
 	exit ;;
     RM*:ReliantUNIX-*:*:*)
 	echo mips-sni-sysv4
@@ -1176,7 +1251,7 @@
     *:SINIX-*:*:*)
 	if uname -p 2>/dev/null >/dev/null ; then
 		UNAME_MACHINE=`(uname -p) 2>/dev/null`
-		echo ${UNAME_MACHINE}-sni-sysv4
+		echo "$UNAME_MACHINE"-sni-sysv4
 	else
 		echo ns32k-sni-sysv
 	fi
@@ -1196,23 +1271,23 @@
 	exit ;;
     i*86:VOS:*:*)
 	# From Paul.Green@stratus.com.
-	echo ${UNAME_MACHINE}-stratus-vos
+	echo "$UNAME_MACHINE"-stratus-vos
 	exit ;;
     *:VOS:*:*)
 	# From Paul.Green@stratus.com.
 	echo hppa1.1-stratus-vos
 	exit ;;
     mc68*:A/UX:*:*)
-	echo m68k-apple-aux${UNAME_RELEASE}
+	echo m68k-apple-aux"$UNAME_RELEASE"
 	exit ;;
     news*:NEWS-OS:6*:*)
 	echo mips-sony-newsos6
 	exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 	if [ -d /usr/nec ]; then
-		echo mips-nec-sysv${UNAME_RELEASE}
+		echo mips-nec-sysv"$UNAME_RELEASE"
 	else
-		echo mips-unknown-sysv${UNAME_RELEASE}
+		echo mips-unknown-sysv"$UNAME_RELEASE"
 	fi
 	exit ;;
     BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
@@ -1231,77 +1306,94 @@
 	echo x86_64-unknown-haiku
 	exit ;;
     SX-4:SUPER-UX:*:*)
-	echo sx4-nec-superux${UNAME_RELEASE}
+	echo sx4-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-5:SUPER-UX:*:*)
-	echo sx5-nec-superux${UNAME_RELEASE}
+	echo sx5-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-6:SUPER-UX:*:*)
-	echo sx6-nec-superux${UNAME_RELEASE}
+	echo sx6-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-7:SUPER-UX:*:*)
-	echo sx7-nec-superux${UNAME_RELEASE}
+	echo sx7-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-8:SUPER-UX:*:*)
-	echo sx8-nec-superux${UNAME_RELEASE}
+	echo sx8-nec-superux"$UNAME_RELEASE"
 	exit ;;
     SX-8R:SUPER-UX:*:*)
-	echo sx8r-nec-superux${UNAME_RELEASE}
+	echo sx8r-nec-superux"$UNAME_RELEASE"
+	exit ;;
+    SX-ACE:SUPER-UX:*:*)
+	echo sxace-nec-superux"$UNAME_RELEASE"
 	exit ;;
     Power*:Rhapsody:*:*)
-	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
 	exit ;;
     *:Rhapsody:*:*)
-	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
 	exit ;;
     *:Darwin:*:*)
-	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	eval $set_cc_for_build
-	if test "$UNAME_PROCESSOR" = unknown ; then
-	    UNAME_PROCESSOR=powerpc
+	UNAME_PROCESSOR=`uname -p`
+	case $UNAME_PROCESSOR in
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	if command -v xcode-select > /dev/null 2> /dev/null && \
+		! xcode-select --print-path > /dev/null 2> /dev/null ; then
+	    # Avoid executing cc if there is no toolchain installed as
+	    # cc will be a stub that puts up a graphical alert
+	    # prompting the user to install developer tools.
+	    CC_FOR_BUILD=no_compiler_found
+	else
+	    set_cc_for_build
 	fi
-	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
-	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		    grep IS_64BIT_ARCH >/dev/null
-		then
-		    case $UNAME_PROCESSOR in
-			i386) UNAME_PROCESSOR=x86_64 ;;
-			powerpc) UNAME_PROCESSOR=powerpc64 ;;
-		    esac
-		fi
+	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		   grep IS_64BIT_ARCH >/dev/null
+	    then
+		case $UNAME_PROCESSOR in
+		    i386) UNAME_PROCESSOR=x86_64 ;;
+		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		esac
+	    fi
+	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		   grep IS_PPC >/dev/null
+	    then
+		UNAME_PROCESSOR=powerpc
 	    fi
 	elif test "$UNAME_PROCESSOR" = i386 ; then
-	    # Avoid executing cc on OS X 10.9, as it ships with a stub
-	    # that puts up a graphical alert prompting to install
-	    # developer tools.  Any system running Mac OS X 10.7 or
-	    # later (Darwin 11 and later) is required to have a 64-bit
-	    # processor. This is not true of the ARM version of Darwin
-	    # that Apple uses in portable devices.
-	    UNAME_PROCESSOR=x86_64
+	    # uname -m returns i386 or x86_64
+	    UNAME_PROCESSOR=$UNAME_MACHINE
 	fi
-	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 	UNAME_PROCESSOR=`uname -p`
-	if test "$UNAME_PROCESSOR" = "x86"; then
+	if test "$UNAME_PROCESSOR" = x86; then
 		UNAME_PROCESSOR=i386
 		UNAME_MACHINE=pc
 	fi
-	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
 	exit ;;
     *:QNX:*:4*)
 	echo i386-pc-qnx
 	exit ;;
-    NEO-?:NONSTOP_KERNEL:*:*)
-	echo neo-tandem-nsk${UNAME_RELEASE}
+    NEO-*:NONSTOP_KERNEL:*:*)
+	echo neo-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     NSE-*:NONSTOP_KERNEL:*:*)
-	echo nse-tandem-nsk${UNAME_RELEASE}
+	echo nse-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-	echo nsr-tandem-nsk${UNAME_RELEASE}
+    NSR-*:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk"$UNAME_RELEASE"
+	exit ;;
+    NSV-*:NONSTOP_KERNEL:*:*)
+	echo nsv-tandem-nsk"$UNAME_RELEASE"
+	exit ;;
+    NSX-*:NONSTOP_KERNEL:*:*)
+	echo nsx-tandem-nsk"$UNAME_RELEASE"
 	exit ;;
     *:NonStop-UX:*:*)
 	echo mips-compaq-nonstopux
@@ -1310,18 +1402,19 @@
 	echo bs2000-siemens-sysv
 	exit ;;
     DS/*:UNIX_System_V:*:*)
-	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
 	exit ;;
     *:Plan9:*:*)
 	# "uname -m" is not consistent, so use $cputype instead. 386
 	# is converted to i386 for consistency with other x86
 	# operating systems.
-	if test "$cputype" = "386"; then
+	# shellcheck disable=SC2154
+	if test "$cputype" = 386; then
 	    UNAME_MACHINE=i386
 	else
 	    UNAME_MACHINE="$cputype"
 	fi
-	echo ${UNAME_MACHINE}-unknown-plan9
+	echo "$UNAME_MACHINE"-unknown-plan9
 	exit ;;
     *:TOPS-10:*:*)
 	echo pdp10-unknown-tops10
@@ -1342,14 +1435,14 @@
 	echo pdp10-unknown-its
 	exit ;;
     SEI:*:*:SEIUX)
-	echo mips-sei-seiux${UNAME_RELEASE}
+	echo mips-sei-seiux"$UNAME_RELEASE"
 	exit ;;
     *:DragonFly:*:*)
-	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
 	exit ;;
     *:*VMS:*:*)
 	UNAME_MACHINE=`(uname -p) 2>/dev/null`
-	case "${UNAME_MACHINE}" in
+	case "$UNAME_MACHINE" in
 	    A*) echo alpha-dec-vms ; exit ;;
 	    I*) echo ia64-dec-vms ; exit ;;
 	    V*) echo vax-dec-vms ; exit ;;
@@ -1358,24 +1451,39 @@
 	echo i386-pc-xenix
 	exit ;;
     i*86:skyos:*:*)
-	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
 	exit ;;
     i*86:rdos:*:*)
-	echo ${UNAME_MACHINE}-pc-rdos
+	echo "$UNAME_MACHINE"-pc-rdos
 	exit ;;
     i*86:AROS:*:*)
-	echo ${UNAME_MACHINE}-pc-aros
+	echo "$UNAME_MACHINE"-pc-aros
 	exit ;;
     x86_64:VMkernel:*:*)
-	echo ${UNAME_MACHINE}-unknown-esx
+	echo "$UNAME_MACHINE"-unknown-esx
+	exit ;;
+    amd64:Isilon\ OneFS:*:*)
+	echo x86_64-unknown-onefs
+	exit ;;
+    *:Unleashed:*:*)
+	echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
 	exit ;;
 esac
 
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
 #ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
 #endif
 main ()
 {
@@ -1388,22 +1496,14 @@
 #include <sys/param.h>
   printf ("m68k-sony-newsos%s\n",
 #ifdef NEWSOS4
-	"4"
+  "4"
 #else
-	""
+  ""
 #endif
-	); exit (0);
+  ); exit (0);
 #endif
 #endif
 
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
 #if defined (NeXT)
 #if !defined (__ARCHITECTURE__)
 #define __ARCHITECTURE__ "m68k"
@@ -1443,39 +1543,54 @@
 #endif
 
 #if defined (_SEQUENT_)
-    struct utsname un;
+  struct utsname un;
 
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
+  uname(&un);
+  if (strncmp(un.version, "V2", 2) == 0) {
+    printf ("i386-sequent-ptx2\n"); exit (0);
+  }
+  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+    printf ("i386-sequent-ptx1\n"); exit (0);
+  }
+  printf ("i386-sequent-ptx\n"); exit (0);
 #endif
 
 #if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+  printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+  printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+  printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+  printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+  struct utsname un;
+  uname (&un);
+  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+  printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+  struct utsname *un;
+  uname (&un);
+  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+  printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
 #endif
 
 #if defined (alliant) && defined (i860)
@@ -1486,54 +1601,38 @@
 }
 EOF
 
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` &&
 	{ echo "$SYSTEM_NAME"; exit; }
 
 # Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
 
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+echo "$0: unable to guess system type" >&2
 
-# Convex versions that predate uname can use getsysinfo(1)
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+    mips:Linux | mips64:Linux)
+	# If we got here on MIPS GNU/Linux, output extra information.
+	cat >&2 <<EOF
 
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+	;;
+esac
 
 cat >&2 <<EOF
-$0: unable to guess system type
 
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
 
 config.guess timestamp = $timestamp
 
@@ -1552,16 +1651,16 @@
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM  = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
 EOF
 
 exit 1
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
diff --git a/config/config.rpath b/config/config.rpath
index 5ead758..98183ff 100755
--- a/config/config.rpath
+++ b/config/config.rpath
@@ -2,28 +2,13 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2002 Free Software Foundation, Inc.
+#   Copyright 1996-2016 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
-#   This program is free software; you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful, but
-#   WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#   General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-#   As a special exception to the GNU General Public License, if you
-#   distribute this file as part of a program that contains a
-#   configuration script generated by Autoconf, you may include it under
-#   the same distribution terms that you use for the rest of that program.
+#   This file is free software; the Free Software Foundation gives
+#   unlimited permission to copy and/or distribute it, with or without
+#   modifications, as long as this notice is preserved.
 #
 # The first argument passed to this file is the canonical host specification,
 #    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
@@ -34,66 +19,137 @@
 #
 # The set of defined variables is at the end of this script.
 
-# All known linkers require a `.a' archive for static linking (except M$VC,
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+#   than 256 bytes, otherwise the compiler driver will dump core. The only
+#   known workaround is to choose shorter directory names for the build
+#   directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
-shlibext=
+shrext=.so
 
 host="$1"
 host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
 host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
 wl=
 if test "$GCC" = yes; then
   wl='-Wl,'
 else
   case "$host_os" in
-    aix3* | aix4* | aix5*)
+    aix*)
       wl='-Wl,'
       ;;
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      ;;
     hpux9* | hpux10* | hpux11*)
       wl='-Wl,'
       ;;
-    irix5* | irix6*)
+    irix5* | irix6* | nonstopux*)
       wl='-Wl,'
       ;;
-    linux*)
-      echo '__INTEL_COMPILER' > conftest.$ac_ext
-      if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
-      then
-        :
-      else
-        # Intel icc
-        wl='-Qoption,ld,'
-      fi
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+        ecc*)
+          wl='-Wl,'
+          ;;
+        icc* | ifort*)
+          wl='-Wl,'
+          ;;
+        lf95*)
+          wl='-Wl,'
+          ;;
+        nagfor*)
+          wl='-Wl,-Wl,,'
+          ;;
+        pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+          wl='-Wl,'
+          ;;
+        ccc*)
+          wl='-Wl,'
+          ;;
+        xl* | bgxl* | bgf* | mpixl*)
+          wl='-Wl,'
+          ;;
+        como)
+          wl='-lopt='
+          ;;
+        *)
+          case `$CC -V 2>&1 | sed 5q` in
+            *Sun\ F* | *Sun*Fortran*)
+              wl=
+              ;;
+            *Sun\ C*)
+              wl='-Wl,'
+              ;;
+          esac
+          ;;
+      esac
+      ;;
+    newsos6)
+      ;;
+    *nto* | *qnx*)
       ;;
     osf3* | osf4* | osf5*)
       wl='-Wl,'
       ;;
+    rdos*)
+      ;;
     solaris*)
-      wl='-Wl,'
+      case $cc_basename in
+        f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+          wl='-Qoption ld '
+          ;;
+        *)
+          wl='-Wl,'
+          ;;
+      esac
       ;;
     sunos4*)
       wl='-Qoption ld '
       ;;
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      if test "x$host_vendor" = xsni; then
-        wl='-LD'
-      else
-        wl='-Wl,'
-      fi
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      wl='-Wl,'
+      ;;
+    sysv4*MP*)
+      ;;
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      wl='-Wl,'
+      ;;
+    unicos*)
+      wl='-Wl,'
+      ;;
+    uts4*)
       ;;
   esac
 fi
 
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
 hardcode_libdir_flag_spec=
 hardcode_libdir_separator=
 hardcode_direct=no
 hardcode_minus_L=no
 
 case "$host_os" in
-  cygwin* | mingw* | pw32*)
+  cygwin* | mingw* | pw32* | cegcc*)
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
@@ -101,6 +157,10 @@
       with_gnu_ld=no
     fi
     ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
   openbsd*)
     with_gnu_ld=no
     ;;
@@ -108,56 +168,97 @@
 
 ld_shlibs=yes
 if test "$with_gnu_ld" = yes; then
+  # Set some defaults for GNU ld with shared library support. These
+  # are reset later if shared libraries are not supported. Putting them
+  # here allows them to be overridden if necessary.
+  # Unlike libtool, we use -rpath here, not --rpath, since the documented
+  # option of GNU ld is called -rpath, not --rpath.
+  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
   case "$host_os" in
-    aix3* | aix4* | aix5*)
-      # On AIX, the GNU linker is very broken
-      ld_shlibs=no
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+        ld_shlibs=no
+      fi
       ;;
     amigaos*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can use
-      # them.
-      ld_shlibs=no
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
       ;;
     beos*)
-      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         :
       else
         ld_shlibs=no
       fi
       ;;
-    cygwin* | mingw* | pw32*)
+    cygwin* | mingw* | pw32* | cegcc*)
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
-      ;;
-    solaris* | sysv5*)
-      if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
-        ld_shlibs=no
-      elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
         :
       else
         ld_shlibs=no
       fi
       ;;
+    haiku*)
+      ;;
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      ;;
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    netbsd*)
+      ;;
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+        ld_shlibs=no
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+          ld_shlibs=no
+          ;;
+        *)
+          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+          else
+            ld_shlibs=no
+          fi
+          ;;
+      esac
+      ;;
     sunos4*)
       hardcode_direct=yes
       ;;
     *)
-      if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
         :
       else
         ld_shlibs=no
       fi
       ;;
   esac
-  if test "$ld_shlibs" = yes; then
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+  if test "$ld_shlibs" = no; then
+    hardcode_libdir_flag_spec=
   fi
 else
   case "$host_os" in
@@ -171,7 +272,7 @@
         hardcode_direct=unsupported
       fi
       ;;
-    aix4* | aix5*)
+    aix[4-9]*)
       if test "$host_cpu" = ia64; then
         # On IA64, the linker does run time linking by default, so we don't
         # have to do anything special.
@@ -181,13 +282,14 @@
         # Test if we are trying to use run time linking or normal
         # AIX style linking. If -brtl is somewhere in LDFLAGS, we
         # need to do runtime linking.
-        case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
           for ld_flag in $LDFLAGS; do
             if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
               aix_use_runtimelinking=yes
               break
             fi
           done
+          ;;
         esac
       fi
       hardcode_direct=yes
@@ -199,7 +301,7 @@
             strings "$collect2name" | grep resolve_lib_name >/dev/null
           then
             # We have reworked collect2
-            hardcode_direct=yes
+            :
           else
             # We have old collect2
             hardcode_direct=unsupported
@@ -207,25 +309,46 @@
             hardcode_libdir_flag_spec='-L$libdir'
             hardcode_libdir_separator=
           fi
+          ;;
         esac
       fi
+      # Begin _LT_AC_SYS_LIBPATH_AIX.
+      echo 'int main () { return 0; }' > conftest.c
+      ${CC} ${LDFLAGS} conftest.c -o conftest
+      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      if test -z "$aix_libpath"; then
+        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      fi
+      if test -z "$aix_libpath"; then
+        aix_libpath="/usr/lib:/lib"
+      fi
+      rm -f conftest.c conftest
+      # End _LT_AC_SYS_LIBPATH_AIX.
       if test "$aix_use_runtimelinking" = yes; then
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
       else
         if test "$host_cpu" = ia64; then
           hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
         else
-          hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
+          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
         fi
       fi
       ;;
     amigaos*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs=no
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
       ;;
-    cygwin* | mingw* | pw32*)
+    bsdi[45]*)
+      ;;
+    cygwin* | mingw* | pw32* | cegcc*)
       # When not using gcc, we currently assume that we are using
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -234,31 +357,60 @@
       libext=lib
       ;;
     darwin* | rhapsody*)
-      hardcode_direct=yes
+      hardcode_direct=no
+      if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+        :
+      else
+        ld_shlibs=no
+      fi
       ;;
-    freebsd1*)
-      ld_shlibs=no
+    dgux*)
+      hardcode_libdir_flag_spec='-L$libdir'
       ;;
-    freebsd2.2*)
-      hardcode_libdir_flag_spec='-R$libdir'
-      hardcode_direct=yes
-      ;;
-    freebsd2*)
+    freebsd2.[01]*)
       hardcode_direct=yes
       hardcode_minus_L=yes
       ;;
-    freebsd*)
+    freebsd* | dragonfly*)
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
       ;;
-    hpux9* | hpux10* | hpux11*)
+    hpux9*)
       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
       hardcode_libdir_separator=:
       hardcode_direct=yes
-      hardcode_minus_L=yes # Not in the search PATH, but as the default
-                           # location of the library.
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
       ;;
-    irix5* | irix6*)
+    hpux10*)
+      if test "$with_gnu_ld" = no; then
+        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator=:
+        hardcode_direct=yes
+        # hardcode_minus_L: Not really in the search PATH,
+        # but as the default location of the library.
+        hardcode_minus_L=yes
+      fi
+      ;;
+    hpux11*)
+      if test "$with_gnu_ld" = no; then
+        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator=:
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct=no
+            ;;
+          *)
+            hardcode_direct=yes
+            # hardcode_minus_L: Not really in the search PATH,
+            # but as the default location of the library.
+            hardcode_minus_L=yes
+            ;;
+        esac
+      fi
+      ;;
+    irix5* | irix6* | nonstopux*)
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
       ;;
@@ -271,19 +423,25 @@
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
       ;;
+    *nto* | *qnx*)
+      ;;
     openbsd*)
-      hardcode_direct=yes
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      if test -f /usr/libexec/ld.so; then
+        hardcode_direct=yes
+        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+        else
+          case "$host_os" in
+            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+              hardcode_libdir_flag_spec='-R$libdir'
+              ;;
+            *)
+              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+              ;;
+          esac
+        fi
       else
-        case "$host_os" in
-          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-            hardcode_libdir_flag_spec='-R$libdir'
-            ;;
-          *)
-            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-            ;;
-        esac
+        ld_shlibs=no
       fi
       ;;
     os2*)
@@ -303,8 +461,6 @@
       fi
       hardcode_libdir_separator=:
       ;;
-    sco3.2v5*)
-      ;;
     solaris*)
       hardcode_libdir_flag_spec='-R$libdir'
       ;;
@@ -314,33 +470,33 @@
       hardcode_minus_L=yes
       ;;
     sysv4)
-      if test "x$host_vendor" = xsno; then
-        hardcode_direct=yes # is this really true???
-      else
-        hardcode_direct=no # Motorola manual says yes, but my tests say they lie
-      fi
+      case $host_vendor in
+        sni)
+          hardcode_direct=yes # is this really true???
+          ;;
+        siemens)
+          hardcode_direct=no
+          ;;
+        motorola)
+          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+          ;;
+      esac
       ;;
     sysv4.3*)
       ;;
-    sysv5*)
-      hardcode_libdir_flag_spec=
-      ;;
-    uts4*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      ;;
-    dgux*)
-      hardcode_libdir_flag_spec='-L$libdir'
-      ;;
     sysv4*MP*)
       if test -d /usr/nec; then
         ld_shlibs=yes
       fi
       ;;
-    sysv4.2uw2*)
-      hardcode_direct=yes
-      hardcode_minus_L=no
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
       ;;
-    sysv5uw7* | unixware7*)
+    sysv5* | sco3.2v5* | sco5v6*)
+      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator=':'
+      ;;
+    uts4*)
+      hardcode_libdir_flag_spec='-L$libdir'
       ;;
     *)
       ld_shlibs=no
@@ -349,136 +505,151 @@
 fi
 
 # Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec=      # the last element of library_names_spec in libtool.m4
 libname_spec='lib$name'
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 case "$host_os" in
   aix3*)
-    shlibext=so
+    library_names_spec='$libname.a'
     ;;
-  aix4* | aix5*)
-    shlibext=so
+  aix[4-9]*)
+    library_names_spec='$libname$shrext'
     ;;
   amigaos*)
-    shlibext=ixlibrary
-    ;;
-  beos*)
-    shlibext=so
-    ;;
-  bsdi4*)
-    shlibext=so
-    sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-    sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-    ;;
-  cygwin* | mingw* | pw32*)
-    case $GCC,$host_os in
-      yes,cygwin*)
-        shlibext=dll.a
-        ;;
-      yes,mingw*)
-        shlibext=dll
-        sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
-        ;;
-      yes,pw32*)
-        shlibext=dll
-        ;;
-      *)
-        shlibext=dll
-        ;;
+    case "$host_cpu" in
+      powerpc*)
+        library_names_spec='$libname$shrext' ;;
+      m68k)
+        library_names_spec='$libname.a' ;;
     esac
     ;;
+  beos*)
+    library_names_spec='$libname$shrext'
+    ;;
+  bsdi[45]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  cygwin* | mingw* | pw32* | cegcc*)
+    shrext=.dll
+    library_names_spec='$libname.dll.a $libname.lib'
+    ;;
   darwin* | rhapsody*)
-    shlibext=dylib
+    shrext=.dylib
+    library_names_spec='$libname$shrext'
     ;;
-  freebsd1*)
+  dgux*)
+    library_names_spec='$libname$shrext'
     ;;
-  freebsd*)
-    shlibext=so
+  freebsd[23].*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  freebsd* | dragonfly*)
+    library_names_spec='$libname$shrext'
     ;;
   gnu*)
-    shlibext=so
+    library_names_spec='$libname$shrext'
+    ;;
+  haiku*)
+    library_names_spec='$libname$shrext'
     ;;
   hpux9* | hpux10* | hpux11*)
-    shlibext=sl
+    case $host_cpu in
+      ia64*)
+        shrext=.so
+        ;;
+      hppa*64*)
+        shrext=.sl
+        ;;
+      *)
+        shrext=.sl
+        ;;
+    esac
+    library_names_spec='$libname$shrext'
     ;;
-  irix5* | irix6*)
-    shlibext=so
+  interix[3-9]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  irix5* | irix6* | nonstopux*)
+    library_names_spec='$libname$shrext'
     case "$host_os" in
-      irix5*)
+      irix5* | nonstopux*)
         libsuff= shlibsuff=
         ;;
       *)
         case $LD in
-          *-32|*"-32 ") libsuff= shlibsuff= ;;
-          *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
-          *-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
+          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
           *) libsuff= shlibsuff= ;;
         esac
         ;;
     esac
-    sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-    sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
     ;;
-  linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+  linux*oldld* | linux*aout* | linux*coff*)
     ;;
-  linux-gnu*)
-    shlibext=so
+  linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  knetbsd*-gnu)
+    library_names_spec='$libname$shrext'
     ;;
   netbsd*)
-    shlibext=so
+    library_names_spec='$libname$shrext'
     ;;
   newsos6)
-    shlibext=so
+    library_names_spec='$libname$shrext'
+    ;;
+  *nto* | *qnx*)
+    library_names_spec='$libname$shrext'
     ;;
   openbsd*)
-    shlibext=so
+    library_names_spec='$libname$shrext$versuffix'
     ;;
   os2*)
     libname_spec='$name'
-    shlibext=dll
+    shrext=.dll
+    library_names_spec='$libname.a'
     ;;
   osf3* | osf4* | osf5*)
-    shlibext=so
-    sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-    sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+    library_names_spec='$libname$shrext'
     ;;
-  sco3.2v5*)
-    shlibext=so
+  rdos*)
     ;;
   solaris*)
-    shlibext=so
+    library_names_spec='$libname$shrext'
     ;;
   sunos4*)
-    shlibext=so
+    library_names_spec='$libname$shrext$versuffix'
     ;;
-  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-    shlibext=so
-    case "$host_vendor" in
-      motorola)
-        sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-        ;;
-    esac
-    ;;
-  uts4*)
-    shlibext=so
-    ;;
-  dgux*)
-    shlibext=so
+  sysv4 | sysv4.3*)
+    library_names_spec='$libname$shrext'
     ;;
   sysv4*MP*)
-    if test -d /usr/nec; then
-      shlibext=so
-    fi
+    library_names_spec='$libname$shrext'
+    ;;
+  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+    library_names_spec='$libname$shrext'
+    ;;
+  tpf*)
+    library_names_spec='$libname$shrext'
+    ;;
+  uts4*)
+    library_names_spec='$libname$shrext'
     ;;
 esac
 
 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
 escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
 escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
 
-sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
 
 # How to pass a linker flag through the compiler.
 wl="$escaped_wl"
@@ -489,6 +660,12 @@
 # Shared library suffix (normally "so").
 shlibext="$shlibext"
 
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
 # Flag to hardcode \$libdir into a binary during linking.
 # This must work even if \$libdir does not exist.
 hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
@@ -504,10 +681,4 @@
 # resulting binary.
 hardcode_minus_L="$hardcode_minus_L"
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"
-
 EOF
diff --git a/config/config.sub b/config/config.sub
old mode 100644
new mode 100755
index 61cb4bc..f02d43a
--- a/config/config.sub
+++ b/config/config.sub
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2013 Free Software Foundation, Inc.
+#   Copyright 1992-2020 Free Software Foundation, Inc.
 
-timestamp='2013-10-01'
+timestamp='2020-01-01'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -25,7 +25,7 @@
 # of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -33,7 +33,7 @@
 # Otherwise, we print the canonical config type on stdout and succeed.
 
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
@@ -53,12 +53,11 @@
 me=`echo "$0" | sed -e 's,.*/,,'`
 
 usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
-       $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
 
 Canonicalize a configuration name.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -68,7 +67,7 @@
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2013 Free Software Foundation, Inc.
+Copyright 1992-2020 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -90,12 +89,12 @@
     - )	# Use stdin as input.
        break ;;
     -* )
-       echo "$me: invalid option $1$help"
+       echo "$me: invalid option $1$help" >&2
        exit 1 ;;
 
     *local*)
        # First pass through any local machine types.
-       echo $1
+       echo "$1"
        exit ;;
 
     * )
@@ -111,1211 +110,1164 @@
     exit 1;;
 esac
 
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
-  kopensolaris*-gnu* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-	-sun*os*)
-		# Prevent following clause from handling this invalid input.
+# Separate into logical components for further validation
+case $1 in
+	*-*-*-*-*)
+		echo Invalid configuration \`"$1"\': more than four components >&2
+		exit 1
 		;;
-	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-	-apple | -axis | -knuth | -cray | -microblaze*)
-		os=
-		basic_machine=$1
+	*-*-*-*)
+		basic_machine=$field1-$field2
+		os=$field3-$field4
 		;;
-	-bluegene*)
-		os=-cnk
+	*-*-*)
+		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+		# parts
+		maybe_os=$field2-$field3
+		case $maybe_os in
+			nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
+			| linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+			| storm-chaos* | os2-emx* | rtmk-nova*)
+				basic_machine=$field1
+				os=$maybe_os
+				;;
+			android-linux)
+				basic_machine=$field1-unknown
+				os=linux-android
+				;;
+			*)
+				basic_machine=$field1-$field2
+				os=$field3
+				;;
+		esac
 		;;
-	-sim | -cisco | -oki | -wec | -winbond)
-		os=
-		basic_machine=$1
+	*-*)
+		# A lone config we happen to match not fitting any pattern
+		case $field1-$field2 in
+			decstation-3100)
+				basic_machine=mips-dec
+				os=
+				;;
+			*-*)
+				# Second component is usually, but not always the OS
+				case $field2 in
+					# Prevent following clause from handling this valid os
+					sun*os*)
+						basic_machine=$field1
+						os=$field2
+						;;
+					# Manufacturers
+					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
+					| convergent* | ncr* | news | 32* | 3600* | 3100* \
+					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+					| ultra | tti* | harris | dolphin | highlevel | gould \
+					| cbm | ns | masscomp | apple | axis | knuth | cray \
+					| microblaze* | sim | cisco \
+					| oki | wec | wrs | winbond)
+						basic_machine=$field1-$field2
+						os=
+						;;
+					*)
+						basic_machine=$field1
+						os=$field2
+						;;
+				esac
+			;;
+		esac
 		;;
-	-scout)
-		;;
-	-wrs)
-		os=-vxworks
-		basic_machine=$1
-		;;
-	-chorusos*)
-		os=-chorusos
-		basic_machine=$1
-		;;
-	-chorusrdb)
-		os=-chorusrdb
-		basic_machine=$1
-		;;
-	-hiux*)
-		os=-hiuxwe2
-		;;
-	-sco6)
-		os=-sco5v6
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5)
-		os=-sco3.2v5
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco4)
-		os=-sco3.2v4
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2.[4-9]*)
-		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco3.2v[4-9]*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco5v6*)
-		# Don't forget version if it is 3.2v4 or newer.
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-sco*)
-		os=-sco3.2v2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-udk*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-isc)
-		os=-isc2.2
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-clix*)
-		basic_machine=clipper-intergraph
-		;;
-	-isc*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-		;;
-	-lynx*178)
-		os=-lynxos178
-		;;
-	-lynx*5)
-		os=-lynxos5
-		;;
-	-lynx*)
-		os=-lynxos
-		;;
-	-ptx*)
-		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
-		;;
-	-windowsnt*)
-		os=`echo $os | sed -e 's/windowsnt/winnt/'`
-		;;
-	-psos*)
-		os=-psos
-		;;
-	-mint | -mint[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
+	*)
+		# Convert single-component short-hands not valid as part of
+		# multi-component configurations.
+		case $field1 in
+			386bsd)
+				basic_machine=i386-pc
+				os=bsd
+				;;
+			a29khif)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			adobe68k)
+				basic_machine=m68010-adobe
+				os=scout
+				;;
+			alliant)
+				basic_machine=fx80-alliant
+				os=
+				;;
+			altos | altos3068)
+				basic_machine=m68k-altos
+				os=
+				;;
+			am29k)
+				basic_machine=a29k-none
+				os=bsd
+				;;
+			amdahl)
+				basic_machine=580-amdahl
+				os=sysv
+				;;
+			amiga)
+				basic_machine=m68k-unknown
+				os=
+				;;
+			amigaos | amigados)
+				basic_machine=m68k-unknown
+				os=amigaos
+				;;
+			amigaunix | amix)
+				basic_machine=m68k-unknown
+				os=sysv4
+				;;
+			apollo68)
+				basic_machine=m68k-apollo
+				os=sysv
+				;;
+			apollo68bsd)
+				basic_machine=m68k-apollo
+				os=bsd
+				;;
+			aros)
+				basic_machine=i386-pc
+				os=aros
+				;;
+			aux)
+				basic_machine=m68k-apple
+				os=aux
+				;;
+			balance)
+				basic_machine=ns32k-sequent
+				os=dynix
+				;;
+			blackfin)
+				basic_machine=bfin-unknown
+				os=linux
+				;;
+			cegcc)
+				basic_machine=arm-unknown
+				os=cegcc
+				;;
+			convex-c1)
+				basic_machine=c1-convex
+				os=bsd
+				;;
+			convex-c2)
+				basic_machine=c2-convex
+				os=bsd
+				;;
+			convex-c32)
+				basic_machine=c32-convex
+				os=bsd
+				;;
+			convex-c34)
+				basic_machine=c34-convex
+				os=bsd
+				;;
+			convex-c38)
+				basic_machine=c38-convex
+				os=bsd
+				;;
+			cray)
+				basic_machine=j90-cray
+				os=unicos
+				;;
+			crds | unos)
+				basic_machine=m68k-crds
+				os=
+				;;
+			da30)
+				basic_machine=m68k-da30
+				os=
+				;;
+			decstation | pmax | pmin | dec3100 | decstatn)
+				basic_machine=mips-dec
+				os=
+				;;
+			delta88)
+				basic_machine=m88k-motorola
+				os=sysv3
+				;;
+			dicos)
+				basic_machine=i686-pc
+				os=dicos
+				;;
+			djgpp)
+				basic_machine=i586-pc
+				os=msdosdjgpp
+				;;
+			ebmon29k)
+				basic_machine=a29k-amd
+				os=ebmon
+				;;
+			es1800 | OSE68k | ose68k | ose | OSE)
+				basic_machine=m68k-ericsson
+				os=ose
+				;;
+			gmicro)
+				basic_machine=tron-gmicro
+				os=sysv
+				;;
+			go32)
+				basic_machine=i386-pc
+				os=go32
+				;;
+			h8300hms)
+				basic_machine=h8300-hitachi
+				os=hms
+				;;
+			h8300xray)
+				basic_machine=h8300-hitachi
+				os=xray
+				;;
+			h8500hms)
+				basic_machine=h8500-hitachi
+				os=hms
+				;;
+			harris)
+				basic_machine=m88k-harris
+				os=sysv3
+				;;
+			hp300 | hp300hpux)
+				basic_machine=m68k-hp
+				os=hpux
+				;;
+			hp300bsd)
+				basic_machine=m68k-hp
+				os=bsd
+				;;
+			hppaosf)
+				basic_machine=hppa1.1-hp
+				os=osf
+				;;
+			hppro)
+				basic_machine=hppa1.1-hp
+				os=proelf
+				;;
+			i386mach)
+				basic_machine=i386-mach
+				os=mach
+				;;
+			isi68 | isi)
+				basic_machine=m68k-isi
+				os=sysv
+				;;
+			m68knommu)
+				basic_machine=m68k-unknown
+				os=linux
+				;;
+			magnum | m3230)
+				basic_machine=mips-mips
+				os=sysv
+				;;
+			merlin)
+				basic_machine=ns32k-utek
+				os=sysv
+				;;
+			mingw64)
+				basic_machine=x86_64-pc
+				os=mingw64
+				;;
+			mingw32)
+				basic_machine=i686-pc
+				os=mingw32
+				;;
+			mingw32ce)
+				basic_machine=arm-unknown
+				os=mingw32ce
+				;;
+			monitor)
+				basic_machine=m68k-rom68k
+				os=coff
+				;;
+			morphos)
+				basic_machine=powerpc-unknown
+				os=morphos
+				;;
+			moxiebox)
+				basic_machine=moxie-unknown
+				os=moxiebox
+				;;
+			msdos)
+				basic_machine=i386-pc
+				os=msdos
+				;;
+			msys)
+				basic_machine=i686-pc
+				os=msys
+				;;
+			mvs)
+				basic_machine=i370-ibm
+				os=mvs
+				;;
+			nacl)
+				basic_machine=le32-unknown
+				os=nacl
+				;;
+			ncr3000)
+				basic_machine=i486-ncr
+				os=sysv4
+				;;
+			netbsd386)
+				basic_machine=i386-pc
+				os=netbsd
+				;;
+			netwinder)
+				basic_machine=armv4l-rebel
+				os=linux
+				;;
+			news | news700 | news800 | news900)
+				basic_machine=m68k-sony
+				os=newsos
+				;;
+			news1000)
+				basic_machine=m68030-sony
+				os=newsos
+				;;
+			necv70)
+				basic_machine=v70-nec
+				os=sysv
+				;;
+			nh3000)
+				basic_machine=m68k-harris
+				os=cxux
+				;;
+			nh[45]000)
+				basic_machine=m88k-harris
+				os=cxux
+				;;
+			nindy960)
+				basic_machine=i960-intel
+				os=nindy
+				;;
+			mon960)
+				basic_machine=i960-intel
+				os=mon960
+				;;
+			nonstopux)
+				basic_machine=mips-compaq
+				os=nonstopux
+				;;
+			os400)
+				basic_machine=powerpc-ibm
+				os=os400
+				;;
+			OSE68000 | ose68000)
+				basic_machine=m68000-ericsson
+				os=ose
+				;;
+			os68k)
+				basic_machine=m68k-none
+				os=os68k
+				;;
+			paragon)
+				basic_machine=i860-intel
+				os=osf
+				;;
+			parisc)
+				basic_machine=hppa-unknown
+				os=linux
+				;;
+			pw32)
+				basic_machine=i586-unknown
+				os=pw32
+				;;
+			rdos | rdos64)
+				basic_machine=x86_64-pc
+				os=rdos
+				;;
+			rdos32)
+				basic_machine=i386-pc
+				os=rdos
+				;;
+			rom68k)
+				basic_machine=m68k-rom68k
+				os=coff
+				;;
+			sa29200)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			sei)
+				basic_machine=mips-sei
+				os=seiux
+				;;
+			sequent)
+				basic_machine=i386-sequent
+				os=
+				;;
+			sps7)
+				basic_machine=m68k-bull
+				os=sysv2
+				;;
+			st2000)
+				basic_machine=m68k-tandem
+				os=
+				;;
+			stratus)
+				basic_machine=i860-stratus
+				os=sysv4
+				;;
+			sun2)
+				basic_machine=m68000-sun
+				os=
+				;;
+			sun2os3)
+				basic_machine=m68000-sun
+				os=sunos3
+				;;
+			sun2os4)
+				basic_machine=m68000-sun
+				os=sunos4
+				;;
+			sun3)
+				basic_machine=m68k-sun
+				os=
+				;;
+			sun3os3)
+				basic_machine=m68k-sun
+				os=sunos3
+				;;
+			sun3os4)
+				basic_machine=m68k-sun
+				os=sunos4
+				;;
+			sun4)
+				basic_machine=sparc-sun
+				os=
+				;;
+			sun4os3)
+				basic_machine=sparc-sun
+				os=sunos3
+				;;
+			sun4os4)
+				basic_machine=sparc-sun
+				os=sunos4
+				;;
+			sun4sol2)
+				basic_machine=sparc-sun
+				os=solaris2
+				;;
+			sun386 | sun386i | roadrunner)
+				basic_machine=i386-sun
+				os=
+				;;
+			sv1)
+				basic_machine=sv1-cray
+				os=unicos
+				;;
+			symmetry)
+				basic_machine=i386-sequent
+				os=dynix
+				;;
+			t3e)
+				basic_machine=alphaev5-cray
+				os=unicos
+				;;
+			t90)
+				basic_machine=t90-cray
+				os=unicos
+				;;
+			toad1)
+				basic_machine=pdp10-xkl
+				os=tops20
+				;;
+			tpf)
+				basic_machine=s390x-ibm
+				os=tpf
+				;;
+			udi29k)
+				basic_machine=a29k-amd
+				os=udi
+				;;
+			ultra3)
+				basic_machine=a29k-nyu
+				os=sym1
+				;;
+			v810 | necv810)
+				basic_machine=v810-nec
+				os=none
+				;;
+			vaxv)
+				basic_machine=vax-dec
+				os=sysv
+				;;
+			vms)
+				basic_machine=vax-dec
+				os=vms
+				;;
+			vsta)
+				basic_machine=i386-pc
+				os=vsta
+				;;
+			vxworks960)
+				basic_machine=i960-wrs
+				os=vxworks
+				;;
+			vxworks68)
+				basic_machine=m68k-wrs
+				os=vxworks
+				;;
+			vxworks29k)
+				basic_machine=a29k-wrs
+				os=vxworks
+				;;
+			xbox)
+				basic_machine=i686-pc
+				os=mingw32
+				;;
+			ymp)
+				basic_machine=ymp-cray
+				os=unicos
+				;;
+			*)
+				basic_machine=$1
+				os=
+				;;
+		esac
 		;;
 esac
 
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
 case $basic_machine in
-	# Recognize the basic CPU types without company name.
-	# Some are omitted here because they have special meanings below.
-	1750a | 580 \
-	| a29k \
-	| aarch64 | aarch64_be \
-	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-	| am33_2.0 \
-	| arc | arceb \
-	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
-	| avr | avr32 \
-	| be32 | be64 \
-	| bfin \
-	| c4x | c8051 | clipper \
-	| d10v | d30v | dlx | dsp16xx \
-	| epiphany \
-	| fido | fr30 | frv \
-	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-	| hexagon \
-	| i370 | i860 | i960 | ia64 \
-	| ip2k | iq2000 \
-	| k1om \
-	| le32 | le64 \
-	| lm32 \
-	| m32c | m32r | m32rle | m68000 | m68k | m88k \
-	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
-	| mips | mipsbe | mipseb | mipsel | mipsle \
-	| mips16 \
-	| mips64 | mips64el \
-	| mips64octeon | mips64octeonel \
-	| mips64orion | mips64orionel \
-	| mips64r5900 | mips64r5900el \
-	| mips64vr | mips64vrel \
-	| mips64vr4100 | mips64vr4100el \
-	| mips64vr4300 | mips64vr4300el \
-	| mips64vr5000 | mips64vr5000el \
-	| mips64vr5900 | mips64vr5900el \
-	| mipsisa32 | mipsisa32el \
-	| mipsisa32r2 | mipsisa32r2el \
-	| mipsisa64 | mipsisa64el \
-	| mipsisa64r2 | mipsisa64r2el \
-	| mipsisa64sb1 | mipsisa64sb1el \
-	| mipsisa64sr71k | mipsisa64sr71kel \
-	| mipsr5900 | mipsr5900el \
-	| mipstx39 | mipstx39el \
-	| mn10200 | mn10300 \
-	| moxie \
-	| mt \
-	| msp430 \
-	| nds32 | nds32le | nds32be \
-	| nios | nios2 | nios2eb | nios2el \
-	| ns16k | ns32k \
-	| open8 \
-	| or1k | or32 \
-	| pdp10 | pdp11 | pj | pjl \
-	| powerpc | powerpc64 | powerpc64le | powerpcle \
-	| pyramid \
-	| rl78 | rx \
-	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-	| sh64 | sh64le \
-	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-	| spu \
-	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-	| ubicom32 \
-	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-	| we32k \
-	| x86 | xc16x | xstormy16 | xtensa \
-	| z8k | z80)
-		basic_machine=$basic_machine-unknown
+	# Here we handle the default manufacturer of certain CPU types.  It is in
+	# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		cpu=hppa1.1
+		vendor=winbond
 		;;
-	c54x)
-		basic_machine=tic54x-unknown
+	op50n)
+		cpu=hppa1.1
+		vendor=oki
 		;;
-	c55x)
-		basic_machine=tic55x-unknown
+	op60c)
+		cpu=hppa1.1
+		vendor=oki
 		;;
-	c6x)
-		basic_machine=tic6x-unknown
+	ibm*)
+		cpu=i370
+		vendor=ibm
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
-		basic_machine=$basic_machine-unknown
-		os=-none
+	orion105)
+		cpu=clipper
+		vendor=highlevel
 		;;
-	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+	mac | mpw | mac-mpw)
+		cpu=m68k
+		vendor=apple
 		;;
-	ms1)
-		basic_machine=mt-unknown
+	pmac | pmac-mpw)
+		cpu=powerpc
+		vendor=apple
 		;;
 
-	strongarm | thumb | xscale)
-		basic_machine=arm-unknown
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		cpu=m68000
+		vendor=att
 		;;
-	xgate)
-		basic_machine=$basic_machine-unknown
-		os=-none
+	3b*)
+		cpu=we32k
+		vendor=att
 		;;
-	xscaleeb)
-		basic_machine=armeb-unknown
+	bluegene*)
+		cpu=powerpc
+		vendor=ibm
+		os=cnk
+		;;
+	decsystem10* | dec10*)
+		cpu=pdp10
+		vendor=dec
+		os=tops10
+		;;
+	decsystem20* | dec20*)
+		cpu=pdp10
+		vendor=dec
+		os=tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		cpu=m68k
+		vendor=motorola
+		;;
+	dpx2*)
+		cpu=m68k
+		vendor=bull
+		os=sysv3
+		;;
+	encore | umax | mmax)
+		cpu=ns32k
+		vendor=encore
+		;;
+	elxsi)
+		cpu=elxsi
+		vendor=elxsi
+		os=${os:-bsd}
+		;;
+	fx2800)
+		cpu=i860
+		vendor=alliant
+		;;
+	genix)
+		cpu=ns32k
+		vendor=ns
+		;;
+	h3050r* | hiux*)
+		cpu=hppa1.1
+		vendor=hitachi
+		os=hiuxwe2
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		cpu=hppa1.0
+		vendor=hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		cpu=m68000
+		vendor=hp
+		;;
+	hp9k3[2-9][0-9])
+		cpu=m68k
+		vendor=hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		cpu=hppa1.0
+		vendor=hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		cpu=hppa1.1
+		vendor=hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		cpu=hppa1.1
+		vendor=hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		cpu=hppa1.1
+		vendor=hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		cpu=hppa1.1
+		vendor=hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		cpu=hppa1.0
+		vendor=hp
+		;;
+	i*86v32)
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=sysv32
+		;;
+	i*86v4*)
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=sysv4
+		;;
+	i*86v)
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=sysv
+		;;
+	i*86sol2)
+		cpu=`echo "$1" | sed -e 's/86.*/86/'`
+		vendor=pc
+		os=solaris2
+		;;
+	j90 | j90-cray)
+		cpu=j90
+		vendor=cray
+		os=${os:-unicos}
+		;;
+	iris | iris4d)
+		cpu=mips
+		vendor=sgi
+		case $os in
+		    irix*)
+			;;
+		    *)
+			os=irix4
+			;;
+		esac
+		;;
+	miniframe)
+		cpu=m68000
+		vendor=convergent
+		;;
+	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		cpu=m68k
+		vendor=atari
+		os=mint
+		;;
+	news-3600 | risc-news)
+		cpu=mips
+		vendor=sony
+		os=newsos
+		;;
+	next | m*-next)
+		cpu=m68k
+		vendor=next
+		case $os in
+		    openstep*)
+		        ;;
+		    nextstep*)
+			;;
+		    ns2*)
+		      os=nextstep2
+			;;
+		    *)
+		      os=nextstep3
+			;;
+		esac
+		;;
+	np1)
+		cpu=np1
+		vendor=gould
+		;;
+	op50n-* | op60c-*)
+		cpu=hppa1.1
+		vendor=oki
+		os=proelf
+		;;
+	pa-hitachi)
+		cpu=hppa1.1
+		vendor=hitachi
+		os=hiuxwe2
+		;;
+	pbd)
+		cpu=sparc
+		vendor=tti
+		;;
+	pbb)
+		cpu=m68k
+		vendor=tti
+		;;
+	pc532)
+		cpu=ns32k
+		vendor=pc532
+		;;
+	pn)
+		cpu=pn
+		vendor=gould
+		;;
+	power)
+		cpu=power
+		vendor=ibm
+		;;
+	ps2)
+		cpu=i386
+		vendor=ibm
+		;;
+	rm[46]00)
+		cpu=mips
+		vendor=siemens
+		;;
+	rtpc | rtpc-*)
+		cpu=romp
+		vendor=ibm
+		;;
+	sde)
+		cpu=mipsisa32
+		vendor=sde
+		os=${os:-elf}
+		;;
+	simso-wrs)
+		cpu=sparclite
+		vendor=wrs
+		os=vxworks
+		;;
+	tower | tower-32)
+		cpu=m68k
+		vendor=ncr
+		;;
+	vpp*|vx|vx-*)
+		cpu=f301
+		vendor=fujitsu
+		;;
+	w65)
+		cpu=w65
+		vendor=wdc
+		;;
+	w89k-*)
+		cpu=hppa1.1
+		vendor=winbond
+		os=proelf
+		;;
+	none)
+		cpu=none
+		vendor=none
+		;;
+	leon|leon[3-9])
+		cpu=sparc
+		vendor=$basic_machine
+		;;
+	leon-*|leon[3-9]-*)
+		cpu=sparc
+		vendor=`echo "$basic_machine" | sed 's/-.*//'`
 		;;
 
-	xscaleel)
-		basic_machine=armel-unknown
+	*-*)
+		# shellcheck disable=SC2162
+		IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
 		;;
-
 	# We use `pc' rather than `unknown'
 	# because (1) that's what they normally are, and
 	# (2) the word "unknown" tends to confuse beginning users.
 	i*86 | x86_64)
-	  basic_machine=$basic_machine-pc
-	  ;;
-	# Object if more than one company name word.
-	*-*-*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
+		cpu=$basic_machine
+		vendor=pc
 		;;
-	# Recognize the basic CPU types with company name.
-	580-* \
-	| a29k-* \
-	| aarch64-* | aarch64_be-* \
-	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
-	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-	| avr-* | avr32-* \
-	| be32-* | be64-* \
-	| bfin-* | bs2000-* \
-	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| c8051-* | clipper-* | craynv-* | cydra-* \
-	| d10v-* | d30v-* | dlx-* \
-	| elxsi-* \
-	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-	| h8300-* | h8500-* \
-	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-	| hexagon-* \
-	| i*86-* | i860-* | i960-* | ia64-* \
-	| ip2k-* | iq2000-* \
-	| k1om-* \
-	| le32-* | le64-* \
-	| lm32-* \
-	| m32c-* | m32r-* | m32rle-* \
-	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
-	| microblaze-* | microblazeel-* \
-	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-	| mips16-* \
-	| mips64-* | mips64el-* \
-	| mips64octeon-* | mips64octeonel-* \
-	| mips64orion-* | mips64orionel-* \
-	| mips64r5900-* | mips64r5900el-* \
-	| mips64vr-* | mips64vrel-* \
-	| mips64vr4100-* | mips64vr4100el-* \
-	| mips64vr4300-* | mips64vr4300el-* \
-	| mips64vr5000-* | mips64vr5000el-* \
-	| mips64vr5900-* | mips64vr5900el-* \
-	| mipsisa32-* | mipsisa32el-* \
-	| mipsisa32r2-* | mipsisa32r2el-* \
-	| mipsisa64-* | mipsisa64el-* \
-	| mipsisa64r2-* | mipsisa64r2el-* \
-	| mipsisa64sb1-* | mipsisa64sb1el-* \
-	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
-	| mipsr5900-* | mipsr5900el-* \
-	| mipstx39-* | mipstx39el-* \
-	| mmix-* \
-	| mt-* \
-	| msp430-* \
-	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* | nios2eb-* | nios2el-* \
-	| none-* | np1-* | ns16k-* | ns32k-* \
-	| open8-* \
-	| orion-* \
-	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-	| pyramid-* \
-	| rl78-* | romp-* | rs6000-* | rx-* \
-	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
-	| tahoe-* \
-	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-	| tile*-* \
-	| tron-* \
-	| ubicom32-* \
-	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-	| vax-* \
-	| we32k-* \
-	| x86-* | x86_64-* | xc16x-* | xps100-* \
-	| xstormy16-* | xtensa*-* \
-	| ymp-* \
-	| z8k-* | z80-*)
-		;;
-	# Recognize the basic CPU types without company name, with glob match.
-	xtensa*)
-		basic_machine=$basic_machine-unknown
-		;;
-	# Recognize the various machine names and aliases which stand
-	# for a CPU type and a company and sometimes even an OS.
-	386bsd)
-		basic_machine=i386-unknown
-		os=-bsd
-		;;
-	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-		basic_machine=m68000-att
-		;;
-	3b*)
-		basic_machine=we32k-att
-		;;
-	a29khif)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	abacus)
-		basic_machine=abacus-unknown
-		;;
-	adobe68k)
-		basic_machine=m68010-adobe
-		os=-scout
-		;;
-	alliant | fx80)
-		basic_machine=fx80-alliant
-		;;
-	altos | altos3068)
-		basic_machine=m68k-altos
-		;;
-	am29k)
-		basic_machine=a29k-none
-		os=-bsd
-		;;
-	amd64)
-		basic_machine=x86_64-pc
-		;;
-	amd64-*)
-		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	amdahl)
-		basic_machine=580-amdahl
-		os=-sysv
-		;;
-	amiga | amiga-*)
-		basic_machine=m68k-unknown
-		;;
-	amigaos | amigados)
-		basic_machine=m68k-unknown
-		os=-amigaos
-		;;
-	amigaunix | amix)
-		basic_machine=m68k-unknown
-		os=-sysv4
-		;;
-	apollo68)
-		basic_machine=m68k-apollo
-		os=-sysv
-		;;
-	apollo68bsd)
-		basic_machine=m68k-apollo
-		os=-bsd
-		;;
-	aros)
-		basic_machine=i386-pc
-		os=-aros
-		;;
-	aux)
-		basic_machine=m68k-apple
-		os=-aux
-		;;
-	balance)
-		basic_machine=ns32k-sequent
-		os=-dynix
-		;;
-	blackfin)
-		basic_machine=bfin-unknown
-		os=-linux
-		;;
-	blackfin-*)
-		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	bluegene*)
-		basic_machine=powerpc-ibm
-		os=-cnk
-		;;
-	c54x-*)
-		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c55x-*)
-		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c6x-*)
-		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	c90)
-		basic_machine=c90-cray
-		os=-unicos
-		;;
-	cegcc)
-		basic_machine=arm-unknown
-		os=-cegcc
-		;;
-	convex-c1)
-		basic_machine=c1-convex
-		os=-bsd
-		;;
-	convex-c2)
-		basic_machine=c2-convex
-		os=-bsd
-		;;
-	convex-c32)
-		basic_machine=c32-convex
-		os=-bsd
-		;;
-	convex-c34)
-		basic_machine=c34-convex
-		os=-bsd
-		;;
-	convex-c38)
-		basic_machine=c38-convex
-		os=-bsd
-		;;
-	cray | j90)
-		basic_machine=j90-cray
-		os=-unicos
-		;;
-	craynv)
-		basic_machine=craynv-cray
-		os=-unicosmp
-		;;
-	cr16 | cr16-*)
-		basic_machine=cr16-unknown
-		os=-elf
-		;;
-	crds | unos)
-		basic_machine=m68k-crds
-		;;
-	crisv32 | crisv32-* | etraxfs*)
-		basic_machine=crisv32-axis
-		;;
-	cris | cris-* | etrax*)
-		basic_machine=cris-axis
-		;;
-	crx)
-		basic_machine=crx-unknown
-		os=-elf
-		;;
-	da30 | da30-*)
-		basic_machine=m68k-da30
-		;;
-	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-		basic_machine=mips-dec
-		;;
-	decsystem10* | dec10*)
-		basic_machine=pdp10-dec
-		os=-tops10
-		;;
-	decsystem20* | dec20*)
-		basic_machine=pdp10-dec
-		os=-tops20
-		;;
-	delta | 3300 | motorola-3300 | motorola-delta \
-	      | 3300-motorola | delta-motorola)
-		basic_machine=m68k-motorola
-		;;
-	delta88)
-		basic_machine=m88k-motorola
-		os=-sysv3
-		;;
-	dicos)
-		basic_machine=i686-pc
-		os=-dicos
-		;;
-	djgpp)
-		basic_machine=i586-pc
-		os=-msdosdjgpp
-		;;
-	dpx20 | dpx20-*)
-		basic_machine=rs6000-bull
-		os=-bosx
-		;;
-	dpx2* | dpx2*-bull)
-		basic_machine=m68k-bull
-		os=-sysv3
-		;;
-	ebmon29k)
-		basic_machine=a29k-amd
-		os=-ebmon
-		;;
-	elxsi)
-		basic_machine=elxsi-elxsi
-		os=-bsd
-		;;
-	encore | umax | mmax)
-		basic_machine=ns32k-encore
-		;;
-	es1800 | OSE68k | ose68k | ose | OSE)
-		basic_machine=m68k-ericsson
-		os=-ose
-		;;
-	fx2800)
-		basic_machine=i860-alliant
-		;;
-	genix)
-		basic_machine=ns32k-ns
-		;;
-	gmicro)
-		basic_machine=tron-gmicro
-		os=-sysv
-		;;
-	go32)
-		basic_machine=i386-pc
-		os=-go32
-		;;
-	h3050r* | hiux*)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	h8300hms)
-		basic_machine=h8300-hitachi
-		os=-hms
-		;;
-	h8300xray)
-		basic_machine=h8300-hitachi
-		os=-xray
-		;;
-	h8500hms)
-		basic_machine=h8500-hitachi
-		os=-hms
-		;;
-	harris)
-		basic_machine=m88k-harris
-		os=-sysv3
-		;;
-	hp300-*)
-		basic_machine=m68k-hp
-		;;
-	hp300bsd)
-		basic_machine=m68k-hp
-		os=-bsd
-		;;
-	hp300hpux)
-		basic_machine=m68k-hp
-		os=-hpux
-		;;
-	hp3k9[0-9][0-9] | hp9[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k2[0-9][0-9] | hp9k31[0-9])
-		basic_machine=m68000-hp
-		;;
-	hp9k3[2-9][0-9])
-		basic_machine=m68k-hp
-		;;
-	hp9k6[0-9][0-9] | hp6[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hp9k7[0-79][0-9] | hp7[0-79][0-9])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k78[0-9] | hp78[0-9])
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
-		# FIXME: really hppa2.0-hp
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][13679] | hp8[0-9][13679])
-		basic_machine=hppa1.1-hp
-		;;
-	hp9k8[0-9][0-9] | hp8[0-9][0-9])
-		basic_machine=hppa1.0-hp
-		;;
-	hppa-next)
-		os=-nextstep3
-		;;
-	hppaosf)
-		basic_machine=hppa1.1-hp
-		os=-osf
-		;;
-	hppro)
-		basic_machine=hppa1.1-hp
-		os=-proelf
-		;;
-	i370-ibm* | ibm*)
-		basic_machine=i370-ibm
-		;;
-	i*86v32)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv32
-		;;
-	i*86v4*)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv4
-		;;
-	i*86v)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-sysv
-		;;
-	i*86sol2)
-		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-		os=-solaris2
-		;;
-	i386mach)
-		basic_machine=i386-mach
-		os=-mach
-		;;
-	i386-vsta | vsta)
-		basic_machine=i386-unknown
-		os=-vsta
-		;;
-	iris | iris4d)
-		basic_machine=mips-sgi
-		case $os in
-		    -irix*)
-			;;
-		    *)
-			os=-irix4
-			;;
-		esac
-		;;
-	isi68 | isi)
-		basic_machine=m68k-isi
-		os=-sysv
-		;;
-	m68knommu)
-		basic_machine=m68k-unknown
-		os=-linux
-		;;
-	m68knommu-*)
-		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	m88k-omron*)
-		basic_machine=m88k-omron
-		;;
-	magnum | m3230)
-		basic_machine=mips-mips
-		os=-sysv
-		;;
-	merlin)
-		basic_machine=ns32k-utek
-		os=-sysv
-		;;
-	microblaze*)
-		basic_machine=microblaze-xilinx
-		;;
-	mingw64)
-		basic_machine=x86_64-pc
-		os=-mingw64
-		;;
-	mingw32)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	mingw32ce)
-		basic_machine=arm-unknown
-		os=-mingw32ce
-		;;
-	miniframe)
-		basic_machine=m68000-convergent
-		;;
-	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-		basic_machine=m68k-atari
-		os=-mint
-		;;
-	mips3*-*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-		;;
-	mips3*)
-		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-		;;
-	monitor)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	morphos)
-		basic_machine=powerpc-unknown
-		os=-morphos
-		;;
-	msdos)
-		basic_machine=i386-pc
-		os=-msdos
-		;;
-	ms1-*)
-		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-		;;
-	msys)
-		basic_machine=i686-pc
-		os=-msys
-		;;
-	mvs)
-		basic_machine=i370-ibm
-		os=-mvs
-		;;
-	nacl)
-		basic_machine=le32-unknown
-		os=-nacl
-		;;
-	ncr3000)
-		basic_machine=i486-ncr
-		os=-sysv4
-		;;
-	netbsd386)
-		basic_machine=i386-unknown
-		os=-netbsd
-		;;
-	netwinder)
-		basic_machine=armv4l-rebel
-		os=-linux
-		;;
-	news | news700 | news800 | news900)
-		basic_machine=m68k-sony
-		os=-newsos
-		;;
-	news1000)
-		basic_machine=m68030-sony
-		os=-newsos
-		;;
-	news-3600 | risc-news)
-		basic_machine=mips-sony
-		os=-newsos
-		;;
-	necv70)
-		basic_machine=v70-nec
-		os=-sysv
-		;;
-	next | m*-next )
-		basic_machine=m68k-next
-		case $os in
-		    -nextstep* )
-			;;
-		    -ns2*)
-		      os=-nextstep2
-			;;
-		    *)
-		      os=-nextstep3
-			;;
-		esac
-		;;
-	nh3000)
-		basic_machine=m68k-harris
-		os=-cxux
-		;;
-	nh[45]000)
-		basic_machine=m88k-harris
-		os=-cxux
-		;;
-	nindy960)
-		basic_machine=i960-intel
-		os=-nindy
-		;;
-	mon960)
-		basic_machine=i960-intel
-		os=-mon960
-		;;
-	nonstopux)
-		basic_machine=mips-compaq
-		os=-nonstopux
-		;;
-	np1)
-		basic_machine=np1-gould
-		;;
-	neo-tandem)
-		basic_machine=neo-tandem
-		;;
-	nse-tandem)
-		basic_machine=nse-tandem
-		;;
-	nsr-tandem)
-		basic_machine=nsr-tandem
-		;;
-	op50n-* | op60c-*)
-		basic_machine=hppa1.1-oki
-		os=-proelf
-		;;
-	openrisc | openrisc-*)
-		basic_machine=or32-unknown
-		;;
-	os400)
-		basic_machine=powerpc-ibm
-		os=-os400
-		;;
-	OSE68000 | ose68000)
-		basic_machine=m68000-ericsson
-		os=-ose
-		;;
-	os68k)
-		basic_machine=m68k-none
-		os=-os68k
-		;;
-	pa-hitachi)
-		basic_machine=hppa1.1-hitachi
-		os=-hiuxwe2
-		;;
-	paragon)
-		basic_machine=i860-intel
-		os=-osf
-		;;
-	parisc)
-		basic_machine=hppa-unknown
-		os=-linux
-		;;
-	parisc-*)
-		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-		os=-linux
-		;;
-	pbd)
-		basic_machine=sparc-tti
-		;;
-	pbb)
-		basic_machine=m68k-tti
-		;;
-	pc532 | pc532-*)
-		basic_machine=ns32k-pc532
-		;;
+	# These rules are duplicated from below for sake of the special case above;
+	# i.e. things that normalized to x86 arches should also default to "pc"
 	pc98)
-		basic_machine=i386-pc
+		cpu=i386
+		vendor=pc
 		;;
-	pc98-*)
-		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+	x64 | amd64)
+		cpu=x86_64
+		vendor=pc
 		;;
-	pentium | p5 | k5 | k6 | nexgen | viac3)
-		basic_machine=i586-pc
+	# Recognize the basic CPU types without company name.
+	*)
+		cpu=$basic_machine
+		vendor=unknown
 		;;
-	pentiumpro | p6 | 6x86 | athlon | athlon_*)
-		basic_machine=i686-pc
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+	# Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+	# some cases the only manufacturer, in others, it is the most popular.
+	craynv-unknown)
+		vendor=cray
+		os=${os:-unicosmp}
 		;;
-	pentiumii | pentium2 | pentiumiii | pentium3)
-		basic_machine=i686-pc
+	c90-unknown | c90-cray)
+		vendor=cray
+		os=${os:-unicos}
 		;;
-	pentium4)
-		basic_machine=i786-pc
+	fx80-unknown)
+		vendor=alliant
 		;;
-	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+	romp-unknown)
+		vendor=ibm
 		;;
-	pentiumpro-* | p6-* | 6x86-* | athlon-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+	mmix-unknown)
+		vendor=knuth
 		;;
-	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+	microblaze-unknown | microblazeel-unknown)
+		vendor=xilinx
 		;;
-	pentium4-*)
-		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+	rs6000-unknown)
+		vendor=ibm
 		;;
-	pn)
-		basic_machine=pn-gould
+	vax-unknown)
+		vendor=dec
 		;;
-	power)	basic_machine=power-ibm
+	pdp11-unknown)
+		vendor=dec
 		;;
-	ppc | ppcbe)	basic_machine=powerpc-unknown
+	we32k-unknown)
+		vendor=att
 		;;
-	ppc-* | ppcbe-*)
-		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+	cydra-unknown)
+		vendor=cydrome
 		;;
-	ppcle | powerpclittle | ppc-le | powerpc-little)
-		basic_machine=powerpcle-unknown
+	i370-ibm*)
+		vendor=ibm
 		;;
-	ppcle-* | powerpclittle-*)
-		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+	orion-unknown)
+		vendor=highlevel
 		;;
-	ppc64)	basic_machine=powerpc64-unknown
-		;;
-	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
-		basic_machine=powerpc64le-unknown
-		;;
-	ppc64le-* | powerpc64little-*)
-		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	ps2)
-		basic_machine=i386-ibm
-		;;
-	pw32)
-		basic_machine=i586-unknown
-		os=-pw32
-		;;
-	rdos | rdos64)
-		basic_machine=x86_64-pc
-		os=-rdos
-		;;
-	rdos32)
-		basic_machine=i386-pc
-		os=-rdos
-		;;
-	rom68k)
-		basic_machine=m68k-rom68k
-		os=-coff
-		;;
-	rm[46]00)
-		basic_machine=mips-siemens
-		;;
-	rtpc | rtpc-*)
-		basic_machine=romp-ibm
-		;;
-	s390 | s390-*)
-		basic_machine=s390-ibm
-		;;
-	s390x | s390x-*)
-		basic_machine=s390x-ibm
-		;;
-	sa29200)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	sb1)
-		basic_machine=mipsisa64sb1-unknown
-		;;
-	sb1el)
-		basic_machine=mipsisa64sb1el-unknown
-		;;
-	sde)
-		basic_machine=mipsisa32-sde
-		os=-elf
-		;;
-	sei)
-		basic_machine=mips-sei
-		os=-seiux
-		;;
-	sequent)
-		basic_machine=i386-sequent
-		;;
-	sh)
-		basic_machine=sh-hitachi
-		os=-hms
-		;;
-	sh5el)
-		basic_machine=sh5le-unknown
-		;;
-	sh64)
-		basic_machine=sh64-unknown
-		;;
-	sparclite-wrs | simso-wrs)
-		basic_machine=sparclite-wrs
-		os=-vxworks
-		;;
-	sps7)
-		basic_machine=m68k-bull
-		os=-sysv2
-		;;
-	spur)
-		basic_machine=spur-unknown
-		;;
-	st2000)
-		basic_machine=m68k-tandem
-		;;
-	stratus)
-		basic_machine=i860-stratus
-		os=-sysv4
-		;;
-	strongarm-* | thumb-*)
-		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
-		;;
-	sun2)
-		basic_machine=m68000-sun
-		;;
-	sun2os3)
-		basic_machine=m68000-sun
-		os=-sunos3
-		;;
-	sun2os4)
-		basic_machine=m68000-sun
-		os=-sunos4
-		;;
-	sun3os3)
-		basic_machine=m68k-sun
-		os=-sunos3
-		;;
-	sun3os4)
-		basic_machine=m68k-sun
-		os=-sunos4
-		;;
-	sun4os3)
-		basic_machine=sparc-sun
-		os=-sunos3
-		;;
-	sun4os4)
-		basic_machine=sparc-sun
-		os=-sunos4
-		;;
-	sun4sol2)
-		basic_machine=sparc-sun
-		os=-solaris2
-		;;
-	sun3 | sun3-*)
-		basic_machine=m68k-sun
-		;;
-	sun4)
-		basic_machine=sparc-sun
-		;;
-	sun386 | sun386i | roadrunner)
-		basic_machine=i386-sun
-		;;
-	sv1)
-		basic_machine=sv1-cray
-		os=-unicos
-		;;
-	symmetry)
-		basic_machine=i386-sequent
-		os=-dynix
-		;;
-	t3e)
-		basic_machine=alphaev5-cray
-		os=-unicos
-		;;
-	t90)
-		basic_machine=t90-cray
-		os=-unicos
-		;;
-	tile*)
-		basic_machine=$basic_machine-unknown
-		os=-linux-gnu
-		;;
-	tx39)
-		basic_machine=mipstx39-unknown
-		;;
-	tx39el)
-		basic_machine=mipstx39el-unknown
-		;;
-	toad1)
-		basic_machine=pdp10-xkl
-		os=-tops20
-		;;
-	tower | tower-32)
-		basic_machine=m68k-ncr
-		;;
-	tpf)
-		basic_machine=s390x-ibm
-		os=-tpf
-		;;
-	udi29k)
-		basic_machine=a29k-amd
-		os=-udi
-		;;
-	ultra3)
-		basic_machine=a29k-nyu
-		os=-sym1
-		;;
-	v810 | necv810)
-		basic_machine=v810-nec
-		os=-none
-		;;
-	vaxv)
-		basic_machine=vax-dec
-		os=-sysv
-		;;
-	vms)
-		basic_machine=vax-dec
-		os=-vms
-		;;
-	vpp*|vx|vx-*)
-		basic_machine=f301-fujitsu
-		;;
-	vxworks960)
-		basic_machine=i960-wrs
-		os=-vxworks
-		;;
-	vxworks68)
-		basic_machine=m68k-wrs
-		os=-vxworks
-		;;
-	vxworks29k)
-		basic_machine=a29k-wrs
-		os=-vxworks
-		;;
-	w65*)
-		basic_machine=w65-wdc
-		os=-none
-		;;
-	w89k-*)
-		basic_machine=hppa1.1-winbond
-		os=-proelf
-		;;
-	xbox)
-		basic_machine=i686-pc
-		os=-mingw32
-		;;
-	xps | xps100)
-		basic_machine=xps100-honeywell
-		;;
-	xscale-* | xscalee[bl]-*)
-		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
-		;;
-	ymp)
-		basic_machine=ymp-cray
-		os=-unicos
-		;;
-	z8k-*-coff)
-		basic_machine=z8k-unknown
-		os=-sim
-		;;
-	z80-*-coff)
-		basic_machine=z80-unknown
-		os=-sim
-		;;
-	none)
-		basic_machine=none-none
-		os=-none
+	xps-unknown | xps100-unknown)
+		cpu=xps100
+		vendor=honeywell
 		;;
 
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-	w89k)
-		basic_machine=hppa1.1-winbond
+	# Here we normalize CPU types with a missing or matching vendor
+	dpx20-unknown | dpx20-bull)
+		cpu=rs6000
+		vendor=bull
+		os=${os:-bosx}
 		;;
-	op50n)
-		basic_machine=hppa1.1-oki
+
+	# Here we normalize CPU types irrespective of the vendor
+	amd64-*)
+		cpu=x86_64
 		;;
-	op60c)
-		basic_machine=hppa1.1-oki
+	blackfin-*)
+		cpu=bfin
+		os=linux
 		;;
-	romp)
-		basic_machine=romp-ibm
+	c54x-*)
+		cpu=tic54x
 		;;
-	mmix)
-		basic_machine=mmix-knuth
+	c55x-*)
+		cpu=tic55x
 		;;
-	rs6000)
-		basic_machine=rs6000-ibm
+	c6x-*)
+		cpu=tic6x
 		;;
-	vax)
-		basic_machine=vax-dec
+	e500v[12]-*)
+		cpu=powerpc
+		os=$os"spe"
 		;;
-	pdp10)
-		# there are many clones, so DEC is not a safe bet
-		basic_machine=pdp10-unknown
+	mips3*-*)
+		cpu=mips64
 		;;
-	pdp11)
-		basic_machine=pdp11-dec
+	ms1-*)
+		cpu=mt
 		;;
-	we32k)
-		basic_machine=we32k-att
+	m68knommu-*)
+		cpu=m68k
+		os=linux
 		;;
-	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-		basic_machine=sh-unknown
+	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+		cpu=s12z
 		;;
-	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-		basic_machine=sparc-sun
+	openrisc-*)
+		cpu=or32
 		;;
-	cydra)
-		basic_machine=cydra-cydrome
+	parisc-*)
+		cpu=hppa
+		os=linux
 		;;
-	orion)
-		basic_machine=orion-highlevel
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		cpu=i586
 		;;
-	orion105)
-		basic_machine=clipper-highlevel
+	pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+		cpu=i686
 		;;
-	mac | mpw | mac-mpw)
-		basic_machine=m68k-apple
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		cpu=i686
 		;;
-	pmac | pmac-mpw)
-		basic_machine=powerpc-apple
+	pentium4-*)
+		cpu=i786
 		;;
-	*-unknown)
-		# Make sure to match an already-canonicalized machine name.
+	pc98-*)
+		cpu=i386
 		;;
+	ppc-* | ppcbe-*)
+		cpu=powerpc
+		;;
+	ppcle-* | powerpclittle-*)
+		cpu=powerpcle
+		;;
+	ppc64-*)
+		cpu=powerpc64
+		;;
+	ppc64le-* | powerpc64little-*)
+		cpu=powerpc64le
+		;;
+	sb1-*)
+		cpu=mipsisa64sb1
+		;;
+	sb1el-*)
+		cpu=mipsisa64sb1el
+		;;
+	sh5e[lb]-*)
+		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
+		;;
+	spur-*)
+		cpu=spur
+		;;
+	strongarm-* | thumb-*)
+		cpu=arm
+		;;
+	tx39-*)
+		cpu=mipstx39
+		;;
+	tx39el-*)
+		cpu=mipstx39el
+		;;
+	x64-*)
+		cpu=x86_64
+		;;
+	xscale-* | xscalee[bl]-*)
+		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
+		;;
+
+	# Recognize the canonical CPU Types that limit and/or modify the
+	# company names they are paired with.
+	cr16-*)
+		os=${os:-elf}
+		;;
+	crisv32-* | etraxfs*-*)
+		cpu=crisv32
+		vendor=axis
+		;;
+	cris-* | etrax*-*)
+		cpu=cris
+		vendor=axis
+		;;
+	crx-*)
+		os=${os:-elf}
+		;;
+	neo-tandem)
+		cpu=neo
+		vendor=tandem
+		;;
+	nse-tandem)
+		cpu=nse
+		vendor=tandem
+		;;
+	nsr-tandem)
+		cpu=nsr
+		vendor=tandem
+		;;
+	nsv-tandem)
+		cpu=nsv
+		vendor=tandem
+		;;
+	nsx-tandem)
+		cpu=nsx
+		vendor=tandem
+		;;
+	s390-*)
+		cpu=s390
+		vendor=ibm
+		;;
+	s390x-*)
+		cpu=s390x
+		vendor=ibm
+		;;
+	tile*-*)
+		os=${os:-linux-gnu}
+		;;
+
 	*)
-		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-		exit 1
+		# Recognize the canonical CPU types that are allowed with any
+		# company name.
+		case $cpu in
+			1750a | 580 \
+			| a29k \
+			| aarch64 | aarch64_be \
+			| abacus \
+			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+			| alphapca5[67] | alpha64pca5[67] \
+			| am33_2.0 \
+			| amdgcn \
+			| arc | arceb \
+			| arm  | arm[lb]e | arme[lb] | armv* \
+			| avr | avr32 \
+			| asmjs \
+			| ba \
+			| be32 | be64 \
+			| bfin | bpf | bs2000 \
+			| c[123]* | c30 | [cjt]90 | c4x \
+			| c8051 | clipper | craynv | csky | cydra \
+			| d10v | d30v | dlx | dsp16xx \
+			| e2k | elxsi | epiphany \
+			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+			| h8300 | h8500 \
+			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+			| hexagon \
+			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
+			| ip2k | iq2000 \
+			| k1om \
+			| le32 | le64 \
+			| lm32 \
+			| m32c | m32r | m32rle \
+			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+			| m88110 | m88k | maxq | mb | mcore | mep | metag \
+			| microblaze | microblazeel \
+			| mips | mipsbe | mipseb | mipsel | mipsle \
+			| mips16 \
+			| mips64 | mips64eb | mips64el \
+			| mips64octeon | mips64octeonel \
+			| mips64orion | mips64orionel \
+			| mips64r5900 | mips64r5900el \
+			| mips64vr | mips64vrel \
+			| mips64vr4100 | mips64vr4100el \
+			| mips64vr4300 | mips64vr4300el \
+			| mips64vr5000 | mips64vr5000el \
+			| mips64vr5900 | mips64vr5900el \
+			| mipsisa32 | mipsisa32el \
+			| mipsisa32r2 | mipsisa32r2el \
+			| mipsisa32r6 | mipsisa32r6el \
+			| mipsisa64 | mipsisa64el \
+			| mipsisa64r2 | mipsisa64r2el \
+			| mipsisa64r6 | mipsisa64r6el \
+			| mipsisa64sb1 | mipsisa64sb1el \
+			| mipsisa64sr71k | mipsisa64sr71kel \
+			| mipsr5900 | mipsr5900el \
+			| mipstx39 | mipstx39el \
+			| mmix \
+			| mn10200 | mn10300 \
+			| moxie \
+			| mt \
+			| msp430 \
+			| nds32 | nds32le | nds32be \
+			| nfp \
+			| nios | nios2 | nios2eb | nios2el \
+			| none | np1 | ns16k | ns32k | nvptx \
+			| open8 \
+			| or1k* \
+			| or32 \
+			| orion \
+			| picochip \
+			| pdp10 | pdp11 | pj | pjl | pn | power \
+			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+			| pru \
+			| pyramid \
+			| riscv | riscv32 | riscv64 \
+			| rl78 | romp | rs6000 | rx \
+			| score \
+			| sh | shl \
+			| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+			| sparclite \
+			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+			| spu \
+			| tahoe \
+			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+			| tron \
+			| ubicom32 \
+			| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+			| vax \
+			| visium \
+			| w65 \
+			| wasm32 | wasm64 \
+			| we32k \
+			| x86 | x86_64 | xc16x | xgate | xps100 \
+			| xstormy16 | xtensa* \
+			| ymp \
+			| z8k | z80)
+				;;
+
+			*)
+				echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+				exit 1
+				;;
+		esac
 		;;
 esac
 
 # Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-	*-digital*)
-		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+	digital*)
+		vendor=dec
 		;;
-	*-commodore*)
-		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+	commodore*)
+		vendor=cbm
 		;;
 	*)
 		;;
@@ -1323,197 +1275,244 @@
 
 # Decode manufacturer-specific aliases for certain operating systems.
 
-if [ x"$os" != x"" ]
+if [ x$os != x ]
 then
 case $os in
-	# First match some system type aliases
-	# that might get confused with valid system types.
-	# -solaris* is a basic system type, with this one exception.
-	-auroraux)
-		os=-auroraux
+	# First match some system type aliases that might get confused
+	# with valid system types.
+	# solaris* is a basic system type, with this one exception.
+	auroraux)
+		os=auroraux
 		;;
-	-solaris1 | -solaris1.*)
+	bluegene*)
+		os=cnk
+		;;
+	solaris1 | solaris1.*)
 		os=`echo $os | sed -e 's|solaris1|sunos4|'`
 		;;
-	-solaris)
-		os=-solaris2
+	solaris)
+		os=solaris2
 		;;
-	-svr4*)
-		os=-sysv4
+	unixware*)
+		os=sysv4.2uw
 		;;
-	-unixware*)
-		os=-sysv4.2uw
-		;;
-	-gnu/linux*)
+	gnu/linux*)
 		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
 		;;
-	# First accept the basic system types.
+	# es1800 is here to avoid being matched by es* (a different OS)
+	es1800*)
+		os=ose
+		;;
+	# Some version numbers need modification
+	chorusos*)
+		os=chorusos
+		;;
+	isc)
+		os=isc2.2
+		;;
+	sco6)
+		os=sco5v6
+		;;
+	sco5)
+		os=sco3.2v5
+		;;
+	sco4)
+		os=sco3.2v4
+		;;
+	sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		;;
+	sco3.2v[4-9]* | sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		;;
+	scout)
+		# Don't match below
+		;;
+	sco*)
+		os=sco3.2v2
+		;;
+	psos*)
+		os=psos
+		;;
+	# Now accept the basic system types.
 	# The portable systems comes first.
-	# Each alternative MUST END IN A *, to match a version number.
-	# -sysv* is not here because it comes later, after sysvr4.
-	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* | -plan9* \
-	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* \
-	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-	      | -bitrig* | -openbsd* | -solidbsd* \
-	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-	      | -chorusos* | -chorusrdb* | -cegcc* \
-	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
-	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	# Each alternative MUST end in a * to match a version number.
+	# sysv* is not here because it comes later, after sysvr4.
+	gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
+	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+	     | sym* | kopensolaris* | plan9* \
+	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+	     | aos* | aros* | cloudabi* | sortix* | twizzler* \
+	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+	     | knetbsd* | mirbsd* | netbsd* \
+	     | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
+	     | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
+	     | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+	     | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+	     | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
+	     | chorusrdb* | cegcc* | glidix* \
+	     | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+	     | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
+	     | linux-newlib* | linux-musl* | linux-uclibc* \
+	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+	     | interix* | uwin* | mks* | rhapsody* | darwin* \
+	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
+	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
+	     | os2* | vos* | palmos* | uclinux* | nucleus* \
+	     | morphos* | superux* | rtmk* | windiss* \
+	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+	     | nsk* | powerunix)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
-	-qnx*)
-		case $basic_machine in
-		    x86-* | i*86-*)
+	qnx*)
+		case $cpu in
+		    x86 | i*86)
 			;;
 		    *)
-			os=-nto$os
+			os=nto-$os
 			;;
 		esac
 		;;
-	-nto-qnx*)
+	hiux*)
+		os=hiuxwe2
 		;;
-	-nto*)
+	nto-qnx*)
+		;;
+	nto*)
 		os=`echo $os | sed -e 's|nto|nto-qnx|'`
 		;;
-	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+	sim | xray | os68k* | v88r* \
+	    | windows* | osx | abug | netware* | os9* \
+	    | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
 		;;
-	-mac*)
-		os=`echo $os | sed -e 's|mac|macos|'`
+	linux-dietlibc)
+		os=linux-dietlibc
 		;;
-	-linux-dietlibc)
-		os=-linux-dietlibc
-		;;
-	-linux*)
+	linux*)
 		os=`echo $os | sed -e 's|linux|linux-gnu|'`
 		;;
-	-sunos5*)
-		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+	lynx*178)
+		os=lynxos178
 		;;
-	-sunos6*)
-		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+	lynx*5)
+		os=lynxos5
 		;;
-	-opened*)
-		os=-openedition
+	lynx*)
+		os=lynxos
 		;;
-	-os400*)
-		os=-os400
+	mac*)
+		os=`echo "$os" | sed -e 's|mac|macos|'`
 		;;
-	-wince*)
-		os=-wince
+	opened*)
+		os=openedition
 		;;
-	-osfrose*)
-		os=-osfrose
+	os400*)
+		os=os400
 		;;
-	-osf*)
-		os=-osf
+	sunos5*)
+		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
 		;;
-	-utek*)
-		os=-bsd
+	sunos6*)
+		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
 		;;
-	-dynix*)
-		os=-bsd
+	wince*)
+		os=wince
 		;;
-	-acis*)
-		os=-aos
+	utek*)
+		os=bsd
 		;;
-	-atheos*)
-		os=-atheos
+	dynix*)
+		os=bsd
 		;;
-	-syllable*)
-		os=-syllable
+	acis*)
+		os=aos
 		;;
-	-386bsd)
-		os=-bsd
+	atheos*)
+		os=atheos
 		;;
-	-ctix* | -uts*)
-		os=-sysv
+	syllable*)
+		os=syllable
 		;;
-	-nova*)
-		os=-rtmk-nova
+	386bsd)
+		os=bsd
 		;;
-	-ns2 )
-		os=-nextstep2
+	ctix* | uts*)
+		os=sysv
 		;;
-	-nsk*)
-		os=-nsk
+	nova*)
+		os=rtmk-nova
+		;;
+	ns2)
+		os=nextstep2
 		;;
 	# Preserve the version number of sinix5.
-	-sinix5.*)
+	sinix5.*)
 		os=`echo $os | sed -e 's|sinix|sysv|'`
 		;;
-	-sinix*)
-		os=-sysv4
+	sinix*)
+		os=sysv4
 		;;
-	-tpf*)
-		os=-tpf
+	tpf*)
+		os=tpf
 		;;
-	-triton*)
-		os=-sysv3
+	triton*)
+		os=sysv3
 		;;
-	-oss*)
-		os=-sysv3
+	oss*)
+		os=sysv3
 		;;
-	-svr4)
-		os=-sysv4
+	svr4*)
+		os=sysv4
 		;;
-	-svr3)
-		os=-sysv3
+	svr3)
+		os=sysv3
 		;;
-	-sysvr4)
-		os=-sysv4
+	sysvr4)
+		os=sysv4
 		;;
-	# This must come after -sysvr4.
-	-sysv*)
+	# This must come after sysvr4.
+	sysv*)
 		;;
-	-ose*)
-		os=-ose
+	ose*)
+		os=ose
 		;;
-	-es1800*)
-		os=-ose
+	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+		os=mint
 		;;
-	-xenix)
-		os=-xenix
+	zvmoe)
+		os=zvmoe
 		;;
-	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-		os=-mint
+	dicos*)
+		os=dicos
 		;;
-	-aros*)
-		os=-aros
+	pikeos*)
+		# Until real need of OS specific support for
+		# particular features comes up, bare metal
+		# configurations are quite functional.
+		case $cpu in
+		    arm*)
+			os=eabi
+			;;
+		    *)
+			os=elf
+			;;
+		esac
 		;;
-	-zvmoe)
-		os=-zvmoe
+	nacl*)
 		;;
-	-dicos*)
-		os=-dicos
+	ios)
 		;;
-	-nacl*)
+	none)
 		;;
-	-none)
+	*-eabi)
 		;;
 	*)
-		# Get rid of the `-' at the beginning of $os.
-		os=`echo $os | sed 's/[^-]*-//'`
-		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
 		exit 1
 		;;
 esac
@@ -1529,264 +1528,265 @@
 # will signal an error saying that MANUFACTURER isn't an operating
 # system, and we'll never get to this point.
 
-case $basic_machine in
+case $cpu-$vendor in
 	score-*)
-		os=-elf
+		os=elf
 		;;
 	spu-*)
-		os=-elf
+		os=elf
 		;;
 	*-acorn)
-		os=-riscix1.2
+		os=riscix1.2
 		;;
 	arm*-rebel)
-		os=-linux
+		os=linux
 		;;
 	arm*-semi)
-		os=-aout
+		os=aout
 		;;
 	c4x-* | tic4x-*)
-		os=-coff
+		os=coff
 		;;
 	c8051-*)
-		os=-elf
+		os=elf
+		;;
+	clipper-intergraph)
+		os=clix
 		;;
 	hexagon-*)
-		os=-elf
+		os=elf
 		;;
 	tic54x-*)
-		os=-coff
+		os=coff
 		;;
 	tic55x-*)
-		os=-coff
+		os=coff
 		;;
 	tic6x-*)
-		os=-coff
+		os=coff
 		;;
 	# This must come before the *-dec entry.
 	pdp10-*)
-		os=-tops20
+		os=tops20
 		;;
 	pdp11-*)
-		os=-none
+		os=none
 		;;
 	*-dec | vax-*)
-		os=-ultrix4.2
+		os=ultrix4.2
 		;;
 	m68*-apollo)
-		os=-domain
+		os=domain
 		;;
 	i386-sun)
-		os=-sunos4.0.2
+		os=sunos4.0.2
 		;;
 	m68000-sun)
-		os=-sunos3
+		os=sunos3
 		;;
 	m68*-cisco)
-		os=-aout
+		os=aout
 		;;
 	mep-*)
-		os=-elf
+		os=elf
 		;;
 	mips*-cisco)
-		os=-elf
+		os=elf
 		;;
 	mips*-*)
-		os=-elf
-		;;
-	or1k-*)
-		os=-elf
+		os=elf
 		;;
 	or32-*)
-		os=-coff
+		os=coff
 		;;
 	*-tti)	# must be before sparc entry or we get the wrong os.
-		os=-sysv3
+		os=sysv3
 		;;
 	sparc-* | *-sun)
-		os=-sunos4.1.1
+		os=sunos4.1.1
+		;;
+	pru-*)
+		os=elf
 		;;
 	*-be)
-		os=-beos
-		;;
-	*-haiku)
-		os=-haiku
+		os=beos
 		;;
 	*-ibm)
-		os=-aix
+		os=aix
 		;;
 	*-knuth)
-		os=-mmixware
+		os=mmixware
 		;;
 	*-wec)
-		os=-proelf
+		os=proelf
 		;;
 	*-winbond)
-		os=-proelf
+		os=proelf
 		;;
 	*-oki)
-		os=-proelf
+		os=proelf
 		;;
 	*-hp)
-		os=-hpux
+		os=hpux
 		;;
 	*-hitachi)
-		os=-hiux
+		os=hiux
 		;;
 	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-		os=-sysv
+		os=sysv
 		;;
 	*-cbm)
-		os=-amigaos
+		os=amigaos
 		;;
 	*-dg)
-		os=-dgux
+		os=dgux
 		;;
 	*-dolphin)
-		os=-sysv3
+		os=sysv3
 		;;
 	m68k-ccur)
-		os=-rtu
+		os=rtu
 		;;
 	m88k-omron*)
-		os=-luna
-		;;
-	*-next )
-		os=-nextstep
-		;;
-	*-sequent)
-		os=-ptx
-		;;
-	*-crds)
-		os=-unos
-		;;
-	*-ns)
-		os=-genix
-		;;
-	i370-*)
-		os=-mvs
+		os=luna
 		;;
 	*-next)
-		os=-nextstep3
+		os=nextstep
+		;;
+	*-sequent)
+		os=ptx
+		;;
+	*-crds)
+		os=unos
+		;;
+	*-ns)
+		os=genix
+		;;
+	i370-*)
+		os=mvs
 		;;
 	*-gould)
-		os=-sysv
+		os=sysv
 		;;
 	*-highlevel)
-		os=-bsd
+		os=bsd
 		;;
 	*-encore)
-		os=-bsd
+		os=bsd
 		;;
 	*-sgi)
-		os=-irix
+		os=irix
 		;;
 	*-siemens)
-		os=-sysv4
+		os=sysv4
 		;;
 	*-masscomp)
-		os=-rtu
+		os=rtu
 		;;
 	f30[01]-fujitsu | f700-fujitsu)
-		os=-uxpv
+		os=uxpv
 		;;
 	*-rom68k)
-		os=-coff
+		os=coff
 		;;
 	*-*bug)
-		os=-coff
+		os=coff
 		;;
 	*-apple)
-		os=-macos
+		os=macos
 		;;
 	*-atari*)
-		os=-mint
+		os=mint
+		;;
+	*-wrs)
+		os=vxworks
 		;;
 	*)
-		os=-none
+		os=none
 		;;
 esac
 fi
 
 # Here we handle the case where we know the os, and the CPU type, but not the
 # manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-	*-unknown)
+case $vendor in
+	unknown)
 		case $os in
-			-riscix*)
+			riscix*)
 				vendor=acorn
 				;;
-			-sunos*)
+			sunos*)
 				vendor=sun
 				;;
-			-cnk*|-aix*)
+			cnk*|-aix*)
 				vendor=ibm
 				;;
-			-beos*)
+			beos*)
 				vendor=be
 				;;
-			-hpux*)
+			hpux*)
 				vendor=hp
 				;;
-			-mpeix*)
+			mpeix*)
 				vendor=hp
 				;;
-			-hiux*)
+			hiux*)
 				vendor=hitachi
 				;;
-			-unos*)
+			unos*)
 				vendor=crds
 				;;
-			-dgux*)
+			dgux*)
 				vendor=dg
 				;;
-			-luna*)
+			luna*)
 				vendor=omron
 				;;
-			-genix*)
+			genix*)
 				vendor=ns
 				;;
-			-mvs* | -opened*)
+			clix*)
+				vendor=intergraph
+				;;
+			mvs* | opened*)
 				vendor=ibm
 				;;
-			-os400*)
+			os400*)
 				vendor=ibm
 				;;
-			-ptx*)
+			ptx*)
 				vendor=sequent
 				;;
-			-tpf*)
+			tpf*)
 				vendor=ibm
 				;;
-			-vxsim* | -vxworks* | -windiss*)
+			vxsim* | vxworks* | windiss*)
 				vendor=wrs
 				;;
-			-aux*)
+			aux*)
 				vendor=apple
 				;;
-			-hms*)
+			hms*)
 				vendor=hitachi
 				;;
-			-mpw* | -macos*)
+			mpw* | macos*)
 				vendor=apple
 				;;
-			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+			*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
 				vendor=atari
 				;;
-			-vos*)
+			vos*)
 				vendor=stratus
 				;;
 		esac
-		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
 		;;
 esac
 
-echo $basic_machine$os
+echo "$cpu-$vendor-$os"
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
diff --git a/config/ltmain.sh b/config/ltmain.sh
new file mode 100644
index 0000000..c12c197
--- /dev/null
+++ b/config/ltmain.sh
@@ -0,0 +1,11249 @@
+#! /bin/sh
+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
+##               by inline-source v2014-01-03.01
+
+# libtool (GNU libtool) 2.4.6
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION="2.4.6 Debian-2.4.6-9"
+package_revision=2.4.6
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2015-01-20.17; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# As a special exception to the GNU General Public License, if you distribute
+# this file as part of a program or library that is built using GNU Libtool,
+# you may include this file under the same distribution terms that you use
+# for the rest of that program.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
+fi
+
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test set = \"\${$_G_var+set}\"; then
+          save_$_G_var=\$$_G_var
+          $_G_var=C
+	  export $_G_var
+	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
+	fi"
+done
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp	$nl"
+
+# There are apparently some retarded systems that use ';' as a PATH separator!
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+
+## ------------------------- ##
+## Locate command utilities. ##
+## ------------------------- ##
+
+
+# func_executable_p FILE
+# ----------------------
+# Check that FILE is an executable regular file.
+func_executable_p ()
+{
+    test -f "$1" && test -x "$1"
+}
+
+
+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
+# --------------------------------------------
+# Search for either a program that responds to --version with output
+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
+# trying all the directories in PATH with each of the elements of
+# PROGS_LIST.
+#
+# CHECK_FUNC should accept the path to a candidate program, and
+# set $func_check_prog_result if it truncates its output less than
+# $_G_path_prog_max characters.
+func_path_progs ()
+{
+    _G_progs_list=$1
+    _G_check_func=$2
+    _G_PATH=${3-"$PATH"}
+
+    _G_path_prog_max=0
+    _G_path_prog_found=false
+    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
+    for _G_dir in $_G_PATH; do
+      IFS=$_G_save_IFS
+      test -z "$_G_dir" && _G_dir=.
+      for _G_prog_name in $_G_progs_list; do
+        for _exeext in '' .EXE; do
+          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
+          func_executable_p "$_G_path_prog" || continue
+          case `"$_G_path_prog" --version 2>&1` in
+            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
+            *)     $_G_check_func $_G_path_prog
+		   func_path_progs_result=$func_check_prog_result
+		   ;;
+          esac
+          $_G_path_prog_found && break 3
+        done
+      done
+    done
+    IFS=$_G_save_IFS
+    test -z "$func_path_progs_result" && {
+      echo "no acceptable sed could be found in \$PATH" >&2
+      exit 1
+    }
+}
+
+
+# We want to be able to use the functions in this file before configure
+# has figured out where the best binaries are kept, which means we have
+# to search for them ourselves - except when the results are already set
+# where we skip the searches.
+
+# Unless the user overrides by setting SED, search the path for either GNU
+# sed, or the sed that truncates its output the least.
+test -z "$SED" && {
+  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+  for _G_i in 1 2 3 4 5 6 7; do
+    _G_sed_script=$_G_sed_script$nl$_G_sed_script
+  done
+  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
+  _G_sed_script=
+
+  func_check_prog_sed ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo '' >> conftest.nl
+      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+  rm -f conftest.sed
+  SED=$func_path_progs_result
+}
+
+
+# Unless the user overrides by setting GREP, search the path for either GNU
+# grep, or the grep that truncates its output the least.
+test -z "$GREP" && {
+  func_check_prog_grep ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    _G_path_prog_max=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo 'GREP' >> conftest.nl
+      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+  GREP=$func_path_progs_result
+}
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables.  These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
+
+: ${CP="cp -f"}
+: ${ECHO="printf %s\n"}
+: ${EGREP="$GREP -E"}
+: ${FGREP="$GREP -F"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+
+
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
+
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
+
+# Same as above, but do not quote variable references.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
+
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same.  If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion.  Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+  s/$_G_bs4/&\\
+/g
+  s/^$_G_bs2$_G_dollar/$_G_bs&/
+  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+  s/\n//g"
+
+
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
+
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
+
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
+
+# By convention, finish your script with:
+#
+#    exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
+
+# The name of this program.
+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
+
+# Make sure we have an absolute progpath for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
+     progdir=`cd "$progdir" && pwd`
+     progpath=$progdir/$progname
+     ;;
+  *)
+     _G_IFS=$IFS
+     IFS=${PATH_SEPARATOR-:}
+     for progdir in $PATH; do
+       IFS=$_G_IFS
+       test -x "$progdir/$progname" && break
+     done
+     IFS=$_G_IFS
+     test -n "$progdir" || progdir=`pwd`
+     progpath=$progdir/$progname
+     ;;
+esac
+
+
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
+
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
+
+opt_dry_run=false
+opt_quiet=false
+opt_verbose=false
+
+# Categories 'all' and 'none' are always available.  Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
+
+# By default, display warnings according to 'opt_warning_types'.  Set
+# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
+
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
+{
+    $debug_cmd
+
+    test -t 1 && {
+      # COLORTERM and USE_ANSI_COLORS environment variables take
+      # precedence, because most terminfo databases neglect to describe
+      # whether color sequences are supported.
+      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+      if test 1 = "$USE_ANSI_COLORS"; then
+        # Standard ANSI escape sequences
+        tc_reset=''
+        tc_bold='';   tc_standout=''
+        tc_red='';   tc_green=''
+        tc_blue='';  tc_cyan=''
+      else
+        # Otherwise trust the terminfo database after all.
+        test -n "`tput sgr0 2>/dev/null`" && {
+          tc_reset=`tput sgr0`
+          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+          tc_standout=$tc_bold
+          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+        }
+      fi
+    }
+
+    require_term_colors=:
+}
+
+
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+  # We should try to minimise forks, especially on Windows where they are
+  # unreasonably slow, so skip the feature probes when bash or zsh are
+  # being used:
+  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+    : ${_G_HAVE_ARITH_OP="yes"}
+    : ${_G_HAVE_XSI_OPS="yes"}
+    # The += operator was introduced in bash 3.1
+    case $BASH_VERSION in
+      [12].* | 3.0 | 3.0*) ;;
+      *)
+        : ${_G_HAVE_PLUSEQ_OP="yes"}
+        ;;
+    esac
+  fi
+
+  # _G_HAVE_PLUSEQ_OP
+  # Can be empty, in which case the shell is probed, "yes" if += is
+  # useable or anything else if it does not work.
+  test -z "$_G_HAVE_PLUSEQ_OP" \
+    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+    && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_append ()
+  {
+    $debug_cmd
+
+    eval "$1+=\$2"
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_append ()
+  {
+    $debug_cmd
+
+    eval "$1=\$$1\$2"
+  }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+  eval 'func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1+=\\ \$func_quote_for_eval_result"
+  }'
+else
+  func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+  }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE.  For example:
+#
+#   func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
+{
+    $debug_cmd
+
+    eval _G_current_value='`$ECHO $'$1'`'
+    _G_delim=`expr "$2" : '\(.\)'`
+
+    case $_G_delim$_G_current_value$_G_delim in
+      *"$2$_G_delim"*) ;;
+      *) func_append "$@" ;;
+    esac
+}
+
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+  test -z "$_G_HAVE_ARITH_OP" \
+    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+    && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+  eval 'func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=$(( $* ))
+  }'
+else
+  func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=`expr "$@"`
+  }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  # If this shell supports suffix pattern removal, then use it to avoid
+  # forking. Hide the definitions single quotes in case the shell chokes
+  # on unsupported syntax...
+  _b='func_basename_result=${1##*/}'
+  _d='case $1 in
+        */*) func_dirname_result=${1%/*}$2 ;;
+        *  ) func_dirname_result=$3        ;;
+      esac'
+
+else
+  # ...otherwise fall back to using sed.
+  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
+      if test "X$func_dirname_result" = "X$1"; then
+        func_dirname_result=$3
+      else
+        func_append func_dirname_result "$2"
+      fi'
+fi
+
+eval 'func_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+    $debug_cmd
+
+    '"$_d"'
+}'
+
+
+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
+# --------------------------------------------------------
+# Perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+    '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    _G_infix=$1; shift
+    _G_indent=$_G_infix
+    _G_prefix="$progname: $_G_infix: "
+    _G_message=$*
+
+    # Strip color escape sequences before counting printable length
+    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+    do
+      test -n "$_G_tc" && {
+        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
+        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
+      }
+    done
+    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
+
+    func_echo_infix_1_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_infix_1_IFS
+      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+      _G_prefix=$_G_indent
+    done
+    IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    $debug_cmd
+
+    func_error "$*"
+    exit $EXIT_FAILURE
+}
+
+
+# func_grep EXPRESSION FILENAME
+# -----------------------------
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $debug_cmd
+
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+  test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=${#1}
+  }'
+else
+  func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+  }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    $debug_cmd
+
+    _G_directory_path=$1
+    _G_dir_list=
+
+    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+      # Protect directory names starting with '-'
+      case $_G_directory_path in
+        -*) _G_directory_path=./$_G_directory_path ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$_G_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        _G_dir_list=$_G_directory_path:$_G_dir_list
+
+        # If the last portion added has no slash in it, the list is done
+        case $_G_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
+      done
+      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
+
+      func_mkdir_p_IFS=$IFS; IFS=:
+      for _G_dir in $_G_dir_list; do
+	IFS=$func_mkdir_p_IFS
+        # mkdir can fail with a 'File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$_G_dir" 2>/dev/null || :
+      done
+      IFS=$func_mkdir_p_IFS
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$_G_directory_path" || \
+        func_fatal_error "Failed to create '$1'"
+    fi
+}
+
+
+# func_mktempdir [BASENAME]
+# -------------------------
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, BASENAME is the basename for that directory.
+func_mktempdir ()
+{
+    $debug_cmd
+
+    _G_template=${TMPDIR-/tmp}/${1-$progname}
+
+    if test : = "$opt_dry_run"; then
+      # Return a directory name, but don't create it in dry-run mode
+      _G_tmpdir=$_G_template-$$
+    else
+
+      # If mktemp works, use that first and foremost
+      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$_G_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        _G_tmpdir=$_G_template-${RANDOM-0}$$
+
+        func_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$_G_tmpdir"
+        umask $func_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$_G_tmpdir" || \
+        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+    fi
+
+    $ECHO "$_G_tmpdir"
+}
+
+
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
+{
+    $debug_cmd
+
+    # These SED scripts presuppose an absolute path with a trailing slash.
+    _G_pathcar='s|^/\([^/]*\).*$|\1|'
+    _G_pathcdr='s|^/[^/]*||'
+    _G_removedotparts=':dotsl
+		s|/\./|/|g
+		t dotsl
+		s|/\.$|/|'
+    _G_collapseslashes='s|/\{1,\}|/|g'
+    _G_finalslash='s|/*$|/|'
+
+    # Start from root dir and reassemble the path.
+    func_normal_abspath_result=
+    func_normal_abspath_tpath=$1
+    func_normal_abspath_altnamespace=
+    case $func_normal_abspath_tpath in
+      "")
+        # Empty path, that just means $cwd.
+        func_stripname '' '/' "`pwd`"
+        func_normal_abspath_result=$func_stripname_result
+        return
+        ;;
+      # The next three entries are used to spot a run of precisely
+      # two leading slashes without using negated character classes;
+      # we take advantage of case's first-match behaviour.
+      ///*)
+        # Unusual form of absolute path, do nothing.
+        ;;
+      //*)
+        # Not necessarily an ordinary path; POSIX reserves leading '//'
+        # and for example Cygwin uses it to access remote file shares
+        # over CIFS/SMB, so we conserve a leading double slash if found.
+        func_normal_abspath_altnamespace=/
+        ;;
+      /*)
+        # Absolute path, do nothing.
+        ;;
+      *)
+        # Relative path, prepend $cwd.
+        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+        ;;
+    esac
+
+    # Cancel out all the simple stuff to save iterations.  We also want
+    # the path to end with a slash for ease of parsing, so make sure
+    # there is one (and only one) here.
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+    while :; do
+      # Processed it all yet?
+      if test / = "$func_normal_abspath_tpath"; then
+        # If we ascended to the root using ".." the result may be empty now.
+        if test -z "$func_normal_abspath_result"; then
+          func_normal_abspath_result=/
+        fi
+        break
+      fi
+      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcar"`
+      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcdr"`
+      # Figure out what to do with it
+      case $func_normal_abspath_tcomponent in
+        "")
+          # Trailing empty path component, ignore it.
+          ;;
+        ..)
+          # Parent dir; strip last assembled component from result.
+          func_dirname "$func_normal_abspath_result"
+          func_normal_abspath_result=$func_dirname_result
+          ;;
+        *)
+          # Actual path component, append it.
+          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+          ;;
+      esac
+    done
+    # Restore leading double-slash if one was found on entry.
+    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+    $debug_cmd
+
+    $opt_quiet || func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+    $debug_cmd
+
+    func_relative_path_result=
+    func_normal_abspath "$1"
+    func_relative_path_tlibdir=$func_normal_abspath_result
+    func_normal_abspath "$2"
+    func_relative_path_tbindir=$func_normal_abspath_result
+
+    # Ascend the tree starting from libdir
+    while :; do
+      # check if we have found a prefix of bindir
+      case $func_relative_path_tbindir in
+        $func_relative_path_tlibdir)
+          # found an exact match
+          func_relative_path_tcancelled=
+          break
+          ;;
+        $func_relative_path_tlibdir*)
+          # found a matching prefix
+          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+          func_relative_path_tcancelled=$func_stripname_result
+          if test -z "$func_relative_path_result"; then
+            func_relative_path_result=.
+          fi
+          break
+          ;;
+        *)
+          func_dirname $func_relative_path_tlibdir
+          func_relative_path_tlibdir=$func_dirname_result
+          if test -z "$func_relative_path_tlibdir"; then
+            # Have to descend all the way to the root!
+            func_relative_path_result=../$func_relative_path_result
+            func_relative_path_tcancelled=$func_relative_path_tbindir
+            break
+          fi
+          func_relative_path_result=../$func_relative_path_result
+          ;;
+      esac
+    done
+
+    # Now calculate path; take care to avoid doubling-up slashes.
+    func_stripname '' '/' "$func_relative_path_result"
+    func_relative_path_result=$func_stripname_result
+    func_stripname '/' '/' "$func_relative_path_tcancelled"
+    if test -n "$func_stripname_result"; then
+      func_append func_relative_path_result "/$func_stripname_result"
+    fi
+
+    # Normalisation. If bindir is libdir, return '.' else relative path.
+    if test -n "$func_relative_path_result"; then
+      func_stripname './' '' "$func_relative_path_result"
+      func_relative_path_result=$func_stripname_result
+    fi
+
+    test -n "$func_relative_path_result" || func_relative_path_result=.
+
+    :
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+#   i) func_quote_for_eval_result
+#      double-quoted, suitable for a subsequent eval
+#  ii) func_quote_for_eval_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.
+func_quote_for_eval ()
+{
+    $debug_cmd
+
+    func_quote_for_eval_unquoted_result=
+    func_quote_for_eval_result=
+    while test 0 -lt $#; do
+      case $1 in
+        *[\\\`\"\$]*)
+	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+        *)
+          _G_unquoted_arg=$1 ;;
+      esac
+      if test -n "$func_quote_for_eval_unquoted_result"; then
+	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+      else
+        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+      fi
+
+      case $_G_unquoted_arg in
+        # Double-quote args containing shell metacharacters to delay
+        # word splitting, command substitution and variable expansion
+        # for a subsequent eval.
+        # Many Bourne shells cannot handle close brackets correctly
+        # in scan sets, so we specify it separately.
+        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+          _G_quoted_arg=\"$_G_unquoted_arg\"
+          ;;
+        *)
+          _G_quoted_arg=$_G_unquoted_arg
+	  ;;
+      esac
+
+      if test -n "$func_quote_for_eval_result"; then
+	func_append func_quote_for_eval_result " $_G_quoted_arg"
+      else
+        func_append func_quote_for_eval_result "$_G_quoted_arg"
+      fi
+      shift
+    done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    $debug_cmd
+
+    case $1 in
+      *[\\\`\"]*)
+	_G_arg=`$ECHO "$1" | $SED \
+	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        _G_arg=$1 ;;
+    esac
+
+    case $_G_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        _G_arg=\"$_G_arg\"
+        ;;
+    esac
+
+    func_quote_for_expand_result=$_G_arg
+}
+
+
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_stripname ()
+  {
+    $debug_cmd
+
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary variable first.
+    func_stripname_result=$3
+    func_stripname_result=${func_stripname_result#"$1"}
+    func_stripname_result=${func_stripname_result%"$2"}
+  }'
+else
+  func_stripname ()
+  {
+    $debug_cmd
+
+    case $2 in
+      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+    esac
+  }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    func_quote_for_expand "$_G_cmd"
+    eval "func_notquiet $func_quote_for_expand_result"
+
+    $opt_dry_run || {
+      eval "$_G_cmd"
+      _G_status=$?
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    $opt_quiet || {
+      func_quote_for_expand "$_G_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    $opt_dry_run || {
+      eval "$_G_user_locale
+	    $_G_cmd"
+      _G_status=$?
+      eval "$_G_safe_locale"
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_tr_sh
+# ----------
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+    $debug_cmd
+
+    case $1 in
+    [0-9]* | *[!a-zA-Z0-9_]*)
+      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+      ;;
+    * )
+      func_tr_sh_result=$1
+      ;;
+    esac
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $debug_cmd
+
+    $opt_verbose && func_echo "$*"
+
+    :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+    $debug_cmd
+
+    # CATEGORY must be in the warning_categories list!
+    case " $warning_categories " in
+      *" $1 "*) ;;
+      *) func_internal_error "invalid warning category '$1'" ;;
+    esac
+
+    _G_category=$1
+    shift
+
+    case " $opt_warning_types " in
+      *" $_G_category "*) $warning_func ${1+"$@"} ;;
+    esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+    $debug_cmd
+
+    printf '%s\n%s\n' "$1" "$2" \
+      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
+}
+
+# func_lt_ver PREV CURR
+# ---------------------
+# Return true if PREV and CURR are in the correct order according to
+# func_sort_ver, otherwise false.  Use it like this:
+#
+#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
+func_lt_ver ()
+{
+    $debug_cmd
+
+    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2015-10-07.11; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+#   #!/bin/sh
+#   . relative/path/to/funclib.sh
+#   . relative/path/to/options-parser
+#   scriptversion=1.0
+#   func_options ${1+"$@"}
+#   eval set dummy "$func_options_result"; shift
+#   ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'.  Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+       --debug        enable verbose shell tracing
+   -W, --warnings=CATEGORY
+                      report the warnings falling in CATEGORY [all]
+   -v, --verbose      verbosely report processing
+       --version      print version information and exit
+   -h, --help         print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+       'all'          show all warnings
+       'none'         turn off all the warnings
+       'error'        warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code.  A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+    $debug_cmd
+
+    func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not accept hook functions." ;;
+    esac
+
+    eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+    $debug_cmd
+
+    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+    $debug_cmd
+
+    _G_rc_run_hooks=false
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+    esac
+
+    eval _G_hook_fns=\$$1_hooks; shift
+
+    for _G_hook in $_G_hook_fns; do
+      if eval $_G_hook '"$@"'; then
+        # store returned options list back into positional
+        # parameters for next 'cmd' execution.
+        eval _G_hook_result=\$${_G_hook}_result
+        eval set dummy "$_G_hook_result"; shift
+        _G_rc_run_hooks=:
+      fi
+    done
+
+    $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, you may remove/edit
+# any options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'.  In this case you also must return $EXIT_SUCCESS to let the
+# hook's caller know that it should pay attention to
+# '<hooked_function_name>_result'.  Returning $EXIT_FAILURE signalizes that
+# arguments are left untouched by the hook and therefore caller will ignore the
+# result variable.
+#
+# Like this:
+#
+#    my_options_prep ()
+#    {
+#        $debug_cmd
+#
+#        # Extend the existing usage message.
+#        usage_message=$usage_message'
+#      -s, --silent       don'\''t print informational messages
+#    '
+#        # No change in '$@' (ignored completely by this hook).  There is
+#        # no need to do the equivalent (but slower) action:
+#        # func_quote_for_eval ${1+"$@"}
+#        # my_options_prep_result=$func_quote_for_eval_result
+#        false
+#    }
+#    func_add_hook func_options_prep my_options_prep
+#
+#
+#    my_silent_option ()
+#    {
+#        $debug_cmd
+#
+#        args_changed=false
+#
+#        # Note that for efficiency, we parse as many options as we can
+#        # recognise in a loop before passing the remainder back to the
+#        # caller on the first unrecognised argument we encounter.
+#        while test $# -gt 0; do
+#          opt=$1; shift
+#          case $opt in
+#            --silent|-s) opt_silent=:
+#                         args_changed=:
+#                         ;;
+#            # Separate non-argument short options:
+#            -s*)         func_split_short_opt "$_G_opt"
+#                         set dummy "$func_split_short_opt_name" \
+#                             "-$func_split_short_opt_arg" ${1+"$@"}
+#                         shift
+#                         args_changed=:
+#                         ;;
+#            *)           # Make sure the first unrecognised option "$_G_opt"
+#                         # is added back to "$@", we could need that later
+#                         # if $args_changed is true.
+#                         set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+#          esac
+#        done
+#
+#        if $args_changed; then
+#          func_quote_for_eval ${1+"$@"}
+#          my_silent_option_result=$func_quote_for_eval_result
+#        fi
+#
+#        $args_changed
+#    }
+#    func_add_hook func_parse_options my_silent_option
+#
+#
+#    my_option_validation ()
+#    {
+#        $debug_cmd
+#
+#        $opt_silent && $opt_verbose && func_fatal_help "\
+#    '--silent' and '--verbose' options are mutually exclusive."
+#
+#        false
+#    }
+#    func_add_hook func_validate_options my_option_validation
+#
+# You'll also need to manually amend $usage_message to reflect the extra
+# options you parse.  It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options_finish [ARG]...
+# ----------------------------
+# Finishing the option parse loop (call 'func_options' hooks ATM).
+func_options_finish ()
+{
+    $debug_cmd
+
+    _G_func_options_finish_exit=false
+    if func_run_hooks func_options ${1+"$@"}; then
+      func_options_finish_result=$func_run_hooks_result
+      _G_func_options_finish_exit=:
+    fi
+
+    $_G_func_options_finish_exit
+}
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+    $debug_cmd
+
+    _G_rc_options=false
+
+    for my_func in options_prep parse_options validate_options options_finish
+    do
+      if eval func_$my_func '${1+"$@"}'; then
+        eval _G_res_var='$'"func_${my_func}_result"
+        eval set dummy "$_G_res_var" ; shift
+        _G_rc_options=:
+      fi
+    done
+
+    # Save modified positional parameters for caller.  As a top-level
+    # options-parser function we always need to set the 'func_options_result'
+    # variable (regardless the $_G_rc_options value).
+    if $_G_rc_options; then
+      func_options_result=$_G_res_var
+    else
+      func_quote_for_eval ${1+"$@"}
+      func_options_result=$func_quote_for_eval_result
+    fi
+
+    $_G_rc_options
+}
+
+
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters.  If a hook function modifies that list, and
+# needs to propagate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned).
+func_hookable func_options_prep
+func_options_prep ()
+{
+    $debug_cmd
+
+    # Option defaults:
+    opt_verbose=false
+    opt_warning_types=
+
+    _G_rc_options_prep=false
+    if func_run_hooks func_options_prep ${1+"$@"}; then
+      _G_rc_options_prep=:
+      # save modified positional parameters for caller
+      func_options_prep_result=$func_run_hooks_result
+    fi
+
+    $_G_rc_options_prep
+}
+
+
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
+{
+    $debug_cmd
+
+    func_parse_options_result=
+
+    _G_rc_parse_options=false
+    # this just eases exit handling
+    while test $# -gt 0; do
+      # Defer to hook functions for initial option parsing, so they
+      # get priority in the event of reusing an option name.
+      if func_run_hooks func_parse_options ${1+"$@"}; then
+        eval set dummy "$func_run_hooks_result"; shift
+        _G_rc_parse_options=:
+      fi
+
+      # Break out of the loop if we already parsed every option.
+      test $# -gt 0 || break
+
+      _G_match_parse_options=:
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --debug|-x)   debug_cmd='set -x'
+                      func_echo "enabling shell trace mode"
+                      $debug_cmd
+                      ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                      set dummy --warnings none ${1+"$@"}
+                      shift
+		      ;;
+
+        --warnings|--warning|-W)
+                      if test $# = 0 && func_missing_arg $_G_opt; then
+                        _G_rc_parse_options=:
+                        break
+                      fi
+                      case " $warning_categories $1" in
+                        *" $1 "*)
+                          # trailing space prevents matching last $1 above
+                          func_append_uniq opt_warning_types " $1"
+                          ;;
+                        *all)
+                          opt_warning_types=$warning_categories
+                          ;;
+                        *none)
+                          opt_warning_types=none
+                          warning_func=:
+                          ;;
+                        *error)
+                          opt_warning_types=$warning_categories
+                          warning_func=func_fatal_error
+                          ;;
+                        *)
+                          func_fatal_error \
+                             "unsupported warning category: '$1'"
+                          ;;
+                      esac
+                      shift
+                      ;;
+
+        --verbose|-v) opt_verbose=: ;;
+        --version)    func_version ;;
+        -\?|-h)       func_usage ;;
+        --help)       func_help ;;
+
+	# Separate optargs to long options (plugins may need this):
+	--*=*)        func_split_equals "$_G_opt"
+	              set dummy "$func_split_equals_lhs" \
+                          "$func_split_equals_rhs" ${1+"$@"}
+                      shift
+                      ;;
+
+       # Separate optargs to short options:
+        -W*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        # Separate non-argument short options:
+        -\?*|-h*|-v*|-x*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        --)           _G_rc_parse_options=: ; break ;;
+        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift
+                      _G_match_parse_options=false
+                      break
+                      ;;
+      esac
+
+      $_G_match_parse_options && _G_rc_parse_options=:
+    done
+
+
+    if $_G_rc_parse_options; then
+      # save modified positional parameters for caller
+      func_quote_for_eval ${1+"$@"}
+      func_parse_options_result=$func_quote_for_eval_result
+    fi
+
+    $_G_rc_parse_options
+}
+
+
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
+{
+    $debug_cmd
+
+    _G_rc_validate_options=false
+
+    # Display all warnings if -W was not given.
+    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+    if func_run_hooks func_validate_options ${1+"$@"}; then
+      # save modified positional parameters for caller
+      func_validate_options_result=$func_run_hooks_result
+      _G_rc_validate_options=:
+    fi
+
+    # Bail if the options were screwed!
+    $exit_cmd $EXIT_FAILURE
+
+    $_G_rc_validate_options
+}
+
+
+
+## ----------------- ##
+## Helper functions. ##
+## ----------------- ##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    $debug_cmd
+
+    eval \$ECHO \""Usage: $usage"\"
+    eval \$ECHO \""$fatal_help"\"
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
+func_help ()
+{
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message"
+    exit 0
+}
+
+
+# func_missing_arg ARGNAME
+# ------------------------
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    $debug_cmd
+
+    func_error "Missing argument for '$1'."
+    exit_cmd=exit
+}
+
+
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=${1%%=*}
+      func_split_equals_rhs=${1#*=}
+      test "x$func_split_equals_lhs" = "x$1" \
+        && func_split_equals_rhs=
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+      func_split_equals_rhs=
+      test "x$func_split_equals_lhs" = "x$1" \
+        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+  }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_arg=${1#??}
+      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+  }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
+    exit 0
+}
+
+
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
+{
+    $debug_cmd
+
+    eval \$ECHO \""Usage: $usage"\"
+    echo
+    $SED -n 's|^# ||
+        /^Written by/{
+          x;p;x
+        }
+	h
+	/^Written by/q' < "$progpath"
+    echo
+    eval \$ECHO \""$usage_message"\"
+}
+
+
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $debug_cmd
+
+    printf '%s\n' "$progname $scriptversion"
+    $SED -n '
+        /(C)/!b go
+        :more
+        /\./!{
+          N
+          s|\n# | |
+          b more
+        }
+        :go
+        /^# Written by /,/# warranty; / {
+          s|^# ||
+          s|^# *$||
+          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+          p
+        }
+        /^# Written by / {
+          s|^# ||
+          p
+        }
+        /^warranty; /q' < "$progpath"
+
+    exit $?
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.6'
+
+
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
+{
+    $debug_cmd
+
+    $warning_func ${1+"$@"}
+}
+
+
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+       --config             show all configuration variables
+       --debug              enable verbose shell tracing
+   -n, --dry-run            display commands without modifying any files
+       --features           display basic configuration information and exit
+       --mode=MODE          use operation mode MODE
+       --no-warnings        equivalent to '-Wnone'
+       --preserve-dup-deps  don't remove duplicate dependency libraries
+       --quiet, --silent    don't print informational messages
+       --tag=TAG            use configuration variables from tag TAG
+   -v, --verbose            print more informational messages than default
+       --version            print version information
+   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
+   -h, --help, --help-all   print short, long, or detailed help message
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+func_help ()
+{
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message
+
+MODE must be one of the following:
+
+       clean           remove files from the build directory
+       compile         compile a source file into a libtool object
+       execute         automatically set library path, then run a program
+       finish          complete the installation of libtool libraries
+       install         install libraries or executables
+       link            create a library or an executable
+       uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+       host-triplet:   $host
+       shell:          $SHELL
+       compiler:       $LTCC
+       compiler flags: $LTCFLAGS
+       linker:         $LD (gnu? $with_gnu_ld)
+       version:        $progname $scriptversion Debian-2.4.6-9
+       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool@gnu.org>.
+GNU libtool home page: <http://www.gnu.org/s/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+    exit 0
+}
+
+
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_lo2o ()
+  {
+    case $1 in
+      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+      *   ) func_lo2o_result=$1               ;;
+    esac
+  }'
+
+  # func_xform LIBOBJ-OR-SOURCE
+  # ---------------------------
+  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+  # suffix to a '.lo' libtool-object suffix.
+  eval 'func_xform ()
+  {
+    func_xform_result=${1%.*}.lo
+  }'
+else
+  # ...otherwise fall back to using sed.
+  func_lo2o ()
+  {
+    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+  }
+
+  func_xform ()
+  {
+    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+  }
+fi
+
+
+# func_fatal_configuration ARG...
+# -------------------------------
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func__fatal_error ${1+"$@"} \
+      "See the $PACKAGE documentation for more information." \
+      "Fatal configuration error."
+}
+
+
+# func_config
+# -----------
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+    done
+
+    exit $?
+}
+
+
+# func_features
+# -------------
+# Display the features supported by this script.
+func_features ()
+{
+    echo "host: $host"
+    if test yes = "$build_libtool_libs"; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test yes = "$build_old_libs"; then
+      echo "enable static libraries"
+    else
+      echo "disable static libraries"
+    fi
+
+    exit $?
+}
+
+
+# func_enable_tag TAGNAME
+# -----------------------
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+    # Global variable:
+    tagname=$1
+
+    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+    sed_extractcf=/$re_begincf/,/$re_endcf/p
+
+    # Validate tagname.
+    case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+        func_fatal_error "invalid tag name: $tagname"
+        ;;
+    esac
+
+    # Don't test for the "default" C tag, as we know it's
+    # there but not specially marked.
+    case $tagname in
+        CC) ;;
+    *)
+        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	  taglist="$taglist $tagname"
+
+	  # Evaluate the configuration.  Be careful to quote the path
+	  # and the sed script, to avoid splitting on whitespace, but
+	  # also don't use non-portable quotes within backquotes within
+	  # quotes we have to do it in 2 steps:
+	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	  eval "$extractedcf"
+        else
+	  func_error "ignoring unknown tag $tagname"
+        fi
+        ;;
+    esac
+}
+
+
+# func_check_version_match
+# ------------------------
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+    if test "$package_revision" != "$macro_revision"; then
+      if test "$VERSION" != "$macro_version"; then
+        if test -z "$macro_version"; then
+          cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+        else
+          cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+        fi
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+      fi
+
+      exit $EXIT_MISMATCH
+    fi
+}
+
+
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+    $debug_mode
+
+    # Option defaults:
+    opt_config=false
+    opt_dlopen=
+    opt_dry_run=false
+    opt_help=false
+    opt_mode=
+    opt_preserve_dup_deps=false
+    opt_quiet=false
+
+    nonopt=
+    preserve_args=
+
+    _G_rc_lt_options_prep=:
+
+    # Shorthand for --mode=foo, only valid as the first argument
+    case $1 in
+    clean|clea|cle|cl)
+      shift; set dummy --mode clean ${1+"$@"}; shift
+      ;;
+    compile|compil|compi|comp|com|co|c)
+      shift; set dummy --mode compile ${1+"$@"}; shift
+      ;;
+    execute|execut|execu|exec|exe|ex|e)
+      shift; set dummy --mode execute ${1+"$@"}; shift
+      ;;
+    finish|finis|fini|fin|fi|f)
+      shift; set dummy --mode finish ${1+"$@"}; shift
+      ;;
+    install|instal|insta|inst|ins|in|i)
+      shift; set dummy --mode install ${1+"$@"}; shift
+      ;;
+    link|lin|li|l)
+      shift; set dummy --mode link ${1+"$@"}; shift
+      ;;
+    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+      shift; set dummy --mode uninstall ${1+"$@"}; shift
+      ;;
+    *)
+      _G_rc_lt_options_prep=false
+      ;;
+    esac
+
+    if $_G_rc_lt_options_prep; then
+      # Pass back the list of options.
+      func_quote_for_eval ${1+"$@"}
+      libtool_options_prep_result=$func_quote_for_eval_result
+    fi
+
+    $_G_rc_lt_options_prep
+}
+func_add_hook func_options_prep libtool_options_prep
+
+
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
+{
+    $debug_cmd
+
+    _G_rc_lt_parse_options=false
+
+    # Perform our own loop to consume as many options as possible in
+    # each iteration.
+    while test $# -gt 0; do
+      _G_match_lt_parse_options=:
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --dry-run|--dryrun|-n)
+                        opt_dry_run=:
+                        ;;
+
+        --config)       func_config ;;
+
+        --dlopen|-dlopen)
+                        opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+                        shift
+                        ;;
+
+        --preserve-dup-deps)
+                        opt_preserve_dup_deps=: ;;
+
+        --features)     func_features ;;
+
+        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
+
+        --help)         opt_help=: ;;
+
+        --help-all)     opt_help=': help-all' ;;
+
+        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_mode=$1
+                        case $1 in
+                          # Valid mode arguments:
+                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+                          # Catch anything else as an error
+                          *) func_error "invalid argument for $_G_opt"
+                             exit_cmd=exit
+                             break
+                             ;;
+                        esac
+                        shift
+                        ;;
+
+        --no-silent|--no-quiet)
+                        opt_quiet=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                        opt_warning=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-verbose)
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --silent|--quiet)
+                        opt_quiet=:
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_tag=$1
+                        func_append preserve_args " $_G_opt $1"
+                        func_enable_tag "$1"
+                        shift
+                        ;;
+
+        --verbose|-v)   opt_quiet=false
+                        opt_verbose=:
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        # An option not handled by this hook function:
+        *)              set dummy "$_G_opt" ${1+"$@"} ; shift
+                        _G_match_lt_parse_options=false
+                        break
+                        ;;
+      esac
+      $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
+    done
+
+    if $_G_rc_lt_parse_options; then
+      # save modified positional parameters for caller
+      func_quote_for_eval ${1+"$@"}
+      libtool_parse_options_result=$func_quote_for_eval_result
+    fi
+
+    $_G_rc_lt_parse_options
+}
+func_add_hook func_parse_options libtool_parse_options
+
+
+
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+    # save first non-option argument
+    if test 0 -lt $#; then
+      nonopt=$1
+      shift
+    fi
+
+    # preserve --debug
+    test : = "$debug_cmd" || func_append preserve_args " --debug"
+
+    case $host in
+      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+        # don't eliminate duplications in $postdeps and $predeps
+        opt_duplicate_compiler_generated_deps=:
+        ;;
+      *)
+        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+        ;;
+    esac
+
+    $opt_help || {
+      # Sanity checks first:
+      func_check_version_match
+
+      test yes != "$build_libtool_libs" \
+        && test yes != "$build_old_libs" \
+        && func_fatal_configuration "not configured to build any kind of library"
+
+      # Darwin sucks
+      eval std_shrext=\"$shrext_cmds\"
+
+      # Only execute mode is allowed to have -dlopen flags.
+      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+        func_error "unrecognized option '-dlopen'"
+        $ECHO "$help" 1>&2
+        exit $EXIT_FAILURE
+      fi
+
+      # Change the help message to a mode-specific one.
+      generic_help=$help
+      help="Try '$progname --help --mode=$opt_mode' for more information."
+    }
+
+    # Pass back the unparsed argument list
+    func_quote_for_eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_validate_options libtool_validate_options
+
+
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_generated_by_libtool
+# True iff stdin has been generated by Libtool. This function is only
+# a basic sanity check; it will hardly flush out determined imposters.
+func_generated_by_libtool_p ()
+{
+  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_p file
+# True iff FILE is a libtool '.la' library or '.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool '.la' library or '.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if 'file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+	for lalib_p_l in 1 2 3 4
+	do
+	    read lalib_p_line
+	    case $lalib_p_line in
+		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+	    esac
+	done
+	exec 0<&5 5<&-
+    fi
+    test yes = "$lalib_p"
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    test -f "$1" &&
+      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_dirname_and_basename "$1" "" "."
+    func_stripname '' '.exe' "$func_basename_result"
+    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $debug_cmd
+
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$sp$nl
+      eval cmd=\"$cmd\"
+      IFS=$save_ifs
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# 'FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $debug_cmd
+
+    case $1 in
+    */* | *\\*)	. "$1" ;;
+    *)		. "./$1" ;;
+    esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot.  Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+  func_resolve_sysroot_result=$1
+  case $func_resolve_sysroot_result in
+  =*)
+    func_stripname '=' '' "$func_resolve_sysroot_result"
+    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+    ;;
+  esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+  case $lt_sysroot:$1 in
+  ?*:"$lt_sysroot"*)
+    func_stripname "$lt_sysroot" '' "$1"
+    func_replace_sysroot_result='='$func_stripname_result
+    ;;
+  *)
+    # Including no sysroot.
+    func_replace_sysroot_result=$1
+    ;;
+  esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $debug_cmd
+
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+	func_append_quoted CC_quoted "$arg"
+      done
+      CC_expanded=`func_echo_all $CC`
+      CC_quoted_expanded=`func_echo_all $CC_quoted`
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	      # Double-quote args containing other shell metacharacters.
+	      func_append_quoted CC_quoted "$arg"
+	    done
+	    CC_expanded=`func_echo_all $CC`
+	    CC_quoted_expanded=`func_echo_all $CC_quoted`
+	    case "$@ " in
+	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  func_echo "unable to infer tagged configuration"
+	  func_fatal_error "specify a tag with '--tag'"
+#	else
+#	  func_verbose "using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=$1
+    if test yes = "$build_libtool_libs"; then
+      write_lobj=\'$2\'
+    else
+      write_lobj=none
+    fi
+
+    if test yes = "$build_old_libs"; then
+      write_oldobj=\'$3\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "$write_libobj"
+    }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+  $debug_cmd
+
+  func_convert_core_file_wine_to_w32_result=$1
+  if test -n "$1"; then
+    # Unfortunately, winepath does not exit with a non-zero error code, so we
+    # are forced to check the contents of stdout. On the other hand, if the
+    # command is not found, the shell will set an exit code of 127 and print
+    # *an error message* to stdout. So we must check for both error code of
+    # zero AND non-empty stdout, which explains the odd construction:
+    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
+      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+        $SED -e "$sed_naive_backslashify"`
+    else
+      func_convert_core_file_wine_to_w32_result=
+    fi
+  fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+  $debug_cmd
+
+  # unfortunately, winepath doesn't convert paths, only file names
+  func_convert_core_path_wine_to_w32_result=
+  if test -n "$1"; then
+    oldIFS=$IFS
+    IFS=:
+    for func_convert_core_path_wine_to_w32_f in $1; do
+      IFS=$oldIFS
+      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+      if test -n "$func_convert_core_file_wine_to_w32_result"; then
+        if test -z "$func_convert_core_path_wine_to_w32_result"; then
+          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
+        else
+          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+        fi
+      fi
+    done
+    IFS=$oldIFS
+  fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+  $debug_cmd
+
+  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+    if test "$?" -ne 0; then
+      # on failure, ensure result is empty
+      func_cygpath_result=
+    fi
+  else
+    func_cygpath_result=
+    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
+  fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format.  Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+  $debug_cmd
+
+  # awkward: cmd appends spaces to result
+  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+  $debug_cmd
+
+  if test -z "$2" && test -n "$1"; then
+    func_error "Could not determine host file name corresponding to"
+    func_error "  '$1'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback:
+    func_to_host_file_result=$1
+  fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+  $debug_cmd
+
+  if test -z "$4" && test -n "$3"; then
+    func_error "Could not determine the host path corresponding to"
+    func_error "  '$3'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback.  This is a deliberately simplistic "conversion" and
+    # should not be "improved".  See libtool.info.
+    if test "x$1" != "x$2"; then
+      lt_replace_pathsep_chars="s|$1|$2|g"
+      func_to_host_path_result=`echo "$3" |
+        $SED -e "$lt_replace_pathsep_chars"`
+    else
+      func_to_host_path_result=$3
+    fi
+  fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+  $debug_cmd
+
+  case $4 in
+  $1 ) func_to_host_path_result=$3$func_to_host_path_result
+    ;;
+  esac
+  case $4 in
+  $2 ) func_append func_to_host_path_result "$3"
+    ;;
+  esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via '$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+  $debug_cmd
+
+  $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result.  If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+  $debug_cmd
+
+  case ,$2, in
+    *,"$to_tool_file_cmd",*)
+      func_to_tool_file_result=$1
+      ;;
+    *)
+      $to_tool_file_cmd "$1"
+      func_to_tool_file_result=$func_to_host_file_result
+      ;;
+  esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+  func_to_host_file_result=$1
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_file_result=$1
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_to_host_file_result=$func_convert_core_msys_to_w32_result
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_file_result=$1
+  if test -n "$1"; then
+    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+    # LT_CYGPATH in this case.
+    func_to_host_file_result=`cygpath -m "$1"`
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format.  Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_file_result=$1
+  if test -n "$1"; then
+    func_convert_core_file_wine_to_w32 "$1"
+    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+  $debug_cmd
+
+  func_to_host_file_result=$1
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result=$func_cygpath_result
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+  $debug_cmd
+
+  func_to_host_file_result=$1
+  if test -n "$1"; then
+    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+    func_convert_core_file_wine_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result=$func_cygpath_result
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via '$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format.  If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+#   file name conversion function    : func_convert_file_X_to_Y ()
+#   path conversion function         : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same.  If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+  $debug_cmd
+
+  if test -z "$to_host_path_cmd"; then
+    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+    to_host_path_cmd=func_convert_path_$func_stripname_result
+  fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+  $debug_cmd
+
+  func_init_to_host_path_cmd
+  $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+  func_to_host_path_result=$1
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_path_result=$1
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from ARG.  MSYS
+    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+    # and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result=$func_convert_core_msys_to_w32_result
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_path_result=$1
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format.  Requires a wine environment and
+# a working winepath.  Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+  $debug_cmd
+
+  func_to_host_path_result=$1
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+  $debug_cmd
+
+  func_to_host_path_result=$1
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result=$func_cygpath_result
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+  $debug_cmd
+
+  func_to_host_path_result=$1
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from
+    # ARG. msys behavior is inconsistent here, cygpath turns them
+    # into '.;' and ';.', and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result=$func_cygpath_result
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+  $debug_cmd
+
+  func_dll_def_p_tmp=`$SED -n \
+    -e 's/^[	 ]*//' \
+    -e '/^\(;.*\)*$/d' \
+    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
+    -e q \
+    "$1"`
+  test DEF = "$func_dll_def_p_tmp"
+}
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $debug_cmd
+
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg=$arg
+	arg_mode=normal
+	;;
+
+      target )
+	libobj=$arg
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  test -n "$libobj" && \
+	    func_fatal_error "you cannot specify '-o' more than once"
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-pie | -fpie | -fPIE)
+          func_append pie_flag " $arg"
+	  continue
+	  ;;
+
+	-shared | -static | -prefer-pic | -prefer-non-pic)
+	  func_append later " $arg"
+	  continue
+	  ;;
+
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  func_stripname '-Wc,' '' "$arg"
+	  args=$func_stripname_result
+	  lastarg=
+	  save_ifs=$IFS; IFS=,
+	  for arg in $args; do
+	    IFS=$save_ifs
+	    func_append_quoted lastarg "$arg"
+	  done
+	  IFS=$save_ifs
+	  func_stripname ' ' '' "$lastarg"
+	  lastarg=$func_stripname_result
+
+	  # Add the arguments to base_compile.
+	  func_append base_compile " $lastarg"
+	  continue
+	  ;;
+
+	*)
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg=$srcfile
+	  srcfile=$arg
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      func_append_quoted base_compile "$lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with '-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+	func_basename "$srcfile"
+	libobj=$func_basename_result
+      }
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
+
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from '$libobj'"
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -shared)
+	test yes = "$build_libtool_libs" \
+	  || func_fatal_configuration "cannot build a shared library"
+	build_old_libs=no
+	continue
+	;;
+
+      -static)
+	build_libtool_libs=no
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+      esac
+    done
+
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
+      && func_warning "libobj name '$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname=$func_basename_result
+    xdir=$func_dirname_result
+    lobj=$xdir$objdir/$objname
+
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
+
+    # Delete any leftover library objects.
+    if test yes = "$build_old_libs"; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
+      pic_mode=default
+      ;;
+    esac
+    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test no = "$compiler_c_o"; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+      lockfile=$output_obj.lock
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test yes = "$need_locks"; then
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test warn = "$need_locks"; then
+      if test -f "$lockfile"; then
+	$ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support '-c' and '-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+      func_append removelist " $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
+    fi
+
+    $opt_dry_run || $RM $removelist
+    func_append removelist " $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+    srcfile=$func_to_tool_file_result
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test yes = "$build_libtool_libs"; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test no != "$pic_mode"; then
+	command="$base_compile $qsrcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      fi
+
+      func_mkdir_p "$xdir$objdir"
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	func_append command " -o $lobj"
+      fi
+
+      func_show_eval_locale "$command"	\
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+      if test warn = "$need_locks" &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support '-c' and '-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	func_show_eval '$MV "$output_obj" "$lobj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+
+      # Allow error messages only from the first compilation.
+      if test yes = "$suppress_opt"; then
+	suppress_output=' >/dev/null 2>&1'
+      fi
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test yes = "$build_old_libs"; then
+      if test yes != "$pic_mode"; then
+	# Don't build PIC code
+	command="$base_compile $qsrcfile$pie_flag"
+      else
+	command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test yes = "$compiler_c_o"; then
+	func_append command " -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      func_append command "$suppress_output"
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+      if test warn = "$need_locks" &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support '-c' and '-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	func_show_eval '$MV "$output_obj" "$obj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test no != "$need_locks"; then
+	removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $opt_mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to build PIC objects only
+  -prefer-non-pic   try to build non-PIC objects only
+  -shared           do not build a '.o' file suitable for static linking
+  -static           only build a '.o' file suitable for static linking
+  -Wc,FLAG          pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to '-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the '--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the 'install' or 'cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
+  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  use a list of object files found in FILE to specify objects
+  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+  -Wc,FLAG
+  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
+  -Wl,FLAG
+  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
+  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with '-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in '.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
+only library objects ('.lo' files) may be specified, and '-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
+using 'ar' and 'ranlib', or on Windows using 'lib'.
+
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode '$opt_mode'"
+        ;;
+    esac
+
+    echo
+    $ECHO "Try '$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+  if test : = "$opt_help"; then
+    func_mode_help
+  else
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	func_mode_help
+      done
+    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	echo
+	func_mode_help
+      done
+    } |
+    $SED '1d
+      /^When reporting/,/^Report/{
+	H
+	d
+      }
+      $x
+      /information about other modes/d
+      /more detailed .*MODE/d
+      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+  fi
+  exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $debug_cmd
+
+    # The first argument is the command name.
+    cmd=$nonopt
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $opt_dlopen; do
+      test -f "$file" \
+	|| func_fatal_help "'$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "'$lib' is not a valid libtool archive"
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+	func_source "$file"
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && \
+	    func_warning "'$file' was not linked with '-export-dynamic'"
+	  continue
+	fi
+
+	func_dirname "$file" "" "."
+	dir=$func_dirname_result
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  func_append dir "/$objdir"
+	else
+	  if test ! -f "$dir/$dlname"; then
+	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	func_dirname "$file" "" "."
+	dir=$func_dirname_result
+	;;
+
+      *)
+	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir=$absdir
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic=$magic
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -* | *.la | *.lo ) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if func_ltwrapper_script_p "$file"; then
+	  func_source "$file"
+	  # Transform arg to wrapped name.
+	  file=$progdir/$program
+	elif func_ltwrapper_executable_p "$file"; then
+	  func_ltwrapper_scriptname "$file"
+	  func_source "$func_ltwrapper_scriptname_result"
+	  # Transform arg to wrapped name.
+	  file=$progdir/$program
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_append_quoted args "$file"
+    done
+
+    if $opt_dry_run; then
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    else
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+	eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+	      else
+		$lt_unset $lt_var
+	      fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd=\$cmd$args
+    fi
+}
+
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $debug_cmd
+
+    libs=
+    libdirs=
+    admincmds=
+
+    for opt in "$nonopt" ${1+"$@"}
+    do
+      if test -d "$opt"; then
+	func_append libdirs " $opt"
+
+      elif test -f "$opt"; then
+	if func_lalib_unsafe_p "$opt"; then
+	  func_append libs " $opt"
+	else
+	  func_warning "'$opt' is not a valid libtool archive"
+	fi
+
+      else
+	func_fatal_error "invalid argument '$opt'"
+      fi
+    done
+
+    if test -n "$libs"; then
+      if test -n "$lt_sysroot"; then
+        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+      else
+        sysroot_cmd=
+      fi
+
+      # Remove sysroot references
+      if $opt_dry_run; then
+        for lib in $libs; do
+          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
+        done
+      else
+        tmpdir=`func_mktempdir`
+        for lib in $libs; do
+	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	    > $tmpdir/tmp-la
+	  mv -f $tmpdir/tmp-la $lib
+	done
+        ${RM}r "$tmpdir"
+      fi
+    fi
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $opt_dry_run || eval "$cmds" || func_append admincmds "
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    $opt_quiet && exit $EXIT_SUCCESS
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      echo "----------------------------------------------------------------------"
+      echo "Libraries have been installed in:"
+      for libdir in $libdirs; do
+	$ECHO "   $libdir"
+      done
+      echo
+      echo "If you ever happen to want to link against installed libraries"
+      echo "in a given directory, LIBDIR, you must either use libtool, and"
+      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
+      echo "flag during linking and do at least one of the following:"
+      if test -n "$shlibpath_var"; then
+	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
+	echo "     during execution"
+      fi
+      if test -n "$runpath_var"; then
+	echo "   - add LIBDIR to the '$runpath_var' environment variable"
+	echo "     during linking"
+      fi
+      if test -n "$hardcode_libdir_flag_spec"; then
+	libdir=LIBDIR
+	eval flag=\"$hardcode_libdir_flag_spec\"
+
+	$ECHO "   - use the '$flag' linker flag"
+      fi
+      if test -n "$admincmds"; then
+	$ECHO "   - have your system administrator run these commands:$admincmds"
+      fi
+      if test -f /etc/ld.so.conf; then
+	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
+      fi
+      echo
+
+      echo "See any operating system documentation about shared libraries for"
+      case $host in
+	solaris2.[6789]|solaris2.1[0-9])
+	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	  echo "pages."
+	  ;;
+	*)
+	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
+	  ;;
+      esac
+      echo "----------------------------------------------------------------------"
+    fi
+    exit $EXIT_SUCCESS
+}
+
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $debug_cmd
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
+       # Allow the use of GNU shtool's install command.
+       case $nonopt in *shtool*) :;; *) false;; esac
+    then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    func_append install_prog "$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
+    case " $install_prog " in
+      *[\\\ /]cp\ *) install_cp=: ;;
+      *) install_cp=false ;;
+    esac
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=false
+    stripme=
+    no_mode=:
+    for arg
+    do
+      arg2=
+      if test -n "$dest"; then
+	func_append files " $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=: ;;
+      -f)
+	if $install_cp; then :; else
+	  prev=$arg
+	fi
+	;;
+      -g | -m | -o)
+	prev=$arg
+	;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
+	    arg2=$install_override_mode
+	    no_mode=false
+	  fi
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      func_append install_prog " $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+	func_quote_for_eval "$arg2"
+      fi
+      func_append install_shared_prog " $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the '$prev' option requires an argument"
+
+    if test -n "$install_override_mode" && $no_mode; then
+      if $install_cp; then :; else
+	func_quote_for_eval "$install_override_mode"
+	func_append install_shared_prog " -m $func_quote_for_eval_result"
+      fi
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	func_fatal_help "no file or destination specified"
+      else
+	func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=:
+    if $isdir; then
+      destdir=$dest
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir=$func_dirname_result
+      destname=$func_basename_result
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+	func_fatal_help "'$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  func_fatal_help "'$destdir' must be an absolute directory name"
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic=$magic
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	func_append staticlibs " $file"
+	;;
+
+      *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "'$file' is not a valid libtool archive"
+
+	library_names=
+	old_library=
+	relink_command=
+	func_source "$file"
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) func_append current_libdirs " $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) func_append future_libdirs " $libdir" ;;
+	  esac
+	fi
+
+	func_dirname "$file" "/" ""
+	dir=$func_dirname_result
+	func_append dir "$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  test "$inst_prefix_dir" = "$destdir" && \
+	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  func_warning "relinking '$file'"
+	  func_show_eval "$relink_command" \
+	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names; shift
+	if test -n "$1"; then
+	  realname=$1
+	  shift
+
+	  srcname=$realname
+	  test -n "$relink_command" && srcname=${realname}T
+
+	  # Install the shared library and build the symlinks.
+	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+	      'exit $?'
+	  tstripme=$stripme
+	  case $host_os in
+	  cygwin* | mingw* | pw32* | cegcc*)
+	    case $realname in
+	    *.dll.a)
+	      tstripme=
+	      ;;
+	    esac
+	    ;;
+	  os2*)
+	    case $realname in
+	    *_dll.a)
+	      tstripme=
+	      ;;
+	    esac
+	    ;;
+	  esac
+	  if test -n "$tstripme" && test -n "$striplib"; then
+	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try 'ln -sf' first, because the 'ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      test "$linkname" != "$realname" \
+		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib=$destdir/$realname
+	  func_execute_cmds "$postinstall_cmds" 'exit $?'
+	fi
+
+	# Install the pseudo-library for information purposes.
+	func_basename "$file"
+	name=$func_basename_result
+	instname=$dir/${name}i
+	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile=$destdir/$destname
+	else
+	  func_basename "$file"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  func_lo2o "$destfile"
+	  staticdest=$func_lo2o_result
+	  ;;
+	*.$objext)
+	  staticdest=$destfile
+	  destfile=
+	  ;;
+	*)
+	  func_fatal_help "cannot copy a libtool object to '$destfile'"
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	test -n "$destfile" && \
+	  func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+	# Install the old object if enabled.
+	if test yes = "$build_old_libs"; then
+	  # Deduce the name of the old-style object file.
+	  func_lo2o "$file"
+	  staticobj=$func_lo2o_result
+	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile=$destdir/$destname
+	else
+	  func_basename "$file"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      func_stripname '' '.exe' "$file"
+	      file=$func_stripname_result
+	      stripped_ext=.exe
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin* | *mingw*)
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      wrapper=$func_ltwrapper_scriptname_result
+	    else
+	      func_stripname '' '.exe' "$file"
+	      wrapper=$func_stripname_result
+	    fi
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if func_ltwrapper_script_p "$wrapper"; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  func_source "$wrapper"
+
+	  # Check the variables that should have been set.
+	  test -z "$generated_by_libtool_version" && \
+	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
+
+	  finalize=:
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      func_source "$lib"
+	    fi
+	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      func_warning "'$lib' has not been installed in '$libdir'"
+	      finalize=false
+	    fi
+	  done
+
+	  relink_command=
+	  func_source "$wrapper"
+
+	  outputname=
+	  if test no = "$fast_install" && test -n "$relink_command"; then
+	    $opt_dry_run || {
+	      if $finalize; then
+	        tmpdir=`func_mktempdir`
+		func_basename "$file$stripped_ext"
+		file=$func_basename_result
+	        outputname=$tmpdir/$file
+	        # Replace the output file specification.
+	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+	        $opt_quiet || {
+	          func_quote_for_expand "$relink_command"
+		  eval "func_echo $func_quote_for_expand_result"
+	        }
+	        if eval "$relink_command"; then :
+	          else
+		  func_error "error: relink '$file' with the above command before installing it"
+		  $opt_dry_run || ${RM}r "$tmpdir"
+		  continue
+	        fi
+	        file=$outputname
+	      else
+	        func_warning "cannot relink '$file'"
+	      fi
+	    }
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    func_stripname '' '.exe' "$destfile"
+	    destfile=$func_stripname_result
+	    ;;
+	  esac
+	  ;;
+	esac
+	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+	$opt_dry_run || if test -n "$outputname"; then
+	  ${RM}r "$tmpdir"
+	fi
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name=$func_basename_result
+
+      # Set up the ranlib parameters.
+      oldlib=$destdir/$name
+      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+      tool_oldlib=$func_to_tool_file_result
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run '$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $debug_cmd
+
+    my_outputname=$1
+    my_originator=$2
+    my_pic_p=${3-false}
+    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	my_dlsyms=${my_outputname}S.c
+      else
+	func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+	# Discover the nlist of each of the dlfiles.
+	nlist=$output_objdir/$my_outputname.nm
+
+	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+	# Parse the name list into a source file.
+	func_verbose "creating $output_objdir/$my_dlsyms"
+
+	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
+/* External symbol declarations for the compiler. */\
+"
+
+	if test yes = "$dlself"; then
+	  func_verbose "generating symbol list for '$output'"
+
+	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+	  # Add our own program objects to the symbol list.
+	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	  for progfile in $progfiles; do
+	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
+	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -n "$exclude_expsyms"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  if test -n "$export_symbols_regex"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  # Prepare the list of exported symbols
+	  if test -z "$export_symbols"; then
+	    export_symbols=$output_objdir/$outputname.exp
+	    $opt_dry_run || {
+	      $RM $export_symbols
+	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      case $host in
+	      *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+	        ;;
+	      esac
+	    }
+	  else
+	    $opt_dry_run || {
+	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	      case $host in
+	        *cygwin* | *mingw* | *cegcc* )
+	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+	          ;;
+	      esac
+	    }
+	  fi
+	fi
+
+	for dlprefile in $dlprefiles; do
+	  func_verbose "extracting global C symbols from '$dlprefile'"
+	  func_basename "$dlprefile"
+	  name=$func_basename_result
+          case $host in
+	    *cygwin* | *mingw* | *cegcc* )
+	      # if an import library, we need to obtain dlname
+	      if func_win32_import_lib_p "$dlprefile"; then
+	        func_tr_sh "$dlprefile"
+	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
+	        dlprefile_dlbasename=
+	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+	          # Use subshell, to avoid clobbering current variable values
+	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+	          if test -n "$dlprefile_dlname"; then
+	            func_basename "$dlprefile_dlname"
+	            dlprefile_dlbasename=$func_basename_result
+	          else
+	            # no lafile. user explicitly requested -dlpreopen <import library>.
+	            $sharedlib_from_linklib_cmd "$dlprefile"
+	            dlprefile_dlbasename=$sharedlib_from_linklib_result
+	          fi
+	        fi
+	        $opt_dry_run || {
+	          if test -n "$dlprefile_dlbasename"; then
+	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+	          else
+	            func_warning "Could not compute DLL name from $name"
+	            eval '$ECHO ": $name " >> "$nlist"'
+	          fi
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+	        }
+	      else # not an import lib
+	        $opt_dry_run || {
+	          eval '$ECHO ": $name " >> "$nlist"'
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	        }
+	      fi
+	    ;;
+	    *)
+	      $opt_dry_run || {
+	        eval '$ECHO ": $name " >> "$nlist"'
+	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	      }
+	    ;;
+          esac
+	done
+
+	$opt_dry_run || {
+	  # Make sure we have at least an empty file.
+	  test -f "$nlist" || : > "$nlist"
+
+	  if test -n "$exclude_expsyms"; then
+	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	    $MV "$nlist"T "$nlist"
+	  fi
+
+	  # Try sorting and uniquifying the output.
+	  if $GREP -v "^: " < "$nlist" |
+	      if sort -k 3 </dev/null >/dev/null 2>&1; then
+		sort -k 3
+	      else
+		sort +2
+	      fi |
+	      uniq > "$nlist"S; then
+	    :
+	  else
+	    $GREP -v "^: " < "$nlist" > "$nlist"S
+	  fi
+
+	  if test -f "$nlist"S; then
+	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+	  else
+	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	  fi
+
+	  func_show_eval '$RM "${nlist}I"'
+	  if test -n "$global_symbol_to_import"; then
+	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+	  fi
+
+	  echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+  for (; symbol->name; ++symbol)
+    {"
+	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+	    echo >> "$output_objdir/$my_dlsyms" "\
+    }
+}"
+	  fi
+	  echo >> "$output_objdir/$my_dlsyms" "\
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{ {\"$my_originator\", (void *) 0},"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+  {\"@INIT@\", (void *) &lt_syminit},"
+	  fi
+
+	  case $need_lib_prefix in
+	  no)
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  *)
+	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  esac
+	  echo >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	} # !$opt_dry_run
+
+	pic_flag_for_symtable=
+	case "$compile_command " in
+	*" -static "*) ;;
+	*)
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+	  *-*-hpux*)
+	    pic_flag_for_symtable=" $pic_flag"  ;;
+	  *)
+	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
+	    ;;
+	  esac
+	  ;;
+	esac
+	symtab_cflags=
+	for arg in $LTCFLAGS; do
+	  case $arg in
+	  -pie | -fpie | -fPIE) ;;
+	  *) func_append symtab_cflags " $arg" ;;
+	  esac
+	done
+
+	# Now compile the dynamic symbol file.
+	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+	# Clean up the generated files.
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
+
+	# Transform the symbol file into the correct name.
+	symfileobj=$output_objdir/${my_outputname}S.$objext
+	case $host in
+	*cygwin* | *mingw* | *cegcc* )
+	  if test -f "$output_objdir/$my_outputname.def"; then
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	  else
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  fi
+	  ;;
+	*)
+	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  ;;
+	esac
+	;;
+      *)
+	func_fatal_error "unknown suffix for '$my_dlsyms'"
+	;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+  $debug_cmd
+
+  win32_libid_type=unknown
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+      case $nm_interface in
+      "MS dumpbin")
+	if func_cygming_ms_implib_p "$1" ||
+	   func_cygming_gnu_implib_p "$1"
+	then
+	  win32_nmres=import
+	else
+	  win32_nmres=
+	fi
+	;;
+      *)
+	func_to_tool_file "$1" func_convert_file_msys_to_w32
+	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	  $SED -n -e '
+	    1,100{
+		/ I /{
+		    s|.*|import|
+		    p
+		    q
+		}
+	    }'`
+	;;
+      esac
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+  $debug_cmd
+
+  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+  $debug_cmd
+
+  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+    $SED '/^Contents of section '"$match_literal"':/{
+      # Place marker at beginning of archive member dllname section
+      s/.*/====MARK====/
+      p
+      d
+    }
+    # These lines can sometimes be longer than 43 characters, but
+    # are always uninteresting
+    /:[	 ]*file format pe[i]\{,1\}-/d
+    /^In archive [^:]*:/d
+    # Ensure marker is printed
+    /^====MARK====/p
+    # Remove all lines with less than 43 characters
+    /^.\{43\}/!d
+    # From remaining lines, remove first 43 characters
+    s/^.\{43\}//' |
+    $SED -n '
+      # Join marker and all lines until next marker into a single line
+      /^====MARK====/ b para
+      H
+      $ b para
+      b
+      :para
+      x
+      s/\n//g
+      # Remove the marker
+      s/^====MARK====//
+      # Remove trailing dots and whitespace
+      s/[\. \t]*$//
+      # Print
+      /./p' |
+    # we now have a list, one entry per line, of the stringified
+    # contents of the appropriate section of all members of the
+    # archive that possess that section. Heuristic: eliminate
+    # all those that have a first or second character that is
+    # a '.' (that is, objdump's representation of an unprintable
+    # character.) This should work for all archives with less than
+    # 0x302f exports -- but will fail for DLLs whose name actually
+    # begins with a literal '.' or a single character followed by
+    # a '.'.
+    #
+    # Of those that remain, print the first one.
+    $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+  $debug_cmd
+
+  if func_cygming_gnu_implib_p "$1"; then
+    # binutils import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+  elif func_cygming_ms_implib_p "$1"; then
+    # ms-generated import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+  else
+    # unknown
+    sharedlib_from_linklib_result=
+  fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $debug_cmd
+
+    f_ex_an_ar_dir=$1; shift
+    f_ex_an_ar_oldlib=$1
+    if test yes = "$lock_old_archive_extraction"; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+		   'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test yes = "$lock_old_archive_extraction"; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $debug_cmd
+
+    my_gentop=$1; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=
+    my_xlib=
+    my_xabs=
+    my_xdir=
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib=$func_basename_result
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+	*" $my_xlib_u "*)
+	  func_arith $extracted_serial + 1
+	  extracted_serial=$func_arith_result
+	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
+	*) break ;;
+	esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir=$my_gentop/$my_xlib_u
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+	func_verbose "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	$opt_dry_run || {
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  func_basename "$darwin_archive"
+	  darwin_base_archive=$func_basename_result
+	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+	  if test -n "$darwin_arches"; then
+	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches; do
+	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
+	      cd "$darwin_curdir"
+	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
+	    done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+	      $LIPO -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    $RM -rf unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd $darwin_orig_dir
+	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	} # !$opt_dry_run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+	;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+    done
+
+    func_extract_archives_result=$my_oldobjs
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory where it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+	func_emit_wrapper_arg1=${1-no}
+
+	$ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    file=\"\$0\""
+
+    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+    ECHO=\"$qECHO\"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ that is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options that match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  case \" \$* \" in
+  *\\ --lt-*)
+    for lt_wr_arg
+    do
+      case \$lt_wr_arg in
+      --lt-*) ;;
+      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+      esac
+      shift
+    done ;;
+  esac
+  func_exec_program_core \${1+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test yes = "$fast_install"; then
+	  $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+	  $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	\$ECHO \"\$relink_command_output\" >&2
+	$RM \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+	else
+	  $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# fixup the dll searchpath if we need to.
+	#
+	# Fix the DLL searchpath if we need to.  Do this before prepending
+	# to shlibpath, because on Windows, both are PATH and uninstalled
+	# libraries must come first.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	# Export our shlibpath_var if we have one.
+	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	$ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+      func_exec_program \${1+\"\$@\"}
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+	cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+*/
+EOF
+	    cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
+/* declarations of non-ANSI functions */
+#if defined __MINGW32__
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined __CYGWIN__
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined other_platform || defined ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined _MSC_VER
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+# define S_IXUSR _S_IEXEC
+#elif defined __MINGW32__
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+#elif defined __CYGWIN__
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined other platforms ... */
+#endif
+
+#if defined PATH_MAX
+# define LT_PATHMAX PATH_MAX
+#elif defined MAXPATHLEN
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+  defined __OS2__
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free (stale); stale = 0; } \
+} while (0)
+
+#if defined LT_DEBUGWRAPPER
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+	    cat <<EOF
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_path "$temp_rpath"
+	      cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test -n "$dllsearchpath"; then
+              func_to_host_path "$dllsearchpath:"
+	      cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test yes = "$fast_install"; then
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+	    else
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+	    fi
+
+
+	    cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  int rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  newargz = XMALLOC (char *, (size_t) argc + 1);
+
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (STREQ (argv[i], dumpscript_opt))
+	{
+EOF
+	    case $host in
+	      *mingw* | *cygwin* )
+		# make stdout use "unix" line endings
+		echo "          setmode(1,_O_BINARY);"
+		;;
+	      esac
+
+	    cat <<"EOF"
+	  lt_dump_script (stdout);
+	  return 0;
+	}
+      if (STREQ (argv[i], debug_opt))
+	{
+          lt_debug = 1;
+          continue;
+	}
+      if (STREQ (argv[i], ltwrapper_option_prefix))
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+		    "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+EOF
+	    cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
+EOF
+	    cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+		  tmp_pathspec);
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+		  actual_cwrapper_path);
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(main) libtool target name: %s\n",
+		  target_name);
+EOF
+
+	    cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+	    cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+	    case $host_os in
+	      mingw*)
+	    cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+	*p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+	*p = '/';
+      }
+  }
+EOF
+	    ;;
+	    esac
+
+	    cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
+     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+     because on Windows, both *_VARNAMEs are PATH but uninstalled
+     libraries must come first. */
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+		  nonnull (lt_argv_zero));
+  for (i = 0; i < newargc; i++)
+    {
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+		      i, nonnull (newargz[i]));
+    }
+
+EOF
+
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  newargz = prepare_spawn (newargz);
+  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      lt_debugprintf (__FILE__, __LINE__,
+		      "(main) failed to launch target \"%s\": %s\n",
+		      lt_argv_zero, nonnull (strerror (errno)));
+      return 127;
+    }
+  return rval;
+EOF
+		;;
+	      *)
+		cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+		;;
+	    esac
+
+	    cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+			  string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  size_t tmp_len;
+  char *concat_name;
+
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+	return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+	{
+	  concat_name = xstrdup (wrapper);
+	  if (check_executable (concat_name))
+	    return concat_name;
+	  XFREE (concat_name);
+	}
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+	has_slash = 1;
+	break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+	{
+	  for (p = path; *p; p = p_next)
+	    {
+	      const char *q;
+	      size_t p_len;
+	      for (q = p; *q; q++)
+		if (IS_PATH_SEPARATOR (*q))
+		  break;
+	      p_len = (size_t) (q - p);
+	      p_next = (*q == '\0' ? q : q + 1);
+	      if (p_len == 0)
+		{
+		  /* empty path: current directory */
+		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              nonnull (strerror (errno)));
+		  tmp_len = strlen (tmp);
+		  concat_name =
+		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, tmp, tmp_len);
+		  concat_name[tmp_len] = '/';
+		  strcpy (concat_name + tmp_len + 1, wrapper);
+		}
+	      else
+		{
+		  concat_name =
+		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, p, p_len);
+		  concat_name[p_len] = '/';
+		  strcpy (concat_name + p_len + 1, wrapper);
+		}
+	      if (check_executable (concat_name))
+		return concat_name;
+	      XFREE (concat_name);
+	    }
+	}
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      lt_debugprintf (__FILE__, __LINE__,
+		      "checking path component for symlinks: %s\n",
+		      tmp_pathspec);
+      if (lstat (tmp_pathspec, &s) == 0)
+	{
+	  if (S_ISLNK (s.st_mode) != 0)
+	    {
+	      has_symlinks = 1;
+	      break;
+	    }
+
+	  /* search backwards for last DIR_SEPARATOR */
+	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    p--;
+	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    {
+	      /* no more DIR_SEPARATORS left */
+	      break;
+	    }
+	  *p = '\0';
+	}
+      else
+	{
+	  lt_fatal (__FILE__, __LINE__,
+		    "error accessing file \"%s\": %s",
+		    tmp_pathspec, nonnull (strerror (errno)));
+	}
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal (__FILE__, __LINE__,
+		"could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (STREQ (str, pat))
+	*str = '\0';
+    }
+  return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+	       int line, const char *mode,
+	       const char *message, va_list ap)
+{
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+  va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    size_t len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      size_t orig_value_len = strlen (orig_value);
+      size_t add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      size_t len = strlen (new_value);
+      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[--len] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+EOF
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+	new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+	{
+	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+	  size_t length;
+	  unsigned int backslashes;
+	  const char *s;
+	  char *quoted_string;
+	  char *p;
+
+	  length = 0;
+	  backslashes = 0;
+	  if (quote_around)
+	    length++;
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		length += backslashes + 1;
+	      length++;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    length += backslashes + 1;
+
+	  quoted_string = XMALLOC (char, length + 1);
+
+	  p = quoted_string;
+	  backslashes = 0;
+	  if (quote_around)
+	    *p++ = '"';
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		{
+		  unsigned int j;
+		  for (j = backslashes + 1; j > 0; j--)
+		    *p++ = '\\';
+		}
+	      *p++ = c;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    {
+	      unsigned int j;
+	      for (j = backslashes; j > 0; j--)
+		*p++ = '\\';
+	      *p++ = '"';
+	    }
+	  *p = '\0';
+
+	  new_argv[i] = quoted_string;
+	}
+      else
+	new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+		;;
+	    esac
+
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+	    func_emit_wrapper yes |
+	      $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
+            cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $debug_cmd
+
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+    $debug_cmd
+
+    case " $compile_command " in
+    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+      suncc_use_cstd_abi=no
+      ;;
+    *)
+      suncc_use_cstd_abi=yes
+      ;;
+    esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $debug_cmd
+
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # what system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll that has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args=$nonopt
+    base_compile="$nonopt $@"
+    compile_command=$nonopt
+    finalize_command=$nonopt
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+    new_inherited_linker_flags=
+
+    avoid_version=no
+    bindir=
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    os2dllname=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=false
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+    weak_libs=
+    single_module=$wl-single_module
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -shared)
+	test yes != "$build_libtool_libs" \
+	  && func_fatal_configuration "cannot build a shared library"
+	build_old_libs=no
+	break
+	;;
+      -all-static | -static | -static-libtool-libs)
+	case $arg in
+	-all-static)
+	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
+	    func_warning "complete static linking is impossible in this configuration"
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	-static)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=built
+	  ;;
+	-static-libtool-libs)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	esac
+	build_libtool_libs=no
+	build_old_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg=$1
+      shift
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  func_append compile_command " @OUTPUT@"
+	  func_append finalize_command " @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	bindir)
+	  bindir=$arg
+	  prev=
+	  continue
+	  ;;
+	dlfiles|dlprefiles)
+	  $preload || {
+	    # Add the symbol object into the linking commands.
+	    func_append compile_command " @SYMFILE@"
+	    func_append finalize_command " @SYMFILE@"
+	    preload=:
+	  }
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test no = "$dlself"; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test dlprefiles = "$prev"; then
+	      dlself=yes
+	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test dlfiles = "$prev"; then
+	      func_append dlfiles " $arg"
+	    else
+	      func_append dlprefiles " $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols=$arg
+	  test -f "$arg" \
+	    || func_fatal_error "symbol file '$arg' does not exist"
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex=$arg
+	  prev=
+	  continue
+	  ;;
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+		*" $qarg.ltframework "*) ;;
+		*) func_append deplibs " $qarg.ltframework" # this is fixed later
+		   ;;
+	      esac
+	      ;;
+	  esac
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir=$arg
+	  prev=
+	  continue
+	  ;;
+	mllvm)
+	  # Clang does not use LLVM to link, so we can simply discard any
+	  # '-mllvm $arg' options when doing the link step.
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat "$save_arg"`
+	    do
+#	      func_append moreargs " $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if func_lalib_unsafe_p "$arg"; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		func_source "$arg"
+
+		if test -z "$pic_object" ||
+		   test -z "$non_pic_object" ||
+		   test none = "$pic_object" &&
+		   test none = "$non_pic_object"; then
+		  func_fatal_error "cannot find name of object for '$arg'"
+		fi
+
+		# Extract subdirectory from the argument.
+		func_dirname "$arg" "/" ""
+		xdir=$func_dirname_result
+
+		if test none != "$pic_object"; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object=$xdir$pic_object
+
+		  if test dlfiles = "$prev"; then
+		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+		      func_append dlfiles " $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test dlprefiles = "$prev"; then
+		    # Preload the old-style object.
+		    func_append dlprefiles " $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  func_append libobjs " $pic_object"
+		  arg=$pic_object
+		fi
+
+		# Non-PIC object.
+		if test none != "$non_pic_object"; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object=$xdir$non_pic_object
+
+		  # A standard non-PIC object
+		  func_append non_pic_objects " $non_pic_object"
+		  if test -z "$pic_object" || test none = "$pic_object"; then
+		    arg=$non_pic_object
+		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object=$pic_object
+		  func_append non_pic_objects " $non_pic_object"
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if $opt_dry_run; then
+		  # Extract subdirectory from the argument.
+		  func_dirname "$arg" "/" ""
+		  xdir=$func_dirname_result
+
+		  func_lo2o "$arg"
+		  pic_object=$xdir$objdir/$func_lo2o_result
+		  non_pic_object=$xdir$func_lo2o_result
+		  func_append libobjs " $pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+	        else
+		  func_fatal_error "'$arg' is not a valid libtool object"
+		fi
+	      fi
+	    done
+	  else
+	    func_fatal_error "link input file '$arg' does not exist"
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	os2dllname)
+	  os2dllname=$arg
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex=$arg
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release=-$arg
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    func_fatal_error "only absolute run-paths are allowed"
+	    ;;
+	  esac
+	  if test rpath = "$prev"; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) func_append rpath " $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) func_append xrpath " $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	shrext)
+	  shrext_cmds=$arg
+	  prev=
+	  continue
+	  ;;
+	weak)
+	  func_append weak_libs " $arg"
+	  prev=
+	  continue
+	  ;;
+	xcclinker)
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xcompiler)
+	  func_append compiler_flags " $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $wl$qarg"
+	  prev=
+	  func_append compile_command " $wl$qarg"
+	  func_append finalize_command " $wl$qarg"
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg=$arg
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  # See comment for -static flag below, for more details.
+	  func_append compile_command " $link_static_flag"
+	  func_append finalize_command " $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	func_fatal_error "'-allow-undefined' must not be used because it is the default"
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -bindir)
+	prev=bindir
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  func_fatal_error "more than one -exported-symbols argument is not allowed"
+	fi
+	if test X-export-symbols = "X$arg"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -framework)
+	prev=framework
+	continue
+	;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	func_stripname "-L" '' "$arg"
+	if test -z "$func_stripname_result"; then
+	  if test "$#" -gt 0; then
+	    func_fatal_error "require no space between '-L' and '$1'"
+	  else
+	    func_fatal_error "need path for '-L' option"
+	  fi
+	fi
+	func_resolve_sysroot "$func_stripname_result"
+	dir=$func_resolve_sysroot_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  test -z "$absdir" && \
+	    func_fatal_error "cannot determine absolute directory name of '$dir'"
+	  dir=$absdir
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "* | *" $arg "*)
+	  # Will only happen for absolute or sysroot arguments
+	  ;;
+	*)
+	  # Preserve sysroot, but never include relative directories
+	  case $dir in
+	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+	    *) func_append deplibs " -L$dir" ;;
+	  esac
+	  func_append lib_search_path " $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  ::) dllsearchpath=$dir;;
+	  *) func_append dllsearchpath ":$dir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) func_append dllsearchpath ":$testbindir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test X-lc = "X$arg" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test X-lc = "X$arg" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    func_append deplibs " System.ltframework"
+	    continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    test X-lc = "X$arg" && continue
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test X-lc = "X$arg" && continue
+	    ;;
+	  esac
+	elif test X-lc_r = "X$arg"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	func_append deplibs " $arg"
+	continue
+	;;
+
+      -mllvm)
+	prev=mllvm
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot|--sysroot)
+	func_append compiler_flags " $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	prev=xcompiler
+	continue
+	;;
+
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+	func_append compiler_flags " $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	case "$new_inherited_linker_flags " in
+	    *" $arg "*) ;;
+	    * ) func_append new_inherited_linker_flags " $arg" ;;
+	esac
+	continue
+	;;
+
+      -multi_module)
+	single_module=$wl-multi_module
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # and Darwin in order for the loader to find any dlls it needs.
+	  func_warning "'-no-install' is ignored for $host"
+	  func_warning "assuming '-no-fast-install' instead"
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -os2dllname)
+	prev=os2dllname
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	func_stripname '-R' '' "$arg"
+	dir=$func_stripname_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	=*)
+	  func_stripname '=' '' "$dir"
+	  dir=$lt_sysroot$func_stripname_result
+	  ;;
+	*)
+	  func_fatal_error "only absolute run-paths are allowed"
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) func_append xrpath " $dir" ;;
+	esac
+	continue
+	;;
+
+      -shared)
+	# The effects of -shared are defined in a previous loop.
+	continue
+	;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -static | -static-libtool-libs)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -weak)
+        prev=weak
+	continue
+	;;
+
+      -Wc,*)
+	func_stripname '-Wc,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs=$IFS; IFS=,
+	for flag in $args; do
+	  IFS=$save_ifs
+          func_quote_for_eval "$flag"
+	  func_append arg " $func_quote_for_eval_result"
+	  func_append compiler_flags " $func_quote_for_eval_result"
+	done
+	IFS=$save_ifs
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Wl,*)
+	func_stripname '-Wl,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs=$IFS; IFS=,
+	for flag in $args; do
+	  IFS=$save_ifs
+          func_quote_for_eval "$flag"
+	  func_append arg " $wl$func_quote_for_eval_result"
+	  func_append compiler_flags " $wl$func_quote_for_eval_result"
+	  func_append linker_flags " $func_quote_for_eval_result"
+	done
+	IFS=$save_ifs
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # -msg_* for osf cc
+      -msg_*)
+	func_quote_for_eval "$arg"
+	arg=$func_quote_for_eval_result
+	;;
+
+      # Flags to be passed through unchanged, with rationale:
+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
+      # -r[0-9][0-9]*        specify processor for the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
+      # -q*                  compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+      # -F/path              path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # -fstack-protector*   stack protector flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      # --sysroot=*          for sysroot support
+      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -specs=*             GCC specs files
+      # -stdlib=*            select c++ std lib with clang
+      # -fsanitize=*         Clang/GCC memory and address sanitizer
+      # -fuse-ld=*           Linker select flags for GCC
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+      -specs=*|-fsanitize=*|-fuse-ld=*)
+        func_quote_for_eval "$arg"
+	arg=$func_quote_for_eval_result
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        func_append compiler_flags " $arg"
+        continue
+        ;;
+
+      -Z*)
+        if test os2 = "`expr $host : '.*\(os2\)'`"; then
+          # OS/2 uses -Zxxx to specify OS/2-specific options
+	  compiler_flags="$compiler_flags $arg"
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  case $arg in
+	  -Zlinker | -Zstack)
+	    prev=xcompiler
+	    ;;
+	  esac
+	  continue
+        else
+	  # Otherwise treat like 'Some other compiler flag' below
+	  func_quote_for_eval "$arg"
+	  arg=$func_quote_for_eval_result
+        fi
+	;;
+
+      # Some other compiler flag.
+      -* | +*)
+        func_quote_for_eval "$arg"
+	arg=$func_quote_for_eval_result
+	;;
+
+      *.$objext)
+	# A standard object.
+	func_append objs " $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if func_lalib_unsafe_p "$arg"; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  func_source "$arg"
+
+	  if test -z "$pic_object" ||
+	     test -z "$non_pic_object" ||
+	     test none = "$pic_object" &&
+	     test none = "$non_pic_object"; then
+	    func_fatal_error "cannot find name of object for '$arg'"
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  func_dirname "$arg" "/" ""
+	  xdir=$func_dirname_result
+
+	  test none = "$pic_object" || {
+	    # Prepend the subdirectory the object is found in.
+	    pic_object=$xdir$pic_object
+
+	    if test dlfiles = "$prev"; then
+	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+		func_append dlfiles " $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test dlprefiles = "$prev"; then
+	      # Preload the old-style object.
+	      func_append dlprefiles " $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    func_append libobjs " $pic_object"
+	    arg=$pic_object
+	  }
+
+	  # Non-PIC object.
+	  if test none != "$non_pic_object"; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object=$xdir$non_pic_object
+
+	    # A standard non-PIC object
+	    func_append non_pic_objects " $non_pic_object"
+	    if test -z "$pic_object" || test none = "$pic_object"; then
+	      arg=$non_pic_object
+	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object=$pic_object
+	    func_append non_pic_objects " $non_pic_object"
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if $opt_dry_run; then
+	    # Extract subdirectory from the argument.
+	    func_dirname "$arg" "/" ""
+	    xdir=$func_dirname_result
+
+	    func_lo2o "$arg"
+	    pic_object=$xdir$objdir/$func_lo2o_result
+	    non_pic_object=$xdir$func_lo2o_result
+	    func_append libobjs " $pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  else
+	    func_fatal_error "'$arg' is not a valid libtool object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	func_append deplibs " $arg"
+	func_append old_deplibs " $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	func_resolve_sysroot "$arg"
+	if test dlfiles = "$prev"; then
+	  # This library was specified with -dlopen.
+	  func_append dlfiles " $func_resolve_sysroot_result"
+	  prev=
+	elif test dlprefiles = "$prev"; then
+	  # The library was specified with -dlpreopen.
+	  func_append dlprefiles " $func_resolve_sysroot_result"
+	  prev=
+	else
+	  func_append deplibs " $func_resolve_sysroot_result"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	func_quote_for_eval "$arg"
+	arg=$func_quote_for_eval_result
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+      fi
+    done # argument parsing loop
+
+    test -n "$prev" && \
+      func_fatal_help "the '$prevarg' option requires an argument"
+
+    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    func_basename "$output"
+    outputname=$func_basename_result
+    libobjs_save=$libobjs
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    # Definition is injected by LT_CONFIG during libtool generation.
+    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
+    func_dirname "$output" "/" ""
+    output_objdir=$func_dirname_result$objdir
+    func_to_tool_file "$output_objdir/"
+    tool_output_objdir=$func_to_tool_file_result
+    # Create the object directory.
+    func_mkdir_p "$output_objdir"
+
+    # Determine the type of output
+    case $output in
+    "")
+      func_fatal_help "you must specify an output file"
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if $opt_preserve_dup_deps; then
+	case "$libs " in
+	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	esac
+      fi
+      func_append libs " $deplib"
+    done
+
+    if test lib = "$linkmode"; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if $opt_duplicate_compiler_generated_deps; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+	  esac
+	  func_append pre_post_deps " $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
+    case $linkmode in
+    lib)
+	passes="conv dlpreopen link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=false
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+
+    for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test lib,link = "$linkmode,$pass"; then
+	## FIXME: Find the place where the list is rebuilt in the wrong
+	##        order, and fix it there properly
+        tmp_deplibs=
+	for deplib in $deplibs; do
+	  tmp_deplibs="$deplib $tmp_deplibs"
+	done
+	deplibs=$tmp_deplibs
+      fi
+
+      if test lib,link = "$linkmode,$pass" ||
+	 test prog,scan = "$linkmode,$pass"; then
+	libs=$deplibs
+	deplibs=
+      fi
+      if test prog = "$linkmode"; then
+	case $pass in
+	dlopen) libs=$dlfiles ;;
+	dlpreopen) libs=$dlprefiles ;;
+	link)
+	  libs="$deplibs %DEPLIBS%"
+	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+	  ;;
+	esac
+      fi
+      if test lib,dlpreopen = "$linkmode,$pass"; then
+	# Collect and forward deplibs of preopened libtool libs
+	for lib in $dlprefiles; do
+	  # Ignore non-libtool-libs
+	  dependency_libs=
+	  func_resolve_sysroot "$lib"
+	  case $lib in
+	  *.la)	func_source "$func_resolve_sysroot_result" ;;
+	  esac
+
+	  # Collect preopened libtool deplibs, except any this library
+	  # has declared as weak libs
+	  for deplib in $dependency_libs; do
+	    func_basename "$deplib"
+            deplib_base=$func_basename_result
+	    case " $weak_libs " in
+	    *" $deplib_base "*) ;;
+	    *) func_append deplibs " $deplib" ;;
+	    esac
+	  done
+	done
+	libs=$dlprefiles
+      fi
+      if test dlopen = "$pass"; then
+	# Collect dlpreopened libraries
+	save_deplibs=$deplibs
+	deplibs=
+      fi
+
+      for deplib in $libs; do
+	lib=
+	found=false
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+	  if test prog,link = "$linkmode,$pass"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    func_append compiler_flags " $deplib"
+	    if test lib = "$linkmode"; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-l*)
+	  if test lib != "$linkmode" && test prog != "$linkmode"; then
+	    func_warning "'-l' is ignored for archives/objects"
+	    continue
+	  fi
+	  func_stripname '-l' '' "$deplib"
+	  name=$func_stripname_result
+	  if test lib = "$linkmode"; then
+	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+	  else
+	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+	  fi
+	  for searchdir in $searchdirs; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib=$searchdir/lib$name$search_ext
+	      if test -f "$lib"; then
+		if test .la = "$search_ext"; then
+		  found=:
+		else
+		  found=false
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if $found; then
+	    # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if func_lalib_p "$lib"; then
+		  library_names=
+		  old_library=
+		  func_source "$lib"
+		  for l in $old_library $library_names; do
+		    ll=$l
+		  done
+		  if test "X$ll" = "X$old_library"; then # only static version available
+		    found=false
+		    func_dirname "$lib" "" "."
+		    ladir=$func_dirname_result
+		    lib=$ladir/$old_library
+		    if test prog,link = "$linkmode,$pass"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+		;;
+	      *) ;;
+	      esac
+	    fi
+	  else
+	    # deplib doesn't seem to be a libtool library
+	    if test prog,link = "$linkmode,$pass"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  fi
+	  ;; # -l
+	*.ltframework)
+	  if test prog,link = "$linkmode,$pass"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test lib = "$linkmode"; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test conv = "$pass" && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    func_stripname '-L' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
+	    ;;
+	  prog)
+	    if test conv = "$pass"; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test scan = "$pass"; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    func_stripname '-L' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
+	    ;;
+	  *)
+	    func_warning "'-L' is ignored for archives/objects"
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test link = "$pass"; then
+	    func_stripname '-R' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    dir=$func_resolve_sysroot_result
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) func_append xrpath " $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la)
+	  func_resolve_sysroot "$deplib"
+	  lib=$func_resolve_sysroot_result
+	  ;;
+	*.$libext)
+	  if test conv = "$pass"; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    # Linking convenience modules into shared libraries is allowed,
+	    # but linking other static libraries is non-portable.
+	    case " $dlpreconveniencelibs " in
+	    *" $deplib "*) ;;
+	    *)
+	      valid_a_lib=false
+	      case $deplibs_check_method in
+		match_pattern*)
+		  set dummy $deplibs_check_method; shift
+		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		    valid_a_lib=:
+		  fi
+		;;
+		pass_all)
+		  valid_a_lib=:
+		;;
+	      esac
+	      if $valid_a_lib; then
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      else
+		echo
+		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because the file extensions .$libext of this argument makes me believe"
+		echo "*** that it is just a static archive that I should not use here."
+	      fi
+	      ;;
+	    esac
+	    continue
+	    ;;
+	  prog)
+	    if test link != "$pass"; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test conv = "$pass"; then
+	    deplibs="$deplib $deplibs"
+	  elif test prog = "$linkmode"; then
+	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      func_append newdlprefiles " $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      func_append newdlfiles " $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=:
+	  continue
+	  ;;
+	esac # case $deplib
+
+	$found || test -f "$lib" \
+	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$lib" \
+	  || func_fatal_error "'$lib' is not a valid libtool archive"
+
+	func_dirname "$lib" "" "."
+	ladir=$func_dirname_result
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	inherited_linker_flags=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+	avoidtemprpath=
+
+
+	# Read the .la file
+	func_source "$lib"
+
+	# Convert "-framework foo" to "foo.ltframework"
+	if test -n "$inherited_linker_flags"; then
+	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+	    case " $new_inherited_linker_flags " in
+	      *" $tmp_inherited_linker_flag "*) ;;
+	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+	    esac
+	  done
+	fi
+	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	if test lib,link = "$linkmode,$pass" ||
+	   test prog,scan = "$linkmode,$pass" ||
+	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
+	  test -n "$dlopen" && func_append dlfiles " $dlopen"
+	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+	fi
+
+	if test conv = "$pass"; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      func_fatal_error "cannot find name of link library for '$lib'"
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    func_append convenience " $ladir/$objdir/$old_library"
+	    func_append old_convenience " $ladir/$objdir/$old_library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+	      if $opt_preserve_dup_deps; then
+		case "$tmp_libs " in
+		*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+		esac
+	      fi
+	      func_append tmp_libs " $deplib"
+	    done
+	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
+	    func_fatal_error "'$lib' is not a convenience library"
+	  fi
+	  continue
+	fi # $pass = conv
+
+
+	# Get the name of the library we link against.
+	linklib=
+	if test -n "$old_library" &&
+	   { test yes = "$prefer_static_libs" ||
+	     test built,no = "$prefer_static_libs,$installed"; }; then
+	  linklib=$old_library
+	else
+	  for l in $old_library $library_names; do
+	    linklib=$l
+	  done
+	fi
+	if test -z "$linklib"; then
+	  func_fatal_error "cannot find name of link library for '$lib'"
+	fi
+
+	# This library was specified with -dlopen.
+	if test dlopen = "$pass"; then
+	  test -z "$libdir" \
+	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
+	  if test -z "$dlname" ||
+	     test yes != "$dlopen_support" ||
+	     test no = "$build_libtool_libs"
+	  then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    func_append dlprefiles " $lib $dependency_libs"
+	  else
+	    func_append newdlfiles " $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    func_warning "cannot determine absolute directory name of '$ladir'"
+	    func_warning "passing it literally to the linker, although it might fail"
+	    abs_ladir=$ladir
+	  fi
+	  ;;
+	esac
+	func_basename "$lib"
+	laname=$func_basename_result
+
+	# Find the relevant object directory and library name.
+	if test yes = "$installed"; then
+	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    func_warning "library '$lib' was moved."
+	    dir=$ladir
+	    absdir=$abs_ladir
+	    libdir=$abs_ladir
+	  else
+	    dir=$lt_sysroot$libdir
+	    absdir=$lt_sysroot$libdir
+	  fi
+	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
+	else
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir=$ladir
+	    absdir=$abs_ladir
+	    # Remove this search path later
+	    func_append notinst_path " $abs_ladir"
+	  else
+	    dir=$ladir/$objdir
+	    absdir=$abs_ladir/$objdir
+	    # Remove this search path later
+	    func_append notinst_path " $abs_ladir"
+	  fi
+	fi # $installed = yes
+	func_stripname 'lib' '.la' "$laname"
+	name=$func_stripname_result
+
+	# This library was specified with -dlpreopen.
+	if test dlpreopen = "$pass"; then
+	  if test -z "$libdir" && test prog = "$linkmode"; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
+	  fi
+	  case $host in
+	    # special handling for platforms with PE-DLLs.
+	    *cygwin* | *mingw* | *cegcc* )
+	      # Linker will automatically link against shared library if both
+	      # static and shared are present.  Therefore, ensure we extract
+	      # symbols from the import library if a shared library is present
+	      # (otherwise, the dlopen module name will be incorrect).  We do
+	      # this by putting the import library name into $newdlprefiles.
+	      # We recover the dlopen module name by 'saving' the la file
+	      # name in a special purpose variable, and (later) extracting the
+	      # dlname from the la file.
+	      if test -n "$dlname"; then
+	        func_tr_sh "$dir/$linklib"
+	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+	        func_append newdlprefiles " $dir/$linklib"
+	      else
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      fi
+	    ;;
+	    * )
+	      # Prefer using a static library (so that no silly _DYNAMIC symbols
+	      # are required to link).
+	      if test -n "$old_library"; then
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      # Otherwise, use the dlname, so that lt_dlopen finds it.
+	      elif test -n "$dlname"; then
+	        func_append newdlprefiles " $dir/$dlname"
+	      else
+	        func_append newdlprefiles " $dir/$linklib"
+	      fi
+	    ;;
+	  esac
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test lib = "$linkmode"; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test prog,link = "$linkmode,$pass"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+
+	if test prog = "$linkmode" && test link != "$pass"; then
+	  func_append newlib_search_path " $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=false
+	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
+	     test no = "$build_libtool_libs"; then
+	    linkalldeplibs=:
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) func_stripname '-L' '' "$deplib"
+	         func_resolve_sysroot "$func_stripname_result"
+	         func_append newlib_search_path " $func_resolve_sysroot_result"
+		 ;;
+	    esac
+	    # Need to link against all dependency_libs?
+	    if $linkalldeplibs; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if $opt_preserve_dup_deps; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test prog,link = "$linkmode,$pass"; then
+	  if test -n "$library_names" &&
+	     { { test no = "$prefer_static_libs" ||
+	         test built,yes = "$prefer_static_libs,$installed"; } ||
+	       test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
+	      # Make sure the rpath contains only unique directories.
+	      case $temp_rpath: in
+	      *"$absdir:"*) ;;
+	      *) func_append temp_rpath "$absdir:" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) func_append compile_rpath " $absdir" ;;
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append finalize_rpath " $libdir" ;;
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if $alldeplibs &&
+	     { test pass_all = "$deplibs_check_method" ||
+	       { test yes = "$build_libtool_libs" &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test built = "$use_static_libs" && test yes = "$installed"; then
+	  use_static_libs=no
+	fi
+	if test -n "$library_names" &&
+	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc* | *os2*)
+	      # No point in relinking DLLs because paths are not encoded
+	      func_append notinst_deplibs " $lib"
+	      need_relink=no
+	    ;;
+	  *)
+	    if test no = "$installed"; then
+	      func_append notinst_deplibs " $lib"
+	      need_relink=yes
+	    fi
+	    ;;
+	  esac
+	  # This is a shared library
+
+	  # Warn about portability, can't link against -module's on some
+	  # systems (darwin).  Don't bleat about dlopened modules though!
+	  dlopenmodule=
+	  for dlpremoduletest in $dlprefiles; do
+	    if test "X$dlpremoduletest" = "X$lib"; then
+	      dlopenmodule=$dlpremoduletest
+	      break
+	    fi
+	  done
+	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
+	    echo
+	    if test prog = "$linkmode"; then
+	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $ECHO "*** $linklib is not portable!"
+	  fi
+	  if test lib = "$linkmode" &&
+	     test yes = "$hardcode_into_libs"; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) func_append compile_rpath " $absdir" ;;
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append finalize_rpath " $libdir" ;;
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    shift
+	    realname=$1
+	    shift
+	    libname=`eval "\\$ECHO \"$libname_spec\""`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname=$dlname
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw* | *cegcc* | *os2*)
+	        func_arith $current - $age
+		major=$func_arith_result
+		versuffix=-$major
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname=$realname
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot=$soname
+	    func_basename "$soroot"
+	    soname=$func_basename_result
+	    func_stripname 'lib' '.dll' "$soname"
+	    newlib=libimp-$func_stripname_result.a
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      func_verbose "extracting exported symbol list from '$soname'"
+	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      func_verbose "generating import library for '$soname'"
+	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test no = "$hardcode_direct"; then
+		add=$dir/$linklib
+		case $host in
+		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir=-L$dir ;;
+		  *-*-darwin* )
+		    # if the lib is a (non-dlopened) module then we cannot
+		    # link against it, someone is ignoring the earlier warnings
+		    if /usr/bin/file -L $add 2> /dev/null |
+			 $GREP ": [^:]* bundle" >/dev/null; then
+		      if test "X$dlopenmodule" != "X$lib"; then
+			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
+			if test -z "$old_library"; then
+			  echo
+			  echo "*** And there doesn't seem to be a static archive available"
+			  echo "*** The link will probably fail, sorry"
+			else
+			  add=$dir/$old_library
+			fi
+		      elif test -n "$old_library"; then
+			add=$dir/$old_library
+		      fi
+		    fi
+		esac
+	      elif test no = "$hardcode_minus_L"; then
+		case $host in
+		*-*-sunos*) add_shlibpath=$dir ;;
+		esac
+		add_dir=-L$dir
+		add=-l$name
+	      elif test no = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test yes = "$hardcode_direct" &&
+	         test no = "$hardcode_direct_absolute"; then
+		add=$dir/$linklib
+	      elif test yes = "$hardcode_minus_L"; then
+		add_dir=-L$absdir
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case $libdir in
+		    [\\/]*)
+		      func_append add_dir " -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add=-l$name
+	      elif test yes = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test yes != "$lib_linked"; then
+	      func_fatal_configuration "unsupported hardcode properties"
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test prog = "$linkmode"; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test yes != "$hardcode_direct" &&
+		 test yes != "$hardcode_minus_L" &&
+		 test yes = "$hardcode_shlibpath_var"; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) func_append finalize_shlibpath "$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test yes = "$hardcode_direct" &&
+	       test no = "$hardcode_direct_absolute"; then
+	      add=$libdir/$linklib
+	    elif test yes = "$hardcode_minus_L"; then
+	      add_dir=-L$libdir
+	      add=-l$name
+	    elif test yes = "$hardcode_shlibpath_var"; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) func_append finalize_shlibpath "$libdir:" ;;
+	      esac
+	      add=-l$name
+	    elif test yes = "$hardcode_automatic"; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib"; then
+		add=$inst_prefix_dir$libdir/$linklib
+	      else
+		add=$libdir/$linklib
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir=-L$libdir
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case $libdir in
+		  [\\/]*)
+		    func_append add_dir " -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add=-l$name
+	    fi
+
+	    if test prog = "$linkmode"; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test prog = "$linkmode"; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test unsupported != "$hardcode_direct"; then
+	    test -n "$old_library" && linklib=$old_library
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test yes = "$build_libtool_libs"; then
+	  # Not a shared library
+	  if test pass_all != "$deplibs_check_method"; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    echo
+	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
+	    echo "*** I have the capability to make that library automatically link in when"
+	    echo "*** you link to this library.  But I can only do this if you have a"
+	    echo "*** shared version of the library, which you do not appear to have."
+	    if test yes = "$module"; then
+	      echo "*** But as you try to build a module library, libtool will still create "
+	      echo "*** a static module, that should work as long as the dlopening application"
+	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		echo
+		echo "*** However, this would only work if libtool was able to extract symbol"
+		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
+		echo "*** not find such a program.  So, this module is probably useless."
+		echo "*** 'nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test no = "$build_old_libs"; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test lib = "$linkmode"; then
+	  if test -n "$dependency_libs" &&
+	     { test yes != "$hardcode_into_libs" ||
+	       test yes = "$build_old_libs" ||
+	       test yes = "$link_static"; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) func_stripname '-R' '' "$libdir"
+	           temp_xrpath=$func_stripname_result
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) func_append xrpath " $temp_xrpath";;
+		   esac;;
+	      *) func_append temp_deplibs " $libdir";;
+	      esac
+	    done
+	    dependency_libs=$temp_deplibs
+	  fi
+
+	  func_append newlib_search_path " $absdir"
+	  # Link against this library
+	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    case $deplib in
+              -L*) func_stripname '-L' '' "$deplib"
+                   func_resolve_sysroot "$func_stripname_result";;
+              *) func_resolve_sysroot "$deplib" ;;
+            esac
+	    if $opt_preserve_dup_deps; then
+	      case "$tmp_libs " in
+	      *" $func_resolve_sysroot_result "*)
+                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $func_resolve_sysroot_result"
+	  done
+
+	  if test no != "$link_all_deplibs"; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      path=
+	      case $deplib in
+	      -L*) path=$deplib ;;
+	      *.la)
+	        func_resolve_sysroot "$deplib"
+	        deplib=$func_resolve_sysroot_result
+	        func_dirname "$deplib" "" "."
+		dir=$func_dirname_result
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    func_warning "cannot determine absolute directory name of '$dir'"
+		    absdir=$dir
+		  fi
+		  ;;
+		esac
+		if $GREP "^installed=no" $deplib > /dev/null; then
+		case $host in
+		*-*-darwin*)
+		  depdepl=
+		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names"; then
+		    for tmp in $deplibrary_names; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$absdir/$objdir/$depdepl"; then
+		      depdepl=$absdir/$objdir/$depdepl
+		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
+		      path=
+		    fi
+		  fi
+		  ;;
+		*)
+		  path=-L$absdir/$objdir
+		  ;;
+		esac
+		else
+		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  test -z "$libdir" && \
+		    func_fatal_error "'$deplib' is not a valid libtool archive"
+		  test "$absdir" != "$libdir" && \
+		    func_warning "'$deplib' seems to be moved"
+
+		  path=-L$absdir
+		fi
+		;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      if test link = "$pass"; then
+	if test prog = "$linkmode"; then
+	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+	else
+	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	fi
+      fi
+      dependency_libs=$newdependency_libs
+      if test dlpreopen = "$pass"; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test dlopen != "$pass"; then
+	test conv = "$pass" || {
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) func_append lib_search_path " $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	}
+
+	if test prog,link = "$linkmode,$pass"; then
+	  vars="compile_deplibs finalize_deplibs"
+	else
+	  vars=deplibs
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) func_append tmp_libs " $deplib" ;;
+	      esac
+	      ;;
+	    *) func_append tmp_libs " $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+
+      # Add Sun CC postdeps if required:
+      test CXX = "$tagname" && {
+        case $host_os in
+        linux*)
+          case `$CC -V 2>&1 | sed 5q` in
+          *Sun\ C*) # Sun C++ 5.9
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+
+        solaris*)
+          func_cc_basename "$CC"
+          case $func_cc_basename_result in
+          CC* | sunCC*)
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+        esac
+      }
+
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=
+	  ;;
+	esac
+	if test -n "$i"; then
+	  func_append tmp_libs " $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test prog = "$linkmode"; then
+      dlfiles=$newdlfiles
+    fi
+    if test prog = "$linkmode" || test lib = "$linkmode"; then
+      dlprefiles=$newdlprefiles
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for archives"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "'-l' and '-L' are ignored for archives" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "'-rpath' is ignored for archives"
+
+      test -n "$xrpath" && \
+	func_warning "'-R' is ignored for archives"
+
+      test -n "$vinfo" && \
+	func_warning "'-version-info/-version-number' is ignored for archives"
+
+      test -n "$release" && \
+	func_warning "'-release' is ignored for archives"
+
+      test -n "$export_symbols$export_symbols_regex" && \
+	func_warning "'-export-symbols' is ignored for archives"
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs=$output
+      func_append objs "$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form 'libNAME.la'.
+      case $outputname in
+      lib*)
+	func_stripname 'lib' '.la' "$outputname"
+	name=$func_stripname_result
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	test no = "$module" \
+	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
+
+	if test no != "$need_lib_prefix"; then
+	  # Add the "lib" prefix for modules if required
+	  func_stripname '' '.la' "$outputname"
+	  name=$func_stripname_result
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  func_stripname '' '.la' "$outputname"
+	  libname=$func_stripname_result
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test pass_all != "$deplibs_check_method"; then
+	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
+	else
+	  echo
+	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+	  $ECHO "*** objects $objs is not portable!"
+	  func_append libobjs " $objs"
+	fi
+      fi
+
+      test no = "$dlself" \
+	|| func_warning "'-dlopen self' is ignored for libtool libraries"
+
+      set dummy $rpath
+      shift
+      test 1 -lt "$#" \
+	&& func_warning "ignoring multiple '-rpath's for a libtool library"
+
+      install_libdir=$1
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test yes = "$build_libtool_libs"; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a '.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	test -n "$vinfo" && \
+	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
+
+	test -n "$release" && \
+	  func_warning "'-release' is ignored for convenience libraries"
+      else
+
+	# Parse the version information argument.
+	save_ifs=$IFS; IFS=:
+	set dummy $vinfo 0 0 0
+	shift
+	IFS=$save_ifs
+
+	test -n "$7" && \
+	  func_fatal_help "too many parameters to '-version-info'"
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+
+	case $vinfo_number in
+	yes)
+	  number_major=$1
+	  number_minor=$2
+	  number_revision=$3
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # that has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  # correct linux to gnu/linux during the next big refactor
+	  darwin|freebsd-elf|linux|osf|windows|none)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age=$number_minor
+	    revision=$number_revision
+	    ;;
+	  freebsd-aout|qnx|sunos)
+	    current=$number_major
+	    revision=$number_minor
+	    age=0
+	    ;;
+	  irix|nonstopux)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age=$number_minor
+	    revision=$number_minor
+	    lt_irix_increment=no
+	    ;;
+	  *)
+	    func_fatal_configuration "$modename: unknown library version type '$version_type'"
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current=$1
+	  revision=$2
+	  age=$3
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "CURRENT '$current' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $revision in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "REVISION '$revision' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $age in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "AGE '$age' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  func_error "AGE '$age' is greater than the current interface number '$current'"
+	  func_fatal_error "'$vinfo' is not valid version information"
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
+	  # Darwin ld doesn't like 0 for these options...
+	  func_arith $current + 1
+	  minor_current=$func_arith_result
+	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+          # On Darwin other compilers
+          case $CC in
+              nagfor*)
+                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+                  ;;
+              *)
+                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+                  ;;
+          esac
+	  ;;
+
+	freebsd-aout)
+	  major=.$current
+	  versuffix=.$current.$revision
+	  ;;
+
+	freebsd-elf)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
+	  ;;
+
+	irix | nonstopux)
+	  if test no = "$lt_irix_increment"; then
+	    func_arith $current - $age
+	  else
+	    func_arith $current - $age + 1
+	  fi
+	  major=$func_arith_result
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring=$verstring_prefix$major.$revision
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test 0 -ne "$loop"; do
+	    func_arith $revision - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring=$verstring_prefix$major.$iface:$verstring
+	  done
+
+	  # Before this point, $major must not contain '.'.
+	  major=.$major
+	  versuffix=$major.$revision
+	  ;;
+
+	linux) # correct to gnu/linux during the next big refactor
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
+	  ;;
+
+	osf)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=.$current.$age.$revision
+	  verstring=$current.$age.$revision
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test 0 -ne "$loop"; do
+	    func_arith $current - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring=$verstring:$iface.0
+	  done
+
+	  # Make executables depend on our current version.
+	  func_append verstring ":$current.0"
+	  ;;
+
+	qnx)
+	  major=.$current
+	  versuffix=.$current
+	  ;;
+
+	sco)
+	  major=.$current
+	  versuffix=.$current
+	  ;;
+
+	sunos)
+	  major=.$current
+	  versuffix=.$current.$revision
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 file systems.
+	  func_arith $current - $age
+	  major=$func_arith_result
+	  versuffix=-$major
+	  ;;
+
+	*)
+	  func_fatal_configuration "unknown library version type '$version_type'"
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring=0.0
+	    ;;
+	  esac
+	  if test no = "$need_version"; then
+	    versuffix=
+	  else
+	    versuffix=.0.0
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test yes,no = "$avoid_version,$need_version"; then
+	  major=
+	  versuffix=
+	  verstring=
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test yes = "$allow_undefined"; then
+	  if test unsupported = "$allow_undefined_flag"; then
+	    if test yes = "$build_old_libs"; then
+	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+	      build_libtool_libs=no
+	    else
+	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+	    fi
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag=$no_undefined_flag
+	fi
+
+      fi
+
+      func_generate_dlsyms "$libname" "$libname" :
+      func_append libobjs " $symfileobj"
+      test " " = "$libobjs" && libobjs=
+
+      if test relink != "$opt_mode"; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$ECHO "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext | *.gcno)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+	       if test -n "$precious_files_regex"; then
+		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+		 then
+		   continue
+		 fi
+	       fi
+	       func_append removelist " $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	test -n "$removelist" && \
+	  func_show_eval "${RM}r \$removelist"
+      fi
+
+      # Now set the variables for building old libraries.
+      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
+	func_append oldlibs " $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      #for path in $notinst_path; do
+      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+      #done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  func_replace_sysroot "$libdir"
+	  func_append temp_xrpath " -R$func_replace_sysroot_result"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_rpath " $libdir" ;;
+	  esac
+	done
+	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles=$dlfiles
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) func_append dlfiles " $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles=$dlprefiles
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) func_append dlprefiles " $lib" ;;
+	esac
+      done
+
+      if test yes = "$build_libtool_libs"; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    func_append deplibs " System.ltframework"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    ;;
+	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test yes = "$build_libtool_need_lc"; then
+	      func_append deplibs " -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=
+	versuffix=
+	major=
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $opt_dry_run || $RM conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $opt_dry_run || $RM conftest
+	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    func_append newdeplibs " $i"
+		    i=
+		    ;;
+		  esac
+		fi
+		if test -n "$i"; then
+		  libname=`eval "\\$ECHO \"$libname_spec\""`
+		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		  set dummy $deplib_matches; shift
+		  deplib_match=$1
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+		    func_append newdeplibs " $i"
+		  else
+		    droppeddeps=yes
+		    echo
+		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		    echo "*** I have the capability to make that library automatically link in when"
+		    echo "*** you link to this library.  But I can only do this if you have a"
+		    echo "*** shared version of the library, which I believe you do not have"
+		    echo "*** because a test_compile did reveal that the linker did not use it for"
+		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+		;;
+	      *)
+		func_append newdeplibs " $i"
+		;;
+	      esac
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		$opt_dry_run || $RM conftest
+		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+		  ldd_output=`ldd conftest`
+		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      func_append newdeplibs " $i"
+		      i=
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i"; then
+		    libname=`eval "\\$ECHO \"$libname_spec\""`
+		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		    set dummy $deplib_matches; shift
+		    deplib_match=$1
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+		      func_append newdeplibs " $i"
+		    else
+		      droppeddeps=yes
+		      echo
+		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		      echo "*** I have the capability to make that library automatically link in when"
+		      echo "*** you link to this library.  But I can only do this if you have a"
+		      echo "*** shared version of the library, which you do not appear to have"
+		      echo "*** because a test_compile did reveal that the linker did not use this one"
+		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  echo
+		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+		  echo "*** make it link in!  You will probably need to install it or some"
+		  echo "*** library that it depends on before this library will be fully"
+		  echo "*** functional.  Installing it before continuing would be even better."
+		fi
+		;;
+	      *)
+		func_append newdeplibs " $i"
+		;;
+	      esac
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method; shift
+	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  func_append newdeplibs " $a_deplib"
+		  a_deplib=
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib"; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		if test -n "$file_magic_glob"; then
+		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+		else
+		  libnameglob=$libname
+		fi
+		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  if test yes = "$want_nocaseglob"; then
+		    shopt -s nocaseglob
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		    $nocaseglob
+		  else
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		  fi
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null |
+			 $GREP " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib=$potent_lib
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+			 $SED -e 10q |
+			 $EGREP "$file_magic_regex" > /dev/null; then
+			func_append newdeplibs " $a_deplib"
+			a_deplib=
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib"; then
+		droppeddeps=yes
+		echo
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib"; then
+		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      func_append newdeplibs " $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method; shift
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  func_append newdeplibs " $a_deplib"
+		  a_deplib=
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib"; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib=$potent_lib # see symlink-check above in file_magic test
+		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+		       $EGREP "$match_pattern_regex" > /dev/null; then
+		      func_append newdeplibs " $a_deplib"
+		      a_deplib=
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib"; then
+		droppeddeps=yes
+		echo
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib"; then
+		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      func_append newdeplibs " $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=
+	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	    for i in $predeps $postdeps; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
+	    done
+	  fi
+	  case $tmp_deplibs in
+	  *[!\	\ ]*)
+	    echo
+	    if test none = "$deplibs_check_method"; then
+	      echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	    ;;
+	  esac
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library with the System framework
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+	  ;;
+	esac
+
+	if test yes = "$droppeddeps"; then
+	  if test yes = "$module"; then
+	    echo
+	    echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+	    echo "*** a static module, that should work as long as the dlopening"
+	    echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      echo
+	      echo "*** However, this would only work if libtool was able to extract symbol"
+	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
+	      echo "*** not find such a program.  So, this module is probably useless."
+	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test no = "$build_old_libs"; then
+	      oldlibs=$output_objdir/$libname.$libext
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    echo "*** The inter-library dependencies that have been dropped here will be"
+	    echo "*** automatically added whenever a program is linked with this library"
+	    echo "*** or is declared to -dlopen it."
+
+	    if test no = "$allow_undefined"; then
+	      echo
+	      echo "*** Since this library must not contain undefined symbols,"
+	      echo "*** because either the platform does not support them or"
+	      echo "*** it was explicitly requested with -no-undefined,"
+	      echo "*** libtool will only create a static version of it."
+	      if test no = "$build_old_libs"; then
+		oldlibs=$output_objdir/$libname.$libext
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+	*-*-darwin*)
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  ;;
+      esac
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    func_append new_libs " -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) func_append new_libs " $deplib" ;;
+	  esac
+	  ;;
+	*) func_append new_libs " $deplib" ;;
+	esac
+      done
+      deplibs=$new_libs
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test yes = "$build_libtool_libs"; then
+	# Remove $wl instances when linking with ld.
+	# FIXME: should test the right _cmds variable.
+	case $archive_cmds in
+	  *\$LD\ *) wl= ;;
+        esac
+	if test yes = "$hardcode_into_libs"; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath=$finalize_rpath
+	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		func_replace_sysroot "$libdir"
+		libdir=$func_replace_sysroot_result
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs=$libdir
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		func_append dep_rpath " $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append perm_rpath " $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir=$hardcode_libdirs
+	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      func_append rpath "$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath=$finalize_shlibpath
+	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext_cmds\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	shift
+	realname=$1
+	shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname=$realname
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib=$output_objdir/$realname
+	linknames=
+	for link
+	do
+	  func_append linknames " $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	test "X$libobjs" = "X " && libobjs=
+
+	delfiles=
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+	  export_symbols=$output_objdir/$libname.uexp
+	  func_append delfiles " $export_symbols"
+	fi
+
+	orig_export_symbols=
+	case $host_os in
+	cygwin* | mingw* | cegcc*)
+	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+	    # exporting using user supplied symfile
+	    func_dll_def_p "$export_symbols" || {
+	      # and it's NOT already a .def file. Must figure out
+	      # which of the given symbols are data symbols and tag
+	      # them as such. So, trigger use of export_symbols_cmds.
+	      # export_symbols gets reassigned inside the "prepare
+	      # the list of exported symbols" if statement, so the
+	      # include_expsyms logic still works.
+	      orig_export_symbols=$export_symbols
+	      export_symbols=
+	      always_export_symbols=yes
+	    }
+	  fi
+	  ;;
+	esac
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for '$libname.la'"
+	    export_symbols=$output_objdir/$libname.exp
+	    $opt_dry_run || $RM $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs=$IFS; IFS='~'
+	    for cmd1 in $cmds; do
+	      IFS=$save_ifs
+	      # Take the normal branch if the nm_file_list_spec branch
+	      # doesn't work or if tool conversion is not needed.
+	      case $nm_file_list_spec~$to_tool_file_cmd in
+		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+		  try_normal_branch=yes
+		  eval cmd=\"$cmd1\"
+		  func_len " $cmd"
+		  len=$func_len_result
+		  ;;
+		*)
+		  try_normal_branch=no
+		  ;;
+	      esac
+	      if test yes = "$try_normal_branch" \
+		 && { test "$len" -lt "$max_cmd_len" \
+		      || test "$max_cmd_len" -le -1; }
+	      then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
+	      elif test -n "$nm_file_list_spec"; then
+		func_basename "$output"
+		output_la=$func_basename_result
+		save_libobjs=$libobjs
+		save_output=$output
+		output=$output_objdir/$output_la.nm
+		func_to_tool_file "$output"
+		libobjs=$nm_file_list_spec$func_to_tool_file_result
+		func_append delfiles " $output"
+		func_verbose "creating $NM input file list: $output"
+		for obj in $save_libobjs; do
+		  func_to_tool_file "$obj"
+		  $ECHO "$func_to_tool_file_result"
+		done > "$output"
+		eval cmd=\"$cmd1\"
+		func_show_eval "$cmd" 'exit $?'
+		output=$save_output
+		libobjs=$save_libobjs
+		skipped_export=false
+	      else
+		# The command line is too long to execute in one step.
+		func_verbose "using reloadable object file for export list..."
+		skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
+	      fi
+	    done
+	    IFS=$save_ifs
+	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  tmp_export_symbols=$export_symbols
+	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
+	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+	fi
+
+	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
+	  # The given exports_symbols file has to be filtered, so filter it.
+	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
+	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	  # 's' commands, which not all seds can handle. GNU sed should be fine
+	  # though. Also, the filter scales superlinearly with the number of
+	  # global variables. join(1) would be nice here, but unfortunately
+	  # isn't a blessed tool.
+	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+	  export_symbols=$output_objdir/$libname.def
+	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+	  case " $convenience " in
+	  *" $test_deplib "*) ;;
+	  *)
+	    func_append tmp_deplibs " $test_deplib"
+	    ;;
+	  esac
+	done
+	deplibs=$tmp_deplibs
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec" &&
+	    test yes = "$compiler_needs_object" &&
+	    test -z "$libobjs"; then
+	    # extract the archives, so we have objects to list.
+	    # TODO: could optimize this to just extract one archive.
+	    whole_archive_flag_spec=
+	  fi
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  else
+	    gentop=$output_objdir/${outputname}x
+	    func_append generated " $gentop"
+
+	    func_extract_archives $gentop $convenience
+	    func_append libobjs " $func_extract_archives_result"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	fi
+
+	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  func_append linker_flags " $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test relink = "$opt_mode"; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test yes = "$module" && test -n "$module_cmds"; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
+	else
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval test_cmds=\"$archive_expsym_cmds\"
+	    cmds=$archive_expsym_cmds
+	  else
+	    eval test_cmds=\"$archive_cmds\"
+	    cmds=$archive_cmds
+	  fi
+	fi
+
+	if test : != "$skipped_export" &&
+	   func_len " $test_cmds" &&
+	   len=$func_len_result &&
+	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise
+	  # or, if using GNU ld and skipped_export is not :, use a linker
+	  # script.
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+	  func_basename "$output"
+	  output_la=$func_basename_result
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  last_robj=
+	  k=1
+
+	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+	    output=$output_objdir/$output_la.lnkscript
+	    func_verbose "creating GNU ld script: $output"
+	    echo 'INPUT (' > $output
+	    for obj in $save_libobjs
+	    do
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
+	    done
+	    echo ')' >> $output
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$func_to_tool_file_result
+	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+	    output=$output_objdir/$output_la.lnk
+	    func_verbose "creating linker input file list: $output"
+	    : > $output
+	    set x $save_libobjs
+	    shift
+	    firstobj=
+	    if test yes = "$compiler_needs_object"; then
+	      firstobj="$1 "
+	      shift
+	    fi
+	    for obj
+	    do
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
+	    done
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+	  else
+	    if test -n "$save_libobjs"; then
+	      func_verbose "creating reloadable object files..."
+	      output=$output_objdir/$output_la-$k.$objext
+	      eval test_cmds=\"$reload_cmds\"
+	      func_len " $test_cmds"
+	      len0=$func_len_result
+	      len=$len0
+
+	      # Loop over the list of objects to be linked.
+	      for obj in $save_libobjs
+	      do
+		func_len " $obj"
+		func_arith $len + $func_len_result
+		len=$func_arith_result
+		if test -z "$objlist" ||
+		   test "$len" -lt "$max_cmd_len"; then
+		  func_append objlist " $obj"
+		else
+		  # The command $test_cmds is almost too long, add a
+		  # command to the queue.
+		  if test 1 -eq "$k"; then
+		    # The first file doesn't have a previous command to add.
+		    reload_objs=$objlist
+		    eval concat_cmds=\"$reload_cmds\"
+		  else
+		    # All subsequent reloadable object files will link in
+		    # the last one created.
+		    reload_objs="$objlist $last_robj"
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+		  fi
+		  last_robj=$output_objdir/$output_la-$k.$objext
+		  func_arith $k + 1
+		  k=$func_arith_result
+		  output=$output_objdir/$output_la-$k.$objext
+		  objlist=" $obj"
+		  func_len " $last_robj"
+		  func_arith $len0 + $func_len_result
+		  len=$func_arith_result
+		fi
+	      done
+	      # Handle the remaining objects by creating one last
+	      # reloadable object file.  All subsequent reloadable object
+	      # files will link in the last one created.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      reload_objs="$objlist $last_robj"
+	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
+	      if test -n "$last_robj"; then
+	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+	      fi
+	      func_append delfiles " $output"
+
+	    else
+	      output=
+	    fi
+
+	    ${skipped_export-false} && {
+	      func_verbose "generating symbol list for '$libname.la'"
+	      export_symbols=$output_objdir/$libname.exp
+	      $opt_dry_run || $RM $export_symbols
+	      libobjs=$output
+	      # Append the command to create the export file.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+	      if test -n "$last_robj"; then
+		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+	      fi
+	    }
+
+	    test -n "$save_libobjs" &&
+	      func_verbose "creating a temporary reloadable object file: $output"
+
+	    # Loop through the commands generated above and execute them.
+	    save_ifs=$IFS; IFS='~'
+	    for cmd in $concat_cmds; do
+	      IFS=$save_ifs
+	      $opt_quiet || {
+		  func_quote_for_expand "$cmd"
+		  eval "func_echo $func_quote_for_expand_result"
+	      }
+	      $opt_dry_run || eval "$cmd" || {
+		lt_exit=$?
+
+		# Restore the uninstalled library and exit
+		if test relink = "$opt_mode"; then
+		  ( cd "$output_objdir" && \
+		    $RM "${realname}T" && \
+		    $MV "${realname}U" "$realname" )
+		fi
+
+		exit $lt_exit
+	      }
+	    done
+	    IFS=$save_ifs
+
+	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+
+          ${skipped_export-false} && {
+	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	      tmp_export_symbols=$export_symbols
+	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
+	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+	    fi
+
+	    if test -n "$orig_export_symbols"; then
+	      # The given exports_symbols file has to be filtered, so filter it.
+	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
+	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	      # 's' commands, which not all seds can handle. GNU sed should be fine
+	      # though. Also, the filter scales superlinearly with the number of
+	      # global variables. join(1) would be nice here, but unfortunately
+	      # isn't a blessed tool.
+	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+	      export_symbols=$output_objdir/$libname.def
+	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	    fi
+	  }
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test yes = "$module" && test -n "$module_cmds"; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
+	  else
+	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	      cmds=$archive_expsym_cmds
+	    else
+	      cmds=$archive_cmds
+	    fi
+	  fi
+	fi
+
+	if test -n "$delfiles"; then
+	  # Append the command to remove temporary files to $cmds.
+	  eval cmds=\"\$cmds~\$RM $delfiles\"
+	fi
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop=$output_objdir/${outputname}x
+	  func_append generated " $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  func_append libobjs " $func_extract_archives_result"
+	  test "X$libobjs" = "X " && libobjs=
+	fi
+
+	save_ifs=$IFS; IFS='~'
+	for cmd in $cmds; do
+	  IFS=$sp$nl
+	  eval cmd=\"$cmd\"
+	  IFS=$save_ifs
+	  $opt_quiet || {
+	    func_quote_for_expand "$cmd"
+	    eval "func_echo $func_quote_for_expand_result"
+	  }
+	  $opt_dry_run || eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test relink = "$opt_mode"; then
+	      ( cd "$output_objdir" && \
+	        $RM "${realname}T" && \
+		$MV "${realname}U" "$realname" )
+	    fi
+
+	    exit $lt_exit
+	  }
+	done
+	IFS=$save_ifs
+
+	# Restore the uninstalled library and exit
+	if test relink = "$opt_mode"; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      func_show_eval '${RM}r "$gentop"'
+	    fi
+	  fi
+
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test yes = "$module" || test yes = "$export_dynamic"; then
+	  # On all known operating systems, these are identical.
+	  dlname=$soname
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for objects"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "'-l' and '-L' are ignored for objects" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "'-rpath' is ignored for objects"
+
+      test -n "$xrpath" && \
+	func_warning "'-R' is ignored for objects"
+
+      test -n "$vinfo" && \
+	func_warning "'-version-info' is ignored for objects"
+
+      test -n "$release" && \
+	func_warning "'-release' is ignored for objects"
+
+      case $output in
+      *.lo)
+	test -n "$objs$old_deplibs" && \
+	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
+
+	libobj=$output
+	func_lo2o "$libobj"
+	obj=$func_lo2o_result
+	;;
+      *)
+	libobj=
+	obj=$output
+	;;
+      esac
+
+      # Delete the old objects.
+      $opt_dry_run || $RM $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # if reload_cmds runs $LD directly, get rid of -Wl from
+      # whole_archive_flag_spec and hope we can get by with turning comma
+      # into space.
+      case $reload_cmds in
+        *\$LD[\ \$]*) wl= ;;
+      esac
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
+	else
+	  gentop=$output_objdir/${obj}x
+	  func_append generated " $gentop"
+
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+	fi
+      fi
+
+      # If we're not building shared, we need to use non_pic_objs
+      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
+
+      # Create the old-style object.
+      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
+
+      output=$obj
+      func_execute_cmds "$reload_cmds" 'exit $?'
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      test yes = "$build_libtool_libs" || {
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      }
+
+      if test -n "$pic_flag" || test default != "$pic_mode"; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output=$libobj
+	func_execute_cmds "$reload_cmds" 'exit $?'
+      fi
+
+      if test -n "$gentop"; then
+	func_show_eval '${RM}r "$gentop"'
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) func_stripname '' '.exe' "$output"
+	          output=$func_stripname_result.exe;;
+      esac
+      test -n "$vinfo" && \
+	func_warning "'-version-info' is ignored for programs"
+
+      test -n "$release" && \
+	func_warning "'-release' is ignored for programs"
+
+      $preload \
+	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+	# Don't allow lazy linking, it breaks C++ global constructors
+	# But is supposedly fixed on 10.4 or later (yay!).
+	if test CXX = "$tagname"; then
+	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+	    10.[0123])
+	      func_append compile_command " $wl-bind_at_load"
+	      func_append finalize_command " $wl-bind_at_load"
+	    ;;
+	  esac
+	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    func_append new_libs " -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) func_append new_libs " $deplib" ;;
+	  esac
+	  ;;
+	*) func_append new_libs " $deplib" ;;
+	esac
+      done
+      compile_deplibs=$new_libs
+
+
+      func_append compile_command " $compile_deplibs"
+      func_append finalize_command " $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_rpath " $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs=$libdir
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    func_append rpath " $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append perm_rpath " $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  ::) dllsearchpath=$libdir;;
+	  *) func_append dllsearchpath ":$libdir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) func_append dllsearchpath ":$testbindir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir=$hardcode_libdirs
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath=$rpath
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs=$libdir
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    func_append rpath " $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_perm_rpath " $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir=$hardcode_libdirs
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath=$rpath
+
+      if test -n "$libobjs" && test yes = "$build_old_libs"; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+      fi
+
+      func_generate_dlsyms "$outputname" "@PROGRAM@" false
+
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+	func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
+
+      wrappers_required=:
+      case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=false
+        ;;
+      *cygwin* | *mingw* )
+        test yes = "$build_libtool_libs" || wrappers_required=false
+        ;;
+      *)
+        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+          wrappers_required=false
+        fi
+        ;;
+      esac
+      $wrappers_required || {
+	# Replace the output file specification.
+	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+	link_command=$compile_command$compile_rpath
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	exit_status=0
+	func_show_eval "$link_command" 'exit_status=$?'
+
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
+	fi
+
+	# Delete the generated files.
+	if test -f "$output_objdir/${outputname}S.$objext"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
+	fi
+
+	exit $exit_status
+      }
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    func_append rpath "$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    func_append rpath "$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test yes = "$no_install"; then
+	# We don't need to create a wrapper script.
+	link_command=$compile_var$compile_command$compile_rpath
+	# Replace the output file specification.
+	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$opt_dry_run || $RM $output
+	# Link the executable and exit
+	func_show_eval "$link_command" 'exit $?'
+
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      case $hardcode_action,$fast_install in
+        relink,*)
+	  # Fast installation is not supported
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
+
+	  func_warning "this platform does not like uninstalled shared libraries"
+	  func_warning "'$output' will be relinked during installation"
+	  ;;
+        *,yes)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+          ;;
+	*,no)
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
+          ;;
+	*,needless)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=
+          ;;
+      esac
+
+      # Replace the output file specification.
+      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      func_show_eval "$link_command" 'exit $?'
+
+      if test -n "$postlink_cmds"; then
+	func_to_tool_file "$output_objdir/$outputname"
+	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	func_execute_cmds "$postlink_cmds" 'exit $?'
+      fi
+
+      # Now create the wrapper script.
+      func_verbose "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    func_quote_for_eval "$var_value"
+	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) func_stripname '' '.exe' "$output"
+	         output=$func_stripname_result ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    func_stripname '' '.exe' "$outputname"
+	    outputname=$func_stripname_result ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+	    func_dirname_and_basename "$output" "" "."
+	    output_name=$func_basename_result
+	    output_path=$func_dirname_result
+	    cwrappersource=$output_path/$objdir/lt-$output_name.c
+	    cwrapper=$output_path/$output_name.exe
+	    $RM $cwrappersource $cwrapper
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_cwrapperexe_src > $cwrappersource
+
+	    # The wrapper executable is built using the $host compiler,
+	    # because it contains $host paths and files. If cross-
+	    # compiling, it, like the target executable, must be
+	    # executed on the $host or under an emulation environment.
+	    $opt_dry_run || {
+	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+	      $STRIP $cwrapper
+	    }
+
+	    # Now, create the wrapper script for func_source use:
+	    func_ltwrapper_scriptname $cwrapper
+	    $RM $func_ltwrapper_scriptname_result
+	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+	    $opt_dry_run || {
+	      # note: this script will not be executed, so do not chmod.
+	      if test "x$build" = "x$host"; then
+		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+	      else
+		func_emit_wrapper no > $func_ltwrapper_scriptname_result
+	      fi
+	    }
+	  ;;
+	  * )
+	    $RM $output
+	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_wrapper no > $output
+	    chmod +x $output
+	  ;;
+	esac
+      }
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      case $build_libtool_libs in
+        convenience)
+	  oldobjs="$libobjs_save $symfileobj"
+	  addlibs=$convenience
+	  build_libtool_libs=no
+	  ;;
+	module)
+	  oldobjs=$libobjs_save
+	  addlibs=$old_convenience
+	  build_libtool_libs=no
+          ;;
+	*)
+	  oldobjs="$old_deplibs $non_pic_objects"
+	  $preload && test -f "$symfileobj" \
+	    && func_append oldobjs " $symfileobj"
+	  addlibs=$old_convenience
+	  ;;
+      esac
+
+      if test -n "$addlibs"; then
+	gentop=$output_objdir/${outputname}x
+	func_append generated " $gentop"
+
+	func_extract_archives $gentop $addlibs
+	func_append oldobjs " $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
+	cmds=$old_archive_from_new_cmds
+      else
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop=$output_objdir/${outputname}x
+	  func_append generated " $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  func_append oldobjs " $func_extract_archives_result"
+	fi
+
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      func_basename "$obj"
+	      $ECHO "$func_basename_result"
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  echo "copying selected object files to avoid basename conflicts..."
+	  gentop=$output_objdir/${outputname}x
+	  func_append generated " $gentop"
+	  func_mkdir_p "$gentop"
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    func_basename "$obj"
+	    objbase=$func_basename_result
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		func_arith $counter + 1
+		counter=$func_arith_result
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      func_append oldobjs " $gentop/$newobj"
+	      ;;
+	    *) func_append oldobjs " $obj" ;;
+	    esac
+	  done
+	fi
+	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+	tool_oldlib=$func_to_tool_file_result
+	eval cmds=\"$old_archive_cmds\"
+
+	func_len " $cmds"
+	len=$func_len_result
+	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	elif test -n "$archiver_list_spec"; then
+	  func_verbose "using command file archive linking..."
+	  for obj in $oldobjs
+	  do
+	    func_to_tool_file "$obj"
+	    $ECHO "$func_to_tool_file_result"
+	  done > $output_objdir/$libname.libcmd
+	  func_to_tool_file "$output_objdir/$libname.libcmd"
+	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  func_verbose "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  eval test_cmds=\"$old_archive_cmds\"
+	  func_len " $test_cmds"
+	  len0=$func_len_result
+	  len=$len0
+	  for obj in $save_oldobjs
+	  do
+	    func_len " $obj"
+	    func_arith $len + $func_len_result
+	    len=$func_arith_result
+	    func_append objlist " $obj"
+	    if test "$len" -lt "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj"; then
+		RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
+	      objlist=
+	      len=$len0
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test -z "$oldobjs"; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      func_execute_cmds "$cmds" 'exit $?'
+    done
+
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test yes = "$build_old_libs" && old_library=$libname.$libext
+      func_verbose "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  func_quote_for_eval "$var_value"
+	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      if test yes = "$hardcode_automatic"; then
+	relink_command=
+      fi
+
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+	for installed in no yes; do
+	  if test yes = "$installed"; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output=$output_objdir/${outputname}i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		func_basename "$deplib"
+		name=$func_basename_result
+		func_resolve_sysroot "$deplib"
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		test -z "$libdir" && \
+		  func_fatal_error "'$deplib' is not a valid libtool archive"
+		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      -L*)
+		func_stripname -L '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -L$func_replace_sysroot_result"
+		;;
+	      -R*)
+		func_stripname -R '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -R$func_replace_sysroot_result"
+		;;
+	      *) func_append newdependency_libs " $deplib" ;;
+	      esac
+	    done
+	    dependency_libs=$newdependency_libs
+	    newdlfiles=
+
+	    for lib in $dlfiles; do
+	      case $lib in
+	      *.la)
+	        func_basename "$lib"
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "'$lib' is not a valid libtool archive"
+		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      *) func_append newdlfiles " $lib" ;;
+	      esac
+	    done
+	    dlfiles=$newdlfiles
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+	      *.la)
+		# Only pass preopened files to the pseudo-archive (for
+		# eventual linking with the app. that links it) if we
+		# didn't already link the preopened objects directly into
+		# the library:
+		func_basename "$lib"
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "'$lib' is not a valid libtool archive"
+		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      esac
+	    done
+	    dlprefiles=$newdlprefiles
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      func_append newdlfiles " $abs"
+	    done
+	    dlfiles=$newdlfiles
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      func_append newdlprefiles " $abs"
+	    done
+	    dlprefiles=$newdlprefiles
+	  fi
+	  $RM $output
+	  # place dlname in correct position for cygwin
+	  # In fact, it would be nice if we could use this code for all target
+	  # systems that can't hard-code library paths into their executables
+	  # and that have no shared library path variable independent of PATH,
+	  # but it turns out we can't easily determine that from inspecting
+	  # libtool variables, so we have to hard-code the OSs to which it
+	  # applies here; at the moment, that means platforms that use the PE
+	  # object format with DLL files.  See the long comment at the top of
+	  # tests/bindir.at for full details.
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+	      # If a -bindir argument was supplied, place the dll there.
+	      if test -n "$bindir"; then
+		func_relative_path "$install_libdir" "$bindir"
+		tdlname=$func_relative_path_result/$dlname
+	      else
+		# Otherwise fall back on heuristic.
+		tdlname=../bin/$dlname
+	      fi
+	      ;;
+	  esac
+	  $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that cannot go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test no,yes = "$installed,$need_relink"; then
+	    $ECHO >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      }
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+}
+
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+  func_mode_link ${1+"$@"}
+fi
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $debug_cmd
+
+    RM=$nonopt
+    files=
+    rmforce=false
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic=$magic
+
+    for arg
+    do
+      case $arg in
+      -f) func_append RM " $arg"; rmforce=: ;;
+      -*) func_append RM " $arg" ;;
+      *) func_append files " $arg" ;;
+      esac
+    done
+
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
+
+    rmdirs=
+
+    for file in $files; do
+      func_dirname "$file" "" "."
+      dir=$func_dirname_result
+      if test . = "$dir"; then
+	odir=$objdir
+      else
+	odir=$dir/$objdir
+      fi
+      func_basename "$file"
+      name=$func_basename_result
+      test uninstall = "$opt_mode" && odir=$dir
+
+      # Remember odir for removal later, being careful to avoid duplicates
+      if test clean = "$opt_mode"; then
+	case " $rmdirs " in
+	  *" $odir "*) ;;
+	  *) func_append rmdirs " $odir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+	 { test -h "$file"; } >/dev/null 2>&1 ||
+	 test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif $rmforce; then
+	continue
+      fi
+
+      rmfiles=$file
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if func_lalib_p "$file"; then
+	  func_source $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    func_append rmfiles " $odir/$n"
+	  done
+	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+	  case $opt_mode in
+	  clean)
+	    case " $library_names " in
+	    *" $dlname "*) ;;
+	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+	    esac
+	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+	    ;;
+	  uninstall)
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	    ;;
+	  esac
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if func_lalib_p "$file"; then
+
+	  # Read the .lo file
+	  func_source $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" && test none != "$pic_object"; then
+	    func_append rmfiles " $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
+	    func_append rmfiles " $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test clean = "$opt_mode"; then
+	  noexename=$name
+	  case $file in
+	  *.exe)
+	    func_stripname '' '.exe' "$file"
+	    file=$func_stripname_result
+	    func_stripname '' '.exe' "$name"
+	    noexename=$func_stripname_result
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    func_append rmfiles " $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if func_ltwrapper_p "$file"; then
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      relink_command=
+	      func_source $func_ltwrapper_scriptname_result
+	      func_append rmfiles " $func_ltwrapper_scriptname_result"
+	    else
+	      relink_command=
+	      func_source $dir/$noexename
+	    fi
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+	    if test yes = "$fast_install" && test -n "$relink_command"; then
+	      func_append rmfiles " $odir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name"; then
+	      func_append rmfiles " $odir/lt-$noexename.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
+    done
+
+    # Try to remove the $objdir's in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	func_show_eval "rmdir $dir >/dev/null 2>&1"
+      fi
+    done
+
+    exit $exit_status
+}
+
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+  func_mode_uninstall ${1+"$@"}
+fi
+
+test -z "$opt_mode" && {
+  help=$generic_help
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode '$opt_mode'"
+
+if test -n "$exec_cmd"; then
+  eval exec "$exec_cmd"
+  exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# where we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/config/parse-types.sh b/config/parse-types.sh
index 5076f6c..24d2a99 100755
--- a/config/parse-types.sh
+++ b/config/parse-types.sh
@@ -118,8 +118,10 @@
 then
     true
 else
-    echo "Problem detected with asm_types.h"
-    echo "" > asm_types.h
+    if [ "${CROSS_COMPILE}" != "1" ]; then
+	echo "Problem detected with asm_types.h"
+	echo "" > asm_types.h
+    fi
 fi
 rm asm_types.c asm_types
 
diff --git a/configure b/configure
index 31ec8d3..405b730 100755
--- a/configure
+++ b/configure
@@ -619,45 +619,79 @@
 # include <unistd.h>
 #endif"
 
-ac_header_list=
+gt_needs=
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+OS_IO_FILE
+systemd_system_unit_dir
+have_systemd
+systemd_LIBS
+systemd_CFLAGS
+crond_dir
+have_crond
+pkg_udev_rules_dir
+have_udev
+udev_LIBS
+udev_CFLAGS
+LDFLAGS_SHLIB
+CFLAGS_STLIB
+CFLAGS_SHLIB
 BUILD_LDFLAGS
 BUILD_CFLAGS
 INCLUDES
 DO_TEST_SUITE
-ET_DIR
-SS_DIR
-LDFLAG_STATIC
+LDFLAGS_STATIC
 root_sysconfdir
 root_libdir
 root_sbindir
 root_bindir
 root_prefix
+E2SCRUB_CMT
 UNIX_CMT
 CYGWIN_CMT
 LINUX_CMT
+threadsan_ldflags
+threadsan_cflags
+have_threadsan
+addrsan_ldflags
+addrsan_cflags
+have_addrsan
+ubsan_ldflags
+ubsan_cflags
+have_ubsan
+lto_ldflags
+lto_cflags
+have_lto
+gcc_ranlib
+gcc_ar
 UNI_DIFF_OPTS
 SEM_INIT_LIB
+FUSE_CMT
+FUSE_LIB
+CLOCK_GETTIME_LIB
+MAGIC_LIB
 SOCKET_LIB
+SIZEOF_TIME_T
 SIZEOF_OFF_T
 SIZEOF_LONG_LONG
 SIZEOF_LONG
 SIZEOF_INT
 SIZEOF_SHORT
+DD
 BUILD_CC
 MAKEINFO
 STRIP
+RANLIB
 AR
 LDCONFIG
 PERL
-SED
 AWK
 CHMOD
 RM
 CP
 MV
 LN_S
+mkdir_p
 LN
 ifNotGNUmake
 ifGNUmake
@@ -666,32 +700,20 @@
 LTLIBINTL
 LIBINTL
 INTLLIBS
-INTL_LIBTOOL_SUFFIX_PREFIX
-INTLOBJS
-GENCAT
-INSTOBJEXT
-DATADIRNAME
-CATOBJEXT
-USE_INCLUDED_LIBINTL
-BUILD_INCLUDED_LIBINTL
-INTLBISON
 LTLIBICONV
 LIBICONV
-HAVE_WPRINTF
-HAVE_SNPRINTF
-HAVE_ASPRINTF
-HAVE_POSIX_PRINTF
-GLIBC21
-ALLOCA
-EGREP
-GREP
-RANLIB
+INTL_MACOSX_LIBS
+XGETTEXT_EXTRA_OPTIONS
+MSGMERGE_FOR_MSGFMT_OPTION
 MSGMERGE
+XGETTEXT_015
 XGETTEXT
+GMSGFMT_015
 GMSGFMT
 MSGFMT
+GETTEXT_MACRO_VERSION
 USE_NLS
-MKINSTALLDIRS
+MKDIR_P
 INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
@@ -699,7 +721,14 @@
 VERSION
 PACKAGE
 GETTEXT_PACKAGE
+TDB_MAN_COMMENT
+TDB_CMT
 UUIDD_CMT
+PTHREAD_CFLAGS
+PTHREAD_LIBS
+PTHREAD_CC
+ax_pthread_config
+SED
 E2INITRD_MAN
 E2INITRD_PROG
 FSCK_MAN
@@ -708,14 +737,8 @@
 RESIZER_CMT
 IMAGER_CMT
 DEBUGFS_CMT
-QUOTA_CMT
-DEPPROFILED_LIBQUOTA
-PROFILED_LIBQUOTA
-DEPSTATIC_LIBQUOTA
-STATIC_LIBQUOTA
-DEPLIBQUOTA
-LIBQUOTA
-QUOTA_MAN_COMMENT
+SUBSET_CMT
+ALL_CMT
 BLKID_CMT
 DEPPROFILED_LIBBLKID
 PROFILED_LIBBLKID
@@ -730,18 +753,19 @@
 STATIC_LIBUUID
 DEPLIBUUID
 LIBUUID
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
 PKG_CONFIG
+DEV_FEATURES_CMT
 TEST_IO_CMT
 PRIVATE_LIBS_CMT
 LDFLAG_DYNAMIC
 PROFILED_LIB_EXT
 STATIC_LIB_EXT
 LIB_EXT
-CHECKER_CMT
 PROFILE_CMT
 BSDLIB_CMT
 ELF_CMT
-HTREE_CMT
 Q
 ES
 E
@@ -749,6 +773,8 @@
 SYMLINK_RELATIVE
 LINK_INSTALL_FLAGS
 MAINTAINER_CMT
+EGREP
+GREP
 CPP
 RDYNAMIC
 DLOPEN_LIB
@@ -767,6 +793,7 @@
 build_vendor
 build_cpu
 build
+E2FSPROGS_DATE
 E2FSPROGS_PKGVER
 E2FSPROGS_VERSION
 E2FSPROGS_DAY
@@ -791,6 +818,7 @@
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -814,7 +842,6 @@
 MAKEFILE_ELF
 MAKEFILE_BSDLIB
 MAKEFILE_PROFILE
-MAKEFILE_CHECKER
 MAKEFILE_LIBRARY
 ASM_TYPES_HEADER
 PUBLIC_CONFIG_HEADER'
@@ -831,18 +858,18 @@
 enable_symlink_relative_symlinks
 enable_symlink_build
 enable_verbose_makecmds
-enable_compression
-enable_htree
 enable_elf_shlibs
 enable_bsd_shlibs
 enable_profile
-enable_checker
+enable_gcov
+enable_hardening
 enable_jbd_debug
 enable_blkid_debug
 enable_testio_debug
+enable_developer_features
 enable_libuuid
 enable_libblkid
-enable_quota
+enable_subset
 enable_backtrace
 enable_debugfs
 enable_imager
@@ -851,14 +878,26 @@
 enable_fsck
 enable_e2initrd_helper
 enable_tls
+with_pthread
 enable_uuidd
+enable_mmp
+enable_tdb
+enable_bmap_stats
+enable_bmap_stats_ops
 enable_nls
 with_gnu_ld
 enable_rpath
 with_libiconv_prefix
-with_included_gettext
 with_libintl_prefix
+enable_fuse2fs
+enable_lto
+enable_ubsan
+enable_addrsan
+enable_threadsan
 with_multiarch
+with_udev_rules_dir
+with_crond_dir
+with_systemd_unit_dir
 '
       ac_precious_vars='build_alias
 host_alias
@@ -869,7 +908,13 @@
 LIBS
 CPPFLAGS
 CPP
-PKG_CONFIG'
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+udev_CFLAGS
+udev_LIBS
+systemd_CFLAGS
+systemd_LIBS'
 
 
 # Initialize some variables set by options.
@@ -908,6 +953,7 @@
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE}'
@@ -1160,6 +1206,15 @@
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1297,7 +1352,7 @@
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1450,6 +1505,7 @@
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1481,35 +1537,51 @@
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-maintainer-mode enable makefile rules useful for maintainers
-  --enable-symlink-install use symlinks when installing instead of hard links
-  --enable-relative-symlinks use relative symlinks when installing
+  --enable-maintainer-mode
+                          enable makefile rules useful for maintainers
+  --enable-symlink-install
+                          use symlinks when installing instead of hard links
+  --enable-relative-symlinks
+                          use relative symlinks when installing
 
   --enable-symlink-build  use symlinks while building instead of hard links
-  --enable-verbose-makecmds enable verbose make command output
-  --enable-compression	  enable EXPERIMENTAL compression support
-  --enable-htree      	  enable EXPERIMENTAL htree directory support
-  --enable-elf-shlibs	  select ELF shared libraries
-  --enable-bsd-shlibs	  select BSD shared libraries
-  --enable-profile	  build profiling libraries
-  --enable-checker	  build checker libraries
-  --enable-jbd-debug  	  enable journal debugging
+  --enable-verbose-makecmds
+                          enable verbose make command output
+  --enable-elf-shlibs     select ELF shared libraries
+  --enable-bsd-shlibs     select BSD shared libraries
+  --enable-profile        build profiling libraries
+  --enable-gcov           build for coverage testing using gcov
+  --enable-hardening      build for coverage testing using gcov
+  --enable-jbd-debug      enable journal debugging
   --enable-blkid-debug    enable blkid debugging
-  --disable-testio-debug  disable the use of the test I/O manager for debugging
-  --disable-libuuid	  do not build private uuid library
-  --disable-libblkid	  do not build private blkid library
-  --enable-quota	  enable quota support
-  --disable-backtrace	  disable use backtrace
-  --disable-debugfs   	  disable support of debugfs program
-  --disable-imager   	  disable support of e2image program
-  --disable-resizer   	  disable support of e2resize program
-  --disable-defrag   	  disable support of e4defrag program
+  --disable-testio-debug  disable the use of the test I/O manager for
+                          debugging
+  --enable-developer-features
+                          enable features for use by ext4 developers
+  --enable-libuuid        build and use private uuid library
+  --enable-libblkid       build and use private blkid library
+  --enable-subset         enable subset-only build
+  --disable-backtrace     disable use backtrace
+  --disable-debugfs       disable support of debugfs program
+  --disable-imager        disable support of e2image program
+  --disable-resizer       disable support of e2resize program
+  --disable-defrag        disable support of e4defrag program
   --enable-fsck           build fsck wrapper program
-  --enable-e2initrd-helper build e2initrd-helper program
+  --enable-e2initrd-helper
+                          build e2initrd-helper program
   --disable-tls           disable use of thread local support
   --disable-uuidd         disable building the uuid daemon
+  --disable-mmp           disable support mmp, Multi Mount Protection
+  --disable-tdb           disable tdb support
+  --disable-bmap-stats    disable collection of bitmap stats
+  --enable-bmap-stats-ops enable collection of additional bitmap stats
   --disable-nls           do not use Native Language Support
   --disable-rpath         do not hardcode runtime library paths
+  --disable-fuse2fs       do not build fuse2fs
+  --enable-lto            enable link time optimization
+  --enable-ubsan          enable undefined behavior sanitizer
+  --enable-addrsan        enable address sanitizer
+  --enable-threadsan      enable thread sanitizer
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -1518,14 +1590,21 @@
   --with-cc               no longer supported, use CC= instead
   --with-ccopts           no longer supported, use CFLAGS= instead
   --with-ldopts           no longer supported, use LDFLAGS= instead
-  --with-root-prefix=PREFIX override prefix variable for files to be placed in the root
-  --with-gnu-ld           assume the C compiler uses GNU ld default=no
+  --with-root-prefix=PREFIX
+                          override prefix variable for files to be placed in
+                          the root
+  --without-pthread       disable use of pthread support
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
   --without-libiconv-prefix     don't search for libiconv in includedir and libdir
-  --with-included-gettext use the GNU gettext library included here
   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
   --without-libintl-prefix     don't search for libintl in includedir and libdir
-  --with-multiarch=ARCH specify the multiarch triplet
+  --with-multiarch=ARCH   specify the multiarch triplet
+  --with-udev-rules-dir[=DIR]
+                          Install udev rules into DIR.
+  --with-crond-dir[=DIR]  Install system crontabs into DIR.
+  --with-systemd-unit-dir[=DIR]
+                          Install systemd system units into DIR.
 
 Some influential environment variables:
   CC          C compiler command
@@ -1537,6 +1616,16 @@
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
   PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
+  udev_CFLAGS C compiler flags for udev, overriding pkg-config
+  udev_LIBS   linker flags for udev, overriding pkg-config
+  systemd_CFLAGS
+              C compiler flags for systemd, overriding pkg-config
+  systemd_LIBS
+              linker flags for systemd, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1739,6 +1828,93 @@
 
 } # ac_fn_c_try_cpp
 
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
 # ac_fn_c_try_run LINENO
 # ----------------------
 # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
@@ -1781,60 +1957,6 @@
 
 } # ac_fn_c_try_run
 
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof ($2))
-	 return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
-	    return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-
 # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
 # -------------------------------------------------------
 # Tests whether HEADER exists and can be compiled using the include files in
@@ -1933,92 +2055,162 @@
 
 } # ac_fn_c_check_func
 
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
   $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$4
-#include <$2>
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_header_compiler=yes
+  eval "$4=yes"
 else
-  ac_header_compiler=no
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  eval "$4=no"
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  ac_header_preproc=yes
-else
-  ac_header_preproc=no
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
-  yes:no: )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-esac
+} # ac_fn_c_check_member
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
 if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  eval "$3=\$ac_header_compiler"
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-fi
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
-} # ac_fn_c_check_header_mongrel
+} # ac_fn_c_check_type
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
 
 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
 # --------------------------------------------
@@ -2202,109 +2394,6 @@
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_compute_int
-
-# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
-# ----------------------------------------------------
-# Tries to find if the field MEMBER exists in type AGGR, after including
-# INCLUDES, setting cache variable VAR accordingly.
-ac_fn_c_check_member ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
-$as_echo_n "checking for $2.$3... " >&6; }
-if eval \${$4+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$5
-int
-main ()
-{
-static $2 ac_aggr;
-if (ac_aggr.$3)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$4=yes"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$5
-int
-main ()
-{
-static $2 ac_aggr;
-if (sizeof ac_aggr.$3)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$4=yes"
-else
-  eval "$4=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$4
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_member
-
-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
-# ---------------------------------------------
-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
-# accordingly.
-ac_fn_c_check_decl ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  as_decl_name=`echo $2|sed 's/ *(.*//'`
-  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
-$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-#ifndef $as_decl_name
-#ifdef __cplusplus
-  (void) $as_decl_use;
-#else
-  (void) $as_decl_name;
-#endif
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_decl
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
@@ -2589,9 +2678,7 @@
   >$cache_file
 fi
 
-as_fn_append ac_header_list " stdlib.h"
-as_fn_append ac_header_list " unistd.h"
-as_fn_append ac_header_list " sys/param.h"
+gt_needs="$gt_needs "
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
@@ -2698,11 +2785,11 @@
 BINARY_TYPE=bin
 E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h  \
 	| awk '{print $3}' | tr \" " " | awk '{print $1}'`
-DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
-	| tr \" " "`
-E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'`
-MONTH=`echo $DATE | awk -F- '{print $2}'`
-YEAR=`echo $DATE | awk -F- '{print $3}'`
+E2FSPROGS_DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
+	| tr \" " " | awk '{print $1}'`
+E2FSPROGS_DAY=$(echo $E2FSPROGS_DATE | awk -F- '{print $1}' | sed -e '/^[1-9]$/s/^/0/')
+MONTH=`echo $E2FSPROGS_DATE | awk -F- '{print $2}'`
+YEAR=`echo $E2FSPROGS_DATE | awk -F- '{print $3}'`
 
 if expr $YEAR ">" 1900 > /dev/null ; then
 	E2FSPROGS_YEAR=$YEAR
@@ -2736,7 +2823,7 @@
 
 case $E2FSPROGS_VERSION in
 *-WIP|pre-*)
-	E2FSPROGS_PKGVER="$base_ver~WIP-$E2FSPROGS_YEAR-$MONTH_NUM-$E2FSPROGS_DAY"
+	E2FSPROGS_PKGVER="$base_ver~WIP.$date_spec"
 	;;
 *)
 	E2FSPROGS_PKGVER="$base_ver"
@@ -2753,6 +2840,22 @@
 
 
 
+
+WITH_DIET_LIBC=
+
+# Check whether --with-diet-libc was given.
+if test "${with_diet_libc+set}" = set; then :
+  withval=$with_diet_libc; CC="diet cc -nostdinc"
+WITH_DIET_LIBC=yes
+if test -z "$LIBS"
+then
+	LIBS="-lcompat"
+else
+	LIBS="$LIBS -lcompat"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: CC=$CC" >&5
+$as_echo "CC=$CC" >&6; }
+fi
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
   as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
@@ -3653,21 +3756,9 @@
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
   DLOPEN_LIB=-ldl
-
-$as_echo "#define HAVE_DLOPEN 1" >>confdefs.h
-
 fi
 
 
-WITH_DIET_LIBC=
-
-# Check whether --with-diet-libc was given.
-if test "${with_diet_libc+set}" = set; then :
-  withval=$with_diet_libc; CC="diet cc -nostdinc"
-WITH_DIET_LIBC=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: CC=$CC" >&5
-$as_echo "CC=$CC" >&6; }
-fi
 
 # Check whether --with-cc was given.
 if test "${with_cc+set}" = set; then :
@@ -4383,1816 +4474,6 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: (none)" >&5
 $as_echo "(none)" >&6; }
 fi
-LIB_EXT=.a
-STATIC_LIB_EXT=.a
-PROFILED_LIB_EXT=.a
-
-# Check whether --with-root-prefix was given.
-if test "${with_root_prefix+set}" = set; then :
-  withval=$with_root_prefix; root_prefix=$withval
-else
-  root_prefix=NONE
-fi
-# Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
-  enableval=$enable_maintainer_mode; if test "$enableval" = "no"
-then
-	MAINTAINER_CMT=#
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling maintainer mode" >&5
-$as_echo "Disabling maintainer mode" >&6; }
-else
-	MAINTAINER_CMT=
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling maintainer mode" >&5
-$as_echo "Enabling maintainer mode" >&6; }
-fi
-
-else
-  MAINTAINER_CMT=#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling maintainer mode by default" >&5
-$as_echo "Disabling maintainer mode by default" >&6; }
-
-fi
-
-
-# Check whether --enable-symlink-install was given.
-if test "${enable_symlink_install+set}" = set; then :
-  enableval=$enable_symlink_install; if test "$enableval" = "no"
-then
-	LINK_INSTALL_FLAGS=-f
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for install" >&5
-$as_echo "Disabling symlinks for install" >&6; }
-else
-	LINK_INSTALL_FLAGS=-sf
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling symlinks for install" >&5
-$as_echo "Enabling symlinks for install" >&6; }
-fi
-
-else
-  LINK_INSTALL_FLAGS=-f
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for install by default" >&5
-$as_echo "Disabling symlinks for install by default" >&6; }
-
-fi
-
-
-relative_symlink_defined=
-# Check whether --enable-relative-symlinks was given.
-if test "${enable_relative_symlinks+set}" = set; then :
-  enableval=$enable_relative_symlinks; if test "$enableval" = "no"
-then
-	SYMLINK_RELATIVE=
-	relative_symlink_defined=yes
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling relative symlinks for install" >&5
-$as_echo "Disabling relative symlinks for install" >&6; }
-else
-	SYMLINK_RELATIVE=--relative
-	relative_symlink_defined=yes
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling relative symlinks for install" >&5
-$as_echo "Enabling relative symlinks for install" >&6; }
-fi
-fi
-
-# Check whether --enable-symlink-relative-symlinks was given.
-if test "${enable_symlink_relative_symlinks+set}" = set; then :
-  enableval=$enable_symlink_relative_symlinks; if test "$enableval" = "no"
-then
-	SYMLINK_RELATIVE=yes
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling relative symlinks for install" >&5
-$as_echo "Disabling relative symlinks for install" >&6; }
-else
-	SYMLINK_RELATIVE=--relative
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling relative symlinks for install" >&5
-$as_echo "Enabling relative symlinks for install" >&6; }
-fi
-
-else
-  if test -z "$relative_symlink_defined"
-then
-	SYMLINK_RELATIVE=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling relative symlinks for install by default" >&5
-$as_echo "Disabling relative symlinks for install by default" >&6; }
-fi
-
-fi
-
-
-# Check whether --enable-symlink-build was given.
-if test "${enable_symlink_build+set}" = set; then :
-  enableval=$enable_symlink_build; if test "$enableval" = "no"
-then
-	LINK_BUILD_FLAGS=
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for build" >&5
-$as_echo "Disabling symlinks for build" >&6; }
-else
-	LINK_BUILD_FLAGS=-s
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling symlinks for build" >&5
-$as_echo "Enabling symlinks for build" >&6; }
-fi
-
-else
-  LINK_BUILD_FLAGS=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for build by default" >&5
-$as_echo "Disabling symlinks for build by default" >&6; }
-
-fi
-
-
-# Check whether --enable-verbose-makecmds was given.
-if test "${enable_verbose_makecmds+set}" = set; then :
-  enableval=$enable_verbose_makecmds; if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling verbose make commands" >&5
-$as_echo "Disabling verbose make commands" >&6; }
-	E=@echo
-	ES=echo
-	Q=@
-else
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling verbose make commands" >&5
-$as_echo "Enabling verbose make commands" >&6; }
-	E=@\\#
-	ES=\\#
-	Q=
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling verbose make commands" >&5
-$as_echo "Disabling verbose make commands" >&6; }
-E=@echo
-ES=echo
-Q=@
-
-fi
-
-
-
-
-# Check whether --enable-compression was given.
-if test "${enable_compression+set}" = set; then :
-  enableval=$enable_compression; if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling compression support" >&5
-$as_echo "Disabling compression support" >&6; }
-else
-
-$as_echo "#define ENABLE_COMPRESSION 1" >>confdefs.h
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling compression support" >&5
-$as_echo "Enabling compression support" >&6; }
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Compression support is experimental" >&5
-$as_echo "$as_me: WARNING: Compression support is experimental" >&2;}
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling compression support by default" >&5
-$as_echo "Disabling compression support by default" >&6; }
-
-fi
-
-
-# Check whether --enable-htree was given.
-if test "${enable_htree+set}" = set; then :
-  enableval=$enable_htree; if test "$enableval" = "no"
-then
-	HTREE_CMT=#
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling htree directory support" >&5
-$as_echo "Disabling htree directory support" >&6; }
-else
-	HTREE_CMT=
-	$as_echo "#define ENABLE_HTREE 1" >>confdefs.h
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling htree directory support" >&5
-$as_echo "Enabling htree directory support" >&6; }
-fi
-
-else
-  HTREE_CMT=
-$as_echo "#define ENABLE_HTREE 1" >>confdefs.h
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling htree directory support by default" >&5
-$as_echo "Enabling htree directory support by default" >&6; }
-
-fi
-
-
-E2_PKG_CONFIG_STATIC=--static
-LDFLAG_DYNAMIC=
-PRIVATE_LIBS_CMT=
-# Check whether --enable-elf-shlibs was given.
-if test "${enable_elf_shlibs+set}" = set; then :
-  enableval=$enable_elf_shlibs; if test "$enableval" = "no"
-then
-	ELF_CMT=#
-	MAKEFILE_ELF=/dev/null
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling ELF shared libraries" >&5
-$as_echo "Disabling ELF shared libraries" >&6; }
-else
-	E2_PKG_CONFIG_STATIC=
-	ELF_CMT=
-	MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
-	case "$host_os" in
-	solaris2.*)
-		MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
-	;;
-	esac
-	BINARY_TYPE=elfbin
-	LIB_EXT=.so
-	PRIVATE_LIBS_CMT=#
-	LDFLAG_DYNAMIC='-Wl,-rpath-link,$(top_builddir)/lib'
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling ELF shared libraries" >&5
-$as_echo "Enabling ELF shared libraries" >&6; }
-fi
-
-else
-  MAKEFILE_ELF=/dev/null
-ELF_CMT=#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling ELF shared libraries by default" >&5
-$as_echo "Disabling ELF shared libraries by default" >&6; }
-
-fi
-
-
-
-# Check whether --enable-bsd-shlibs was given.
-if test "${enable_bsd_shlibs+set}" = set; then :
-  enableval=$enable_bsd_shlibs; if test "$enableval" = "no"
-then
-	BSDLIB_CMT=#
-	MAKEFILE_BSDLIB=/dev/null
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling BSD shared libraries" >&5
-$as_echo "Disabling BSD shared libraries" >&6; }
-else
-	E2_PKG_CONFIG_STATIC=
-	BSDLIB_CMT=
-	MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
-	LIB_EXT=.so
-	case "$host_os" in
-	darwin*)
-		MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
-		LIB_EXT=.dylib
-	;;
-	esac
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling BSD shared libraries" >&5
-$as_echo "Enabling BSD shared libraries" >&6; }
-fi
-
-else
-  MAKEFILE_BSDLIB=/dev/null
-BSDLIB_CMT=#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling BSD shared libraries by default" >&5
-$as_echo "Disabling BSD shared libraries by default" >&6; }
-
-fi
-
-
-
-# Check whether --enable-profile was given.
-if test "${enable_profile+set}" = set; then :
-  enableval=$enable_profile; if test "$enableval" = "no"
-then
-	PROFILE_CMT=#
-	MAKEFILE_PROFILE=/dev/null
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling profiling libraries" >&5
-$as_echo "Disabling profiling libraries" >&6; }
-else
-	PROFILE_CMT=
-	MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
-	PROFILED_LIB_EXT=_p.a
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building profiling libraries" >&5
-$as_echo "Building profiling libraries" >&6; }
-fi
-
-else
-  PROFILE_CMT=#
-MAKEFILE_PROFILE=/dev/null
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling profiling libraries by default" >&5
-$as_echo "Disabling profiling libraries by default" >&6; }
-
-fi
-
-
-
-# Check whether --enable-checker was given.
-if test "${enable_checker+set}" = set; then :
-  enableval=$enable_checker; if test "$enableval" = "no"
-then
-	CHECKER_CMT=#
-	MAKEFILE_CHECKER=/dev/null
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling checker libraries" >&5
-$as_echo "Disabling checker libraries" >&6; }
-else
-	CHECKER_CMT=
-	MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building checker libraries" >&5
-$as_echo "Building checker libraries" >&6; }
-fi
-
-else
-  CHECKER_CMT=#
-MAKEFILE_CHECKER=/dev/null
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling checker libraries by default" >&5
-$as_echo "Disabling checker libraries by default" >&6; }
-
-fi
-
-
-
-
-
-
-
-
-# Check whether --enable-jbd-debug was given.
-if test "${enable_jbd_debug+set}" = set; then :
-  enableval=$enable_jbd_debug; if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling journal debugging" >&5
-$as_echo "Disabling journal debugging" >&6; }
-else
-
-$as_echo "#define CONFIG_JBD_DEBUG 1" >>confdefs.h
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling journal debugging" >&5
-$as_echo "Enabling journal debugging" >&6; }
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling journal debugging by default" >&5
-$as_echo "Disabling journal debugging by default" >&6; }
-
-fi
-
-# Check whether --enable-blkid-debug was given.
-if test "${enable_blkid_debug+set}" = set; then :
-  enableval=$enable_blkid_debug; if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling blkid debugging" >&5
-$as_echo "Disabling blkid debugging" >&6; }
-else
-
-$as_echo "#define CONFIG_BLKID_DEBUG 1" >>confdefs.h
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling blkid debugging" >&5
-$as_echo "Enabling blkid debugging" >&6; }
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling blkid debugging by default" >&5
-$as_echo "Disabling blkid debugging by default" >&6; }
-
-fi
-
-# Check whether --enable-testio-debug was given.
-if test "${enable_testio_debug+set}" = set; then :
-  enableval=$enable_testio_debug;
-if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling testio debugging" >&5
-$as_echo "Disabling testio debugging" >&6; }
-	TEST_IO_CMT="#"
-else
-	TEST_IO_CMT=
-	$as_echo "#define CONFIG_TESTIO_DEBUG 1" >>confdefs.h
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling testio debugging" >&5
-$as_echo "Enabling testio debugging" >&6; }
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling testio debugging by default" >&5
-$as_echo "Enabling testio debugging by default" >&6; }
-$as_echo "#define CONFIG_TESTIO_DEBUG 1" >>confdefs.h
-
-TEST_IO_CMT=
-
-fi
-
-
-
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-        if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
-        _pkg_min_version=0.9.0
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-        else
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-                PKG_CONFIG=""
-        fi
-
-fi
-LIBUUID=
-DEPLIBUUID=
-STATIC_LIBUUID=
-DEPSTATIC_LIBUUID=
-PROFILED_LIBUUID=
-DEPPROFILED_LIBUUID=
-UUID_CMT=
-# Check whether --enable-libuuid was given.
-if test "${enable_libuuid+set}" = set; then :
-  enableval=$enable_libuuid; if test "$enableval" = "no"
-then
-	if test -z "$PKG_CONFIG"; then
-		as_fn_error $? "pkg-config not installed; please install it." "$LINENO" 5
-	fi
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
-$as_echo_n "checking for uuid_generate in -luuid... " >&6; }
-if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-luuid $LIBUUID $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char uuid_generate ();
-int
-main ()
-{
-return uuid_generate ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_uuid_uuid_generate=yes
-else
-  ac_cv_lib_uuid_uuid_generate=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
-$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
-  LIBUUID=`$PKG_CONFIG --libs uuid`;
-		 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`
-else
-  as_fn_error $? "external uuid library not found" "$LINENO" 5
-fi
-
-	UUID_CMT=#
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling private uuid library" >&5
-$as_echo "Disabling private uuid library" >&6; }
-else
-	LIBUUID='$(LIB)/libuuid'$LIB_EXT
-	DEPLIBUUID=$LIBUUID
-	STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
-	DEPSTATIC_LIBUUID=$STATIC_LIBUUID
-	PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
-	DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling private uuid library" >&5
-$as_echo "Enabling private uuid library" >&6; }
-fi
-
-else
-  LIBUUID='$(LIB)/libuuid'$LIB_EXT
-DEPLIBUUID=$LIBUUID
-STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
-DEPSTATIC_LIBUUID=$STATIC_LIBUUID
-PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
-DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling private uuid library by default" >&5
-$as_echo "Enabling private uuid library by default" >&6; }
-
-fi
-
-
-
-
-
-
-
-
-
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-        if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
-        _pkg_min_version=0.9.0
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-        else
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-                PKG_CONFIG=""
-        fi
-
-fi
-LIBBLKID=
-DEPLIBBLKID=
-STATIC_LIBBLKID=
-DEPSTATIC_LIBBLKID=
-PROFILED_LIBBLKID=
-DEPPROFILED_LIBBLKID=
-BLKID_CMT=
-
-# Check whether --enable-libblkid was given.
-if test "${enable_libblkid+set}" = set; then :
-  enableval=$enable_libblkid; if test "$enableval" = "no"
-then
-	if test -z "$PKG_CONFIG"; then
-		as_fn_error $? "pkg-config not installed; please install it." "$LINENO" 5
-	fi
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for blkid_get_cache in -lblkid" >&5
-$as_echo_n "checking for blkid_get_cache in -lblkid... " >&6; }
-if ${ac_cv_lib_blkid_blkid_get_cache+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lblkid $LIBBLKID $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char blkid_get_cache ();
-int
-main ()
-{
-return blkid_get_cache ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_blkid_blkid_get_cache=yes
-else
-  ac_cv_lib_blkid_blkid_get_cache=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blkid_blkid_get_cache" >&5
-$as_echo "$ac_cv_lib_blkid_blkid_get_cache" >&6; }
-if test "x$ac_cv_lib_blkid_blkid_get_cache" = xyes; then :
-  LIBBLKID=`$PKG_CONFIG --libs blkid`;
-		 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`
-else
-  as_fn_error $? "external blkid library not found" "$LINENO" 5
-fi
-
-	BLKID_CMT=#
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling private blkid library" >&5
-$as_echo "Disabling private blkid library" >&6; }
-else
-	LIBBLKID='$(LIB)/libblkid'$LIB_EXT
-	DEPLIBBLKID=$LIBBLKID
-	STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
-	DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
-	PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
-	DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
-	$as_echo "#define CONFIG_BUILD_FINDFS 1" >>confdefs.h
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling private blkid library" >&5
-$as_echo "Enabling private blkid library" >&6; }
-fi
-
-else
-  LIBBLKID='$(LIB)/libblkid'$LIB_EXT
-DEPLIBBLKID=$LIBBLKID
-STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
-DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
-PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
-DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
-$as_echo "#define CONFIG_BUILD_FINDFS 1" >>confdefs.h
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling private blkid library by default" >&5
-$as_echo "Enabling private blkid library by default" >&6; }
-
-fi
-
-
-
-
-
-
-
-
-QUOTA_MAN_COMMENT='.\"'
-QUOTA_CMT=
-
-
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-        if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
-        _pkg_min_version=0.9.0
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-        else
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-                PKG_CONFIG=""
-        fi
-
-fi
-
-# Check whether --enable-quota was given.
-if test "${enable_quota+set}" = set; then :
-  enableval=$enable_quota; if test "$enableval" = "no"
-then
-	QUOTA_CMT=#
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling quota support" >&5
-$as_echo "Disabling quota support" >&6; }
-else
-	QUOTA_CMT=
-	$as_echo "#define CONFIG_QUOTA 1" >>confdefs.h
-
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling quota support" >&5
-$as_echo "Enabling quota support" >&6; }
-	QUOTA_MAN_COMMENT=""
-
-fi
-
-else
-  QUOTA_CMT=#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling quota support by default" >&5
-$as_echo "Disabling quota support by default" >&6; }
-
-fi
-
-LIBQUOTA='$(LIB)/libquota'$LIB_EXT
-DEPLIBQUOTA=$LIBQUOTA
-STATIC_LIBQUOTA='$(LIB)/libquota'$STATIC_LIB_EXT
-DEPSTATIC_LIBQUOTA=$STATIC_LIBQUOTA
-PROFILED_LIBQUOTA='$(LIB)/libquota'$PROFILED_LIB_EXT
-DEPPROFILED_LIBQUOTA=$PROFILED_LIBQUOTA
-
-
-
-
-
-
-
-
-# Check whether --enable-backtrace was given.
-if test "${enable_backtrace+set}" = set; then :
-  enableval=$enable_backtrace; if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling use of backtrace" >&5
-$as_echo "Disabling use of backtrace" >&6; }
-	$as_echo "#define DISABLE_BACKTRACE 1" >>confdefs.h
-
-else
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling use of backtrace" >&5
-$as_echo "Enabling use of backtrace" >&6; }
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling use of backtrace by default" >&5
-$as_echo "Enabling use of backtrace by default" >&6; }
-
-fi
-
-# Check whether --enable-debugfs was given.
-if test "${enable_debugfs+set}" = set; then :
-  enableval=$enable_debugfs; if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling debugfs support" >&5
-$as_echo "Disabling debugfs support" >&6; }
-	DEBUGFS_CMT="#"
-else
-	DEBUGFS_CMT=
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling debugfs support" >&5
-$as_echo "Enabling debugfs support" >&6; }
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling debugfs support by default" >&5
-$as_echo "Enabling debugfs support by default" >&6; }
-DEBUGFS_CMT=
-
-fi
-
-
-# Check whether --enable-imager was given.
-if test "${enable_imager+set}" = set; then :
-  enableval=$enable_imager; if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling e2image support" >&5
-$as_echo "Disabling e2image support" >&6; }
-	IMAGER_CMT="#"
-else
-	IMAGER_CMT=
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e2image support" >&5
-$as_echo "Enabling e2image support" >&6; }
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e2image support by default" >&5
-$as_echo "Enabling e2image support by default" >&6; }
-IMAGER_CMT=
-
-fi
-
-
-# Check whether --enable-resizer was given.
-if test "${enable_resizer+set}" = set; then :
-  enableval=$enable_resizer; if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling e2resize support" >&5
-$as_echo "Disabling e2resize support" >&6; }
-	RESIZER_CMT="#"
-else
-	RESIZER_CMT=
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e2resize support" >&5
-$as_echo "Enabling e2resize support" >&6; }
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e2resize support by default" >&5
-$as_echo "Enabling e2resize support by default" >&6; }
-RESIZER_CMT=
-
-fi
-
-
-# Check whether --enable-defrag was given.
-if test "${enable_defrag+set}" = set; then :
-  enableval=$enable_defrag; if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling e4defrag support" >&5
-$as_echo "Disabling e4defrag support" >&6; }
-	DEFRAG_CMT="#"
-else
-	DEFRAG_CMT=
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e4defrag support" >&5
-$as_echo "Enabling e4defrag support" >&6; }
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e4defrag support by default" >&5
-$as_echo "Enabling e4defrag support by default" >&6; }
-DEFRAG_CMT=
-
-fi
-
-
-# Check whether --enable-fsck was given.
-if test "${enable_fsck+set}" = set; then :
-  enableval=$enable_fsck; if test "$enableval" = "no"
-then
-	FSCK_PROG='' FSCK_MAN=''
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Not building fsck wrapper" >&5
-$as_echo "Not building fsck wrapper" >&6; }
-else
-	FSCK_PROG=fsck FSCK_MAN=fsck.8
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building fsck wrapper" >&5
-$as_echo "Building fsck wrapper" >&6; }
-fi
-
-else
-  case "$host_os" in
-  gnu*)
-    FSCK_PROG='' FSCK_MAN=''
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not building fsck wrapper by default" >&5
-$as_echo "Not building fsck wrapper by default" >&6; }
-    ;;
-  *)
-    FSCK_PROG=fsck FSCK_MAN=fsck.8
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Building fsck wrapper by default" >&5
-$as_echo "Building fsck wrapper by default" >&6; }
-esac
-
-fi
-
-
-
-# Check whether --enable-e2initrd-helper was given.
-if test "${enable_e2initrd_helper+set}" = set; then :
-  enableval=$enable_e2initrd_helper; if test "$enableval" = "no"
-then
-	E2INITRD_PROG='' E2INITRD_MAN=''
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Not building e2initrd helper" >&5
-$as_echo "Not building e2initrd helper" >&6; }
-else
-	E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building e2initrd helper" >&5
-$as_echo "Building e2initrd helper" >&6; }
-fi
-
-else
-  E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building e2initrd helper by default" >&5
-$as_echo "Building e2initrd helper by default" >&6; }
-
-fi
-
-
-
-# Check whether --enable-tls was given.
-if test "${enable_tls+set}" = set; then :
-  enableval=$enable_tls; if test "$enableval" = "no"
-then
-	try_tls=""
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling thread local support" >&5
-$as_echo "Disabling thread local support" >&6; }
-else
-	try_tls="yes"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling thread local support" >&5
-$as_echo "Enabling thread local support" >&6; }
-fi
-
-else
-  if test -n "$WITH_DIET_LIBC"
-then
-	try_tls=""
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Diet libc does not support thread local support" >&5
-$as_echo "Diet libc does not support thread local support" >&6; }
-else
-	try_tls="yes"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Try using thread local support by default" >&5
-$as_echo "Try using thread local support by default" >&6; }
-fi
-
-fi
-
-if test "$try_tls" = "yes"
-then
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread local storage (TLS) class" >&5
-$as_echo_n "checking for thread local storage (TLS) class... " >&6; }
-  if ${ac_cv_tls+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    ax_tls_keywords="__thread __declspec(thread) none"
-    for ax_tls_keyword in $ax_tls_keywords; do
-       case $ax_tls_keyword in
-          none) ac_cv_tls=none ; break ;;
-          *)
-             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-                 static void
-                 foo(void) {
-                 static  $ax_tls_keyword  int bar;
-                 exit(1);
-                 }
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_tls=$ax_tls_keyword ; break
-else
-  ac_cv_tls=none
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-          esac
-    done
-
-fi
-
-
-  if test "$ac_cv_tls" != "none"; then
-
-cat >>confdefs.h <<_ACEOF
-#define TLS $ac_cv_tls
-_ACEOF
-
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5
-$as_echo "$ac_cv_tls" >&6; }
-
-fi
-
-# Check whether --enable-uuidd was given.
-if test "${enable_uuidd+set}" = set; then :
-  enableval=$enable_uuidd; if test "$enableval" = "no"
-then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Not building uuidd" >&5
-$as_echo "Not building uuidd" >&6; }
-	UUIDD_CMT="#"
-else
-	$as_echo "#define USE_UUIDD 1" >>confdefs.h
-
-	UUIDD_CMT=""
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building uuidd" >&5
-$as_echo "Building uuidd" >&6; }
-fi
-
-else
-  $as_echo "#define USE_UUIDD 1" >>confdefs.h
-
-UUIDD_CMT=""
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building uuidd by default" >&5
-$as_echo "Building uuidd by default" >&6; }
-
-fi
-
-
-MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
-
-GETTEXT_PACKAGE=e2fsprogs
-PACKAGE=e2fsprogs
-VERSION="$E2FSPROGS_VERSION"
-VERSION=0.14.1
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
-	@echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
-  *@@@%%%=?*=@@@%%%*)
-    eval ac_cv_prog_make_${ac_make}_set=yes;;
-  *)
-    eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-  SET_MAKE=
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
-  ./ | .// | /[cC]/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-	  if test $ac_prog = install &&
-	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # AIX install.  It has an incompatible calling convention.
-	    :
-	  elif test $ac_prog = install &&
-	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # program-specific install script used by HP pwplus--don't use.
-	    :
-	  else
-	    rm -rf conftest.one conftest.two conftest.dir
-	    echo one > conftest.one
-	    echo two > conftest.two
-	    mkdir conftest.dir
-	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
-	      test -s conftest.one && test -s conftest.two &&
-	      test -s conftest.dir/conftest.one &&
-	      test -s conftest.dir/conftest.two
-	    then
-	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	      break 3
-	    fi
-	  fi
-	fi
-      done
-    done
-    ;;
-esac
-
-  done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    INSTALL=$ac_install_sh
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-
-        MKINSTALLDIRS=
-  if test -n "$ac_aux_dir"; then
-    case "$ac_aux_dir" in
-      /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
-      *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
-    esac
-  fi
-  if test -z "$MKINSTALLDIRS"; then
-    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
-  fi
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
-$as_echo_n "checking whether NLS is requested... " >&6; }
-    # Check whether --enable-nls was given.
-if test "${enable_nls+set}" = set; then :
-  enableval=$enable_nls; USE_NLS=$enableval
-else
-  USE_NLS=yes
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
-$as_echo "$USE_NLS" >&6; }
-
-
-
-
-
-
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-# Find out how to test for executable files. Don't use a zero-byte file,
-# as systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
-  ac_executable_p="test -x"
-else
-  ac_executable_p="test -f"
-fi
-rm -f conf$$.file
-
-# Extract the first word of "msgfmt", so it can be a program name with args.
-set dummy msgfmt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MSGFMT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case "$MSGFMT" in
-  [\\/]* | ?:[\\/]*)
-    ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
-    ;;
-  *)
-    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH; do
-      IFS="$ac_save_IFS"
-      test -z "$ac_dir" && ac_dir=.
-      for ac_exec_ext in '' $ac_executable_extensions; do
-        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
-          if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
-     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
-            ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
-            break 2
-          fi
-        fi
-      done
-    done
-    IFS="$ac_save_IFS"
-  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
-    ;;
-esac
-fi
-MSGFMT="$ac_cv_path_MSGFMT"
-if test "$MSGFMT" != ":"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
-$as_echo "$MSGFMT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  # Extract the first word of "gmsgfmt", so it can be a program name with args.
-set dummy gmsgfmt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GMSGFMT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $GMSGFMT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
-  ;;
-esac
-fi
-GMSGFMT=$ac_cv_path_GMSGFMT
-if test -n "$GMSGFMT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
-$as_echo "$GMSGFMT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-# Find out how to test for executable files. Don't use a zero-byte file,
-# as systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
-  ac_executable_p="test -x"
-else
-  ac_executable_p="test -f"
-fi
-rm -f conf$$.file
-
-# Extract the first word of "xgettext", so it can be a program name with args.
-set dummy xgettext; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XGETTEXT+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case "$XGETTEXT" in
-  [\\/]* | ?:[\\/]*)
-    ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
-    ;;
-  *)
-    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH; do
-      IFS="$ac_save_IFS"
-      test -z "$ac_dir" && ac_dir=.
-      for ac_exec_ext in '' $ac_executable_extensions; do
-        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
-          if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
-     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
-            ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext"
-            break 2
-          fi
-        fi
-      done
-    done
-    IFS="$ac_save_IFS"
-  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
-    ;;
-esac
-fi
-XGETTEXT="$ac_cv_path_XGETTEXT"
-if test "$XGETTEXT" != ":"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
-$as_echo "$XGETTEXT" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-    rm -f messages.po
-
-
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
-
-# Find out how to test for executable files. Don't use a zero-byte file,
-# as systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
-  ac_executable_p="test -x"
-else
-  ac_executable_p="test -f"
-fi
-rm -f conf$$.file
-
-# Extract the first word of "msgmerge", so it can be a program name with args.
-set dummy msgmerge; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_MSGMERGE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case "$MSGMERGE" in
-  [\\/]* | ?:[\\/]*)
-    ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
-    ;;
-  *)
-    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH; do
-      IFS="$ac_save_IFS"
-      test -z "$ac_dir" && ac_dir=.
-      for ac_exec_ext in '' $ac_executable_extensions; do
-        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
-          if $ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1; then
-            ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
-            break 2
-          fi
-        fi
-      done
-    done
-    IFS="$ac_save_IFS"
-  test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
-    ;;
-esac
-fi
-MSGMERGE="$ac_cv_path_MSGMERGE"
-if test "$MSGMERGE" != ":"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
-$as_echo "$MSGMERGE" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-      if test "$GMSGFMT" != ":"; then
-            if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
-       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
-      : ;
-    else
-      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $GMSGFMT program is not GNU msgfmt; ignore it" >&5
-$as_echo "found $GMSGFMT program is not GNU msgfmt; ignore it" >&6; }
-      GMSGFMT=":"
-    fi
-  fi
-
-      if test "$XGETTEXT" != ":"; then
-            if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
-       (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
-      : ;
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: found xgettext program is not GNU xgettext; ignore it" >&5
-$as_echo "found xgettext program is not GNU xgettext; ignore it" >&6; }
-      XGETTEXT=":"
-    fi
-        rm -f messages.po
-  fi
-
-  ac_config_commands="$ac_config_commands default-1"
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror in -lcposix" >&5
-$as_echo_n "checking for strerror in -lcposix... " >&6; }
-if ${ac_cv_lib_cposix_strerror+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcposix  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char strerror ();
-int
-main ()
-{
-return strerror ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_cposix_strerror=yes
-else
-  ac_cv_lib_cposix_strerror=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cposix_strerror" >&5
-$as_echo "$ac_cv_lib_cposix_strerror" >&6; }
-if test "x$ac_cv_lib_cposix_strerror" = xyes; then :
-  LIBS="$LIBS -lcposix"
-fi
-
-
-
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
@@ -6436,161 +4717,6 @@
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-#ifndef __cplusplus
-  /* Ultrix mips cc rejects this sort of thing.  */
-  typedef int charset[2];
-  const charset cs = { 0, 0 };
-  /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *pcpcc;
-  char **ppc;
-  /* NEC SVR4.0.2 mips cc rejects this.  */
-  struct point {int x, y;};
-  static struct point const zero = {0,0};
-  /* AIX XL C 1.02.0.0 rejects this.
-     It does not let you subtract one const X* pointer from another in
-     an arm of an if-expression whose if-part is not a constant
-     expression */
-  const char *g = "string";
-  pcpcc = &g + (g ? g-g : 0);
-  /* HPUX 7.0 cc rejects these. */
-  ++pcpcc;
-  ppc = (char**) pcpcc;
-  pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this sort of thing.  */
-    char tx;
-    char *t = &tx;
-    char const *s = 0 ? (char *) 0 : (char const *) 0;
-
-    *t++ = 0;
-    if (s) return 0;
-  }
-  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
-    int x[] = {25, 17};
-    const int *foo = &x[0];
-    ++foo;
-  }
-  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
-    typedef const int *iptr;
-    iptr p = 0;
-    ++p;
-  }
-  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
-       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; } bx;
-    struct s *b = &bx; b->j = 5;
-  }
-  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
-    const int foo = 10;
-    if (!foo) return 0;
-  }
-  return !cs[0] && !zero.x;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_const=yes
-else
-  ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed" >&5
-$as_echo_n "checking for signed... " >&6; }
-if ${bh_cv_c_signed+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-signed char x;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  bh_cv_c_signed=yes
-else
-  bh_cv_c_signed=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $bh_cv_c_signed" >&5
-$as_echo "$bh_cv_c_signed" >&6; }
-  if test $bh_cv_c_signed = no; then
-
-$as_echo "#define signed /**/" >>confdefs.h
-
-  fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
-    ;;
-esac
-
 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
 		  inttypes.h stdint.h unistd.h
@@ -6608,1091 +4734,2583 @@
 done
 
 
-ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = xyes; then :
 
+  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
+  MINIX=yes
 else
-
-cat >>confdefs.h <<_ACEOF
-#define off_t long int
-_ACEOF
-
-fi
-
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
+  MINIX=
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long" >&5
-$as_echo_n "checking for long long... " >&6; }
-if ${ac_cv_type_long_long+:} false; then :
+  if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+  fi
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-long long ll = 1LL; int i = 63;
+
+#         define __EXTENSIONS__ 1
+          $ac_includes_default
 int
 main ()
 {
-long long llmax = (long long) -1;
-     return ll << i | ll >> i | llmax / ll | llmax % ll;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_safe_to_define___extensions__=yes
+else
+  ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+  test $ac_cv_safe_to_define___extensions__ = yes &&
+    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
+LIB_EXT=.a
+STATIC_LIB_EXT=.a
+PROFILED_LIB_EXT=.a
+
+# Check whether --with-root-prefix was given.
+if test "${with_root_prefix+set}" = set; then :
+  withval=$with_root_prefix; root_prefix=$withval
+else
+  root_prefix=NONE
+fi
+# Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; if test "$enableval" = "no"
+then
+	MAINTAINER_CMT=#
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling maintainer mode" >&5
+$as_echo "Disabling maintainer mode" >&6; }
+else
+	MAINTAINER_CMT=
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling maintainer mode" >&5
+$as_echo "Enabling maintainer mode" >&6; }
+fi
+
+else
+  MAINTAINER_CMT=#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling maintainer mode by default" >&5
+$as_echo "Disabling maintainer mode by default" >&6; }
+
+fi
+
+
+# Check whether --enable-symlink-install was given.
+if test "${enable_symlink_install+set}" = set; then :
+  enableval=$enable_symlink_install; if test "$enableval" = "no"
+then
+	LINK_INSTALL_FLAGS=-f
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for install" >&5
+$as_echo "Disabling symlinks for install" >&6; }
+else
+	LINK_INSTALL_FLAGS=-sf
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling symlinks for install" >&5
+$as_echo "Enabling symlinks for install" >&6; }
+fi
+
+else
+  LINK_INSTALL_FLAGS=-f
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for install by default" >&5
+$as_echo "Disabling symlinks for install by default" >&6; }
+
+fi
+
+
+relative_symlink_defined=
+# Check whether --enable-relative-symlinks was given.
+if test "${enable_relative_symlinks+set}" = set; then :
+  enableval=$enable_relative_symlinks; if test "$enableval" = "no"
+then
+	SYMLINK_RELATIVE=
+	relative_symlink_defined=yes
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling relative symlinks for install" >&5
+$as_echo "Disabling relative symlinks for install" >&6; }
+else
+	SYMLINK_RELATIVE=--relative
+	relative_symlink_defined=yes
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling relative symlinks for install" >&5
+$as_echo "Enabling relative symlinks for install" >&6; }
+fi
+fi
+
+# Check whether --enable-symlink-relative-symlinks was given.
+if test "${enable_symlink_relative_symlinks+set}" = set; then :
+  enableval=$enable_symlink_relative_symlinks; if test "$enableval" = "no"
+then
+	SYMLINK_RELATIVE=yes
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling relative symlinks for install" >&5
+$as_echo "Disabling relative symlinks for install" >&6; }
+else
+	SYMLINK_RELATIVE=--relative
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling relative symlinks for install" >&5
+$as_echo "Enabling relative symlinks for install" >&6; }
+fi
+
+else
+  if test -z "$relative_symlink_defined"
+then
+	SYMLINK_RELATIVE=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling relative symlinks for install by default" >&5
+$as_echo "Disabling relative symlinks for install by default" >&6; }
+fi
+
+fi
+
+
+# Check whether --enable-symlink-build was given.
+if test "${enable_symlink_build+set}" = set; then :
+  enableval=$enable_symlink_build; if test "$enableval" = "no"
+then
+	LINK_BUILD_FLAGS=
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for build" >&5
+$as_echo "Disabling symlinks for build" >&6; }
+else
+	LINK_BUILD_FLAGS=-s
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling symlinks for build" >&5
+$as_echo "Enabling symlinks for build" >&6; }
+fi
+
+else
+  LINK_BUILD_FLAGS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling symlinks for build by default" >&5
+$as_echo "Disabling symlinks for build by default" >&6; }
+
+fi
+
+
+# Check whether --enable-verbose-makecmds was given.
+if test "${enable_verbose_makecmds+set}" = set; then :
+  enableval=$enable_verbose_makecmds; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling verbose make commands" >&5
+$as_echo "Disabling verbose make commands" >&6; }
+	E=@echo
+	ES=echo
+	Q=@
+else
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling verbose make commands" >&5
+$as_echo "Enabling verbose make commands" >&6; }
+	E=@\\#
+	ES=\\#
+	Q=
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling verbose make commands" >&5
+$as_echo "Disabling verbose make commands" >&6; }
+E=@echo
+ES=echo
+Q=@
+
+fi
+
+
+
+
+E2_PKG_CONFIG_STATIC=--static
+LDFLAG_DYNAMIC=
+PRIVATE_LIBS_CMT=
+# Check whether --enable-elf-shlibs was given.
+if test "${enable_elf_shlibs+set}" = set; then :
+  enableval=$enable_elf_shlibs; if test "$enableval" = "no"
+then
+	ELF_CMT=#
+	MAKEFILE_ELF=/dev/null
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling ELF shared libraries" >&5
+$as_echo "Disabling ELF shared libraries" >&6; }
+else
+	E2_PKG_CONFIG_STATIC=
+	ELF_CMT=
+	MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
+	case "$host_os" in
+	solaris2.*)
+		MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
+	;;
+	esac
+	BINARY_TYPE=elfbin
+	LIB_EXT=.so
+	PRIVATE_LIBS_CMT=#
+	LDFLAG_DYNAMIC='-Wl,-rpath-link,$(top_builddir)/lib'
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling ELF shared libraries" >&5
+$as_echo "Enabling ELF shared libraries" >&6; }
+fi
+
+else
+  MAKEFILE_ELF=/dev/null
+ELF_CMT=#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling ELF shared libraries by default" >&5
+$as_echo "Disabling ELF shared libraries by default" >&6; }
+
+fi
+
+
+
+# Check whether --enable-bsd-shlibs was given.
+if test "${enable_bsd_shlibs+set}" = set; then :
+  enableval=$enable_bsd_shlibs; if test "$enableval" = "no"
+then
+	BSDLIB_CMT=#
+	MAKEFILE_BSDLIB=/dev/null
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling BSD shared libraries" >&5
+$as_echo "Disabling BSD shared libraries" >&6; }
+else
+	E2_PKG_CONFIG_STATIC=
+	BSDLIB_CMT=
+	MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
+	LIB_EXT=.so
+	case "$host_os" in
+	darwin*)
+		MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
+		LIB_EXT=.dylib
+	;;
+	esac
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling BSD shared libraries" >&5
+$as_echo "Enabling BSD shared libraries" >&6; }
+fi
+
+else
+  MAKEFILE_BSDLIB=/dev/null
+BSDLIB_CMT=#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling BSD shared libraries by default" >&5
+$as_echo "Disabling BSD shared libraries by default" >&6; }
+
+fi
+
+
+
+# Check whether --enable-profile was given.
+if test "${enable_profile+set}" = set; then :
+  enableval=$enable_profile; if test "$enableval" = "no"
+then
+	PROFILE_CMT=#
+	MAKEFILE_PROFILE=/dev/null
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling profiling libraries" >&5
+$as_echo "Disabling profiling libraries" >&6; }
+else
+	PROFILE_CMT=
+	MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
+	PROFILED_LIB_EXT=_p.a
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building profiling libraries" >&5
+$as_echo "Building profiling libraries" >&6; }
+fi
+
+else
+  PROFILE_CMT=#
+MAKEFILE_PROFILE=/dev/null
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling profiling libraries by default" >&5
+$as_echo "Disabling profiling libraries by default" >&6; }
+
+fi
+
+
+
+# Check whether --enable-gcov was given.
+if test "${enable_gcov+set}" = set; then :
+  enableval=$enable_gcov; if test "$enableval" = "yes"
+then
+	CFLAGS="-g -fprofile-arcs -ftest-coverage"
+	LDFLAGS="-fprofile-arcs -ftest-coverage"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling gcov support" >&5
+$as_echo "Enabling gcov support" >&6; }
+fi
+
+fi
+
+CFLAGS_SHLIB="${CFLAGS_SHLIB:-$CFLAGS}"
+CFLAGS_STLIB="${CFLAGS_STLIB:-$CFLAGS}"
+LDFLAGS_SHLIB=${LDFLAGS_SHLIB:-$LDFLAGS}
+LDFLAGS_STATIC=${LDFLAGS_STATIC:-$LDFLAGS}
+# Check whether --enable-hardening was given.
+if test "${enable_hardening+set}" = set; then :
+  enableval=$enable_hardening; if test "$enableval" = "yes"
+then
+	HARDEN_CFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-strong"
+	HARDEN_LDFLAGS="-Wl,-z,relro -Wl,-z,now"
+	CFLAGS="$CFLAGS $HARDEN_CFLAGS -fPIE"
+	CFLAGS_SHLIB="$CFLAGS_SHLIB $HARDEN_CFLAGS"
+	CFLAGS_STLIB="$CFLAGS_STLIB $HARDEN_CFLAGS -fPIE"
+	LDFLAGS="$LDFLAGS $HARDEN_LDFLAGS -fPIE -pie"
+	LDFLAGS_STATIC="$LDFLAGS_STATIC $HARDEN_LDFLAGS"
+	LDFLAGS_SHLIB="$LDFLAGS_SHLIB $HARDEN_LDFLAGS"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling hardening support" >&5
+$as_echo "Enabling hardening support" >&6; }
+fi
+
+fi
+
+
+
+
+
+
+# Check whether --enable-jbd-debug was given.
+if test "${enable_jbd_debug+set}" = set; then :
+  enableval=$enable_jbd_debug; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling journal debugging" >&5
+$as_echo "Disabling journal debugging" >&6; }
+else
+
+$as_echo "#define CONFIG_JBD_DEBUG 1" >>confdefs.h
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling journal debugging" >&5
+$as_echo "Enabling journal debugging" >&6; }
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling journal debugging by default" >&5
+$as_echo "Disabling journal debugging by default" >&6; }
+
+fi
+
+# Check whether --enable-blkid-debug was given.
+if test "${enable_blkid_debug+set}" = set; then :
+  enableval=$enable_blkid_debug; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling blkid debugging" >&5
+$as_echo "Disabling blkid debugging" >&6; }
+else
+
+$as_echo "#define CONFIG_BLKID_DEBUG 1" >>confdefs.h
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling blkid debugging" >&5
+$as_echo "Enabling blkid debugging" >&6; }
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling blkid debugging by default" >&5
+$as_echo "Disabling blkid debugging by default" >&6; }
+
+fi
+
+# Check whether --enable-testio-debug was given.
+if test "${enable_testio_debug+set}" = set; then :
+  enableval=$enable_testio_debug;
+if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling testio debugging" >&5
+$as_echo "Disabling testio debugging" >&6; }
+	TEST_IO_CMT="#"
+else
+	TEST_IO_CMT=
+	$as_echo "#define CONFIG_TESTIO_DEBUG 1" >>confdefs.h
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling testio debugging" >&5
+$as_echo "Enabling testio debugging" >&6; }
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling testio debugging by default" >&5
+$as_echo "Enabling testio debugging by default" >&6; }
+$as_echo "#define CONFIG_TESTIO_DEBUG 1" >>confdefs.h
+
+TEST_IO_CMT=
+
+fi
+
+
+# Check whether --enable-developer-features was given.
+if test "${enable_developer_features+set}" = set; then :
+  enableval=$enable_developer_features;
+if test "$enableval" = "yes"
+then
+	DEV_FEATURES_CMT=
+	$as_echo "#define CONFIG_DEVELOPER_FEATURES 1" >>confdefs.h
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling ext4 developer features" >&5
+$as_echo "Enabling ext4 developer features" >&6; }
+else
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling ext4 developer features" >&5
+$as_echo "Disabling ext4 developer features" >&6; }
+	DEV_FEATURES_CMT="#"
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling ext4 developer features by default" >&5
+$as_echo "Disabling ext4 developer features by default" >&6; }
+DEV_FEATURES_CMT=
+
+fi
+
+
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		PKG_CONFIG=""
+	fi
+fi
+LIBUUID=
+DEPLIBUUID=
+STATIC_LIBUUID=
+DEPSTATIC_LIBUUID=
+PROFILED_LIBUUID=
+DEPPROFILED_LIBUUID=
+UUID_CMT=
+# Check whether --enable-libuuid was given.
+if test "${enable_libuuid+set}" = set; then :
+  enableval=$enable_libuuid; if test "$enableval" = "no"
+then
+	if test -z "$PKG_CONFIG"; then
+		as_fn_error $? "pkg-config not installed; please install it." "$LINENO" 5
+	fi
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
+$as_echo_n "checking for uuid_generate in -luuid... " >&6; }
+if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_generate ();
+int
+main ()
+{
+return uuid_generate ();
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_type_long_long=yes
+  ac_cv_lib_uuid_uuid_generate=yes
 else
-  ac_cv_type_long_long=no
+  ac_cv_lib_uuid_uuid_generate=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long" >&5
-$as_echo "$ac_cv_type_long_long" >&6; }
-  if test $ac_cv_type_long_long = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
+  LIBUUID=`$PKG_CONFIG --libs uuid`;
+		 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`
+else
+  as_fn_error $? "external uuid library not found" "$LINENO" 5
+fi
 
-$as_echo "#define HAVE_LONG_LONG 1" >>confdefs.h
+	PROFILED_LIBUUID=$LIBUUID
+	UUID_CMT=#
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling private uuid library" >&5
+$as_echo "Disabling private uuid library" >&6; }
+else
+	LIBUUID='$(LIB)/libuuid'$LIB_EXT
+	DEPLIBUUID=$LIBUUID
+	STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
+	DEPSTATIC_LIBUUID=$STATIC_LIBUUID
+	PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
+	DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling private uuid library" >&5
+$as_echo "Enabling private uuid library" >&6; }
+fi
 
-  fi
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5
-$as_echo_n "checking for long double... " >&6; }
-if ${gt_cv_c_long_double+:} false; then :
+else
+  if test -n "$PKG_CONFIG"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
+$as_echo_n "checking for uuid_generate in -luuid... " >&6; }
+if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$GCC" = yes; then
-       gt_cv_c_long_double=yes
-     else
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
-         long double foo = 0.0;
-         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
-         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
-
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_generate ();
 int
 main ()
 {
-
+return uuid_generate ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_c_long_double=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_uuid_uuid_generate=yes
 else
-  gt_cv_c_long_double=no
+  ac_cv_lib_uuid_uuid_generate=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-     fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_long_double" >&5
-$as_echo "$gt_cv_c_long_double" >&6; }
-  if test $gt_cv_c_long_double = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
+  LIBUUID=`$PKG_CONFIG --libs uuid`;
+		 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`
+fi
 
-$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h
+fi
+if test -n "$LIBUUID"; then
+	PROFILED_LIBUUID=$LIBUUID
+	UUID_CMT=#
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Using system uuid by default" >&5
+$as_echo "Using system uuid by default" >&6; }
+else
+	LIBUUID='$(LIB)/libuuid'$LIB_EXT
+	DEPLIBUUID=$LIBUUID
+	STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
+	DEPSTATIC_LIBUUID=$STATIC_LIBUUID
+	PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
+	DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling private uuid library by default" >&5
+$as_echo "Enabling private uuid library by default" >&6; }
+fi
 
-  fi
+fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
-$as_echo_n "checking for wchar_t... " >&6; }
-if ${gt_cv_c_wchar_t+:} false; then :
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		PKG_CONFIG=""
+	fi
+fi
+LIBBLKID=
+DEPLIBBLKID=
+STATIC_LIBBLKID=
+DEPSTATIC_LIBBLKID=
+PROFILED_LIBBLKID=
+DEPPROFILED_LIBBLKID=
+BLKID_CMT=
+
+# Check whether --enable-libblkid was given.
+if test "${enable_libblkid+set}" = set; then :
+  enableval=$enable_libblkid; if test "$enableval" = "no"
+then
+	if test -z "$PKG_CONFIG"; then
+		as_fn_error $? "pkg-config not installed; please install it." "$LINENO" 5
+	fi
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for blkid_get_cache in -lblkid" >&5
+$as_echo_n "checking for blkid_get_cache in -lblkid... " >&6; }
+if ${ac_cv_lib_blkid_blkid_get_cache+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lblkid -luuid $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stddef.h>
-       wchar_t foo = (wchar_t)'\0';
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char blkid_get_cache ();
 int
 main ()
 {
-
+return blkid_get_cache ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_c_wchar_t=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_blkid_blkid_get_cache=yes
 else
-  gt_cv_c_wchar_t=no
+  ac_cv_lib_blkid_blkid_get_cache=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
-$as_echo "$gt_cv_c_wchar_t" >&6; }
-  if test $gt_cv_c_wchar_t = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blkid_blkid_get_cache" >&5
+$as_echo "$ac_cv_lib_blkid_blkid_get_cache" >&6; }
+if test "x$ac_cv_lib_blkid_blkid_get_cache" = xyes; then :
+  LIBBLKID=`$PKG_CONFIG --libs blkid`;
+		 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`
+else
+  as_fn_error $? "external blkid library not found" "$LINENO" 5
+fi
 
-$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
+	BLKID_CMT=#
+	PROFILED_LIBBLKID=$LIBBLKID
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling private blkid library" >&5
+$as_echo "Disabling private blkid library" >&6; }
+else
+	LIBBLKID='$(LIB)/libblkid'$LIB_EXT
+	DEPLIBBLKID=$LIBBLKID
+	STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
+	DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
+	PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
+	DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
+	$as_echo "#define CONFIG_BUILD_FINDFS 1" >>confdefs.h
 
-  fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling private blkid library" >&5
+$as_echo "Enabling private blkid library" >&6; }
+fi
 
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
-$as_echo_n "checking for wint_t... " >&6; }
-if ${gt_cv_c_wint_t+:} false; then :
+else
+  if test -n "$PKG_CONFIG"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for blkid_get_cache in -lblkid" >&5
+$as_echo_n "checking for blkid_get_cache in -lblkid... " >&6; }
+if ${ac_cv_lib_blkid_blkid_get_cache+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lblkid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <wchar.h>
-       wint_t foo = (wchar_t)'\0';
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char blkid_get_cache ();
 int
 main ()
 {
-
+return blkid_get_cache ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_c_wint_t=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_blkid_blkid_get_cache=yes
 else
-  gt_cv_c_wint_t=no
+  ac_cv_lib_blkid_blkid_get_cache=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
-$as_echo "$gt_cv_c_wint_t" >&6; }
-  if test $gt_cv_c_wint_t = yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blkid_blkid_get_cache" >&5
+$as_echo "$ac_cv_lib_blkid_blkid_get_cache" >&6; }
+if test "x$ac_cv_lib_blkid_blkid_get_cache" = xyes; then :
+  LIBBLKID=`$PKG_CONFIG --libs blkid`;
+		 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`
+fi
 
-$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
+fi
+if test -n "$LIBBLKID"; then
+	BLKID_CMT=#
+	PROFILED_LIBBLKID=$LIBBLKID
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Using system blkid library by default" >&5
+$as_echo "Using system blkid library by default" >&6; }
+else
+	LIBBLKID='$(LIB)/libblkid'$LIB_EXT
+	DEPLIBBLKID=$LIBBLKID
+	STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
+	DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
+	PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
+	DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
+	$as_echo "#define CONFIG_BUILD_FINDFS 1" >>confdefs.h
 
-  fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling private blkid library by default" >&5
+$as_echo "Enabling private blkid library by default" >&6; }
+fi
+
+fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5
-$as_echo_n "checking for inttypes.h... " >&6; }
-if ${jm_ac_cv_header_inttypes_h+:} false; then :
+
+
+
+
+
+
+ALL_CMT=
+SUBSET_CMT=
+# Check whether --enable-subset was given.
+if test "${enable_subset+set}" = set; then :
+  enableval=$enable_subset; if test "$enableval" = "no"
+then
+	SUBSET_CMT=#
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling subset-only build" >&5
+$as_echo "Disabling subset-only build" >&6; }
+else
+	ALL_CMT=#
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling subset-only-build" >&5
+$as_echo "Enabling subset-only-build" >&6; }
+fi
+
+fi
+
+
+
+
+# Check whether --enable-backtrace was given.
+if test "${enable_backtrace+set}" = set; then :
+  enableval=$enable_backtrace; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling use of backtrace" >&5
+$as_echo "Disabling use of backtrace" >&6; }
+	$as_echo "#define DISABLE_BACKTRACE 1" >>confdefs.h
+
+else
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling use of backtrace" >&5
+$as_echo "Enabling use of backtrace" >&6; }
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling use of backtrace by default" >&5
+$as_echo "Enabling use of backtrace by default" >&6; }
+
+fi
+
+# Check whether --enable-debugfs was given.
+if test "${enable_debugfs+set}" = set; then :
+  enableval=$enable_debugfs; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling debugfs support" >&5
+$as_echo "Disabling debugfs support" >&6; }
+	DEBUGFS_CMT="#"
+else
+	DEBUGFS_CMT=
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling debugfs support" >&5
+$as_echo "Enabling debugfs support" >&6; }
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling debugfs support by default" >&5
+$as_echo "Enabling debugfs support by default" >&6; }
+DEBUGFS_CMT=
+
+fi
+
+
+# Check whether --enable-imager was given.
+if test "${enable_imager+set}" = set; then :
+  enableval=$enable_imager; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling e2image support" >&5
+$as_echo "Disabling e2image support" >&6; }
+	IMAGER_CMT="#"
+else
+	IMAGER_CMT=
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e2image support" >&5
+$as_echo "Enabling e2image support" >&6; }
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e2image support by default" >&5
+$as_echo "Enabling e2image support by default" >&6; }
+IMAGER_CMT=
+
+fi
+
+
+# Check whether --enable-resizer was given.
+if test "${enable_resizer+set}" = set; then :
+  enableval=$enable_resizer; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling e2resize support" >&5
+$as_echo "Disabling e2resize support" >&6; }
+	RESIZER_CMT="#"
+else
+	RESIZER_CMT=
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e2resize support" >&5
+$as_echo "Enabling e2resize support" >&6; }
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e2resize support by default" >&5
+$as_echo "Enabling e2resize support by default" >&6; }
+RESIZER_CMT=
+
+fi
+
+
+# Check whether --enable-defrag was given.
+if test "${enable_defrag+set}" = set; then :
+  enableval=$enable_defrag; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling e4defrag support" >&5
+$as_echo "Disabling e4defrag support" >&6; }
+	DEFRAG_CMT="#"
+else
+	DEFRAG_CMT=
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e4defrag support" >&5
+$as_echo "Enabling e4defrag support" >&6; }
+fi
+
+else
+  if test -z "$WITH_DIET_LIBC"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling e4defrag support by default" >&5
+$as_echo "Enabling e4defrag support by default" >&6; }
+	DEFRAG_CMT=
+else
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling e4defrag support by default" >&5
+$as_echo "Disabling e4defrag support by default" >&6; }
+	DEFRAG_CMT="#"
+fi
+
+fi
+
+
+# Check whether --enable-fsck was given.
+if test "${enable_fsck+set}" = set; then :
+  enableval=$enable_fsck; if test "$enableval" = "no"
+then
+	FSCK_PROG='' FSCK_MAN=''
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Not building fsck wrapper" >&5
+$as_echo "Not building fsck wrapper" >&6; }
+else
+	FSCK_PROG=fsck FSCK_MAN=fsck.8
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building fsck wrapper" >&5
+$as_echo "Building fsck wrapper" >&6; }
+fi
+
+else
+  case "$host_os" in
+  gnu*)
+    FSCK_PROG='' FSCK_MAN=''
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not building fsck wrapper by default" >&5
+$as_echo "Not building fsck wrapper by default" >&6; }
+    ;;
+  *)
+    FSCK_PROG=fsck FSCK_MAN=fsck.8
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Building fsck wrapper by default" >&5
+$as_echo "Building fsck wrapper by default" >&6; }
+esac
+
+fi
+
+
+
+# Check whether --enable-e2initrd-helper was given.
+if test "${enable_e2initrd_helper+set}" = set; then :
+  enableval=$enable_e2initrd_helper; if test "$enableval" = "no"
+then
+	E2INITRD_PROG='' E2INITRD_MAN=''
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Not building e2initrd helper" >&5
+$as_echo "Not building e2initrd helper" >&6; }
+else
+	E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building e2initrd helper" >&5
+$as_echo "Building e2initrd helper" >&6; }
+fi
+
+else
+  E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building e2initrd helper by default" >&5
+$as_echo "Building e2initrd helper by default" >&6; }
+
+fi
+
+
+
+# Check whether --enable-tls was given.
+if test "${enable_tls+set}" = set; then :
+  enableval=$enable_tls; if test "$enableval" = "no"
+then
+	try_tls=""
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling thread local support" >&5
+$as_echo "Disabling thread local support" >&6; }
+else
+	try_tls="yes"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling thread local support" >&5
+$as_echo "Enabling thread local support" >&6; }
+fi
+
+else
+  if test -n "$WITH_DIET_LIBC"
+then
+	try_tls=""
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Diet libc does not support thread local support" >&5
+$as_echo "Diet libc does not support thread local support" >&6; }
+else
+	try_tls="yes"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Try using thread local support by default" >&5
+$as_echo "Try using thread local support by default" >&6; }
+fi
+
+fi
+
+if test "$try_tls" = "yes"
+then
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread local storage (TLS) class" >&5
+$as_echo_n "checking for thread local storage (TLS) class... " >&6; }
+  if ${ac_cv_tls+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+    ax_tls_keywords="__thread __declspec(thread) none"
+    for ax_tls_keyword in $ax_tls_keywords; do
+       case $ax_tls_keyword in
+          none) ac_cv_tls=none ; break ;;
+          *)
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-#include <inttypes.h>
-int
-main ()
-{
-uintmax_t i = (uintmax_t) -1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  jm_ac_cv_header_inttypes_h=yes
-else
-  jm_ac_cv_header_inttypes_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $jm_ac_cv_header_inttypes_h" >&5
-$as_echo "$jm_ac_cv_header_inttypes_h" >&6; }
-  if test $jm_ac_cv_header_inttypes_h = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INTTYPES_H_WITH_UINTMAX 1
-_ACEOF
-
-  fi
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5
-$as_echo_n "checking for stdint.h... " >&6; }
-if ${jm_ac_cv_header_stdint_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <stdint.h>
-int
-main ()
-{
-uintmax_t i = (uintmax_t) -1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  jm_ac_cv_header_stdint_h=yes
-else
-  jm_ac_cv_header_stdint_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $jm_ac_cv_header_stdint_h" >&5
-$as_echo "$jm_ac_cv_header_stdint_h" >&6; }
-  if test $jm_ac_cv_header_stdint_h = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H_WITH_UINTMAX 1
-_ACEOF
-
-  fi
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5
-$as_echo_n "checking for intmax_t... " >&6; }
-if ${gt_cv_c_intmax_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stddef.h>
 #include <stdlib.h>
-#if HAVE_STDINT_H_WITH_UINTMAX
-#include <stdint.h>
-#endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-#include <inttypes.h>
-#endif
-
+                 static void
+                 foo(void) {
+                 static  $ax_tls_keyword  int bar;
+                 exit(1);
+                 }
 int
 main ()
 {
-intmax_t x = -1;
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_c_intmax_t=yes
+  ac_cv_tls=$ax_tls_keyword ; break
 else
-  gt_cv_c_intmax_t=no
+  ac_cv_tls=none
+
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5
-$as_echo "$gt_cv_c_intmax_t" >&6; }
-  if test $gt_cv_c_intmax_t = yes; then
+          esac
+    done
 
-$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h
+fi
+
+
+  if test "$ac_cv_tls" != "none"; then
+
+cat >>confdefs.h <<_ACEOF
+#define TLS $ac_cv_tls
+_ACEOF
 
   fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5
+$as_echo "$ac_cv_tls" >&6; }
 
+fi
 
+# Check whether --with-pthread was given.
+if test "${with_pthread+set}" = set; then :
+  withval=$with_pthread; if test "$withval" = "no"
+then
+	try_pthread=""
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling pthread support" >&5
+$as_echo "Disabling pthread support" >&6; }
+else
+	try_pthread="yes"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Testing for pthread support" >&5
+$as_echo "Testing for pthread support" >&6; }
+fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf() supports POSIX/XSI format strings" >&5
-$as_echo_n "checking whether printf() supports POSIX/XSI format strings... " >&6; }
-if ${gt_cv_func_printf_posix+:} false; then :
+else
+  try_pthread="yes"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Try testing for pthread support by default" >&5
+$as_echo "Try testing for pthread support by default" >&6; }
+
+fi
+
+if test "$try_pthread" = "yes"
+then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
   $as_echo_n "(cached) " >&6
 else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
 
-      if test "$cross_compiling" = yes; then :
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on Tru64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
+        ax_pthread_save_CC="$CC"
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        if test "x$PTHREAD_CC" != "x"; then :
+  CC="$PTHREAD_CC"
+fi
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5
+$as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; }
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_join ();
+int
+main ()
+{
+return pthread_join ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_pthread_ok=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+        if test "x$ax_pthread_ok" = "xno"; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        CC="$ax_pthread_save_CC"
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
+#           (Note: HP C rejects this with "bad form for `-t' option")
+# -pthreads: Solaris/gcc (Note: HP C also rejects)
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads and
+#      -D_REENTRANT too), HP C (must be checked before -lpthread, which
+#      is present but should not be used directly; and before -mthreads,
+#      because the compiler interprets this as "-mt" + "-hreads")
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case $host_os in
+
+        freebsd*)
+
+        # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+        # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+
+        ax_pthread_flags="-kthread lthread $ax_pthread_flags"
+        ;;
+
+        hpux*)
+
+        # From the cc(1) man page: "[-mt] Sets various -D flags to enable
+        # multi-threading and also sets -lpthread."
+
+        ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
+        ;;
+
+        openedition*)
+
+        # IBM z/OS requires a feature-test macro to be defined in order to
+        # enable POSIX threads at all, so give the user a hint if this is
+        # not set. (We don't define these ourselves, as they can affect
+        # other portions of the system API in unpredictable ways.)
 
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
-  notposix
-#endif
+#            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
+             AX_PTHREAD_ZOS_MISSING
+#            endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "notposix" >/dev/null 2>&1; then :
-  gt_cv_func_printf_posix="guessing no"
-else
-  gt_cv_func_printf_posix="guessing yes"
+  $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5
+$as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;}
 fi
 rm -f conftest*
 
+        ;;
 
+        solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed. (N.B.: The stubs are missing
+        # pthread_cleanup_push, or rather a function called by this macro,
+        # so we could check for that, but who knows whether they'll stub
+        # that too in a future libc.)  So we'll check first for the
+        # standard Solaris way of linking pthreads (-mt -lpthread).
+
+        ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
+        ;;
+esac
+
+# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
+
+if test "x$GCC" = "xyes"; then :
+  ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"
+fi
+
+# The presence of a feature test macro requesting re-entrant function
+# definitions is, on some systems, a strong hint that pthreads support is
+# correctly enabled
+
+case $host_os in
+        darwin* | hpux* | linux* | osf* | solaris*)
+        ax_pthread_check_macro="_REENTRANT"
+        ;;
+
+        aix*)
+        ax_pthread_check_macro="_THREAD_SAFE"
+        ;;
+
+        *)
+        ax_pthread_check_macro="--"
+        ;;
+esac
+if test "x$ax_pthread_check_macro" = "x--"; then :
+  ax_pthread_check_cond=0
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdio.h>
-#include <string.h>
-/* The string "%2$d %1$d", with dollar characters protected from the shell's
-   dollar expansion (possibly an autoconf bug).  */
-static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
-static char buf[100];
-int main ()
-{
-  sprintf (buf, format, 33, 55);
-  return (strcmp (buf, "55 33") != 0);
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gt_cv_func_printf_posix=yes
-else
-  gt_cv_func_printf_posix=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+  ax_pthread_check_cond="!defined($ax_pthread_check_macro)"
 fi
 
+# Are we compiling with Clang?
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_printf_posix" >&5
-$as_echo "$gt_cv_func_printf_posix" >&6; }
-  case $gt_cv_func_printf_posix in
-    *yes)
-
-$as_echo "#define HAVE_POSIX_PRINTF 1" >>confdefs.h
-
-      ;;
-  esac
-
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments.  Useless!
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
-$as_echo_n "checking for working alloca.h... " >&6; }
-if ${ac_cv_working_alloca_h+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5
+$as_echo_n "checking whether $CC is Clang... " >&6; }
+if ${ax_cv_PTHREAD_CLANG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ax_cv_PTHREAD_CLANG=no
+     # Note that Autoconf sets GCC=yes for Clang as well as GCC
+     if test "x$GCC" = "xyes"; then
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <alloca.h>
+/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
+#            if defined(__clang__) && defined(__llvm__)
+             AX_PTHREAD_CC_IS_CLANG
+#            endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then :
+  ax_cv_PTHREAD_CLANG=yes
+fi
+rm -f conftest*
+
+     fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5
+$as_echo "$ax_cv_PTHREAD_CLANG" >&6; }
+ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
+
+ax_pthread_clang_warning=no
+
+# Clang needs special handling, because older versions handle the -pthread
+# option in a rather... idiosyncratic way
+
+if test "x$ax_pthread_clang" = "xyes"; then
+
+        # Clang takes -pthread; it has never supported any other flag
+
+        # (Note 1: This will need to be revisited if a system that Clang
+        # supports has POSIX threads in a separate library.  This tends not
+        # to be the way of modern systems, but it's conceivable.)
+
+        # (Note 2: On some systems, notably Darwin, -pthread is not needed
+        # to get POSIX threads support; the API is always present and
+        # active.  We could reasonably leave PTHREAD_CFLAGS empty.  But
+        # -pthread does define _REENTRANT, and while the Darwin headers
+        # ignore this macro, third-party headers might not.)
+
+        PTHREAD_CFLAGS="-pthread"
+        PTHREAD_LIBS=
+
+        ax_pthread_ok=yes
+
+        # However, older versions of Clang make a point of warning the user
+        # that, in an invocation where only linking and no compilation is
+        # taking place, the -pthread option has no effect ("argument unused
+        # during compilation").  They expect -pthread to be passed in only
+        # when source code is being compiled.
+        #
+        # Problem is, this is at odds with the way Automake and most other
+        # C build frameworks function, which is that the same flags used in
+        # compilation (CFLAGS) are also used in linking.  Many systems
+        # supported by AX_PTHREAD require exactly this for POSIX threads
+        # support, and in fact it is often not straightforward to specify a
+        # flag that is used only in the compilation phase and not in
+        # linking.  Such a scenario is extremely rare in practice.
+        #
+        # Even though use of the -pthread flag in linking would only print
+        # a warning, this can be a nuisance for well-run software projects
+        # that build with -Werror.  So if the active version of Clang has
+        # this misfeature, we search for an option to squash it.
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5
+$as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; }
+if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
+             # Create an alternate version of $ac_link that compiles and
+             # links in two steps (.c -> .o, .o -> exe) instead of one
+             # (.c -> exe), because the warning occurs only in the second
+             # step
+             ax_pthread_save_ac_link="$ac_link"
+             ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
+             ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
+             ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
+             ax_pthread_save_CFLAGS="$CFLAGS"
+             for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
+                if test "x$ax_pthread_try" = "xunknown"; then :
+  break
+fi
+                CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
+                ac_link="$ax_pthread_save_ac_link"
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void){return 0;}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_link="$ax_pthread_2step_ac_link"
+                     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void){return 0;}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+             done
+             ac_link="$ax_pthread_save_ac_link"
+             CFLAGS="$ax_pthread_save_CFLAGS"
+             if test "x$ax_pthread_try" = "x"; then :
+  ax_pthread_try=no
+fi
+             ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5
+$as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; }
+
+        case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
+                no | unknown) ;;
+                *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
+        esac
+
+fi # $ax_pthread_clang = yes
+
+if test "x$ax_pthread_ok" = "xno"; then
+for ax_pthread_try_flag in $ax_pthread_flags; do
+
+        case $ax_pthread_try_flag in
+                none)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
+$as_echo_n "checking whether pthreads work without any flags... " >&6; }
+                ;;
+
+                -mt,pthread)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5
+$as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; }
+                PTHREAD_CFLAGS="-mt"
+                PTHREAD_LIBS="-lpthread"
+                ;;
+
+                -*)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5
+$as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; }
+                PTHREAD_CFLAGS="$ax_pthread_try_flag"
+                ;;
+
+                pthread-config)
+                # Extract the first word of "pthread-config", so it can be a program name with args.
+set dummy pthread-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ax_pthread_config+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ax_pthread_config"; then
+  ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ax_pthread_config="yes"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
+fi
+fi
+ax_pthread_config=$ac_cv_prog_ax_pthread_config
+if test -n "$ax_pthread_config"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
+$as_echo "$ax_pthread_config" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+                if test "x$ax_pthread_config" = "xno"; then :
+  continue
+fi
+                PTHREAD_CFLAGS="`pthread-config --cflags`"
+                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+                ;;
+
+                *)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5
+$as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; }
+                PTHREAD_LIBS="-l$ax_pthread_try_flag"
+                ;;
+        esac
+
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+#                       if $ax_pthread_check_cond
+#                        error "$ax_pthread_check_macro must be defined"
+#                       endif
+                        static void routine(void *a) { a = 0; }
+                        static void *start_routine(void *a) { return a; }
 int
 main ()
 {
-char *p = (char *) alloca (2 * sizeof (int));
-			  if (p) return 0;
+pthread_t th; pthread_attr_t attr;
+                        pthread_create(&th, 0, start_routine, 0);
+                        pthread_join(th, 0);
+                        pthread_attr_init(&attr);
+                        pthread_cleanup_push(routine, 0);
+                        pthread_cleanup_pop(0) /* ; */
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_working_alloca_h=yes
-else
-  ac_cv_working_alloca_h=no
+  ax_pthread_ok=yes
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
-$as_echo "$ac_cv_working_alloca_h" >&6; }
-if test $ac_cv_working_alloca_h = yes; then
 
-$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+        if test "x$ax_pthread_ok" = "xyes"; then :
+  break
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
-$as_echo_n "checking for alloca... " >&6; }
-if ${ac_cv_func_alloca_works+:} false; then :
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = "xyes"; then
+        ax_pthread_save_CFLAGS="$CFLAGS"
+        ax_pthread_save_LIBS="$LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
+$as_echo_n "checking for joinable pthread attribute... " >&6; }
+if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ax_cv_PTHREAD_JOINABLE_ATTR=unknown
+             for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+                 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
-#  include <malloc.h>
-#  define alloca _alloca
-# else
-#  ifdef HAVE_ALLOCA_H
-#   include <alloca.h>
-#  else
-#   ifdef _AIX
- #pragma alloca
-#   else
-#    ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca (size_t);
-#    endif
-#   endif
-#  endif
-# endif
-#endif
-
+#include <pthread.h>
 int
 main ()
 {
-char *p = (char *) alloca (1);
-				    if (p) return 0;
+int attr = $ax_pthread_attr; return attr /* ; */
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_alloca_works=yes
-else
-  ac_cv_func_alloca_works=no
+  ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
-$as_echo "$ac_cv_func_alloca_works" >&6; }
-
-if test $ac_cv_func_alloca_works = yes; then
-
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
-
-else
-  # The SVR3 libPW and SVR4 libucb both contain incompatible functions
-# that cause trouble.  Some versions do not even contain alloca or
-# contain a buggy version.  If you still want to use their alloca,
-# use ar to extract alloca.o from them instead of compiling alloca.c.
-
-ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
-
-$as_echo "#define C_ALLOCA 1" >>confdefs.h
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
-$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if ${ac_cv_os_cray+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "webecray" >/dev/null 2>&1; then :
-  ac_cv_os_cray=yes
-else
-  ac_cv_os_cray=no
-fi
-rm -f conftest*
+             done
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
-$as_echo "$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
+$as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; }
+        if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
+               test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
+               test "x$ax_pthread_joinable_attr_defined" != "xyes"; then :
 
 cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
+#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR
 _ACEOF
 
-    break
+               ax_pthread_joinable_attr_defined=yes
+
 fi
 
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5
+$as_echo_n "checking whether more special flags are required for pthreads... " >&6; }
+if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ax_cv_PTHREAD_SPECIAL_FLAGS=no
+             case $host_os in
+             solaris*)
+             ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
+             ;;
+             esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
+$as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; }
+        if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
+               test "x$ax_pthread_special_flags_added" != "xyes"; then :
+  PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
+               ax_pthread_special_flags_added=yes
+fi
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5
+$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
+if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+int i = PTHREAD_PRIO_INHERIT;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_cv_PTHREAD_PRIO_INHERIT=yes
+else
+  ax_cv_PTHREAD_PRIO_INHERIT=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
+$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; }
+        if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
+               test "x$ax_pthread_prio_inherit_defined" != "xyes"; then :
+
+$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
+
+               ax_pthread_prio_inherit_defined=yes
+
+fi
+
+        CFLAGS="$ax_pthread_save_CFLAGS"
+        LIBS="$ax_pthread_save_LIBS"
+
+        # More AIX lossage: compile with *_r variant
+        if test "x$GCC" != "xyes"; then
+            case $host_os in
+                aix*)
+                case "x/$CC" in #(
+  x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
+    #handle absolute path differently from PATH based program lookup
+                     case "x$CC" in #(
+  x/*) :
+    if as_fn_executable_p ${CC}_r; then :
+  PTHREAD_CC="${CC}_r"
+fi ;; #(
+  *) :
+    for ac_prog in ${CC}_r
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PTHREAD_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PTHREAD_CC"; then
+  ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_PTHREAD_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
+if test -n "$PTHREAD_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
+$as_echo "$PTHREAD_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$PTHREAD_CC" && break
+done
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+ ;;
+esac ;; #(
+  *) :
+     ;;
+esac
+                ;;
+            esac
+        fi
+fi
+
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test "x$ax_pthread_ok" = "xyes"; then
+
+$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
+
+        :
+else
+        ax_pthread_ok=no
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+else
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+
+fi
+
+# Check whether --enable-uuidd was given.
+if test "${enable_uuidd+set}" = set; then :
+  enableval=$enable_uuidd; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Not building uuidd" >&5
+$as_echo "Not building uuidd" >&6; }
+	UUIDD_CMT="#"
+else
+	$as_echo "#define USE_UUIDD 1" >>confdefs.h
+
+	UUIDD_CMT=""
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building uuidd" >&5
+$as_echo "Building uuidd" >&6; }
+fi
+
+else
+  $as_echo "#define USE_UUIDD 1" >>confdefs.h
+
+if test -z "$UUID_CMT"
+then
+	UUIDD_CMT=""
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Building uuidd by default" >&5
+$as_echo "Building uuidd by default" >&6; }
+else
+	UUIDD_CMT="#"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling uuidd by default" >&5
+$as_echo "Disabling uuidd by default" >&6; }
+fi
+
+fi
+
+
+
+# Check whether --enable-mmp was given.
+if test "${enable_mmp+set}" = set; then :
+  enableval=$enable_mmp; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling mmp support" >&5
+$as_echo "Disabling mmp support" >&6; }
+else
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling mmp support" >&5
+$as_echo "Enabling mmp support" >&6; }
+	$as_echo "#define CONFIG_MMP 1" >>confdefs.h
+
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling mmp support by default" >&5
+$as_echo "Enabling mmp support by default" >&6; }
+$as_echo "#define CONFIG_MMP 1" >>confdefs.h
+
+
+fi
+
+
+# Check whether --enable-tdb was given.
+if test "${enable_tdb+set}" = set; then :
+  enableval=$enable_tdb; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling tdb support" >&5
+$as_echo "Disabling tdb support" >&6; }
+	TDB_CMT="#"
+	TDB_MAN_COMMENT='.\"'
+else
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling tdb support" >&5
+$as_echo "Enabling tdb support" >&6; }
+	$as_echo "#define CONFIG_TDB 1" >>confdefs.h
+
+	TDB_CMT=""
+	TDB_MAN_COMMENT=""
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling mmp support by default" >&5
+$as_echo "Enabling mmp support by default" >&6; }
+$as_echo "#define CONFIG_TDB 1" >>confdefs.h
+
+TDB_CMT=""
+TDB_MAN_COMMENT=""
+
+fi
+
+
+
+
+# Check whether --enable-bmap-stats was given.
+if test "${enable_bmap_stats+set}" = set; then :
+  enableval=$enable_bmap_stats; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling bitmap statistics support" >&5
+$as_echo "Disabling bitmap statistics support" >&6; }
+else
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling bitmap statistics support" >&5
+$as_echo "Enabling bitmap statistics support" >&6; }
+	$as_echo "#define ENABLE_BMAP_STATS 1" >>confdefs.h
+
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling bitmap statistics support by default" >&5
+$as_echo "Enabling bitmap statistics support by default" >&6; }
+$as_echo "#define ENABLE_BMAP_STATS 1" >>confdefs.h
+
+
+fi
+
+
+# Check whether --enable-bmap-stats-ops was given.
+if test "${enable_bmap_stats_ops+set}" = set; then :
+  enableval=$enable_bmap_stats_ops; if test "$enableval" = "no"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling additional bitmap statistics" >&5
+$as_echo "Disabling additional bitmap statistics" >&6; }
+else
+		if test "x${enable_bmap_stats}" = "xno"; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Error --enable-bmap-stats-ops requires bmap-stats
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling additional bitmap statistics" >&5
+$as_echo "Enabling additional bitmap statistics" >&6; }
+	$as_echo "#define ENABLE_BMAP_STATS_OPS 1" >>confdefs.h
+
+fi
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling additional bitmap statistics by default" >&5
+$as_echo "Disabling additional bitmap statistics by default" >&6; }
+
+fi
+
+MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
+
+GETTEXT_PACKAGE=e2fsprogs
+PACKAGE=e2fsprogs
+VERSION="$E2FSPROGS_VERSION"
+VERSION=0.14.1
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
   done
-fi
+IFS=$as_save_IFS
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
-$as_echo_n "checking stack direction for C alloca... " >&6; }
-if ${ac_cv_c_stack_direction+:} false; then :
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_c_stack_direction=0
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
+$as_echo_n "checking whether NLS is requested... " >&6; }
+    # Check whether --enable-nls was given.
+if test "${enable_nls+set}" = set; then :
+  enableval=$enable_nls; USE_NLS=$enableval
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-find_stack_direction (int *addr, int depth)
-{
-  int dir, dummy = 0;
-  if (! addr)
-    addr = &dummy;
-  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
-  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
-  return dir + dummy;
-}
+  USE_NLS=yes
+fi
 
-int
-main (int argc, char **argv)
-{
-  return find_stack_direction (0, argc + !argv + 20) < 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_stack_direction=1
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
+$as_echo "$USE_NLS" >&6; }
+
+
+
+
+      GETTEXT_MACRO_VERSION=0.20
+
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
 else
-  ac_cv_c_stack_direction=-1
+  ac_executable_p="test -f"
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conf$$.file
+
+# Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MSGFMT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case "$MSGFMT" in
+  [\\/]* | ?:[\\/]*)
+    ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH; do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&5
+          if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 &&
+     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+            ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+    ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
+$as_echo "$MSGFMT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
-$as_echo "$ac_cv_c_stack_direction" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
-
-
-fi
-
-
-
-
-  for ac_header in $ac_header_list
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
+  # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GMSGFMT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $GMSGFMT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
+  done
+IFS=$as_save_IFS
 
-
-
-
-
-
-
-
-for ac_func in getpagesize
-do :
-  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPAGESIZE 1
-_ACEOF
-
+  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+  ;;
+esac
 fi
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
-$as_echo_n "checking for working mmap... " >&6; }
-if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
-  $as_echo_n "(cached) " >&6
+GMSGFMT=$ac_cv_path_GMSGFMT
+if test -n "$GMSGFMT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
+$as_echo "$GMSGFMT" >&6; }
 else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_func_mmap_fixed_mapped=no
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-/* malloc might have been renamed as rpl_malloc. */
-#undef malloc
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
-   Here is a matrix of mmap possibilities:
-	mmap private not fixed
-	mmap private fixed at somewhere currently unmapped
-	mmap private fixed at somewhere already mapped
-	mmap shared not fixed
-	mmap shared fixed at somewhere currently unmapped
-	mmap shared fixed at somewhere already mapped
-   For private mappings, we should verify that changes cannot be read()
-   back from the file, nor mmap's back from the file at a different
-   address.  (There have been systems where private was not correctly
-   implemented like the infamous i386 svr4.0, and systems where the
-   VM page cache was not coherent with the file system buffer cache
-   like early versions of FreeBSD and possibly contemporary NetBSD.)
-   For shared mappings, we should conversely verify that changes get
-   propagated back to all the places they're supposed to be.
-
-   Grep wants private fixed already mapped.
-   The main things grep needs to know about mmap are:
-   * does it exist and is it safe to write into the mmap'd area
-   * how to use it (BSD variants)  */
-
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
-char *malloc ();
-#endif
-
-/* This mess was copied from the GNU getpagesize.h.  */
-#ifndef HAVE_GETPAGESIZE
-# ifdef _SC_PAGESIZE
-#  define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-#  ifdef HAVE_SYS_PARAM_H
-#   include <sys/param.h>
-#   ifdef EXEC_PAGESIZE
-#    define getpagesize() EXEC_PAGESIZE
-#   else /* no EXEC_PAGESIZE */
-#    ifdef NBPG
-#     define getpagesize() NBPG * CLSIZE
-#     ifndef CLSIZE
-#      define CLSIZE 1
-#     endif /* no CLSIZE */
-#    else /* no NBPG */
-#     ifdef NBPC
-#      define getpagesize() NBPC
-#     else /* no NBPC */
-#      ifdef PAGESIZE
-#       define getpagesize() PAGESIZE
-#      endif /* PAGESIZE */
-#     endif /* no NBPC */
-#    endif /* no NBPG */
-#   endif /* no EXEC_PAGESIZE */
-#  else /* no HAVE_SYS_PARAM_H */
-#   define getpagesize() 8192	/* punt totally */
-#  endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
-
-int
-main ()
-{
-  char *data, *data2, *data3;
-  const char *cdata2;
-  int i, pagesize;
-  int fd, fd2;
-
-  pagesize = getpagesize ();
-
-  /* First, make a file with some known garbage in it. */
-  data = (char *) malloc (pagesize);
-  if (!data)
-    return 1;
-  for (i = 0; i < pagesize; ++i)
-    *(data + i) = rand ();
-  umask (0);
-  fd = creat ("conftest.mmap", 0600);
-  if (fd < 0)
-    return 2;
-  if (write (fd, data, pagesize) != pagesize)
-    return 3;
-  close (fd);
-
-  /* Next, check that the tail of a page is zero-filled.  File must have
-     non-zero length, otherwise we risk SIGBUS for entire page.  */
-  fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
-  if (fd2 < 0)
-    return 4;
-  cdata2 = "";
-  if (write (fd2, cdata2, 1) != 1)
-    return 5;
-  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
-  if (data2 == MAP_FAILED)
-    return 6;
-  for (i = 0; i < pagesize; ++i)
-    if (*(data2 + i))
-      return 7;
-  close (fd2);
-  if (munmap (data2, pagesize))
-    return 8;
-
-  /* Next, try to mmap the file at a fixed address which already has
-     something else allocated at it.  If we can, also make sure that
-     we see the same garbage.  */
-  fd = open ("conftest.mmap", O_RDWR);
-  if (fd < 0)
-    return 9;
-  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
-		     MAP_PRIVATE | MAP_FIXED, fd, 0L))
-    return 10;
-  for (i = 0; i < pagesize; ++i)
-    if (*(data + i) != *(data2 + i))
-      return 11;
-
-  /* Finally, make sure that changes to the mapped area do not
-     percolate back to the file as seen by read().  (This is a bug on
-     some variants of i386 svr4.0.)  */
-  for (i = 0; i < pagesize; ++i)
-    *(data2 + i) = *(data2 + i) + 1;
-  data3 = (char *) malloc (pagesize);
-  if (!data3)
-    return 12;
-  if (read (fd, data3, pagesize) != pagesize)
-    return 13;
-  for (i = 0; i < pagesize; ++i)
-    if (*(data + i) != *(data3 + i))
-      return 14;
-  close (fd);
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_mmap_fixed_mapped=yes
-else
-  ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
-$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
-
-$as_echo "#define HAVE_MMAP 1" >>confdefs.h
-
-fi
-rm -f conftest.mmap conftest.txt
-
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library 2.1 or newer" >&5
-$as_echo_n "checking whether we are using the GNU C Library 2.1 or newer... " >&6; }
-if ${ac_cv_gnu_library_2_1+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-  Lucky GNU user
- #endif
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky GNU user" >/dev/null 2>&1; then :
-  ac_cv_gnu_library_2_1=yes
-else
-  ac_cv_gnu_library_2_1=no
-fi
-rm -f conftest*
-
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5
-$as_echo "$ac_cv_gnu_library_2_1" >&6; }
-
-    GLIBC21="$ac_cv_gnu_library_2_1"
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether integer division by zero raises SIGFPE" >&5
-$as_echo_n "checking whether integer division by zero raises SIGFPE... " >&6; }
-if ${gt_cv_int_divbyzero_sigfpe+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      if test "$cross_compiling" = yes; then :
-
-          # Guess based on the CPU.
-          case "$host_cpu" in
-            alpha* | i3456786 | m68k | s390*)
-              gt_cv_int_divbyzero_sigfpe="guessing yes";;
-            *)
-              gt_cv_int_divbyzero_sigfpe="guessing no";;
-          esac
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdlib.h>
-#include <signal.h>
-
-static void
-#ifdef __cplusplus
-sigfpe_handler (int sig)
-#else
-sigfpe_handler (sig) int sig;
-#endif
-{
-  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
-  exit (sig != SIGFPE);
-}
-
-int x = 1;
-int y = 0;
-int z;
-int nan;
-
-int main ()
-{
-  signal (SIGFPE, sigfpe_handler);
-/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
-#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
-  signal (SIGTRAP, sigfpe_handler);
-#endif
-/* Linux/SPARC yields signal SIGILL.  */
-#if defined (__sparc__) && defined (__linux__)
-  signal (SIGILL, sigfpe_handler);
-#endif
-
-  z = x / y;
-  nan = y / y;
-  exit (1);
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gt_cv_int_divbyzero_sigfpe=yes
-else
-  gt_cv_int_divbyzero_sigfpe=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_int_divbyzero_sigfpe" >&5
-$as_echo "$gt_cv_int_divbyzero_sigfpe" >&6; }
-  case "$gt_cv_int_divbyzero_sigfpe" in
-    *yes) value=1;;
-    *) value=0;;
+
+    case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+    *) GMSGFMT_015=$GMSGFMT ;;
   esac
 
-cat >>confdefs.h <<_ACEOF
-#define INTDIV0_RAISES_SIGFPE $value
-_ACEOF
 
 
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
+fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long" >&5
-$as_echo_n "checking for unsigned long long... " >&6; }
-if ${ac_cv_type_unsigned_long_long+:} false; then :
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
+else
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_XGETTEXT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-unsigned long long ull = 1ULL; int i = 63;
-int
-main ()
-{
-unsigned long long ullmax = (unsigned long long) -1;
-     return ull << i | ull >> i | ullmax / ull | ullmax % ull;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_type_unsigned_long_long=yes
+  case "$XGETTEXT" in
+  [\\/]* | ?:[\\/]*)
+    ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH; do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&5
+          if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 &&
+     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+            ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+    ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
+$as_echo "$XGETTEXT" >&6; }
 else
-  ac_cv_type_unsigned_long_long=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+
+    rm -f messages.po
+
+    case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+    *) XGETTEXT_015=$XGETTEXT ;;
+  esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long" >&5
-$as_echo "$ac_cv_type_unsigned_long_long" >&6; }
-  if test $ac_cv_type_unsigned_long_long = yes; then
 
-$as_echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>confdefs.h
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
+else
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
 
-  fi
+# Extract the first word of "msgmerge", so it can be a program name with args.
+set dummy msgmerge; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_MSGMERGE+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case "$MSGMERGE" in
+  [\\/]* | ?:[\\/]*)
+    ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH; do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&5
+          if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then
+            ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+  test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
+    ;;
+esac
+fi
+MSGMERGE="$ac_cv_path_MSGMERGE"
+if test "$MSGMERGE" != ":"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
+$as_echo "$MSGMERGE" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
-
-
-  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
-
-    test $ac_cv_type_unsigned_long_long = yes \
-      && ac_type='unsigned long long' \
-      || ac_type='unsigned long'
-
-cat >>confdefs.h <<_ACEOF
-#define uintmax_t $ac_type
-_ACEOF
-
+    if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then
+    MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt'
   else
-
-$as_echo "#define HAVE_UINTMAX_T 1" >>confdefs.h
-
-  fi
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5
-$as_echo_n "checking for inttypes.h... " >&6; }
-if ${gt_cv_header_inttypes_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <inttypes.h>
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_header_inttypes_h=yes
-else
-  gt_cv_header_inttypes_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_header_inttypes_h" >&5
-$as_echo "$gt_cv_header_inttypes_h" >&6; }
-  if test $gt_cv_header_inttypes_h = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INTTYPES_H 1
-_ACEOF
-
-  fi
-
-
-
-  if test $gt_cv_header_inttypes_h = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5
-$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; }
-if ${gt_cv_inttypes_pri_broken+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <inttypes.h>
-#ifdef PRId32
-char *p = PRId32;
-#endif
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_inttypes_pri_broken=no
-else
-  gt_cv_inttypes_pri_broken=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5
-$as_echo "$gt_cv_inttypes_pri_broken" >&6; }
-  fi
-  if test "$gt_cv_inttypes_pri_broken" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define PRI_MACROS_BROKEN 1
-_ACEOF
-
-  fi
-
-
-  for ac_header in stdint.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdint_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H 1
-_ACEOF
-
-fi
-
-done
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5
-$as_echo_n "checking for SIZE_MAX... " >&6; }
-  result=
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <limits.h>
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef SIZE_MAX
-Found it
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Found it" >/dev/null 2>&1; then :
-  result=yes
-fi
-rm -f conftest*
-
-  if test -z "$result"; then
-                    if ac_fn_c_compute_int "$LINENO" "~(size_t)0 / 10" "res_hi"        "#include <stddef.h>"; then :
-
-else
-  result=?
-fi
-
-
-    if ac_fn_c_compute_int "$LINENO" "~(size_t)0 % 10" "res_lo"        "#include <stddef.h>"; then :
-
-else
-  result=?
-fi
-
-
-    if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint"        "#include <stddef.h>"; then :
-
-else
-  result=?
-fi
-
-
-    if test "$fits_in_uint" = 1; then
-                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stddef.h>
-        extern size_t foo;
-        extern unsigned long foo;
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  fits_in_uint=0
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test -z "$result"; then
-      if test "$fits_in_uint" = 1; then
-        result="$res_hi$res_lo"U
-      else
-        result="$res_hi$res_lo"UL
-      fi
+        if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then
+      MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet'
     else
-            result='~(size_t)0'
+                        MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet'
     fi
   fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $result" >&5
-$as_echo "$result" >&6; }
-  if test "$result" != yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define SIZE_MAX $result
-_ACEOF
-
-  fi
 
 
+    test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
 
-  for ac_header in stdint.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdint_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H 1
-_ACEOF
 
-fi
-
-done
+  ac_config_commands="$ac_config_commands po-directories"
 
 
 
@@ -7712,6 +7330,7 @@
   prefix="$acl_save_prefix"
 
 
+
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then :
   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
@@ -7722,48 +7341,22 @@
 # Prepare PATH_SEPARATOR.
 # The user is always right.
 if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
-$as_echo_n "checking for ld used by GCC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | [A-Za-z]:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the path of ld
-      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
+
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld" >&5
+$as_echo_n "checking for ld... " >&6; }
+elif test "$GCC" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
 elif test "$with_gnu_ld" = yes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
@@ -7771,52 +7364,142 @@
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
 $as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-if ${acl_cv_path_LD+:} false; then :
+if test -n "$LD"; then
+  # Let the user override the test with a path.
+  :
+else
+  if ${acl_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -z "$LD"; then
-  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
-  for ac_dir in $PATH; do
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some GNU ld's only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break ;;
-      *)
-	test "$with_gnu_ld" != yes && break ;;
+
+    acl_cv_path_LD= # Final result of this test
+    ac_prog=ld # Program to search in $PATH
+    if test "$GCC" = yes; then
+      # Check if gcc -print-prog-name=ld gives a path.
+      case $host in
+        *-*-mingw*)
+          # gcc leaves a trailing carriage return which upsets mingw
+          acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+        *)
+          acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+      esac
+      case $acl_output in
+        # Accept absolute paths.
+        [\\/]* | ?:[\\/]*)
+          re_direlt='/[^/][^/]*/\.\./'
+          # Canonicalize the pathname of ld
+          acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+          while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+            acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+          done
+          # Got the pathname. No search in PATH is needed.
+          acl_cv_path_LD="$acl_output"
+          ac_prog=
+          ;;
+        "")
+          # If it fails, then pretend we aren't using GCC.
+          ;;
+        *)
+          # If it is relative, then search for the first ld in PATH.
+          with_gnu_ld=unknown
+          ;;
       esac
     fi
-  done
-  IFS="$ac_save_ifs"
-else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+    if test -n "$ac_prog"; then
+      # Search for $ac_prog in $PATH.
+      acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+      for ac_dir in $PATH; do
+        IFS="$acl_save_ifs"
+        test -z "$ac_dir" && ac_dir=.
+        if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+          acl_cv_path_LD="$ac_dir/$ac_prog"
+          # Check to see if the program is GNU ld.  I'd rather use --version,
+          # but apparently some variants of GNU ld only accept -v.
+          # Break only if it was the GNU/non-GNU ld that we prefer.
+          case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+            *GNU* | *'with BFD'*)
+              test "$with_gnu_ld" != no && break
+              ;;
+            *)
+              test "$with_gnu_ld" != yes && break
+              ;;
+          esac
+        fi
+      done
+      IFS="$acl_save_ifs"
+    fi
+    case $host in
+      *-*-aix*)
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __powerpc64__ || defined _ARCH_PPC64
+                int ok;
+               #else
+                error fail
+               #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  # The compiler produces 64-bit code. Add option '-b64' so that the
+           # linker groks 64-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -b64 "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+           esac
+
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        ;;
+      sparc64-*-netbsd*)
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __sparcv9 || defined __arch64__
+                int ok;
+               #else
+                error fail
+               #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  # The compiler produces 32-bit code. Add option '-m elf32_sparc'
+           # so that the linker groks 32-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -m elf32_sparc "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+           esac
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        ;;
+    esac
+
 fi
 
-LD="$acl_cv_path_LD"
+  LD="$acl_cv_path_LD"
+fi
 if test -n "$LD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+  as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
 fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
 if ${acl_cv_prog_gnu_ld+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
-  acl_cv_prog_gnu_ld=yes ;;
+  acl_cv_prog_gnu_ld=yes
+  ;;
 *)
-  acl_cv_prog_gnu_ld=no ;;
+  acl_cv_prog_gnu_ld=no
+  ;;
 esac
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
@@ -7825,6 +7508,7 @@
 
 
 
+
                                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
 $as_echo_n "checking for shared library run path origin... " >&6; }
 if ${acl_cv_rpath+:} false; then :
@@ -7841,12 +7525,14 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
 $as_echo "$acl_cv_rpath" >&6; }
   wl="$acl_cv_wl"
-  libext="$acl_cv_libext"
-  shlibext="$acl_cv_shlibext"
-  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-  hardcode_direct="$acl_cv_hardcode_direct"
-  hardcode_minus_L="$acl_cv_hardcode_minus_L"
+  acl_libext="$acl_cv_libext"
+  acl_shlibext="$acl_cv_shlibext"
+  acl_libname_spec="$acl_cv_libname_spec"
+  acl_library_names_spec="$acl_cv_library_names_spec"
+  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  acl_hardcode_direct="$acl_cv_hardcode_direct"
+  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
     # Check whether --enable-rpath was given.
 if test "${enable_rpath+set}" = set; then :
   enableval=$enable_rpath; :
@@ -7857,6 +7543,419 @@
 
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5
+$as_echo_n "checking 32-bit host C ABI... " >&6; }
+if ${gl_cv_host_cpu_c_abi_32bit+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$gl_cv_host_cpu_c_abi"; then
+       case "$gl_cv_host_cpu_c_abi" in
+         i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+           gl_cv_host_cpu_c_abi_32bit=yes ;;
+         x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+           gl_cv_host_cpu_c_abi_32bit=no ;;
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown ;;
+       esac
+     else
+       case "$host_cpu" in
+
+         # CPUs that only support a 32-bit ABI.
+         arc \
+         | bfin \
+         | cris* \
+         | csky \
+         | epiphany \
+         | ft32 \
+         | h8300 \
+         | m68k \
+         | microblaze | microblazeel \
+         | nds32 | nds32le | nds32be \
+         | nios2 | nios2eb | nios2el \
+         | or1k* \
+         | or32 \
+         | sh | sh1234 | sh1234elb \
+         | tic6x \
+         | xtensa* )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         # CPUs that only support a 64-bit ABI.
+         alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+         | mmix )
+           gl_cv_host_cpu_c_abi_32bit=no
+           ;;
+
+         i[34567]86 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         x86_64 )
+           # On x86_64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+           # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+           #   with native Windows (mingw, MSVC).
+           # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if (defined __x86_64__ || defined __amd64__ \
+                       || defined _M_X64 || defined _M_AMD64) \
+                      && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         arm* | aarch64 )
+           # Assume arm with EABI.
+           # On arm64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+           # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+           # On hppa, the C compiler may be generating 32-bit code or 64-bit
+           # code. In the latter case, it defines _LP64 and __LP64__.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __LP64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         ia64* )
+           # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+           # 32-bit code. In the latter case, it defines _ILP32.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=yes
+else
+  gl_cv_host_cpu_c_abi_32bit=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         mips* )
+           # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+           # at 32.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         powerpc* )
+           # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+           # No need to distinguish them here; the caller may distinguish
+           # them based on the OS.
+           # On powerpc64 systems, the C compiler may still be generating
+           # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+           # be generating 64-bit code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __powerpc64__ || defined _ARCH_PPC64
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         rs6000 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         riscv32 | riscv64 )
+           # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+           # Size of 'long' and 'void *':
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         s390* )
+           # On s390x, the C compiler may be generating 64-bit (= s390x) code
+           # or 31-bit (= s390) code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__ || defined __s390x__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         sparc | sparc64 )
+           # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+           # C compiler still generates 32-bit code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __sparcv9 || defined __arch64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+           ;;
+
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown
+           ;;
+       esac
+     fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5
+$as_echo "$gl_cv_host_cpu_c_abi_32bit" >&6; }
+
+  HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF binary format" >&5
+$as_echo_n "checking for ELF binary format... " >&6; }
+if ${gl_cv_elf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __ELF__
+        Extensible Linking Format
+        #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
+  gl_cv_elf=yes
+else
+  gl_cv_elf=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5
+$as_echo "$gl_cv_elf" >&6; }
+  if test $gl_cv_elf; then
+    # Extract the ELF class of a file (5th byte) in decimal.
+    # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+    if od -A x < /dev/null >/dev/null 2>/dev/null; then
+      # Use POSIX od.
+      func_elfclass ()
+      {
+        od -A n -t d1 -j 4 -N 1
+      }
+    else
+      # Use BSD hexdump.
+      func_elfclass ()
+      {
+        dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+        echo
+      }
+    fi
+    case $HOST_CPU_C_ABI_32BIT in
+      yes)
+        # 32-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          test "`func_elfclass | sed -e 's/[ 	]//g'`" = 1
+        }
+        ;;
+      no)
+        # 64-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          test "`func_elfclass | sed -e 's/[ 	]//g'`" = 2
+        }
+        ;;
+      *)
+        # Unknown.
+        acl_is_expected_elfclass ()
+        {
+          :
+        }
+        ;;
+    esac
+  else
+    acl_is_expected_elfclass ()
+    {
+      :
+    }
+  fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5
+$as_echo_n "checking for the common suffixes of directories in the library search path... " >&6; }
+if ${acl_cv_libdirstems+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            acl_libdirstem=lib
+     acl_libdirstem2=
+     acl_libdirstem3=
+     case "$host_os" in
+       solaris*)
+                                                      if test $HOST_CPU_C_ABI_32BIT = no; then
+           acl_libdirstem2=lib/64
+           case "$host_cpu" in
+             sparc*)        acl_libdirstem3=lib/sparcv9 ;;
+             i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
+           esac
+         fi
+         ;;
+       *)
+                                                                                 searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+                     | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+         if test $HOST_CPU_C_ABI_32BIT != no; then
+           # 32-bit or unknown ABI.
+           if test -d /usr/lib32; then
+             acl_libdirstem2=lib32
+           fi
+         fi
+         if test $HOST_CPU_C_ABI_32BIT != yes; then
+           # 64-bit or unknown ABI.
+           if test -d /usr/lib64; then
+             acl_libdirstem3=lib64
+           fi
+         fi
+         if test -n "$searchpath"; then
+           acl_save_IFS="${IFS= 	}"; IFS=":"
+           for searchdir in $searchpath; do
+             if test -d "$searchdir"; then
+               case "$searchdir" in
+                 */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+                 */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+                 */../ | */.. )
+                   # Better ignore directories of this form. They are misleading.
+                   ;;
+                 *) searchdir=`cd "$searchdir" && pwd`
+                    case "$searchdir" in
+                      */lib32 ) acl_libdirstem2=lib32 ;;
+                      */lib64 ) acl_libdirstem3=lib64 ;;
+                    esac ;;
+               esac
+             fi
+           done
+           IFS="$acl_save_IFS"
+           if test $HOST_CPU_C_ABI_32BIT = yes; then
+             # 32-bit ABI.
+             acl_libdirstem3=
+           fi
+           if test $HOST_CPU_C_ABI_32BIT = no; then
+             # 64-bit ABI.
+             acl_libdirstem2=
+           fi
+         fi
+         ;;
+     esac
+     test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+     test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+     acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5
+$as_echo "$acl_cv_libdirstems" >&6; }
+      acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+  acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+  acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
+
+
+
+
+
+
+
 
 
 
@@ -7870,6 +7969,8 @@
 
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
+    eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+    eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
 
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
@@ -7890,21 +7991,33 @@
 
           eval additional_includedir=\"$includedir\"
           eval additional_libdir=\"$libdir\"
+          eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+          eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
 
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
       else
         additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
+        additional_libdir="$withval/$acl_libdirstem"
+        additional_libdir2="$withval/$acl_libdirstem2"
+        additional_libdir3="$withval/$acl_libdirstem3"
       fi
     fi
 
 fi
 
+  if test "X$additional_libdir2" = "X$additional_libdir"; then
+    additional_libdir2=
+  fi
+  if test "X$additional_libdir3" = "X$additional_libdir"; then
+    additional_libdir3=
+  fi
       LIBICONV=
   LTLIBICONV=
   INCICONV=
+  LIBICONV_PREFIX=
+      HAVE_LIBICONV=
   rpathdirs=
   ltrpathdirs=
   names_already_handled=
@@ -7922,7 +8035,7 @@
       done
       if test -z "$already_handled"; then
         names_already_handled="$names_already_handled $name"
-                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
         eval value=\"\$HAVE_LIB$uppername\"
         if test -n "$value"; then
           if test "$value" = yes; then
@@ -7938,22 +8051,58 @@
           found_la=
           found_so=
           found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
+          else
+            shrext=
+          fi
           if test $use_additional = yes; then
-            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
-              found_dir="$additional_libdir"
-              found_so="$additional_libdir/lib$name.$shlibext"
-              if test -f "$additional_libdir/lib$name.la"; then
-                found_la="$additional_libdir/lib$name.la"
-              fi
-            else
-              if test -f "$additional_libdir/lib$name.$libext"; then
-                found_dir="$additional_libdir"
-                found_a="$additional_libdir/lib$name.$libext"
-                if test -f "$additional_libdir/lib$name.la"; then
-                  found_la="$additional_libdir/lib$name.la"
+            for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+              if test "X$found_dir" = "X"; then
+                eval dir=\$$additional_libdir_variable
+                if test -n "$dir"; then
+                                                      if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                 fi
               fi
-            fi
+            done
           fi
           if test "X$found_dir" = "X"; then
             for x in $LDFLAGS $LTLIBICONV; do
@@ -7969,21 +8118,44 @@
               case "$x" in
                 -L*)
                   dir=`echo "X$x" | sed -e 's/^X-L//'`
-                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
-                    found_dir="$dir"
-                    found_so="$dir/lib$name.$shlibext"
-                    if test -f "$dir/lib$name.la"; then
-                      found_la="$dir/lib$name.la"
-                    fi
-                  else
-                    if test -f "$dir/lib$name.$libext"; then
+                                    if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
                       found_dir="$dir"
-                      found_a="$dir/lib$name.$libext"
-                      if test -f "$dir/lib$name.la"; then
-                        found_la="$dir/lib$name.la"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
                       fi
                     fi
                   fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                   ;;
               esac
               if test "X$found_dir" != "X"; then
@@ -7994,7 +8166,10 @@
           if test "X$found_dir" != "X"; then
                         LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
             if test "X$found_so" != "X"; then
-                                                        if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+                                                        if test "$enable_rpath" = no \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
                                 LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
               else
                                                                                 haveit=
@@ -8007,10 +8182,10 @@
                 if test -z "$haveit"; then
                   ltrpathdirs="$ltrpathdirs $found_dir"
                 fi
-                                if test "$hardcode_direct" = yes; then
+                                if test "$acl_hardcode_direct" = yes; then
                                                       LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
                 else
-                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
                                                             LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
                                                             haveit=
                     for x in $rpathdirs; do
@@ -8042,7 +8217,7 @@
                     if test -z "$haveit"; then
                       LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
                     fi
-                    if test "$hardcode_minus_L" != no; then
+                    if test "$acl_hardcode_minus_L" != no; then
                                                                                         LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
                     else
                                                                                                                                                                                 LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
@@ -8059,8 +8234,25 @@
             fi
                         additional_includedir=
             case "$found_dir" in
-              */lib | */lib/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                if test "$name" = 'iconv'; then
+                  LIBICONV_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem2 | */$acl_libdirstem2/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+                if test "$name" = 'iconv'; then
+                  LIBICONV_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem3 | */$acl_libdirstem3/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+                if test "$name" = 'iconv'; then
+                  LIBICONV_PREFIX="$basedir"
+                fi
                 additional_includedir="$basedir/include"
                 ;;
             esac
@@ -8070,7 +8262,7 @@
                 if test "X$additional_includedir" = "X/usr/local/include"; then
                   if test -n "$GCC"; then
                     case $host_os in
-                      linux*) haveit=yes;;
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
                     esac
                   fi
                 fi
@@ -8108,13 +8300,17 @@
                             for dep in $dependency_libs; do
                 case "$dep" in
                   -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                                                                                                                                                                if test "X$additional_libdir" != "X/usr/lib"; then
+                    dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
                       haveit=
-                      if test "X$additional_libdir" = "X/usr/local/lib"; then
+                      if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
                         if test -n "$GCC"; then
                           case $host_os in
-                            linux*) haveit=yes;;
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
                           esac
                         fi
                       fi
@@ -8130,14 +8326,14 @@
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }-L$dependency_libdir"
                           fi
                         fi
                         haveit=
@@ -8151,14 +8347,14 @@
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                                                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$dependency_libdir"
                           fi
                         fi
                       fi
@@ -8211,21 +8407,21 @@
     done
   done
   if test "X$rpathdirs" != "X"; then
-    if test -n "$hardcode_libdir_separator"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
                         alldirs=
       for found_dir in $rpathdirs; do
-        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
       done
             acl_save_libdir="$libdir"
       libdir="$alldirs"
-      eval flag=\"$hardcode_libdir_flag_spec\"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
       libdir="$acl_save_libdir"
       LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
     else
             for found_dir in $rpathdirs; do
         acl_save_libdir="$libdir"
         libdir="$found_dir"
-        eval flag=\"$hardcode_libdir_flag_spec\"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
         libdir="$acl_save_libdir"
         LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
       done
@@ -8244,277 +8440,180 @@
 
 
 
-  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
-
-else
-
-$as_echo "#define ptrdiff_t long" >>confdefs.h
-
-
-fi
-
-  for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
-stdlib.h string.h unistd.h sys/param.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-  for ac_func in asprintf fwprintf getcwd getegid geteuid getgid getuid \
-mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
-strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
-__fsetlocking
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _snprintf is declared" >&5
-$as_echo_n "checking whether _snprintf is declared... " >&6; }
-if ${ac_cv_have_decl__snprintf+:} false; then :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
+$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; }
+if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdio.h>
+#include <CoreFoundation/CFPreferences.h>
 int
 main ()
 {
-
-#ifndef _snprintf
-  char *p = (char *) _snprintf;
-#endif
-
+CFPreferencesCopyAppValue(NULL, NULL)
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_have_decl__snprintf=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  gt_cv_func_CFPreferencesCopyAppValue=yes
 else
-  ac_cv_have_decl__snprintf=no
+  gt_cv_func_CFPreferencesCopyAppValue=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     LIBS="$gt_save_LIBS"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl__snprintf" >&5
-$as_echo "$ac_cv_have_decl__snprintf" >&6; }
-  if test $ac_cv_have_decl__snprintf = yes; then
-    gt_value=1
-  else
-    gt_value=0
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
+$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+
+$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
+
   fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL__SNPRINTF $gt_value
-_ACEOF
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _snwprintf is declared" >&5
-$as_echo_n "checking whether _snwprintf is declared... " >&6; }
-if ${ac_cv_have_decl__snwprintf+:} false; then :
+                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5
+$as_echo_n "checking for CFLocaleCopyPreferredLanguages... " >&6; }
+if ${gt_cv_func_CFLocaleCopyPreferredLanguages+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdio.h>
+#include <CoreFoundation/CFLocale.h>
 int
 main ()
 {
-
-#ifndef _snwprintf
-  char *p = (char *) _snwprintf;
-#endif
-
+CFLocaleCopyPreferredLanguages();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_have_decl__snwprintf=yes
+if ac_fn_c_try_link "$LINENO"; then :
+  gt_cv_func_CFLocaleCopyPreferredLanguages=yes
 else
-  ac_cv_have_decl__snwprintf=no
+  gt_cv_func_CFLocaleCopyPreferredLanguages=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     LIBS="$gt_save_LIBS"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl__snwprintf" >&5
-$as_echo "$ac_cv_have_decl__snwprintf" >&6; }
-  if test $ac_cv_have_decl__snwprintf = yes; then
-    gt_value=1
-  else
-    gt_value=0
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5
+$as_echo "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; }
+  if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+
+$as_echo "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h
+
+  fi
+  INTL_MACOSX_LIBS=
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+     || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
   fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL__SNWPRINTF $gt_value
-_ACEOF
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether feof_unlocked is declared" >&5
-$as_echo_n "checking whether feof_unlocked is declared... " >&6; }
-if ${ac_cv_have_decl_feof_unlocked+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
 
-#ifndef feof_unlocked
-  char *p = (char *) feof_unlocked;
-#endif
+  LIBINTL=
+  LTLIBINTL=
+  POSUB=
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_have_decl_feof_unlocked=yes
-else
-  ac_cv_have_decl_feof_unlocked=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_feof_unlocked" >&5
-$as_echo "$ac_cv_have_decl_feof_unlocked" >&6; }
-  if test $ac_cv_have_decl_feof_unlocked = yes; then
-    gt_value=1
-  else
-    gt_value=0
-  fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FEOF_UNLOCKED $gt_value
-_ACEOF
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fgets_unlocked is declared" >&5
-$as_echo_n "checking whether fgets_unlocked is declared... " >&6; }
-if ${ac_cv_have_decl_fgets_unlocked+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-
-#ifndef fgets_unlocked
-  char *p = (char *) fgets_unlocked;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_have_decl_fgets_unlocked=yes
-else
-  ac_cv_have_decl_fgets_unlocked=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_fgets_unlocked" >&5
-$as_echo "$ac_cv_have_decl_fgets_unlocked" >&6; }
-  if test $ac_cv_have_decl_fgets_unlocked = yes; then
-    gt_value=1
-  else
-    gt_value=0
-  fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FGETS_UNLOCKED $gt_value
-_ACEOF
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getc_unlocked is declared" >&5
-$as_echo_n "checking whether getc_unlocked is declared... " >&6; }
-if ${ac_cv_have_decl_getc_unlocked+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-
-#ifndef getc_unlocked
-  char *p = (char *) getc_unlocked;
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_have_decl_getc_unlocked=yes
-else
-  ac_cv_have_decl_getc_unlocked=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_getc_unlocked" >&5
-$as_echo "$ac_cv_have_decl_getc_unlocked" >&6; }
-  if test $ac_cv_have_decl_getc_unlocked = yes; then
-    gt_value=1
-  else
-    gt_value=0
-  fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETC_UNLOCKED $gt_value
-_ACEOF
-
-
-
-  case $gt_cv_func_printf_posix in
-    *yes) HAVE_POSIX_PRINTF=1 ;;
-    *) HAVE_POSIX_PRINTF=0 ;;
+    case " $gt_needs " in
+    *" need-formatstring-macros "*) gt_api_version=3 ;;
+    *" need-ngettext "*) gt_api_version=2 ;;
+    *) gt_api_version=1 ;;
   esac
+  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
 
-  if test "$ac_cv_func_asprintf" = yes; then
-    HAVE_ASPRINTF=1
-  else
-    HAVE_ASPRINTF=0
-  fi
-
-  if test "$ac_cv_func_snprintf" = yes; then
-    HAVE_SNPRINTF=1
-  else
-    HAVE_SNPRINTF=0
-  fi
-
-  if test "$ac_cv_func_wprintf" = yes; then
-    HAVE_WPRINTF=1
-  else
-    HAVE_WPRINTF=0
-  fi
+    if test "$USE_NLS" = "yes"; then
+    gt_use_preinstalled_gnugettext=no
 
 
+        if test $gt_api_version -ge 3; then
+          gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+'
+        else
+          gt_revision_test_code=
+        fi
+        if test $gt_api_version -ge 2; then
+          gt_expression_test_code=' + * ngettext ("", "", 0)'
+        else
+          gt_expression_test_code=
+        fi
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5
+$as_echo_n "checking for GNU gettext in libc... " >&6; }
+if eval \${$gt_func_gnugettext_libc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
+int
+main ()
+{
+
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$gt_func_gnugettext_libc=yes"
+else
+  eval "$gt_func_gnugettext_libc=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$gt_func_gnugettext_libc
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
 
 
 
@@ -8555,14 +8654,16 @@
     am_cv_lib_iconv=no
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <stdlib.h>
 #include <iconv.h>
+
 int
 main ()
 {
 iconv_t cd = iconv_open("","");
-       iconv(cd,NULL,NULL,NULL,NULL);
-       iconv_close(cd);
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);
   ;
   return 0;
 }
@@ -8577,14 +8678,16 @@
       LIBS="$LIBS $LIBICONV"
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <stdlib.h>
 #include <iconv.h>
+
 int
 main ()
 {
 iconv_t cd = iconv_open("","");
-         iconv(cd,NULL,NULL,NULL,NULL);
-         iconv_close(cd);
+             iconv(cd,NULL,NULL,NULL,NULL);
+             iconv_close(cd);
   ;
   return 0;
 }
@@ -8602,6 +8705,169 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
 $as_echo "$am_cv_func_iconv" >&6; }
   if test "$am_cv_func_iconv" = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
+$as_echo_n "checking for working iconv... " >&6; }
+if ${am_cv_func_iconv_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+                  am_save_LIBS="$LIBS"
+      if test $am_cv_lib_iconv = yes; then
+        LIBS="$LIBS $LIBICONV"
+      fi
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <iconv.h>
+#include <string.h>
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main ()
+{
+int result = 0;
+  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
+     returns.  */
+  {
+    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+    if (cd_utf8_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_utf8_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
+      }
+  }
+  /* Test against Solaris 10 bug: Failures are not distinguishable from
+     successful returns.  */
+  {
+    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+    if (cd_ascii_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\263";
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_ascii_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
+      }
+  }
+  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304";
+        static char buf[2] = { (char)0xDE, (char)0xAD };
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = 1;
+        char *outptr = buf;
+        size_t outbytesleft = 1;
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#if 0 /* This bug could be worked around by the caller.  */
+  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        char buf[50];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if ((int)res > 0)
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#endif
+  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+     provided.  */
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
+  return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  am_cv_func_iconv_works=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+        test "$am_cv_func_iconv_works" = no || break
+      done
+      LIBS="$am_save_LIBS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
+$as_echo "$am_cv_func_iconv_works" >&6; }
+    case "$am_cv_func_iconv_works" in
+      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+      *)   am_func_iconv=yes ;;
+    esac
+  else
+    am_func_iconv=no am_cv_lib_iconv=no
+  fi
+  if test "$am_func_iconv" = yes; then
 
 $as_echo "#define HAVE_ICONV 1" >>confdefs.h
 
@@ -8619,187 +8885,6 @@
 
 
 
-  if test "$am_cv_func_iconv" = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5
-$as_echo_n "checking for iconv declaration... " >&6; }
-    if ${am_cv_proto_iconv+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdlib.h>
-#include <iconv.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-#if defined(__STDC__) || defined(__cplusplus)
-size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
-#else
-size_t iconv();
-#endif
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  am_cv_proto_iconv_arg1=""
-else
-  am_cv_proto_iconv_arg1="const"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"
-fi
-
-    am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:-
-         }$am_cv_proto_iconv" >&5
-$as_echo "${ac_t:-
-         }$am_cv_proto_iconv" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define ICONV_CONST $am_cv_proto_iconv_arg1
-_ACEOF
-
-  fi
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
-$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
-if ${am_cv_langinfo_codeset+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <langinfo.h>
-int
-main ()
-{
-char* cs = nl_langinfo(CODESET);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  am_cv_langinfo_codeset=yes
-else
-  am_cv_langinfo_codeset=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
-$as_echo "$am_cv_langinfo_codeset" >&6; }
-  if test $am_cv_langinfo_codeset = yes; then
-
-$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
-
-  fi
-
-  if test $ac_cv_header_locale_h = yes; then
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
-$as_echo_n "checking for LC_MESSAGES... " >&6; }
-if ${am_cv_val_LC_MESSAGES+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <locale.h>
-int
-main ()
-{
-return LC_MESSAGES
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  am_cv_val_LC_MESSAGES=yes
-else
-  am_cv_val_LC_MESSAGES=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_val_LC_MESSAGES" >&5
-$as_echo "$am_cv_val_LC_MESSAGES" >&6; }
-  if test $am_cv_val_LC_MESSAGES = yes; then
-
-$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
-
-  fi
-
-  fi
-
-                      for ac_prog in bison
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_INTLBISON+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$INTLBISON"; then
-  ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_INTLBISON="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-INTLBISON=$ac_cv_prog_INTLBISON
-if test -n "$INTLBISON"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTLBISON" >&5
-$as_echo "$INTLBISON" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$INTLBISON" && break
-done
-
-  if test -z "$INTLBISON"; then
-    ac_verc_fail=yes
-  else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of bison" >&5
-$as_echo_n "checking version of bison... " >&6; }
-    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-    case $ac_prog_version in
-      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
-         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-    esac
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
-$as_echo "$ac_prog_version" >&6; }
-  fi
-  if test $ac_verc_fail = yes; then
-    INTLBISON=:
-  fi
 
 
 
@@ -8807,95 +8892,6 @@
 
 
 
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
-$as_echo_n "checking whether NLS is requested... " >&6; }
-    # Check whether --enable-nls was given.
-if test "${enable_nls+set}" = set; then :
-  enableval=$enable_nls; USE_NLS=$enableval
-else
-  USE_NLS=yes
-fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
-$as_echo "$USE_NLS" >&6; }
-
-
-
-
-    BUILD_INCLUDED_LIBINTL=no
-    USE_INCLUDED_LIBINTL=no
-
-  LIBINTL=
-  LTLIBINTL=
-  POSUB=
-
-    if test "$USE_NLS" = "yes"; then
-    gt_use_preinstalled_gnugettext=no
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether included gettext is requested" >&5
-$as_echo_n "checking whether included gettext is requested... " >&6; }
-
-# Check whether --with-included-gettext was given.
-if test "${with_included_gettext+set}" = set; then :
-  withval=$with_included_gettext; nls_cv_force_use_gnu_gettext=$withval
-else
-  nls_cv_force_use_gnu_gettext=no
-fi
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $nls_cv_force_use_gnu_gettext" >&5
-$as_echo "$nls_cv_force_use_gnu_gettext" >&6; }
-
-      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
-      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
-
-
-
-
-
-
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5
-$as_echo_n "checking for GNU gettext in libc... " >&6; }
-if ${gt_cv_func_gnugettext1_libc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <libintl.h>
-extern int _nl_msg_cat_cntr;
-extern int *_nl_domain_bindings;
-int
-main ()
-{
-bindtextdomain ("", "");
-return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_domain_bindings
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gt_cv_func_gnugettext1_libc=yes
-else
-  gt_cv_func_gnugettext1_libc=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_gnugettext1_libc" >&5
-$as_echo "$gt_cv_func_gnugettext1_libc" >&6; }
-
-        if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
-
-
-
     use_additional=yes
 
   acl_save_prefix="$prefix"
@@ -8905,6 +8901,8 @@
 
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
+    eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+    eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
 
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
@@ -8925,21 +8923,33 @@
 
           eval additional_includedir=\"$includedir\"
           eval additional_libdir=\"$libdir\"
+          eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+          eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
 
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
       else
         additional_includedir="$withval/include"
-        additional_libdir="$withval/lib"
+        additional_libdir="$withval/$acl_libdirstem"
+        additional_libdir2="$withval/$acl_libdirstem2"
+        additional_libdir3="$withval/$acl_libdirstem3"
       fi
     fi
 
 fi
 
+  if test "X$additional_libdir2" = "X$additional_libdir"; then
+    additional_libdir2=
+  fi
+  if test "X$additional_libdir3" = "X$additional_libdir"; then
+    additional_libdir3=
+  fi
       LIBINTL=
   LTLIBINTL=
   INCINTL=
+  LIBINTL_PREFIX=
+      HAVE_LIBINTL=
   rpathdirs=
   ltrpathdirs=
   names_already_handled=
@@ -8957,7 +8967,7 @@
       done
       if test -z "$already_handled"; then
         names_already_handled="$names_already_handled $name"
-                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
         eval value=\"\$HAVE_LIB$uppername\"
         if test -n "$value"; then
           if test "$value" = yes; then
@@ -8973,22 +8983,58 @@
           found_la=
           found_so=
           found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
+          else
+            shrext=
+          fi
           if test $use_additional = yes; then
-            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
-              found_dir="$additional_libdir"
-              found_so="$additional_libdir/lib$name.$shlibext"
-              if test -f "$additional_libdir/lib$name.la"; then
-                found_la="$additional_libdir/lib$name.la"
-              fi
-            else
-              if test -f "$additional_libdir/lib$name.$libext"; then
-                found_dir="$additional_libdir"
-                found_a="$additional_libdir/lib$name.$libext"
-                if test -f "$additional_libdir/lib$name.la"; then
-                  found_la="$additional_libdir/lib$name.la"
+            for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+              if test "X$found_dir" = "X"; then
+                eval dir=\$$additional_libdir_variable
+                if test -n "$dir"; then
+                                                      if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                 fi
               fi
-            fi
+            done
           fi
           if test "X$found_dir" = "X"; then
             for x in $LDFLAGS $LTLIBINTL; do
@@ -9004,21 +9050,44 @@
               case "$x" in
                 -L*)
                   dir=`echo "X$x" | sed -e 's/^X-L//'`
-                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
-                    found_dir="$dir"
-                    found_so="$dir/lib$name.$shlibext"
-                    if test -f "$dir/lib$name.la"; then
-                      found_la="$dir/lib$name.la"
-                    fi
-                  else
-                    if test -f "$dir/lib$name.$libext"; then
+                                    if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
                       found_dir="$dir"
-                      found_a="$dir/lib$name.$libext"
-                      if test -f "$dir/lib$name.la"; then
-                        found_la="$dir/lib$name.la"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
                       fi
                     fi
                   fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                   ;;
               esac
               if test "X$found_dir" != "X"; then
@@ -9029,7 +9098,10 @@
           if test "X$found_dir" != "X"; then
                         LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
             if test "X$found_so" != "X"; then
-                                                        if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
+                                                        if test "$enable_rpath" = no \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
                                 LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
               else
                                                                                 haveit=
@@ -9042,10 +9114,10 @@
                 if test -z "$haveit"; then
                   ltrpathdirs="$ltrpathdirs $found_dir"
                 fi
-                                if test "$hardcode_direct" = yes; then
+                                if test "$acl_hardcode_direct" = yes; then
                                                       LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
                 else
-                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
                                                             LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
                                                             haveit=
                     for x in $rpathdirs; do
@@ -9077,7 +9149,7 @@
                     if test -z "$haveit"; then
                       LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir"
                     fi
-                    if test "$hardcode_minus_L" != no; then
+                    if test "$acl_hardcode_minus_L" != no; then
                                                                                         LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
                     else
                                                                                                                                                                                 LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
@@ -9094,8 +9166,25 @@
             fi
                         additional_includedir=
             case "$found_dir" in
-              */lib | */lib/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                if test "$name" = 'intl'; then
+                  LIBINTL_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem2 | */$acl_libdirstem2/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+                if test "$name" = 'intl'; then
+                  LIBINTL_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem3 | */$acl_libdirstem3/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+                if test "$name" = 'intl'; then
+                  LIBINTL_PREFIX="$basedir"
+                fi
                 additional_includedir="$basedir/include"
                 ;;
             esac
@@ -9105,7 +9194,7 @@
                 if test "X$additional_includedir" = "X/usr/local/include"; then
                   if test -n "$GCC"; then
                     case $host_os in
-                      linux*) haveit=yes;;
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
                     esac
                   fi
                 fi
@@ -9143,13 +9232,17 @@
                             for dep in $dependency_libs; do
                 case "$dep" in
                   -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                                                                                                                                                                if test "X$additional_libdir" != "X/usr/lib"; then
+                    dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
                       haveit=
-                      if test "X$additional_libdir" = "X/usr/local/lib"; then
+                      if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
                         if test -n "$GCC"; then
                           case $host_os in
-                            linux*) haveit=yes;;
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
                           esac
                         fi
                       fi
@@ -9165,14 +9258,14 @@
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                                                        LIBINTL="${LIBINTL}${LIBINTL:+ }-L$dependency_libdir"
                           fi
                         fi
                         haveit=
@@ -9186,14 +9279,14 @@
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                                                        LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$dependency_libdir"
                           fi
                         fi
                       fi
@@ -9246,21 +9339,21 @@
     done
   done
   if test "X$rpathdirs" != "X"; then
-    if test -n "$hardcode_libdir_separator"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
                         alldirs=
       for found_dir in $rpathdirs; do
-        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
       done
             acl_save_libdir="$libdir"
       libdir="$alldirs"
-      eval flag=\"$hardcode_libdir_flag_spec\"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
       libdir="$acl_save_libdir"
       LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
     else
             for found_dir in $rpathdirs; do
         acl_save_libdir="$libdir"
         libdir="$found_dir"
-        eval flag=\"$hardcode_libdir_flag_spec\"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
         libdir="$acl_save_libdir"
         LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
       done
@@ -9272,9 +9365,13 @@
     done
   fi
 
+
+
+
+
           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5
 $as_echo_n "checking for GNU gettext in libintl... " >&6; }
-if ${gt_cv_func_gnugettext1_libintl+:} false; then :
+if eval \${$gt_func_gnugettext_libintl+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   gt_save_CPPFLAGS="$CPPFLAGS"
@@ -9283,53 +9380,73 @@
             LIBS="$LIBS $LIBINTL"
                         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
-const char *_nl_expand_alias ();
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
 int
 main ()
 {
+
 bindtextdomain ("", "");
-return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0)
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  gt_cv_func_gnugettext1_libintl=yes
+  eval "$gt_func_gnugettext_libintl=yes"
 else
-  gt_cv_func_gnugettext1_libintl=no
+  eval "$gt_func_gnugettext_libintl=no"
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-                        if test "$gt_cv_func_gnugettext1_libintl" != yes && test -n "$LIBICONV"; then
+                        if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
               LIBS="$LIBS $LIBICONV"
               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <libintl.h>
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 extern int _nl_msg_cat_cntr;
 extern
 #ifdef __cplusplus
 "C"
 #endif
-const char *_nl_expand_alias ();
+const char *_nl_expand_alias (const char *);
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
+#else
+#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
+#endif
+$gt_revision_test_code
+
 int
 main ()
 {
+
 bindtextdomain ("", "");
-return (int) gettext ("") + _nl_msg_cat_cntr + *_nl_expand_alias (0)
+return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
+
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   LIBINTL="$LIBINTL $LIBICONV"
-                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
-                gt_cv_func_gnugettext1_libintl=yes
+                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                 eval "$gt_func_gnugettext_libintl=yes"
 
 fi
 rm -f core conftest.err conftest.$ac_objext \
@@ -9338,12 +9455,13 @@
             CPPFLAGS="$gt_save_CPPFLAGS"
             LIBS="$gt_save_LIBS"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_gnugettext1_libintl" >&5
-$as_echo "$gt_cv_func_gnugettext1_libintl" >&6; }
+eval ac_res=\$$gt_func_gnugettext_libintl
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
         fi
 
-                                        if test "$gt_cv_func_gnugettext1_libc" = "yes" \
-           || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \
+                                        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
                 && test "$PACKAGE" != gettext-runtime \
                 && test "$PACKAGE" != gettext-tools; }; then
           gt_use_preinstalled_gnugettext=yes
@@ -9354,24 +9472,14 @@
         fi
 
 
-        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
-                              nls_cv_use_gnu_gettext=yes
-        fi
-      fi
 
-      if test "$nls_cv_use_gnu_gettext" = "yes"; then
-                BUILD_INCLUDED_LIBINTL=yes
-        USE_INCLUDED_LIBINTL=yes
-        LIBINTL="\${top_builddir}/intl/libintl.a $LIBICONV"
-        LTLIBINTL="\${top_builddir}/intl/libintl.a $LTLIBICONV"
-        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
-      fi
-
+    if test -n "$INTL_MACOSX_LIBS"; then
       if test "$gt_use_preinstalled_gnugettext" = "yes" \
          || test "$nls_cv_use_gnu_gettext" = "yes"; then
-                CATOBJEXT=.gmo
+                LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
       fi
-
+    fi
 
     if test "$gt_use_preinstalled_gnugettext" = "yes" \
        || test "$nls_cv_use_gnu_gettext" = "yes"; then
@@ -9391,7 +9499,7 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5
 $as_echo_n "checking where the gettext function comes from... " >&6; }
     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
-      if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then
+      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
         gt_source="external libintl"
       else
         gt_source="libc"
@@ -9406,7 +9514,7 @@
   if test "$USE_NLS" = "yes"; then
 
     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
-      if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then
+      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5
 $as_echo_n "checking how to link with libintl... " >&6; }
         { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5
@@ -9448,34 +9556,6 @@
   fi
 
 
-            if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
-      BUILD_INCLUDED_LIBINTL=yes
-    fi
-
-
-
-
-
-        nls_cv_header_intl=
-    nls_cv_header_libgt=
-
-        DATADIRNAME=share
-
-
-        INSTOBJEXT=.mo
-
-
-        GENCAT=gencat
-
-
-        if test "$USE_INCLUDED_LIBINTL" = yes; then
-      INTLOBJS="\$(GETTOBJS)"
-    fi
-
-
-        INTL_LIBTOOL_SUFFIX_PREFIX=
-
-
 
     INTLLIBS="$LIBINTL"
 
@@ -9522,7 +9602,12 @@
   $as_echo_n "(cached) " >&6
 else
   _cv_gnu_make_command='' ;
-                for a in "$MAKE" make gmake gnumake ; do
+                if test -n "$FORCE_NATIVE_MAKE" ; then
+                   MAKES="make"
+                else
+                   MAKES="make gmake gnumake"
+                fi
+                for a in "$MAKE" $MAKES ; do
                         if test -z "$a" ; then continue ; fi ;
                         if  ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
                                 _cv_gnu_make_command=$a ;
@@ -9586,6 +9671,9 @@
 fi
 
 
+
+mkdir_p=$MKDIR_P
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
 $as_echo_n "checking whether ln -s works... " >&6; }
 LN_S=$as_ln_s
@@ -10307,7 +10395,7 @@
 
 
 if test "_$MAKEINFO" = "_"; then
-    MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true"
+    MAKEINFO="echo Makeinfo is missing. Info documentation will not be built."
 else
     case "$MAKEINFO" in
       */missing.*)
@@ -10370,7 +10458,7 @@
 done
 
 fi
-for ac_header in  	dirent.h 	errno.h 	execinfo.h 	getopt.h 	malloc.h 	mntent.h 	paths.h 	semaphore.h 	setjmp.h 	signal.h 	stdarg.h 	stdint.h 	stdlib.h 	termios.h 	termio.h 	unistd.h 	utime.h 	linux/falloc.h 	linux/fd.h 	linux/major.h 	linux/loop.h 	net/if_dl.h 	netinet/in.h 	sys/disklabel.h 	sys/file.h 	sys/ioctl.h 	sys/mkdev.h 	sys/mman.h 	sys/prctl.h 	sys/queue.h 	sys/resource.h 	sys/select.h 	sys/socket.h 	sys/sockio.h 	sys/stat.h 	sys/syscall.h 	sys/sysmacros.h 	sys/time.h 	sys/types.h 	sys/un.h 	sys/wait.h
+for ac_header in  	dirent.h 	errno.h 	execinfo.h 	getopt.h 	malloc.h 	mntent.h 	paths.h 	pthread.h 	semaphore.h 	setjmp.h 	signal.h 	stdarg.h 	stdint.h 	stdlib.h 	termios.h 	termio.h 	unistd.h 	utime.h 	attr/xattr.h 	linux/falloc.h 	linux/fd.h 	linux/fsmap.h 	linux/major.h 	linux/loop.h 	linux/types.h 	net/if_dl.h 	netinet/in.h 	sys/acl.h 	sys/disklabel.h 	sys/disk.h 	sys/file.h 	sys/ioctl.h 	sys/key.h 	sys/mkdev.h 	sys/mman.h 	sys/mount.h 	sys/prctl.h 	sys/resource.h 	sys/select.h 	sys/socket.h 	sys/sockio.h 	sys/stat.h 	sys/syscall.h 	sys/sysmacros.h 	sys/time.h 	sys/types.h 	sys/un.h 	sys/wait.h 	sys/xattr.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -10383,23 +10471,26 @@
 
 done
 
-for ac_header in sys/disk.h sys/mount.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
-#if HAVE_SYS_QUEUE_H
-#include <sys/queue.h>
-#endif
-
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a dd(1) program that supports iflag=fullblock" >&5
+$as_echo_n "checking for a dd(1) program that supports iflag=fullblock... " >&6; }
+DD=
+for i in dd gdd ; do
+	if "$i" if=/dev/null of=/dev/null count=1 bs=10k 2>/dev/null iflag=fullblock oflag=append ; then
+		DD=$i
+		break
+	fi
+done
+if test -n "$DD" ; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DD" >&5
+$as_echo "$DD" >&6; }
+else
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found, using dd" >&5
+$as_echo "not found, using dd" >&6; }
+	DD=dd
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No GNU-compatible dd(1) program found, expect some self-test failures." >&5
+$as_echo "$as_me: WARNING: No GNU-compatible dd(1) program found, expect some self-test failures." >&2;}
 fi
 
-done
 
 for ac_header in net/if.h
 do :
@@ -10448,6 +10539,16 @@
 
 fi
 
+ac_fn_c_check_member "$LINENO" "struct stat" "st_atim" "ac_cv_member_struct_stat_st_atim" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_atim" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_ATIM 1
+_ACEOF
+
+
+fi
+
 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "#include <sys/types.h>
 "
 if test "x$ac_cv_type_ssize_t" = xyes; then :
@@ -10639,11 +10740,46 @@
 _ACEOF
 
 
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
+$as_echo_n "checking size of time_t... " >&6; }
+if ${ac_cv_sizeof_time_t+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t"        "$ac_includes_default"; then :
+
+else
+  if test "$ac_cv_type_time_t" = yes; then
+     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot compute sizeof (time_t)
+See \`config.log' for more details" "$LINENO" 5; }
+   else
+     ac_cv_sizeof_time_t=0
+   fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5
+$as_echo "$ac_cv_sizeof_time_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
+_ACEOF
+
+
 SIZEOF_SHORT=$ac_cv_sizeof_short
 SIZEOF_INT=$ac_cv_sizeof_int
 SIZEOF_LONG=$ac_cv_sizeof_long
 SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
 SIZEOF_OFF_T=$ac_cv_sizeof_off_t
+SIZEOF_TIME_T=$ac_cv_sizeof_time_t
+
 
 
 
@@ -10873,7 +11009,11 @@
  presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
  esac
 
-BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+if test $cross_compiling = no; then
+  BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+else
+  CROSS_COMPILE="1" BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+fi
 ASM_TYPES_HEADER=./asm_types.h
 
 echo "/* These defines are needed for the public ext2fs.h header file */" \
@@ -10984,12 +11124,13 @@
 fi
 
 if test -n "$BLKID_CMT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing blkid_probe_all" >&5
-$as_echo_n "checking for library containing blkid_probe_all... " >&6; }
-if ${ac_cv_search_blkid_probe_all+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blkid_probe_get_topology in -lblkid" >&5
+$as_echo_n "checking for blkid_probe_get_topology in -lblkid... " >&6; }
+if ${ac_cv_lib_blkid_blkid_probe_get_topology+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_func_search_save_LIBS=$LIBS
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lblkid  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -10999,49 +11140,121 @@
 #ifdef __cplusplus
 extern "C"
 #endif
-char blkid_probe_all ();
+char blkid_probe_get_topology ();
 int
 main ()
 {
-return blkid_probe_all ();
+return blkid_probe_get_topology ();
   ;
   return 0;
 }
 _ACEOF
-for ac_lib in '' blkid; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_blkid_probe_all=$ac_res
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_blkid_blkid_probe_get_topology=yes
+else
+  ac_cv_lib_blkid_blkid_probe_get_topology=no
 fi
 rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_blkid_probe_all+:} false; then :
-  break
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-done
-if ${ac_cv_search_blkid_probe_all+:} false; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blkid_blkid_probe_get_topology" >&5
+$as_echo "$ac_cv_lib_blkid_blkid_probe_get_topology" >&6; }
+if test "x$ac_cv_lib_blkid_blkid_probe_get_topology" = xyes; then :
 
+$as_echo "#define HAVE_BLKID_PROBE_GET_TOPOLOGY 1" >>confdefs.h
+
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blkid_topology_get_dax in -lblkid" >&5
+$as_echo_n "checking for blkid_topology_get_dax in -lblkid... " >&6; }
+if ${ac_cv_lib_blkid_blkid_topology_get_dax+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_search_blkid_probe_all=no
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lblkid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char blkid_topology_get_dax ();
+int
+main ()
+{
+return blkid_topology_get_dax ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_blkid_blkid_topology_get_dax=yes
+else
+  ac_cv_lib_blkid_blkid_topology_get_dax=no
 fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_blkid_probe_all" >&5
-$as_echo "$ac_cv_search_blkid_probe_all" >&6; }
-ac_res=$ac_cv_search_blkid_probe_all
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blkid_blkid_topology_get_dax" >&5
+$as_echo "$ac_cv_lib_blkid_blkid_topology_get_dax" >&6; }
+if test "x$ac_cv_lib_blkid_blkid_topology_get_dax" = xyes; then :
+
+$as_echo "#define HAVE_BLKID_TOPOLOGY_GET_DAX 1" >>confdefs.h
+
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blkid_probe_enable_partitions in -lblkid" >&5
+$as_echo_n "checking for blkid_probe_enable_partitions in -lblkid... " >&6; }
+if ${ac_cv_lib_blkid_blkid_probe_enable_partitions+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lblkid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char blkid_probe_enable_partitions ();
+int
+main ()
+{
+return blkid_probe_enable_partitions ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_blkid_blkid_probe_enable_partitions=yes
+else
+  ac_cv_lib_blkid_blkid_probe_enable_partitions=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blkid_blkid_probe_enable_partitions" >&5
+$as_echo "$ac_cv_lib_blkid_blkid_probe_enable_partitions" >&6; }
+if test "x$ac_cv_lib_blkid_blkid_probe_enable_partitions" = xyes; then :
+
+$as_echo "#define HAVE_BLKID_PROBE_ENABLE_PARTITIONS 1" >>confdefs.h
 
 fi
 
 fi
-for ac_func in  	__secure_getenv 	backtrace 	blkid_probe_get_topology 	chflags 	fallocate 	fallocate64 	fchown 	fdatasync 	fstat64 	ftruncate64 	getdtablesize 	getmntinfo 	getpwuid_r 	getrlimit 	getrusage 	jrand48 	llseek 	lseek64 	mallinfo 	mbstowcs 	memalign 	mmap 	msync 	nanosleep 	open64 	pathconf 	posix_fadvise 	posix_memalign 	prctl 	secure_getenv 	setmntent 	setresgid 	setresuid 	srandom 	strcasecmp 	strdup 	strnlen 	strptime 	strtoull 	sync_file_range 	sysconf 	usleep 	utime 	valloc
+if test -n "$DLOPEN_LIB" ; then
+   ac_cv_func_dlopen=yes
+fi
+for ac_func in  	__secure_getenv 	add_key 	backtrace 	chflags 	dlopen 	fadvise64 	fallocate 	fallocate64 	fchown 	fcntl 	fdatasync 	fstat64 	fsync 	ftruncate64 	futimes 	getcwd 	getdtablesize 	gethostname 	getmntinfo 	getpwuid_r 	getrlimit 	getrusage 	jrand48 	keyctl 	llistxattr 	llseek 	lseek64 	mallinfo 	mbstowcs 	memalign 	mempcpy 	mmap 	msync 	nanosleep 	open64 	pathconf 	posix_fadvise 	posix_fadvise64 	posix_memalign 	prctl 	pread 	pwrite 	pread64 	pwrite64 	secure_getenv 	setmntent 	setresgid 	setresuid 	snprintf 	srandom 	stpcpy 	strcasecmp 	strdup 	strnlen 	strptime 	strtoull 	sync_file_range 	sysconf 	usleep 	utime 	utimes 	valloc
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -11095,6 +11308,370 @@
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for magic_file in -lmagic" >&5
+$as_echo_n "checking for magic_file in -lmagic... " >&6; }
+if ${ac_cv_lib_magic_magic_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmagic  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char magic_file ();
+int
+main ()
+{
+return magic_file ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_magic_magic_file=yes
+else
+  ac_cv_lib_magic_magic_file=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_magic_magic_file" >&5
+$as_echo "$ac_cv_lib_magic_magic_file" >&6; }
+if test "x$ac_cv_lib_magic_magic_file" = xyes; then :
+  MAGIC_LIB=-lmagic
+for ac_header in magic.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "magic.h" "ac_cv_header_magic_h" "$ac_includes_default"
+if test "x$ac_cv_header_magic_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MAGIC_H 1
+_ACEOF
+
+fi
+
+done
+
+fi
+
+if test "$ac_cv_func_dlopen" = yes ; then
+   MAGIC_LIB=$DLOPEN_LIB
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if ${ac_cv_lib_rt_clock_gettime+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_rt_clock_gettime=yes
+else
+  ac_cv_lib_rt_clock_gettime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
+  CLOCK_GETTIME_LIB=-lrt
+fi
+
+
+FUSE_CMT=
+FUSE_LIB=
+# Check whether --enable-fuse2fs was given.
+if test "${enable_fuse2fs+set}" = set; then :
+  enableval=$enable_fuse2fs; if test "$enableval" = "no"
+then
+	FUSE_CMT="#"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Disabling fuse2fs" >&5
+$as_echo "Disabling fuse2fs" >&6; }
+else
+	for ac_header in pthread.h fuse.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#define _FILE_OFFSET_BITS	64
+#define FUSE_USE_VERSION 29
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Cannot find fuse2fs headers.
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+done
+
+
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define FUSE_USE_VERSION 29
+#ifdef __linux__
+#include <linux/fs.h>
+#include <linux/falloc.h>
+#include <linux/xattr.h>
+#endif
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Cannot find fuse2fs Linux headers.
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_main in -losxfuse" >&5
+$as_echo_n "checking for fuse_main in -losxfuse... " >&6; }
+if ${ac_cv_lib_osxfuse_fuse_main+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-losxfuse  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fuse_main ();
+int
+main ()
+{
+return fuse_main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_osxfuse_fuse_main=yes
+else
+  ac_cv_lib_osxfuse_fuse_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_main" >&5
+$as_echo "$ac_cv_lib_osxfuse_fuse_main" >&6; }
+if test "x$ac_cv_lib_osxfuse_fuse_main" = xyes; then :
+  FUSE_LIB=-losxfuse
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_main in -lfuse" >&5
+$as_echo_n "checking for fuse_main in -lfuse... " >&6; }
+if ${ac_cv_lib_fuse_fuse_main+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfuse  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fuse_main ();
+int
+main ()
+{
+return fuse_main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_fuse_fuse_main=yes
+else
+  ac_cv_lib_fuse_fuse_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_main" >&5
+$as_echo "$ac_cv_lib_fuse_fuse_main" >&6; }
+if test "x$ac_cv_lib_fuse_fuse_main" = xyes; then :
+  FUSE_LIB=-lfuse
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Cannot find fuse library.
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+fi
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling fuse2fs" >&5
+$as_echo "Enabling fuse2fs" >&6; }
+fi
+
+else
+  for ac_header in pthread.h fuse.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#define _FILE_OFFSET_BITS	64
+#define FUSE_USE_VERSION 29
+#ifdef __linux__
+# include <linux/fs.h>
+# include <linux/falloc.h>
+# include <linux/xattr.h>
+#endif
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  FUSE_CMT="#"
+fi
+
+done
+
+if test -z "$FUSE_CMT"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_main in -losxfuse" >&5
+$as_echo_n "checking for fuse_main in -losxfuse... " >&6; }
+if ${ac_cv_lib_osxfuse_fuse_main+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-losxfuse  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fuse_main ();
+int
+main ()
+{
+return fuse_main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_osxfuse_fuse_main=yes
+else
+  ac_cv_lib_osxfuse_fuse_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_osxfuse_fuse_main" >&5
+$as_echo "$ac_cv_lib_osxfuse_fuse_main" >&6; }
+if test "x$ac_cv_lib_osxfuse_fuse_main" = xyes; then :
+  FUSE_LIB=-losxfuse
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fuse_main in -lfuse" >&5
+$as_echo_n "checking for fuse_main in -lfuse... " >&6; }
+if ${ac_cv_lib_fuse_fuse_main+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lfuse  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char fuse_main ();
+int
+main ()
+{
+return fuse_main ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_fuse_fuse_main=yes
+else
+  ac_cv_lib_fuse_fuse_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fuse_fuse_main" >&5
+$as_echo "$ac_cv_lib_fuse_fuse_main" >&6; }
+if test "x$ac_cv_lib_fuse_fuse_main" = xyes; then :
+  FUSE_LIB=-lfuse
+else
+  FUSE_CMT="#"
+fi
+
+fi
+
+fi
+if test -z "$FUSE_CMT"
+then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Enabling fuse2fs by default." >&5
+$as_echo "Enabling fuse2fs by default." >&6; }
+fi
+
+fi
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for optreset" >&5
 $as_echo_n "checking for optreset... " >&6; }
 if ${ac_cv_have_optreset+:} false; then :
@@ -11123,7 +11700,10 @@
 fi
 
 SEM_INIT_LIB=''
-ac_fn_c_check_func "$LINENO" "sem_init" "ac_cv_func_sem_init"
+echo GL_THREADS_API: ${gl_threads_api}
+if test "${gl_threads_api}" != none
+then
+  ac_fn_c_check_func "$LINENO" "sem_init" "ac_cv_func_sem_init"
 if test "x$ac_cv_func_sem_init" = xyes; then :
 
 else
@@ -11256,6 +11836,7 @@
 fi
 
 fi
+fi
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unified diff option" >&5
 $as_echo_n "checking for unified diff option... " >&6; }
@@ -11274,6 +11855,376 @@
 
 	;;
 esac
+
+    $as_echo_n "checking for mount 'nosuid' option... "
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/mount.h>
+int
+main ()
+{
+void *temp = (void *)(MS_NOSUID); (void) temp;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_MOUNT_NOSUID 1" >>confdefs.h
+
+         ac_cv_mount_nosuid=yes
+         $as_echo "yes"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/mount.h>
+int
+main ()
+{
+void *temp = (void *)(MNT_NOSUID); (void) temp;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_MOUNT_NOSUID 1" >>confdefs.h
+
+             ac_cv_mount_nosuid=yes
+             $as_echo "yes"
+else
+  ac_cv_mount_nosuid=no
+             $as_echo "no"
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+    $as_echo_n "checking for mount 'nodev' option... "
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/mount.h>
+int
+main ()
+{
+void *temp = (void *)(MS_NODEV); (void) temp;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_MOUNT_NODEV 1" >>confdefs.h
+
+         ac_cv_mount_nodev=yes
+         $as_echo "yes"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/mount.h>
+int
+main ()
+{
+void *temp = (void *)(MNT_NODEV); (void) temp;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_MOUNT_NODEV 1" >>confdefs.h
+
+             ac_cv_mount_nodev=yes
+             $as_echo "yes"
+else
+  ac_cv_mount_nodev=no
+             $as_echo "no"
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+# Check whether --enable-lto was given.
+if test "${enable_lto+set}" = set; then :
+  enableval=$enable_lto;
+else
+  enable_lto=no
+fi
+
+if test "$enable_lto" = "yes" || test "$enable_lto" = "probe"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C compiler supports LTO" >&5
+$as_echo_n "checking if C compiler supports LTO... " >&6; }
+	OLD_CFLAGS="$CFLAGS"
+	OLD_LDFLAGS="$LDFLAGS"
+	LTO_FLAGS="-g -flto -ffat-lto-objects"
+	CFLAGS="$CFLAGS $LTO_FLAGS"
+	LDFLAGS="$LDFLAGS $LTO_FLAGS"
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+		lto_cflags=$LTO_FLAGS
+		lto_ldflags=$LTO_FLAGS
+		# Extract the first word of "gcc-ar", so it can be a program name with args.
+set dummy gcc-ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_gcc_ar+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $gcc_ar in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_gcc_ar="$gcc_ar" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_gcc_ar="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+gcc_ar=$ac_cv_path_gcc_ar
+if test -n "$gcc_ar"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_ar" >&5
+$as_echo "$gcc_ar" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+		# Extract the first word of "gcc-ranlib", so it can be a program name with args.
+set dummy gcc-ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_gcc_ranlib+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $gcc_ranlib in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_gcc_ranlib="$gcc_ranlib" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_gcc_ranlib="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+gcc_ranlib=$ac_cv_path_gcc_ranlib
+if test -n "$gcc_ranlib"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_ranlib" >&5
+$as_echo "$gcc_ranlib" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	if test -x "$gcc_ar" && test -x "$gcc_ranlib"; then
+		have_lto=yes
+		AR="${gcc_ar}"
+		RANLIB="${gcc_ranlib}"
+	fi
+	CFLAGS="${OLD_CFLAGS}"
+	LDFLAGS="${OLD_LDFLAGS}"
+
+
+
+fi
+if test "$enable_lto" = "yes" && test "$have_lto" != "yes"; then
+	as_fn_error $? "LTO not supported by compiler." "$LINENO" 5
+fi
+# Check whether --enable-ubsan was given.
+if test "${enable_ubsan+set}" = set; then :
+  enableval=$enable_ubsan;
+else
+  enable_ubsan=no
+fi
+
+if test "$enable_ubsan" = "yes" || test "$enable_ubsan" = "probe"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C compiler supports UBSAN" >&5
+$as_echo_n "checking if C compiler supports UBSAN... " >&6; }
+	OLD_CFLAGS="$CFLAGS"
+	OLD_LDFLAGS="$LDFLAGS"
+	UBSAN_FLAGS="-fsanitize=undefined"
+	CFLAGS="$CFLAGS $UBSAN_FLAGS"
+	LDFLAGS="$LDFLAGS $UBSAN_FLAGS"
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+		ubsan_cflags=$UBSAN_FLAGS
+		ubsan_ldflags=$UBSAN_FLAGS
+		have_ubsan=yes
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	CFLAGS="${OLD_CFLAGS}"
+	LDFLAGS="${OLD_LDFLAGS}"
+
+
+
+fi
+if test "$enable_ubsan" = "yes" && test "$have_ubsan" != "yes"; then
+	as_fn_error $? "UBSAN not supported by compiler." "$LINENO" 5
+fi
+# Check whether --enable-addrsan was given.
+if test "${enable_addrsan+set}" = set; then :
+  enableval=$enable_addrsan;
+else
+  enable_addrsan=no
+fi
+
+if test "$enable_addrsan" = "yes" || test "$enable_addrsan" = "probe"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C compiler supports ADDRSAN" >&5
+$as_echo_n "checking if C compiler supports ADDRSAN... " >&6; }
+	OLD_CFLAGS="$CFLAGS"
+	OLD_LDFLAGS="$LDFLAGS"
+	ADDRSAN_FLAGS="-fsanitize=address"
+	CFLAGS="$CFLAGS $ADDRSAN_FLAGS"
+	LDFLAGS="$LDFLAGS $ADDRSAN_FLAGS"
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+		addrsan_cflags=$ADDRSAN_FLAGS
+		addrsan_ldflags=$ADDRSAN_FLAGS
+		have_addrsan=yes
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	CFLAGS="${OLD_CFLAGS}"
+	LDFLAGS="${OLD_LDFLAGS}"
+
+
+
+fi
+if test "$enable_addrsan" = "yes" && test "$have_addrsan" != "yes"; then
+	as_fn_error $? "ADDRSAN not supported by compiler." "$LINENO" 5
+fi
+# Check whether --enable-threadsan was given.
+if test "${enable_threadsan+set}" = set; then :
+  enableval=$enable_threadsan;
+else
+  enable_threadsan=no
+fi
+
+if test "$enable_threadsan" = "yes" || test "$enable_threadsan" = "probe"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C compiler supports THREADSAN" >&5
+$as_echo_n "checking if C compiler supports THREADSAN... " >&6; }
+	OLD_CFLAGS="$CFLAGS"
+	OLD_LDFLAGS="$LDFLAGS"
+	THREADSAN_FLAGS="-fsanitize=thread"
+	CFLAGS="$CFLAGS $THREADSAN_FLAGS"
+	LDFLAGS="$LDFLAGS $THREADSAN_FLAGS"
+	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+		threadsan_cflags=$THREADSAN_FLAGS
+		threadsan_ldflags=$THREADSAN_FLAGS
+		have_threadsan=yes
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	CFLAGS="${OLD_CFLAGS}"
+	LDFLAGS="${OLD_LDFLAGS}"
+
+
+
+fi
+if test "$enable_threadsan" = "yes" && test "$have_threadsan" != "yes"; then
+	as_fn_error $? "THREADSAN not supported by compiler." "$LINENO" 5
+fi
+if test "$have_threadsan" = "yes" && test "$have_addrsan" = "yes"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ADDRSAN and THREADSAN are not known to work together." >&5
+$as_echo "$as_me: WARNING: ADDRSAN and THREADSAN are not known to work together." >&2;}
+fi
 LINUX_CMT="#"
 CYGWIN_CMT="#"
 UNIX_CMT=
@@ -11289,6 +12240,8 @@
 
 
 
+E2SCRUB_CMT="$LINUX_CMT"
+
 case "$host_os" in
 linux* | gnu* | k*bsd*-gnu)
 	if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
@@ -11356,16 +12309,22 @@
 
 # Check whether --with-multiarch was given.
 if test "${with_multiarch+set}" = set; then :
-  withval=$with_multiarch; libdir=$libdir/$withval
-root_libdir=$root_libdir/$withval
+  withval=$with_multiarch; if test "$withval" = "lib64"; then
+    libdir=/usr/lib64
+    root_libdir=/lib64
+else
+    libdir=$libdir/$withval
+    root_libdir=$root_libdir/$withval
+fi
 
 fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can link with -static" >&5
 $as_echo_n "checking whether we can link with -static... " >&6; }
 if ${ac_cv_e2fsprogs_use_static+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
+  SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS_STATIC -static"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
@@ -11394,9 +12353,8 @@
 esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_e2fsprogs_use_static" >&5
 $as_echo "$ac_cv_e2fsprogs_use_static" >&6; }
-LDFLAG_STATIC=
 if test $ac_cv_e2fsprogs_use_static = yes; then
-	LDFLAG_STATIC=-static
+	LDFLAGS_STATIC="$LDFLAGS_STATIC -static"
 fi
 
 case "$host_os" in
@@ -11408,10 +12366,6 @@
 
 	;;
 esac
-SS_DIR=`cd ${srcdir}/lib/ss; pwd`
-ET_DIR=`cd ${srcdir}/lib/et; pwd`
-
-
 if test "$cross_compiling" = yes ; then
   DO_TEST_SUITE=
 else
@@ -11425,32 +12379,330 @@
 if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
 	INCLUDES=$INCLUDES' -I$(top_builddir)/intl -I$(top_srcdir)/intl'
 fi
-
-if test $cross_compiling = no; then
-   BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
-   BUILD_LDFLAGS="$LDFLAGS"
-else
-   BUILD_CFLAGS=
-   BUILD_LDFLAGS=
+if test -n "$WITH_DIET_LIBC" ; then
+	INCLUDES="$INCLUDES -D_REENTRANT"
 fi
 
+if test $cross_compiling = no; then
+   BUILD_CFLAGS="$CFLAGS $CPPFLAGS $INCLUDES -DHAVE_CONFIG_H"
+   BUILD_LDFLAGS="$LDFLAGS"
+fi
+
+
+CFLAGS_SHLIB=${CFLAGS_SHLIB:-$CFLAGS}
+CFLAGS_STLIB=${CFLAGS_STLIB:-$CFLAGS}
+LDFLAGS_SHLIB=${LDFLAGS_SHLIB:-$LDFLAGS}
+
+
+
+
+
+# Check whether --with-udev_rules_dir was given.
+if test "${with_udev_rules_dir+set}" = set; then :
+  withval=$with_udev_rules_dir;
+else
+  with_udev_rules_dir=yes
+fi
+
+if test "x${with_udev_rules_dir}" != "xno"; then :
+
+	if test "x${with_udev_rules_dir}" = "xyes"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for udev" >&5
+$as_echo_n "checking for udev... " >&6; }
+
+if test -n "$udev_CFLAGS"; then
+    pkg_cv_udev_CFLAGS="$udev_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"udev\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "udev") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_udev_CFLAGS=`$PKG_CONFIG --cflags "udev" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$udev_LIBS"; then
+    pkg_cv_udev_LIBS="$udev_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"udev\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "udev") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_udev_LIBS=`$PKG_CONFIG --libs "udev" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        udev_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "udev" 2>&1`
+        else
+	        udev_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "udev" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$udev_PKG_ERRORS" >&5
+
+
+			with_udev_rules_dir=""
+
+elif test $pkg_failed = untried; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+			with_udev_rules_dir=""
+
+else
+	udev_CFLAGS=$pkg_cv_udev_CFLAGS
+	udev_LIBS=$pkg_cv_udev_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+			with_udev_rules_dir="$($PKG_CONFIG --variable=udevdir udev)/rules.d"
+
+fi
+
+fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for udev rules dir" >&5
+$as_echo_n "checking for udev rules dir... " >&6; }
+	pkg_udev_rules_dir="${with_udev_rules_dir}"
+	if test -n "${pkg_udev_rules_dir}"; then :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${pkg_udev_rules_dir}" >&5
+$as_echo "${pkg_udev_rules_dir}" >&6; }
+		have_udev="yes"
+
+else
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		have_udev="no"
+
+fi
+
+else
+
+	have_udev="disabled"
+
+fi
+
+
+
+
+# Check whether --with-crond_dir was given.
+if test "${with_crond_dir+set}" = set; then :
+  withval=$with_crond_dir;
+else
+  with_crond_dir=yes
+fi
+
+if test "x${with_crond_dir}" != "xno"; then :
+
+	if test "x${with_crond_dir}" = "xyes"; then :
+
+		if test -d "/etc/cron.d"; then :
+  with_crond_dir="/etc/cron.d"
+else
+  have_crond="no"; with_crond_dir=""
+fi
+
+fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for system crontab dir" >&5
+$as_echo_n "checking for system crontab dir... " >&6; }
+	crond_dir="${with_crond_dir}"
+	if test -n "${crond_dir}"; then :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5
+$as_echo "${crond_dir}" >&6; }
+		have_crond="yes"
+
+else
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		have_crond="no"
+
+fi
+
+else
+
+	have_crond="disabled"
+
+fi
+
+
+
+
+# Check whether --with-systemd_unit_dir was given.
+if test "${with_systemd_unit_dir+set}" = set; then :
+  withval=$with_systemd_unit_dir;
+else
+  with_systemd_unit_dir=yes
+fi
+
+if test "x${with_systemd_unit_dir}" != "xno"; then :
+
+	if test "x${with_systemd_unit_dir}" = "xyes"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemd" >&5
+$as_echo_n "checking for systemd... " >&6; }
+
+if test -n "$systemd_CFLAGS"; then
+    pkg_cv_systemd_CFLAGS="$systemd_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "systemd") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_systemd_CFLAGS=`$PKG_CONFIG --cflags "systemd" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$systemd_LIBS"; then
+    pkg_cv_systemd_LIBS="$systemd_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"systemd\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "systemd") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_systemd_LIBS=`$PKG_CONFIG --libs "systemd" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        systemd_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "systemd" 2>&1`
+        else
+	        systemd_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "systemd" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$systemd_PKG_ERRORS" >&5
+
+
+			with_systemd_unit_dir=""
+
+elif test $pkg_failed = untried; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+			with_systemd_unit_dir=""
+
+else
+	systemd_CFLAGS=$pkg_cv_systemd_CFLAGS
+	systemd_LIBS=$pkg_cv_systemd_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+			with_systemd_unit_dir="$($PKG_CONFIG --variable=systemdsystemunitdir systemd)"
+
+fi
+
+
+fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemd system unit dir" >&5
+$as_echo_n "checking for systemd system unit dir... " >&6; }
+	systemd_system_unit_dir="${with_systemd_unit_dir}"
+	if test -n "${systemd_system_unit_dir}"; then :
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${systemd_system_unit_dir}" >&5
+$as_echo "${systemd_system_unit_dir}" >&6; }
+		have_systemd="yes"
+
+else
+
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		have_systemd="no"
+
+fi
+
+else
+
+	have_systemd="disabled"
+
+fi
+
+
+OS_IO_FILE=""
+case "$host_os" in
+  cigwin*|mingw*|msys*)
+    OS_IO_FILE=windows_io
+  ;;
+  *)
+    OS_IO_FILE=unix_io
+  ;;
+esac
 
 test -d lib || mkdir lib
 test -d include || mkdir include
 test -d include/linux || mkdir include/linux
 test -d include/asm || mkdir include/asm
-for i in MCONFIG Makefile e2fsprogs.spec \
+if test -z "$UUID_CMT" ; then
+	uuid_out_list="lib/uuid/Makefile lib/uuid/uuid.pc \
+		lib/uuid/uuid_types.h"
+fi
+if test -z "$BLKID_CMT" ; then
+	blkid_out_list="lib/blkid/Makefile lib/blkid/blkid.pc \
+		lib/blkid/blkid_types.h"
+fi
+for i in MCONFIG Makefile \
 	util/Makefile util/subst.conf util/gen-tarball util/install-symlink \
 	lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
 	lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
-	lib/uuid/Makefile lib/uuid/uuid_types.h \
-	lib/blkid/Makefile lib/blkid/blkid_types.h lib/quota/Makefile \
-	lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
-	lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
+	$uuid_out_list $blkid_out_list lib/support/Makefile \
+	lib/ss/ss.pc lib/et/com_err.pc lib/e2p/e2p.pc lib/ext2fs/ext2fs.pc \
 	misc/Makefile ext2ed/Makefile e2fsck/Makefile \
 	debugfs/Makefile tests/Makefile tests/progs/Makefile \
-	resize/Makefile doc/Makefile intl/Makefile \
-	intl/libgnuintl.h po/Makefile.in ; do
+	resize/Makefile doc/Makefile po/Makefile.in scrub/Makefile; do
 	if test -d `dirname ${srcdir}/$i` ; then
 		outlist="$outlist $i"
 	fi
@@ -12041,6 +13293,7 @@
 ac_pwd='$ac_pwd'
 srcdir='$srcdir'
 INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
 AWK='$AWK'
 test -n "\$AWK" || AWK=awk
 _ACEOF
@@ -12149,9 +13402,8 @@
 # INIT-COMMANDS
 #
 # Capture the value of obsolete ALL_LINGUAS because we need it to compute
-    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
-    # from automake.
-    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS.
+    OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS"
     # Capture the value of LINGUAS because we need it to compute CATALOGS.
     LINGUAS="${LINGUAS-%UNSET%}"
 
@@ -12165,7 +13417,7 @@
 do
   case $ac_config_target in
     "lib/config.h") CONFIG_HEADERS="$CONFIG_HEADERS lib/config.h" ;;
-    "default-1") CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
+    "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
     "$outlist") CONFIG_FILES="$CONFIG_FILES $outlist" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
@@ -12649,6 +13901,11 @@
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
   *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
   esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
@@ -12703,6 +13960,7 @@
 s&@abs_builddir@&$ac_abs_builddir&;t t
 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
 "
 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" |
@@ -12761,7 +14019,7 @@
 
 
   case $ac_file$ac_mode in
-    "default-1":C)
+    "po-directories":C)
     for ac_file in $CONFIG_FILES; do
       # Support "outfile[:infile[:infile...]]"
       case "$ac_file" in
@@ -12771,7 +14029,7 @@
       case "$ac_file" in */Makefile.in)
         # Adjust a relative srcdir.
         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
-        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
+        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
         # In autoconf-2.13 it is called $ac_given_srcdir.
         # In autoconf-2.50 it is called $srcdir.
@@ -12781,10 +14039,14 @@
           /*) top_srcdir="$ac_given_srcdir" ;;
           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
         esac
+        # Treat a directory as a PO directory if and only if it has a
+        # POTFILES.in file. This allows packages to have multiple PO
+        # directories under different names or in different locations.
         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
           rm -f "$ac_dir/POTFILES"
           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
-          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ 	]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+          gt_tab=`printf '\t'`
+          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
           POMAKEFILEDEPS="POTFILES.in"
           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
           # on $ac_dir but don't depend on user-specified configuration
@@ -12794,13 +14056,11 @@
             if test -n "$OBSOLETE_ALL_LINGUAS"; then
               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
             fi
-            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
-            # Hide the ALL_LINGUAS assigment from automake.
-            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+            ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
           else
             # The set of available languages was given in configure.in.
-            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+            ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS
           fi
           # Compute POFILES
           # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..824a93d
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,1830 @@
+AC_INIT(version.h)
+AC_PREREQ(2.69)
+AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_HEADERS([lib/config.h])
+AH_BOTTOM([#include <dirpaths.h>])
+MCONFIG=./MCONFIG
+AC_SUBST_FILE(MCONFIG)
+BINARY_TYPE=bin
+dnl
+dnl This is to figure out the version number and the date....
+dnl
+E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h  \
+	| awk '{print $3}' | tr \" " " | awk '{print $1}'`
+E2FSPROGS_DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
+	| tr \" " " | awk '{print $1}'`
+E2FSPROGS_DAY=$(echo $E2FSPROGS_DATE | awk -F- '{print $1}' | sed -e '/^[[1-9]]$/s/^/0/')
+MONTH=`echo $E2FSPROGS_DATE | awk -F- '{print $2}'`
+YEAR=`echo $E2FSPROGS_DATE | awk -F- '{print $3}'`
+
+if expr $YEAR ">" 1900 > /dev/null ; then
+	E2FSPROGS_YEAR=$YEAR
+elif expr $YEAR ">" 90 >/dev/null ; then
+	E2FSPROGS_YEAR=19$YEAR
+else
+	E2FSPROGS_YEAR=20$YEAR
+fi
+
+case $MONTH in
+Jan)	MONTH_NUM=01; E2FSPROGS_MONTH="January" ;;
+Feb)	MONTH_NUM=02; E2FSPROGS_MONTH="February" ;;
+Mar)	MONTH_NUM=03; E2FSPROGS_MONTH="March" ;;
+Apr)	MONTH_NUM=04; E2FSPROGS_MONTH="April" ;;
+May)	MONTH_NUM=05; E2FSPROGS_MONTH="May" ;;
+Jun)	MONTH_NUM=06; E2FSPROGS_MONTH="June" ;;
+Jul)	MONTH_NUM=07; E2FSPROGS_MONTH="July" ;;
+Aug)	MONTH_NUM=08; E2FSPROGS_MONTH="August" ;;
+Sep)	MONTH_NUM=09; E2FSPROGS_MONTH="September" ;;
+Oct)	MONTH_NUM=10; E2FSPROGS_MONTH="October" ;;
+Nov)	MONTH_NUM=11; E2FSPROGS_MONTH="November" ;;
+Dec)	MONTH_NUM=12; E2FSPROGS_MONTH="December" ;;
+*)	AC_MSG_WARN([Unknown month $MONTH??]) ;;
+esac
+
+base_ver=`echo $E2FSPROGS_VERSION | \
+	       sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'`
+
+date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY}
+
+case $E2FSPROGS_VERSION in
+*-WIP|pre-*)
+	E2FSPROGS_PKGVER="$base_ver~WIP.$date_spec"
+	;;
+*)
+	E2FSPROGS_PKGVER="$base_ver"
+	;;
+esac
+
+unset DATE MONTH YEAR base_ver pre_vers date_spec
+AC_MSG_RESULT([Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION])
+AC_MSG_RESULT([Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}])
+AC_SUBST(E2FSPROGS_YEAR)
+AC_SUBST(E2FSPROGS_MONTH)
+AC_SUBST(E2FSPROGS_DAY)
+AC_SUBST(E2FSPROGS_VERSION)
+AC_SUBST(E2FSPROGS_PKGVER)
+AC_SUBST(E2FSPROGS_DATE)
+dnl
+dnl Use diet libc
+dnl 
+WITH_DIET_LIBC=
+AC_ARG_WITH([diet-libc],
+AS_HELP_STRING([--with-diet-libc],[use diet libc]),
+CC="diet cc -nostdinc"
+WITH_DIET_LIBC=yes
+if test -z "$LIBS"
+then
+	LIBS="-lcompat"
+else
+	LIBS="$LIBS -lcompat"
+fi
+AC_MSG_RESULT(CC=$CC))dnl
+dnl
+AC_CANONICAL_HOST
+dnl
+dnl Check to see if libdl exists for the sake of dlopen
+dnl
+DLOPEN_LIB=''
+AC_CHECK_LIB(dl, dlopen,DLOPEN_LIB=-ldl)
+AC_SUBST(DLOPEN_LIB)
+dnl
+AC_ARG_WITH([cc],
+AS_HELP_STRING([--with-cc],[no longer supported, use CC= instead]),
+AC_MSG_ERROR([--with-cc no longer supported; use CC= instead]))
+dnl
+AC_ARG_WITH([ccopts],
+AS_HELP_STRING([--with-ccopts],[no longer supported, use CFLAGS= instead]),
+AC_MSG_ERROR([--with-ccopts no longer supported; use CFLAGS= instead]))
+dnl
+AC_ARG_WITH([ldopts],
+AS_HELP_STRING([--with-ldopts],[no longer supported, use LDFLAGS= instead]),
+AC_MSG_ERROR([--with-ldopts no longer supported; use LDFLAGS= instead]))
+dnl
+AC_PROG_CC
+if test "$GCC" = yes; then
+   RDYNAMIC="-rdynamic"
+   AC_SUBST(RDYNAMIC)
+fi
+AC_PROG_CPP
+dnl
+dnl Alpha computers use fast and imprecise floating point code that may
+dnl miss exceptions by default. Force sane options if we're using GCC.
+AC_MSG_CHECKING(for additional special compiler flags)
+if test "$GCC" = yes
+then
+    case "$host_cpu" in
+	alpha)		addcflags="-mieee" ;;
+    esac
+fi
+if test "x$addcflags" != x
+then
+    AC_MSG_RESULT($addcflags)
+    CFLAGS="$addcflags $CFLAGS"
+else
+    AC_MSG_RESULT([[(none)]])
+fi
+AC_USE_SYSTEM_EXTENSIONS
+dnl
+dnl Set default values for library extensions.  Will be dealt with after
+dnl parsing configuration options, which may modify these
+dnl
+LIB_EXT=.a
+STATIC_LIB_EXT=.a
+PROFILED_LIB_EXT=.a
+dnl
+dnl Allow separate `root_prefix' to be specified
+dnl
+AC_ARG_WITH([root-prefix],
+AS_HELP_STRING([--with-root-prefix=PREFIX],[override prefix variable for files to be placed in the root]),
+root_prefix=$withval,
+root_prefix=NONE)dnl
+dnl
+dnl handle --enable-maintainer-mode
+dnl
+AC_ARG_ENABLE([maintainer-mode],
+AS_HELP_STRING([--enable-maintainer-mode],[enable makefile rules useful for maintainers]),
+if test "$enableval" = "no"
+then
+	MAINTAINER_CMT=#
+	AC_MSG_RESULT([Disabling maintainer mode])
+else
+	MAINTAINER_CMT=
+	AC_MSG_RESULT([Enabling maintainer mode])
+fi
+,
+MAINTAINER_CMT=#
+AC_MSG_RESULT([Disabling maintainer mode by default])
+)
+AC_SUBST(MAINTAINER_CMT)
+dnl
+dnl handle --enable-symlink-install
+dnl
+AC_ARG_ENABLE([symlink-install],
+AS_HELP_STRING([--enable-symlink-install],[use symlinks when installing instead of hard links]),
+if test "$enableval" = "no"
+then
+	LINK_INSTALL_FLAGS=-f
+	AC_MSG_RESULT([Disabling symlinks for install])
+else
+	LINK_INSTALL_FLAGS=-sf
+	AC_MSG_RESULT([Enabling symlinks for install])
+fi
+,
+LINK_INSTALL_FLAGS=-f
+AC_MSG_RESULT([Disabling symlinks for install by default])
+)
+AC_SUBST(LINK_INSTALL_FLAGS)
+dnl
+dnl handle --enable-relative-symlinks
+dnl
+relative_symlink_defined=
+AC_ARG_ENABLE([relative-symlinks],
+AS_HELP_STRING([--enable-relative-symlinks],[use relative symlinks when installing]),
+if test "$enableval" = "no"
+then
+	SYMLINK_RELATIVE=
+	relative_symlink_defined=yes
+	AC_MSG_RESULT([Disabling relative symlinks for install])
+else
+	SYMLINK_RELATIVE=--relative
+	relative_symlink_defined=yes
+	AC_MSG_RESULT([Enabling relative symlinks for install])
+fi)
+AC_ARG_ENABLE([symlink-relative-symlinks],,
+if test "$enableval" = "no"
+then
+	SYMLINK_RELATIVE=yes
+	AC_MSG_RESULT([Disabling relative symlinks for install])
+else
+	SYMLINK_RELATIVE=--relative
+	AC_MSG_RESULT([Enabling relative symlinks for install])
+fi
+,
+if test -z "$relative_symlink_defined"
+then
+	SYMLINK_RELATIVE=
+AC_MSG_RESULT([Disabling relative symlinks for install by default])
+fi
+)
+AC_SUBST(SYMLINK_RELATIVE)
+dnl
+dnl handle --enable-symlink-build
+dnl
+AC_ARG_ENABLE([symlink-build],
+AS_HELP_STRING([--enable-symlink-build],[use symlinks while building instead of hard links]),
+if test "$enableval" = "no"
+then
+	LINK_BUILD_FLAGS=
+	AC_MSG_RESULT([Disabling symlinks for build])
+else
+	LINK_BUILD_FLAGS=-s
+	AC_MSG_RESULT([Enabling symlinks for build])
+fi
+,
+LINK_BUILD_FLAGS=
+AC_MSG_RESULT([Disabling symlinks for build by default])
+)
+AC_SUBST(LINK_BUILD_FLAGS)
+dnl
+dnl handle --enable-verbose-makecmds
+dnl
+AC_ARG_ENABLE([verbose-makecmds],
+AS_HELP_STRING([--enable-verbose-makecmds],[enable verbose make command output]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling verbose make commands])
+	E=@echo
+	ES=echo
+	Q=@
+else
+	AC_MSG_RESULT([Enabling verbose make commands])
+	E=@\\#
+	ES=\\#
+	Q= 
+fi
+,
+AC_MSG_RESULT([Disabling verbose make commands])
+E=@echo
+ES=echo
+Q=@
+)
+AC_SUBST(E)
+AC_SUBST(ES)
+AC_SUBST(Q)
+dnl
+dnl This needs to be before all of the --enable-*-shlibs options
+dnl
+E2_PKG_CONFIG_STATIC=--static
+LDFLAG_DYNAMIC=
+PRIVATE_LIBS_CMT=
+dnl
+dnl handle --enable-elf-shlibs
+dnl
+AC_ARG_ENABLE([elf-shlibs],
+AS_HELP_STRING([--enable-elf-shlibs],[select ELF shared libraries]),
+if test "$enableval" = "no"
+then
+	ELF_CMT=#
+	MAKEFILE_ELF=/dev/null
+	AC_MSG_RESULT([Disabling ELF shared libraries])
+else
+	E2_PKG_CONFIG_STATIC=
+	ELF_CMT=
+	MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
+	[case "$host_os" in
+	solaris2.*)
+		MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
+	;;
+	esac]
+	BINARY_TYPE=elfbin
+	LIB_EXT=.so
+	PRIVATE_LIBS_CMT=#
+	LDFLAG_DYNAMIC=['-Wl,-rpath-link,$(top_builddir)/lib']
+	AC_MSG_RESULT([Enabling ELF shared libraries])
+fi
+,
+MAKEFILE_ELF=/dev/null
+ELF_CMT=#
+AC_MSG_RESULT([Disabling ELF shared libraries by default])
+)
+AC_SUBST(ELF_CMT)
+AC_SUBST_FILE(MAKEFILE_ELF)
+dnl
+dnl handle --enable-bsd-shlibs
+dnl
+AC_ARG_ENABLE([bsd-shlibs],
+AS_HELP_STRING([--enable-bsd-shlibs],[select BSD shared libraries]),
+if test "$enableval" = "no"
+then
+	BSDLIB_CMT=#
+	MAKEFILE_BSDLIB=/dev/null
+	AC_MSG_RESULT([Disabling BSD shared libraries])
+else
+	E2_PKG_CONFIG_STATIC=
+	BSDLIB_CMT=
+	MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
+	LIB_EXT=.so
+	[case "$host_os" in
+	darwin*)
+		MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
+		LIB_EXT=.dylib
+	;;
+	esac]
+	AC_MSG_RESULT([Enabling BSD shared libraries])
+fi
+,
+MAKEFILE_BSDLIB=/dev/null
+BSDLIB_CMT=#
+AC_MSG_RESULT([Disabling BSD shared libraries by default])
+)
+AC_SUBST(BSDLIB_CMT)
+AC_SUBST_FILE(MAKEFILE_BSDLIB)
+dnl
+dnl handle --enable-profile
+dnl
+AC_ARG_ENABLE([profile],
+AS_HELP_STRING([--enable-profile],[build profiling libraries]),
+if test "$enableval" = "no"
+then
+	PROFILE_CMT=#
+	MAKEFILE_PROFILE=/dev/null
+	AC_MSG_RESULT([Disabling profiling libraries])
+else
+	PROFILE_CMT=
+	MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
+	PROFILED_LIB_EXT=_p.a
+	AC_MSG_RESULT([Building profiling libraries])
+fi
+,
+PROFILE_CMT=#
+MAKEFILE_PROFILE=/dev/null
+AC_MSG_RESULT([Disabling profiling libraries by default])
+)
+AC_SUBST(PROFILE_CMT)
+AC_SUBST_FILE(MAKEFILE_PROFILE)
+dnl
+dnl handle --enable-gcov
+dnl
+AC_ARG_ENABLE([gcov],
+AS_HELP_STRING([--enable-gcov],[build for coverage testing using gcov]),
+if test "$enableval" = "yes"
+then
+	CFLAGS="-g -fprofile-arcs -ftest-coverage"
+	LDFLAGS="-fprofile-arcs -ftest-coverage"
+	AC_MSG_RESULT([Enabling gcov support])
+fi
+)
+dnl
+dnl handle --enable-hardening
+dnl
+CFLAGS_SHLIB="${CFLAGS_SHLIB:-$CFLAGS}"
+CFLAGS_STLIB="${CFLAGS_STLIB:-$CFLAGS}"
+LDFLAGS_SHLIB=${LDFLAGS_SHLIB:-$LDFLAGS}
+LDFLAGS_STATIC=${LDFLAGS_STATIC:-$LDFLAGS}
+AC_ARG_ENABLE([hardening],
+AS_HELP_STRING([--enable-hardening],[build for coverage testing using gcov]),
+if test "$enableval" = "yes"
+then
+	HARDEN_CFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-strong"
+	HARDEN_LDFLAGS=["-Wl,-z,relro -Wl,-z,now"]
+	CFLAGS="$CFLAGS $HARDEN_CFLAGS -fPIE"
+	CFLAGS_SHLIB="$CFLAGS_SHLIB $HARDEN_CFLAGS"
+	CFLAGS_STLIB="$CFLAGS_STLIB $HARDEN_CFLAGS -fPIE"
+	LDFLAGS="$LDFLAGS $HARDEN_LDFLAGS -fPIE -pie"
+	LDFLAGS_STATIC="$LDFLAGS_STATIC $HARDEN_LDFLAGS"
+	LDFLAGS_SHLIB="$LDFLAGS_SHLIB $HARDEN_LDFLAGS"
+	AC_MSG_RESULT([Enabling hardening support])
+fi
+)
+dnl
+dnl Substitute library extensions
+dnl
+AC_SUBST(LIB_EXT)
+AC_SUBST(STATIC_LIB_EXT)
+AC_SUBST(PROFILED_LIB_EXT)
+AC_SUBST(LDFLAG_DYNAMIC)
+AC_SUBST(PRIVATE_LIBS_CMT)
+dnl
+dnl handle --enable-jbd-debug
+dnl
+AC_ARG_ENABLE([jbd-debug],
+AS_HELP_STRING([--enable-jbd-debug],[enable journal debugging]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling journal debugging])
+else
+	AC_DEFINE(CONFIG_JBD_DEBUG, 1,
+		[Define to 1 if debugging ext3/4 journal code])
+	AC_MSG_RESULT([Enabling journal debugging])
+fi
+,
+AC_MSG_RESULT([Disabling journal debugging by default])
+)
+dnl
+dnl handle --enable-blkid-debug
+dnl
+AC_ARG_ENABLE([blkid-debug],
+AS_HELP_STRING([--enable-blkid-debug],[enable blkid debugging]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling blkid debugging])
+else
+	AC_DEFINE(CONFIG_BLKID_DEBUG, 1,
+		[Define to 1 if debugging the blkid library])
+	AC_MSG_RESULT([Enabling blkid debugging])
+fi
+,
+AC_MSG_RESULT([Disabling blkid debugging by default])
+)
+dnl
+dnl handle --enable-testio-debug
+dnl
+AC_ARG_ENABLE([testio-debug],
+AS_HELP_STRING([--disable-testio-debug],[disable the use of the test I/O manager for debugging]),
+AH_TEMPLATE([CONFIG_TESTIO_DEBUG],
+	[Define to 1 if the testio I/O manager should be enabled])
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling testio debugging])
+	TEST_IO_CMT="#"
+else
+	TEST_IO_CMT=
+	AC_DEFINE(CONFIG_TESTIO_DEBUG, 1)
+	AC_MSG_RESULT([Enabling testio debugging])
+fi
+,
+AC_MSG_RESULT([Enabling testio debugging by default])
+AC_DEFINE(CONFIG_TESTIO_DEBUG, 1)
+TEST_IO_CMT=
+)
+AC_SUBST(TEST_IO_CMT)
+dnl
+dnl handle --enable-developer-features
+dnl
+AC_ARG_ENABLE([developer-features],
+AS_HELP_STRING([--enable-developer-features],[enable features for use by ext4 developers]),
+AH_TEMPLATE([CONFIG_DEVELOPER_FEATURES],
+	[Define to 1 for features for use by ext4 developers])
+if test "$enableval" = "yes"
+then
+	DEV_FEATURES_CMT=
+	AC_DEFINE(CONFIG_DEVELOPER_FEATURES, 1)
+	AC_MSG_RESULT([Enabling ext4 developer features])
+else
+	AC_MSG_RESULT([Disabling ext4 developer features])
+	DEV_FEATURES_CMT="#"
+fi
+,
+AC_MSG_RESULT([Disabling ext4 developer features by default])
+DEV_FEATURES_CMT=
+)
+AC_SUBST(DEV_FEATURES_CMT)
+dnl
+dnl handle --disable-libuuid
+dnl
+PKG_PROG_PKG_CONFIG
+LIBUUID=
+DEPLIBUUID=
+STATIC_LIBUUID=
+DEPSTATIC_LIBUUID=
+PROFILED_LIBUUID=
+DEPPROFILED_LIBUUID=
+UUID_CMT=
+AC_ARG_ENABLE([libuuid],
+AS_HELP_STRING([--enable-libuuid],[build and use private uuid library]),
+if test "$enableval" = "no"
+then
+	if test -z "$PKG_CONFIG"; then
+		AC_MSG_ERROR([pkg-config not installed; please install it.])
+	fi
+
+	AC_CHECK_LIB(uuid, uuid_generate,
+		[LIBUUID=`$PKG_CONFIG --libs uuid`;
+		 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`],
+		[AC_MSG_ERROR([external uuid library not found])])
+	PROFILED_LIBUUID=$LIBUUID
+	UUID_CMT=#
+	AC_MSG_RESULT([Disabling private uuid library])
+else
+	LIBUUID='$(LIB)/libuuid'$LIB_EXT
+	DEPLIBUUID=$LIBUUID
+	STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
+	DEPSTATIC_LIBUUID=$STATIC_LIBUUID
+	PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
+	DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
+	AC_MSG_RESULT([Enabling private uuid library])
+fi
+,
+if test -n "$PKG_CONFIG"; then
+	AC_CHECK_LIB(uuid, uuid_generate,
+		[LIBUUID=`$PKG_CONFIG --libs uuid`;
+		 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`])
+fi
+if test -n "$LIBUUID"; then
+	PROFILED_LIBUUID=$LIBUUID
+	UUID_CMT=#
+	AC_MSG_RESULT([Using system uuid by default])
+else
+	LIBUUID='$(LIB)/libuuid'$LIB_EXT
+	DEPLIBUUID=$LIBUUID
+	STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
+	DEPSTATIC_LIBUUID=$STATIC_LIBUUID
+	PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
+	DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
+	AC_MSG_RESULT([Enabling private uuid library by default])
+fi
+)
+AC_SUBST(LIBUUID)
+AC_SUBST(DEPLIBUUID)
+AC_SUBST(STATIC_LIBUUID)
+AC_SUBST(DEPSTATIC_LIBUUID)
+AC_SUBST(PROFILED_LIBUUID)
+AC_SUBST(DEPPROFILED_LIBUUID)
+AC_SUBST(UUID_CMT)
+dnl
+dnl handle --disable-libblkid
+dnl
+PKG_PROG_PKG_CONFIG
+LIBBLKID=
+DEPLIBBLKID=
+STATIC_LIBBLKID=
+DEPSTATIC_LIBBLKID=
+PROFILED_LIBBLKID=
+DEPPROFILED_LIBBLKID=
+BLKID_CMT=
+AH_TEMPLATE([CONFIG_BUILD_FINDFS], [Define to 1 to compile findfs])
+AC_ARG_ENABLE([libblkid],
+AS_HELP_STRING([--enable-libblkid],[build and use private blkid library]),
+if test "$enableval" = "no"
+then
+	if test -z "$PKG_CONFIG"; then
+		AC_MSG_ERROR([pkg-config not installed; please install it.])
+	fi
+
+	AC_CHECK_LIB(blkid, blkid_get_cache,
+		[LIBBLKID=`$PKG_CONFIG --libs blkid`;
+		 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`],
+		[AC_MSG_ERROR([external blkid library not found])], -luuid)
+	BLKID_CMT=#
+	PROFILED_LIBBLKID=$LIBBLKID
+	AC_MSG_RESULT([Disabling private blkid library])
+else
+	LIBBLKID='$(LIB)/libblkid'$LIB_EXT
+	DEPLIBBLKID=$LIBBLKID
+	STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
+	DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
+	PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
+	DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
+	AC_DEFINE(CONFIG_BUILD_FINDFS, 1)
+	AC_MSG_RESULT([Enabling private blkid library])
+fi
+,
+if test -n "$PKG_CONFIG"; then
+	AC_CHECK_LIB(blkid, blkid_get_cache,
+		[LIBBLKID=`$PKG_CONFIG --libs blkid`;
+		 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`])
+fi
+if test -n "$LIBBLKID"; then
+	BLKID_CMT=#
+	PROFILED_LIBBLKID=$LIBBLKID
+	AC_MSG_RESULT([Using system blkid library by default])
+else
+	LIBBLKID='$(LIB)/libblkid'$LIB_EXT
+	DEPLIBBLKID=$LIBBLKID
+	STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
+	DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
+	PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
+	DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
+	AC_DEFINE(CONFIG_BUILD_FINDFS, 1)
+	AC_MSG_RESULT([Enabling private blkid library by default])
+fi
+)
+AC_SUBST(LIBBLKID)
+AC_SUBST(DEPLIBBLKID)
+AC_SUBST(STATIC_LIBBLKID)
+AC_SUBST(DEPSTATIC_LIBBLKID)
+AC_SUBST(PROFILED_LIBBLKID)
+AC_SUBST(DEPPROFILED_LIBBLKID)
+AC_SUBST(BLKID_CMT)
+dnl
+dnl handle --enable-subset
+dnl
+ALL_CMT=
+SUBSET_CMT=
+AC_ARG_ENABLE([subset],
+AS_HELP_STRING([--enable-subset],[enable subset-only build]),
+if test "$enableval" = "no"
+then
+	SUBSET_CMT=#
+	AC_MSG_RESULT([Disabling subset-only build])
+else
+	ALL_CMT=#
+	AC_MSG_RESULT([Enabling subset-only-build])
+fi
+,)
+AC_SUBST(ALL_CMT)
+AC_SUBST(SUBSET_CMT)
+dnl
+dnl handle --disable-backtrace
+dnl
+AH_TEMPLATE([DISABLE_BACKTRACE], [Define to 1 to disable use of backtrace])
+AC_ARG_ENABLE([backtrace],
+AS_HELP_STRING([--disable-backtrace],[disable use backtrace]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling use of backtrace])
+	AC_DEFINE(DISABLE_BACKTRACE, 1)
+else
+	AC_MSG_RESULT([Enabling use of backtrace])
+fi
+,
+AC_MSG_RESULT([Enabling use of backtrace by default])
+)
+dnl
+dnl handle --enable-debugfs
+dnl
+AC_ARG_ENABLE([debugfs],
+AS_HELP_STRING([--disable-debugfs],[disable support of debugfs program]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling debugfs support])
+	DEBUGFS_CMT="#"
+else
+	DEBUGFS_CMT=
+	AC_MSG_RESULT([Enabling debugfs support])
+fi
+,
+AC_MSG_RESULT([Enabling debugfs support by default])
+DEBUGFS_CMT=
+)
+AC_SUBST(DEBUGFS_CMT)
+dnl
+dnl handle --enable-imager
+dnl
+AC_ARG_ENABLE([imager],
+AS_HELP_STRING([--disable-imager],[disable support of e2image program]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling e2image support])
+	IMAGER_CMT="#"
+else
+	IMAGER_CMT=
+	AC_MSG_RESULT([Enabling e2image support])
+fi
+,
+AC_MSG_RESULT([Enabling e2image support by default])
+IMAGER_CMT=
+)
+AC_SUBST(IMAGER_CMT)
+dnl
+dnl handle --enable-resizer
+dnl
+AC_ARG_ENABLE([resizer],
+AS_HELP_STRING([--disable-resizer],[disable support of e2resize program]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling e2resize support])
+	RESIZER_CMT="#"
+else
+	RESIZER_CMT=
+	AC_MSG_RESULT([Enabling e2resize support])
+fi
+,
+AC_MSG_RESULT([Enabling e2resize support by default])
+RESIZER_CMT=
+)
+AC_SUBST(RESIZER_CMT)
+dnl
+dnl handle --enable-defrag
+dnl
+AC_ARG_ENABLE([defrag],
+AS_HELP_STRING([--disable-defrag],[disable support of e4defrag program]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling e4defrag support])
+	DEFRAG_CMT="#"
+else
+	DEFRAG_CMT=
+	AC_MSG_RESULT([Enabling e4defrag support])
+fi
+,
+if test -z "$WITH_DIET_LIBC"
+then
+	AC_MSG_RESULT([Enabling e4defrag support by default])
+	DEFRAG_CMT=
+else
+	AC_MSG_RESULT([Disabling e4defrag support by default])
+	DEFRAG_CMT="#"
+fi
+)
+AC_SUBST(DEFRAG_CMT)
+dnl
+dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
+dnl
+AC_ARG_ENABLE([fsck],
+AS_HELP_STRING([--enable-fsck],[build fsck wrapper program]),
+[if test "$enableval" = "no"
+then
+	FSCK_PROG='' FSCK_MAN=''
+	AC_MSG_RESULT([Not building fsck wrapper])
+else
+	FSCK_PROG=fsck FSCK_MAN=fsck.8
+	AC_MSG_RESULT([Building fsck wrapper])
+fi]
+,
+[case "$host_os" in
+  gnu*)
+    FSCK_PROG='' FSCK_MAN=''
+    AC_MSG_RESULT([Not building fsck wrapper by default])
+    ;;
+  *)
+    FSCK_PROG=fsck FSCK_MAN=fsck.8
+    AC_MSG_RESULT([Building fsck wrapper by default])
+esac]
+)
+AC_SUBST(FSCK_PROG)
+AC_SUBST(FSCK_MAN)
+dnl
+dnl See whether to install the `e2initrd-helper' program
+dnl
+AC_ARG_ENABLE([e2initrd-helper],
+AS_HELP_STRING([--enable-e2initrd-helper],[build e2initrd-helper program]),
+[if test "$enableval" = "no"
+then
+	E2INITRD_PROG='' E2INITRD_MAN=''
+	AC_MSG_RESULT([Not building e2initrd helper])
+else
+	E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
+	AC_MSG_RESULT([Building e2initrd helper])
+fi]
+,
+E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
+AC_MSG_RESULT([Building e2initrd helper by default])
+)
+AC_SUBST(E2INITRD_PROG)
+AC_SUBST(E2INITRD_MAN)
+dnl
+dnl
+dnl
+AC_ARG_ENABLE([tls],
+AS_HELP_STRING([--disable-tls],[disable use of thread local support]),
+[if test "$enableval" = "no"
+then
+	try_tls=""
+	AC_MSG_RESULT([Disabling thread local support])
+else
+	try_tls="yes"
+	AC_MSG_RESULT([Enabling thread local support])
+fi]
+,
+if test -n "$WITH_DIET_LIBC"
+then
+	try_tls=""
+	AC_MSG_RESULT([Diet libc does not support thread local support])
+else
+	try_tls="yes"
+	AC_MSG_RESULT([Try using thread local support by default])
+fi
+)
+if test "$try_tls" = "yes"
+then
+AX_TLS
+fi
+dnl
+dnl
+dnl
+AC_ARG_WITH([pthread],
+AS_HELP_STRING([--without-pthread],[disable use of pthread support]),
+[if test "$withval" = "no"
+then
+	try_pthread=""
+	AC_MSG_RESULT([Disabling pthread support])
+else
+	try_pthread="yes"
+	AC_MSG_RESULT([Testing for pthread support])
+fi]
+,
+try_pthread="yes"
+AC_MSG_RESULT([Try testing for pthread support by default])
+)
+if test "$try_pthread" = "yes"
+then
+AX_PTHREAD
+else
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+AC_SUBST([PTHREAD_CC])
+fi
+dnl
+dnl
+dnl
+AH_TEMPLATE([USE_UUIDD], [Define to 1 to build uuidd])
+AC_ARG_ENABLE([uuidd],
+AS_HELP_STRING([--disable-uuidd],[disable building the uuid daemon]),
+[if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Not building uuidd])
+	UUIDD_CMT="#"
+else
+	AC_DEFINE(USE_UUIDD, 1)
+	UUIDD_CMT=""
+	AC_MSG_RESULT([Building uuidd])
+fi]
+,
+AC_DEFINE(USE_UUIDD, 1)
+if test -z "$UUID_CMT"
+then
+	UUIDD_CMT=""
+	AC_MSG_RESULT([Building uuidd by default])
+else
+	UUIDD_CMT="#"
+	AC_MSG_RESULT([Disabling uuidd by default])
+fi
+)
+AC_SUBST(UUIDD_CMT)
+dnl
+dnl handle --disable-mmp
+dnl
+AH_TEMPLATE([CONFIG_MMP], [Define to 1 to enable mmp support])
+AC_ARG_ENABLE([mmp],
+AS_HELP_STRING([--disable-mmp],[disable support mmp, Multi Mount Protection]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling mmp support])
+else
+	AC_MSG_RESULT([Enabling mmp support])
+	AC_DEFINE(CONFIG_MMP, 1)
+fi
+,
+AC_MSG_RESULT([Enabling mmp support by default])
+AC_DEFINE(CONFIG_MMP, 1)
+)
+dnl
+dnl handle --disable-tdb
+dnl
+AH_TEMPLATE([CONFIG_TDB], [Define to 1 to enable tdb support])
+AC_ARG_ENABLE([tdb],
+AS_HELP_STRING([--disable-tdb],[disable tdb support]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling tdb support])
+	TDB_CMT="#"
+	TDB_MAN_COMMENT='.\"'
+else
+	AC_MSG_RESULT([Enabling tdb support])
+	AC_DEFINE(CONFIG_TDB, 1)
+	TDB_CMT=""
+	TDB_MAN_COMMENT=""
+fi
+,
+AC_MSG_RESULT([Enabling mmp support by default])
+AC_DEFINE(CONFIG_TDB, 1)
+TDB_CMT=""
+TDB_MAN_COMMENT=""
+)
+AC_SUBST(TDB_CMT)
+AC_SUBST(TDB_MAN_COMMENT)
+dnl
+dnl handle --disable-bmap-stats
+dnl
+AH_TEMPLATE([ENABLE_BMAP_STATS], [Define to 1 to enable bitmap stats.])
+AC_ARG_ENABLE([bmap-stats],
+AS_HELP_STRING([--disable-bmap-stats],[disable collection of bitmap stats]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling bitmap statistics support])
+else
+	AC_MSG_RESULT([Enabling bitmap statistics support])
+	AC_DEFINE(ENABLE_BMAP_STATS, 1)
+fi
+,
+AC_MSG_RESULT([Enabling bitmap statistics support by default])
+AC_DEFINE(ENABLE_BMAP_STATS, 1)
+)
+dnl
+dnl handle --enable-bmap-stats-ops
+dnl
+AH_TEMPLATE([ENABLE_BMAP_STATS_OPS], [Define to 1 to enable bitmap stats.])
+AC_ARG_ENABLE([bmap-stats-ops],
+AS_HELP_STRING([--enable-bmap-stats-ops],[enable collection of additional bitmap stats]),
+if test "$enableval" = "no"
+then
+	AC_MSG_RESULT([Disabling additional bitmap statistics])
+else
+	dnl There has to be a better way!
+	AS_IF([test "x${enable_bmap_stats}" = "xno"],
+	 AC_MSG_FAILURE([Error --enable-bmap-stats-ops requires bmap-stats]))
+
+	AC_MSG_RESULT([Enabling additional bitmap statistics])
+	AC_DEFINE(ENABLE_BMAP_STATS_OPS, 1)
+fi
+,
+AC_MSG_RESULT([Disabling additional bitmap statistics by default])
+)
+dnl
+dnl
+dnl
+MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
+AC_SUBST_FILE(MAKEFILE_LIBRARY)
+dnl
+dnl Add internationalization support, using gettext.
+dnl
+GETTEXT_PACKAGE=e2fsprogs
+PACKAGE=e2fsprogs
+VERSION="$E2FSPROGS_VERSION"
+VERSION=0.14.1
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [package name for gettext])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [version for gettext])
+AC_SUBST(GETTEXT_PACKAGE)
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+
+AM_GNU_GETTEXT([external])
+dnl
+dnl End of configuration options
+dnl
+AC_SUBST(BINARY_TYPE)
+AC_PROG_MAKE_SET
+CHECK_GNU_MAKE
+AC_PATH_PROG(LN, ln, ln)
+AC_PROG_MKDIR_P
+dnl
+dnl @mkdir_p@ is used by po's Makefile.in
+dnl
+mkdir_p=$MKDIR_P
+AC_SUBST(mkdir_p)
+AC_PROG_LN_S
+AC_PATH_PROG(MV, mv, mv)
+AC_PATH_PROG(CP, cp, cp)
+AC_PATH_PROG(RM, rm, rm)
+AC_PATH_PROG(CHMOD, chmod, :)
+AC_PROG_AWK
+AC_PROG_EGREP
+AC_PATH_PROG(SED, sed, sed)
+AC_PATH_PROG(PERL, perl, perl)
+AC_PATH_PROG(LDCONFIG, ldconfig, :)
+AC_CHECK_TOOL(AR, ar, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
+if test "_$MAKEINFO" = "_"; then
+    MAKEINFO="echo Makeinfo is missing. Info documentation will not be built."
+else
+    case "$MAKEINFO" in
+      */missing.*)
+        AC_MSG_WARN([
+*** Makeinfo is missing. Info documentation will not be built.])
+        ;;
+      *)
+        ;;
+    esac
+fi
+AC_SUBST(MAKEINFO)
+AC_PROG_INSTALL
+# See if we need a separate native compiler.
+if test $cross_compiling = no; then
+  BUILD_CC="$CC"
+  AC_SUBST(BUILD_CC)
+else
+  AC_CHECK_PROGS(BUILD_CC, gcc cc)
+fi
+AC_CHECK_HEADERS(m4_flatten([
+	dirent.h
+	errno.h
+	execinfo.h
+	getopt.h
+	malloc.h
+	mntent.h
+	paths.h
+	pthread.h
+	semaphore.h
+	setjmp.h
+	signal.h
+	stdarg.h
+	stdint.h
+	stdlib.h
+	termios.h
+	termio.h
+	unistd.h
+	utime.h
+	attr/xattr.h
+	linux/falloc.h
+	linux/fd.h
+	linux/fsmap.h
+	linux/major.h
+	linux/loop.h
+	linux/types.h
+	net/if_dl.h
+	netinet/in.h
+	sys/acl.h
+	sys/disklabel.h
+	sys/disk.h
+	sys/file.h
+	sys/ioctl.h
+	sys/key.h
+	sys/mkdev.h
+	sys/mman.h
+	sys/mount.h
+	sys/prctl.h
+	sys/resource.h
+	sys/select.h
+	sys/socket.h
+	sys/sockio.h
+	sys/stat.h
+	sys/syscall.h
+	sys/sysmacros.h
+	sys/time.h
+	sys/types.h
+	sys/un.h
+	sys/wait.h
+	sys/xattr.h
+]))
+dnl Check where to find a dd(1) that supports iflag=fullblock
+dnl and oflag=append
+AC_MSG_CHECKING([for a dd(1) program that supports iflag=fullblock])
+DD=
+for i in dd gdd ; do
+	if "$i" if=/dev/null of=/dev/null count=1 bs=10k 2>/dev/null iflag=fullblock oflag=append ; then
+		DD=$i
+		break
+	fi
+done
+if test -n "$DD" ; then
+	AC_MSG_RESULT([$DD])
+else
+	AC_MSG_RESULT([not found, using dd])
+	DD=dd
+	AC_MSG_WARN([No GNU-compatible dd(1) program found, expect some self-test failures.])
+fi
+AC_SUBST([DD])
+
+AC_CHECK_HEADERS(net/if.h,,,
+[[
+#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_SOCKET
+#include <sys/socket.h>
+#endif
+]])
+AC_FUNC_VPRINTF
+dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
+dnl is not declared.
+AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT, 1,
+		       [Define to 1 if dirent has d_reclen])],,
+		[#include <dirent.h>])
+AC_CHECK_MEMBERS([struct stat.st_atim])
+dnl Check to see if ssize_t was declared
+AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T, 1,
+		[Define to 1 if ssize_t declared])],,
+	      [#include <sys/types.h>])
+dnl
+dnl Check to see if llseek() is declared in unistd.h.  On some libc's 
+dnl it is, and on others it isn't..... Thank you glibc developers....
+dnl
+AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE, 1,
+			[Define to 1 if llseek declared in unistd.h])],,
+	      [#include <unistd.h>])
+dnl
+dnl Check to see if lseek64() is declared in unistd.h.  Glibc's header files
+dnl are so convoluted that I can't tell whether it will always be defined,
+dnl and if it isn't defined while lseek64 is defined in the library, 
+dnl disaster will strike.  
+dnl
+dnl Warning!  Use of --enable-gcc-wall may throw off this test.
+dnl
+dnl
+AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1,
+			[Define to 1 if lseek64 declared in unistd.h])],,
+		[#define _LARGEFILE_SOURCE
+		 #define _LARGEFILE64_SOURCE
+		 #include <unistd.h>])
+dnl
+dnl Word sizes...
+dnl
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(time_t)
+SIZEOF_SHORT=$ac_cv_sizeof_short
+SIZEOF_INT=$ac_cv_sizeof_int
+SIZEOF_LONG=$ac_cv_sizeof_long
+SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
+SIZEOF_OFF_T=$ac_cv_sizeof_off_t
+SIZEOF_TIME_T=$ac_cv_sizeof_time_t
+AC_SUBST(SIZEOF_SHORT)
+AC_SUBST(SIZEOF_INT)
+AC_SUBST(SIZEOF_LONG)
+AC_SUBST(SIZEOF_LONG_LONG)
+AC_SUBST(SIZEOF_OFF_T)
+AC_SUBST(SIZEOF_TIME_T)
+AC_C_BIGENDIAN
+if test $cross_compiling = no; then
+  BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+else
+  CROSS_COMPILE="1" BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
+fi
+ASM_TYPES_HEADER=./asm_types.h
+AC_SUBST_FILE(ASM_TYPES_HEADER)
+dnl
+dnl Save the configuration #defines needed for the public ext2fs.h
+dnl header file
+dnl
+echo "/* These defines are needed for the public ext2fs.h header file */" \
+     > public_config.h
+if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then
+  uniq tmp_config.$$ >> public_config.h
+else
+  echo "#undef HAVE_SYS_TYPES_H" >> public_config.h
+fi
+if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then
+  uniq tmp_config.$$ >> public_config.h
+else
+  echo "#undef WORDS_BIGENDIAN" >> public_config.h
+fi
+rm -f tmp_config.$$
+PUBLIC_CONFIG_HEADER=./public_config.h
+AC_SUBST_FILE(PUBLIC_CONFIG_HEADER)
+dnl
+dnl See if we have inttypes.h and if intptr_t is defined
+dnl
+AC_CHECK_HEADERS([inttypes.h])
+AC_CHECK_TYPES(intptr_t)
+dnl
+dnl See if struct stat has a st_flags field, in which case we can get file
+dnl flags somewhat portably.  Also check for the analogous setter, chflags().
+dnl
+AC_MSG_CHECKING(whether struct stat has a st_flags field)
+AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
+	AC_TRY_COMPILE([#include <sys/stat.h>],
+		[struct stat stat; stat.st_flags = 0;],
+		[e2fsprogs_cv_struct_st_flags=yes],
+		[e2fsprogs_cv_struct_st_flags=no]))
+AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
+if test "$e2fsprogs_cv_struct_st_flags" = yes; then
+  AC_MSG_CHECKING(whether st_flags field is useful)
+  AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
+	AC_TRY_COMPILE([#include <sys/stat.h>],
+		[struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
+		[e2fsprogs_cv_struct_st_flags_immut=yes],
+		[e2fsprogs_cv_struct_st_flags_immut=no]))
+  AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
+  if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
+	  AC_DEFINE(HAVE_STAT_FLAGS, 1,
+		[Define to 1 if struct stat has st_flags])
+  fi
+fi
+dnl
+dnl Check for the presence of SA_LEN
+dnl
+AC_CHECK_MEMBER(struct sockaddr.sa_len,
+		AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,
+			[Define to 1 if if struct sockaddr contains sa_len]),,
+	[#include <sys/types.h>
+	 #include <sys/socket.h>])
+dnl
+dnl If we are using the system-provided blkid library, check for
+dnl the functions added after migrating that library to util-linux
+dnl
+if test -n "$BLKID_CMT"; then
+  AC_CHECK_LIB(blkid, blkid_probe_get_topology,
+		      AC_DEFINE(HAVE_BLKID_PROBE_GET_TOPOLOGY, 1,
+				[Define to 1 if blkid has blkid_probe_get_topology]))
+  AC_CHECK_LIB(blkid, blkid_topology_get_dax,
+		      AC_DEFINE(HAVE_BLKID_TOPOLOGY_GET_DAX, 1,
+				[Define to 1 if blkid has blkid_topology_get_dax]))
+  AC_CHECK_LIB(blkid, blkid_probe_enable_partitions,
+		      AC_DEFINE(HAVE_BLKID_PROBE_ENABLE_PARTITIONS, 1,
+				[Define to 1 if blkid has blkid_probe_enable_partitions]))
+fi
+dnl
+if test -n "$DLOPEN_LIB" ; then
+   ac_cv_func_dlopen=yes
+fi
+AC_CHECK_FUNCS(m4_flatten([
+	__secure_getenv
+	add_key
+	backtrace
+	chflags
+	dlopen
+	fadvise64
+	fallocate
+	fallocate64
+	fchown
+	fcntl
+	fdatasync
+	fstat64
+	fsync
+	ftruncate64
+	futimes
+	getcwd
+	getdtablesize
+	gethostname
+	getmntinfo
+	getpwuid_r
+	getrlimit
+	getrusage
+	jrand48
+	keyctl
+	llistxattr
+	llseek
+	lseek64
+	mallinfo
+	mbstowcs
+	memalign
+	mempcpy
+	mmap
+	msync
+	nanosleep
+	open64
+	pathconf
+	posix_fadvise
+	posix_fadvise64
+	posix_memalign
+	prctl
+	pread
+	pwrite
+	pread64
+	pwrite64
+	secure_getenv
+	setmntent
+	setresgid
+	setresuid
+	snprintf
+	srandom
+	stpcpy
+	strcasecmp
+	strdup
+	strnlen
+	strptime
+	strtoull
+	sync_file_range
+	sysconf
+	usleep
+	utime
+	utimes
+	valloc
+]))
+dnl
+dnl Check to see if -lsocket is required (solaris) to make something
+dnl that uses socket() to compile; this is needed for the UUID library
+dnl
+SOCKET_LIB=''
+AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
+AC_SUBST(SOCKET_LIB)
+dnl
+dnl See if libmagic exists
+dnl
+AC_CHECK_LIB(magic, magic_file, [MAGIC_LIB=-lmagic
+AC_CHECK_HEADERS([magic.h])])
+if test "$ac_cv_func_dlopen" = yes ; then
+   MAGIC_LIB=$DLOPEN_LIB
+fi
+AC_SUBST(MAGIC_LIB)
+dnl
+dnl Check to see if librt is required for clock_gettime() (glibc < 2.17)
+dnl
+AC_CHECK_LIB(rt, clock_gettime, [CLOCK_GETTIME_LIB=-lrt])
+AC_SUBST(CLOCK_GETTIME_LIB)
+dnl
+dnl Check to see if the FUSE library is -lfuse or -losxfuse
+dnl
+FUSE_CMT=
+FUSE_LIB=
+dnl osxfuse.dylib supersedes fuselib.dylib
+AC_ARG_ENABLE([fuse2fs],
+AS_HELP_STRING([--disable-fuse2fs],[do not build fuse2fs]),
+if test "$enableval" = "no"
+then
+	FUSE_CMT="#"
+	AC_MSG_RESULT([Disabling fuse2fs])
+else
+	AC_CHECK_HEADERS([pthread.h fuse.h], [],
+[AC_MSG_FAILURE([Cannot find fuse2fs headers.])],
+[#define _FILE_OFFSET_BITS	64
+#define FUSE_USE_VERSION 29])
+
+	AC_PREPROC_IFELSE(
+[AC_LANG_PROGRAM([[#define FUSE_USE_VERSION 29
+#ifdef __linux__
+#include <linux/fs.h>
+#include <linux/falloc.h>
+#include <linux/xattr.h>
+#endif
+]], [])], [], [AC_MSG_FAILURE([Cannot find fuse2fs Linux headers.])])
+
+	AC_CHECK_LIB(osxfuse, fuse_main, [FUSE_LIB=-losxfuse],
+		[AC_CHECK_LIB(fuse, fuse_main, [FUSE_LIB=-lfuse],
+			      [AC_MSG_FAILURE([Cannot find fuse library.])])])
+	AC_MSG_RESULT([Enabling fuse2fs])
+fi
+,
+AC_CHECK_HEADERS([pthread.h fuse.h], [], [FUSE_CMT="#"],
+[#define _FILE_OFFSET_BITS	64
+#define FUSE_USE_VERSION 29
+#ifdef __linux__
+# include <linux/fs.h>
+# include <linux/falloc.h>
+# include <linux/xattr.h>
+#endif])
+if test -z "$FUSE_CMT"
+then
+	AC_CHECK_LIB(osxfuse, fuse_main, [FUSE_LIB=-losxfuse],
+[AC_CHECK_LIB(fuse, fuse_main, [FUSE_LIB=-lfuse], [FUSE_CMT="#"])])
+fi
+if test -z "$FUSE_CMT"
+then
+	AC_MSG_RESULT([Enabling fuse2fs by default.])
+fi
+)
+AC_SUBST(FUSE_LIB)
+AC_SUBST(FUSE_CMT)
+dnl
+dnl See if optreset exists
+dnl
+AC_MSG_CHECKING(for optreset)
+AC_CACHE_VAL(ac_cv_have_optreset,
+[AC_EGREP_HEADER(optreset, unistd.h,
+  ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
+AC_MSG_RESULT($ac_cv_have_optreset)
+if test $ac_cv_have_optreset = yes; then
+  AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if optreset for getopt is present])
+fi
+dnl
+dnl Test for sem_init, and which library it might require:
+dnl
+AH_TEMPLATE([HAVE_SEM_INIT], [Define to 1 if sem_init() exists])
+SEM_INIT_LIB=''
+echo GL_THREADS_API: ${gl_threads_api}
+if test "${gl_threads_api}" != none
+then
+  AC_CHECK_FUNC(sem_init, ,
+    AC_CHECK_LIB(pthread, sem_init,
+  	AC_DEFINE(HAVE_SEM_INIT, 1)
+  	SEM_INIT_LIB=-lpthread,
+    AC_CHECK_LIB(rt, sem_init,
+  	AC_DEFINE(HAVE_SEM_INIT, 1)
+  	SEM_INIT_LIB=-lrt,
+    AC_CHECK_LIB(posix4, sem_init,
+  	AC_DEFINE(HAVE_SEM_INIT, 1)
+  	SEM_INIT_LIB=-lposix4))))dnl
+fi
+AC_SUBST(SEM_INIT_LIB)
+dnl
+dnl Check for unified diff
+dnl
+AC_MSG_CHECKING(for unified diff option)
+if diff -u $0 $0 > /dev/null 2>&1 ; then
+   UNI_DIFF_OPTS=-u
+else
+   UNI_DIFF_OPTS=-c
+fi
+AC_MSG_RESULT($UNI_DIFF_OPTS)
+AC_SUBST(UNI_DIFF_OPTS)
+dnl
+dnl We use the EXT2 ioctls only under Linux
+dnl
+case "$host_os" in
+linux*)
+	AC_DEFINE(HAVE_EXT2_IOCTLS, 1, [Define to 1 if Ext2 ioctls present])
+	;;
+esac
+dnl
+dnl Check the available mount options
+dnl
+AX_CHECK_MOUNT_OPT(nosuid)
+AX_CHECK_MOUNT_OPT(nodev)
+dnl Enable LTO for all packages
+dnl
+AC_ARG_ENABLE([lto],
+AS_HELP_STRING([--enable-lto],[enable link time optimization]),,
+enable_lto=no)
+if test "$enable_lto" = "yes" || test "$enable_lto" = "probe"; then
+	AC_MSG_CHECKING([if C compiler supports LTO])
+	OLD_CFLAGS="$CFLAGS"
+	OLD_LDFLAGS="$LDFLAGS"
+	LTO_FLAGS="-g -flto -ffat-lto-objects"
+	CFLAGS="$CFLAGS $LTO_FLAGS"
+	LDFLAGS="$LDFLAGS $LTO_FLAGS"
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+		[AC_MSG_RESULT([yes])]
+		[lto_cflags=$LTO_FLAGS]
+		[lto_ldflags=$LTO_FLAGS]
+		[AC_PATH_PROG(gcc_ar, gcc-ar,,)]
+		[AC_PATH_PROG(gcc_ranlib, gcc-ranlib,,)],
+		[AC_MSG_RESULT([no])])
+	if test -x "$gcc_ar" && test -x "$gcc_ranlib"; then
+		have_lto=yes
+		AR="${gcc_ar}"
+		RANLIB="${gcc_ranlib}"
+	fi
+	CFLAGS="${OLD_CFLAGS}"
+	LDFLAGS="${OLD_LDFLAGS}"
+	AC_SUBST(have_lto)
+	AC_SUBST(lto_cflags)
+	AC_SUBST(lto_ldflags)
+fi
+if test "$enable_lto" = "yes" && test "$have_lto" != "yes"; then
+	AC_MSG_ERROR([LTO not supported by compiler.])
+fi
+dnl
+dnl Enable UBSAN for all packages
+dnl
+AC_ARG_ENABLE([ubsan],
+AS_HELP_STRING([--enable-ubsan],[enable undefined behavior sanitizer]),,
+enable_ubsan=no)
+if test "$enable_ubsan" = "yes" || test "$enable_ubsan" = "probe"; then
+	AC_MSG_CHECKING([if C compiler supports UBSAN])
+	OLD_CFLAGS="$CFLAGS"
+	OLD_LDFLAGS="$LDFLAGS"
+	UBSAN_FLAGS="-fsanitize=undefined"
+	CFLAGS="$CFLAGS $UBSAN_FLAGS"
+	LDFLAGS="$LDFLAGS $UBSAN_FLAGS"
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+		[AC_MSG_RESULT([yes])]
+		[ubsan_cflags=$UBSAN_FLAGS]
+		[ubsan_ldflags=$UBSAN_FLAGS]
+		[have_ubsan=yes],
+		[AC_MSG_RESULT([no])])
+	CFLAGS="${OLD_CFLAGS}"
+	LDFLAGS="${OLD_LDFLAGS}"
+	AC_SUBST(have_ubsan)
+	AC_SUBST(ubsan_cflags)
+	AC_SUBST(ubsan_ldflags)
+fi
+if test "$enable_ubsan" = "yes" && test "$have_ubsan" != "yes"; then
+	AC_MSG_ERROR([UBSAN not supported by compiler.])
+fi
+dnl
+dnl Enable ADDRSAN for all packages
+dnl
+AC_ARG_ENABLE([addrsan],
+AS_HELP_STRING([--enable-addrsan],[enable address sanitizer]),,
+enable_addrsan=no)
+if test "$enable_addrsan" = "yes" || test "$enable_addrsan" = "probe"; then
+	AC_MSG_CHECKING([if C compiler supports ADDRSAN])
+	OLD_CFLAGS="$CFLAGS"
+	OLD_LDFLAGS="$LDFLAGS"
+	ADDRSAN_FLAGS="-fsanitize=address"
+	CFLAGS="$CFLAGS $ADDRSAN_FLAGS"
+	LDFLAGS="$LDFLAGS $ADDRSAN_FLAGS"
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+		[AC_MSG_RESULT([yes])]
+		[addrsan_cflags=$ADDRSAN_FLAGS]
+		[addrsan_ldflags=$ADDRSAN_FLAGS]
+		[have_addrsan=yes],
+		[AC_MSG_RESULT([no])])
+	CFLAGS="${OLD_CFLAGS}"
+	LDFLAGS="${OLD_LDFLAGS}"
+	AC_SUBST(have_addrsan)
+	AC_SUBST(addrsan_cflags)
+	AC_SUBST(addrsan_ldflags)
+fi
+if test "$enable_addrsan" = "yes" && test "$have_addrsan" != "yes"; then
+	AC_MSG_ERROR([ADDRSAN not supported by compiler.])
+fi
+dnl
+dnl Enable THREADSAN for all packages
+dnl
+AC_ARG_ENABLE([threadsan],
+AS_HELP_STRING([--enable-threadsan],[enable thread sanitizer]),,
+enable_threadsan=no)
+if test "$enable_threadsan" = "yes" || test "$enable_threadsan" = "probe"; then
+	AC_MSG_CHECKING([if C compiler supports THREADSAN])
+	OLD_CFLAGS="$CFLAGS"
+	OLD_LDFLAGS="$LDFLAGS"
+	THREADSAN_FLAGS="-fsanitize=thread"
+	CFLAGS="$CFLAGS $THREADSAN_FLAGS"
+	LDFLAGS="$LDFLAGS $THREADSAN_FLAGS"
+	AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+		[AC_MSG_RESULT([yes])]
+		[threadsan_cflags=$THREADSAN_FLAGS]
+		[threadsan_ldflags=$THREADSAN_FLAGS]
+		[have_threadsan=yes],
+		[AC_MSG_RESULT([no])])
+	CFLAGS="${OLD_CFLAGS}"
+	LDFLAGS="${OLD_LDFLAGS}"
+	AC_SUBST(have_threadsan)
+	AC_SUBST(threadsan_cflags)
+	AC_SUBST(threadsan_ldflags)
+fi
+if test "$enable_threadsan" = "yes" && test "$have_threadsan" != "yes"; then
+	AC_MSG_ERROR([THREADSAN not supported by compiler.])
+fi
+if test "$have_threadsan" = "yes" && test "$have_addrsan" = "yes"; then
+	AC_MSG_WARN([ADDRSAN and THREADSAN are not known to work together.])
+fi
+dnl
+dnl OS-specific uncomment control
+dnl
+LINUX_CMT="#"
+CYGWIN_CMT="#"
+UNIX_CMT=
+case "$host_os" in
+linux*)
+	LINUX_CMT=
+	;;
+cygwin)
+	CYGWIN_CMT=
+	UNIX_CMT="#"
+	;;
+esac
+AC_SUBST(LINUX_CMT)
+AC_SUBST(CYGWIN_CMT)
+AC_SUBST(UNIX_CMT)
+dnl
+dnl e2scrub only builds on linux
+dnl
+E2SCRUB_CMT="$LINUX_CMT"
+AC_SUBST(E2SCRUB_CMT)
+dnl
+dnl Linux and Hurd places root files in the / by default
+dnl
+case "$host_os" in
+linux* | gnu* | k*bsd*-gnu)
+	if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
+		root_prefix="";
+		AC_MSG_RESULT([On $host_os systems, root_prefix defaults to ''])
+	fi
+	;;
+esac
+dnl
+dnl On Linux/hurd, force the prefix to be /usr
+dnl
+case "$host_os" in
+linux* | gnu* | k*bsd*-gnu)
+	if test "$prefix" = NONE ; then
+		prefix="/usr";
+		AC_MSG_RESULT([On $host_os systems, prefix defaults to /usr])
+		if test "$mandir" = '${prefix}/man' ; then
+			AC_MSG_RESULT([...and mandir defaults to /usr/share/man])
+			mandir=/usr/share/man
+		fi
+	fi
+;;
+esac
+if test "$root_prefix" = NONE ; then
+	if test "$prefix" = NONE ; then
+		root_prefix="$ac_default_prefix"
+	else
+		root_prefix="$prefix"
+	fi
+	root_bindir=$bindir
+	root_sbindir=$sbindir
+	root_libdir=$libdir
+	root_sysconfdir=$sysconfdir
+else
+	root_bindir='${root_prefix}/bin'
+	root_sbindir='${root_prefix}/sbin'
+	root_libdir='${root_prefix}/lib'
+	root_sysconfdir='${root_prefix}/etc'
+fi
+if test "$bindir" != '${exec_prefix}/bin'; then
+    root_bindir=$bindir
+    AC_MSG_RESULT([Setting root_bindir to $root_bindir])
+fi
+if test "$sbindir" != '${exec_prefix}/sbin'; then
+    root_sbindir=$sbindir
+    AC_MSG_RESULT([Setting root_sbindir to $root_sbindir])
+fi
+if test "$libdir" != '${exec_prefix}/lib'; then
+    root_libdir=$libdir
+    AC_MSG_RESULT([Setting root_libdir to $root_libdir])
+fi
+if test "$sysconfdir" != '${prefix}/etc'; then
+    root_sysconfdir=$sysconfdir
+    AC_MSG_RESULT([Setting root_sysconfdir to $root_sysconfdir])
+fi
+AC_SUBST(root_prefix)
+AC_SUBST(root_bindir)
+AC_SUBST(root_sbindir)
+AC_SUBST(root_libdir)
+AC_SUBST(root_sysconfdir)
+dnl
+dnl Allow specification of the multiarch arch
+dnl
+AC_ARG_WITH([multiarch],
+AS_HELP_STRING([--with-multiarch=ARCH],[specify the multiarch triplet]),
+if test "$withval" = "lib64"; then
+    libdir=/usr/lib64
+    root_libdir=/lib64
+else
+    libdir=$libdir/$withval
+    root_libdir=$root_libdir/$withval
+fi
+)
+dnl
+dnl
+dnl See if -static works.  This could fail if the linker does not
+dnl support -static, or if required external libraries are not available
+dnl in static form.
+dnl
+AC_MSG_CHECKING([whether we can link with -static])
+AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
+[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS_STATIC -static"
+AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
+ ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
+LDFLAGS=$SAVE_LDFLAGS])
+dnl
+dnl Regardless of how the test turns out, Solaris doesn't handle -static
+dnl This is caused by the socket library requiring the nsl library, which
+dnl requires the -dl library, which only works for dynamically linked 
+dnl programs.  It basically means you can't have statically linked programs
+dnl which use the network under Solaris.  
+dnl
+case "$host_os" in
+solaris2.*)
+	ac_cv_e2fsprogs_use_static=no	
+;;
+esac
+AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
+if test $ac_cv_e2fsprogs_use_static = yes; then
+	LDFLAGS_STATIC="$LDFLAGS_STATIC -static"
+fi
+AC_SUBST(LDFLAGS_STATIC)
+dnl
+dnl Work around mysterious Darwin / GNU libintl problem
+dnl (__asm__ redirection doesn't work for some mysterious reason.  Looks like
+dnl Apple hacked gcc somehow?)
+dnl
+case "$host_os" in
+darwin*)
+	AC_MSG_RESULT([Using Apple Darwin / GNU libintl workaround])
+	AC_DEFINE(_INTL_REDIRECT_MACROS, 1,
+		[Define to 1 if Apple Darwin libintl workaround is needed])
+	;;
+esac
+dnl
+dnl Only try to run the test suite if we're not cross compiling.
+dnl
+if test "$cross_compiling" = yes ; then
+  DO_TEST_SUITE=
+else
+  DO_TEST_SUITE=check
+fi
+AC_SUBST(DO_TEST_SUITE)
+dnl
+dnl Only include the intl include files if we're building with them
+dnl
+INCLUDES='-I. -I$(top_builddir)/lib -I$(top_srcdir)/lib'
+if test -n "$CPPFLAGS" ; then
+	INCLUDES="$INCLUDES $CPPFLAGS"
+fi
+if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
+	INCLUDES=$INCLUDES' -I$(top_builddir)/intl -I$(top_srcdir)/intl'
+fi
+if test -n "$WITH_DIET_LIBC" ; then
+	INCLUDES="$INCLUDES -D_REENTRANT"
+fi
+AC_SUBST(INCLUDES)
+dnl
+dnl Build CFLAGS
+dnl
+if test $cross_compiling = no; then
+   BUILD_CFLAGS="$CFLAGS $CPPFLAGS $INCLUDES -DHAVE_CONFIG_H"
+   BUILD_LDFLAGS="$LDFLAGS"
+fi
+AC_SUBST(BUILD_CFLAGS)
+AC_SUBST(BUILD_LDFLAGS)
+dnl
+dnl Define CFLAGS and LDFLAGS for shared libraries
+dnl
+CFLAGS_SHLIB=${CFLAGS_SHLIB:-$CFLAGS}
+CFLAGS_STLIB=${CFLAGS_STLIB:-$CFLAGS}
+LDFLAGS_SHLIB=${LDFLAGS_SHLIB:-$LDFLAGS}
+AC_SUBST(CFLAGS_SHLIB)
+AC_SUBST(CFLAGS_STLIB)
+AC_SUBST(LDFLAGS_SHLIB)
+
+dnl
+dnl Where do udev rules go?
+dnl
+AC_ARG_WITH([udev_rules_dir],
+  [AS_HELP_STRING([--with-udev-rules-dir@<:@=DIR@:>@],
+	[Install udev rules into DIR.])],
+  [],
+  [with_udev_rules_dir=yes])
+AS_IF([test "x${with_udev_rules_dir}" != "xno"],
+  [
+	AS_IF([test "x${with_udev_rules_dir}" = "xyes"],
+	  [
+		PKG_CHECK_MODULES([udev], [udev],
+		  [
+			with_udev_rules_dir="$($PKG_CONFIG --variable=udevdir udev)/rules.d"
+		  ], [
+			with_udev_rules_dir=""
+		  ])
+	  ])
+	AC_MSG_CHECKING([for udev rules dir])
+	pkg_udev_rules_dir="${with_udev_rules_dir}"
+	AS_IF([test -n "${pkg_udev_rules_dir}"],
+	  [
+		AC_MSG_RESULT(${pkg_udev_rules_dir})
+		have_udev="yes"
+	  ],
+	  [
+		AC_MSG_RESULT(no)
+		have_udev="no"
+	  ])
+  ],
+  [
+	have_udev="disabled"
+  ])
+AC_SUBST(have_udev)
+AC_SUBST(pkg_udev_rules_dir)
+
+dnl
+dnl Where do cron jobs go?
+dnl
+AC_ARG_WITH([crond_dir],
+  [AS_HELP_STRING([--with-crond-dir@<:@=DIR@:>@],
+	[Install system crontabs into DIR.])],
+  [],
+  [with_crond_dir=yes])
+AS_IF([test "x${with_crond_dir}" != "xno"],
+  [
+	AS_IF([test "x${with_crond_dir}" = "xyes"],
+	  [
+		AS_IF([test -d "/etc/cron.d"],
+		  [with_crond_dir="/etc/cron.d"],
+		  [have_crond="no"; with_crond_dir=""])
+	  ])
+	AC_MSG_CHECKING([for system crontab dir])
+	crond_dir="${with_crond_dir}"
+	AS_IF([test -n "${crond_dir}"],
+	  [
+		AC_MSG_RESULT(${crond_dir})
+		have_crond="yes"
+	  ],
+	  [
+		AC_MSG_RESULT(no)
+		have_crond="no"
+	  ])
+  ],
+  [
+	have_crond="disabled"
+  ])
+AC_SUBST(have_crond)
+AC_SUBST(crond_dir)
+
+dnl
+dnl Where do systemd services go?
+dnl
+AC_ARG_WITH([systemd_unit_dir],
+  [AS_HELP_STRING([--with-systemd-unit-dir@<:@=DIR@:>@],
+	[Install systemd system units into DIR.])],
+  [],
+  [with_systemd_unit_dir=yes])
+AS_IF([test "x${with_systemd_unit_dir}" != "xno"],
+  [
+	AS_IF([test "x${with_systemd_unit_dir}" = "xyes"],
+	  [
+		PKG_CHECK_MODULES([systemd], [systemd],
+		  [
+			with_systemd_unit_dir="$($PKG_CONFIG --variable=systemdsystemunitdir systemd)"
+		  ], [
+			with_systemd_unit_dir=""
+		  ])
+		m4_pattern_allow([^PKG_(MAJOR|MINOR|BUILD|REVISION)$])
+	  ])
+	AC_MSG_CHECKING([for systemd system unit dir])
+	systemd_system_unit_dir="${with_systemd_unit_dir}"
+	AS_IF([test -n "${systemd_system_unit_dir}"],
+	  [
+		AC_MSG_RESULT(${systemd_system_unit_dir})
+		have_systemd="yes"
+	  ],
+	  [
+		AC_MSG_RESULT(no)
+		have_systemd="no"
+	  ])
+  ],
+  [
+	have_systemd="disabled"
+  ])
+AC_SUBST(have_systemd)
+AC_SUBST(systemd_system_unit_dir)
+dnl Adjust the compiled files if we are on windows vs everywhere else
+dnl
+OS_IO_FILE=""
+[case "$host_os" in
+  cigwin*|mingw*|msys*)
+    OS_IO_FILE=windows_io
+  ;;
+  *)
+    OS_IO_FILE=unix_io
+  ;;
+esac]
+AC_SUBST(OS_IO_FILE)
+dnl
+dnl Make our output files, being sure that we create the some miscellaneous 
+dnl directories
+dnl
+test -d lib || mkdir lib
+test -d include || mkdir include
+test -d include/linux || mkdir include/linux
+test -d include/asm || mkdir include/asm
+if test -z "$UUID_CMT" ; then
+	uuid_out_list="lib/uuid/Makefile lib/uuid/uuid.pc \
+		lib/uuid/uuid_types.h"
+fi
+if test -z "$BLKID_CMT" ; then
+	blkid_out_list="lib/blkid/Makefile lib/blkid/blkid.pc \
+		lib/blkid/blkid_types.h"
+fi
+for i in MCONFIG Makefile \
+	util/Makefile util/subst.conf util/gen-tarball util/install-symlink \
+	lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
+	lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
+	$uuid_out_list $blkid_out_list lib/support/Makefile \
+	lib/ss/ss.pc lib/et/com_err.pc lib/e2p/e2p.pc lib/ext2fs/ext2fs.pc \
+	misc/Makefile ext2ed/Makefile e2fsck/Makefile \
+	debugfs/Makefile tests/Makefile tests/progs/Makefile \
+	resize/Makefile doc/Makefile po/Makefile.in scrub/Makefile; do
+	if test -d `dirname ${srcdir}/$i` ; then
+		outlist="$outlist $i"
+	fi
+done
+AC_OUTPUT($outlist)
+if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi
diff --git a/configure.in b/configure.in
deleted file mode 100644
index 6f39cc9..0000000
--- a/configure.in
+++ /dev/null
@@ -1,1316 +0,0 @@
-AC_INIT(version.h)
-AC_PREREQ(2.54)
-AC_CONFIG_AUX_DIR(config)
-AC_CONFIG_HEADERS([lib/config.h])
-AH_BOTTOM([#include "dirpaths.h"])
-MCONFIG=./MCONFIG
-AC_SUBST_FILE(MCONFIG)
-BINARY_TYPE=bin
-dnl
-dnl This is to figure out the version number and the date....
-dnl
-E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h  \
-	| awk '{print $3}' | tr \" " " | awk '{print $1}'`
-DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
-	| tr \" " "`
-E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'`
-MONTH=`echo $DATE | awk -F- '{print $2}'`
-YEAR=`echo $DATE | awk -F- '{print $3}'`
-
-if expr $YEAR ">" 1900 > /dev/null ; then
-	E2FSPROGS_YEAR=$YEAR
-elif expr $YEAR ">" 90 >/dev/null ; then
-	E2FSPROGS_YEAR=19$YEAR
-else
-	E2FSPROGS_YEAR=20$YEAR
-fi
-
-case $MONTH in
-Jan)	MONTH_NUM=01; E2FSPROGS_MONTH="January" ;;
-Feb)	MONTH_NUM=02; E2FSPROGS_MONTH="February" ;;
-Mar)	MONTH_NUM=03; E2FSPROGS_MONTH="March" ;;
-Apr)	MONTH_NUM=04; E2FSPROGS_MONTH="April" ;;
-May)	MONTH_NUM=05; E2FSPROGS_MONTH="May" ;;
-Jun)	MONTH_NUM=06; E2FSPROGS_MONTH="June" ;;
-Jul)	MONTH_NUM=07; E2FSPROGS_MONTH="July" ;;
-Aug)	MONTH_NUM=08; E2FSPROGS_MONTH="August" ;;
-Sep)	MONTH_NUM=09; E2FSPROGS_MONTH="September" ;;
-Oct)	MONTH_NUM=10; E2FSPROGS_MONTH="October" ;;
-Nov)	MONTH_NUM=11; E2FSPROGS_MONTH="November" ;;
-Dec)	MONTH_NUM=12; E2FSPROGS_MONTH="December" ;;
-*)	AC_MSG_WARN([Unknown month $MONTH??]) ;;
-esac
-
-base_ver=`echo $E2FSPROGS_VERSION | \
-	       sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'`
-
-date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY}
-
-case $E2FSPROGS_VERSION in
-*-WIP|pre-*)
-	E2FSPROGS_PKGVER="$base_ver~WIP-$E2FSPROGS_YEAR-$MONTH_NUM-$E2FSPROGS_DAY"
-	;;
-*)
-	E2FSPROGS_PKGVER="$base_ver"
-	;;
-esac
-
-unset DATE MONTH YEAR base_ver pre_vers date_spec
-AC_MSG_RESULT([Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION])
-AC_MSG_RESULT([Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}])
-AC_SUBST(E2FSPROGS_YEAR)
-AC_SUBST(E2FSPROGS_MONTH)
-AC_SUBST(E2FSPROGS_DAY)
-AC_SUBST(E2FSPROGS_VERSION)
-AC_SUBST(E2FSPROGS_PKGVER)
-AC_CANONICAL_HOST
-dnl
-dnl Check to see if libdl exists for the sake of dlopen
-dnl
-DLOPEN_LIB=''
-AC_CHECK_LIB(dl, dlopen, 
-[DLOPEN_LIB=-ldl
-AC_DEFINE(HAVE_DLOPEN, 1, [Define to 1 if dlopen/libdl exists])])
-AC_SUBST(DLOPEN_LIB)
-dnl
-dnl Use diet libc
-dnl 
-WITH_DIET_LIBC=
-AC_ARG_WITH([diet-libc],
-[  --with-diet-libc        use diet libc],
-CC="diet cc -nostdinc"
-WITH_DIET_LIBC=yes
-AC_MSG_RESULT(CC=$CC))dnl
-dnl
-AC_ARG_WITH([cc],
-AC_HELP_STRING([--with-cc],[no longer supported, use CC= instead]),
-AC_MSG_ERROR([--with-cc no longer supported; use CC= instead]))
-dnl
-AC_ARG_WITH([ccopts],
-AC_HELP_STRING([--with-ccopts],[no longer supported, use CFLAGS= instead]),
-AC_MSG_ERROR([--with-ccopts no longer supported; use CFLAGS= instead]))
-dnl
-AC_ARG_WITH([ldopts],
-AC_HELP_STRING([--with-ldopts],[no longer supported, use LDFLAGS= instead]),
-AC_MSG_ERROR([--with-ldopts no longer supported; use LDFLAGS= instead]))
-dnl
-AC_PROG_CC
-if test "$GCC" = yes; then
-   RDYNAMIC="-rdynamic"
-   AC_SUBST(RDYNAMIC)
-fi
-AC_PROG_CPP
-dnl
-dnl Alpha computers use fast and imprecise floating point code that may
-dnl miss exceptions by default. Force sane options if we're using GCC.
-AC_MSG_CHECKING(for additional special compiler flags)
-if test "$GCC" = yes
-then
-    case "$host_cpu" in
-	alpha)		addcflags="-mieee" ;;
-    esac
-fi
-if test "x$addcflags" != x
-then
-    AC_MSG_RESULT($addcflags)
-    CFLAGS="$addcflags $CFLAGS"
-else
-    AC_MSG_RESULT([[(none)]])
-fi
-dnl
-dnl Set default values for library extentions.  Will be dealt with after
-dnl parsing configuration opions, which may modify these
-dnl
-LIB_EXT=.a
-STATIC_LIB_EXT=.a
-PROFILED_LIB_EXT=.a
-dnl
-dnl Allow separate `root_prefix' to be specified
-dnl
-AC_ARG_WITH([root-prefix],
-[  --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
-root_prefix=$withval,
-root_prefix=NONE)dnl
-dnl
-dnl handle --enable-maintainer-mode
-dnl
-AC_ARG_ENABLE([maintainer-mode],
-[  --enable-maintainer-mode enable makefile rules useful for maintainers],
-if test "$enableval" = "no"
-then
-	MAINTAINER_CMT=#
-	AC_MSG_RESULT([Disabling maintainer mode])
-else
-	MAINTAINER_CMT=
-	AC_MSG_RESULT([Enabling maintainer mode])
-fi
-,
-MAINTAINER_CMT=#
-AC_MSG_RESULT([Disabling maintainer mode by default])
-)
-AC_SUBST(MAINTAINER_CMT)
-dnl
-dnl handle --enable-symlink-install
-dnl
-AC_ARG_ENABLE([symlink-install],
-[  --enable-symlink-install use symlinks when installing instead of hard links],
-if test "$enableval" = "no"
-then
-	LINK_INSTALL_FLAGS=-f
-	AC_MSG_RESULT([Disabling symlinks for install])
-else
-	LINK_INSTALL_FLAGS=-sf
-	AC_MSG_RESULT([Enabling symlinks for install])
-fi
-,
-LINK_INSTALL_FLAGS=-f
-AC_MSG_RESULT([Disabling symlinks for install by default])
-)
-AC_SUBST(LINK_INSTALL_FLAGS)
-dnl
-dnl handle --enable-relative-symlinks
-dnl
-relative_symlink_defined=
-AC_ARG_ENABLE([relative-symlinks],
-[  --enable-relative-symlinks use relative symlinks when installing],
-if test "$enableval" = "no"
-then
-	SYMLINK_RELATIVE=
-	relative_symlink_defined=yes
-	AC_MSG_RESULT([Disabling relative symlinks for install])
-else
-	SYMLINK_RELATIVE=--relative
-	relative_symlink_defined=yes
-	AC_MSG_RESULT([Enabling relative symlinks for install])
-fi)
-AC_ARG_ENABLE([symlink-relative-symlinks],,
-if test "$enableval" = "no"
-then
-	SYMLINK_RELATIVE=yes
-	AC_MSG_RESULT([Disabling relative symlinks for install])
-else
-	SYMLINK_RELATIVE=--relative
-	AC_MSG_RESULT([Enabling relative symlinks for install])
-fi
-,
-if test -z "$relative_symlink_defined"
-then
-	SYMLINK_RELATIVE=
-AC_MSG_RESULT([Disabling relative symlinks for install by default])
-fi
-)
-AC_SUBST(SYMLINK_RELATIVE)
-dnl
-dnl handle --enable-symlink-build
-dnl
-AC_ARG_ENABLE([symlink-build],
-[  --enable-symlink-build  use symlinks while building instead of hard links],
-if test "$enableval" = "no"
-then
-	LINK_BUILD_FLAGS=
-	AC_MSG_RESULT([Disabling symlinks for build])
-else
-	LINK_BUILD_FLAGS=-s
-	AC_MSG_RESULT([Enabling symlinks for build])
-fi
-,
-LINK_BUILD_FLAGS=
-AC_MSG_RESULT([Disabling symlinks for build by default])
-)
-AC_SUBST(LINK_BUILD_FLAGS)
-dnl
-dnl handle --enable-verbose-makecmds
-dnl
-AC_ARG_ENABLE([verbose-makecmds],
-[  --enable-verbose-makecmds enable verbose make command output],
-if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Disabling verbose make commands])
-	E=@echo
-	ES=echo
-	Q=@
-else
-	AC_MSG_RESULT([Enabling verbose make commands])
-	E=@\\#
-	ES=\\#
-	Q= 
-fi
-,
-AC_MSG_RESULT([Disabling verbose make commands])
-E=@echo
-ES=echo
-Q=@
-)
-AC_SUBST(E)
-AC_SUBST(ES)
-AC_SUBST(Q)
-dnl
-dnl handle --enable-compression
-dnl
-AC_ARG_ENABLE([compression],
-[  --enable-compression	  enable EXPERIMENTAL compression support],
-if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Disabling compression support])
-else
-	AC_DEFINE(ENABLE_COMPRESSION, 1,
-		[Define to 1 if ext2 compression enabled])
-	AC_MSG_RESULT([Enabling compression support])
-	AC_MSG_WARN([Compression support is experimental])
-fi
-,
-AC_MSG_RESULT([Disabling compression support by default])
-)
-dnl
-dnl handle --enable-htree
-dnl
-AH_TEMPLATE([ENABLE_HTREE], [Define to 1 if ext3/4 htree support enabled])
-AC_ARG_ENABLE([htree],
-[  --enable-htree      	  enable EXPERIMENTAL htree directory support],
-if test "$enableval" = "no"
-then
-	HTREE_CMT=#
-	AC_MSG_RESULT([Disabling htree directory support])
-else
-	HTREE_CMT=
-	AC_DEFINE(ENABLE_HTREE, 1)
-	AC_MSG_RESULT([Enabling htree directory support])
-fi
-,
-HTREE_CMT=
-AC_DEFINE(ENABLE_HTREE, 1)
-AC_MSG_RESULT([Enabling htree directory support by default])
-)
-AC_SUBST(HTREE_CMT)
-dnl
-dnl This needs to be before all of the --enable-*-shlibs options
-dnl
-E2_PKG_CONFIG_STATIC=--static
-LDFLAG_DYNAMIC=
-PRIVATE_LIBS_CMT=
-dnl
-dnl handle --enable-elf-shlibs
-dnl
-AC_ARG_ENABLE([elf-shlibs],
-[  --enable-elf-shlibs	  select ELF shared libraries],
-if test "$enableval" = "no"
-then
-	ELF_CMT=#
-	MAKEFILE_ELF=/dev/null
-	AC_MSG_RESULT([Disabling ELF shared libraries])
-else
-	E2_PKG_CONFIG_STATIC=
-	ELF_CMT=
-	MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
-	[case "$host_os" in
-	solaris2.*)
-		MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
-	;;
-	esac]
-	BINARY_TYPE=elfbin
-	LIB_EXT=.so
-	PRIVATE_LIBS_CMT=#
-	LDFLAG_DYNAMIC=['-Wl,-rpath-link,$(top_builddir)/lib']
-	AC_MSG_RESULT([Enabling ELF shared libraries])
-fi
-,
-MAKEFILE_ELF=/dev/null
-ELF_CMT=#
-AC_MSG_RESULT([Disabling ELF shared libraries by default])
-)
-AC_SUBST(ELF_CMT)
-AC_SUBST_FILE(MAKEFILE_ELF)
-dnl
-dnl handle --enable-bsd-shlibs
-dnl
-AC_ARG_ENABLE([bsd-shlibs],
-[  --enable-bsd-shlibs	  select BSD shared libraries],
-if test "$enableval" = "no"
-then
-	BSDLIB_CMT=#
-	MAKEFILE_BSDLIB=/dev/null
-	AC_MSG_RESULT([Disabling BSD shared libraries])
-else
-	E2_PKG_CONFIG_STATIC=
-	BSDLIB_CMT=
-	MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
-	LIB_EXT=.so
-	[case "$host_os" in
-	darwin*)
-		MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
-		LIB_EXT=.dylib
-	;;
-	esac]
-	AC_MSG_RESULT([Enabling BSD shared libraries])
-fi
-,
-MAKEFILE_BSDLIB=/dev/null
-BSDLIB_CMT=#
-AC_MSG_RESULT([Disabling BSD shared libraries by default])
-)
-AC_SUBST(BSDLIB_CMT)
-AC_SUBST_FILE(MAKEFILE_BSDLIB)
-dnl
-dnl handle --enable-profile
-dnl
-AC_ARG_ENABLE([profile],
-[  --enable-profile	  build profiling libraries],
-if test "$enableval" = "no"
-then
-	PROFILE_CMT=#
-	MAKEFILE_PROFILE=/dev/null
-	AC_MSG_RESULT([Disabling profiling libraries])
-else
-	PROFILE_CMT=
-	MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
-	PROFILED_LIB_EXT=_p.a
-	AC_MSG_RESULT([Building profiling libraries])
-fi
-,
-PROFILE_CMT=#
-MAKEFILE_PROFILE=/dev/null
-AC_MSG_RESULT([Disabling profiling libraries by default])
-)
-AC_SUBST(PROFILE_CMT)
-AC_SUBST_FILE(MAKEFILE_PROFILE)
-dnl
-dnl handle --enable-checker
-dnl
-AC_ARG_ENABLE([checker],
-[  --enable-checker	  build checker libraries],
-if test "$enableval" = "no"
-then
-	CHECKER_CMT=#
-	MAKEFILE_CHECKER=/dev/null
-	AC_MSG_RESULT([Disabling checker libraries])
-else
-	CHECKER_CMT=
-	MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
-	AC_MSG_RESULT([Building checker libraries])
-fi
-,
-CHECKER_CMT=#
-MAKEFILE_CHECKER=/dev/null
-AC_MSG_RESULT([Disabling checker libraries by default])
-)
-AC_SUBST(CHECKER_CMT)
-AC_SUBST_FILE(MAKEFILE_CHECKER)
-dnl
-dnl Substitute library extensions
-dnl
-AC_SUBST(LIB_EXT)
-AC_SUBST(STATIC_LIB_EXT)
-AC_SUBST(PROFILED_LIB_EXT)
-AC_SUBST(LDFLAG_DYNAMIC)
-AC_SUBST(PRIVATE_LIBS_CMT)
-dnl
-dnl handle --enable-jbd-debug
-dnl
-AC_ARG_ENABLE([jbd-debug],
-[  --enable-jbd-debug  	  enable journal debugging],
-if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Disabling journal debugging])
-else
-	AC_DEFINE(CONFIG_JBD_DEBUG, 1,
-		[Define to 1 if debugging ext3/4 journal code])
-	AC_MSG_RESULT([Enabling journal debugging])
-fi
-,
-AC_MSG_RESULT([Disabling journal debugging by default])
-)
-dnl
-dnl handle --enable-blkid-debug
-dnl
-AC_ARG_ENABLE([blkid-debug],
-[  --enable-blkid-debug    enable blkid debugging],
-if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Disabling blkid debugging])
-else
-	AC_DEFINE(CONFIG_BLKID_DEBUG, 1,
-		[Define to 1 if debugging the blkid library])
-	AC_MSG_RESULT([Enabling blkid debugging])
-fi
-,
-AC_MSG_RESULT([Disabling blkid debugging by default])
-)
-dnl
-dnl handle --enable-testio-debug
-dnl
-AC_ARG_ENABLE([testio-debug],
-[  --disable-testio-debug  disable the use of the test I/O manager for debugging],
-AH_TEMPLATE([CONFIG_TESTIO_DEBUG],
-	[Define to 1 if the testio I/O manager should be enabled])
-if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Disabling testio debugging])
-	TEST_IO_CMT="#"
-else
-	TEST_IO_CMT=
-	AC_DEFINE(CONFIG_TESTIO_DEBUG, 1)
-	AC_MSG_RESULT([Enabling testio debugging])
-fi
-,
-AC_MSG_RESULT([Enabling testio debugging by default])
-AC_DEFINE(CONFIG_TESTIO_DEBUG, 1)
-TEST_IO_CMT=
-)
-AC_SUBST(TEST_IO_CMT)
-dnl
-dnl handle --disable-libuuid
-dnl
-PKG_PROG_PKG_CONFIG
-LIBUUID=
-DEPLIBUUID=
-STATIC_LIBUUID=
-DEPSTATIC_LIBUUID=
-PROFILED_LIBUUID=
-DEPPROFILED_LIBUUID=
-UUID_CMT=
-AC_ARG_ENABLE([libuuid],
-[  --disable-libuuid	  do not build private uuid library],
-if test "$enableval" = "no"
-then
-	if test -z "$PKG_CONFIG"; then
-		AC_MSG_ERROR([pkg-config not installed; please install it.])
-	fi
-
-	AC_CHECK_LIB(uuid, uuid_generate,
-		[LIBUUID=`$PKG_CONFIG --libs uuid`;
-		 STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`],
-		[AC_MSG_ERROR([external uuid library not found])],
-		[$LIBUUID])
-	UUID_CMT=#
-	AC_MSG_RESULT([Disabling private uuid library])
-else
-	LIBUUID='$(LIB)/libuuid'$LIB_EXT
-	DEPLIBUUID=$LIBUUID
-	STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
-	DEPSTATIC_LIBUUID=$STATIC_LIBUUID
-	PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
-	DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
-	AC_MSG_RESULT([Enabling private uuid library])
-fi
-,
-LIBUUID='$(LIB)/libuuid'$LIB_EXT
-DEPLIBUUID=$LIBUUID
-STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT
-DEPSTATIC_LIBUUID=$STATIC_LIBUUID
-PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT
-DEPPROFILED_LIBUUID=$PROFILED_LIBUUID
-AC_MSG_RESULT([Enabling private uuid library by default])
-)
-AC_SUBST(LIBUUID)
-AC_SUBST(DEPLIBUUID)
-AC_SUBST(STATIC_LIBUUID)
-AC_SUBST(DEPSTATIC_LIBUUID)
-AC_SUBST(PROFILED_LIBUUID)
-AC_SUBST(DEPPROFILED_LIBUUID)
-AC_SUBST(UUID_CMT)
-dnl
-dnl handle --disable-libblkid
-dnl
-PKG_PROG_PKG_CONFIG
-LIBBLKID=
-DEPLIBBLKID=
-STATIC_LIBBLKID=
-DEPSTATIC_LIBBLKID=
-PROFILED_LIBBLKID=
-DEPPROFILED_LIBBLKID=
-BLKID_CMT=
-AH_TEMPLATE([CONFIG_BUILD_FINDFS], [Define to 1 to compile findfs])
-AC_ARG_ENABLE([libblkid],
-[  --disable-libblkid	  do not build private blkid library],
-if test "$enableval" = "no"
-then
-	if test -z "$PKG_CONFIG"; then
-		AC_MSG_ERROR([pkg-config not installed; please install it.])
-	fi
-
-	AC_CHECK_LIB(blkid, blkid_get_cache,
-		[LIBBLKID=`$PKG_CONFIG --libs blkid`;
-		 STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`],
-		[AC_MSG_ERROR([external blkid library not found])],
-		[$LIBBLKID])
-	BLKID_CMT=#
-	AC_MSG_RESULT([Disabling private blkid library])
-else
-	LIBBLKID='$(LIB)/libblkid'$LIB_EXT
-	DEPLIBBLKID=$LIBBLKID
-	STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
-	DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
-	PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
-	DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
-	AC_DEFINE(CONFIG_BUILD_FINDFS, 1)
-	AC_MSG_RESULT([Enabling private blkid library])
-fi
-,
-LIBBLKID='$(LIB)/libblkid'$LIB_EXT
-DEPLIBBLKID=$LIBBLKID
-STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT
-DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID
-PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT
-DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID
-AC_DEFINE(CONFIG_BUILD_FINDFS, 1)
-AC_MSG_RESULT([Enabling private blkid library by default])
-)
-AC_SUBST(LIBBLKID)
-AC_SUBST(DEPLIBBLKID)
-AC_SUBST(STATIC_LIBBLKID)
-AC_SUBST(DEPSTATIC_LIBBLKID)
-AC_SUBST(PROFILED_LIBBLKID)
-AC_SUBST(DEPPROFILED_LIBBLKID)
-AC_SUBST(BLKID_CMT)
-dnl
-dnl handle --enable-quota
-dnl
-QUOTA_MAN_COMMENT='.\"'
-QUOTA_CMT=
-AC_SUBST(QUOTA_MAN_COMMENT)
-PKG_PROG_PKG_CONFIG
-AH_TEMPLATE([CONFIG_QUOTA], [Define to 1 to enable quota support])
-AC_ARG_ENABLE([quota],
-[  --enable-quota	  enable quota support],
-if test "$enableval" = "no"
-then
-	QUOTA_CMT=#
-	AC_MSG_RESULT([Disabling quota support])
-else
-	QUOTA_CMT=
-	AC_DEFINE(CONFIG_QUOTA, 1)
-	AC_MSG_RESULT([Enabling quota support])
-	QUOTA_MAN_COMMENT=""
-	AC_SUBST(QUOTA_MAN_COMMENT)
-fi
-,
-QUOTA_CMT=#
-AC_MSG_RESULT([Disabling quota support by default])
-)
-dnl
-dnl Define stuff expected for quota library
-dnl
-LIBQUOTA='$(LIB)/libquota'$LIB_EXT
-DEPLIBQUOTA=$LIBQUOTA
-STATIC_LIBQUOTA='$(LIB)/libquota'$STATIC_LIB_EXT
-DEPSTATIC_LIBQUOTA=$STATIC_LIBQUOTA
-PROFILED_LIBQUOTA='$(LIB)/libquota'$PROFILED_LIB_EXT
-DEPPROFILED_LIBQUOTA=$PROFILED_LIBQUOTA
-AC_SUBST(LIBQUOTA)
-AC_SUBST(DEPLIBQUOTA)
-AC_SUBST(STATIC_LIBQUOTA)
-AC_SUBST(DEPSTATIC_LIBQUOTA)
-AC_SUBST(PROFILED_LIBQUOTA)
-AC_SUBST(DEPPROFILED_LIBQUOTA)
-AC_SUBST(QUOTA_CMT)
-dnl
-dnl handle --disable-backtrace
-dnl
-AH_TEMPLATE([DISABLE_BACKTRACE], [Define to 1 to disable use of backtrace])
-AC_ARG_ENABLE([backtrace],
-[  --disable-backtrace	  disable use backtrace],
-if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Disabling use of backtrace])
-	AC_DEFINE(DISABLE_BACKTRACE, 1)
-else
-	AC_MSG_RESULT([Enabling use of backtrace])
-fi
-,
-AC_MSG_RESULT([Enabling use of backtrace by default])
-)
-dnl
-dnl handle --enable-debugfs
-dnl
-AC_ARG_ENABLE([debugfs],
-[  --disable-debugfs   	  disable support of debugfs program],
-if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Disabling debugfs support])
-	DEBUGFS_CMT="#"
-else
-	DEBUGFS_CMT=
-	AC_MSG_RESULT([Enabling debugfs support])
-fi
-,
-AC_MSG_RESULT([Enabling debugfs support by default])
-DEBUGFS_CMT=
-)
-AC_SUBST(DEBUGFS_CMT)
-dnl
-dnl handle --enable-imager
-dnl
-AC_ARG_ENABLE([imager],
-[  --disable-imager   	  disable support of e2image program],
-if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Disabling e2image support])
-	IMAGER_CMT="#"
-else
-	IMAGER_CMT=
-	AC_MSG_RESULT([Enabling e2image support])
-fi
-,
-AC_MSG_RESULT([Enabling e2image support by default])
-IMAGER_CMT=
-)
-AC_SUBST(IMAGER_CMT)
-dnl
-dnl handle --enable-resizer
-dnl
-AC_ARG_ENABLE([resizer],
-[  --disable-resizer   	  disable support of e2resize program],
-if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Disabling e2resize support])
-	RESIZER_CMT="#"
-else
-	RESIZER_CMT=
-	AC_MSG_RESULT([Enabling e2resize support])
-fi
-,
-AC_MSG_RESULT([Enabling e2resize support by default])
-RESIZER_CMT=
-)
-AC_SUBST(RESIZER_CMT)
-dnl
-dnl handle --enable-defrag
-dnl
-AC_ARG_ENABLE([defrag],
-[  --disable-defrag   	  disable support of e4defrag program],
-if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Disabling e4defrag support])
-	DEFRAG_CMT="#"
-else
-	DEFRAG_CMT=
-	AC_MSG_RESULT([Enabling e4defrag support])
-fi
-,
-AC_MSG_RESULT([Enabling e4defrag support by default])
-DEFRAG_CMT=
-)
-AC_SUBST(DEFRAG_CMT)
-dnl
-dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
-dnl
-AC_ARG_ENABLE([fsck],
-[  --enable-fsck           build fsck wrapper program],
-[if test "$enableval" = "no"
-then
-	FSCK_PROG='' FSCK_MAN=''
-	AC_MSG_RESULT([Not building fsck wrapper])
-else
-	FSCK_PROG=fsck FSCK_MAN=fsck.8
-	AC_MSG_RESULT([Building fsck wrapper])
-fi]
-,
-[case "$host_os" in
-  gnu*)
-    FSCK_PROG='' FSCK_MAN=''
-    AC_MSG_RESULT([Not building fsck wrapper by default])
-    ;;
-  *)
-    FSCK_PROG=fsck FSCK_MAN=fsck.8
-    AC_MSG_RESULT([Building fsck wrapper by default])
-esac]
-)
-AC_SUBST(FSCK_PROG)
-AC_SUBST(FSCK_MAN)
-dnl
-dnl See whether to install the `e2initrd-helper' program
-dnl
-AC_ARG_ENABLE([e2initrd-helper],
-[  --enable-e2initrd-helper build e2initrd-helper program],
-[if test "$enableval" = "no"
-then
-	E2INITRD_PROG='' E2INITRD_MAN=''
-	AC_MSG_RESULT([Not building e2initrd helper])
-else
-	E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
-	AC_MSG_RESULT([Building e2initrd helper])
-fi]
-,
-E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
-AC_MSG_RESULT([Building e2initrd helper by default])
-)
-AC_SUBST(E2INITRD_PROG)
-AC_SUBST(E2INITRD_MAN)
-dnl
-dnl
-dnl
-AC_ARG_ENABLE([tls],
-[  --disable-tls           disable use of thread local support],
-[if test "$enableval" = "no"
-then
-	try_tls=""
-	AC_MSG_RESULT([Disabling thread local support])
-else
-	try_tls="yes"
-	AC_MSG_RESULT([Enabling thread local support])
-fi]
-,
-if test -n "$WITH_DIET_LIBC"
-then
-	try_tls=""
-	AC_MSG_RESULT([Diet libc does not support thread local support])
-else
-	try_tls="yes"
-	AC_MSG_RESULT([Try using thread local support by default])
-fi
-)
-if test "$try_tls" = "yes"
-then
-AX_TLS
-fi
-dnl
-dnl
-dnl
-AH_TEMPLATE([USE_UUIDD], [Define to 1 to build uuidd])
-AC_ARG_ENABLE([uuidd],
-[  --disable-uuidd         disable building the uuid daemon],
-[if test "$enableval" = "no"
-then
-	AC_MSG_RESULT([Not building uuidd])
-	UUIDD_CMT="#"
-else
-	AC_DEFINE(USE_UUIDD, 1)
-	UUIDD_CMT=""
-	AC_MSG_RESULT([Building uuidd])
-fi]
-,
-AC_DEFINE(USE_UUIDD, 1)
-UUIDD_CMT=""
-AC_MSG_RESULT([Building uuidd by default])
-)
-AC_SUBST(UUIDD_CMT)
-dnl
-dnl
-dnl
-MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
-AC_SUBST_FILE(MAKEFILE_LIBRARY)
-dnl
-dnl Add internationalization support, using gettext.
-dnl
-GETTEXT_PACKAGE=e2fsprogs
-PACKAGE=e2fsprogs
-VERSION="$E2FSPROGS_VERSION"
-VERSION=0.14.1
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [package name for gettext])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [version for gettext])
-AC_SUBST(GETTEXT_PACKAGE)
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
-
-AM_GNU_GETTEXT
-dnl
-dnl End of configuration options
-dnl
-AC_SUBST(BINARY_TYPE)
-AC_PROG_MAKE_SET
-CHECK_GNU_MAKE
-AC_PATH_PROG(LN, ln, ln)
-AC_PROG_LN_S
-AC_PATH_PROG(MV, mv, mv)
-AC_PATH_PROG(CP, cp, cp)
-AC_PATH_PROG(RM, rm, rm)
-AC_PATH_PROG(CHMOD, chmod, :)
-AC_PROG_AWK
-AC_PROG_EGREP
-AC_PATH_PROG(SED, sed, sed)
-AC_PATH_PROG(PERL, perl, perl)
-AC_PATH_PROG(LDCONFIG, ldconfig, :)
-AC_CHECK_TOOL(AR, ar, ar)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
-if test "_$MAKEINFO" = "_"; then
-    MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true"
-else
-    case "$MAKEINFO" in
-      */missing.*)
-        AC_MSG_WARN([
-*** Makeinfo is missing. Info documentation will not be built.])
-        ;;
-      *)
-        ;;
-    esac
-fi
-AC_SUBST(MAKEINFO)
-AC_PROG_INSTALL
-# See if we need a separate native compiler.
-if test $cross_compiling = no; then
-  BUILD_CC="$CC"
-  AC_SUBST(BUILD_CC)
-else
-  AC_CHECK_PROGS(BUILD_CC, gcc cc)
-fi
-AC_CHECK_HEADERS(m4_flatten([
-	dirent.h
-	errno.h
-	execinfo.h
-	getopt.h
-	malloc.h
-	mntent.h
-	paths.h
-	semaphore.h
-	setjmp.h
-	signal.h
-	stdarg.h
-	stdint.h
-	stdlib.h
-	termios.h
-	termio.h
-	unistd.h
-	utime.h
-	linux/falloc.h
-	linux/fd.h
-	linux/major.h
-	linux/loop.h
-	net/if_dl.h
-	netinet/in.h
-	sys/disklabel.h
-	sys/file.h
-	sys/ioctl.h
-	sys/mkdev.h
-	sys/mman.h
-	sys/prctl.h
-	sys/queue.h
-	sys/resource.h
-	sys/select.h
-	sys/socket.h
-	sys/sockio.h
-	sys/stat.h
-	sys/syscall.h
-	sys/sysmacros.h
-	sys/time.h
-	sys/types.h
-	sys/un.h
-	sys/wait.h
-]))
-AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
-[[
-#if HAVE_SYS_QUEUE_H
-#include <sys/queue.h>
-#endif
-]])
-AC_CHECK_HEADERS(net/if.h,,,
-[[
-#if HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#if HAVE_SYS_SOCKET
-#include <sys/socket.h>
-#endif
-]])
-AC_FUNC_VPRINTF
-dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
-dnl is not decleared.
-AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT, 1,
-		       [Define to 1 if dirent has d_reclen])],,
-		[#include <dirent.h>])
-dnl Check to see if ssize_t was declared
-AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T, 1,
-		[Define to 1 if ssize_t declared])],,
-	      [#include <sys/types.h>])
-dnl
-dnl Check to see if llseek() is declared in unistd.h.  On some libc's 
-dnl it is, and on others it isn't..... Thank you glibc developers....
-dnl
-AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE, 1,
-			[Define to 1 if llseek declared in unistd.h])],,
-	      [#include <unistd.h>])
-dnl
-dnl Check to see if lseek64() is declared in unistd.h.  Glibc's header files
-dnl are so convoluted that I can't tell whether it will always be defined,
-dnl and if it isn't defined while lseek64 is defined in the library, 
-dnl disaster will strike.  
-dnl
-dnl Warning!  Use of --enable-gcc-wall may throw off this test.
-dnl
-dnl
-AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1,
-			[Define to 1 if lseek64 declared in unistd.h])],,
-		[#define _LARGEFILE_SOURCE
-		 #define _LARGEFILE64_SOURCE
-		 #include <unistd.h>])
-dnl
-dnl Word sizes...
-dnl
-AC_CHECK_SIZEOF(short)
-AC_CHECK_SIZEOF(int)
-AC_CHECK_SIZEOF(long)
-AC_CHECK_SIZEOF(long long)
-AC_CHECK_SIZEOF(off_t)
-SIZEOF_SHORT=$ac_cv_sizeof_short
-SIZEOF_INT=$ac_cv_sizeof_int
-SIZEOF_LONG=$ac_cv_sizeof_long
-SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
-SIZEOF_OFF_T=$ac_cv_sizeof_off_t
-AC_SUBST(SIZEOF_SHORT)
-AC_SUBST(SIZEOF_INT)
-AC_SUBST(SIZEOF_LONG)
-AC_SUBST(SIZEOF_LONG_LONG)
-AC_SUBST(SIZEOF_OFF_T)
-AC_C_BIGENDIAN
-BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
-ASM_TYPES_HEADER=./asm_types.h
-AC_SUBST_FILE(ASM_TYPES_HEADER)
-dnl
-dnl Save the configuration #defines needed for the public ext2fs.h
-dnl header file
-dnl
-echo "/* These defines are needed for the public ext2fs.h header file */" \
-     > public_config.h
-if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then
-  uniq tmp_config.$$ >> public_config.h
-else
-  echo "#undef HAVE_SYS_TYPES_H" >> public_config.h
-fi
-if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then
-  uniq tmp_config.$$ >> public_config.h
-else
-  echo "#undef WORDS_BIGENDIAN" >> public_config.h
-fi
-rm -f tmp_config.$$
-PUBLIC_CONFIG_HEADER=./public_config.h
-AC_SUBST_FILE(PUBLIC_CONFIG_HEADER)
-dnl
-dnl See if we have inttypes.h and if intptr_t is defined
-dnl
-AC_CHECK_HEADERS([inttypes.h])
-AC_CHECK_TYPES(intptr_t)
-dnl
-dnl See if struct stat has a st_flags field, in which case we can get file
-dnl flags somewhat portably.  Also check for the analogous setter, chflags().
-dnl
-AC_MSG_CHECKING(whether struct stat has a st_flags field)
-AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
-	AC_TRY_COMPILE([#include <sys/stat.h>],
-		[struct stat stat; stat.st_flags = 0;],
-		[e2fsprogs_cv_struct_st_flags=yes],
-		[e2fsprogs_cv_struct_st_flags=no]))
-AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
-if test "$e2fsprogs_cv_struct_st_flags" = yes; then
-  AC_MSG_CHECKING(whether st_flags field is useful)
-  AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
-	AC_TRY_COMPILE([#include <sys/stat.h>],
-		[struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
-		[e2fsprogs_cv_struct_st_flags_immut=yes],
-		[e2fsprogs_cv_struct_st_flags_immut=no]))
-  AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
-  if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
-	  AC_DEFINE(HAVE_STAT_FLAGS, 1,
-		[Define to 1 if struct stat has st_flags])
-  fi
-fi
-dnl
-dnl Check for the presence of SA_LEN
-dnl
-AC_CHECK_MEMBER(struct sockaddr.sa_len,
-		AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,
-			[Define to 1 if if struct sockaddr contains sa_len]),,
-	[#include <sys/types.h>
-	 #include <sys/socket.h>])
-dnl
-dnl This will add -lblkid to the AC_CHECK_FUNCS search if we are using
-dnl the system-provided blkid library
-dnl
-if test -n "$BLKID_CMT"; then
-  AC_SEARCH_LIBS([blkid_probe_all], [blkid])
-fi
-dnl
-AC_CHECK_FUNCS(m4_flatten([
-	__secure_getenv
-	backtrace
-	blkid_probe_get_topology
-	chflags
-	fallocate
-	fallocate64
-	fchown
-	fdatasync
-	fstat64
-	ftruncate64
-	getdtablesize
-	getmntinfo
-	getpwuid_r
-	getrlimit
-	getrusage
-	jrand48
-	llseek
-	lseek64
-	mallinfo
-	mbstowcs
-	memalign
-	mmap
-	msync
-	nanosleep
-	open64
-	pathconf
-	posix_fadvise
-	posix_memalign
-	prctl
-	secure_getenv
-	setmntent
-	setresgid
-	setresuid
-	srandom
-	strcasecmp
-	strdup
-	strnlen
-	strptime
-	strtoull
-	sync_file_range
-	sysconf
-	usleep
-	utime
-	valloc
-]))
-dnl
-dnl Check to see if -lsocket is required (solaris) to make something
-dnl that uses socket() to compile; this is needed for the UUID library
-dnl
-SOCKET_LIB=''
-AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
-AC_SUBST(SOCKET_LIB)
-dnl
-dnl See if optreset exists
-dnl
-AC_MSG_CHECKING(for optreset)
-AC_CACHE_VAL(ac_cv_have_optreset,
-[AC_EGREP_HEADER(optreset, unistd.h,
-  ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
-AC_MSG_RESULT($ac_cv_have_optreset)
-if test $ac_cv_have_optreset = yes; then
-  AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if optreset for getopt is present])
-fi
-dnl
-dnl Test for sem_init, and which library it might require:
-dnl
-AH_TEMPLATE([HAVE_SEM_INIT], [Define to 1 if sem_init() exists])
-SEM_INIT_LIB=''
-AC_CHECK_FUNC(sem_init, ,
-  AC_CHECK_LIB(pthread, sem_init,
-  	AC_DEFINE(HAVE_SEM_INIT, 1)
-  	SEM_INIT_LIB=-lpthread,
-  AC_CHECK_LIB(rt, sem_init,
-  	AC_DEFINE(HAVE_SEM_INIT, 1)
-  	SEM_INIT_LIB=-lrt,
-  AC_CHECK_LIB(posix4, sem_init,
-  	AC_DEFINE(HAVE_SEM_INIT, 1)
-  	SEM_INIT_LIB=-lposix4))))dnl
-AC_SUBST(SEM_INIT_LIB)
-dnl
-dnl Check for unified diff
-dnl
-AC_MSG_CHECKING(for unified diff option)
-if diff -u $0 $0 > /dev/null 2>&1 ; then
-   UNI_DIFF_OPTS=-u
-else
-   UNI_DIFF_OPTS=-c
-fi
-AC_MSG_RESULT($UNI_DIFF_OPTS)
-AC_SUBST(UNI_DIFF_OPTS)
-dnl
-dnl We use the EXT2 ioctls only under Linux
-dnl
-case "$host_os" in
-linux*)
-	AC_DEFINE(HAVE_EXT2_IOCTLS, 1, [Define to 1 if Ext2 ioctls present])
-	;;
-esac
-dnl
-dnl OS-specific uncomment control
-dnl
-LINUX_CMT="#"
-CYGWIN_CMT="#"
-UNIX_CMT=
-case "$host_os" in
-linux*)
-	LINUX_CMT=
-	;;
-cygwin)
-	CYGWIN_CMT=
-	UNIX_CMT="#"
-	;;
-esac
-AC_SUBST(LINUX_CMT)
-AC_SUBST(CYGWIN_CMT)
-AC_SUBST(UNIX_CMT)
-dnl
-dnl Linux and Hurd places root files in the / by default
-dnl
-case "$host_os" in
-linux* | gnu* | k*bsd*-gnu)
-	if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
-		root_prefix="";
-		AC_MSG_RESULT([On $host_os systems, root_prefix defaults to ''])
-	fi
-	;;
-esac
-dnl
-dnl On Linux/hurd, force the prefix to be /usr
-dnl
-case "$host_os" in
-linux* | gnu* | k*bsd*-gnu)
-	if test "$prefix" = NONE ; then
-		prefix="/usr";
-		AC_MSG_RESULT([On $host_os systems, prefix defaults to /usr])
-		if test "$mandir" = '${prefix}/man' ; then
-			AC_MSG_RESULT([...and mandir defaults to /usr/share/man])
-			mandir=/usr/share/man
-		fi
-	fi
-;;
-esac
-if test "$root_prefix" = NONE ; then
-	if test "$prefix" = NONE ; then
-		root_prefix="$ac_default_prefix"
-	else
-		root_prefix="$prefix"
-	fi
-	root_bindir=$bindir
-	root_sbindir=$sbindir
-	root_libdir=$libdir
-	root_sysconfdir=$sysconfdir
-else
-	root_bindir='${root_prefix}/bin'
-	root_sbindir='${root_prefix}/sbin'
-	root_libdir='${root_prefix}/lib'
-	root_sysconfdir='${root_prefix}/etc'
-fi
-if test "$bindir" != '${exec_prefix}/bin'; then
-    root_bindir=$bindir
-    AC_MSG_RESULT([Setting root_bindir to $root_bindir])
-fi
-if test "$sbindir" != '${exec_prefix}/sbin'; then
-    root_sbindir=$sbindir
-    AC_MSG_RESULT([Setting root_sbindir to $root_sbindir])
-fi
-if test "$libdir" != '${exec_prefix}/lib'; then
-    root_libdir=$libdir
-    AC_MSG_RESULT([Setting root_libdir to $root_libdir])
-fi
-if test "$sysconfdir" != '${prefix}/etc'; then
-    root_sysconfdir=$sysconfdir
-    AC_MSG_RESULT([Setting root_sysconfdir to $root_sysconfdir])
-fi
-AC_SUBST(root_prefix)
-AC_SUBST(root_bindir)
-AC_SUBST(root_sbindir)
-AC_SUBST(root_libdir)
-AC_SUBST(root_sysconfdir)
-dnl
-dnl Allow specification of the multiarch arch
-dnl
-AC_ARG_WITH([multiarch],
-[  --with-multiarch=ARCH specify the multiarch triplet],
-libdir=$libdir/$withval
-root_libdir=$root_libdir/$withval
-)dnl
-dnl
-dnl See if -static works.  This could fail if the linker does not
-dnl support -static, or if required external libraries are not available
-dnl in static form.
-dnl
-AC_MSG_CHECKING([whether we can link with -static])
-AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
-[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
-AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
- ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
-LDFLAGS=$SAVE_LDFLAGS])
-dnl
-dnl Regardless of how the test turns out, Solaris doesn't handle -static
-dnl This is caused by the socket library requiring the nsl library, which
-dnl requires the -dl library, which only works for dynamically linked 
-dnl programs.  It basically means you can't have statically linked programs
-dnl which use the network under Solaris.  
-dnl
-case "$host_os" in
-solaris2.*)
-	ac_cv_e2fsprogs_use_static=no	
-;;
-esac
-AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
-LDFLAG_STATIC=
-if test $ac_cv_e2fsprogs_use_static = yes; then
-	LDFLAG_STATIC=-static
-fi
-AC_SUBST(LDFLAG_STATIC)
-dnl
-dnl Work around mysterious Darwin / GNU libintl problem
-dnl (__asm__ redirection doesn't work for some mysterious reason.  Looks like
-dnl Apple hacked gcc somehow?)
-dnl
-case "$host_os" in
-darwin*)
-	AC_MSG_RESULT([Using Apple Darwin / GNU libintl workaround])
-	AC_DEFINE(_INTL_REDIRECT_MACROS, 1,
-		[Define to 1 if Apple Darwin libintl workaround is needed])
-	;;
-esac
-dnl
-dnl Make the ss and et directories work correctly.
-dnl
-SS_DIR=`cd ${srcdir}/lib/ss; pwd`
-ET_DIR=`cd ${srcdir}/lib/et; pwd`
-AC_SUBST(SS_DIR)
-AC_SUBST(ET_DIR)
-dnl
-dnl Only try to run the test suite if we're not cross compiling.
-dnl
-if test "$cross_compiling" = yes ; then
-  DO_TEST_SUITE=
-else
-  DO_TEST_SUITE=check
-fi
-AC_SUBST(DO_TEST_SUITE)
-dnl
-dnl Only include the intl include files if we're building with them
-dnl
-INCLUDES='-I. -I$(top_builddir)/lib -I$(top_srcdir)/lib'
-if test -n "$CPPFLAGS" ; then
-	INCLUDES="$INCLUDES $CPPFLAGS"
-fi
-if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
-	INCLUDES=$INCLUDES' -I$(top_builddir)/intl -I$(top_srcdir)/intl'
-fi
-AC_SUBST(INCLUDES)
-dnl
-dnl Build CFLAGS
-dnl
-if test $cross_compiling = no; then
-   BUILD_CFLAGS="$CFLAGS $CPPFLAGS"
-   BUILD_LDFLAGS="$LDFLAGS"
-else
-   BUILD_CFLAGS=
-   BUILD_LDFLAGS=
-fi
-AC_SUBST(BUILD_CFLAGS)
-AC_SUBST(BUILD_LDFLAGS)
-dnl
-dnl Make our output files, being sure that we create the some miscellaneous 
-dnl directories
-dnl
-test -d lib || mkdir lib
-test -d include || mkdir include
-test -d include/linux || mkdir include/linux
-test -d include/asm || mkdir include/asm
-for i in MCONFIG Makefile e2fsprogs.spec \
-	util/Makefile util/subst.conf util/gen-tarball util/install-symlink \
-	lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
-	lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
-	lib/uuid/Makefile lib/uuid/uuid_types.h \
-	lib/blkid/Makefile lib/blkid/blkid_types.h lib/quota/Makefile \
-	lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
-	lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
-	misc/Makefile ext2ed/Makefile e2fsck/Makefile \
-	debugfs/Makefile tests/Makefile tests/progs/Makefile \
-	resize/Makefile doc/Makefile intl/Makefile \
-	intl/libgnuintl.h po/Makefile.in ; do
-	if test -d `dirname ${srcdir}/$i` ; then
-		outlist="$outlist $i"
-	fi
-done
-AC_OUTPUT($outlist)
-if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi
diff --git a/contrib/Android.bp b/contrib/Android.bp
new file mode 100644
index 0000000..8bde657
--- /dev/null
+++ b/contrib/Android.bp
@@ -0,0 +1,19 @@
+// Copyright 2017 The Android Open Source Project
+
+subdirs = ["android"]
+
+//########################################################################
+// Build add_ext4_encrypt
+
+cc_binary {
+    name: "add_ext4_encrypt",
+    host_supported: true,
+    defaults: ["e2fsprogs-defaults"],
+
+    srcs: ["add_ext4_encrypt.c"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_com_err",
+    ],
+    system_shared_libs: ["libc", "libdl"],
+}
diff --git a/contrib/add_ext4_encrypt.c b/contrib/add_ext4_encrypt.c
new file mode 100644
index 0000000..133fe25
--- /dev/null
+++ b/contrib/add_ext4_encrypt.c
@@ -0,0 +1,64 @@
+/*
+ * Basic program to add ext4 encryption to a file system
+ *
+ * Copyright 2015, Google, Inc.
+ *
+ * %Begin-Header%
+ * This file may be redistributed under the terms of the GNU Public
+ * License.
+ * %End-Header%
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/time.h>
+
+#include <ext2fs/ext2_fs.h>
+#include <ext2fs/ext2fs.h>
+
+int main (int argc, char *argv[])
+{
+	errcode_t	retval = 0;
+	ext2_filsys	fs;
+
+	setbuf(stdout, NULL);
+	setbuf(stderr, NULL);
+	initialize_ext2_error_table();
+
+	if (argc != 2) {
+		fprintf(stderr, "%s: Usage <device|filesystem>\n", argv[0]);
+		exit(1);
+	}
+
+	retval = ext2fs_open(argv[1], EXT2_FLAG_RW, 0, 0,
+			     unix_io_manager, &fs);
+
+	if (retval) {
+		com_err(argv[0], retval, "while trying to open '%s'",
+			argv[1]);
+		exit(1);
+	}
+	if (!ext2fs_has_feature_encrypt(fs->super)) {
+		ext2fs_set_feature_encrypt(fs->super);
+		fs->super->s_encrypt_algos[0] =
+			EXT4_ENCRYPTION_MODE_AES_256_XTS;
+		fs->super->s_encrypt_algos[1] =
+			EXT4_ENCRYPTION_MODE_AES_256_CTS;
+		ext2fs_mark_super_dirty(fs);
+		printf("Ext4 encryption enabled on %s\n", argv[1]);
+	} else
+		printf("Ext4 encryption already enabled on %s\n", argv[1]);
+
+	retval = ext2fs_close(fs);
+	if (retval) {
+		com_err(argv[0], retval, "while trying to close '%s'",
+			argv[1]);
+		exit(1);
+	}
+	return (0);
+}
+
diff --git a/contrib/android/Android.bp b/contrib/android/Android.bp
new file mode 100644
index 0000000..b1fd0da
--- /dev/null
+++ b/contrib/android/Android.bp
@@ -0,0 +1,69 @@
+// Copyright 2017 The Android Open Source Project
+
+//##########################################################################
+// Build e2fsdroid
+
+cc_binary {
+    name: "e2fsdroid",
+    host_supported: true,
+    recovery_available: true,
+    defaults: ["e2fsprogs-defaults"],
+
+    srcs: [
+        "e2fsdroid.c",
+        "block_range.c",
+        "fsmap.c",
+        "block_list.c",
+        "base_fs.c",
+        "perms.c",
+        "basefs_allocator.c",
+    ],
+    target: {
+        host: {
+            static_libs: [
+                "libext2_com_err",
+                "libext2_misc",
+                "libext2fs",
+                "libsparse",
+                "libz",
+                "libcutils",
+                "libbase",
+                "libselinux",
+                "libcrypto",
+                "liblog",
+            ],
+            sanitize: {
+                address: false,  // http://b/68387795 - heap overflow in e2fsdroid
+            },
+        },
+        android: {
+            shared_libs: [
+                "libext2fs",
+                "libext2_com_err",
+                "libext2_misc",
+                "libcutils",
+                "libbase",
+                "libselinux",
+                "libcrypto",
+            ],
+        },
+    },
+    stl: "libc++_static",
+}
+
+//##########################################################################
+// Build ext2simg
+
+cc_binary {
+    name: "ext2simg",
+    host_supported: true,
+    defaults: ["e2fsprogs-defaults"],
+
+    srcs: ["ext2simg.c"],
+    shared_libs: [
+        "libext2fs",
+        "libext2_com_err",
+        "libsparse",
+        "libz",
+    ],
+}
diff --git a/contrib/android/base_fs.c b/contrib/android/base_fs.c
new file mode 100644
index 0000000..652317e
--- /dev/null
+++ b/contrib/android/base_fs.c
@@ -0,0 +1,205 @@
+#include "base_fs.h"
+#include <stdio.h>
+
+#define BASE_FS_VERSION "Base EXT4 version 1.0"
+
+struct base_fs {
+	FILE *file;
+	const char *mountpoint;
+	struct basefs_entry entry;
+};
+
+static FILE *basefs_open(const char *file)
+{
+	char *line = NULL;
+	size_t len;
+	FILE *f = fopen(file, "r");
+	if (!f)
+		return NULL;
+
+	if (getline(&line, &len, f) == -1 || !line)
+		goto err_getline;
+
+	if (strncmp(line, BASE_FS_VERSION, strlen(BASE_FS_VERSION)))
+		goto err_header;
+
+	free(line);
+	return f;
+
+err_header:
+	free(line);
+err_getline:
+	fclose(f);
+	return NULL;
+}
+
+static struct basefs_entry *basefs_readline(FILE *f, const char *mountpoint,
+					    int *err)
+{
+	char *line = NULL, *saveptr1, *saveptr2, *block_range, *block;
+	int offset;
+	size_t len;
+	struct basefs_entry *entry = NULL;
+	blk64_t range_start, range_end;
+
+	if (getline(&line, &len, f) == -1) {
+		if (feof(f))
+			goto end;
+		goto err_getline;
+	}
+
+	entry = calloc(1, sizeof(*entry));
+	if (!entry)
+		goto err_alloc;
+
+	/*
+	 * With BASEFS version 1.0, a typical line looks like this:
+	 * /bin/mke2fs 5000-5004,8000,9000-9990
+	 */
+	if (sscanf(line, "%ms%n", &entry->path, &offset) != 1)
+		goto err_sscanf;
+	len = strlen(mountpoint);
+	memmove(entry->path, entry->path + len, strlen(entry->path) - len + 1);
+
+	while (line[offset] == ' ')
+		++offset;
+
+	block_range = strtok_r(line + offset, ",\n", &saveptr1);
+	while (block_range) {
+		block = strtok_r(block_range, "-", &saveptr2);
+		if (!block)
+			break;
+		range_start = atoll(block);
+		block = strtok_r(NULL, "-", &saveptr2);
+		range_end = block ? atoll(block) : range_start;
+		add_blocks_to_range(&entry->blocks, range_start, range_end);
+		block_range = strtok_r(NULL, ",\n", &saveptr1);
+	}
+end:
+	*err = 0;
+	free(line);
+	return entry;
+
+err_sscanf:
+	free(entry);
+err_alloc:
+	free(line);
+err_getline:
+	*err = 1;
+	return NULL;
+}
+
+static void free_base_fs_entry(void *e)
+{
+	struct basefs_entry *entry = e;
+	if (entry) {
+		free(entry->path);
+		free(entry);
+	}
+}
+
+struct ext2fs_hashmap *basefs_parse(const char *file, const char *mountpoint)
+{
+	int err;
+	struct ext2fs_hashmap *entries = NULL;
+	struct basefs_entry *entry;
+	FILE *f = basefs_open(file);
+	if (!f)
+		return NULL;
+	entries = ext2fs_hashmap_create(ext2fs_djb2_hash, free_base_fs_entry, 1024);
+	if (!entries)
+		goto end;
+
+	while ((entry = basefs_readline(f, mountpoint, &err)))
+		ext2fs_hashmap_add(entries, entry, entry->path,
+				   strlen(entry->path));
+
+	if (err) {
+		fclose(f);
+		ext2fs_hashmap_free(entries);
+		return NULL;
+	}
+end:
+	fclose(f);
+	return entries;
+}
+
+static void *init(const char *file, const char *mountpoint)
+{
+	struct base_fs *params = malloc(sizeof(*params));
+
+	if (!params)
+		return NULL;
+	params->mountpoint = mountpoint;
+	params->file = fopen(file, "w+");
+	if (!params->file) {
+		free(params);
+		return NULL;
+	}
+	if (fwrite(BASE_FS_VERSION"\n", 1, strlen(BASE_FS_VERSION"\n"),
+		   params->file) != strlen(BASE_FS_VERSION"\n")) {
+		fclose(params->file);
+		free(params);
+		return NULL;
+	}
+	return params;
+}
+
+static int start_new_file(char *path, ext2_ino_t ino EXT2FS_ATTR((unused)),
+			  struct ext2_inode *inode, void *data)
+{
+	struct base_fs *params = data;
+
+	params->entry.path = LINUX_S_ISREG(inode->i_mode) ? path : NULL;
+	return 0;
+}
+
+static int add_block(ext2_filsys fs EXT2FS_ATTR((unused)), blk64_t blocknr,
+		     int metadata, void *data)
+{
+	struct base_fs *params = data;
+
+	if (params->entry.path && !metadata)
+		add_blocks_to_range(&params->entry.blocks, blocknr, blocknr);
+	return 0;
+}
+
+static int inline_data(void *inline_data EXT2FS_ATTR((unused)),
+		       void *data EXT2FS_ATTR((unused)))
+{
+	return 0;
+}
+
+static int end_new_file(void *data)
+{
+	struct base_fs *params = data;
+
+	if (!params->entry.path)
+		return 0;
+	if (fprintf(params->file, "%s%s ", params->mountpoint,
+		    params->entry.path) < 0
+	    || write_block_ranges(params->file, params->entry.blocks.head, ",")
+	    || fwrite("\n", 1, 1, params->file) != 1)
+		return -1;
+
+	delete_block_ranges(&params->entry.blocks);
+	return 0;
+}
+
+static int cleanup(void *data)
+{
+	struct base_fs *params = data;
+
+	fclose(params->file);
+	free(params);
+	return 0;
+}
+
+struct fsmap_format base_fs_format = {
+	.init = init,
+	.start_new_file = start_new_file,
+	.add_block = add_block,
+	.inline_data = inline_data,
+	.end_new_file = end_new_file,
+	.cleanup = cleanup,
+};
diff --git a/contrib/android/base_fs.h b/contrib/android/base_fs.h
new file mode 100644
index 0000000..f53f1ed
--- /dev/null
+++ b/contrib/android/base_fs.h
@@ -0,0 +1,17 @@
+#ifndef BASE_FS_H
+# define BASE_FS_H
+
+# include "fsmap.h"
+# include "hashmap.h"
+# include "block_range.h"
+
+struct basefs_entry {
+	char *path;
+	struct block_range_list blocks;
+};
+
+extern struct fsmap_format base_fs_format;
+
+struct ext2fs_hashmap *basefs_parse(const char *file, const char *mountpoint);
+
+#endif /* !BASE_FS_H */
diff --git a/contrib/android/basefs_allocator.c b/contrib/android/basefs_allocator.c
new file mode 100644
index 0000000..5c92ddc
--- /dev/null
+++ b/contrib/android/basefs_allocator.c
@@ -0,0 +1,367 @@
+#include <limits.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include "basefs_allocator.h"
+#include "block_range.h"
+#include "hashmap.h"
+#include "base_fs.h"
+
+struct base_fs_allocator {
+	struct ext2fs_hashmap *entries;
+	struct basefs_entry *cur_entry;
+	/* The next expected logical block to allocate for cur_entry. */
+	blk64_t next_lblk;
+	/* Blocks which are definitely owned by a single inode in BaseFS. */
+	ext2fs_block_bitmap exclusive_block_map;
+	/* Blocks which are available to the first inode that requests it. */
+	ext2fs_block_bitmap dedup_block_map;
+};
+
+static errcode_t basefs_block_allocator(ext2_filsys, blk64_t, blk64_t *,
+					struct blk_alloc_ctx *ctx);
+
+/*
+ * Free any reserved, but unconsumed block ranges in the allocator. This both
+ * frees the block_range_list data structure and unreserves exclusive blocks
+ * from the block map.
+ */
+static void fs_free_blocks_range(ext2_filsys fs,
+				 struct base_fs_allocator *allocator,
+				 struct block_range_list *list)
+{
+	ext2fs_block_bitmap exclusive_map = allocator->exclusive_block_map;
+
+	blk64_t block;
+	while (list->head) {
+		block = consume_next_block(list);
+		if (ext2fs_test_block_bitmap2(exclusive_map, block)) {
+			ext2fs_unmark_block_bitmap2(fs->block_map, block);
+			ext2fs_unmark_block_bitmap2(exclusive_map, block);
+		}
+	}
+}
+
+/*
+ * Free any blocks in the bitmap that were reserved but never used. This is
+ * needed to free dedup_block_map and ensure the free block bitmap is
+ * internally consistent.
+ */
+static void fs_free_blocks_bitmap(ext2_filsys fs, ext2fs_block_bitmap bitmap)
+{
+	blk64_t block = 0;
+	blk64_t start = fs->super->s_first_data_block;
+	blk64_t end = ext2fs_blocks_count(fs->super) - 1;
+	errcode_t retval;
+
+	for (;;) {
+		retval = ext2fs_find_first_set_block_bitmap2(bitmap, start, end,
+			&block);
+		if (retval)
+			break;
+		ext2fs_unmark_block_bitmap2(fs->block_map, block);
+		start = block + 1;
+	}
+}
+
+static void basefs_allocator_free(ext2_filsys fs,
+				  struct base_fs_allocator *allocator)
+{
+	struct basefs_entry *e;
+	struct ext2fs_hashmap_entry *it = NULL;
+	struct ext2fs_hashmap *entries = allocator->entries;
+
+	if (entries) {
+		while ((e = ext2fs_hashmap_iter_in_order(entries, &it))) {
+			fs_free_blocks_range(fs, allocator, &e->blocks);
+			delete_block_ranges(&e->blocks);
+		}
+		ext2fs_hashmap_free(entries);
+	}
+	fs_free_blocks_bitmap(fs, allocator->dedup_block_map);
+	ext2fs_free_block_bitmap(allocator->exclusive_block_map);
+	ext2fs_free_block_bitmap(allocator->dedup_block_map);
+	free(allocator);
+}
+
+/*
+ * Build a bitmap of which blocks are definitely owned by exactly one file in
+ * Base FS. Blocks which are not valid or are de-duplicated are skipped. This
+ * is called during allocator initialization, to ensure that libext2fs does
+ * not allocate which we want to re-use.
+ *
+ * If a block was allocated in the initial filesystem, it can never be re-used,
+ * so it will appear in neither the exclusive or dedup set. If a block is used
+ * by multiple files, it will be removed from the owned set and instead added
+ * to the dedup set.
+ *
+ * The dedup set is not removed from fs->block_map. This allows us to re-use
+ * dedup blocks separately and not have them be allocated outside of file data.
+ */
+static void fs_reserve_block(ext2_filsys fs,
+			     struct base_fs_allocator *allocator,
+			     blk64_t block)
+{
+	ext2fs_block_bitmap exclusive_map = allocator->exclusive_block_map;
+	ext2fs_block_bitmap dedup_map = allocator->dedup_block_map;
+
+	if (block >= ext2fs_blocks_count(fs->super))
+		return;
+
+	if (ext2fs_test_block_bitmap2(fs->block_map, block)) {
+		if (!ext2fs_test_block_bitmap2(exclusive_map, block))
+			return;
+		ext2fs_unmark_block_bitmap2(exclusive_map, block);
+		ext2fs_mark_block_bitmap2(dedup_map, block);
+	} else {
+		ext2fs_mark_block_bitmap2(fs->block_map, block);
+		ext2fs_mark_block_bitmap2(exclusive_map, block);
+	}
+}
+
+static void fs_reserve_blocks_range(ext2_filsys fs,
+				    struct base_fs_allocator *allocator,
+				    struct block_range_list *list)
+{
+	blk64_t block;
+	struct block_range *blocks = list->head;
+
+	while (blocks) {
+		for (block = blocks->start; block <= blocks->end; block++)
+			fs_reserve_block(fs, allocator, block);
+		blocks = blocks->next;
+	}
+}
+
+/*
+ * For each file in the base FS map, ensure that its blocks are reserved in
+ * the actual block map. This prevents libext2fs from allocating them for
+ * general purpose use, and ensures that if the file needs data blocks, they
+ * can be re-acquired exclusively for that file.
+ *
+ * If a file in the base map is missing, or not a regular file in the new
+ * filesystem, then it's skipped to ensure that its blocks are reusable.
+ */
+static errcode_t fs_reserve_blocks(ext2_filsys fs,
+			      struct base_fs_allocator *allocator,
+			      const char *src_dir)
+{
+	int nbytes;
+	char full_path[PATH_MAX];
+	const char *sep = "/";
+	struct stat st;
+	struct basefs_entry *e;
+	struct ext2fs_hashmap_entry *it = NULL;
+	struct ext2fs_hashmap *entries = allocator->entries;
+
+	if (strlen(src_dir) && src_dir[strlen(src_dir) - 1] == '/')
+		sep = "";
+
+	while ((e = ext2fs_hashmap_iter_in_order(entries, &it))) {
+		nbytes = snprintf(full_path, sizeof(full_path), "%s%s%s",
+			src_dir, sep, e->path);
+		if (nbytes >= sizeof(full_path))
+			return ENAMETOOLONG;
+		if (lstat(full_path, &st) || !S_ISREG(st.st_mode))
+			continue;
+		fs_reserve_blocks_range(fs, allocator, &e->blocks);
+	}
+	return 0;
+}
+
+errcode_t base_fs_alloc_load(ext2_filsys fs, const char *file,
+			     const char *mountpoint, const char *src_dir)
+{
+	errcode_t retval = 0;
+	struct base_fs_allocator *allocator;
+
+	allocator = calloc(1, sizeof(*allocator));
+	if (!allocator) {
+		retval = ENOMEM;
+		goto out;
+	}
+
+	retval = ext2fs_read_bitmaps(fs);
+	if (retval)
+		goto err_load;
+
+	allocator->cur_entry = NULL;
+	allocator->entries = basefs_parse(file, mountpoint);
+	if (!allocator->entries) {
+		retval = EIO;
+		goto err_load;
+	}
+	retval = ext2fs_allocate_block_bitmap(fs, "exclusive map",
+		&allocator->exclusive_block_map);
+	if (retval)
+		goto err_load;
+	retval = ext2fs_allocate_block_bitmap(fs, "dedup map",
+		&allocator->dedup_block_map);
+	if (retval)
+		goto err_load;
+
+	retval = fs_reserve_blocks(fs, allocator, src_dir);
+	if (retval)
+		goto err_load;
+
+	/* Override the default allocator */
+	fs->get_alloc_block2 = basefs_block_allocator;
+	fs->priv_data = allocator;
+
+	goto out;
+
+err_load:
+	basefs_allocator_free(fs, allocator);
+out:
+	return retval;
+}
+
+/* Try and acquire the next usable block from the Base FS map. */
+static errcode_t get_next_block(ext2_filsys fs, struct base_fs_allocator *allocator,
+				struct block_range_list* list, blk64_t *ret)
+{
+	blk64_t block;
+	ext2fs_block_bitmap exclusive_map = allocator->exclusive_block_map;
+	ext2fs_block_bitmap dedup_map = allocator->dedup_block_map;
+
+	if (!list->head)
+		return EXT2_ET_BLOCK_ALLOC_FAIL;
+
+	block = consume_next_block(list);
+	if (block >= ext2fs_blocks_count(fs->super))
+		return EXT2_ET_BLOCK_ALLOC_FAIL;
+	if (ext2fs_test_block_bitmap2(exclusive_map, block)) {
+		ext2fs_unmark_block_bitmap2(exclusive_map, block);
+		*ret = block;
+		return 0;
+	}
+	if (ext2fs_test_block_bitmap2(dedup_map, block)) {
+		ext2fs_unmark_block_bitmap2(dedup_map, block);
+		*ret = block;
+		return 0;
+	}
+	return EXT2_ET_BLOCK_ALLOC_FAIL;
+}
+
+/*
+ * BaseFS lists blocks in logical block order. However, the allocator hook is
+ * only called if a block needs to be allocated. In the case of a deduplicated
+ * block, or a hole, the hook is not invoked. This means the next block
+ * allocation request will be out of sequence. For example, consider if BaseFS
+ * specifies the following (0 being a hole):
+ *     1 2 3 0 4 5
+ *
+ * If the new file has a hole at logical block 0, we could accidentally
+ * shift the entire expected block list as follows:
+ *     0 1 2 0 3 4
+ *
+ * To account for this, we track the next expected logical block in the
+ * allocator. If the current request is for a later logical block, we skip and
+ * free the intermediate physical blocks that would have been allocated. This
+ * ensures the original block assignment is respected.
+ */
+static void skip_blocks(ext2_filsys fs, struct base_fs_allocator *allocator,
+			struct blk_alloc_ctx *ctx)
+{
+	blk64_t block;
+	struct block_range_list *list = &allocator->cur_entry->blocks;
+	ext2fs_block_bitmap exclusive_map = allocator->exclusive_block_map;
+
+	while (list->head && allocator->next_lblk < ctx->lblk) {
+		block = consume_next_block(list);
+		if (block >= ext2fs_blocks_count(fs->super))
+			continue;
+		if (ext2fs_test_block_bitmap2(exclusive_map, block)) {
+			ext2fs_unmark_block_bitmap2(exclusive_map, block);
+			ext2fs_unmark_block_bitmap2(fs->block_map, block);
+		}
+		allocator->next_lblk++;
+	}
+}
+
+static errcode_t basefs_block_allocator(ext2_filsys fs, blk64_t goal,
+					blk64_t *ret, struct blk_alloc_ctx *ctx)
+{
+	errcode_t retval;
+	struct base_fs_allocator *allocator = fs->priv_data;
+	struct basefs_entry *e = allocator->cur_entry;
+	ext2fs_block_bitmap dedup_map = allocator->dedup_block_map;
+
+	if (e && ctx && (ctx->flags & BLOCK_ALLOC_DATA)) {
+		if (allocator->next_lblk < ctx->lblk)
+			skip_blocks(fs, allocator, ctx);
+		allocator->next_lblk = ctx->lblk + 1;
+
+		if (!get_next_block(fs, allocator, &e->blocks, ret))
+			return 0;
+	}
+
+	retval = ext2fs_new_block2(fs, goal, fs->block_map, ret);
+	if (!retval) {
+		ext2fs_mark_block_bitmap2(fs->block_map, *ret);
+		return 0;
+	}
+	if (retval != EXT2_ET_BLOCK_ALLOC_FAIL)
+		return retval;
+
+	/* Try to steal a block from the dedup pool. */
+	retval = ext2fs_find_first_set_block_bitmap2(dedup_map,
+		fs->super->s_first_data_block,
+		ext2fs_blocks_count(fs->super) - 1, ret);
+	if (!retval) {
+		ext2fs_unmark_block_bitmap2(dedup_map, *ret);
+		return 0;
+	}
+
+	/*
+	 * As a last resort, take any block from our file's list. This
+	 * risks bloating the diff, but means we are more likely to
+	 * successfully build an image.
+	 */
+	while (e->blocks.head) {
+		if (!get_next_block(fs, allocator, &e->blocks, ret))
+			return 0;
+	}
+	return EXT2_ET_BLOCK_ALLOC_FAIL;
+}
+
+void base_fs_alloc_cleanup(ext2_filsys fs)
+{
+	basefs_allocator_free(fs, fs->priv_data);
+	fs->priv_data = NULL;
+	fs->get_alloc_block2 = NULL;
+}
+
+errcode_t base_fs_alloc_set_target(ext2_filsys fs, const char *target_path,
+	const char *name EXT2FS_ATTR((unused)),
+	ext2_ino_t parent_ino EXT2FS_ATTR((unused)),
+	ext2_ino_t root EXT2FS_ATTR((unused)), mode_t mode)
+{
+	struct base_fs_allocator *allocator = fs->priv_data;
+
+	if (mode != S_IFREG)
+		return 0;
+
+	if (allocator) {
+		allocator->cur_entry = ext2fs_hashmap_lookup(allocator->entries,
+						      target_path,
+						      strlen(target_path));
+		allocator->next_lblk = 0;
+	}
+	return 0;
+}
+
+errcode_t base_fs_alloc_unset_target(ext2_filsys fs,
+        const char *target_path EXT2FS_ATTR((unused)),
+	const char *name EXT2FS_ATTR((unused)),
+	ext2_ino_t parent_ino EXT2FS_ATTR((unused)),
+	ext2_ino_t root EXT2FS_ATTR((unused)), mode_t mode)
+{
+	struct base_fs_allocator *allocator = fs->priv_data;
+
+	if (!allocator || !allocator->cur_entry || mode != S_IFREG)
+		return 0;
+
+	fs_free_blocks_range(fs, allocator, &allocator->cur_entry->blocks);
+	delete_block_ranges(&allocator->cur_entry->blocks);
+	return 0;
+}
diff --git a/contrib/android/basefs_allocator.h b/contrib/android/basefs_allocator.h
new file mode 100644
index 0000000..6d1c65e
--- /dev/null
+++ b/contrib/android/basefs_allocator.h
@@ -0,0 +1,16 @@
+#ifndef BASE_FS_ALLOCATOR_H
+# define BASE_FS_ALLOCATOR_H
+
+# include <time.h>
+# include <ext2fs/ext2fs.h>
+
+errcode_t base_fs_alloc_load(ext2_filsys fs, const char *file,
+			     const char *mountpoint, const char *src_dir);
+void base_fs_alloc_cleanup(ext2_filsys fs);
+
+errcode_t base_fs_alloc_set_target(ext2_filsys fs, const char *target_path,
+	const char *name, ext2_ino_t parent_ino, ext2_ino_t root, mode_t mode);
+errcode_t base_fs_alloc_unset_target(ext2_filsys fs, const char *target_path,
+	const char *name, ext2_ino_t parent_ino, ext2_ino_t root, mode_t mode);
+
+#endif /* !BASE_FS_ALLOCATOR_H */
diff --git a/contrib/android/block_list.c b/contrib/android/block_list.c
new file mode 100644
index 0000000..63cc1a2
--- /dev/null
+++ b/contrib/android/block_list.c
@@ -0,0 +1,89 @@
+#include "block_list.h"
+#include "block_range.h"
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+struct block_list {
+	FILE *f;
+	const char *mountpoint;
+
+	const char *filename;
+	struct block_range_list blocks;
+};
+
+static void *init(const char *file, const char *mountpoint)
+{
+	struct block_list *params = calloc(1, sizeof(*params));
+
+	if (!params)
+		return NULL;
+	params->mountpoint = mountpoint;
+	params->f = fopen(file, "w+");
+	if (!params->f) {
+		free(params);
+		return NULL;
+	}
+	return params;
+}
+
+static int start_new_file(char *path, ext2_ino_t ino EXT2FS_ATTR((unused)),
+			  struct ext2_inode *inode EXT2FS_ATTR((unused)),
+			  void *data)
+{
+	struct block_list *params = data;
+
+	params->filename = LINUX_S_ISREG(inode->i_mode) ? path : NULL;
+	return 0;
+}
+
+static int add_block(ext2_filsys fs EXT2FS_ATTR((unused)), blk64_t blocknr,
+		     int metadata, void *data)
+{
+	struct block_list *params = data;
+
+	if (params->filename && !metadata)
+		add_blocks_to_range(&params->blocks, blocknr, blocknr);
+	return 0;
+}
+
+static int inline_data(void *inline_data EXT2FS_ATTR((unused)),
+		       void *data EXT2FS_ATTR((unused)))
+{
+	return 0;
+}
+
+static int end_new_file(void *data)
+{
+	struct block_list *params = data;
+
+	if (!params->filename || !params->blocks.head)
+		return 0;
+	if (fprintf(params->f, "%s%s ", params->mountpoint,
+		    params->filename) < 0
+	    || write_block_ranges(params->f, params->blocks.head, " ")
+	    || fwrite("\n", 1, 1, params->f) != 1)
+		return -1;
+
+	delete_block_ranges(&params->blocks);
+	return 0;
+}
+
+static int cleanup(void *data)
+{
+	struct block_list *params = data;
+
+	fclose(params->f);
+	free(params);
+	return 0;
+}
+
+struct fsmap_format block_list_format = {
+	.init = init,
+	.start_new_file = start_new_file,
+	.add_block = add_block,
+	.inline_data = inline_data,
+	.end_new_file = end_new_file,
+	.cleanup = cleanup,
+};
diff --git a/contrib/android/block_list.h b/contrib/android/block_list.h
new file mode 100644
index 0000000..47041e4
--- /dev/null
+++ b/contrib/android/block_list.h
@@ -0,0 +1,8 @@
+#ifndef BLOCK_LIST_H
+# define BLOCK_LIST_H
+
+# include "fsmap.h"
+
+extern struct fsmap_format block_list_format;
+
+#endif /* !BLOCK_LIST_H */
diff --git a/contrib/android/block_range.c b/contrib/android/block_range.c
new file mode 100644
index 0000000..0a06882
--- /dev/null
+++ b/contrib/android/block_range.c
@@ -0,0 +1,80 @@
+#define _GNU_SOURCE
+
+#include "block_range.h"
+#include <stdio.h>
+
+struct block_range *new_block_range(blk64_t start, blk64_t end)
+{
+	struct block_range *range = malloc(sizeof(*range));
+	range->start = start;
+	range->end = end;
+	range->next = NULL;
+	return range;
+}
+
+void add_blocks_to_range(struct block_range_list *list, blk64_t blk_start,
+			 blk64_t blk_end)
+{
+	if (list->head == NULL)
+		list->head = list->tail = new_block_range(blk_start, blk_end);
+	else if (list->tail->end + 1 == blk_start)
+		list->tail->end += (blk_end - blk_start + 1);
+	else {
+		struct block_range *range = new_block_range(blk_start, blk_end);
+		list->tail->next = range;
+		list->tail = range;
+	}
+}
+
+static void remove_head(struct block_range_list *list)
+{
+	struct block_range *next_range = list->head->next;
+
+	free(list->head);
+	if (next_range == NULL)
+		list->head = list->tail = NULL;
+	else
+		list->head = next_range;
+}
+
+void delete_block_ranges(struct block_range_list *list)
+{
+	while (list->head)
+		remove_head(list);
+}
+
+int write_block_ranges(FILE *f, struct block_range *range,
+				     char *sep)
+{
+	int len;
+	char *buf;
+
+	while (range) {
+		if (range->start == range->end)
+			len = asprintf(&buf, "%llu%s", range->start, sep);
+		else
+			len = asprintf(&buf, "%llu-%llu%s", range->start,
+				       range->end, sep);
+		if (fwrite(buf, 1, len, f) != (size_t)len) {
+			free(buf);
+			return -1;
+		}
+		free(buf);
+		range = range->next;
+	}
+
+	len = strlen(sep);
+	if (fseek(f, -len, SEEK_CUR) == -len)
+		return -1;
+	return 0;
+}
+
+blk64_t consume_next_block(struct block_range_list *list)
+{
+	blk64_t ret = list->head->start;
+
+	list->head->start += 1;
+	if (list->head->start > list->head->end)
+		remove_head(list);
+	return ret;
+}
diff --git a/contrib/android/block_range.h b/contrib/android/block_range.h
new file mode 100644
index 0000000..cf7971e
--- /dev/null
+++ b/contrib/android/block_range.h
@@ -0,0 +1,29 @@
+#ifndef BLOCK_RANGE_H
+# define BLOCK_RANGE_H
+
+# include <sys/types.h>
+# include <ext2fs/ext2fs.h>
+
+struct block_range {
+	blk64_t start;
+	blk64_t end;
+	struct block_range *next;
+};
+
+struct block_range_list {
+	struct block_range *head;
+	struct block_range *tail;
+};
+
+void add_blocks_to_range(struct block_range_list *list, blk64_t blk_start,
+			 blk64_t blk_end);
+void delete_block_ranges(struct block_range_list *list);
+int write_block_ranges(FILE *f, struct block_range *range, char *sep);
+
+/*
+ * Given a non-empty range list, return the next block and remove it from the
+ * list.
+ */
+blk64_t consume_next_block(struct block_range_list *list);
+
+#endif /* !BLOCK_RANGE_H */
diff --git a/contrib/android/e2fsdroid.c b/contrib/android/e2fsdroid.c
new file mode 100644
index 0000000..f5d24b8
--- /dev/null
+++ b/contrib/android/e2fsdroid.c
@@ -0,0 +1,377 @@
+#define _GNU_SOURCE
+
+#include <stdio.h>
+#include <getopt.h>
+#include <string.h>
+#include <unistd.h>
+#include <limits.h>
+#include <ext2fs/ext2fs.h>
+
+#include "perms.h"
+#include "base_fs.h"
+#include "block_list.h"
+#include "basefs_allocator.h"
+#include "create_inode.h"
+
+#ifndef UID_GID_MAP_MAX_EXTENTS
+/*
+ * The value is defined in linux/user_namspace.h.
+ * The value is (arbitrarily) 5 in 4.14 and earlier, or 340 in 4.15 and later.
+ * Here, the bigger value is taken. See also man user_namespace(7).
+ */
+#define UID_GID_MAP_MAX_EXTENTS 340
+#endif
+
+static char *prog_name = "e2fsdroid";
+static char *in_file;
+static char *block_list;
+static char *basefs_out;
+static char *basefs_in;
+static char *mountpoint = "";
+static time_t fixed_time = -1;
+static char *fs_config_file;
+static struct selinux_opt seopt_file[8];
+static int max_nr_opt = (int)sizeof(seopt_file) / sizeof(seopt_file[0]);
+static char *product_out;
+static char *src_dir;
+static int android_configure;
+static int android_sparse_file = 1;
+
+static void usage(int ret)
+{
+	fprintf(stderr, "%s [-B block_list] [-D basefs_out] [-T timestamp]\n"
+			"\t[-C fs_config] [-S file_contexts] [-p product_out]\n"
+			"\t[-a mountpoint] [-d basefs_in] [-f src_dir] [-e] [-s]\n"
+			"\t[-u uid-mapping] [-g gid-mapping] image\n",
+                prog_name);
+	exit(ret);
+}
+
+static char *absolute_path(const char *file)
+{
+	char *ret;
+	char cwd[PATH_MAX];
+
+	if (file[0] != '/') {
+		if (getcwd(cwd, PATH_MAX) == NULL) {
+			fprintf(stderr, "Failed to getcwd\n");
+			exit(EXIT_FAILURE);
+		}
+		ret = malloc(strlen(cwd) + 1 + strlen(file) + 1);
+		if (ret)
+			sprintf(ret, "%s/%s", cwd, file);
+	} else
+		ret = strdup(file);
+	return ret;
+}
+
+static int parse_ugid_map_entry(char* line, struct ugid_map_entry* result)
+{
+	char *token, *token_saveptr;
+	size_t num_tokens;
+	unsigned int *parsed[] = {&result->child_id,
+				  &result->parent_id,
+				  &result->length};
+	for (token = strtok_r(line, " ", &token_saveptr), num_tokens = 0;
+	     token && num_tokens < 3;
+	     token = strtok_r(NULL, " ", &token_saveptr), ++num_tokens) {
+		char* endptr = NULL;
+		unsigned long t = strtoul(token, &endptr, 10);
+		if ((t == ULONG_MAX && errno) || (t > UINT_MAX) || *endptr) {
+			fprintf(stderr, "Malformed u/gid mapping line\n");
+			return 0;
+		}
+		*parsed[num_tokens] = (unsigned int) t;
+	}
+	if (num_tokens < 3 || strtok_r(NULL, " ", &token_saveptr) != NULL) {
+		fprintf(stderr, "Malformed u/gid mapping line\n");
+		return 0;
+	}
+	if (result->child_id + result->length < result->child_id ||
+	    result->parent_id + result->length < result->parent_id) {
+		fprintf(stderr, "u/gid mapping overflow\n");
+		return 0;
+	}
+	return 1;
+}
+
+/*
+ * Returns 1 if [begin1, begin1+length1) and [begin2, begin2+length2) have
+ * overlapping range. Otherwise 0.
+ */
+static int is_overlapping(unsigned int begin1, unsigned int length1,
+			  unsigned int begin2, unsigned int length2)
+{
+	unsigned int end1 = begin1 + length1;
+	unsigned int end2 = begin2 + length2;
+	return !(end1 <= begin2 || end2 <= begin1);
+}
+
+/*
+ * Verifies if the given mapping works.
+ * - Checks if the number of entries is less than or equals to
+ *   UID_GID_MAP_MAX_EXTENTS.
+ * - Checks if there is no overlapped ranges.
+ * Returns 1 if valid, otherwise 0.
+ */
+static int is_valid_ugid_map(const struct ugid_map* mapping)
+{
+	size_t i, j;
+
+	if (mapping->size > UID_GID_MAP_MAX_EXTENTS) {
+		fprintf(stderr, "too many u/gid mapping entries\n");
+		return 0;
+	}
+
+	for (i = 0; i < mapping->size; ++i) {
+		const struct ugid_map_entry *entry1 = &mapping->entries[i];
+		for (j = i + 1; j < mapping->size; ++j) {
+			const struct ugid_map_entry *entry2 =
+				&mapping->entries[j];
+			if (is_overlapping(entry1->child_id, entry1->length,
+					   entry2->child_id, entry2->length)) {
+				fprintf(stderr,
+					"Overlapping child u/gid: [%d %d %d],"
+					" [%d %d %d]\n",
+					entry1->child_id, entry1->parent_id,
+					entry1->length, entry2->child_id,
+					entry2->parent_id, entry2->length);
+				return 0;
+			}
+			if (is_overlapping(entry1->parent_id, entry1->length,
+					   entry2->parent_id, entry2->length)) {
+				fprintf(stderr,
+					"Overlapping parent u/gid: [%d %d %d],"
+					" [%d %d %d]\n",
+					entry1->child_id, entry1->parent_id,
+					entry1->length, entry2->child_id,
+					entry2->parent_id, entry2->length);
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
+/*
+ * Parses the UID/GID mapping argument. The argument could be a multi-line
+ * string (separated by '\n', no trailing '\n' is allowed). Each line must
+ * contain exact three integer tokens; the first token is |child_id|,
+ * the second is |parent_id|, and the last is |length| of the mapping range.
+ * See also user_namespace(7) man page.
+ * On success, the parsed entries are stored in |result|, and it returns 1.
+ * Otherwise, returns 0.
+ */
+static int parse_ugid_map(char* arg, struct ugid_map* result)
+{
+	int i;
+	char *line, *line_saveptr;
+	size_t current_index;
+
+	/* Count the number of lines. */
+	result->size = 1;
+	for (i = 0; arg[i]; ++i) {
+		if (arg[i] == '\n')
+			++result->size;
+	}
+
+	/* Allocate memory for entries. */
+	result->entries = malloc(sizeof(struct ugid_map_entry) * result->size);
+	if (!result->entries) {
+		result->size = 0;
+		return 0;
+	}
+
+	/* Parse each line */
+	for (line = strtok_r(arg, "\n", &line_saveptr), current_index = 0;
+	     line;
+	     line = strtok_r(NULL, "\n", &line_saveptr), ++current_index) {
+		if (!parse_ugid_map_entry(
+			line, &result->entries[current_index])) {
+			return 0;
+		}
+	}
+
+	return is_valid_ugid_map(result);
+}
+
+int main(int argc, char *argv[])
+{
+	int c;
+	char *p;
+	int flags = EXT2_FLAG_RW;
+	errcode_t retval;
+	io_manager io_mgr;
+	ext2_filsys fs = NULL;
+	struct fs_ops_callbacks fs_callbacks = { NULL, NULL };
+	char *token;
+	int nr_opt = 0;
+	ext2_ino_t inodes_count;
+	ext2_ino_t free_inodes_count;
+	blk64_t blocks_count;
+	blk64_t free_blocks_count;
+	struct ugid_map uid_map = { 0, NULL }, gid_map = { 0, NULL };
+
+	add_error_table(&et_ext2_error_table);
+
+	while ((c = getopt (argc, argv, "T:C:S:p:a:D:d:B:f:esu:g:")) != EOF) {
+		switch (c) {
+		case 'T':
+			fixed_time = strtoul(optarg, &p, 0);
+			android_configure = 1;
+			break;
+		case 'C':
+			fs_config_file = absolute_path(optarg);
+			android_configure = 1;
+			break;
+		case 'S':
+			token = strtok(optarg, ",");
+			while (token) {
+				if (nr_opt == max_nr_opt) {
+					fprintf(stderr, "Expected at most %d selinux opts\n",
+						max_nr_opt);
+					exit(EXIT_FAILURE);
+				}
+				seopt_file[nr_opt].type = SELABEL_OPT_PATH;
+				seopt_file[nr_opt].value = absolute_path(token);
+				nr_opt++;
+				token = strtok(NULL, ",");
+			}
+			android_configure = 1;
+			break;
+		case 'p':
+			product_out = absolute_path(optarg);
+			android_configure = 1;
+			break;
+		case 'a':
+			mountpoint = strdup(optarg);
+			break;
+		case 'D':
+			basefs_out = absolute_path(optarg);
+			break;
+		case 'd':
+			basefs_in = absolute_path(optarg);
+			break;
+		case 'B':
+			block_list = absolute_path(optarg);
+			break;
+		case 'f':
+			src_dir = absolute_path(optarg);
+			break;
+		case 'e':
+			android_sparse_file = 0;
+			break;
+		case 's':
+			flags |= EXT2_FLAG_SHARE_DUP;
+			break;
+		case 'u':
+			if (!parse_ugid_map(optarg, &uid_map))
+				exit(EXIT_FAILURE);
+			android_configure = 1;
+			break;
+		case 'g':
+			if (!parse_ugid_map(optarg, &gid_map))
+				exit(EXIT_FAILURE);
+			android_configure = 1;
+			break;
+		default:
+			usage(EXIT_FAILURE);
+		}
+	}
+	if (optind >= argc) {
+		fprintf(stderr, "Expected filename after options\n");
+		exit(EXIT_FAILURE);
+	}
+
+	if (android_sparse_file) {
+		io_mgr = sparse_io_manager;
+		if (asprintf(&in_file, "(%s)", argv[optind]) == -1) {
+			fprintf(stderr, "Failed to allocate file name\n");
+			exit(EXIT_FAILURE);
+		}
+	} else {
+		io_mgr = unix_io_manager;
+		in_file = strdup(argv[optind]);
+	}
+	retval = ext2fs_open(in_file, flags, 0, 0, io_mgr, &fs);
+	if (retval) {
+		com_err(prog_name, retval, "while opening file %s\n", in_file);
+		return retval;
+	}
+
+	if (src_dir) {
+		ext2fs_read_bitmaps(fs);
+		if (basefs_in) {
+			retval = base_fs_alloc_load(fs, basefs_in, mountpoint,
+				src_dir);
+			if (retval) {
+				com_err(prog_name, retval, "%s",
+				"while reading base_fs file");
+			    exit(1);
+			}
+			fs_callbacks.create_new_inode =
+				base_fs_alloc_set_target;
+			fs_callbacks.end_create_new_inode =
+				base_fs_alloc_unset_target;
+		}
+		retval = populate_fs2(fs, EXT2_ROOT_INO, src_dir,
+				      EXT2_ROOT_INO, &fs_callbacks);
+		if (retval) {
+			com_err(prog_name, retval, "%s",
+			"while populating file system");
+		    exit(1);
+		}
+		if (basefs_in)
+			base_fs_alloc_cleanup(fs);
+	}
+
+	if (android_configure) {
+		retval = android_configure_fs(
+			fs, src_dir, product_out, mountpoint, seopt_file,
+			nr_opt, fs_config_file, fixed_time, &uid_map, &gid_map);
+		if (retval) {
+			com_err(prog_name, retval, "%s",
+				"while configuring the file system");
+			exit(1);
+		}
+	}
+
+	if (block_list) {
+		retval = fsmap_iter_filsys(fs, &block_list_format, block_list,
+					   mountpoint);
+		if (retval) {
+			com_err(prog_name, retval, "%s",
+				"while creating the block_list");
+			exit(1);
+		}
+	}
+
+	if (basefs_out) {
+		retval = fsmap_iter_filsys(fs, &base_fs_format,
+					   basefs_out, mountpoint);
+		if (retval) {
+			com_err(prog_name, retval, "%s",
+				"while creating the basefs file");
+			exit(1);
+		}
+	}
+
+	inodes_count = fs->super->s_inodes_count;
+	free_inodes_count = fs->super->s_free_inodes_count;
+	blocks_count = ext2fs_blocks_count(fs->super);
+	free_blocks_count = ext2fs_free_blocks_count(fs->super);
+
+	retval = ext2fs_close_free(&fs);
+	if (retval) {
+		com_err(prog_name, retval, "%s",
+				"while writing superblocks");
+		exit(1);
+	}
+
+	printf("Created filesystem with %u/%u inodes and %llu/%llu blocks\n",
+			inodes_count - free_inodes_count, inodes_count,
+			blocks_count - free_blocks_count, blocks_count);
+
+	remove_error_table(&et_ext2_error_table);
+	return 0;
+}
diff --git a/contrib/android/ext2simg.c b/contrib/android/ext2simg.c
new file mode 100644
index 0000000..017e16f
--- /dev/null
+++ b/contrib/android/ext2simg.c
@@ -0,0 +1,224 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <libgen.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <ext2fs/ext2fs.h>
+#include <et/com_err.h>
+#include <sparse/sparse.h>
+
+struct {
+	int	crc;
+	int	sparse;
+	int	gzip;
+	char	*in_file;
+	char	*out_file;
+	bool	overwrite_input;
+} params = {
+	.crc	    = 0,
+	.sparse	    = 1,
+	.gzip	    = 0,
+};
+
+#define ext2fs_fatal(Retval, Format, ...) \
+	do { \
+		com_err("error", Retval, Format, __VA_ARGS__); \
+		exit(EXIT_FAILURE); \
+	} while(0)
+
+#define sparse_fatal(Format) \
+	do { \
+		fprintf(stderr, "sparse: "Format); \
+		exit(EXIT_FAILURE); \
+	} while(0)
+
+static void usage(char *path)
+{
+	char *progname = basename(path);
+
+	fprintf(stderr, "%s [ options ] <image or block device> <output image>\n"
+			"  -c include CRC block\n"
+			"  -z gzip output\n"
+			"  -S don't use sparse output format\n", progname);
+}
+
+static struct buf_item {
+	struct buf_item	    *next;
+	void		    *buf[0];
+} *buf_list;
+
+static void add_chunk(ext2_filsys fs, struct sparse_file *s, blk_t chunk_start, blk_t chunk_end)
+{
+	int retval;
+	unsigned int nb_blk = chunk_end - chunk_start;
+	size_t len = nb_blk * fs->blocksize;
+	int64_t offset = (int64_t)chunk_start * (int64_t)fs->blocksize;
+
+	if (params.overwrite_input == false) {
+		if (sparse_file_add_file(s, params.in_file, offset, len, chunk_start) < 0)
+			sparse_fatal("adding data to the sparse file");
+	} else {
+		/*
+		 * The input file will be overwritten, make a copy of
+		 * the blocks
+		 */
+		struct buf_item *bi = calloc(1, sizeof(struct buf_item) + len);
+		if (buf_list == NULL)
+			buf_list = bi;
+		else {
+			bi->next = buf_list;
+			buf_list = bi;
+		}
+
+		retval = io_channel_read_blk64(fs->io, chunk_start, nb_blk, bi->buf);
+		if (retval < 0)
+			ext2fs_fatal(retval, "reading block %u - %u", chunk_start, chunk_end);
+
+		if (sparse_file_add_data(s, bi->buf, len, chunk_start) < 0)
+			sparse_fatal("adding data to the sparse file");
+	}
+}
+
+static void free_chunks(void)
+{
+	struct buf_item *bi;
+
+	while (buf_list) {
+		bi = buf_list->next;
+		free(buf_list);
+		buf_list = bi;
+	}
+}
+
+static struct sparse_file *ext_to_sparse(const char *in_file)
+{
+	errcode_t retval;
+	ext2_filsys fs;
+	struct sparse_file *s;
+	int64_t chunk_start = -1;
+	blk_t first_blk, last_blk, nb_blk, cur_blk;
+
+	retval = ext2fs_open(in_file, 0, 0, 0, unix_io_manager, &fs);
+	if (retval)
+		ext2fs_fatal(retval, "while reading %s", in_file);
+
+	retval = ext2fs_read_block_bitmap(fs);
+	if (retval)
+		ext2fs_fatal(retval, "while reading block bitmap of %s", in_file);
+
+	first_blk = ext2fs_get_block_bitmap_start2(fs->block_map);
+	last_blk = ext2fs_get_block_bitmap_end2(fs->block_map);
+	nb_blk = last_blk - first_blk + 1;
+
+	s = sparse_file_new(fs->blocksize, (uint64_t)fs->blocksize * (uint64_t)nb_blk);
+	if (!s)
+		sparse_fatal("creating sparse file");
+
+	/*
+	 * The sparse format encodes the size of a chunk (and its header) in a
+	 * 32-bit unsigned integer (UINT32_MAX)
+	 * When writing the chunk, the library uses a single call to write().
+	 * Linux's implementation of the 'write' syscall does not allow transfers
+	 * larger than INT32_MAX (32-bit _and_ 64-bit systems).
+	 * Make sure we do not create chunks larger than this limit.
+	 */
+	int64_t max_blk_per_chunk = (INT32_MAX - 12) / fs->blocksize;
+
+	/* Iter on the blocks to merge contiguous chunk */
+	for (cur_blk = first_blk; cur_blk <= last_blk; ++cur_blk) {
+		if (ext2fs_test_block_bitmap2(fs->block_map, cur_blk)) {
+			if (chunk_start == -1) {
+				chunk_start = cur_blk;
+			} else if (cur_blk - chunk_start + 1 == max_blk_per_chunk) {
+				add_chunk(fs, s, chunk_start, cur_blk);
+				chunk_start = -1;
+			}
+		} else if (chunk_start != -1) {
+			add_chunk(fs, s, chunk_start, cur_blk);
+			chunk_start = -1;
+		}
+	}
+	if (chunk_start != -1)
+		add_chunk(fs, s, chunk_start, cur_blk - 1);
+
+	ext2fs_free(fs);
+	return s;
+}
+
+static bool same_file(const char *in, const char *out)
+{
+	struct stat st1, st2;
+
+	if (access(out, F_OK) == -1)
+		return false;
+
+	if (lstat(in, &st1) == -1)
+		ext2fs_fatal(errno, "stat %s\n", in);
+	if (lstat(out, &st2) == -1)
+		ext2fs_fatal(errno, "stat %s\n", out);
+	return st1.st_ino == st2.st_ino;
+}
+
+int main(int argc, char *argv[])
+{
+	int opt;
+	int out_fd;
+	struct sparse_file *s;
+
+	while ((opt = getopt(argc, argv, "czS")) != -1) {
+		switch(opt) {
+		case 'c':
+			params.crc = 1;
+			break;
+		case 'z':
+			params.gzip = 1;
+			break;
+		case 'S':
+			params.sparse = 0;
+			break;
+		default:
+			usage(argv[0]);
+			exit(EXIT_FAILURE);
+		}
+	}
+	if (optind + 1 >= argc) {
+		usage(argv[0]);
+		exit(EXIT_FAILURE);
+	}
+	params.in_file = strdup(argv[optind++]);
+	params.out_file = strdup(argv[optind]);
+	params.overwrite_input = same_file(params.in_file, params.out_file);
+
+	s = ext_to_sparse(params.in_file);
+
+	out_fd = open(params.out_file, O_WRONLY | O_CREAT | O_TRUNC, 0664);
+	if (out_fd == -1)
+		ext2fs_fatal(errno, "opening %s\n", params.out_file);
+	if (sparse_file_write(s, out_fd, params.gzip, params.sparse, params.crc) < 0)
+		sparse_fatal("writing sparse file");
+
+	sparse_file_destroy(s);
+
+	free(params.in_file);
+	free(params.out_file);
+	free_chunks();
+	close(out_fd);
+
+	return 0;
+}
diff --git a/contrib/android/fsmap.c b/contrib/android/fsmap.c
new file mode 100644
index 0000000..9ee8472
--- /dev/null
+++ b/contrib/android/fsmap.c
@@ -0,0 +1,169 @@
+#include "fsmap.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include "support/nls-enable.h"
+
+struct walk_ext_priv_data {
+	char			*path;
+	ext2_filsys		fs;
+	struct fsmap_format	*format;
+};
+
+static int walk_block(ext2_filsys fs  EXT2FS_ATTR((unused)), blk64_t *blocknr,
+		      e2_blkcnt_t blockcnt,
+		      blk64_t ref64_blk EXT2FS_ATTR((unused)),
+		      int ref_offset EXT2FS_ATTR((unused)),
+		      void *priv)
+{
+	struct walk_ext_priv_data *pdata = priv;
+	struct fsmap_format *format = pdata->format;
+
+	return format->add_block(fs, *blocknr, blockcnt < 0, format->private);
+}
+
+static errcode_t ino_iter_extents(ext2_filsys fs, ext2_ino_t ino,
+				  ext2_extent_handle_t extents,
+				  struct walk_ext_priv_data *pdata)
+{
+	blk64_t block;
+	errcode_t retval;
+	blk64_t next_lblk = 0;
+	int op = EXT2_EXTENT_ROOT;
+	struct ext2fs_extent extent;
+	struct fsmap_format *format = pdata->format;
+
+	for (;;) {
+		retval = ext2fs_extent_get(extents, op, &extent);
+		if (retval)
+			break;
+
+		op = EXT2_EXTENT_NEXT;
+
+		if ((extent.e_flags & EXT2_EXTENT_FLAGS_SECOND_VISIT) ||
+		    !(extent.e_flags & EXT2_EXTENT_FLAGS_LEAF))
+			continue;
+
+		for (; next_lblk < extent.e_lblk; next_lblk++)
+			format->add_block(fs, 0, 0, format->private);
+
+		block = extent.e_pblk;
+		for (; next_lblk < extent.e_lblk + extent.e_len; next_lblk++)
+			format->add_block(fs, block++, 0, format->private);
+	}
+
+	if (retval == EXT2_ET_EXTENT_NO_NEXT)
+		retval = 0;
+	if (retval) {
+		com_err(__func__, retval, ("getting extents of ino \"%u\""),
+			ino);
+	}
+	return retval;
+}
+
+static errcode_t ino_iter_blocks(ext2_filsys fs, ext2_ino_t ino,
+				 struct walk_ext_priv_data *pdata)
+{
+	errcode_t retval;
+	struct ext2_inode inode;
+	ext2_extent_handle_t extents;
+	struct fsmap_format *format = pdata->format;
+
+	retval = ext2fs_read_inode(fs, ino, &inode);
+	if (retval)
+		return retval;
+
+	if (!ext2fs_inode_has_valid_blocks2(fs, &inode))
+		return format->inline_data(&(inode.i_block[0]),
+					   format->private);
+
+	retval = ext2fs_extent_open(fs, ino, &extents);
+	if (retval == EXT2_ET_INODE_NOT_EXTENT) {
+		retval = ext2fs_block_iterate3(fs, ino, BLOCK_FLAG_READ_ONLY,
+			NULL, walk_block, pdata);
+		if (retval) {
+			com_err(__func__, retval, _("listing blocks of ino \"%u\""),
+				ino);
+		}
+		return retval;
+	}
+
+	retval = ino_iter_extents(fs, ino, extents, pdata);
+
+	ext2fs_extent_free(extents);
+	return retval;
+}
+
+static int is_dir(ext2_filsys fs, ext2_ino_t ino)
+{
+	struct ext2_inode inode;
+
+	if (ext2fs_read_inode(fs, ino, &inode))
+		return 0;
+	return S_ISDIR(inode.i_mode);
+}
+
+static int walk_ext_dir(ext2_ino_t dir EXT2FS_ATTR((unused)),
+			int flags EXT2FS_ATTR((unused)),
+			struct ext2_dir_entry *de,
+			int offset EXT2FS_ATTR((unused)),
+			int blocksize EXT2FS_ATTR((unused)),
+			char *buf EXT2FS_ATTR((unused)), void *priv_data)
+{
+	errcode_t retval;
+	struct ext2_inode inode;
+	char *filename, *cur_path, *name = de->name;
+	int name_len = de->name_len & 0xff;
+	struct walk_ext_priv_data *pdata = priv_data;
+	struct fsmap_format *format = pdata->format;
+
+	if (!strncmp(name, ".", name_len)
+	    || !strncmp(name, "..", name_len)
+	    || !strncmp(name, "lost+found", 10))
+		return 0;
+
+	if (asprintf(&filename, "%s/%.*s", pdata->path, name_len, name) < 0)
+		return -ENOMEM;
+
+	retval = ext2fs_read_inode(pdata->fs, de->inode, &inode);
+	if (retval) {
+		com_err(__func__, retval, _("reading ino \"%u\""), de->inode);
+		goto end;
+	}
+	format->start_new_file(filename, de->inode, &inode, format->private);
+	retval = ino_iter_blocks(pdata->fs, de->inode, pdata);
+	if (retval)
+		return retval;
+	format->end_new_file(format->private);
+
+	retval = 0;
+	if (is_dir(pdata->fs, de->inode)) {
+		cur_path = pdata->path;
+		pdata->path = filename;
+		retval = ext2fs_dir_iterate2(pdata->fs, de->inode, 0, NULL,
+				    walk_ext_dir, pdata);
+		pdata->path = cur_path;
+	}
+
+end:
+	free(filename);
+	return retval;
+}
+
+errcode_t fsmap_iter_filsys(ext2_filsys fs, struct fsmap_format *format,
+			    const char *file, const char *mountpoint)
+{
+	struct walk_ext_priv_data pdata;
+	errcode_t retval;
+
+	format->private = format->init(file, mountpoint);
+	pdata.fs = fs;
+	pdata.path = "";
+	pdata.format = format;
+
+	retval = ext2fs_dir_iterate2(fs, EXT2_ROOT_INO, 0, NULL, walk_ext_dir, &pdata);
+
+	format->cleanup(format->private);
+	return retval;
+}
diff --git a/contrib/android/fsmap.h b/contrib/android/fsmap.h
new file mode 100644
index 0000000..9f84a71
--- /dev/null
+++ b/contrib/android/fsmap.h
@@ -0,0 +1,29 @@
+#ifndef FSMAP_H
+# define FSMAP_H
+
+# ifndef _GNU_SOURCE
+#  define _GNU_SOURCE // asprintf
+# endif
+# include <stdio.h>
+# include <stdint.h>
+# include <stdbool.h>
+# include <sys/types.h>
+# include <ext2fs/ext2fs.h>
+
+struct fsmap_format {
+	void* (* init)(const char *file, const char *mountpoint);
+	int   (* start_new_file)(char *path, ext2_ino_t ino,
+				 struct ext2_inode *inode, void *data);
+	int   (* add_block)(ext2_filsys fs, blk64_t blocknr, int metadata,
+			    void *data);
+	int   (* inline_data)(void *inline_data, void *data);
+	int   (* end_new_file)(void *data);
+	int   (* cleanup)(void *data);
+
+	void *private;
+};
+
+errcode_t fsmap_iter_filsys(ext2_filsys fs, struct fsmap_format *format,
+			    const char *file, const char *mountpoint);
+
+#endif /* !FSMAP_H */
diff --git a/contrib/android/perms.c b/contrib/android/perms.c
new file mode 100644
index 0000000..9c5ec05
--- /dev/null
+++ b/contrib/android/perms.c
@@ -0,0 +1,375 @@
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE //asprintf
+#endif
+#include "perms.h"
+#include "support/nls-enable.h"
+#include <time.h>
+#include <sys/stat.h>
+
+#ifndef XATTR_SELINUX_SUFFIX
+# define XATTR_SELINUX_SUFFIX  "selinux"
+#endif
+#ifndef XATTR_CAPS_SUFFIX
+# define XATTR_CAPS_SUFFIX     "capability"
+#endif
+
+struct inode_params {
+	ext2_filsys fs;
+	char *path;
+	char *filename;
+	char *src_dir;
+	char *target_out;
+	char *mountpoint;
+	fs_config_f fs_config_func;
+	struct selabel_handle *sehnd;
+	time_t fixed_time;
+	const struct ugid_map* uid_map;
+	const struct ugid_map* gid_map;
+	errcode_t error;
+};
+
+static errcode_t ino_add_xattr(ext2_filsys fs, ext2_ino_t ino, const char *name,
+			       const void *value, int value_len)
+{
+	errcode_t retval, close_retval;
+	struct ext2_xattr_handle *xhandle;
+
+	retval = ext2fs_xattrs_open(fs, ino, &xhandle);
+	if (retval) {
+		com_err(__func__, retval, _("while opening inode %u"), ino);
+		return retval;
+	}
+	retval = ext2fs_xattrs_read(xhandle);
+	if (retval) {
+		com_err(__func__, retval,
+			_("while reading xattrs of inode %u"), ino);
+		goto xattrs_close;
+	}
+	retval = ext2fs_xattr_set(xhandle, name, value, value_len);
+	if (retval) {
+		com_err(__func__, retval,
+			_("while setting xattrs of inode %u"), ino);
+		goto xattrs_close;
+	}
+xattrs_close:
+	close_retval = ext2fs_xattrs_close(&xhandle);
+	if (close_retval) {
+		com_err(__func__, close_retval,
+			_("while closing xattrs of inode %u"), ino);
+		return retval ? retval : close_retval;
+	}
+	return retval;
+}
+
+static errcode_t set_selinux_xattr(ext2_filsys fs, ext2_ino_t ino,
+				   struct inode_params *params)
+{
+	errcode_t retval;
+	char *secontext = NULL;
+	struct ext2_inode inode;
+
+	if (params->sehnd == NULL)
+		return 0;
+
+	retval = ext2fs_read_inode(fs, ino, &inode);
+	if (retval) {
+		com_err(__func__, retval,
+			_("while reading inode %u"), ino);
+		return retval;
+	}
+
+	retval = selabel_lookup(params->sehnd, &secontext, params->filename,
+				inode.i_mode);
+	if (retval < 0) {
+		int saved_errno = errno;
+		com_err(__func__, errno,
+			_("searching for label \"%s\""), params->filename);
+		return saved_errno;
+	}
+
+	retval = ino_add_xattr(fs, ino,  "security." XATTR_SELINUX_SUFFIX,
+			       secontext, strlen(secontext) + 1);
+
+	freecon(secontext);
+	return retval;
+}
+
+/*
+ * Returns mapped UID/GID if there is a corresponding entry in |mapping|.
+ * Otherwise |id| as is.
+ */
+static unsigned int resolve_ugid(const struct ugid_map* mapping,
+				 unsigned int id)
+{
+	size_t i;
+	for (i = 0; i < mapping->size; ++i) {
+		const struct ugid_map_entry* entry = &mapping->entries[i];
+		if (entry->parent_id <= id &&
+		    id < entry->parent_id + entry->length) {
+			return id + entry->child_id - entry->parent_id;
+		}
+	}
+
+	/* No entry is found. */
+	return id;
+}
+
+static errcode_t set_perms_and_caps(ext2_filsys fs, ext2_ino_t ino,
+				    struct inode_params *params)
+{
+	errcode_t retval;
+	uint64_t capabilities = 0;
+	struct ext2_inode inode;
+	struct vfs_cap_data cap_data;
+	unsigned int uid = 0, gid = 0, imode = 0;
+
+	retval = ext2fs_read_inode(fs, ino, &inode);
+	if (retval) {
+		com_err(__func__, retval, _("while reading inode %u"), ino);
+		return retval;
+	}
+
+	/* Permissions */
+	if (params->fs_config_func != NULL) {
+		const char *filename = params->filename;
+		if (strcmp(filename, params->mountpoint) == 0) {
+			/* The root of the filesystem needs to be an empty string. */
+			filename = "";
+		}
+		params->fs_config_func(filename, S_ISDIR(inode.i_mode),
+				       params->target_out, &uid, &gid, &imode,
+				       &capabilities);
+		uid = resolve_ugid(params->uid_map, uid);
+		gid = resolve_ugid(params->gid_map, gid);
+		inode.i_uid = (__u16) uid;
+		inode.i_gid = (__u16) gid;
+		ext2fs_set_i_uid_high(inode, (__u16) (uid >> 16));
+		ext2fs_set_i_gid_high(inode, (__u16) (gid >> 16));
+		inode.i_mode = (inode.i_mode & S_IFMT) | (imode & 0xffff);
+		retval = ext2fs_write_inode(fs, ino, &inode);
+		if (retval) {
+			com_err(__func__, retval,
+				_("while writing inode %u"), ino);
+			return retval;
+		}
+	}
+
+	/* Capabilities */
+	if (!capabilities)
+		return 0;
+	memset(&cap_data, 0, sizeof(cap_data));
+	cap_data.magic_etc = VFS_CAP_REVISION_2 | VFS_CAP_FLAGS_EFFECTIVE;
+	cap_data.data[0].permitted = (uint32_t) (capabilities & 0xffffffff);
+	cap_data.data[1].permitted = (uint32_t) (capabilities >> 32);
+	return ino_add_xattr(fs, ino,  "security." XATTR_CAPS_SUFFIX,
+			     &cap_data, sizeof(cap_data));
+}
+
+static errcode_t set_timestamp(ext2_filsys fs, ext2_ino_t ino,
+			       struct inode_params *params)
+{
+	errcode_t retval;
+	struct ext2_inode inode;
+	struct stat stat;
+	char *src_filename = NULL;
+
+	retval = ext2fs_read_inode(fs, ino, &inode);
+	if (retval) {
+		com_err(__func__, retval,
+			_("while reading inode %u"), ino);
+		return retval;
+	}
+
+	if (params->fixed_time == -1 && params->src_dir) {
+		/* replace mountpoint from filename with src_dir */
+		if (asprintf(&src_filename, "%s/%s", params->src_dir,
+			params->filename + strlen(params->mountpoint)) < 0) {
+			return -ENOMEM;
+		}
+		retval = lstat(src_filename, &stat);
+		if (retval < 0) {
+			com_err(__func__, errno,
+				_("while lstat file %s"), src_filename);
+			goto end;
+		}
+		inode.i_atime = inode.i_ctime = inode.i_mtime = stat.st_mtime;
+	} else {
+		inode.i_atime = inode.i_ctime = inode.i_mtime = params->fixed_time;
+	}
+
+	retval = ext2fs_write_inode(fs, ino, &inode);
+	if (retval) {
+		com_err(__func__, retval,
+			_("while writing inode %u"), ino);
+		goto end;
+	}
+
+end:
+	free(src_filename);
+	return retval;
+}
+
+static int is_dir(ext2_filsys fs, ext2_ino_t ino)
+{
+	struct ext2_inode inode;
+
+	if (ext2fs_read_inode(fs, ino, &inode))
+		return 0;
+	return S_ISDIR(inode.i_mode);
+}
+
+static errcode_t androidify_inode(ext2_filsys fs, ext2_ino_t ino,
+				  struct inode_params *params)
+{
+	errcode_t retval;
+
+	retval = set_timestamp(fs, ino, params);
+	if (retval)
+		return retval;
+
+	retval = set_selinux_xattr(fs, ino, params);
+	if (retval)
+		return retval;
+
+	return set_perms_and_caps(fs, ino, params);
+}
+
+static int walk_dir(ext2_ino_t dir EXT2FS_ATTR((unused)),
+		    int flags EXT2FS_ATTR((unused)),
+		    struct ext2_dir_entry *de,
+		    int offset EXT2FS_ATTR((unused)),
+		    int blocksize EXT2FS_ATTR((unused)),
+		    char *buf EXT2FS_ATTR((unused)), void *priv_data)
+{
+	__u16 name_len;
+	errcode_t retval;
+	struct inode_params *params = (struct inode_params *)priv_data;
+
+	name_len = de->name_len & 0xff;
+	if (!strncmp(de->name, ".", name_len)
+	    || (!strncmp(de->name, "..", name_len)))
+		return 0;
+
+	if (asprintf(&params->filename, "%s/%.*s", params->path, name_len,
+		     de->name) < 0) {
+		params->error = ENOMEM;
+		return -ENOMEM;
+        }
+
+	if (!strncmp(de->name, "lost+found", 10)) {
+		retval = set_selinux_xattr(params->fs, de->inode, params);
+		if (retval)
+			goto end;
+	} else {
+		retval = androidify_inode(params->fs, de->inode, params);
+		if (retval)
+			goto end;
+		if (is_dir(params->fs, de->inode)) {
+			char *cur_path = params->path;
+			char *cur_filename = params->filename;
+			params->path = params->filename;
+			retval = ext2fs_dir_iterate2(params->fs, de->inode, 0, NULL,
+						     walk_dir, params);
+			if (retval)
+				goto end;
+			params->path = cur_path;
+			params->filename = cur_filename;
+		}
+	}
+
+end:
+	free(params->filename);
+	params->error |= retval;
+	return retval;
+}
+
+errcode_t __android_configure_fs(ext2_filsys fs, char *src_dir,
+				 char *target_out,
+				 char *mountpoint,
+				 fs_config_f fs_config_func,
+				 struct selabel_handle *sehnd,
+				 time_t fixed_time,
+				 const struct ugid_map* uid_map,
+				 const struct ugid_map* gid_map)
+{
+	errcode_t retval;
+	struct inode_params params = {
+		.fs = fs,
+		.src_dir = src_dir,
+		.target_out = target_out,
+		.fs_config_func = fs_config_func,
+		.sehnd = sehnd,
+		.fixed_time = fixed_time,
+		.path = mountpoint,
+		.filename = mountpoint,
+		.mountpoint = mountpoint,
+		.uid_map = uid_map,
+		.gid_map = gid_map,
+		.error = 0
+	};
+
+	/* walk_dir will add the "/". Don't add it twice. */
+	if (strlen(mountpoint) == 1 && mountpoint[0] == '/')
+		params.path = "";
+
+	retval = androidify_inode(fs, EXT2_ROOT_INO, &params);
+	if (retval)
+		return retval;
+
+	retval = ext2fs_dir_iterate2(fs, EXT2_ROOT_INO, 0, NULL, walk_dir,
+				     &params);
+	if (retval)
+		return retval;
+	return params.error;
+}
+
+errcode_t android_configure_fs(ext2_filsys fs, char *src_dir, char *target_out,
+			       char *mountpoint,
+			       struct selinux_opt *seopts EXT2FS_ATTR((unused)),
+			       unsigned int nopt EXT2FS_ATTR((unused)),
+			       char *fs_config_file, time_t fixed_time,
+			       const struct ugid_map* uid_map,
+			       const struct ugid_map* gid_map)
+{
+	errcode_t retval;
+	fs_config_f fs_config_func = NULL;
+	struct selabel_handle *sehnd = NULL;
+
+	/* Retrieve file contexts */
+#if !defined(__ANDROID__)
+	if (nopt > 0) {
+		sehnd = selabel_open(SELABEL_CTX_FILE, seopts, nopt);
+		if (!sehnd) {
+			int saved_errno = errno;
+			com_err(__func__, errno,
+				_("while opening file contexts \"%s\""),
+				seopts[0].value);
+			return saved_errno;
+		}
+	}
+#else
+	sehnd = selinux_android_file_context_handle();
+	if (!sehnd) {
+		com_err(__func__, EINVAL,
+			_("while opening android file_contexts"));
+		return EINVAL;
+	}
+#endif
+
+	/* Load the FS config */
+	if (fs_config_file) {
+		retval = load_canned_fs_config(fs_config_file);
+		if (retval < 0) {
+			com_err(__func__, retval,
+				_("while loading fs_config \"%s\""),
+				fs_config_file);
+			return retval;
+		}
+		fs_config_func = canned_fs_config;
+	} else if (mountpoint)
+		fs_config_func = fs_config;
+
+	return __android_configure_fs(fs, src_dir, target_out, mountpoint,
+				      fs_config_func, sehnd, fixed_time,
+				      uid_map, gid_map);
+}
diff --git a/contrib/android/perms.h b/contrib/android/perms.h
new file mode 100644
index 0000000..7987127
--- /dev/null
+++ b/contrib/android/perms.h
@@ -0,0 +1,66 @@
+#ifndef ANDROID_PERMS_H
+# define ANDROID_PERMS_H
+
+# include "config.h"
+# include <ext2fs/ext2fs.h>
+
+typedef void (*fs_config_f)(const char *path, int dir,
+			    const char *target_out_path,
+			    unsigned *uid, unsigned *gid,
+			    unsigned *mode, uint64_t *capabilities);
+
+/*
+ * Represents a range of UID/GID mapping.
+ * This maps the id in [|parent_id|, |parent_id| + |length|) into
+ * [|child_id|, |child_id| + |length|)
+ */
+struct ugid_map_entry {
+	unsigned int child_id;
+	unsigned int parent_id;
+	unsigned int length;
+};
+
+struct ugid_map {
+	/* The number of elements in |entries|. */
+	size_t size;
+
+	/* An array of entries. If |size| is 0, this is a null pointer. */
+	struct ugid_map_entry* entries;
+};
+
+# ifdef _WIN32
+struct selabel_handle;
+static inline errcode_t android_configure_fs(ext2_filsys fs,
+					     char *src_dir,
+					     char *target_out,
+					     char *mountpoint,
+					     void *seopts,
+					     unsigned int nopt,
+					     char *fs_config_file,
+					     time_t fixed_time,
+					     const struct ugid_map* uid_map,
+					     const struct ugdi_map* gid_map)
+{
+	return 0;
+}
+# else
+#  include <selinux/selinux.h>
+#  include <selinux/label.h>
+#  if defined(__ANDROID__)
+#   include <selinux/android.h>
+#  endif
+#  include <private/android_filesystem_config.h>
+#  include <private/canned_fs_config.h>
+#  include <private/fs_config.h>
+
+errcode_t android_configure_fs(ext2_filsys fs, char *src_dir,
+			       char *target_out,
+			       char *mountpoint,
+			       struct selinux_opt *seopts,
+			       unsigned int nopt,
+			       char *fs_config_file, time_t fixed_time,
+			       const struct ugid_map* uid_map,
+			       const struct ugid_map* gid_map);
+
+# endif
+#endif /* !ANDROID_PERMS_H */
diff --git a/contrib/dir2fs b/contrib/dir2fs
new file mode 100755
index 0000000..abcecb3
--- /dev/null
+++ b/contrib/dir2fs
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+dir="$1"
+dev="$2"
+
+if [ "$1" = "--help" ] || [ ! -d "${dir}" ]; then
+	echo "Usage: $0 dir [mke2fs args] dev"
+	exit 1
+fi
+
+shift
+
+# Goal: Put all the files at the beginning (which mke2fs does) and minimize
+# the number of free inodes given the minimum number of blocks required.
+# Hence all this math to get the inode ratio just right.
+
+bytes="$(du -ks "${dir}" | awk '{print $1}')"
+bytes="$((bytes * 1024))"
+inodes="$(find "${dir}" -print0 | xargs -0 stat -c '%i' | sort -g | uniq | wc -l)"
+block_sz=4096
+inode_sz=256
+sb_overhead=4096
+blocks_per_group="$((block_sz * 8))"
+bytes_per_group="$((blocks_per_group * block_sz))"
+inode_bytes="$((inodes * inode_sz))"
+
+# Estimate overhead with the minimum number of groups...
+nr_groups="$(( (bytes + inode_bytes + bytes_per_group - 1) / bytes_per_group))"
+inode_bytes_per_group="$((inode_bytes / nr_groups))"
+inode_blocks_per_group="$(( (inode_bytes_per_group + (block_sz - 1)) / block_sz ))"
+per_grp_overhead="$(( ((3 + inode_blocks_per_group) * block_sz) + 64 ))"
+overhead="$(( sb_overhead + (per_grp_overhead * nr_groups) ))"
+used_bytes="$((bytes + overhead))"
+
+# Then do it again with the real number of groups.
+nr_groups="$(( (used_bytes + (bytes_per_group - 1)) / bytes_per_group))"
+tot_blocks="$((nr_groups * blocks_per_group))"
+tot_bytes="$((tot_blocks * block_sz))"
+
+ratio="$((bytes / inodes))"
+mkfs_blocks="$((tot_blocks * 4 / 3))"
+
+mke2fs -i "${ratio}" -T ext4 -d "${dir}" -O ^resize_inode,sparse_super2,metadata_csum,64bit,^has_journal -E packed_meta_blocks=1,num_backup_sb=0 -b "${block_sz}" -I "${inodesz}" -F "${dev}" "${mkfs_blocks}" || exit
+
+e2fsck -fyD "${dev}"
+
+blocks="$(dumpe2fs -h "${dev}" 2>&1 | grep 'Block count:' | awk '{print $3}')"
+while resize2fs -f -M "${dev}"; do
+	new_blocks="$(dumpe2fs -h "${dev}" 2>&1 | grep 'Block count:' | awk '{print $3}')"
+	if [ "${new_blocks}" -eq "${blocks}" ]; then
+		break;
+	fi
+	blocks="${new_blocks}"
+done
+
+if [ ! -b "${dev}" ]; then
+    truncate -s "$((blocks * block_sz))" "${dev}" || (e2image -ar "${dev}" "${dev}.min"; mv "${dev}.min" "${dev}")
+fi
+
+e2fsck -fy "${dev}"
+
+dir_blocks="$((bytes / block_sz))"
+overhead="$((blocks - dir_blocks))"
+echo "Minimized image overhead: $((100 * overhead / dir_blocks))%"
+
+exit 0
diff --git a/contrib/e2croncheck b/contrib/e2croncheck
index 87204be..de0b41f 100755
--- a/contrib/e2croncheck
+++ b/contrib/e2croncheck
@@ -23,7 +23,7 @@
 SNAPSIZE=100m
 EMAIL=sysadmin@example.com
 
-TMPFILE=`mktemp -t e2fsck.log.XXXXXXXXXX`
+TMPFILE=`mktemp ${TMPDIR:-/tmp}/e2fsck.log.XXXXXXXXXX`
 
 OPTS="-Fttv -C0"
 #OPTS="-Fttv -E fragcheck"
diff --git a/contrib/ext4-ioc.c b/contrib/ext4-ioc.c
new file mode 100644
index 0000000..42f022d
--- /dev/null
+++ b/contrib/ext4-ioc.c
@@ -0,0 +1,98 @@
+/*
+ * Test program to trigger various ext4 ioctl's
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+
+#if (!defined(EXT4_IOC_ALLOC_DA_BLKS) && defined(__linux__))
+#define EXT4_IOC_ALLOC_DA_BLKS		_IO('f', 12)
+#endif
+
+#if (!defined(EXT4_IOC_SWAP_BOOT) && defined(__linux__))
+#define EXT4_IOC_SWAP_BOOT		_IO('f', 17)
+#endif
+
+#if (!defined(EXT4_IOC_PRECACHE_EXTENTS) && defined(__linux__))
+#define EXT4_IOC_PRECACHE_EXTENTS	_IO('f', 18)
+#endif
+
+#if (!defined(EXT4_IOC_CLEAR_ES_CACHE) && defined(__linux__))
+#define EXT4_IOC_CLEAR_ES_CACHE		_IO('f', 40)
+#endif
+
+
+#define EXT4_F_RW	0x0001
+
+struct cmd {
+	const char	*cmd;
+	unsigned long	ioc;
+	int		flags;
+};
+
+struct cmd cmds[] = {
+	{ "alloc_da_blks", EXT4_IOC_ALLOC_DA_BLKS, EXT4_F_RW },
+	{ "precache", EXT4_IOC_PRECACHE_EXTENTS, 0 },
+	{ "swap_boot", EXT4_IOC_SWAP_BOOT, EXT4_F_RW },
+	{ "clear_es_cache", EXT4_IOC_CLEAR_ES_CACHE, EXT4_F_RW },
+	{ NULL, 0 }
+};
+
+const char *progname;
+
+void usage()
+{
+	struct cmd *p;
+
+	fprintf(stderr, "Usage: %s <cmd> <file>\n\n", progname);
+	fprintf(stderr, "Available commands:\n");
+	for (p = cmds; p->cmd; p++) {
+		fprintf(stderr, "\t%s\n", p->cmd);
+	}
+	exit(1);
+}
+
+int do_single_cmd(const char *fn, struct cmd *p)
+{
+	int	fd;
+	int	oflags = O_RDONLY;
+
+	if (p->flags & EXT4_F_RW)
+		oflags = O_RDWR;
+	fd = open(fn, oflags, 0);
+	if (fd < 0) {
+		perror("open");
+		return 1;
+	}
+	if (ioctl(fd, p->ioc) < 0) {
+		perror("ioctl");
+		return 1;
+	}
+	close(fd);
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	int	i, fails = 0;
+	struct cmd *p;
+
+	progname = argv[0];
+	if (argc < 3 || strcmp(argv[1], "help") == 0)
+		usage();
+	for (p = cmds; p->cmd; p++) {
+		if (strcmp(argv[1], p->cmd) == 0)
+			break;
+	}
+	if (p->cmd == NULL) {
+		fprintf(stderr, "Invalid command: %s\n", argv[1]);
+		usage();
+	}
+	for (i = 2; i < argc; i++)
+		fails += do_single_cmd(argv[i], p);
+	return fails;
+}
diff --git a/contrib/fallocate.c b/contrib/fallocate.c
index 1f9b59a..16c08ab 100644
--- a/contrib/fallocate.c
+++ b/contrib/fallocate.c
@@ -18,11 +18,15 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
  */
 
+#ifndef _LARGEFILE_SOURCE
 #define _LARGEFILE_SOURCE
+#endif
+#ifndef _LARGEFILE64_SOURCE
 #define _LARGEFILE64_SOURCE
+#endif
 
 #include <sys/stat.h>
 #include <sys/syscall.h>
@@ -36,6 +40,8 @@
 // #include <linux/falloc.h>
 #define FALLOC_FL_KEEP_SIZE	0x01
 #define FALLOC_FL_PUNCH_HOLE	0x02 /* de-allocates range */
+#define FALLOC_FL_COLLAPSE_RANGE	0x08
+#define FALLOC_FL_ZERO_RANGE		0x10
 
 void usage(void)
 {
@@ -89,13 +95,13 @@
 	int	fd;
 	char	*fname;
 	int	opt;
-	loff_t	length = -2LL;
-	loff_t	offset = 0;
+	ext2_loff_t length = -2LL;
+	ext2_loff_t offset = 0;
 	int	falloc_mode = 0;
 	int	error;
 	int	tflag = 0;
 
-	while ((opt = getopt(argc, argv, "npl:o:t")) != -1) {
+	while ((opt = getopt(argc, argv, "npl:o:tzc")) != -1) {
 		switch(opt) {
 		case 'n':
 			/* do not change filesize */
@@ -106,6 +112,16 @@
 			falloc_mode = (FALLOC_FL_PUNCH_HOLE |
 				       FALLOC_FL_KEEP_SIZE);
 			break;
+		case 'c':
+			/* collapse range mode */
+			falloc_mode = (FALLOC_FL_COLLAPSE_RANGE |
+				       FALLOC_FL_KEEP_SIZE);
+			break;
+		case 'z':
+			/* zero range mode */
+			falloc_mode = (FALLOC_FL_ZERO_RANGE |
+				       FALLOC_FL_KEEP_SIZE);
+			break;
 		case 'l':
 			length = cvtnum(optarg);
 			break;
diff --git a/contrib/fsstress.c b/contrib/fsstress.c
new file mode 100644
index 0000000..2a98348
--- /dev/null
+++ b/contrib/fsstress.c
@@ -0,0 +1,2701 @@
+/*
+ * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+ * Mountain View, CA  94043, or:
+ *
+ * http://www.sgi.com
+ *
+ * For further information regarding this notice, see:
+ *
+ * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ */
+
+#define NO_XFS
+#define HAVE_SYS_PRCTL_H
+#define _LARGEFILE64_SOURCE
+
+#define MAXNAMELEN 1024
+struct dioattr {
+	int d_miniosz, d_maxiosz, d_mem;
+};
+
+#define MIN(a,b) ((a)<(b) ? (a):(b))
+#define MAX(a,b) ((a)>(b) ? (a):(b))
+
+#include <sys/stat.h>
+#include <sys/statvfs.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/wait.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <dirent.h>
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#ifndef O_DIRECT
+#define O_DIRECT 040000
+#endif
+
+#ifdef HAVE_SYS_PRCTL_H
+# include <sys/prctl.h>
+#endif
+
+#define XFS_ERRTAG_MAX		17
+
+typedef enum {
+#ifndef NO_XFS
+	OP_ALLOCSP,
+	OP_ATTR_REMOVE,
+	OP_ATTR_SET,
+	OP_BULKSTAT,
+	OP_BULKSTAT1,
+#endif
+	OP_CHOWN,
+	OP_CREAT,
+	OP_DREAD,
+	OP_DWRITE,
+	OP_FDATASYNC,
+#ifndef NO_XFS
+	OP_FREESP,
+#endif
+	OP_FSYNC,
+	OP_GETDENTS,
+	OP_LINK,
+	OP_MKDIR,
+	OP_MKNOD,
+	OP_READ,
+	OP_READLINK,
+	OP_RENAME,
+#ifndef NO_XFS
+	OP_RESVSP,
+#endif
+	OP_RMDIR,
+	OP_STAT,
+	OP_SYMLINK,
+	OP_SYNC,
+	OP_TRUNCATE,
+	OP_UNLINK,
+#ifndef NO_XFS
+	OP_UNRESVSP,
+#endif
+	OP_WRITE,
+	OP_LAST
+} opty_t;
+
+typedef void (*opfnc_t) (int, long);
+
+typedef struct opdesc {
+	opty_t op;
+	char *name;
+	opfnc_t func;
+	int freq;
+	int iswrite;
+	int isxfs;
+} opdesc_t;
+
+typedef struct fent {
+	int id;
+	int parent;
+} fent_t;
+
+typedef struct flist {
+	int nfiles;
+	int nslots;
+	int tag;
+	fent_t *fents;
+} flist_t;
+
+typedef struct pathname {
+	int len;
+	char *path;
+} pathname_t;
+
+#define	FT_DIR	0
+#define	FT_DIRm	(1 << FT_DIR)
+#define	FT_REG	1
+#define	FT_REGm	(1 << FT_REG)
+#define	FT_SYM	2
+#define	FT_SYMm	(1 << FT_SYM)
+#define	FT_DEV	3
+#define	FT_DEVm	(1 << FT_DEV)
+#define	FT_RTF	4
+#define	FT_RTFm	(1 << FT_RTF)
+#define	FT_nft	5
+#define	FT_ANYm	((1 << FT_nft) - 1)
+#define	FT_REGFILE	(FT_REGm | FT_RTFm)
+#define	FT_NOTDIR	(FT_ANYm & ~FT_DIRm)
+
+#define	FLIST_SLOT_INCR	16
+#define	NDCACHE	64
+
+#define	MAXFSIZE	((1ULL << 63) - 1ULL)
+#define	MAXFSIZE32	((1ULL << 40) - 1ULL)
+
+void allocsp_f(int, long);
+void attr_remove_f(int, long);
+void attr_set_f(int, long);
+void bulkstat_f(int, long);
+void bulkstat1_f(int, long);
+void chown_f(int, long);
+void creat_f(int, long);
+void dread_f(int, long);
+void dwrite_f(int, long);
+void fdatasync_f(int, long);
+void freesp_f(int, long);
+void fsync_f(int, long);
+void getdents_f(int, long);
+void link_f(int, long);
+void mkdir_f(int, long);
+void mknod_f(int, long);
+void read_f(int, long);
+void readlink_f(int, long);
+void rename_f(int, long);
+void resvsp_f(int, long);
+void rmdir_f(int, long);
+void stat_f(int, long);
+void symlink_f(int, long);
+void sync_f(int, long);
+void truncate_f(int, long);
+void unlink_f(int, long);
+void unresvsp_f(int, long);
+void write_f(int, long);
+
+opdesc_t ops[] = {
+#ifndef NO_XFS
+	{OP_ALLOCSP, "allocsp", allocsp_f, 1, 1, 1},
+	{OP_ATTR_REMOVE, "attr_remove", attr_remove_f, /* 1 */ 0, 1, 1},
+	{OP_ATTR_SET, "attr_set", attr_set_f, /* 2 */ 0, 1, 1},
+	{OP_BULKSTAT, "bulkstat", bulkstat_f, 1, 0, 1},
+	{OP_BULKSTAT1, "bulkstat1", bulkstat1_f, 1, 0, 1},
+#endif
+	{OP_CHOWN, "chown", chown_f, 3, 1, 0},
+	{OP_CREAT, "creat", creat_f, 4, 1, 0},
+	{OP_DREAD, "dread", dread_f, 4, 0, 0},
+	{OP_DWRITE, "dwrite", dwrite_f, 4, 1, 0},
+	{OP_FDATASYNC, "fdatasync", fdatasync_f, 1, 1, 0},
+#ifndef NO_XFS
+	{OP_FREESP, "freesp", freesp_f, 1, 1, 1},
+#endif
+	{OP_FSYNC, "fsync", fsync_f, 1, 1, 0},
+	{OP_GETDENTS, "getdents", getdents_f, 1, 0, 0},
+	{OP_LINK, "link", link_f, 1, 1, 0},
+	{OP_MKDIR, "mkdir", mkdir_f, 2, 1, 0},
+	{OP_MKNOD, "mknod", mknod_f, 2, 1, 0},
+	{OP_READ, "read", read_f, 1, 0, 0},
+	{OP_READLINK, "readlink", readlink_f, 1, 0, 0},
+	{OP_RENAME, "rename", rename_f, 2, 1, 0},
+#ifndef NO_XFS
+	{OP_RESVSP, "resvsp", resvsp_f, 1, 1, 1},
+#endif
+	{OP_RMDIR, "rmdir", rmdir_f, 1, 1, 0},
+	{OP_STAT, "stat", stat_f, 1, 0, 0},
+	{OP_SYMLINK, "symlink", symlink_f, 2, 1, 0},
+	{OP_SYNC, "sync", sync_f, 1, 0, 0},
+	{OP_TRUNCATE, "truncate", truncate_f, 2, 1, 0},
+	{OP_UNLINK, "unlink", unlink_f, 1, 1, 0},
+#ifndef NO_XFS
+	{OP_UNRESVSP, "unresvsp", unresvsp_f, 1, 1, 1},
+#endif
+	{OP_WRITE, "write", write_f, 4, 1, 0},
+}, *ops_end;
+
+flist_t flist[FT_nft] = {
+	{0, 0, 'd', NULL},
+	{0, 0, 'f', NULL},
+	{0, 0, 'l', NULL},
+	{0, 0, 'c', NULL},
+	{0, 0, 'r', NULL},
+};
+
+int dcache[NDCACHE];
+int errrange;
+int errtag;
+opty_t *freq_table;
+int freq_table_size;
+#ifndef NO_XFS
+xfs_fsop_geom_t geom;
+#endif
+char *homedir;
+int *ilist;
+int ilistlen;
+off64_t maxfsize;
+char *myprog;
+int namerand;
+int nameseq;
+int nops;
+int nproc = 1;
+int operations = 1;
+int procid;
+int rtpct;
+unsigned long seed = 0;
+ino_t top_ino;
+int verbose = 0;
+#ifndef NO_XFS
+int no_xfs = 0;
+#else
+int no_xfs = 1;
+#endif
+sig_atomic_t should_stop = 0;
+
+void add_to_flist(int, int, int);
+void append_pathname(pathname_t *, char *);
+#ifndef NO_XFS
+int attr_list_path(pathname_t *, char *, const int, int, attrlist_cursor_t *);
+int attr_remove_path(pathname_t *, const char *, int);
+int attr_set_path(pathname_t *, const char *, const char *, const int, int);
+#endif
+void check_cwd(void);
+int creat_path(pathname_t *, mode_t);
+void dcache_enter(int, int);
+void dcache_init(void);
+fent_t *dcache_lookup(int);
+void dcache_purge(int);
+void del_from_flist(int, int);
+int dirid_to_name(char *, int);
+void doproc(void);
+void fent_to_name(pathname_t *, flist_t *, fent_t *);
+void fix_parent(int, int);
+void free_pathname(pathname_t *);
+int generate_fname(fent_t *, int, pathname_t *, int *, int *);
+int get_fname(int, long, pathname_t *, flist_t **, fent_t **, int *);
+void init_pathname(pathname_t *);
+int lchown_path(pathname_t *, uid_t, gid_t);
+int link_path(pathname_t *, pathname_t *);
+int lstat64_path(pathname_t *, struct stat64 *);
+void make_freq_table(void);
+int mkdir_path(pathname_t *, mode_t);
+int mknod_path(pathname_t *, mode_t, dev_t);
+void namerandpad(int, char *, int);
+int open_path(pathname_t *, int);
+DIR *opendir_path(pathname_t *);
+void process_freq(char *);
+int readlink_path(pathname_t *, char *, size_t);
+int rename_path(pathname_t *, pathname_t *);
+int rmdir_path(pathname_t *);
+void separate_pathname(pathname_t *, char *, pathname_t *);
+void show_ops(int, char *);
+int stat64_path(pathname_t *, struct stat64 *);
+int symlink_path(const char *, pathname_t *);
+int truncate64_path(pathname_t *, off64_t);
+int unlink_path(pathname_t *);
+void usage(void);
+void write_freq(void);
+void zero_freq(void);
+
+void sg_handler(int signum)
+{
+	should_stop = 1;
+}
+
+int main(int argc, char **argv)
+{
+	char buf[10];
+	int c;
+	char *dirname = NULL;
+	int fd;
+	int i;
+	int cleanup = 0;
+	int loops = 1;
+	int loopcntr = 1;
+	char cmd[256];
+#ifndef NO_XFS
+	int j;
+#endif
+	char *p;
+	int stat;
+	struct timeval t;
+#ifndef NO_XFS
+	ptrdiff_t srval;
+#endif
+	int nousage = 0;
+#ifndef NO_XFS
+	xfs_error_injection_t err_inj;
+#endif
+	struct sigaction action;
+
+	errrange = errtag = 0;
+	umask(0);
+	nops = sizeof(ops) / sizeof(ops[0]);
+	ops_end = &ops[nops];
+	myprog = argv[0];
+	while ((c = getopt(argc, argv, "cd:e:f:i:l:n:p:rs:vwzHSX")) != -1) {
+		switch (c) {
+		case 'c':
+			/*Don't cleanup */
+			cleanup = 1;
+			break;
+		case 'd':
+			dirname = optarg;
+			break;
+		case 'e':
+			sscanf(optarg, "%d", &errtag);
+			if (errtag < 0) {
+				errtag = -errtag;
+				errrange = 1;
+			} else if (errtag == 0)
+				errtag = -1;
+			if (errtag >= XFS_ERRTAG_MAX) {
+				fprintf(stderr,
+					"error tag %d too large (max %d)\n",
+					errtag, XFS_ERRTAG_MAX - 1);
+				exit(1);
+			}
+			break;
+		case 'f':
+			process_freq(optarg);
+			break;
+		case 'i':
+			ilist = realloc(ilist, ++ilistlen * sizeof(*ilist));
+			ilist[ilistlen - 1] = strtol(optarg, &p, 16);
+			break;
+		case 'l':
+			loops = atoi(optarg);
+			break;
+		case 'n':
+			operations = atoi(optarg);
+			break;
+		case 'p':
+			nproc = atoi(optarg);
+			break;
+		case 'r':
+			namerand = 1;
+			break;
+		case 's':
+			seed = strtoul(optarg, NULL, 0);
+			break;
+		case 'v':
+			verbose = 1;
+			break;
+		case 'w':
+			write_freq();
+			break;
+		case 'z':
+			zero_freq();
+			break;
+		case 'S':
+			show_ops(0, NULL);
+			printf("\n");
+			nousage = 1;
+			break;
+		case '?':
+			fprintf(stderr, "%s - invalid parameters\n", myprog);
+			/* fall through */
+		case 'H':
+			usage();
+			exit(1);
+		case 'X':
+			no_xfs = 1;
+			break;
+		}
+	}
+
+	if (no_xfs && errtag) {
+		fprintf(stderr, "error injection only works on XFS\n");
+		exit(1);
+	}
+
+	if (no_xfs) {
+		int i;
+		for (i = 0; ops + i < ops_end; ++i) {
+			if (ops[i].isxfs)
+				ops[i].freq = 0;
+		}
+	}
+
+	make_freq_table();
+
+	while (((loopcntr <= loops) || (loops == 0)) && !should_stop) {
+		if (!dirname) {
+			/* no directory specified */
+			if (!nousage)
+				usage();
+			exit(1);
+		}
+
+		(void)mkdir(dirname, 0777);
+		if (chdir(dirname) < 0) {
+			perror(dirname);
+			exit(1);
+		}
+		sprintf(buf, "fss%x", getpid());
+		fd = creat(buf, 0666);
+		if (lseek64(fd, (off64_t) (MAXFSIZE32 + 1ULL), SEEK_SET) < 0)
+			maxfsize = (off64_t) MAXFSIZE32;
+		else
+			maxfsize = (off64_t) MAXFSIZE;
+		dcache_init();
+		setlinebuf(stdout);
+		if (!seed) {
+			gettimeofday(&t, NULL);
+			seed = (int)t.tv_sec ^ (int)t.tv_usec;
+			printf("seed = %ld\n", seed);
+		}
+#ifndef NO_XFS
+		if (!no_xfs) {
+			memset(&geom, 0, sizeof(geom));
+			i = ioctl(fd, XFS_IOC_FSGEOMETRY, &geom);
+			if (i >= 0 && geom.rtblocks)
+				rtpct = MIN(MAX(geom.rtblocks * 100 /
+						(geom.rtblocks +
+						 geom.datablocks), 1), 99);
+			else
+				rtpct = 0;
+		}
+		if (errtag != 0) {
+			if (errrange == 0) {
+				if (errtag <= 0) {
+					srandom(seed);
+					j = random() % 100;
+
+					for (i = 0; i < j; i++)
+						(void)random();
+
+					errtag =
+					    (random() % (XFS_ERRTAG_MAX - 1)) +
+					    1;
+				}
+			} else {
+				srandom(seed);
+				j = random() % 100;
+
+				for (i = 0; i < j; i++)
+					(void)random();
+
+				errtag +=
+				    (random() % (XFS_ERRTAG_MAX - errtag));
+			}
+			printf("Injecting failure on tag #%d\n", errtag);
+			memset(&err_inj, 0, sizeof(err_inj));
+			err_inj.errtag = errtag;
+			err_inj.fd = fd;
+			srval = ioctl(fd, XFS_IOC_ERROR_INJECTION, &err_inj);
+			if (srval < -1) {
+				perror
+				    ("fsstress - XFS_SYSSGI error injection call");
+				close(fd);
+				unlink(buf);
+				exit(1);
+			}
+		} else
+#endif
+			close(fd);
+		unlink(buf);
+
+
+		if (nproc == 1) {
+			procid = 0;
+			doproc();
+		} else {
+			setpgid(0, 0);
+			action.sa_handler = sg_handler;
+			sigemptyset(&action.sa_mask);
+			action.sa_flags = 0;
+			if (sigaction(SIGTERM, &action, 0)) {
+				perror("sigaction failed");
+				exit(1);
+			}
+
+			for (i = 0; i < nproc; i++) {
+				if (fork() == 0) {
+
+					action.sa_handler = SIG_DFL;
+					sigemptyset(&action.sa_mask);
+					if (sigaction(SIGTERM, &action, 0))
+						return 1;
+#ifdef HAVE_SYS_PRCTL_H
+					prctl(PR_SET_PDEATHSIG, SIGKILL);
+					if (getppid() == 1) /* parent died already? */
+						return 0;
+#endif
+					procid = i;
+					doproc();
+					return 0;
+				}
+			}
+			while (wait(&stat) > 0 && !should_stop) {
+				continue;
+			}
+			if (should_stop) {
+				action.sa_flags = SA_RESTART;
+				sigaction(SIGTERM, &action, 0);
+				kill(-getpid(), SIGTERM);
+				while (wait(&stat) > 0)
+					continue;
+			}
+		}
+#ifndef NO_XFS
+		if (errtag != 0) {
+			memset(&err_inj, 0, sizeof(err_inj));
+			err_inj.errtag = 0;
+			err_inj.fd = fd;
+			if ((srval =
+			     ioctl(fd, XFS_IOC_ERROR_CLEARALL,
+				   &err_inj)) != 0) {
+				fprintf(stderr, "Bad ej clear on %d (%d).\n",
+					fd, errno);
+				perror
+				    ("fsstress - XFS_SYSSGI clear error injection call");
+				close(fd);
+				exit(1);
+			}
+			close(fd);
+		}
+#endif
+		if (cleanup == 0) {
+			sprintf(cmd, "rm -rf %s/*", dirname);
+			system(cmd);
+			for (i = 0; i < FT_nft; i++) {
+				flist[i].nslots = 0;
+				flist[i].nfiles = 0;
+				free(flist[i].fents);
+				flist[i].fents = NULL;
+			}
+		}
+		loopcntr++;
+	}
+	return 0;
+}
+
+void add_to_flist(int ft, int id, int parent)
+{
+	fent_t *fep;
+	flist_t *ftp;
+
+	ftp = &flist[ft];
+	if (ftp->nfiles == ftp->nslots) {
+		ftp->nslots += FLIST_SLOT_INCR;
+		ftp->fents = realloc(ftp->fents, ftp->nslots * sizeof(fent_t));
+	}
+	fep = &ftp->fents[ftp->nfiles++];
+	fep->id = id;
+	fep->parent = parent;
+}
+
+void append_pathname(pathname_t * name, char *str)
+{
+	int len;
+
+	len = strlen(str);
+#ifdef DEBUG
+	if (len && *str == '/' && name->len == 0) {
+		fprintf(stderr, "fsstress: append_pathname failure\n");
+		chdir(homedir);
+		abort();
+
+	}
+#endif
+	name->path = realloc(name->path, name->len + 1 + len);
+	strcpy(&name->path[name->len], str);
+	name->len += len;
+}
+
+#ifndef NO_XFS
+int
+attr_list_path(pathname_t * name, char *buffer, const int buffersize, int flags,
+	       attrlist_cursor_t * cursor)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = attr_list(name->path, buffer, buffersize, flags, cursor);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = attr_list_path(&newname, buffer, buffersize, flags,
+				      cursor);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+int attr_remove_path(pathname_t * name, const char *attrname, int flags)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = attr_remove(name->path, attrname, flags);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = attr_remove_path(&newname, attrname, flags);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+int
+attr_set_path(pathname_t * name, const char *attrname, const char *attrvalue,
+	      const int valuelength, int flags)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = attr_set(name->path, attrname, attrvalue, valuelength, flags);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = attr_set_path(&newname, attrname, attrvalue, valuelength,
+				     flags);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+#endif
+
+void check_cwd(void)
+{
+#ifdef DEBUG
+	struct stat64 statbuf;
+
+	if (stat64(".", &statbuf) == 0 && statbuf.st_ino == top_ino)
+		return;
+	chdir(homedir);
+	fprintf(stderr, "fsstress: check_cwd failure\n");
+	abort();
+
+#endif
+}
+
+int creat_path(pathname_t * name, mode_t mode)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = creat(name->path, mode);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = creat_path(&newname, mode);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+void dcache_enter(int dirid, int slot)
+{
+	dcache[dirid % NDCACHE] = slot;
+}
+
+void dcache_init(void)
+{
+	int i;
+
+	for (i = 0; i < NDCACHE; i++)
+		dcache[i] = -1;
+}
+
+fent_t *dcache_lookup(int dirid)
+{
+	fent_t *fep;
+	int i;
+
+	i = dcache[dirid % NDCACHE];
+	if (i >= 0 && (fep = &flist[FT_DIR].fents[i])->id == dirid)
+		return fep;
+	return NULL;
+}
+
+void dcache_purge(int dirid)
+{
+	int *dcp;
+
+	dcp = &dcache[dirid % NDCACHE];
+	if (*dcp >= 0 && flist[FT_DIR].fents[*dcp].id == dirid)
+		*dcp = -1;
+}
+
+void del_from_flist(int ft, int slot)
+{
+	flist_t *ftp;
+
+	ftp = &flist[ft];
+	if (ft == FT_DIR)
+		dcache_purge(ftp->fents[slot].id);
+	if (slot != ftp->nfiles - 1) {
+		if (ft == FT_DIR)
+			dcache_purge(ftp->fents[ftp->nfiles - 1].id);
+		ftp->fents[slot] = ftp->fents[--ftp->nfiles];
+	} else
+		ftp->nfiles--;
+}
+
+fent_t *dirid_to_fent(int dirid)
+{
+	fent_t *efep;
+	fent_t *fep;
+	flist_t *flp;
+
+	if ((fep = dcache_lookup(dirid)))
+		return fep;
+	flp = &flist[FT_DIR];
+	for (fep = flp->fents, efep = &fep[flp->nfiles]; fep < efep; fep++) {
+		if (fep->id == dirid) {
+			dcache_enter(dirid, fep - flp->fents);
+			return fep;
+		}
+	}
+	return NULL;
+}
+
+void doproc(void)
+{
+	struct stat64 statbuf;
+	char buf[10];
+	int opno;
+	int rval;
+	opdesc_t *p;
+
+	sprintf(buf, "p%x", procid);
+	(void)mkdir(buf, 0777);
+	if (chdir(buf) < 0 || stat64(".", &statbuf) < 0) {
+		perror(buf);
+		_exit(1);
+	}
+	top_ino = statbuf.st_ino;
+	homedir = getcwd(NULL, -1);
+	seed += procid;
+	srandom(seed);
+	if (namerand)
+		namerand = random();
+	for (opno = 0; opno < operations; opno++) {
+		p = &ops[freq_table[random() % freq_table_size]];
+		if ((unsigned long)p->func < 4096)
+			abort();
+
+		p->func(opno, random());
+		/*
+		 * test for forced shutdown by stat'ing the test
+		 * directory.  If this stat returns EIO, assume
+		 * the forced shutdown happened.
+		 */
+		if (errtag != 0 && opno % 100 == 0) {
+			rval = stat64(".", &statbuf);
+			if (rval == EIO) {
+				fprintf(stderr, "Detected EIO\n");
+				return;
+			}
+		}
+	}
+}
+
+void fent_to_name(pathname_t * name, flist_t * flp, fent_t * fep)
+{
+	char buf[MAXNAMELEN];
+	int i;
+	fent_t *pfep;
+
+	if (fep == NULL)
+		return;
+	if (fep->parent != -1) {
+		pfep = dirid_to_fent(fep->parent);
+		fent_to_name(name, &flist[FT_DIR], pfep);
+		append_pathname(name, "/");
+	}
+	i = sprintf(buf, "%c%x", flp->tag, fep->id);
+	namerandpad(fep->id, buf, i);
+	append_pathname(name, buf);
+}
+
+void fix_parent(int oldid, int newid)
+{
+	fent_t *fep;
+	flist_t *flp;
+	int i;
+	int j;
+
+	for (i = 0, flp = flist; i < FT_nft; i++, flp++) {
+		for (j = 0, fep = flp->fents; j < flp->nfiles; j++, fep++) {
+			if (fep->parent == oldid)
+				fep->parent = newid;
+		}
+	}
+}
+
+void free_pathname(pathname_t * name)
+{
+	if (name->path) {
+		free(name->path);
+		name->path = NULL;
+		name->len = 0;
+	}
+}
+
+int generate_fname(fent_t * fep, int ft, pathname_t * name, int *idp, int *v)
+{
+	char buf[MAXNAMELEN];
+	flist_t *flp;
+	int id;
+	int j;
+	int len;
+
+	flp = &flist[ft];
+	len = sprintf(buf, "%c%x", flp->tag, id = nameseq++);
+	namerandpad(id, buf, len);
+	if (fep) {
+		fent_to_name(name, &flist[FT_DIR], fep);
+		append_pathname(name, "/");
+	}
+	append_pathname(name, buf);
+	*idp = id;
+	*v = verbose;
+	for (j = 0; !*v && j < ilistlen; j++) {
+		if (ilist[j] == id) {
+			*v = 1;
+			break;
+		}
+	}
+	return 1;
+}
+
+int
+get_fname(int which, long r, pathname_t * name, flist_t ** flpp, fent_t ** fepp,
+	  int *v)
+{
+	int c;
+	fent_t *fep;
+	flist_t *flp;
+	int i;
+	int j;
+	int x;
+
+	for (i = 0, c = 0, flp = flist; i < FT_nft; i++, flp++) {
+		if (which & (1 << i))
+			c += flp->nfiles;
+	}
+	if (c == 0) {
+		if (flpp)
+			*flpp = NULL;
+		if (fepp)
+			*fepp = NULL;
+		*v = verbose;
+		return 0;
+	}
+	x = (int)(r % c);
+	for (i = 0, c = 0, flp = flist; i < FT_nft; i++, flp++) {
+		if (which & (1 << i)) {
+			if (x < c + flp->nfiles) {
+				fep = &flp->fents[x - c];
+				if (name)
+					fent_to_name(name, flp, fep);
+				if (flpp)
+					*flpp = flp;
+				if (fepp)
+					*fepp = fep;
+				*v = verbose;
+				for (j = 0; !*v && j < ilistlen; j++) {
+					if (ilist[j] == fep->id) {
+						*v = 1;
+						break;
+					}
+				}
+				return 1;
+			}
+			c += flp->nfiles;
+		}
+	}
+#ifdef DEBUG
+	fprintf(stderr, "fsstress: get_fname failure\n");
+	abort();
+#endif
+	return -1;
+
+}
+
+void init_pathname(pathname_t * name)
+{
+	name->len = 0;
+	name->path = NULL;
+}
+
+int lchown_path(pathname_t * name, uid_t owner, gid_t group)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = lchown(name->path, owner, group);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = lchown_path(&newname, owner, group);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+int link_path(pathname_t * name1, pathname_t * name2)
+{
+	char buf1[MAXNAMELEN];
+	char buf2[MAXNAMELEN];
+	int down1;
+	pathname_t newname1;
+	pathname_t newname2;
+	int rval;
+
+	rval = link(name1->path, name2->path);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name1, buf1, &newname1);
+	separate_pathname(name2, buf2, &newname2);
+	if (strcmp(buf1, buf2) == 0) {
+		if (chdir(buf1) == 0) {
+			rval = link_path(&newname1, &newname2);
+			chdir("..");
+		}
+	} else {
+		if (strcmp(buf1, "..") == 0)
+			down1 = 0;
+		else if (strcmp(buf2, "..") == 0)
+			down1 = 1;
+		else if (strlen(buf1) == 0)
+			down1 = 0;
+		else if (strlen(buf2) == 0)
+			down1 = 1;
+		else
+			down1 = MAX(newname1.len, 3 + name2->len) <=
+			    MAX(3 + name1->len, newname2.len);
+		if (down1) {
+			free_pathname(&newname2);
+			append_pathname(&newname2, "../");
+			append_pathname(&newname2, name2->path);
+			if (chdir(buf1) == 0) {
+				rval = link_path(&newname1, &newname2);
+				chdir("..");
+			}
+		} else {
+			free_pathname(&newname1);
+			append_pathname(&newname1, "../");
+			append_pathname(&newname1, name1->path);
+			if (chdir(buf2) == 0) {
+				rval = link_path(&newname1, &newname2);
+				chdir("..");
+			}
+		}
+	}
+	free_pathname(&newname1);
+	free_pathname(&newname2);
+	return rval;
+}
+
+int lstat64_path(pathname_t * name, struct stat64 *sbuf)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = lstat64(name->path, sbuf);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = lstat64_path(&newname, sbuf);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+void make_freq_table(void)
+{
+	int f;
+	int i;
+	opdesc_t *p;
+
+	for (p = ops, f = 0; p < ops_end; p++)
+		f += p->freq;
+	freq_table = malloc(f * sizeof(*freq_table));
+	freq_table_size = f;
+	for (p = ops, i = 0; p < ops_end; p++) {
+		for (f = 0; f < p->freq; f++, i++)
+			freq_table[i] = p->op;
+	}
+}
+
+int mkdir_path(pathname_t * name, mode_t mode)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = mkdir(name->path, mode);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = mkdir_path(&newname, mode);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+int mknod_path(pathname_t * name, mode_t mode, dev_t dev)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = mknod(name->path, mode, dev);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = mknod_path(&newname, mode, dev);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+void namerandpad(int id, char *buf, int i)
+{
+	int bucket;
+	static int buckets[] = { 2, 4, 8, 16, 32, 64, 128, MAXNAMELEN - 1 };
+	int padlen;
+	int padmod;
+
+	if (namerand == 0)
+		return;
+	bucket = (id ^ namerand) % (sizeof(buckets) / sizeof(buckets[0]));
+	padmod = buckets[bucket] + 1 - i;
+	if (padmod <= 0)
+		return;
+	padlen = (id ^ namerand) % padmod;
+	if (padlen) {
+		memset(&buf[i], 'X', padlen);
+		buf[i + padlen] = '\0';
+	}
+}
+
+int open_path(pathname_t * name, int oflag)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = open(name->path, oflag);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = open_path(&newname, oflag);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+DIR *opendir_path(pathname_t * name)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	DIR *rval;
+
+	rval = opendir(name->path);
+	if (rval || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = opendir_path(&newname);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+void process_freq(char *arg)
+{
+	opdesc_t *p;
+	char *s;
+
+	s = strchr(arg, '=');
+	if (s == NULL) {
+		fprintf(stderr, "bad argument '%s'\n", arg);
+		exit(1);
+	}
+	*s++ = '\0';
+	for (p = ops; p < ops_end; p++) {
+		if (strcmp(arg, p->name) == 0) {
+			p->freq = atoi(s);
+			return;
+		}
+	}
+	fprintf(stderr, "can't find op type %s for -f\n", arg);
+	exit(1);
+}
+
+int readlink_path(pathname_t * name, char *lbuf, size_t lbufsiz)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = readlink(name->path, lbuf, lbufsiz);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = readlink_path(&newname, lbuf, lbufsiz);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+int rename_path(pathname_t * name1, pathname_t * name2)
+{
+	char buf1[MAXNAMELEN];
+	char buf2[MAXNAMELEN];
+	int down1;
+	pathname_t newname1;
+	pathname_t newname2;
+	int rval;
+
+	rval = rename(name1->path, name2->path);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name1, buf1, &newname1);
+	separate_pathname(name2, buf2, &newname2);
+	if (strcmp(buf1, buf2) == 0) {
+		if (chdir(buf1) == 0) {
+			rval = rename_path(&newname1, &newname2);
+			chdir("..");
+		}
+	} else {
+		if (strcmp(buf1, "..") == 0)
+			down1 = 0;
+		else if (strcmp(buf2, "..") == 0)
+			down1 = 1;
+		else if (strlen(buf1) == 0)
+			down1 = 0;
+		else if (strlen(buf2) == 0)
+			down1 = 1;
+		else
+			down1 = MAX(newname1.len, 3 + name2->len) <=
+			    MAX(3 + name1->len, newname2.len);
+		if (down1) {
+			free_pathname(&newname2);
+			append_pathname(&newname2, "../");
+			append_pathname(&newname2, name2->path);
+			if (chdir(buf1) == 0) {
+				rval = rename_path(&newname1, &newname2);
+				chdir("..");
+			}
+		} else {
+			free_pathname(&newname1);
+			append_pathname(&newname1, "../");
+			append_pathname(&newname1, name1->path);
+			if (chdir(buf2) == 0) {
+				rval = rename_path(&newname1, &newname2);
+				chdir("..");
+			}
+		}
+	}
+	free_pathname(&newname1);
+	free_pathname(&newname2);
+	return rval;
+}
+
+int rmdir_path(pathname_t * name)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = rmdir(name->path);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = rmdir_path(&newname);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+void separate_pathname(pathname_t * name, char *buf, pathname_t * newname)
+{
+	char *slash;
+
+	init_pathname(newname);
+	slash = strchr(name->path, '/');
+	if (slash == NULL) {
+		buf[0] = '\0';
+		return;
+	}
+	*slash = '\0';
+	strcpy(buf, name->path);
+	*slash = '/';
+	append_pathname(newname, slash + 1);
+}
+
+#define WIDTH 80
+
+void show_ops(int flag, char *lead_str)
+{
+	opdesc_t *p;
+
+	if (flag < 0) {
+		/* print in list form */
+		int x = WIDTH;
+
+		for (p = ops; p < ops_end; p++) {
+			if (lead_str != NULL
+			    && x + strlen(p->name) >= WIDTH - 5)
+				x = printf("%s%s", (p == ops) ? "" : "\n",
+					   lead_str);
+			x += printf("%s ", p->name);
+		}
+		printf("\n");
+	} else {
+		int f;
+		for (f = 0, p = ops; p < ops_end; p++)
+			f += p->freq;
+
+		if (f == 0)
+			flag = 1;
+
+		for (p = ops; p < ops_end; p++) {
+			if (flag != 0 || p->freq > 0) {
+				if (lead_str != NULL)
+					printf("%s", lead_str);
+				printf("%20s %d/%d %s\n",
+				       p->name, p->freq, f,
+				       (p->iswrite == 0) ? " " : "write op");
+			}
+		}
+	}
+}
+
+int stat64_path(pathname_t * name, struct stat64 *sbuf)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = stat64(name->path, sbuf);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = stat64_path(&newname, sbuf);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+int symlink_path(const char *name1, pathname_t * name)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	if (!strcmp(name1, name->path)) {
+		printf("yikes! %s %s\n", name1, name->path);
+		return 0;
+	}
+
+	rval = symlink(name1, name->path);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = symlink_path(name1, &newname);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+int truncate64_path(pathname_t * name, off64_t length)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = truncate64(name->path, length);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = truncate64_path(&newname, length);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+int unlink_path(pathname_t * name)
+{
+	char buf[MAXNAMELEN];
+	pathname_t newname;
+	int rval;
+
+	rval = unlink(name->path);
+	if (rval >= 0 || errno != ENAMETOOLONG)
+		return rval;
+	separate_pathname(name, buf, &newname);
+	if (chdir(buf) == 0) {
+		rval = unlink_path(&newname);
+		chdir("..");
+	}
+	free_pathname(&newname);
+	return rval;
+}
+
+void usage(void)
+{
+	printf("Usage: %s -H   or\n", myprog);
+	printf
+	    ("       %s [-c][-d dir][-e errtg][-f op_name=freq][-l loops][-n nops]\n",
+	     myprog);
+	printf("          [-p nproc][-r len][-s seed][-v][-w][-z][-S]\n");
+	printf("where\n");
+	printf
+	    ("   -c               specifies not to remove files(cleanup) after execution\n");
+	printf
+	    ("   -d dir           specifies the base directory for operations\n");
+	printf("   -e errtg         specifies error injection stuff\n");
+	printf
+	    ("   -f op_name=freq  changes the frequency of option name to freq\n");
+	printf("                    the valid operation names are:\n");
+	show_ops(-1, "                        ");
+	printf
+	    ("   -l loops         specifies the no. of times the testrun should loop.\n");
+	printf("                     *use 0 for infinite (default 1)\n");
+	printf
+	    ("   -n nops          specifies the no. of operations per process (default 1)\n");
+	printf
+	    ("   -p nproc         specifies the no. of processes (default 1)\n");
+	printf("   -r               specifies random name padding\n");
+	printf
+	    ("   -s seed          specifies the seed for the random generator (default random)\n");
+	printf("   -v               specifies verbose mode\n");
+	printf
+	    ("   -w               zeros frequencies of non-write operations\n");
+	printf("   -z               zeros frequencies of all operations\n");
+	printf
+	    ("   -S               prints the table of operations (omitting zero frequency)\n");
+	printf("   -H               prints usage and exits\n");
+	printf
+	    ("   -X               don't do anything XFS specific (default with -DNO_XFS)\n");
+}
+
+void write_freq(void)
+{
+	opdesc_t *p;
+
+	for (p = ops; p < ops_end; p++) {
+		if (!p->iswrite)
+			p->freq = 0;
+	}
+}
+
+void zero_freq(void)
+{
+	opdesc_t *p;
+
+	for (p = ops; p < ops_end; p++)
+		p->freq = 0;
+}
+
+#ifndef NO_XFS
+
+void allocsp_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	int fd;
+	struct xfs_flock64 fl;
+	__s64 lr;
+	__s64 off;
+	struct stat64 stb;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: allocsp - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	fd = open_path(&f, O_RDWR);
+	e = fd < 0 ? errno : 0;
+	check_cwd();
+	if (fd < 0) {
+		if (v)
+			printf("%d/%d: allocsp - open %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+	if (fstat64(fd, &stb) < 0) {
+		if (v)
+			printf("%d/%d: allocsp - fstat64 %s failed %d\n",
+			       procid, opno, f.path, errno);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+	lr = ((__s64) random() << 32) + random();
+	off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE);
+	off %= maxfsize;
+	memset(&fl, 0, sizeof(fl));
+	fl.l_whence = SEEK_SET;
+	fl.l_start = off;
+	fl.l_len = 0;
+	e = ioctl(fd, XFS_IOC_ALLOCSP64, &fl) < 0 ? errno : 0;
+	if (v)
+		printf("%d/%d: ioctl(XFS_IOC_ALLOCSP64) %s %lld 0 %d\n",
+		       procid, opno, f.path, (long long)off, e);
+	free_pathname(&f);
+	close(fd);
+}
+
+void attr_remove_f(int opno, long r)
+{
+	attrlist_ent_t *aep;
+	attrlist_t *alist;
+	char *aname;
+	char buf[4096];
+	attrlist_cursor_t cursor;
+	int e;
+	int ent;
+	pathname_t f;
+	int total;
+	int v;
+	int which;
+
+	init_pathname(&f);
+	if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
+		append_pathname(&f, ".");
+	total = 0;
+	memset(&cursor, 0x00, sizeof(cursor));
+	do {
+		e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW,
+				   &cursor);
+		check_cwd();
+		if (e)
+			break;
+		alist = (attrlist_t *) buf;
+		total += alist->al_count;
+	} while (alist->al_more);
+	if (total == 0) {
+		if (v)
+			printf("%d/%d: attr_remove - no attrs for %s\n",
+			       procid, opno, f.path);
+		free_pathname(&f);
+		return;
+	}
+	which = (int)(random() % total);
+	memset(&cursor, 0x00, sizeof(cursor));
+	ent = 0;
+	aname = NULL;
+	do {
+		e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW,
+				   &cursor);
+		check_cwd();
+		if (e)
+			break;
+		alist = (attrlist_t *) buf;
+		if (which < ent + alist->al_count) {
+			aep = (attrlist_ent_t *)
+			    & buf[alist->al_offset[which - ent]];
+			aname = aep->a_name;
+			break;
+		}
+		ent += alist->al_count;
+	} while (alist->al_more);
+	if (aname == NULL) {
+		if (v)
+			printf("%d/%d: attr_remove - name %d not found at %s\n",
+			       procid, opno, which, f.path);
+		free_pathname(&f);
+		return;
+	}
+	e = attr_remove_path(&f, aname, ATTR_DONTFOLLOW) < 0 ? errno : 0;
+	check_cwd();
+	if (v)
+		printf("%d/%d: attr_remove %s %s %d\n",
+		       procid, opno, f.path, aname, e);
+	free_pathname(&f);
+}
+
+void attr_set_f(int opno, long r)
+{
+	char aname[10];
+	char *aval;
+	int e;
+	pathname_t f;
+	int len;
+	static int lengths[] = { 10, 100, 1000, 10000 };
+	int li;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
+		append_pathname(&f, ".");
+	sprintf(aname, "a%x", nameseq++);
+	li = (int)(random() % (sizeof(lengths) / sizeof(lengths[0])));
+	len = (int)(random() % lengths[li]);
+	if (len == 0)
+		len = 1;
+	aval = malloc(len);
+	memset(aval, nameseq & 0xff, len);
+	e = attr_set_path(&f, aname, aval, len, ATTR_DONTFOLLOW) < 0 ?
+	    errno : 0;
+	check_cwd();
+	free(aval);
+	if (v)
+		printf("%d/%d: attr_set %s %s %d\n", procid, opno, f.path,
+		       aname, e);
+	free_pathname(&f);
+}
+
+void bulkstat_f(int opno, long r)
+{
+	__s32 count;
+	int fd;
+	__u64 last;
+	__s32 nent;
+	xfs_bstat_t *t;
+	__int64_t total;
+	xfs_fsop_bulkreq_t bsr;
+
+	last = 0;
+	nent = (r % 999) + 2;
+	t = malloc(nent * sizeof(*t));
+	fd = open(".", O_RDONLY);
+	total = 0;
+
+	memset(&bsr, 0, sizeof(bsr));
+	bsr.lastip = &last;
+	bsr.icount = nent;
+	bsr.ubuffer = t;
+	bsr.ocount = &count;
+
+	while (ioctl(fd, XFS_IOC_FSBULKSTAT, &bsr) == 0 && count > 0)
+		total += count;
+	free(t);
+	if (verbose)
+		printf("%d/%d: bulkstat nent %d total %lld\n",
+		       procid, opno, (int)nent, (long long)total);
+	close(fd);
+}
+
+void bulkstat1_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	int fd;
+	int good;
+	__u64 ino;
+	struct stat64 s;
+	xfs_bstat_t t;
+	int v;
+	xfs_fsop_bulkreq_t bsr;
+
+	good = random() & 1;
+	if (good) {
+		/* use an inode we know exists */
+		init_pathname(&f);
+		if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
+			append_pathname(&f, ".");
+		ino = stat64_path(&f, &s) < 0 ? (ino64_t) r : s.st_ino;
+		check_cwd();
+		free_pathname(&f);
+	} else {
+		/*
+		 * pick a random inode
+		 *
+		 * note this can generate kernel warning messages
+		 * since bulkstat_one will read the disk block that
+		 * would contain a given inode even if that disk
+		 * block doesn't contain inodes.
+		 *
+		 * this is detected later, but not until after the
+		 * warning is displayed.
+		 *
+		 * "XFS: device 0x825- bad inode magic/vsn daddr 0x0 #0"
+		 *
+		 */
+		ino = (ino64_t) r;
+		v = verbose;
+	}
+	fd = open(".", O_RDONLY);
+
+	memset(&bsr, 0, sizeof(bsr));
+	bsr.lastip = &ino;
+	bsr.icount = 1;
+	bsr.ubuffer = &t;
+	bsr.ocount = NULL;
+
+	e = ioctl(fd, XFS_IOC_FSBULKSTAT_SINGLE, &bsr) < 0 ? errno : 0;
+	if (v)
+		printf("%d/%d: bulkstat1 %s ino %lld %d\n",
+		       procid, opno, good ? "real" : "random",
+		       (long long)ino, e);
+	close(fd);
+}
+
+#endif
+
+void chown_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	int nbits;
+	uid_t u;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
+		append_pathname(&f, ".");
+	u = (uid_t) random();
+	nbits = (int)(random() % 32);
+	u &= (1 << nbits) - 1;
+	e = lchown_path(&f, u, -1) < 0 ? errno : 0;
+	check_cwd();
+	if (v)
+		printf("%d/%d: chown %s %d %d\n", procid, opno, f.path, u, e);
+	free_pathname(&f);
+}
+
+void creat_f(int opno, long r)
+{
+	int e;
+	int e1;
+	int extsize;
+	pathname_t f;
+	int fd;
+	fent_t *fep;
+	int id;
+	int parid;
+	int type;
+	int v;
+	int v1;
+	int esz = 0;
+
+	if (!get_fname(FT_DIRm, r, NULL, NULL, &fep, &v1))
+		parid = -1;
+	else
+		parid = fep->id;
+	init_pathname(&f);
+	type = rtpct ? ((random() % 100) > rtpct ? FT_REG : FT_RTF) : FT_REG;
+	if (type == FT_RTF)
+		extsize = (random() % 10) + 1;
+	else
+		extsize = 0;
+	e = generate_fname(fep, type, &f, &id, &v);
+	v |= v1;
+	if (!e) {
+		if (v) {
+			fent_to_name(&f, &flist[FT_DIR], fep);
+			printf("%d/%d: creat - no filename from %s\n",
+			       procid, opno, f.path);
+		}
+		free_pathname(&f);
+		return;
+	}
+	fd = creat_path(&f, 0666);
+	e = fd < 0 ? errno : 0;
+	e1 = 0;
+	check_cwd();
+	esz = 0;
+	if (fd >= 0) {
+#ifndef NO_XFS
+		struct fsxattr a;
+		memset(&a, 0, sizeof(a));
+		if (extsize && ioctl(fd, XFS_IOC_FSGETXATTR, &a) >= 0) {
+			a.fsx_xflags |= XFS_XFLAG_REALTIME;
+			a.fsx_extsize =
+			    geom.rtextsize * geom.blocksize * extsize;
+			if (ioctl(fd, XFS_IOC_FSSETXATTR, &a) < 0)
+				e1 = errno;
+			esz = a.fsx_extsize;
+
+		}
+#endif
+		add_to_flist(type, id, parid);
+		close(fd);
+	}
+	if (v)
+		printf("%d/%d: creat %s x:%d %d %d\n", procid, opno, f.path,
+		       esz, e, e1);
+	free_pathname(&f);
+}
+
+int setdirect(int fd)
+{
+	static int no_direct;
+	int flags;
+
+	if (no_direct)
+		return 0;
+
+	flags = fcntl(fd, F_GETFL, 0);
+	if (flags < 0)
+		return 0;
+
+	if (fcntl(fd, F_SETFL, flags | O_DIRECT) < 0) {
+		if (no_xfs) {
+			no_direct = 1;
+			return 0;
+		}
+		printf("cannot set O_DIRECT: %s\n", strerror(errno));
+		return 0;
+	}
+
+	return 1;
+}
+
+void dread_f(int opno, long r)
+{
+	__int64_t align;
+	char *buf = NULL;
+	struct dioattr diob;
+	int e;
+	pathname_t f;
+	int fd;
+	size_t len;
+	__int64_t lr;
+	off64_t off;
+	struct stat64 stb;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: dread - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	fd = open_path(&f, O_RDONLY);
+
+	e = fd < 0 ? errno : 0;
+	check_cwd();
+	if (fd < 0) {
+		if (v)
+			printf("%d/%d: dread - open %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+
+	if (!setdirect(fd)) {
+		close(fd);
+		free_pathname(&f);
+		return;
+	}
+
+	if (fstat64(fd, &stb) < 0) {
+		if (v)
+			printf("%d/%d: dread - fstat64 %s failed %d\n",
+			       procid, opno, f.path, errno);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+	if (stb.st_size == 0) {
+		if (v)
+			printf("%d/%d: dread - %s zero size\n", procid, opno,
+			       f.path);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+
+	memset(&diob, 0, sizeof(diob));
+	if (no_xfs) {
+		diob.d_miniosz = stb.st_blksize;
+		diob.d_maxiosz = stb.st_blksize * 256;	/* good number ? */
+		diob.d_mem = stb.st_blksize;
+	}
+#ifndef NO_XFS
+	else if (ioctl(fd, XFS_IOC_DIOINFO, &diob) < 0) {
+		if (v)
+			printf
+			    ("%d/%d: dread - ioctl(fd, XFS_IOC_DIOINFO) %s failed %d\n",
+			     procid, opno, f.path, errno);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+#endif
+	align = (__int64_t) diob.d_miniosz;
+	lr = ((__int64_t) random() << 32) + random();
+	off = (off64_t) (lr % stb.st_size);
+	off -= (off % align);
+	lseek64(fd, off, SEEK_SET);
+	len = (random() % (getpagesize() * 32)) + 1;
+	len -= (len % align);
+	if (len <= 0)
+		len = align;
+	else if (len > diob.d_maxiosz)
+		len = diob.d_maxiosz;
+	if ((e = posix_memalign((void **)&buf, diob.d_mem, len)) != 0) {
+		fprintf(stderr, "posix_memalign: %s\n", strerror(e));
+		exit(1);
+	}
+	if (buf == NULL) {
+		fprintf(stderr, "posix_memalign: buf is NULL\n");
+		exit(1);
+	}
+	e = read(fd, buf, len) < 0 ? errno : 0;
+	free(buf);
+	if (v)
+		printf("%d/%d: dread %s [%lld,%ld] %d\n",
+		       procid, opno, f.path, (long long int)off, (long)len, e);
+	free_pathname(&f);
+	close(fd);
+}
+
+void dwrite_f(int opno, long r)
+{
+	__int64_t align;
+	char *buf = NULL;
+	struct dioattr diob;
+	int e;
+	pathname_t f;
+	int fd;
+	size_t len;
+	__int64_t lr;
+	off64_t off;
+	struct stat64 stb;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: dwrite - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	fd = open_path(&f, O_WRONLY);
+	e = fd < 0 ? errno : 0;
+	check_cwd();
+	if (fd < 0) {
+		if (v)
+			printf("%d/%d: dwrite - open %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+
+	if (!setdirect(fd)) {
+		close(fd);
+		free_pathname(&f);
+		return;
+	}
+	if (fstat64(fd, &stb) < 0) {
+		if (v)
+			printf("%d/%d: dwrite - fstat64 %s failed %d\n",
+			       procid, opno, f.path, errno);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+	memset(&diob, 0, sizeof(diob));
+	if (no_xfs) {
+		diob.d_miniosz = stb.st_blksize;
+		diob.d_maxiosz = stb.st_blksize * 256;	/* good number ? */
+		diob.d_mem = stb.st_blksize;
+	}
+#ifndef NO_XFS
+	else if (ioctl(fd, XFS_IOC_DIOINFO, &diob) < 0) {
+		if (v)
+			printf
+			    ("%d/%d: dwrite - ioctl(fd, XFS_IOC_DIOINFO) %s failed %d\n",
+			     procid, opno, f.path, errno);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+#endif
+	align = (__int64_t) diob.d_miniosz;
+	lr = ((__int64_t) random() << 32) + random();
+	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+	off -= (off % align);
+	lseek64(fd, off, SEEK_SET);
+	len = (random() % (getpagesize() * 32)) + 1;
+	len -= (len % align);
+	if (len <= 0)
+		len = align;
+	else if (len > diob.d_maxiosz)
+		len = diob.d_maxiosz;
+	if ((e = posix_memalign((void **)&buf, diob.d_mem, len)) != 0) {
+		fprintf(stderr, "posix_memalign: %s\n", strerror(e));
+		exit(1);
+	}
+	if (buf == NULL) {
+		fprintf(stderr, "posix_memalign: buf is NULL\n");
+		exit(1);
+	}
+	off %= maxfsize;
+	lseek64(fd, off, SEEK_SET);
+	memset(buf, nameseq & 0xff, len);
+	e = write(fd, buf, len) < 0 ? errno : 0;
+	free(buf);
+	if (v)
+		printf("%d/%d: dwrite %s [%lld,%ld] %d\n",
+		       procid, opno, f.path, (long long)off, (long int)len, e);
+	free_pathname(&f);
+	close(fd);
+}
+
+void fdatasync_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	int fd;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: fdatasync - no filename\n",
+			       procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	fd = open_path(&f, O_WRONLY);
+	e = fd < 0 ? errno : 0;
+	check_cwd();
+	if (fd < 0) {
+		if (v)
+			printf("%d/%d: fdatasync - open %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+	e = fdatasync(fd) < 0 ? errno : 0;
+	if (v)
+		printf("%d/%d: fdatasync %s %d\n", procid, opno, f.path, e);
+	free_pathname(&f);
+	close(fd);
+}
+
+#ifndef NO_XFS
+void freesp_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	int fd;
+	struct xfs_flock64 fl;
+	__s64 lr;
+	__s64 off;
+	struct stat64 stb;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: freesp - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	fd = open_path(&f, O_RDWR);
+	e = fd < 0 ? errno : 0;
+	check_cwd();
+	if (fd < 0) {
+		if (v)
+			printf("%d/%d: freesp - open %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+	if (fstat64(fd, &stb) < 0) {
+		if (v)
+			printf("%d/%d: freesp - fstat64 %s failed %d\n",
+			       procid, opno, f.path, errno);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+	lr = ((__s64) random() << 32) + random();
+	off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE);
+	off %= maxfsize;
+	memset(&fl, 0, sizeof(fl));
+	fl.l_whence = SEEK_SET;
+	fl.l_start = off;
+	fl.l_len = 0;
+	e = ioctl(fd, XFS_IOC_FREESP64, &fl) < 0 ? errno : 0;
+	if (v)
+		printf("%d/%d: ioctl(XFS_IOC_FREESP64) %s %lld 0 %d\n",
+		       procid, opno, f.path, (long long)off, e);
+	free_pathname(&f);
+	close(fd);
+}
+
+#endif
+
+void fsync_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	int fd;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: fsync - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	fd = open_path(&f, O_WRONLY);
+	e = fd < 0 ? errno : 0;
+	check_cwd();
+	if (fd < 0) {
+		if (v)
+			printf("%d/%d: fsync - open %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+	e = fsync(fd) < 0 ? errno : 0;
+	if (v)
+		printf("%d/%d: fsync %s %d\n", procid, opno, f.path, e);
+	free_pathname(&f);
+	close(fd);
+}
+
+void getdents_f(int opno, long r)
+{
+	DIR *dir;
+	pathname_t f;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_DIRm, r, &f, NULL, NULL, &v))
+		append_pathname(&f, ".");
+	dir = opendir_path(&f);
+	check_cwd();
+	if (dir == NULL) {
+		if (v)
+			printf("%d/%d: getdents - can't open %s\n",
+			       procid, opno, f.path);
+		free_pathname(&f);
+		return;
+	}
+	while (readdir64(dir) != NULL)
+		continue;
+	if (v)
+		printf("%d/%d: getdents %s 0\n", procid, opno, f.path);
+	free_pathname(&f);
+	closedir(dir);
+}
+
+void link_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	fent_t *fep;
+	flist_t *flp;
+	int id;
+	pathname_t l;
+	int parid;
+	int v;
+	int v1;
+
+	init_pathname(&f);
+	if (!get_fname(FT_NOTDIR, r, &f, &flp, NULL, &v1)) {
+		if (v1)
+			printf("%d/%d: link - no file\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	if (!get_fname(FT_DIRm, random(), NULL, NULL, &fep, &v))
+		parid = -1;
+	else
+		parid = fep->id;
+	v |= v1;
+	init_pathname(&l);
+	e = generate_fname(fep, flp - flist, &l, &id, &v1);
+	v |= v1;
+	if (!e) {
+		if (v) {
+			fent_to_name(&l, &flist[FT_DIR], fep);
+			printf("%d/%d: link - no filename from %s\n",
+			       procid, opno, l.path);
+		}
+		free_pathname(&l);
+		free_pathname(&f);
+		return;
+	}
+	e = link_path(&f, &l) < 0 ? errno : 0;
+	check_cwd();
+	if (e == 0)
+		add_to_flist(flp - flist, id, parid);
+	if (v)
+		printf("%d/%d: link %s %s %d\n", procid, opno, f.path, l.path,
+		       e);
+	free_pathname(&l);
+	free_pathname(&f);
+}
+
+void mkdir_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	fent_t *fep;
+	int id;
+	int parid;
+	int v;
+	int v1;
+
+	if (!get_fname(FT_DIRm, r, NULL, NULL, &fep, &v))
+		parid = -1;
+	else
+		parid = fep->id;
+	init_pathname(&f);
+	e = generate_fname(fep, FT_DIR, &f, &id, &v1);
+	v |= v1;
+	if (!e) {
+		if (v) {
+			fent_to_name(&f, &flist[FT_DIR], fep);
+			printf("%d/%d: mkdir - no filename from %s\n",
+			       procid, opno, f.path);
+		}
+		free_pathname(&f);
+		return;
+	}
+	e = mkdir_path(&f, 0777) < 0 ? errno : 0;
+	check_cwd();
+	if (e == 0)
+		add_to_flist(FT_DIR, id, parid);
+	if (v)
+		printf("%d/%d: mkdir %s %d\n", procid, opno, f.path, e);
+	free_pathname(&f);
+}
+
+void mknod_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	fent_t *fep;
+	int id;
+	int parid;
+	int v;
+	int v1;
+
+	if (!get_fname(FT_DIRm, r, NULL, NULL, &fep, &v))
+		parid = -1;
+	else
+		parid = fep->id;
+	init_pathname(&f);
+	e = generate_fname(fep, FT_DEV, &f, &id, &v1);
+	v |= v1;
+	if (!e) {
+		if (v) {
+			fent_to_name(&f, &flist[FT_DIR], fep);
+			printf("%d/%d: mknod - no filename from %s\n",
+			       procid, opno, f.path);
+		}
+		free_pathname(&f);
+		return;
+	}
+	e = mknod_path(&f, S_IFCHR | 0444, 0) < 0 ? errno : 0;
+	check_cwd();
+	if (e == 0)
+		add_to_flist(FT_DEV, id, parid);
+	if (v)
+		printf("%d/%d: mknod %s %d\n", procid, opno, f.path, e);
+	free_pathname(&f);
+}
+
+void read_f(int opno, long r)
+{
+	char *buf;
+	int e;
+	pathname_t f;
+	int fd;
+	size_t len;
+	__int64_t lr;
+	off64_t off;
+	struct stat64 stb;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: read - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	fd = open_path(&f, O_RDONLY);
+	e = fd < 0 ? errno : 0;
+	check_cwd();
+	if (fd < 0) {
+		if (v)
+			printf("%d/%d: read - open %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+	if (fstat64(fd, &stb) < 0) {
+		if (v)
+			printf("%d/%d: read - fstat64 %s failed %d\n",
+			       procid, opno, f.path, errno);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+	if (stb.st_size == 0) {
+		if (v)
+			printf("%d/%d: read - %s zero size\n", procid, opno,
+			       f.path);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+	lr = ((__int64_t) random() << 32) + random();
+	off = (off64_t) (lr % stb.st_size);
+	lseek64(fd, off, SEEK_SET);
+	len = (random() % (getpagesize() * 32)) + 1;
+	buf = malloc(len);
+	e = read(fd, buf, len) < 0 ? errno : 0;
+	free(buf);
+	if (v)
+		printf("%d/%d: read %s [%lld,%ld] %d\n",
+		       procid, opno, f.path, (long long)off, (long int)len, e);
+	free_pathname(&f);
+	close(fd);
+}
+
+void readlink_f(int opno, long r)
+{
+	char buf[PATH_MAX];
+	int e;
+	pathname_t f;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_SYMm, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: readlink - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	e = readlink_path(&f, buf, PATH_MAX) < 0 ? errno : 0;
+	check_cwd();
+	if (v)
+		printf("%d/%d: readlink %s %d\n", procid, opno, f.path, e);
+	free_pathname(&f);
+}
+
+void rename_f(int opno, long r)
+{
+	fent_t *dfep;
+	int e;
+	pathname_t f;
+	fent_t *fep;
+	flist_t *flp;
+	int id;
+	pathname_t newf;
+	int oldid;
+	int parid;
+	int v;
+	int v1;
+
+	init_pathname(&f);
+	if (!get_fname(FT_ANYm, r, &f, &flp, &fep, &v1)) {
+		if (v1)
+			printf("%d/%d: rename - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	if (!get_fname(FT_DIRm, random(), NULL, NULL, &dfep, &v))
+		parid = -1;
+	else
+		parid = dfep->id;
+	v |= v1;
+	init_pathname(&newf);
+	e = generate_fname(dfep, flp - flist, &newf, &id, &v1);
+	v |= v1;
+	if (!e) {
+		if (v) {
+			fent_to_name(&f, &flist[FT_DIR], dfep);
+			printf("%d/%d: rename - no filename from %s\n",
+			       procid, opno, f.path);
+		}
+		free_pathname(&newf);
+		free_pathname(&f);
+		return;
+	}
+	e = rename_path(&f, &newf) < 0 ? errno : 0;
+	check_cwd();
+	if (e == 0) {
+		if (flp - flist == FT_DIR) {
+			oldid = fep->id;
+			fix_parent(oldid, id);
+		}
+		del_from_flist(flp - flist, fep - flp->fents);
+		add_to_flist(flp - flist, id, parid);
+	}
+	if (v)
+		printf("%d/%d: rename %s to %s %d\n", procid, opno, f.path,
+		       newf.path, e);
+	free_pathname(&newf);
+	free_pathname(&f);
+}
+
+#ifndef NO_XFS
+void resvsp_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	int fd;
+	struct xfs_flock64 fl;
+	__s64 lr;
+	__s64 off;
+	struct stat64 stb;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: resvsp - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	fd = open_path(&f, O_RDWR);
+	e = fd < 0 ? errno : 0;
+	check_cwd();
+	if (fd < 0) {
+		if (v)
+			printf("%d/%d: resvsp - open %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+	if (fstat64(fd, &stb) < 0) {
+		if (v)
+			printf("%d/%d: resvsp - fstat64 %s failed %d\n",
+			       procid, opno, f.path, errno);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+	lr = ((__s64) random() << 32) + random();
+	off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE);
+	off %= maxfsize;
+	memset(&fl, 0, sizeof(fl));
+	fl.l_whence = SEEK_SET;
+	fl.l_start = off;
+	fl.l_len = (__s64) (random() % (1024 * 1024));
+	e = ioctl(fd, XFS_IOC_RESVSP64, &fl) < 0 ? errno : 0;
+	if (v)
+		printf("%d/%d: ioctl(XFS_IOC_RESVSP64) %s %lld %lld %d\n",
+		       procid, opno, f.path, (long long)off,
+		       (long long)fl.l_len, e);
+	free_pathname(&f);
+	close(fd);
+}
+#endif
+
+void rmdir_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	fent_t *fep;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_DIRm, r, &f, NULL, &fep, &v)) {
+		if (v)
+			printf("%d/%d: rmdir - no directory\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	e = rmdir_path(&f) < 0 ? errno : 0;
+	check_cwd();
+	if (e == 0)
+		del_from_flist(FT_DIR, fep - flist[FT_DIR].fents);
+	if (v)
+		printf("%d/%d: rmdir %s %d\n", procid, opno, f.path, e);
+	free_pathname(&f);
+}
+
+void stat_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	struct stat64 stb;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: stat - no entries\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	e = lstat64_path(&f, &stb) < 0 ? errno : 0;
+	check_cwd();
+	if (v)
+		printf("%d/%d: stat %s %d\n", procid, opno, f.path, e);
+	free_pathname(&f);
+}
+
+void symlink_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	fent_t *fep;
+	int i;
+	int id;
+	int len;
+	int parid;
+	int v;
+	int v1;
+	char *val;
+
+	if (!get_fname(FT_DIRm, r, NULL, NULL, &fep, &v))
+		parid = -1;
+	else
+		parid = fep->id;
+	init_pathname(&f);
+	e = generate_fname(fep, FT_SYM, &f, &id, &v1);
+	v |= v1;
+	if (!e) {
+		if (v) {
+			fent_to_name(&f, &flist[FT_DIR], fep);
+			printf("%d/%d: symlink - no filename from %s\n",
+			       procid, opno, f.path);
+		}
+		free_pathname(&f);
+		return;
+	}
+	len = (int)(random() % PATH_MAX);
+	val = malloc(len + 1);
+	if (len)
+		memset(val, 'x', len);
+	val[len] = '\0';
+	for (i = 10; i < len - 1; i += 10)
+		val[i] = '/';
+	e = symlink_path(val, &f) < 0 ? errno : 0;
+	check_cwd();
+	if (e == 0)
+		add_to_flist(FT_SYM, id, parid);
+	free(val);
+	if (v)
+		printf("%d/%d: symlink %s %d\n", procid, opno, f.path, e);
+	free_pathname(&f);
+}
+
+/* ARGSUSED */
+void sync_f(int opno, long r)
+{
+	sync();
+	if (verbose)
+		printf("%d/%d: sync\n", procid, opno);
+}
+
+void truncate_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	__int64_t lr;
+	off64_t off;
+	struct stat64 stb;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: truncate - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	e = stat64_path(&f, &stb) < 0 ? errno : 0;
+	check_cwd();
+	if (e > 0) {
+		if (v)
+			printf("%d/%d: truncate - stat64 %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+	lr = ((__int64_t) random() << 32) + random();
+	off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE);
+	off %= maxfsize;
+	e = truncate64_path(&f, off) < 0 ? errno : 0;
+	check_cwd();
+	if (v)
+		printf("%d/%d: truncate %s %lld %d\n", procid, opno, f.path,
+		       (long long)off, e);
+	free_pathname(&f);
+}
+
+void unlink_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	fent_t *fep;
+	flist_t *flp;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_NOTDIR, r, &f, &flp, &fep, &v)) {
+		if (v)
+			printf("%d/%d: unlink - no file\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	e = unlink_path(&f) < 0 ? errno : 0;
+	check_cwd();
+	if (e == 0)
+		del_from_flist(flp - flist, fep - flp->fents);
+	if (v)
+		printf("%d/%d: unlink %s %d\n", procid, opno, f.path, e);
+	free_pathname(&f);
+}
+
+#ifndef NO_XFS
+void unresvsp_f(int opno, long r)
+{
+	int e;
+	pathname_t f;
+	int fd;
+	struct xfs_flock64 fl;
+	__s64 lr;
+	__s64 off;
+	struct stat64 stb;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: unresvsp - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	fd = open_path(&f, O_RDWR);
+	e = fd < 0 ? errno : 0;
+	check_cwd();
+	if (fd < 0) {
+		if (v)
+			printf("%d/%d: unresvsp - open %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+	if (fstat64(fd, &stb) < 0) {
+		if (v)
+			printf("%d/%d: unresvsp - fstat64 %s failed %d\n",
+			       procid, opno, f.path, errno);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+	lr = ((__s64) random() << 32) + random();
+	off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE);
+	off %= maxfsize;
+	memset(&fl, 0, sizeof(fl));
+	fl.l_whence = SEEK_SET;
+	fl.l_start = off;
+	fl.l_len = (__s64) (random() % (1 << 20));
+	e = ioctl(fd, XFS_IOC_UNRESVSP64, &fl) < 0 ? errno : 0;
+	if (v)
+		printf("%d/%d: ioctl(XFS_IOC_UNRESVSP64) %s %lld %lld %d\n",
+		       procid, opno, f.path, (long long)off,
+		       (long long)fl.l_len, e);
+	free_pathname(&f);
+	close(fd);
+}
+#endif
+
+void write_f(int opno, long r)
+{
+	char *buf;
+	int e;
+	pathname_t f;
+	int fd;
+	size_t len;
+	__int64_t lr;
+	off64_t off;
+	struct stat64 stb;
+	int v;
+
+	init_pathname(&f);
+	if (!get_fname(FT_REGm, r, &f, NULL, NULL, &v)) {
+		if (v)
+			printf("%d/%d: write - no filename\n", procid, opno);
+		free_pathname(&f);
+		return;
+	}
+	fd = open_path(&f, O_WRONLY);
+	e = fd < 0 ? errno : 0;
+	check_cwd();
+	if (fd < 0) {
+		if (v)
+			printf("%d/%d: write - open %s failed %d\n",
+			       procid, opno, f.path, e);
+		free_pathname(&f);
+		return;
+	}
+	if (fstat64(fd, &stb) < 0) {
+		if (v)
+			printf("%d/%d: write - fstat64 %s failed %d\n",
+			       procid, opno, f.path, errno);
+		free_pathname(&f);
+		close(fd);
+		return;
+	}
+	lr = ((__int64_t) random() << 32) + random();
+	off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE));
+	off %= maxfsize;
+	lseek64(fd, off, SEEK_SET);
+	len = (random() % (getpagesize() * 32)) + 1;
+	buf = malloc(len);
+	memset(buf, nameseq & 0xff, len);
+	e = write(fd, buf, len) < 0 ? errno : 0;
+	free(buf);
+	if (v)
+		printf("%d/%d: write %s [%lld,%ld] %d\n",
+		       procid, opno, f.path, (long long)off, (long int)len, e);
+	free_pathname(&f);
+	close(fd);
+}
diff --git a/contrib/make-sparse.c b/contrib/make-sparse.c
index 1b3d550..98b86b0 100644
--- a/contrib/make-sparse.c
+++ b/contrib/make-sparse.c
@@ -9,8 +9,12 @@
  * %End-Header%
  */
 
+#ifndef _LARGEFILE_SOURCE
 #define _LARGEFILE_SOURCE
+#endif
+#ifndef _LARGEFILE64_SOURCE
 #define _LARGEFILE64_SOURCE
+#endif
 
 #include <stdio.h>
 #include <unistd.h>
diff --git a/debian/.gitignore b/debian/.gitignore
new file mode 100644
index 0000000..91d8482
--- /dev/null
+++ b/debian/.gitignore
@@ -0,0 +1 @@
+!patches
diff --git a/debian/changelog b/debian/changelog
index 47d58bf..f462967 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,1216 @@
+e2fsprogs (1.46.2-1) unstable; urgency=medium
+
+  * New upstream release
+  * Add support for the FS_NOCOMP_FL flag to chattr and lsattr.
+  * Fix Direct I/O support on block devices where the logical block size is
+    greater 1k.
+  * Fix debugfs's logdump so it works on file systems whose block size is
+    greater than 8k.
+  * Fix the debugfs rdump and ls commands so they will work correctly for
+    uid's and gid's => 65536.
+  * Teach the tune2fs program to support "random" as an argument to the -c
+    option, which sets the maximum mount count.  (Closes: #926293)
+  * Fix a where e2fsck could a crash when there is error while e2fsck is
+    trying to open the file system, and e2fsck calls ext2fs_mmp_stop()
+    before MMP has been initialized.  (Closes: #696609)
+  * Fix the debugfs write and symlink commands so they support targets which
+    contain a pathname (instead of only working when writing a file or
+    creating a symlink in the current directory).
+  * When resizing a small file systems to a super-large file system size,
+    avoid issuing some scary bitmap operation warnings.  
+  * Improved error checking in the fast commit replay code in e2fsck.
+  * Updated and clarified the chattr man page.
+  * Update the Spanish translation from the translation project.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 28 Feb 2021 21:24:34 -0500
+
+e2fsprogs (1.46.1-1) unstable; urgency=medium
+
+  * Drop transitional packages libcomerr2, e2fslibs, and e2fslibs-dev
+  * Fix a bug in libext2fs and debugfs when trying to set an extended
+    attribute will result in a seg fault.
+  * Fix e2fsck so it properly accepts large_dir directories which are
+    greater than 4GB in size.
+  * Fix mke2fs -d so it correctly handles important a directory or small
+    file which is stored using inline_data and contains an ACL or extended
+    attribute.   (Closes: #971014)
+  * Add build profiles noudeb and pkg.e2fsprogs.no-static (Closes: #966686)
+  * Update the Czech, French, Malay, Polish, Portuguese, Sweedish, and
+    Ukranian translations from the translation project.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 09 Feb 2021 17:36:02 -0500
+
+e2fsprogs (1.46.0-1) experimental; urgency=medium
+
+  * New upstream release
+  * Add support for the new fast_commit feature.  (Requires Linux version
+    5.10 or higher)
+  * Add support for the new stable_inodes feature which is needed to
+    support some the fscrypt siphash algorithm.
+  * Add support for file systems that have both case folding and
+    encryption enabled.  (Not yet upstream, but used in some Android handsets.)
+  * The fuse2fs program now supports the "norecovery" which omits replying
+    the journal and mounts the file system read-only.
+  * Bitmap loading is now done using multiple threads which can speed up
+    debugfs, dumpe2fs, and e2fsck on very large file systems.
+  * E2fsck now will check file names on file systems with case folding
+    enabled to make sure the characters are valid UTF-8 characters.
+    This is done for file systems which enforce strict encodings, and
+    optionally if the extended "check_encoding" option is requested.
+  * E2fsck will properly handle checking for duplicated file names when
+    case folding is enabled.
+  * E2fsck will now find and fix file system corruptions when the encrypted
+    files have a different policy from their containing directory.
+  * The "htree" command in debugfs now displays the metadata checksums for
+    hash tree index blocks.
+  * Fix various bugs where a maliciously corrupted file systems could case
+    e2fsck and other e2fsprogs programs to crash.
+  * Dumpe2fs will print the error code that Linux kernels newer than v5.6
+    will save to indicate the class of error which triggered the ext4_error
+    event.
+  * E2fsprogs programs (in particular, fuse2fs) can now update htree
+    directories without clearing the htree index.
+  * Tune2fs will properly recalculate directory block checksums when
+    clearing the dir_index feature.
+  * Fix a bug in e2fsck directory rehashing which could fail with ENOSPC
+    because it doesn't take into account the space needed for the metadata
+    checksum, and doesn't create a sufficiently deep index tree.
+  * Clarify the e2fsck messages when it resets the directory link count when
+    it is set to the overflow value but it is no longer needed.
+  * Mke2fs now sets the s_overhead_cluster field, so that the kernel doesn't
+    need to calculate it at mount time.  This speeds up mounting very large
+    file systems.
+  * Speed up mke2fs when creating large bigalloc file systems by optimizing
+    ext2fs_convert_subcluster_bitmap().
+  * The filefrag program can now request the kernel to display the extent
+    status cache by using "filefrag -E".  (This requires Linux version 5.4
+    or newer.)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Fri, 29 Jan 2021 16:24:41 -0500
+
+e2fsprogs (1.45.7-1) unstable; urgency=medium
+
+  * New upstream release
+  * Mke2fs will now warn when creating a file system on a DAX-capable
+    device and the block size is incompatible with DAX.
+  * The chattr and lsattr programs now support using the 'x' attribute
+    to set/get dax support on a particular file.
+  * E2fsprogs now supports the gnu.* extended attribute namespace, which
+    allows mke2fs -d to import the gnu.translator extended attributes.
+  * Add support for the simultaneous enablement of the casefold and
+    encryption features, which ext4 supports starting with the v5.5
+    Linux kernel.
+  * Debugfs will now retry opening the superblock if it finds that the
+    superblock has an invalid checksum, since this could happen when
+    opening a mounted file system.
+  * Fix an off-by-one error when validating the depth of an htree which
+    caused e2fsck to potentially fail to notice an invalid htree.
+  * Fix potential buffer overrun in e2fsck when scanning directory blocks
+    in pass 2. (Addresses Google Bug: #158564737)
+  * Fix tune2fs so that it unlocks the MMP block if it can't perform the
+    requested operation.
+  * Fix mke2fs so it can import the contents of a directory using the -d
+    option when it has inode numbers that are greater than 2**32.   Also
+    fix an ommission were the extended attributes on the top-level directory
+    was not getting copied to the root directory.
+  * Fix e4crypt so that the add_key operation uses the explicitly provided
+    salt if it is provided.
+  * Fix resize2fs to prevent it from overflowing the block group descriptors
+    from overflowing the first block group.  (This can only happen when the
+    block size is 1k and the file system is very large.)
+  * Fix debugfs's set_super_value command so it can set 64-bit integer
+    fields, such as s_kbytes_written.
+  * Fix filefrag so that it won't crash if the kernel returns zero for
+    statfs(2)'s device id or if it returns a blocksize of zero the device's
+    blocksize.
+  * Fix a few bad error code returns in the unix and sparse I/O managers.
+  * E2fsck will no longer try to fix duplicate file names in an encrypted
+    directory by mutating the encrypted file name.
+  * Updated and clarified various man pages.
+  * Update the Dutch, Malay, and Serbian translations from the translation
+    project.
+  * Update the Debian policy compliance to 4.5.1
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Fri, 29 Jan 2021 00:19:52 -0500
+
+e2fsprogs (1.45.6-1) unstable; urgency=medium
+
+  * New upstream release
+  * Fixed a number of potential out of bounds memory accesses caused by
+    fuzzed / malicious file systems.
+  * Fix a spurious complaint from e2fsck when a directory which previously
+    had more than 32000 subdirectories has the number of subdirectories
+    drops below 32000.
+  * Improve e2fsck's ability to deal with file systems with a *very* large
+    number of directories.
+  * Debugfs will ignore lines in its command files which start with a
+    comment character ("#").
+  * Fix debugfs so it correctly prints inode numbers > 2**31.
+  * Filefrag now supports very large files (with > 4 billion blocks), as
+    well as block sizes up to 1 GiB.
+  * Mke2fs -d now correctly sets permission with files where the owner
+    permissions are not rwx.
+  * Updated and clarified various man pages
+    (Closes: #953493, #953494, #951808)
+  * Drop as unneeded libattr1-dev as a build dependency (Closes: #953926)
+  * Update the Malay translation from the translation project.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Fri, 20 Mar 2020 23:49:33 -0400
+
+e2fsprogs (1.45.5-2) unstable; urgency=medium
+
+  * Fix com_err support on Hurd, which has POSIX E* error code starting at
+    0x40000000.  Otherwise the regression tests will fail since the
+    expected output for various error cases will not have the correct
+    error text.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Wed, 08 Jan 2020 15:58:44 -0500
+
+e2fsprogs (1.45.5-1) unstable; urgency=medium
+
+  * New upstream release
+  * E2fsck will no longer force a full file system check if time-based
+    forced checks are disabled and the last mount time or last write time in
+    the superblock are in the future.
+  * Fix spurious weekly e-mails when e2scrub_all is run via a cron job
+    on non-systemd systems.  (Closes: #944033)
+  * Remove an unnecessary sleep in e2scrub which could add up to an
+    additional two second delay during the boot up.  Also, avoid
+    trying to reap aborted snapshots if it has been disabled via
+    e2scrub.conf.  (Closes: #948193)
+  * Resize2fs -M's estimates are now more accurate on mounted file systems.
+  * Tune2fs prohibits enabling or disabling the uninit_bg feature on
+    mounted file systems, since this is unsafe.
+  * Fix support of 32-bit uid's and gid's in fuse2fs and in mke2fs -d.
+  * Fix mke2fs's setting bad blocks to bigalloc file systems.
+  * Fix a bug where fuse2fs would incorrectly report the i_blocks fields for
+    bigalloc file systems.
+  * Fix potential crash in e2fsck when rebuilding very large directories on
+    file systems which have the new large_dir feature enable.
+  * Fix FTBFS problem hurd/i386. (Closes: #944649)
+  * Fix CVE-2019-5188: potential a out of bounds write in mutate_name()
+    when checking a maliciously corrupted file systems
+  * Add autopkgtest tests smoke and fuse2fs
+  * Updated and clarified various man pages
+  * Update the debhelper compatibility level to 12
+  * Update the Chinese and Malay translations
+  * Update the Debian policy compliance to 4.4.1
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 07 Jan 2020 09:18:39 -0500
+
+e2fsprogs (1.46~WIP.2019.10.09-1) experimental; urgency=medium
+
+  * Add (minimal) support to enable the fast commit feaure.  This is just
+    enough to enable kernel development work; e2fsck replay of journals
+    with the fast commit feature is *not* available.
+  * E2fsck will now check encryption policies for consistency
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Wed, 09 Oct 2019 20:22:50 -0400
+
+e2fsprogs (1.45.4-1) unstable; urgency=medium
+
+  * New upstream feature
+  * Fix CVE-2019-5094: A maliciously corrupted file systems can trigger
+    buffer overruns in the quota code used by e2fsck.
+  * E2fsck will now check to make sure the casefold flag is only set on
+    directories, and only when the casefold feature is enabled.
+  * E2fsck will not disable the low dtime checks when using a backup
+    superblock where the last mount time is zero to fix a failure in
+    xfstests ext4/007
+  * Fix e2fsck so that when it needs to recreate the root directory, the
+    quota counts are correctly updated
+  * Update the man pages to document the new fsverity feature, and improve
+    the documentation for the casefold and encrypt features
+  * Allow e2scrub_all to work when the VG free space is exactly the
+    snapshot size (Closes: #935009)
+  * Avoid spurious lvm warnings when e2scrub_all is run out of cron on
+    non-systemd systems (Closes: #940240)
+  * Update the Dutch, German, Malay, Spanish, and Vietnamese translations
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 23 Sep 2019 15:31:27 -0400
+
+e2fsprogs (1.45.3-4) unstable; urgency=medium
+
+  * stop using Link Time Optimization; it breaks reproducible builds
+  * skip "make check" if DEB_BUILD_OPTIONS contains nocheck; this is
+    needed for some ports builds to complete successfully (Closes: #933247)
+  * fix e2fsprogs build problems on non-Linux ports
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 06 Aug 2019 15:22:30 -0400
+
+e2fsprogs (1.45.3-3) unstable; urgency=medium
+
+  * Fix Breaks/Replace dependency for logsave (Closes: #932874)
+  * Mark logsave as Multi-Arch: foreign (Closes: #932876)
+  * Fix test bug on the x32 architecture (Closes: #932906)
+  * Fix FTBFS problem on FreeBSD and Hurd since they don't have systemd
+  * Fix blhc problem when running "make check"
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Thu, 25 Jul 2019 15:35:01 -0400
+
+e2fsprogs (1.45.3-2) unstable; urgency=medium
+
+  * Add a hard dependency on logsave to e2fsprogs to fix initramfs issues
+    (Closes: #932855, #932859, #932861, #932881, #932888)
+  * Add check in e2scrub_all.cron so that it doesn't fail if the package
+    is removed, since e2scrub_all.cron is marked as a config file.
+    (Closes: #932622)
+  * Update the Debian policy compliance to 4.4.0
+  * Update Czech, French, German, Polish, Portuguese, Swedish, and
+    Ukrainian translations
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Wed, 24 Jul 2019 12:56:52 -0400
+
+e2fsprogs (1.45.3-1) unstable; urgency=medium
+
+  * New upstream version
+  * Automatic online file system scrubs is now disabled by default.
+    They can be enabled by editing /etc/e2scrub.conf.
+  * fuse2fs is now installed in /usr/bin instead of /usr/sbin
+  * Fix fuse2fs compatibility with fuse3; but specifying the
+    nonempty option may be necessary if fusermount with fuse v2 is in use.
+    See NEWS.gz for more details.
+  * Fixed e2fsck support of file systems using large_dir and inline
+    directories at the same time.
+  * Fixed a bug in e2scrub_all so it correctly handles an LUKS volume
+    stacked on top of an LV.  (Closes: #931387)
+  * Fixed a bug in e2scrub_all so it correctl specifies the volumes to
+    clean up when using "e2scrub_all -r".   (Closes: #931679)
+  * Fixed improper use of positional markers in the Czech, Dutch,
+    German, and Vietnamese translations.  (Closes: #892173)
+  * Remove ancient special-case CFLAGS for Alpha and Powermac platforms
+  * Drop packaging support for Debian Jessie
+  * Use the same build tree for the e2fsprogs udeb package
+  * Restructure rules file to use dh
+  * Only require the udev, systemd, and cron build dependencies when
+    building on Linux. (Closes: #931266)
+  * Move logsave to its own package.  (Closes: #923372)
+  * Update the Czech and Dutch translations
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 14 Jul 2019 21:01:11 -0400
+
+e2fsprogs (1.45.2-1) unstable; urgency=medium
+
+  * New upstream version
+  * When mke2fs asks the user if she should proceed, fall back to the
+    English 'y' or 'Y' characters since there could be a missing
+    translation prompting the use of the English 'y' character.
+    (Closes: #907034)
+  * Fix spurious complaint of blocks beyond i_size for verity files.
+  * Update the Czech, Malay, Polish, Spanish, Swedish, and Ukarainian
+    translations.  Add the new Portuguese translation.  (Closes: #912185)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 27 May 2019 21:46:31 -0400
+
+e2fsprogs (1.45.1-3) unstable; urgency=medium
+
+  * Fix e2scrub_all cron failures (Closes: #929287)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 20 May 2019 21:48:40 -0400
+
+e2fsprogs (1.45.1-2) unstable; urgency=medium
+
+  * Avoid spurious e2scrub_all error messages spamming administrators from
+    cron/systemd timer units when lvm2 is not installed and/or there are
+    no lvm devices present in the system (Closes: #928977, #929186, #929254)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 20 May 2019 11:02:09 -0400
+
+e2fsprogs (1.45.1-1) unstable; urgency=medium
+
+  * New upstream feature
+  * Drop lvm2 from the recommends line (Closes: #924275)
+  * Add the -n flag to the e2scrub and e2scrub_all commands
+  * Teach e2scrub to issue more useful error messages
+  * Update support for the case-folding file system feature to match what
+    finally will be landing in the kernel.
+  * Teach e2scrub_all to skip scrubing a file system if there is not
+    enough free space to create a snapshot.  (Closes: #924301)
+  * Fixed debugfs so it correctly prints ea_in_inode xattr values.
+  * Debugfs now prints non-printing characters using C-style hex escape
+    sequences.
+  * E2fsck now checks the unused portions of the bitmap blocks when the
+    number of blocks/inodes is less than the full blocksize to make sure
+    they are properly set.
+  * Fixed mke2fs's insanely large file system check, so that creating a
+    900TB file system will succeed.
+  * E2scrub now tags its temp snapshot volumes with UDISK_IGNORE to avoid
+    them showing up in GUI's.  (Closes: #926112)
+  * Mark the e2scrub systemd service files to indicate that it requires
+    CAP_SYS_ADMIN and CAP_SYS_RAWIO so e2scrub will get skipped when run
+    in cointainers that don't give root these capabilities.  (Closes: #926138)
+  * E2fsck can now save a problem code log for debugging or monitoring
+    purposes.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 12 May 2019 21:23:25 -0400
+
+e2fsprogs (1.45.0-1) unstable; urgency=medium
+
+  * New upstream feature
+  * tune2fs can now set the file system error bit to force a check at the
+    next fsck by using the extended option "force_fsck".
+  * There is now an e2scrub script which will allow e2fsck to be run
+    on mounted file systems using an LVM device.  There will be a systemd
+    script to automatically run e2scrub on all ext4* file systems where it
+    can be supported.
+  * mke2fs will attempt avoid discarding pre-allocated blocks when
+    initializing a file system on a file.
+  * The fuse2fs command now supports a "fakeroot" option to allow an
+    unprivileged user to fuse2fs to modify rootfs images.
+  * Add initial support for the character set and case-folding file system
+    feature.
+  * Debugfs can now set the inode's checksum field
+  * E2image now accepts the -b and -B options to allow the user to specify
+    the superblock location when creating a raw or qcow2 image.
+  * Update the debhelper compatibility level to 11
+  * Update the Debian policy compliance to 4.3.0
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Wed, 06 Mar 2019 12:55:18 -0500
+
+e2fsprogs (1.44.6-1) unstable; urgency=medium
+
+  * New upstream version
+  * Fix e4defrag overflow problem when files are being created while it is
+    running (Closes: #888899)
+  * Fix e2fsck so it can correctly handle directories > 2 GiB when the
+    largedir feature is enabled.
+  * Fix mke2fs's hugefile creation so it works correctly for certain
+    unfortunately sized disks/partitions.
+  * Fix the libext2fs library to be more robust against
+    invalid/maliciously corrupted block group descriptors.
+  * Fix mke2fs and debugfs so they can correctly copy in files > 2 GiB.
+  * Fix debugfs so its stat command can correct supportly display directory
+    sizes > 2 GiB.
+  * Fix memory leaks in debugfs, mke2fs, and e2freefrag.
+  * Avoid unnecessarily linking badblocks with the libblkid shared library.
+    (Closes: #919958)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 05 Mar 2019 15:10:40 -0500
+
+e2fsprogs (1.44.5-1) unstable; urgency=medium
+
+  * New upstream version
+  * Avoid overflows when tracking the number of files defragged
+    by e4defrag (Closes: #888899)
+  * Fix groff formatting nits in various man pages (Closes: #916188)
+  * Fix location of libext2fs documentation (Closes: #915942)
+  * Fix regression so we are correctly translating Posix ACL's
+    in libext2fs
+  * Use the online free block counts so e2freefrag's percentages
+    are correct
+  * Fix a false warning that tune2fs will take long time to change
+    a UUID if the metadata_csum feature is not enabled
+  * Fix mk_cmds so it works on a non-usrmerge system when e2fsprogs
+    is built on a usrmerge system (Closes: #914087)
+  * E2fsck will avoid offering to set the inline_data feature flag
+    unnecessarily
+  * E4defrag will handle the case where it is running as root and it can't
+    find the file system to open more gracefully (Closes: #907634)
+  * Fix a bug where resize2fs was failing to update the extent tree
+    checksums in an corner case
+  * Fix fuse2fs's command line parsing when options are specified after
+    the target device/image
+  * Fix a bug which could cause e2fsprogs tools to segfault on a corrupted
+    file system where the journal's s_nr_users is impossibly large.
+  * E2image now includes the mmp block (if needed) when creating a
+    metadata-only image.
+  * When e2fsck notices it could optimize an extent tree, it will now ask
+    "Optimize?" instead of "Fix?", which was confusing some users since it
+    implied that something was broken.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sat, 15 Dec 2018 22:46:49 -0500
+
+e2fsprogs (1.44.4-2) unstable; urgency=medium
+
+  * tune2fs fix dereference of freed memory after journal
+  * fix verity support
+  * Generate NEWS.gz for e2fsprogs's package documentation directory
+  * Update Debian policy compliance to 4.2.0
+  * Improve version dependency for libcom-err and ss2 for e2fsprogs
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Wed, 22 Aug 2018 19:30:17 -0400
+
+e2fsprogs (1.44.4-1) unstable; urgency=medium
+
+  * New upstream release
+  * Add basic support for the ext4 verity (fsverity) feature
+  * E2fsck will fix file systems that have both the resize_inode
+    and meta_bg feature enabled
+  * Debugfs's ncheck command will now correctly inodes that have
+    multiple hard links
+  * Remove kilo/kibi rant (Closes: #757831)
+  * Update Danish, Spanish, and Swedish translations
+  * Fix symlink to directory conversions (Closes: #905195)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sat, 18 Aug 2018 20:46:29 -0400
+
+e2fsprogs (1.44.3-1) unstable; urgency=medium
+
+  * New upstream release
+  * Include hashmap.h in the libext2fs2 package
+  * Update debian policy compliance to 4.1.5
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 10 Jul 2018 01:23:17 -0400
+
+e2fsprogs (1.44.3~rc2-1) unstable; urgency=low
+
+  * New upstream release
+  * Debugfs's inode_dump and xattr_dump commands have new options to
+    display the low-level contents of an inode's i_blocks and extra
+    space, and to better be able to debug corrupted extended attributes.
+  * The dumpe2fs command now will show information about the Multi-Mount
+    Protection (MMP) block, if present
+  * E2fsck, dumpe2fs, and debugfs is now much more robust at handling
+    badly (or maliciously) corrupted file systems.
+  * E2fsck will now offer to enable the dir_nlink feature if it is
+    required by the file system
+  * The project id field in the inode is now properly byte-swapped on
+    big-endian systems
+  * E2fsprogs better handles recent kernels which reports old error
+    conditions via the first fsync() after the file is opened
+  * Updated/fixed various man pages
+  * Update Czech, Dutch, Spanish, French, Polish, Swedish, Ukrainian, and
+    Vietnamese translations
+  * Update debian policy compliance to 4.1.4
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 3 Jul 2018 23:31:40 -0400
+
+e2fsprogs (1.44.2-1) unstable; urgency=medium
+
+  * New upstream release
+  * Demote e2fsprogs from Essential: yes to XB-Important: yes
+    (Closes: #474540)
+  * Fix mke2fs to print a more useful/correct error message if
+    ext2fs_close_free() fails at the end of the file system
+    creation process
+  * Improve chattr's man page
+  * Update Polish translation
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 14 May 2018 19:59:27 -0400
+
+e2fsprogs (1.44.1-2) unstable; urgency=medium
+
+  * Fix e2image handling of e2i files on big endian systems
+  * Add sanity checks for inodes containing xattr values to prevent
+    maliciously crafted file systems from causing crashes caused by
+    infinite recursion
+  * Fix e2fsck so that quota usage is adjusted when clearing orphaned
+    inodes
+  * Fix filefrag so that unknown flags returned by FIEMAP won't cause a
+    buffer overrun
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 10 Apr 2018 11:04:36 -0400
+
+e2fsprogs (1.44.1-1) unstable; urgency=medium
+
+  * New upstream release
+  * Fix FTBFS problem on Hurd (Closes: #893590)
+  * Fix e2fsck support of HTree directories on big-endian systems
+  * Fix miscellaneous e2image image handling for file systems with bigalloc
+    and meta_bg features enabled.
+  * Fix orphan list handling of inodes on bigalloc file systems (and other
+    situations where inodes need to be deleted or truncated) in e2fsck.
+  * Update Sweedish translation.
+  * Add Vcs-* headers in Debian packaging (Closes: #887512)
+  * Speed up reading bitmap blocks in debugfs when opening large file
+    systems.
+  * Add clarifications to chattr's man page.  (Closes: #890390)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sat, 24 Mar 2018 15:13:28 -0400
+
+e2fsprogs (1.44.0-1) unstable; urgency=medium
+
+  * New upstream release
+  * Update Czech, Spanish, French, Malay, and Ukrainian translations.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Wed, 07 Mar 2018 14:39:52 -0500
+
+e2fsprogs (1.44.0~rc2-1) experimental; urgency=medium
+
+  * New upstream release
+  * Fix FTBFS problem on Hurd
+  * Improved e2fsck's consistency checking for symlink.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 04 Mar 2018 15:57:21 -0500
+
+e2fsprogs (1.44.0~rc1-1) experimental; urgency=low
+
+  * New upstream release
+  * Add support for the large_dir feature
+  * Add support for the ea_data feature
+  * Resize2fs will not complain about online resizes of bigalloc file
+    systems
+  * Debugfs's ls command will now print the high bits of the mode bits
+  * Fix some corner cases with tune2fs and journal replay
+  * Add support for libreadline.so.7
+  * E2freefrag will now use the GETFSMAP ioctl for mounted file systems
+  * E2fsck is now much faster when scanning extents on bigalloc file systems
+  * Fix various compiler and UBSAN warnings
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 27 Feb 2018 16:56:32 -0500
+
+e2fsprogs (1.43.9-2) unstable; urgency=medium
+
+  * Fix upgrade when there are two installations of a library (for
+    different architectures) that we are transitioning to the new package
+    name.  (Closes: #890590)
+  * Add support for libreadline.so.7 to libss
+  * Fix tune2fs's journal recovery support
+  * Fix tune2fs to require a freshly checked file system if turning off
+    the metadata_csum feature and UUID has been changed.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sat, 24 Feb 2018 20:48:29 -0500
+
+e2fsprogs (1.43.9-1) unstable; urgency=medium
+
+  * Remove some obsolete flags and add document new flags in the chattr
+    man page
+  * Remove misplaced "MNP is unsupported" message from debugfs
+  * Suppress false positive lintian warning about "new essential
+    package" (caused by preparatory work to make the e2fsprogs
+    package no longer essential)
+  * Fixing missing "General" in "GNU General Public License" in
+    copyright files.
+  * Fix whitespace issue in the debian control file
+  * Update the Hungarian translation.
+  * Rename the packages e2fslibs* to libext2fs* and libcomerr2* to
+    libcom-err2* to conform with the standard Debian library package
+    naming conventions.  (Closes: #269569)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Thu, 08 Feb 2018 13:09:49 -0500
+
+e2fsprogs (1.43.8-2) unstable; urgency=medium
+
+  * Update debian policy version to 4.1.3
+  * Mark library packages as priority: optional
+  * Simplify the debian/rules file and don't build e2fsprogs-l10n
+    unnecessarily
+  * Fix FTBFS on big-endian systems (Closes: #886119)
+  * Add support for the build profile: noudeb
+  * Add support for the build profile: pkg.e2fsprogs.no-fuse2fs
+  * Add support for the build profile: pkg.e2fsprogs.no-static-e2fsck
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Wed, 03 Jan 2018 16:18:40 -0500
+
+e2fsprogs (1.43.8-1) unstable; urgency=medium
+
+  * New upstream version
+  * Fix a bug where updated bitmap checks might not be written to disk.
+    (Closes: #883869)
+  * Add missing byte swaps for newly added fields in the superbloc
+  * Fix a potential use after free bug in e2fsck when fixing a corrupted
+    root node in directory hash tree.
+  * Fix a bug in e2fsck where a badly/maliciously corrupted superblock
+    (which is not fixed due to the -n option, for example) can cause a
+    floating point exception when printing the summary statistics.
+    (Closes: #879220)
+  * Fix debugfs's ncheck command so that it correctly prints the inode
+    number when printing an error message.
+  * Fix a bug in e2freefrag where it could print an incorrect free blocks
+    count on a file system with the 64-bit block number feature.
+  * Update the German, Serbian, Spanish, and Ukrainian translations.
+  * Fix a bug where resize2fs's free blocks sanity check could fail with a
+    false positive and refuse to check a file system with the 64-bit block
+    number feature.
+  * Fix and clarify various man pages and documentations.  Also fixed up
+    some random usage texts that were incorrect.  (Closes: #880483)
+  * Add missing copyright file for the e2fsprogs-l10 package.  (Closes:
+    #880207)
+  * Add missing Multi-arch hints (Closes: #881408, #881590, #881591)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 01 Jan 2018 19:44:41 -0500
+
+e2fsprogs (1.43.7-1) unstable; urgency=medium
+
+  * New upstream version
+  * Fix error handling in debugfs, fuse2fs, and tune2fs so errors while
+    replaying the journal will not cause a segfault in some corner cases
+  * Fix resize2fs to avoid it from either failing or corrupting the file
+    system image in certain corner cases when doing an off-line resize
+  * Fix many spelling mistakes in various man pages, code comments, and
+    program messages.
+  * Fix e2fsck and debugfs so that maliciously corrupted file systems will
+    not cause buffer overflows (Closes: #873757, #878104)
+  * Update German translation (Closes: #833514)
+  * Update debian policy version to 4.1.1
+  * Fix FTBFS caused by debhelper/10.9 and references to obsolete packages
+    in the rules file (Closes: #876551)
+  * Promote e2fsprogs-l10n from suggests to recommends (Closes: #873812)
+  * Make e2fsprogs-l10n be arch:all (Closes: #873813)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 16 Oct 2017 01:20:54 -0400
+
+e2fsprogs (1.43.6-1) unstable; urgency=medium
+
+  * New upstream version
+  * Break out the locale files to a separate package (e2fsprogs-l10n) to
+    reduce the size of the e2fsprogs package, since it is an
+    essential/required package.
+  * Remove support for building uuid/blkid packages on pre-Wheezy
+    distributions (which are no longer supported).
+  * Remove support for pre-Multiarch versions of Debian (which are no
+    longer supported).
+  * Fixed the printing of quota inconsistency messages in e2fsck on 32-bit
+    platforms.  Also fixed a bug which caused project quota problems to be
+    labelled as group quota problems.
+  * Fixed a UI problem with yes/no questions when there are fuzzy
+    translation entries which caused some messages to be printed in English
+    and some in the language specified by the locale.  (Closes: #856586)
+  * Fix some out-of-bounds memory accesses in e2fsck caused by (usually
+    maliciously) corrupted file systems.  (Closes: #871539, 871540)
+  * Optimize CPU usage in e2fsck for very large, very fragmented sparse
+    files.
+  * Avoid creating file systems that use project quotas and 128 byte
+    inodes.
+  * Improve tune2fs's message when a file system needs to be checked using
+    e2fsck -f before running certain complex tune2fs operations.  (Closes:
+    #857336)
+  * Improve e2fsck's message when the proceed_delay option in
+    /etc/e2fsck.conf is enabled.  (Closes: #857336)
+  * Fix an LFS bug in e2image.  (Closes: #855246)
+  * Fix portability problem caused by the fact that disks are character
+    mode devices systems with FreeBSD kernels.
+  * Update the Czech, French, Polish, Swedish, and Vietnamese translations.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 29 Aug 2017 00:58:29 -0400
+
+e2fsprogs (1.43.5-1) unstable; urgency=medium
+
+  * New upstream version
+  * Fix ext2fs_sync_device() so it returns the proper error code if the
+    BLKFLSBUF ioctl fails for some reason.
+  * Fix a potential crash in tune2fs when enabling project quota when the
+    file system has no inodes by fixing error handling in the
+    quota_write_inode() in libsupport.
+  * Fix a bug in debugfs's "ls -p" handling which could cause it to print
+    garbage after a file name in a directory entry.
+  * Fix a number of bugs in debugfs, dumpe2fs, e2fsck, tune2fs, and
+    resize2fs where a carefully/maliciously corrupted file systems (found
+    by American Fuzzy Lop) could these programs to crash or hang.
+    (Closes: #868489)
+  * E2fsck no longer issues some harmless bitmap warnings caused by a
+    corrupted file system; since those corruptions will be fixed up by
+    e2fsck later, there's no point issuing these internal warnings.
+  * E2fsck will now notice invalid quota inode numbers, and offer to fix
+    them.
+  * Fix a regression introduced in e2fsprogs 1.43 which broke mke2fs's
+    hugefile creation so that they aren't contiguous.
+  * Fix how backup superblocks are written in big endian systems so they
+    are all correctly byte swapped.
+  * Fixed tune2fs's support for enabling and disabling project quota.
+  * The badblock program now properly handles languages which have
+    multi-column wide character such as Chinese.  (Closes: #860926)
+  * The mke2fs -U option now accepts "null", "clear", "random", or "time"
+    just as tune2fs's -U option.
+  * Fix e2fsck's -E bmap2extent feature (which converts a file to use
+    extents from indirect block maps) so that it handles sparse files
+    correctly.
+  * Fix libext2fs to correctly handle accounting for an external xattr
+    block on bigalloc file systems.
+  * Fix e2fsck to correctly handle quota accounting when deleting files
+    that have multiply-claimed blocks pass 1b.
+  * Fix potential buffer overrun bug in e2fsck when using 128 byte inodes.
+  * E2fsck's extent tree optimization can now be disabled via an
+    command-line extended option or via an e2fsck.conf configuration
+    parameter.
+  * The e2fsck program now properly updates the quota accounting when
+    optimizing the extent tree.
+  * Fix some error handling in e4crypt when operating on keyring ID's.
+  * Fix e2fsck's quota handling when the bigalloc feature is enabled.
+  * The libext2fs file system now uses readahead when opening file systems
+    to speed up opening very large file systems with the meta_bg option.
+  * If e2fsck logging is enabled, e2fsck will report the exit code in the
+    last line of the log file.
+  * Debugfs can now open file systems with a bad superblock checksum, and
+    the show_super_stats command will print the expected checksum.
+  * Fix a regression introduced in e2fsprogs 1.43.4 where tune2fs was not
+    able to correctly enable the quota feature.  (Closes: #855417)
+  * E2fsck will only return an exit status code of 1 if it has fixed a
+    file system corruption.  If it only performed an optimal optimization
+    of internal file system metadata, it will now return 0.
+  * Fix e2fsck so it won't check inode fields of deleted inodes.
+  * Removed a debugging printf in libsupport which could result to some
+    extraneous and confusing output if the user specifies a quota type.
+  * The debugfs logdump command now accepts a new -S option which will
+    cause it to print information about the journal superblock.
+  * Added a missing space in debugfs's ls -l output to separate the size
+    and date fields.
+  * Update the Czech, Danish, Dutch, French, Hungarian, Polish, Serbian,
+    Spanish, Swedish, Ukrainian, and Vietnamese translations. (Closes: #862482)
+  * Update various man pages.  (Closes: #867895, #865584)
+  * Fix various compiler and UBSAN warnings.
+  * Remove obsolete Conflict/Replaces headers in control file (Closes: #866623)
+  * Remove obsolete mips libraries used to build arcboot (Closes: #864144)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Fri, 04 Aug 2017 01:13:34 -0400
+
+e2fsprogs (1.43.4-2) unstable; urgency=medium
+
+  * Re-enable metadata_csum for Debian (which was accidentally disabled
+    for 1.43.4-1)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 31 Jan 2017 19:54:55 -0500
+
+e2fsprogs (1.43.4-1) unstable; urgency=medium
+
+  * New upstream version
+  * Fix e2fsck to require that the system.data extended attribute is
+    always present even for files smaller than 60 bytes, to be
+    consistent with the kernel
+  * Drop the hard links for mkfs.ext4dev and fsck.ext4dev
+  * Clarify/update various man pages (Closes: #852726)
+  * Clarify the default for the "proceed?" question printed by mke2fs
+    and tune2fs.  (Closes: #852727)
+  * Fix various Coverity warnings and other memory leaks in fuse2fs and
+    extended attribute manipulation functions.
+  * Add Finnish and Malay translations
+  * Update Chinese, Czech, Polish, Serbian, and Spanish translations
+    (Closes: #774379)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 31 Jan 2017 17:31:52 -0500
+
+e2fsprogs (1.43.4~WIP.2017.01.30-1) unstable; urgency=medium
+
+  * Fix a bug which was causing mke2fs -d and fuse2fs to improperly
+    handle Posix ACL's.
+  * Fix a bug which could cause mke2fs -d to fail if there is an
+    zero-length file in source directory tree.
+  * Debugfs will now display project quota information.
+  * Debugfs has a more friendly and powerful to print and set extended
+    attributes.
+  * Fix a bug in mke2fs where I/O errors weren't getting properly
+    reported to the user.
+  * Fix a bug in resize2fs when operating on very large file systems
+    which have a block size different from the VM page size.
+  * If the reported device size is absurdly large, mke2fs will now
+    report an error instead looping forever or crashing.
+  * Replace a test file in the sources with an updated version which has
+    a DFSG-compliant copyright license.  This was making lawyers
+    nervous, even though the file was only used in regression tests and
+    was never used when building any binaries.   (Closes: #840733)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 30 Jan 2017 22:14:07 -0500
+
+e2fsprogs (1.43.3-1) unstable; urgency=medium
+
+  * Fix e2fsck's handling of timestamps on 32-bit system (Closes: #836559)
+  * E2fsck will sanity check and repair the extra isize fields in inodes
+    and the superblock.
+  * Fix sparc64 crashes when dereferencing unaligned integers in journal
+    blocks when metadata checksums are enabled.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 04 Sep 2016 20:41:21 -0400
+
+e2fsprogs (1.43.2-2) unstable; urgency=medium
+
+  * Fix build reproducibility problems
+  * Don't hide the linker flags for e2fsck.static
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Thu, 01 Sep 2016 23:30:55 -0400
+
+e2fsprogs (1.43.2-1) unstable; urgency=medium
+
+  * Change the default journal size to be larger for file systems larger
+    than 128 GB to improve performance on metadata-heavy workloads
+  * Clarify tune2fs's message when the user needs to run e2fsck
+    (Closes: #828022)
+  * Fix an alignment bug in e2fsck which caused sparc64 architectures to
+    crash when replaying the journal on file systems with a 64-bit block
+    number
+  * Fix a typo in debugfs when printing out the dtime field on file
+    systems with an extended timestamp
+  * Fix the logic in e2fsck which decides when to repair legacy negative
+    timestamp encodings.
+  * Add a command to debugfs to copy the inode structure from one inode
+    to another
+  * Fix resize2fs so it will not crash if there is an extended
+    attribute block but it doesn't need to migrate any blocks during
+    an off-line resize
+  * Fix a crash when mke2fs or debugfs tries to copy in a directory
+    hierarchy containing an empty directory
+  * Fix a bug in e2fsck caused by a power failure during e2fsck's journal
+    replay could leave the file system in a state where if the file
+    system is mounted without doing a full e2fsck scan, the file system
+    could get corrupted
+  * Fix big endian bugs in the e2undo program
+  * Fix debugfs's logdump so command so it can correctly handle journals
+    which are larger than 2GB
+  * Add new translations: Hungarian and Serbian
+  * Update the Catalan, Chinese, Danish, Dutch, French, German, Polish,
+    Swedish, Ukrainian translations
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Thu, 01 Sep 2016 00:55:13 -0400
+
+e2fsprogs (1.43.1-1) unstable; urgency=medium
+
+  * New upstream version
+  * Fix the Direct I/O fallback code in the Unix I/O manager so it
+    implements read-modify-write correctly.
+  * The mke2fs program will now warn if the user specifies a label which
+    is too long.  (Closes: #791630)
+  * Clean up various man pages (Closes: #766379, #761144, #770750,
+    #428361, #766127)
+  * Fix bug so that debugfs's rdump command works on the root directory
+    (Closes: #766125)
+  * Fix various Debian packaging issues (Closes: #825868)
+  * Build fully security hardened binaries
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 07 Jun 2016 23:09:55 -0400
+
+e2fsprogs (1.43-3) unstable; urgency=medium
+
+  * Fix various debian packaging nits
+  * Fix spelling mistakes in the copyright files
+  * Fix various spelling mistakes in man pages
+  * Fix project quota bugs in e2fsck and mke2fs
+  * Build binaries with hardening support
+  * Improve e2fsck messages when the journal superblock is corrupt and
+    the user declines to fix the journal.  (Closes: #768162)
+  * Fix debugfs's handling of "set_bg <bg> checksum calc" on 64-bit file
+    systems.
+  * Simplify the debian rules file
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Wed, 25 May 2016 00:51:33 -0400
+
+e2fsprogs (1.43-2) unstable; urgency=medium
+
+  * Update watch file to check for the GPG signatures
+  * Use dh_update_autotools_control to update config.{guess,sub}
+    automatically when building the package.
+  * Only try to run update-initramfs if it exists
+  * Transition to dbgsym packages
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Fri, 20 May 2016 14:07:40 -0400
+
+e2fsprogs (1.43-1) unstable; urgency=medium
+
+  * New upstream version
+  * Fix or improve offset support in mke2fs, e2undo, and libext2fs
+  * Update debian policy version to 3.9.8
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 17 May 2016 01:04:28 -0400
+
+e2fsprogs (1.43~WIP.2016.03.15-2) sid; urgency=low
+
+  * Fix FTBFS on big-endian systems
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Thu, 17 Mar 2016 22:55:52 -0400
+
+e2fsprogs (1.43~WIP.2016.05.12-1) unstable; urgency=medium
+
+  * New upstream version
+  * Clean up various man pages and usage messages
+  * Fix up gcc and Coverity warnings
+  * Stop building static binaries using dietlibc
+  * Fix potential out-of-boundary memory access in resize2fs
+  * Fix sparse_super2 bugs in mke2fs and resize2fs
+  * The mke2fs program will now support multiple -O options
+  * The e2image program now ignores checksum error so that debugging
+    snapshots of a file system can be taken of a broken file system
+  * E2fsck now more cleanly handles checksum errors while replaying the
+    journal
+  * Fix e2fsck to not try to set a UUID if the metadata_csum feature is
+    enabled since this will break the checksums
+  * Fix e2image so progress information won't get leaked to stdout
+  * Fix bugs in "mke2fs -E offset=NNNN" (Closes: #803629)
+  * Fix Hurd portability issues (Closes: #822576)
+  * Update initramfs in e2fsprogs's postinst script so the initial
+    ramdisk gets the updated e2fsprogs binaries (Closes: #804237)
+  * Work around texi2dvi bug which can cause build failures (Closes: #822227)
+  * E2fsck now prints "REBOOT SYSTEM" instead of "REBOOT LINUX" to
+    assuage the sensibilities of Hurd users (Closes: #769838)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Thu, 12 May 2016 00:18:45 -0400
+
+e2fsprogs (1.43~WIP.2016.03.15-1) unstable; urgency=low
+
+  * New upstream release
+  * Fix resize2fs bug that could leave block allocation bitmaps
+    uninitialized
+  * The tune2fs program will ask the user for confirmation before
+    starting dangerous operations if the terminal is available, and it
+    will replay the journal if necessary
+  * Fix a bug which in rare cases would cause e2fsck -fD to corrupt an
+    extent-mapped directory.
+  * E2fsck will now check for extent mapped inodes with no extent header
+    and clear them if found
+  * E2fsck now checks to make sure the extended attribute header doesn't
+    result in the xattr extending beyond the bounds of the inode
+  * Teach mke2fs to parse a human-readable argument for -i option
+  * Teach mke2fs to automatically handle creating file systems > 500T by
+    automatically enable the meta_bg feature
+  * Mke2fs will now prompt for user verification before rewriting a file
+    system's superblock using the -S option
+  * Mke2fs no longer complains if the user tries to create a file system
+    using the entire block device (e.g., without using a partition).
+    The minor number convention is not used by all block devices, and
+    it's quite normal in some circumstances to create a file system
+    on /dev/sdc instead of /dev/sdc1
+  * Debugfs now can properly display and set extended timestamps
+  * Add an ext2/3/4 FUSE server
+  * Fix an "mke2fs -d" bug which could create inodes with invalid
+    extended attribute blocks
+  * Fix miscellaneous file encryption bugs
+  * Fix miscellaneous MMP bugs in debugfs
+  * The e2fsck program will no longer update the quota inodes when it is
+    interrupted
+  * The filefrag program now accounts for holes in sparse files created
+    by the file punch operation as an expected/optimal mapping
+  * Clean up gcc/clang warnings
+  * Add support for the checksum seed feature
+  * Add support for the project quota feature
+  * Add fallocate support to libext2fs and to debugfs
+  * Clean up various man pages (Closes: #798425)
+  * Update debian policy compliance to 3.9.7
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 15 Mar 2016 01:34:14 -0400
+
+e2fsprogs (1.43~WIP.2015.05.18-1) unstable; urgency=low
+
+  * Merge in updates from the maint branch (changes from 1.42.13)
+  * Add support for file encryption feature
+  * Mke2fs will now create file systems with metadata_csum and 64bit
+    enabled by default.
+  * The resize2fs command can now convert file systems between 64-bit
+    and 32-bit mode.
+  * The new undo file format is much faster/efficient than before
+  * E2fsck now has readahead support to speed up its behavior on RAID
+    arrays.
+  * E2fsck can now rebuild/optimize inode extent trees
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 18 May 2015 01:47:43 -0400
+
+e2fsprogs (1.42.13-1) unstable; urgency=low
+
+  * New upstream version
+  * NMU acknowledge (Closes: #778948)
+  * Fixed a bug which could cause e2fsck to corrupt Hurd file systems.
+    (Closes: #760275)
+  * Fixed a deadlock which occurs when using systemd and e2fsck.conf's
+    logging feature.  (Closes: #775234)
+  * Fixed a bug which could cause programs using libext2's inode table
+    scanning functions from crashing on certain corrupted file systems.
+    (Closes: #773795)
+  * Fixed dumpe2fs so it won't crash if the user doesn't specify a block
+    device (file system).  (Closes: #764293)
+  * Fixed e2fsck so if it notices unexpected HTREE blocks in pass 2, it
+    will report the correct directory inode containing the inconsistency.
+  * If e2fsck fails to grow the dir_info structure due realloc(3) not
+    having enough memory, it will now fail with explanatory message
+    instead of staggering on failing with a confusing internal error
+    messages.
+  * The tune2fs program will zero out the superblock journal backup
+    information when removing a journal from a file system.
+  * The mke2fs program now enables the large_file feature by default.
+  * Fixed a bug which could cause badblocks to crash if there are millions
+    and millions of bad blocks.
+  * Fixed some use-after-free bug in resize2fs and e2fsck.
+  * Fixed some bigendian bugs that had crept into both indirect and extent
+    handling inside libext2fs.
+  * Updated/fixed various man pages.
+  * Update Esperanto, German, and Spanish translations.  Added Danish
+    translation.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 17 May 2015 20:38:27 -0400
+
+e2fsprogs (1.43~WIP-2015-03-29-1) unstable; urgency=low
+
+  * Merge in updates from the maint branch (changes from 1.42.12-1)
+  * Add support for inline directories
+  * Add support for the jbd2 checksum v3 format
+  * New dumpe2fs format
+  * Add support for file encryption feature
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 14 Dec 2014 22:49:03 -0500
+
+e2fsprogs (1.42.12-1.1) unstable; urgency=high
+
+  * Non-maintainer upload by the Security Team.
+  * Fix CVE-2015-1572: incomplete fix for CVE-2015-0247 (closes: #778948).
+
+ -- Michael Gilbert <mgilbert@debian.org>  Sun, 22 Feb 2015 01:50:57 +0000
+
+e2fsprogs (1.42.12-1) unstable; urgency=low
+
+  * New upstream version
+  * Fix various e2fsck bugs when trying to repair bigalloc file systems.
+  * E2fsck can now repair a file system with an overly large
+    s_first_meta_bg field, which had previously caused all e2fsprogs
+    programs to crash when trying to open such a file system.
+  * Fix e2fsck so that it can correctly fix a number of rare file system
+    corruptions that were discovered when using a file system fuzzer.
+  * Fix e2fsck so it does not try to write back block group descriptors
+    if they have not been modified.
+  * The mke2fs program will now place metadata blocks in the last
+    flex_bg so they are contiguous.  This reduces free space
+    fragmentation in a freshly created file system, as well as allowing
+    mke2fs commands which request extremely large flex_bg size to succeed.
+  * Mke2fs now creates hugefiles more efficiently (with fewer extent
+    tree blocks).
+  * Fix a 32/64-bit overflow bug that could cause resize2fs to loop
+    forever.
+  * Reduce the memory consumption of resize2fs for very large file
+    systems.
+  * Fix a bug that could cause resize2fs to create a corrupted file
+    system when shrinking a very large file system (typically > 16TB)
+    that had been previously grown using resize2fs.  (Closes: #756922)
+  * Fix tune2fs updating UUID's when manipulating file systems with
+    external journals (both the file system and journal UUID).
+  * Fix tune2fs so it can remove an external journal for file systems
+    with a 1k block size.
+  * Add a new debugfs command, "inode_dump", which prints the inode in
+    hex and ASCII format.
+  * The debugfs command "set_inode_field" will now automatically
+    allocate blocks for indirect blocks and extent tree blocks.
+  * Fix debugfs's "set_inode_field" so can properly handle
+    "block[IND|DIND|TIND]".
+  * The debugfs "rdump" command will now take multiple source arguments.
+  * Fix debugfs's argument parsing for the freefrag command.
+  * Fixed a double close(2) bug in "rdump" and "rdump -p".
+  * Fix filefrag to properly handle using the FIBMAP ioctl (with -B).
+  * e4defrag will now defrag backwards-allocated files
+  * Clarified messages that were confusing users in debugfs, e2fsck,
+    mke2fs, and resize2fs (Closes: #758029, #757543, #757544)
+  * Dumpe2fs will now complain if extra arguments are given to it.
+    (Closes: #758074)
+  * Update/clarify various man pages (Closes: #726760)
+  * Update Czech, Dutch, French, Polish, Spanish, Swedish, Ukrainian,
+    and Vietnamese translations
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Fri, 29 Aug 2014 08:50:48 -0400
+
+e2fsprogs (1.42.11-2) unstable; urgency=low
+
+  * Don't try to build lib/ext2fs/tst_ext2fs unless running "make
+    check"; this fixes a MIPS FTBFS problem because mips has a special
+    no-pics build needed for bootloaders where we only build libext2fs
+    but not libss or other libraries (Closes: #754605)
+  * Update French translation
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 13 Jul 2014 16:18:27 -0400
+
+e2fsprogs (1.42.11-1) unstable; urgency=medium
+
+  * New upstream version
+  * NMU acknowledge (Closes: #752107)
+  * mke2fs can now create hugefiles which are aligned to the beginning
+    of the disk (instead of relative to the beginning of the partition),
+    controlled via a mke2fs.conf configuration parameter.
+  * Fix a bug which caused e2fsck to abort a journal replay on a file
+    system with bigalloc enabled.  (Closes: #744953)
+  * Fix mke2fs so it more correctly handles large flex_bg counts
+  * Mke2fs will check the kernel version number and not just the sysfs
+    feature flag to determine whether it is safe to enable lazy
+    inode table initialization, so it won't get faked out if the ext4 is
+    compiled as a module which hasn't happened to be loaded yet.
+  * E2fsck will now automatically fix a last mount time or last write time
+    which is in the future in preen mode.
+  * Mke2fs will now check the file system revision number requested by the
+    command line, and reject it if it is too large.
+  * If filefrag runs into an error, it will continue processing the rest
+    of the files specified on the command line, but then exit with an
+    error code.
+  * Filefrag now prints some additional new flags (such as
+    FIEMAP_EXTENT_ENCODED), and print unknown flags as hex values.
+  * Fixed support in filefrag for files with > 2**32 blocks on 32-bit
+    platforms.
+  * Fixed a file descriptor leak in debugfs when copying files.
+  * Add Esperanto and Ukrainian translations, and update Czech, Dutch,
+    French, German, Italian, Polish, Swedish, and Vietnamese translations.
+  * Fixed cross-compilation support.  (Closes: #753375)
+  * Update/fix various man pages
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Wed, 9 Jul 2014 23:43:27 -0400
+
+e2fsprogs (1.42.10-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Add patch from upstream git that fixes creating filesystems in files
+    larger than 2GB on 32 bit architectures (Closes: #752107)
+
+ -- Hilko Bengen <bengen@debian.org>  Sat, 21 Jun 2014 12:57:25 +0200
+
+e2fsprogs (1.43~WIP-2014-02-04-1) unstable; urgency=low
+
+  * Merge in updates from the maint branch (changes from 1.42.10-1)
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Wed, 04 Feb 2014 23:31:56 -0500
+
+e2fsprogs (1.42.10-1) unstable; urgency=medium
+
+  * New upstream version
+  * The mke2fs program no longer requires a force (-F) option when
+    when creating a file system in a regular file, since this is a very
+    common use case when managing virtual machine images
+  * The mke2fs program will now ask for confirmation before wiping out a
+    pre-existing file system, partition label, or physical volume
+  * Fix e2fsck so that it properly handles an inconsistent quota inode.
+    Previously the quota inode could be completely corrupted, and
+    missing quota records could be not noticed
+  * Fix mke2fs so if packed metadata blocks are enabled that the block
+    group checksum are set correctly
+  * Debugfs has new commands to allow the quota inode to be queried directly
+  * Tune2fs will allow removal of dirty journal with two "-f" options
+    (Closes: #559301)
+  * Fixed some off-line resize2fs bugs when relocating metadata blocks
+    when growing or shrinking bigalloc file systems
+  * Fixed resize2fs's calculation of the minimum required file system
+    size.  This allows resize2fs -M to shrink the file system more
+    aggressively
+  * Fixed resize2fs to properly handle shrinking a very large and empty
+    file system to a very very small size
+  * Fixed e4defrag to work with 64-bit and bigalloc file systems
+  * Fixed e2fsck to not issue a large number of very scary (but
+    harmless) corruption messages when checking very large file systems
+    when the file system has more inodes than the number of seconds
+    since January 1, 1970.
+  * E2fsck will now check the whole file system if file system problems
+    are detected during its initial "pass 0" sanity check
+  * Filefrag now prints the "shared extent" flag which is used by some
+    file systems such as btrfs
+  * The mke2fs program would previously correctly omit the resize_inode
+    feature when creating a file system > 16TB when the fs size was
+    determined automatically.  It will now also do the right thing when
+    the user explicitly specifies the file system size.
+  * The message printed by logsave is now much less scary (Closes: #468821)
+  * Fix spelling typo in the package descriptions
+  * Update Czech, Dutch, French, German, Polish, Spanish, Swedish, and
+    Vietnamese translations (Closes: #703048)
+  * Update/fix various man pages
+  * Fix debian/rules compatibility problem with GNU make 4.0
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 18 May 2014 22:54:38 -0400
+
+e2fsprogs (1.42.9-3) unstable; urgency=medium
+
+  * Add the ability for mke2fs to create hugefiles
+  * Add support for the sparse_super2 compat feature
+  * Mke2fs can now force all of the metadata blocks to be at the
+    beginning of the file system
+  * Fix loopback mount detection (Closes: #497984)
+  * Add support to mke2fs to create a file system at an offset
+    (Closes: #417385)
+  * Mention badblocks in the package description (Closes: #718725)
+  * Update/fix various man pages (Closes: #719184, #719189)
+  * Improve e2fsck's "superblock corrupt" message (Closes: #719185)
+  * Miscellaneous Coverity clean ups
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 04 Feb 2014 22:17:22 -0500
+
+e2fsprogs (1.42.9-2) unstable; urgency=low
+
+  * Fix lintian warning: debian-changelog-has-wrong-weekday
+  * Fix lintian warning: non-standard-dir-perm by using dh_strip's
+    --dbg-package option instead of manually managing the debug files
+  * Fix printf type format mismatch in e2image
+  * Improved debugfs's error reporting when parsing block numbers
+  * Use consistent configure options across the multiple e2fsprogs
+    builds; this means that e2fsck.static will now use the blkid library
+    shipped with util-linux, instead of the internal one shipped with
+    the e2fsprogs sources.
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 30 Dec 2013 16:56:50 -0500
+
 e2fsprogs (1.42.9-1) unstable; urgency=low
 
   * New upstream version
@@ -11,7 +1224,7 @@
     system with the uninit_bg feature enabled.
   * E2fsck will properly allocate a new extent tree block in the rare
     case where one is needed when rehashing an extent-mapped directory.
-  * Mke2fs wil now properly set the LARGE_FILE feature when creating a
+  * Mke2fs will now properly set the LARGE_FILE feature when creating a
     journal > 2GB.
   * Debugfs will now correctly handle free a range of inodes using the
     freei command.
@@ -49,7 +1262,7 @@
   * Updated/fixed various man pages.  (Closes: #586218, #669730,
     #698076, #731329)
 
- -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 28 Dec 2013 23:18:36 -0500
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sat, 28 Dec 2013 23:18:36 -0500
 
 e2fsprogs (1.42.8-1) unstable; urgency=low
 
@@ -140,11 +1353,17 @@
     statistics
   * Document the bigalloc feature in the mke2fs man page.
     (Closes: #669730)
-  * Update Czech, Dutch, French, German, Polish, Sweedish, and
+  * Update Czech, Dutch, French, German, Polish, Swedish, and
     Vietnamese translations
 
  -- Theodore Y. Ts'o <tytso@mit.edu>  Tue, 21 Jan 2013 21:52:58 -0500
 
+e2fsprogs (1.43~WIP-2012-09-22-1) unstable; urgency=low
+
+  * Add metadata checksum feature
+
+ -- Theodore Y. Ts'o <tytso@mit.edu>  Sat, 22 Sep 2012 21:50:20 -0400
+
 e2fsprogs (1.42.6-1) unstable; urgency=low
 
   * New upstream version
@@ -260,7 +1479,7 @@
     particular, don't rewrite the quota inode unless the quotas are
     inconsistent
   * Optimized reading and writing bitmaps if direct I/O was enabled
-  * Update Czech, Dutch, French, German, Polish, Sweedish, and
+  * Update Czech, Dutch, French, German, Polish, Swedish, and
     Vietnamese translations
   * Fixed incorrect indentation in tune2fs man page
   * Update debian policy compliance to 3.9.3
@@ -385,7 +1604,7 @@
   * Don't look at the high 16 bits of i_file_acl if the 64-bit feature
     is not enabled; this fixes a Hurd compatibility field since this is
     used for the high 16 bits of i_mode on Hurd.
-  * Update Sweedish, Polish, French, German, and Czech translations
+  * Update Swedish, Polish, French, German, and Czech translations
 
  -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 16 Oct 2011 22:07:03 -0400
 
@@ -397,7 +1616,7 @@
   * Fixed various man pages
   * Fixed 64-bit block numbers in e2fsck's journal replay
   * Fixed mipsel FTBFS that was fixed for mips
-  * Update Sweedish, French, and Czech translations
+  * Update Swedish, French, and Czech translations
   * Convert to debian source 3.0 (quilt) format
 
  -- Theodore Y. Ts'o <tytso@mit.edu>  Sun, 09 Oct 2011 22:24:31 -0400
@@ -513,7 +1732,7 @@
       if the file system is mounted, so that an escape sequence won't
       cause a false positive.  (Closes: #619859)
   * E2fsck now uses less cpu time in pass 5
-  * E2fsck will no longer segault when a corrupted file system has a bad
+  * E2fsck will no longer segfault when a corrupted file system has a bad
     extent, and removing it leads to a block needing to be deallocated.
   * E2fsck now supports an extended "discard" option which will cause
       e2fsck to attempt discard all unused blocks after a full check
@@ -529,7 +1748,7 @@
       extended attributes and with time- and mount count-based file
       system checks disabled.
    * Mke2fs will not set a stride or strip size of one block based on
-       block bevice attributes obtained from sysfs.
+       block device attributes obtained from sysfs.
    * Mke2fs now displays a progress report during the discard process.
    * Mke2fs now handles extreme file system parameters correctly which
        previously caused the inodes per group to drop below 8, leading
@@ -650,7 +1869,7 @@
   * Fixed e2fsck not to ask permission from the user to abort if it's
     going to abort regardless of what the user is going to say...
   * E2fsck can now continue even if it fails to recreate the resize inode
-  * E2fsck will now avoid removing directory entries for inods found in
+  * E2fsck will now avoid removing directory entries for inodes found in
     the unused region of the inode table until after it restarts the fs
     check to avoid removing valid data.
   * E2fsck will now longer try to set the block group checksums if it
@@ -658,7 +1877,7 @@
   * Mke2fs will check both the physical and logical blocksizes of a
     device to better support 4k sector drives.
   * Mke2fs will accept the valid (but rarely useful) flex_bg size of 1
-  * E2fsck will check for cases where the EOFBLOCKS_FL is set whe nit is
+  * E2fsck will check for cases where the EOFBLOCKS_FL is set when it is
     not needed, and offer to clear it.
   * The com_err library will now only output a CR character if the
     stderr is connected to a tty in raw mode.
@@ -711,7 +1930,7 @@
     clocks.  (Closes: #559776)
   * Fix flex_bg inode table placement algorithm used by mke2fs for
     certain specific file system sizes
-  * Add source lintian overrids for weak-library-dev-dependency
+  * Add source lintian overrides for weak-library-dev-dependency
   * Fix FTBFS problem caused by texi2html changing (again) its output
     location.  (Closes: #552934)
   * Make e2fsck to avoid rehashing directories which can fit in a
@@ -758,7 +1977,7 @@
   * Fix resize2fs to correctly calculate the minimum size needed, when
     flex_bg is enabled, to prevent resize2fs -M from failing.
   * Dumpe2fs now displays more information about the contents of the journal
-  * Make sure the libblkid1 and libblkid1-dbg packags have changelogs
+  * Make sure the libblkid1 and libblkid1-dbg packages have changelogs
   * On low memory systems, e2fsck can print some very scary looking
     error messages.  Clean up them up to avoid user panic.  (Closes: #509529)
   * Enhance blkid to support .ko.gz files in the modules.dep parser
@@ -787,14 +2006,14 @@
     files when using FIBMAP.  (Closes: #540376)
   * Add a filefrag -B option to make it easier to debug the FIBMAP
     support.
-  * Allow e2fsprogs programs to allocate from uninitalized block groups.
+  * Allow e2fsprogs programs to allocate from uninitialized block groups.
   * Add a new program, e2freefrag, which displays information about the
     free space fragmentation in an ext2/3/4 filesystem.
   * E2fsck will now print much fuller information when the last mount
     time or last written time is in the future, since most people can't
     seem to believe their distribution has buggy init scripts, or they
     have a failed CMOS/RTS clock battery.
-  * Update French, Polish, Czech, and Sweedish translation from the
+  * Update French, Polish, Czech, and Swedish translation from the
     Translation Project.
   * Enhance debugfs's 'stat' command to print basic extent information
     for extent-mapped inodes, and add a new command, 'dump_extents'
@@ -808,7 +2027,7 @@
     to fail on ext4 filesystems if the directory needs to shrink by more
     than a block (Closes: #537510)
   * Fixed filefrag for non-extent based files
-  * Fix use of apostrohe's in package descriptions
+  * Fix use of apostrophe's in package descriptions
   * Don't use dietlibc when building for mips and mipsel architectures
 
  -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 20 Jul 2009 09:38:21 -0400
@@ -818,9 +2037,9 @@
   * New upstream release
   * Fix resize2fs bugs when shrinking ext4 filesystems
   * Update debian policy compliance to 3.8.2
-  * Update package descriptions to mention ext3 and ext4 filesytems
+  * Update package descriptions to mention ext3 and ext4 filesystems
       (Closes: #535530)
-  * Update French, Polish, Czech, Indonesian, and Sweedish translation
+  * Update French, Polish, Czech, Indonesian, and Swedish translation
       from the Translation Project.
   * If the resize2fs operation fails, the user will be told to fix up
     the filesystem using e2fsck -fy.
@@ -844,17 +2063,17 @@
     which can cause e2fsck to run out of memory when checking very large
     filesystems using extents.
   * Fix a bug in libext2fs which can cause e2fsck and resize2fs to write
-    uninitalized data into the portion of the inode beyond the first 128
+    uninitialized data into the portion of the inode beyond the first 128
     bytes when operating on extents; potentially corrupting filesystems.
   * The logsave program will now filter out the ^A and ^B characters when
     writing to the console.
   * Update/clarify man pages (Closes: #531385, #523063)
-  * Fix filefrag progam so it correctly checks for errors from the
+  * Fix filefrag program so it correctly checks for errors from the
     fiemap ioctl.
   * Change badblocks to allow block sizes larger than 4k.
   * Fix libext2fs to properly initialize i_extra_size when creating the
     journal and resize inodes.
-  * Resize2fs will now update the journal backup fileds in the
+  * Resize2fs will now update the journal backup fields in the
     superblock if the journal is moved; this avoids an unnecessary full
     fsck after resizing the filesystem.
   * Use the same encoding as the kernel for rec_len == 64k in 64k block
@@ -1122,7 +2341,7 @@
     environment variables are set.
   * Fix filefrag's ideal extent calculation (Closes: #458306)
   * Fix postinstall scripts when the user/group is in LDAP (Closes: #497010)
-  * Add Indonesian and update French, Polish, Dutch, German, Sweedish,
+  * Add Indonesian and update French, Polish, Dutch, German, Swedish,
        Czech, and Vietnamese Translations.  (Closes: #313697, #401092)
   * Update/clarified man pages
   * Add dpkg-gensymbols support to track ABI changes to the libraries
@@ -1199,7 +2418,7 @@
     descriptors first.
   * Fix resize2fs to clean up the resize_inode if all of the reserved
     gdt blocks are consumed during an off-line resize.
-  * Enable huge_file, dir_nlink, extra_isize feautres for mke2fs and tune2fs.
+  * Enable huge_file, dir_nlink, extra_isize features for mke2fs and tune2fs.
   * Enable huge_file, dir_nlink, extra_isize, and uninit_bg by default
     in mke2fs.conf.
   * Fix badblocks terminology in man page and program output.
@@ -1289,7 +2508,7 @@
 
   * Fix a very rare potential data corruption bug in e2fsck's journal
     replay.
-  * Updated German, Dutch, Sweedish, and Vietnamese translations.
+  * Updated German, Dutch, Swedish, and Vietnamese translations.
   * Force blkid to revalidate a device if its mtime is newer than the
     last validation time in the cache.
 
@@ -1311,7 +2530,7 @@
       and meta_bg filesystem features.
   * Use UID/GID ranges from adduser.conf if present, even though we
       don't use adduser to add users/groups.  (Closes: #473179)
-  * Updated German, Czech, Dutch, French, Polish, Sweedish, and
+  * Updated German, Czech, Dutch, French, Polish, Swedish, and
       Vietnamese translations.
   * Update/clarified the mke2fs man page
 
@@ -1333,7 +2552,7 @@
   * Fix e2fsck's handling of directory inodes with a corrupt size field.
   * Fully fix a resize2fs bug where extended attributes in large inodes
       could get dropped on big-endian systems.
-  * Update Czech, Dutch, Polish, Sweedish, and Vietnamese translations.
+  * Update Czech, Dutch, Polish, Swedish, and Vietnamese translations.
   * Significantly updated German translation!  Thanks to Philipp Thomas
     from Novell for stepping up to be our new German translation
     maintainer!  (Closes: #302512, #370247, #401092, #412882)
@@ -1347,7 +2566,7 @@
   * tune2fs no longer will remove the sparse_super feature, as it is dangerous
   * Update/clarified various man pages
   * Fix bug where large nodes were not getting fully copied when
-      shrinking a fileystem using resize2fs.
+      shrinking a filesystem using resize2fs.
   * Allow mke2fs and tune2fs to manipulate the large_file feature flag
   * Suppress fsck's warning message about an old-style fstab if the
       fstab file is empty.  (Closes: #468176)
@@ -1370,7 +2589,7 @@
       used by SELinux.
   * Add support in fsck to ignore mounted filesystems when given the -M option
   * Fix uuidd so it creates the pid file with the correct pid number
-  * Update Czech, Dutch, Polish, Sweedish, and Vietnamese translations
+  * Update Czech, Dutch, Polish, Swedish, and Vietnamese translations
       from the Translation Project.
 
  -- Theodore Y. Ts'o <tytso@mit.edu>  Thu, 28 Feb 2008 22:27:39 -0500
@@ -1410,7 +2629,7 @@
   * New upstream release.
   * Mke2fs will now create new filesystems with 256 byte inodes and the
       ext_attr feature flag by default.  This allows for much better
-      future compatibity with ext4 and speeds up extended attributes
+      future compatibility with ext4 and speeds up extended attributes
       even on ext3 filesystems.
   * Teach mke2fs and tune2fs to set a "test_fs" flag, which indicates
       that it is ok to use the filesystem on in-development kernel
@@ -1419,7 +2638,7 @@
       number.
   * Add support for detecting HFS+ and ext4/ext4dev filesystems in blkid
   * Fix blkid's ntfs UUID handling so it is compatible with vol_id
-  * Avoid a floating point exception when blkid tries to probe a corrpt
+  * Avoid a floating point exception when blkid tries to probe a corrupt
       reiserfs filesystem.
   * Fix potential overflow problem in e2image if the device name is
       too long.
@@ -1549,8 +2768,8 @@
   * Fix divide-by-zero error in blkid's NTFS proving logic
   * Add new blkid -g option which causes the blkid cache to be garbage
       collected
-  * libblkid: Fix bug which could cuase bid_type to be corrupted
-  * mke2fs: Add santy check to make sure inode_size * num_inodes isn't too big
+  * libblkid: Fix bug which could cause bid_type to be corrupted
+  * mke2fs: Add sanity check to make sure inode_size * num_inodes isn't too big
   * Fix additional Coverity bugs in mke2fs and e2fsck
   * Improve sanity check in e2fsck's algorithm for finding a backup superblock
   * Fix e2fsck get_size logic so that it will work with the Linux floppy
@@ -1584,7 +2803,7 @@
       systems
   * Fix blkid library to report the correct UUID from MD superblocks
   * Fix signed vs. unsigned problem in debugfs' setb/testb/freeb commands
-  * Enhance debugfs's date parser so it acccepts integer values
+  * Enhance debugfs's date parser so it accepts integer values
   * Fix e2fsck's pass1c accounting so it doesn't terminate too early
       if a file with multiply claimed blocks is hard linked. or not at
       all if the root directory contains shared blocks
@@ -1614,7 +2833,7 @@
 e2fsprogs (1.39+1.40-WIP-2007.04.07+dfsg-1) unstable; urgency=low
 
   * Add libreadline.so.5 support to libss.
-  * Impove badblocks -n/-w exclusive usage message.
+  * Improve badblocks -n/-w exclusive usage message.
   * Add debugging code (via the COMERR_DEBUG env. variable) to the
       com_err library
   * Fix dump_unused segfault in debugfs when a filesystem is not open
@@ -1622,7 +2841,7 @@
       (Closes: #413208)
   * Fix memory leak in blkid library.  (Closes: #413661)
   * Let the debugfs lcd command work even if a filesystem is not open
-  * Fix large number of miscellaneous Coveriy bugs.  (None were
+  * Fix large number of miscellaneous Coverity bugs.  (None were
       security-security).
   * Fix e2fsck to clear i_size for special devices with a bogus i_blocks
       field on the first pass.
@@ -1775,10 +2994,10 @@
 
   * Add udeb: lines to the Debian's shlibs files (Closes: #356293)
   * Enhance dumpe2fs to print the size of the journal
-  * Fix e2sprogs so that it is 32-bit clean on x86 platorms.
+  * Fix e2sprogs so that it is 32-bit clean on x86 platforms.
   * Fix mklost+ound so that it creates a full-sized directory on 4k and
     larger block sizes.
-  * Add mke2fs.conf coniguration file to conigure mke2fs's defaults
+  * Add mke2fs.conf configuration file to configure mke2fs's defaults
   * Add devmapper support to the blkid library.
   * E2fsck, resize2fs and mke2fs will now open the filesystem device in
     exclusive mode
@@ -1795,7 +3014,7 @@
   * Enhance e2fsck so it will fix the external journal hint in the
     superblock if it is out of date.
   * Fix debugfs's icheck to correctly report the owner of an EA block
-  * Update Sweedish translation
+  * Update Swedish translation
   * Add a configuration parameter to e2fsck.conf to control whether or not
     filesystem checks are done when the system is running on battery power.
   * Print an explanation when skipping a check due being on battery
@@ -1838,7 +3057,7 @@
     this as a fatal error.  (Closes: #343662, #343645)
   * Move the blkid and uuidgen binaries out of libblkid1 and libuuid1 and
     into the e2fsprogs package to support soname transitions and
-    simulaneous installs of multiarch flavors to coexist.  (It's not worth
+    simultaneous installs of multiarch flavors to coexist.  (It's not worth
     creating two whole new packages for two separate binaries, so we just
     fold them into e2fsprogs.)  (Closes: #330737, #330736)
   * Optionally allow the user to interrupt e2fsck "safely" during a boot
@@ -1854,7 +3073,7 @@
   * Detect if the superblock's last mount time or last write time is in
     the future, and offer to fix it if this is the case (Closes: #327580)
   * Add new debugfs command, set_current_time which sets the time used to
-    update the filesystems's time fields.
+    update the filesystem's time fields.
   * Fix display bug in badblocks -sw when printing the "done" message.
     (Closes: #322231)
   * Improve blkid's FAT/VFAT filesystem detection code so that it can find
@@ -1887,7 +3106,7 @@
   * Fix a compile_et bug which miscount the number of error messages if
     continuations are used in the .et file, and fix compatibility problems
     with MIT Kerberos 1.4
-  * Add extra sanity checks to protect users from unusual cirucmstances
+  * Add extra sanity checks to protect users from unusual circumstances
     where /etc/mtab may not be sane, by checking to see if the device is
     reported busy (works on Linux 2.6) kernels.  (Closes: #319002)
   * Fix use-after-free bug in e2fsck when finishing up the use of the
@@ -1897,7 +3116,7 @@
 
 e2fsprogs (1.38-1.1) unstable; urgency=low
 
-  * NMU for RC bug durring bug squishing party
+  * NMU for RC bug during bug squishing party
   * Fix for changes to texi2html, patch by Matt Kraai
     (Closes: #317862, #320389)
   * version build-depend on texi2html, won't work with older one anymore
@@ -1940,7 +3159,7 @@
   * Make the blkid library much more efficient when a new device is added
     on systems with a huge number of disks.
   * Fix handling of the PAGER and SS_READLINE_PATH environment variables
-    in the ss library, and the TEST_IO_* environemnt vaiables for the
+    in the ss library, and the TEST_IO_* environment variables for the
     test_io io_manager, which was accidentally broken in 1.37-1.
   * Fix libblkid's recognition of cramfs filesystems, and add support for
     cramfs labels.
@@ -2098,13 +3317,13 @@
         "4g" on the command line) if the user finds this more convenient
         than specifying a block count.
   * Fix an obscure, hard-to find bug in "e2fsck -S" caused by an inode
-        cache conherency problem.
+        cache coherency problem.
   * Debugfs now supports a new command, set_inode_field, which allows a
         user to manually set a specific inode field more conveniently, as
         well as set entries in the indirect block map.
   * Debugfs's set_super_value command has been enhanced so that the user
         can set most superblock fields, including the date/time fields and
-        some of the more newsly added superblock fields.
+        some of the more newly added superblock fields.
   * E2fsprogs programs now accept an offset to be passed to the file
         specifiers, via the syntax: "/tmp/test.img?offset=1024"
   * E2fsprogs will now accept blocksizes up to 65536; kernel support on
@@ -2182,7 +3401,7 @@
     we need an explict Conflict: sysvinit (<< 2.85-4) header. (Closes: #243829)
   * Update the UUID library man pages
   * Fix a Y8.8888K potential problem with the uuid library
-  * Minor updates to the german translation
+  * Minor updates to the German translation
   * Clarified/corrected the copyright statements of the UUID and blkid
     libraries in the Debian copyright files.
   * Added sanity check to the blkid library so that if current time is
@@ -2208,7 +3427,7 @@
   * Use the DEBUGFS_PAGER environment variable in preference to PAGER
     (Closes: #239547)
   * Added French translation
-  * Be flexible about the name of the ACPI device that cooresponds to
+  * Be flexible about the name of the ACPI device that corresponds to
     the AC adapter (Closes: #242136)
 
  -- Theodore Y. Ts'o <tytso@mit.edu>  Mon, 12 Apr 2004 12:38:34 -0400
@@ -2287,7 +3506,7 @@
     for debugfs (unfortunately, Debian policy says we must use
     /usr/bin/pager even if it results in very annoying behaviour for
     the user since 'less' is used in preference to 'more' unless it is
-    globally overriden via update-alternatives(8).  Oh, well.  Debian
+    globally overridden via update-alternatives(8).  Oh, well.  Debian
     users are encouraged to set DEBUGFS_PAGER to be "more" in their
     dot files to avoid this brain damage).
   * Fix libuuid1-udeb so that it provides libuuid1.  (Closes: #229633)
@@ -2331,7 +3550,7 @@
   * Fix handling of corrupted indirect blocks in the bad block inode.
   * If the number of mounts until the next forced filesystem check is less
     than 6, mention this to the user.  (Closes: #157194)
-  * E2fsck will try to avoid doing a forced filesystem chcek if a system
+  * E2fsck will try to avoid doing a forced filesystem check if a system
     is running on batteries according to APM or ACPI.  (Closes: #205177)
   * Fix problems in the German translation.  (Closes: #2000086)
   * Updated Swedish translation and added Polish translation.
@@ -2397,7 +3616,7 @@
   * Fix erroneous reference to /usr/share/doc/e2fsprogs/html-info in
     /usr/share/doc-base/libext2fs (Closes: #203157)
   * Explicitly specify the version of libblkid1 needed in
-    e2fsprogs.shlibs.local in order to avoid picking up the wrong depedency.
+    e2fsprogs.shlibs.local in order to avoid picking up the wrong dependency.
     (Closes: #203157)
   * Changed priority of libblkid1-udeb to be standard, not required.
 
@@ -2477,7 +3696,7 @@
 e2fsprogs (1.33-5) unstable; urgency=low
 
   * Clarify blocksize units when displaying messages in resize2fs, and
-    support using suffixes (sectors, kilobytes, megabites, gigabytes)
+    support using suffixes (sectors, kilobytes, megabytes, gigabytes)
     to the size parameter to indicate units.  (Closes: #189814)
   * Fix debugfs core-dumping problem caused by getopt.  (Works around: #192834)
   * Add package dependency to shlibs for comerr to indicate support
@@ -2545,11 +3764,11 @@
 
   * Provide /usr/include/com_err.h, which was previously provided by the
     libkrb5-dev package
-  * Change the sectoin of com_err-dev, ss-dev, uuid-dev, libblkid-dev,
+  * Change the section of com_err-dev, ss-dev, uuid-dev, libblkid-dev,
     e2fslibs-dev to libdevel
   * Add libblkid1-udeb package for the Debian Installer.
   * Use the SS_READLINE_PATH environment variable to control the search
-    for a suitable readine library.
+    for a suitable readline library.
   * Fix bug in mke2fs, which was was incorrectly checking the argument
     to the -g option if the default block size is used.  (Closes: #188319)
   * Update man pages.  (Closes: #188318)
@@ -2572,7 +3791,7 @@
     the block group specific counters quietly.  This is needed for an
     experimental kernel patch which improves SMP scalability by not
     locking the entire filesystem during block or inode allocation; if
-    the filesystem is not unmoutned cleanly, the global counts may not
+    the filesystem is not unmounted cleanly, the global counts may not
     be accurate.
   * Fix a bug in fsck which can cause it to hang trying to access the
     floppy disk if there the floppy drive has filesystem type of
@@ -2635,7 +3854,7 @@
   * Generate udeb package for debian-installer (Martin Sjoegren, Closes:
     #162212).
   * Fixed installation of mkinitrd script (don't use dh_install).  Remove
-    it from the wrong location where it was, in preinst.  Hopefully noone
+    it from the wrong location where it was, in preinst.  Hopefully no one
     noticed.
   * Also have old scripts/e2fsprogs.mkinitrd removed.
   * Bumped Standards-Version to 3.5.6, no change.  3.5.7 will need a bit
@@ -2672,7 +3891,7 @@
 
 e2fsprogs (1.28-2) unstable; urgency=low
 
-  * Fixed my adapation of the mips non-pic build (Closes: #159757).
+  * Fixed my adaption of the mips non-pic build (Closes: #159757).
 
  -- Yann Dirson <dirson@debian.org>  Fri,  6 Sep 2002 00:03:45 +0200
 
@@ -2760,7 +3979,7 @@
 e2fsprogs (1.26-1) unstable; urgency=low
 
   * This uploads fixes 10 bugs, including data-corruption problems, and
-    adds much to the ease of maintainance and problem tracking.  Good
+    adds much to the ease of maintenance and problem tracking.  Good
     choice for woody.
 
   * New upstream release (Closes: #106622, #116975, #118443, #119624,
@@ -2769,7 +3988,7 @@
     trashed external journals needing to be replayed, e2fsck now hides
     visible journal files (data corruption problems when not excluded from
     a backup and then restored) (Closes: #132654).
-  ** Other noticable bugs fixed include: e2fsck null pointer
+  ** Other noticeable bugs fixed include: e2fsck null pointer
     dereferencing, fsck did not finds LVM volumes by UUID or by label,
     largefile support (ie. dealing with filesystems inside 2GB+ files) was
     broken in several programs.
@@ -2954,14 +4173,14 @@
     tune2fs.
   * New binary package with statically linked e2fsck, recommending a
     statically linked shell (Closes: #62611).
-  * All deps against e2fsprogs itself now versionned (lintian).
+  * All deps against e2fsprogs itself now versioned (lintian).
   * Updated copyright file (upstream location, packaging copyright notice
     for previous maintainers and for Alcove).
-  * Remove call to dh_testversion, use versionned build-dep instead
+  * Remove call to dh_testversion, use versioned build-dep instead
     (lintian).
   * Support for DEB_BUILD_OPTIONS debug/nostrip for policy 3.2
     compliance.
-  * Use dh_shlibdeps -l instead of setting LD_LIBRARY_PATH explicitely -
+  * Use dh_shlibdeps -l instead of setting LD_LIBRARY_PATH explicitly -
     necessary for new versions of fakeroot, and requires debhelper 3.0.23
     for a fix.  Well finally 3.0.23 is buggy, leave this for later.
   * Avoid to call ldconfig at "make install" time, too costly.
@@ -2993,7 +4212,7 @@
 
   * Clarified libuuid copyright to LGPL-2, excluding LGPL-2.1.
   * Added build-dependency on debhelper (Closes: #67532).
-  * Don't paralelize fsck runs on same drive for hd[efgh] (Closes:
+  * Don't parallelize fsck runs on same drive for hd[efgh] (Closes:
     #59103).
   * Upload pristine source, -1 was erroneously uploaded as a
     debian-specific package.
@@ -3117,7 +4336,7 @@
   * Fail with error message when /dev/null cannot be opened (Fixes:
     Bug#35595).
   * Fixed typo in e2fsck/unix.c (Fixes: Bug#36960).
-  * Added "emeregency help" options summary to e2fsck (Fixes: Bug#11372).
+  * Added "emergency help" options summary to e2fsck (Fixes: Bug#11372).
   * Prepared debian/rules for usr/share/man/.
 
  -- Yann Dirson <dirson@debian.org>  Tue,  1 Jun 1999 23:37:12 +0200
@@ -3142,7 +4361,7 @@
   * Incorporated patches from Gordon Matzigkeit for hurd cross-compilation:
   * - configure.in: Change cross-compile default for sizeof (long
       long) to 8, so that __s64 and __u64 get defined in ext2fs.h.
-      (BUILD_CC): Discover a native compiler if we are cross-compling
+      (BUILD_CC): Discover a native compiler if we are cross-compiling
       (used for util/subst).
     - Include linux/types.h instead of asm/types.h, so that
       non-Linux platforms use the stubbed version provided with this
@@ -3472,7 +4691,7 @@
   * copied "configure" usr_prefix change (see below), into configure.in
   * updated debian.control file, added Pre-Depends field
     created preinst script to check dpkg --assert-predepends
-    tidyed and fixed debian.rules
+    tidied and fixed debian.rules
   * set e2fsck to link shared, as suggested by Bruce Perens in Bug#2332
   * corrected problem in e2fsck error message, Bug#2534
   * added Architecture field
@@ -3501,7 +4720,7 @@
 e2fsprogs (0.5b-1) unstable; urgency=low
 
   * Made "fsck -t <filesystem-type> <device>" work correctly. Formerly
-    the -t argument was overriden by the filesystem type listed for the
+    the -t argument was overridden by the filesystem type listed for the
     device in /etc/fstab.
   * added Debian GNU/Linux package maintenance system files
 
diff --git a/debian/comerr-dev.files.in b/debian/comerr-dev.install
similarity index 100%
rename from debian/comerr-dev.files.in
rename to debian/comerr-dev.install
diff --git a/debian/comerr-dev.postinst b/debian/comerr-dev.postinst
new file mode 100644
index 0000000..aae743a
--- /dev/null
+++ b/debian/comerr-dev.postinst
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Abort on error.
+set -e
+
+symlink_match()
+{
+	local SYMLINK="$1"
+	local SYMLINK_TARGET="$2"
+
+	[ "$(readlink "$SYMLINK")" = "$SYMLINK_TARGET" ] || \
+	[ "$(readlink -f "$SYMLINK")" = "$SYMLINK_TARGET" ]
+}
+
+SYMLINK=/usr/share/doc/comerr-dev
+SYMLINK_TARGET=libcomerr2
+SYMLINK_TARGET2=libcom-err2
+
+if [ "$1" = "configure" ] && [ -h "${SYMLINK}.dpkg-backup" ]
+then
+    if symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET" ||
+       symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET2"
+    then
+	rm -f "${SYMLINK}.dpkg-backup"
+    fi
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/comerr-dev.postrm b/debian/comerr-dev.postrm
new file mode 100644
index 0000000..8f9e679
--- /dev/null
+++ b/debian/comerr-dev.postrm
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# Abort on error.
+set -e
+
+symlink_match()
+{
+	local SYMLINK="$1"
+	local SYMLINK_TARGET="$2"
+
+	[ "$(readlink "$SYMLINK")" = "$SYMLINK_TARGET" ] || \
+	[ "$(readlink -f "$SYMLINK")" = "$SYMLINK_TARGET" ]
+}
+
+SYMLINK=/usr/share/doc/comerr-dev
+SYMLINK_TARGET=libcomerr2
+SYMLINK_TARGET2=libcom-err2
+
+if [ "$1" = "purge" ] && [ -h "${SYMLINK}.dpkg-backup" ]
+then
+	rm -f "${SYMLINK}.dpkg-backup"
+fi
+if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
+   [ -n "$2" ] && [ ! -e "$SYMLINK" ] && [ -h "${SYMLINK}.dpkg-backup" ]
+then
+    if symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET" ||
+       symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET2"
+    then
+	echo "Restoring backup of $SYMLINK ..."
+	mv "${SYMLINK}.dpkg-backup" "$SYMLINK"
+    fi
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/comerr-dev.preinst b/debian/comerr-dev.preinst
new file mode 100644
index 0000000..5d8090a
--- /dev/null
+++ b/debian/comerr-dev.preinst
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# Abort on error.
+set -e
+
+symlink_match()
+{
+	local SYMLINK="$1"
+	local SYMLINK_TARGET="$2"
+
+	[ "$(readlink "$SYMLINK")" = "$SYMLINK_TARGET" ] || \
+	[ "$(readlink -f "$SYMLINK")" = "$SYMLINK_TARGET" ]
+}
+
+SYMLINK=/usr/share/doc/comerr-dev
+SYMLINK_TARGET=libcomerr2
+SYMLINK_TARGET2=libcom-err2
+
+if [ "$1" = "install" -o "$1" = "upgrade" ] &&
+   [ -n "$2" ] && [ -h "$SYMLINK" ]
+then
+    if symlink_match "$SYMLINK" "$SYMLINK_TARGET" ||
+       symlink_match "$SYMLINK" "$SYMLINK_TARGET2"
+    then
+	mv -f "$SYMLINK" "${SYMLINK}.dpkg-backup"
+    fi
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/compat b/debian/compat
index 7f8f011..48082f7 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+12
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..76a69a1
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,192 @@
+Source: e2fsprogs
+Section: admin
+Priority: required
+Maintainer: Theodore Y. Ts'o <tytso@mit.edu>
+Build-Depends: gettext, texinfo, pkg-config, libfuse-dev [linux-any kfreebsd-any] <!pkg.e2fsprogs.no-fuse2fs>, debhelper (>= 12.0), dh-exec, libblkid-dev, uuid-dev, m4, udev [linux-any], systemd [linux-any], cron [linux-any]
+Standards-Version: 4.5.1
+Homepage: http://e2fsprogs.sourceforge.net
+Vcs-Browser: https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
+Vcs-Git: https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git -b debian/master
+
+Package: fuse2fs
+Build-Profiles: <!pkg.e2fsprogs.no-fuse2fs>
+Priority: optional
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Architecture: linux-any kfreebsd-any
+Description: ext2 / ext3 / ext4 file system driver for FUSE
+ fuse2fs is a FUSE file system client that supports reading and
+ writing from devices or image files containing ext2, ext3, and ext4
+ file systems.
+
+Package: logsave
+Priority: optional
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Replaces: e2fsprogs (<< 1.45.3-1)
+Breaks: e2fsprogs (<< 1.45.3-1)
+Architecture: any
+Multi-Arch: foreign
+Description: save the output of a command in a log file
+ The logsave program will execute cmd_prog with the specified
+ argument(s), and save a copy of its output to logfile.  If the
+ containing directory for logfile does not exist, logsave will
+ accumulate the output in memory until it can be written out.  A copy
+ of the output will also be written to standard output.
+
+Package: e2fsck-static
+Build-Profiles: <!pkg.e2fsprogs.no-static>
+Priority: optional
+Depends: ${misc:Depends}
+Recommends: sash | bash-static | zsh-static | busybox-static
+Architecture: any
+Description: statically-linked version of the ext2/ext3/ext4 filesystem checker
+ This may be of some help to you if your filesystem gets corrupted enough
+ to break the shared libraries used by the dynamically linked checker.
+ .
+ This binary takes much more space than its dynamic counterpart located
+ in e2fsprogs, though.
+ .
+ You may want to install a statically-linked shell as well, to be able
+ to run this program if something like your C library gets corrupted.
+
+Package: e2fsprogs-l10n
+Section: localization
+Priority: optional
+Depends: e2fsprogs (>= ${binary:Version}), e2fsprogs (<< ${binary:Version}+c~), ${misc:Depends}
+Replaces: e2fsprogs (<< 1.43.5-1)
+Architecture: all
+Multi-Arch: foreign
+Description: ext2/ext3/ext4 file system utilities - translations
+ The ext2, ext3 and ext4 file systems are successors of the original ext
+ ("extended") file system. They are the main file system types used for
+ hard disks on Debian and other Linux systems.
+ .
+ This package provides translations for messages for programs found in
+ the 'e2fsprogs' package.
+
+Package: libcom-err2
+Section: libs
+Priority: optional
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Replaces: libcomerr2 (<< 1.43.9-1~)
+Breaks: libcomerr2 (<< 1.43.9-1~)
+Provides: libcomerr2 (= ${binary:Version})
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Description: common error description library
+ libcomerr is an attempt to present a common error-handling mechanism to
+ manipulate the most common form of error code in a fashion that does not
+ have the problems identified with mechanisms commonly in use.
+
+Package: comerr-dev
+Section: libdevel
+Priority: optional
+Depends: libc6-dev | libc-dev, libcom-err2 (= ${mainBinary}), ${misc:Depends}
+Suggests: doc-base
+Replaces: e2fslibs-dev (<< 1.33-2), libkrb5-dev (<< 1.3)
+Architecture: any
+Multi-Arch: same
+Description: common error description library - headers and static libraries
+ libcom_err is an attempt to present a common error-handling mechanism to
+ manipulate the most common form of error code in a fashion that does not
+ have the problems identified with mechanisms commonly in use.
+ .
+ This package contains the development environment for the com_err library.
+
+Package: libss2
+Section: libs
+Priority: optional
+Depends: libcom-err2, ${shlibs:Depends}, ${misc:Depends}
+Replaces: e2fsprogs (<< 1.34-1)
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Description: command-line interface parsing library
+ libss provides a simple command-line interface parser which will
+ accept input from the user, parse the command into an argv argument
+ vector, and then dispatch it to a handler function.
+ .
+ It was originally inspired by the Multics SubSystem library.
+
+Package: ss-dev
+Section: libdevel
+Priority: optional
+Depends: libc6-dev | libc-dev, libss2 (= ${mainBinary}), comerr-dev, ${misc:Depends}
+Architecture: any
+Multi-Arch: same
+Description: command-line interface parsing library - headers and static libraries
+ This package includes a tool that parses a command table to generate
+ a simple command-line interface parser, the include files needed to
+ compile and use it, and the static libs.
+ .
+ It was originally inspired by the Multics SubSystem library.
+ .
+ This package contains the development environment for the ss library.
+
+Package: e2fsprogs-udeb
+Build-Profiles: <!noudeb>
+Package-Type: udeb
+Section: debian-installer
+Priority: optional
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Architecture: any
+Description: stripped-down versions of e2fsprogs, for debian-installer
+ This package is an e2fsprogs package built for a reduced size, so that
+ it can help to save space in debian-installer.
+ .
+ Don't attempt to install this package, it has no support for a couple of
+ features you surely want.  Anyway it should refuse to install.
+
+Package: libext2fs2
+Section: libs
+Priority: optional
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Replaces: e2fslibs (<< 1.43.9-1~)
+Breaks: e2fslibs (<< 1.43.9-1~)
+Provides: e2fslibs (= ${binary:Version})
+Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
+Description: ext2/ext3/ext4 file system libraries
+ The ext2, ext3 and ext4 file systems are successors of the original ext
+ ("extended") file system. They are the main file system types used for
+ hard disks on Debian and other Linux systems.
+ .
+ This package provides the ext2fs and e2p libraries, for userspace software
+ that directly accesses extended file systems. Programs that use libext2fs
+ include e2fsck, mke2fs, and tune2fs. Programs that use libe2p include
+ dumpe2fs, chattr, and lsattr.
+
+Package: libext2fs-dev
+Section: libdevel
+Priority: optional
+Depends: libc6-dev | libc-dev, comerr-dev, libext2fs2 (= ${binary:Version}), ${misc:Depends}
+Replaces: e2fslibs-dev (<< 1.43.9-1~)
+Breaks: e2fslibs-dev (<< 1.43.9-1~)
+Provides: e2fslibs-dev (= ${binary:Version})
+Suggests: doc-base
+Architecture: any
+Description: ext2/ext3/ext4 file system libraries - headers and static libraries
+ The ext2, ext3 and ext4 file systems are successors of the original ext
+ ("extended") file system. They are the main file system types used for
+ hard disks on Debian and other Linux systems.
+ .
+ This package contains the development environment for the ext2fs and e2p
+ libraries.
+
+Package: e2fsprogs
+XB-Important: yes
+Pre-Depends: ${shlibs:Depends}, ${misc:Depends}, libblkid1, libuuid1
+Depends: logsave
+Multi-Arch: foreign
+Suggests: gpart, parted, fuse2fs, e2fsck-static
+Recommends: e2fsprogs-l10n
+Architecture: any
+Description: ext2/ext3/ext4 file system utilities
+ The ext2, ext3 and ext4 file systems are successors of the original ext
+ ("extended") file system. They are the main file system types used for
+ hard disks on Debian and other Linux systems.
+ .
+ This package contains programs for creating, checking, and maintaining
+ ext2/3/4-based file systems.  It also includes the "badblocks" program,
+ which can be used to scan for bad blocks on a disk or other storage device.
diff --git a/debian/control.in b/debian/control.in
deleted file mode 100644
index 6db7cd9..0000000
--- a/debian/control.in
+++ /dev/null
@@ -1,330 +0,0 @@
-define(MULTIARCH_HEADERS,ifdef(`DO_MULTIARCH',
-Multi-Arch: same
-Pre-Depends: ${misc:Pre-Depends},REMOVE_ME))dnl
-define(UTIL_LINUX_NG_DEFINES,
-ifdef(`UTIL_LINUX_NG', ``libblkid-dev (>= 2.16), uuid-dev (>= 2.16),''))dnl
-define(DIETLIBC_DEFINES,
-ifdef(`DIETLIBC', ``dietlibc-dev (>> 0.30) [alpha amd64 arm hppa i386 ia64 powerpc ppc64 s390 sparc],''))dnl
-Source: e2fsprogs
-Section: admin
-Priority: required
-Maintainer: Theodore Y. Ts'o <tytso@mit.edu>
-Build-Depends: gettext, texinfo, pkg-config, DIETLIBC_DEFINES gcc-multilib [mips mipsel], debhelper (>= 7.0), UTIL_LINUX_NG_DEFINES m4
-Standards-Version: 3.9.5
-Homepage: http://e2fsprogs.sourceforge.net
-
-ifdef(`E2FSCK_STATIC',``
-Package: e2fsck-static
-Priority: optional
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Recommends: sash | bash-static | zsh-static | busybox-static | zsh30-static
-Architecture: any
-Description: statically-linked version of the ext2/ext3/ext4 filesystem checker
- This may be of some help to you if your filesystem gets corrupted enough
- to break the shared libraries used by the dynamically linked checker.
- .
- This binary takes much more space than its dynamic counterpart located
- in e2fsprogs, though.
- .
- You may want to install a statically-linked shell as well, to be able
- to run this program if something like your C library gets corrupted.
-'')dnl
-
-Package: libcomerr2
-Section: libs
-Provides: libcomerr-kth-compat
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Replaces: e2fsprogs (<< 1.34-1)
-Architecture: any
-MULTIARCH_HEADERS
-Description: common error description library
- libcomerr is an attempt to present a common error-handling mechanism to
- manipulate the most common form of error code in a fashion that does not
- have the problems identified with mechanisms commonly in use.
-
-Package: comerr-dev
-Section: libdevel
-Priority: extra
-Depends: libc6-dev | libc-dev, libcomerr2 (= ${mainBinary}), ${misc:Depends}
-Suggests: doc-base
-Replaces: e2fslibs-dev (<< 1.33-2), libkrb5-dev (<< 1.3)
-Architecture: any
-Description: common error description library - headers and static libraries
- libcom_err is an attempt to present a common error-handling mechanism to
- manipulate the most common form of error code in a fashion that does not
- have the problems identified with mechanisms commonly in use.
- .
- This package contains the development environment for the com_err library.
-
-Package: libss2
-Section: libs
-Depends: libcomerr2, ${shlibs:Depends}, ${misc:Depends}
-Replaces: e2fsprogs (<< 1.34-1)
-Architecture: any
-MULTIARCH_HEADERS
-Description: command-line interface parsing library
- libss provides a simple command-line interface parser which will
- accept input from the user, parse the command into an argv argument
- vector, and then dispatch it to a handler function.
- . 
- It was originally inspired by the Multics SubSystem library.
-
-Package: ss-dev
-Section: libdevel
-Priority: extra
-Depends: libc6-dev | libc-dev, libss2 (= ${mainBinary}), comerr-dev, ${misc:Depends}
-Architecture: any
-Description: command-line interface parsing library - headers and static libraries
- This package includes a tool that parses a command table to generate
- a simple command-line interface parser, the include files needed to
- compile and use it, and the static libs.
- . 
- It was originally inspired by the Multics SubSystem library.
- .
- This package contains the development environment for the ss library.
-ifdef(`UTIL_LINUX_NG',,``
-Package: libuuid1
-Section: libs
-Depends: passwd, ${shlibs:Depends}, ${misc:Depends}
-Recommends: uuid-runtime
-Replaces: e2fsprogs (<< 1.34-1)
-Architecture: any
-MULTIARCH_HEADERS
-Description: Universally Unique ID library
- The libuuid library generates and parses 128-bit universally unique
- ids (UUIDs).  A UUID is an identifier that is unique across both
- space and time, with respect to the space of all UUIDs.  A UUID can
- be used for multiple purposes, from tagging objects with an extremely
- short lifetime, to reliably identifying very persistent objects
- across a network.
- .
- See RFC 4122 for more information.  
-
-Package: uuid-runtime
-Section: libs
-Priority: optional
-Depends: passwd, libuuid1 (>> 1.40.3-1), ${shlibs:Depends}, ${misc:Depends}
-Replaces: e2fsprogs (<= 1.40.3-1ubuntu1)
-Architecture: any
-Description: runtime components for the Universally Unique ID library
- The libuuid library generates and parses 128-bit universally unique
- ids (UUIDs).  A UUID is an identifier that is unique across both
- space and time, with respect to the space of all UUIDs.  A UUID can
- be used for multiple purposes, from tagging objects with an extremely
- short lifetime, to reliably identifying very persistent objects
- across a network.
- .
- See RFC 4122 for more information.  
- .
- This package contains the uuidgen program and the uuidd daemon.
- .
- The uuidd daemon is used to generate UUIDs, especially time-based
- UUID’s, in a secure and guaranteed-unique fashion, even in the face
- of large numbers of threads trying to grab UUID’s running on
- different CPU’s. It is used by libuuid as well as the uuidgen
- program.
-
-Package: libuuid1-udeb
-XC-Package-Type: udeb
-Section: debian-installer
-Priority: optional
-Depends: ${shlibs:Depends}
-Architecture: any
-Description: stripped down universally unique id library, for debian-installer
- libuuid generates and parses 128-bit universally unique ids (UUIDs).
- See RFC 4122 for more information.
- .
- This is a minimal package for debian-installer.
-
-Package: uuid-dev
-Section: libdevel
-Priority: extra
-Depends: libc6-dev | libc-dev, libuuid1 (= ${mainBinary}), ${misc:Depends}
-Replaces: e2fslibs-dev (<< 1.15)
-Architecture: any
-Description: universally unique id library - headers and static libraries
- libuuid generates and parses 128-bit universally unique ids (UUIDs).
- See RFC 4122 for more information.
- .
- This package contains the development environment for the uuid library.
-
-Package: libblkid1
-Section: libs
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Architecture: any
-Description: block device id library
- The blkid library which allows system programs like fsck and 
- mount to quickly and easily find block devices by filesystem UUID and 
- LABEL.  This allows system administrators to avoid specifying 
- filesystems by hard-coded device names, but via a logical naming 
- system instead.
-
-Package: libblkid1-udeb
-XC-Package-Type: udeb
-Section: debian-installer
-Priority: optional
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Architecture: any
-Description: stripped down block device id library, for debian-installer
- The blkid library which allows system programs like fsck and 
- mount to quickly and easily find block devices by filesystem UUID and 
- LABEL.  This allows system administrators to avoid specifiying 
- filesystems by hard-coded device names, but via a logical naming 
- system instead.
- .
- This is a minimal package for debian-installer.
-
-Package: libblkid-dev
-Section: libdevel
-Priority: extra
-Depends: libc6-dev | libc-dev, libblkid1 (= ${binary:Version}), ${misc:Depends}
-Architecture: any
-Description: block device id library - headers and static libraries
- The blkid library which allows system programs like fsck and 
- mount to quickly and easily find block devices by filesystem UUID and 
- LABEL.  This allows system administrators to avoid specifiying 
- filesystems by hard-coded device names, but via a logical naming 
- system instead.
- .
- This package contains the development environment for the blkid library.
-'')dnl
-
-Package: e2fsprogs-udeb
-XC-Package-Type: udeb
-Section: debian-installer
-Priority: optional
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Architecture: any
-Description: stripped-down versions of e2fsprogs, for debian-installer
- This package is an e2fsprogs package built for a reduced size, so that
- it can help to save space in debian-installer.
- .
- Don't attempt to install this package, it has no support for a couple of
- features you surely want.  Anyway it should refuse to install.
-
-Package: e2fslibs
-Section: libs
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Replaces: e2fsprogs (<< 1.34-1)
-Provides: libext2fs2, libe2p2
-Architecture: any
-MULTIARCH_HEADERS
-Description: ext2/ext3/ext4 file system libraries
- The ext2, ext3 and ext4 file systems are successors of the original ext
- ("extended") file system. They are the main file system types used for
- hard disks on Debian and other Linux systems.
- .
- This package provides the ext2fs and e2p libraries, for userspace software
- that directly accesses extended file systems. Programs that use libext2fs
- include e2fsck, mke2fs, and tune2fs. Programs that use libe2p include
- dumpe2fs, chattr, and lsattr.
-
-Package: e2fslibs-dev
-Section: libdevel
-Priority: extra
-Depends: libc6-dev | libc-dev, comerr-dev, e2fslibs (= ${binary:Version}), ${misc:Depends}
-Suggests: doc-base
-Provides: ext2fs-dev, e2p-dev
-Replaces: libkrb5-dev (<< 1.3)
-Architecture: any
-Description: ext2/ext3/ext4 file system libraries - headers and static libraries
- The ext2, ext3 and ext4 file systems are successors of the original ext
- ("extended") file system. They are the main file system types used for
- hard disks on Debian and other Linux systems.
- .
- This package contains the development environment for the ext2fs and e2p 
- libraries.
-
-Package: e2fsprogs
-Essential: yes
-ifdef(`UTIL_LINUX_NG',
-``Pre-Depends: ${shlibs:Depends}, ${misc:Depends}, util-linux (>= 2.15~rc1-1)
-'',
-``Pre-Depends: ${shlibs:Depends}, ${misc:Depends}
-'')dnl
-Multi-Arch: foreign
-Suggests: gpart, parted, e2fsck-static
-Conflicts: dump (<< 0.4b4-4), quota (<< 1.55-8.1), initscripts (<< 2.85-4), sysvinit (<< 2.85-4)
-Replaces: hurd (<= 20040301-1), libblkid1 (<< 1.38+1.39-WIP-2005.12.10-2), libuuid1 (<< 1.38+1.39-WIP-2005.12.10-2)
-Architecture: any
-Description: ext2/ext3/ext4 file system utilities
- The ext2, ext3 and ext4 file systems are successors of the original ext
- ("extended") file system. They are the main file system types used for
- hard disks on Debian and other Linux systems.
- .
- This package contains programs for creating, checking, and maintaining
- ext2/3/4-based file systems.
-
-Package: e2fsprogs-dbg
-Section: debug
-Priority: extra
-Depends: e2fsprogs (= ${binary:Version}), ${misc:Depends}
-Architecture: any
-Description: debugging information for e2fsprogs
- This package includes the debug information useful for debugging e2fsprogs
- and its libraries, contained in the e2fsprogs and e2fsck-static packages.
- The debug information is used for execution tracing and core
- dump analysis. 
-ifdef(`UTIL_LINUX_NG',,``
-Package: uuid-runtime-dbg
-Section: debug
-Priority: extra
-Depends: uuid-runtime (= ${binary:Version}), ${misc:Depends}
-Architecture: any
-Description: debugging information for uuid-runtime
- This package includes the debug information useful for debugging the
- uuid runtime programs, contained in the uuid-runtime package.
- The debugging information is used for execution tracing and core
- dump analysis.
-'')dnl
-
-Package: e2fslibs-dbg
-Section: debug
-Priority: extra
-Depends: e2fslibs (= ${binary:Version}), ${misc:Depends}
-Architecture: any
-Description: debugging information for e2fslibs
- This package includes the debug information useful for debugging the
- ext2fs and e2p libraries, contained in the e2fslibs package.  The debug
- information is used for execution tracing and core dump analysis.
-
-Package: libcomerr2-dbg
-Section: debug
-Priority: extra
-Depends: libcomerr2 (= ${binary:Version}), ${misc:Depends}
-Architecture: any
-Description: debugging information for libcomerr2
- This package includes the debug information useful for debugging the
- com_err library, contained in the libcomerr2 package.  The debugging
- information is used for execution tracing and core dump analysis.
-
-Package: libss2-dbg
-Section: debug
-Priority: extra
-Depends: libss2 (= ${binary:Version}), ${misc:Depends}
-Architecture: any
-Description: debugging information for libss2
- This package includes the debug information useful for debugging the
- ss library, contained in the libss2 package.  The debug information
- is used for execution tracing and core dump analysis.
-ifdef(`UTIL_LINUX_NG',,``
-Package: libblkid1-dbg
-Section: debug
-Priority: extra
-Depends: libblkid1 (= ${binary:Version}), ${misc:Depends}
-Architecture: any
-Description: debugging information for libblkid1
- This package includes the debug information useful for debugging the
- blkid library, contained in the libblkid1 package.  The debug
- information is used for execution tracing and core dump analysis.
-
-Package: libuuid1-dbg
-Section: debug
-Priority: extra
-Depends: libuuid1 (= ${binary:Version}), ${misc:Depends}
-Architecture: any
-Description: debugging information for libuuid1
- This package includes the debug information useful for debugging the
- UUID library, contained in the libuuid1 package.  The debug
- information is used for execution tracing and core dump analysis.
-'')dnl
diff --git a/debian/copyright b/debian/copyright
index 94a4d62..e6f4676 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -15,11 +15,11 @@
 Copyright notice:
 
 This package, the EXT2 filesystem utilities, are made available under
-the GNU Public License version 2, with the exception of the lib/ext2fs
-and lib/e2p libraries, which are made available under the GNU Library
-General Public License Version 2, the lib/uuid library which is made
-available under a BSD-style license and the lib/et and lib/ss
-libraries which are made available under an MIT-style license.
+the GNU General Public License version 2, with the exception of the
+lib/ext2fs and lib/e2p libraries, which are made available under the
+GNU Library General Public License Version 2, the lib/uuid library
+which is made available under a BSD-style license and the lib/et and
+lib/ss libraries which are made available under an MIT-style license.
 
 	Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 
 	2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Theodore Ts'o
diff --git a/debian/e2fsck-static.copyright b/debian/e2fsck-static.copyright
index 82bdc67..b5b5d3f 100644
--- a/debian/e2fsck-static.copyright
+++ b/debian/e2fsck-static.copyright
@@ -16,7 +16,7 @@
 Copyright notice:
 
 This package, the EXT2 filesystem utilities, is protected by the GNU
-Public License.
+General Public License.
 
 	Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
 	2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Theodore Ts'o
diff --git a/debian/e2fsck-static.files b/debian/e2fsck-static.install
similarity index 100%
rename from debian/e2fsck-static.files
rename to debian/e2fsck-static.install
diff --git a/debian/e2fslibs-dev.doc-base b/debian/e2fslibs-dev.doc-base
deleted file mode 100644
index 19d04f4..0000000
--- a/debian/e2fslibs-dev.doc-base
+++ /dev/null
@@ -1,10 +0,0 @@
-Document: libext2fs
-Title: The EXT2FS library
-Author: Theodore Ts'o
-Abstract: The EXT2FS library is designed to allow
- user-level programs to manipulate an ext2 filesystem.
-Section: Programming
-
-Format: HTML
-Index: /usr/share/doc/e2fslibs/html-info/libext2fs.html
-Files: /usr/share/doc/e2fslibs/html-info/*.html 
diff --git a/debian/e2fslibs.symbols b/debian/e2fslibs.symbols
deleted file mode 100644
index f95f477..0000000
--- a/debian/e2fslibs.symbols
+++ /dev/null
@@ -1,553 +0,0 @@
-libe2p.so.2 e2fslibs #MINVER#
- e2p_edit_feature2@Base 1.40.7
- e2p_edit_feature@Base 1.37
- e2p_edit_mntopts@Base 1.37
- e2p_feature2string@Base 1.37
- e2p_hash2string@Base 1.37
- e2p_is_null_uuid@Base 1.37
- e2p_jrnl_feature2string@Base 1.41.1
- e2p_jrnl_string2feature@Base 1.41.1
- e2p_mntopt2string@Base 1.37
- e2p_os2string@Base 1.37
- e2p_percent@Base 1.40
- e2p_string2feature@Base 1.37
- e2p_string2hash@Base 1.37
- e2p_string2mntopt@Base 1.37
- e2p_string2os@Base 1.37
- e2p_uuid2str@Base 1.37
- e2p_uuid_to_str@Base 1.37
- fgetflags@Base 1.37
- fgetversion@Base 1.37
- fsetflags@Base 1.37
- fsetversion@Base 1.37
- getflags@Base 1.37
- getversion@Base 1.37
- iterate_on_dir@Base 1.37
- list_super2@Base 1.37
- list_super@Base 1.37
- parse_num_blocks2@Base 1.42
- parse_num_blocks@Base 1.37
- print_flags@Base 1.37
- print_fs_errors@Base 1.37
- print_fs_state@Base 1.37
- setflags@Base 1.37
- setversion@Base 1.37
-libext2fs.so.2 e2fslibs #MINVER#
- badblocks_list_add@Base 1.37
- badblocks_list_create@Base 1.37
- badblocks_list_free@Base 1.37
- badblocks_list_iterate@Base 1.37
- badblocks_list_iterate_begin@Base 1.37
- badblocks_list_iterate_end@Base 1.37
- badblocks_list_test@Base 1.37
- et_ext2_error_table@Base 1.37
- ext2fs_add_dir_block2@Base 1.42
- ext2fs_add_dir_block@Base 1.37
- ext2fs_add_journal_device@Base 1.37
- ext2fs_add_journal_inode@Base 1.37
- ext2fs_adjust_ea_refcount2@Base 1.42
- ext2fs_adjust_ea_refcount@Base 1.37
- ext2fs_alloc_block2@Base 1.42
- ext2fs_alloc_block@Base 1.37
- ext2fs_alloc_generic_bmap@Base 1.42
- ext2fs_allocate_block_bitmap@Base 1.37
- ext2fs_allocate_generic_bitmap@Base 1.37
- ext2fs_allocate_group_table@Base 1.37
- ext2fs_allocate_inode_bitmap@Base 1.37
- ext2fs_allocate_subcluster_bitmap@Base 1.42
- ext2fs_allocate_tables@Base 1.37
- ext2fs_badblocks_copy@Base 1.37
- ext2fs_badblocks_equal@Base 1.37
- ext2fs_badblocks_list_add@Base 1.37
- ext2fs_badblocks_list_create@Base 1.37
- ext2fs_badblocks_list_del@Base 1.37
- ext2fs_badblocks_list_free@Base 1.37
- ext2fs_badblocks_list_iterate@Base 1.37
- ext2fs_badblocks_list_iterate_begin@Base 1.37
- ext2fs_badblocks_list_iterate_end@Base 1.37
- ext2fs_badblocks_list_test@Base 1.37
- ext2fs_bg_checksum@Base 1.42
- ext2fs_bg_checksum_set@Base 1.42
- ext2fs_bg_flags@Base 1.42
- ext2fs_bg_flags_clear@Base 1.42
- ext2fs_bg_flags_set@Base 1.42
- ext2fs_bg_flags_test@Base 1.42
- ext2fs_bg_flags_zap@Base 1.42
- ext2fs_bg_free_blocks_count@Base 1.42
- ext2fs_bg_free_blocks_count_set@Base 1.42
- ext2fs_bg_free_inodes_count@Base 1.42
- ext2fs_bg_free_inodes_count_set@Base 1.42
- ext2fs_bg_has_super@Base 1.37
- ext2fs_bg_itable_unused@Base 1.42
- ext2fs_bg_itable_unused_set@Base 1.42
- ext2fs_bg_used_dirs_count@Base 1.42
- ext2fs_bg_used_dirs_count_set@Base 1.42
- ext2fs_bitcount@Base 1.42.7
- ext2fs_blkmap64_bitarray@Base 1.42
- ext2fs_blkmap64_rbtree@Base 1.42.1
- ext2fs_block_alloc_stats2@Base 1.42
- ext2fs_block_alloc_stats@Base 1.37
- ext2fs_block_bitmap_loc@Base 1.42
- ext2fs_block_bitmap_loc_set@Base 1.42
- ext2fs_block_iterate2@Base 1.37
- ext2fs_block_iterate3@Base 1.42
- ext2fs_block_iterate@Base 1.37
- ext2fs_blocks_count@Base 1.42
- ext2fs_blocks_count_add@Base 1.42
- ext2fs_blocks_count_set@Base 1.42
- ext2fs_bmap2@Base 1.41.0
- ext2fs_bmap@Base 1.37
- ext2fs_check_desc@Base 1.37
- ext2fs_check_directory@Base 1.37
- ext2fs_check_if_mounted@Base 1.37
- ext2fs_check_mount_point@Base 1.37
- ext2fs_clear_bit64@Base 1.42
- ext2fs_clear_bit@Base 1.37
- ext2fs_clear_block_bitmap@Base 1.37
- ext2fs_clear_generic_bitmap@Base 1.41.0
- ext2fs_clear_generic_bmap@Base 1.42
- ext2fs_clear_inode_bitmap@Base 1.37
- ext2fs_close2@Base 1.42
- ext2fs_close@Base 1.37
- ext2fs_close_inode_scan@Base 1.37
- ext2fs_compare_block_bitmap@Base 1.37
- ext2fs_compare_generic_bitmap@Base 1.41.0
- ext2fs_compare_generic_bmap@Base 1.42
- ext2fs_compare_inode_bitmap@Base 1.37
- ext2fs_convert_subcluster_bitmap@Base 1.42
- ext2fs_copy_bitmap@Base 1.37
- ext2fs_copy_dblist@Base 1.37
- ext2fs_copy_generic_bitmap@Base 1.41.0
- ext2fs_copy_generic_bmap@Base 1.42
- ext2fs_crc16@Base 1.41.1
- ext2fs_crc32c_be@Base 1.42
- ext2fs_crc32c_le@Base 1.42
- ext2fs_create_icount2@Base 1.37
- ext2fs_create_icount@Base 1.37
- ext2fs_create_icount_tdb@Base 1.40
- ext2fs_create_journal_superblock@Base 1.37
- ext2fs_create_resize_inode@Base 1.37
- ext2fs_dblist_count2@Base 1.42
- ext2fs_dblist_count@Base 1.37
- ext2fs_dblist_dir_iterate@Base 1.37
- ext2fs_dblist_drop_last@Base 1.40.8
- ext2fs_dblist_get_last2@Base 1.42
- ext2fs_dblist_get_last@Base 1.40.8
- ext2fs_dblist_iterate2@Base 1.42
- ext2fs_dblist_iterate@Base 1.37
- ext2fs_dblist_sort2@Base 1.42
- ext2fs_dblist_sort@Base 1.37
- ext2fs_default_journal_size@Base 1.40
- ext2fs_descriptor_block_loc2@Base 1.42
- ext2fs_descriptor_block_loc@Base 1.37
- ext2fs_dir_iterate2@Base 1.37
- ext2fs_dir_iterate@Base 1.37
- ext2fs_dirhash@Base 1.37
- ext2fs_div64_ceil@Base 1.42
- ext2fs_div_ceil@Base 1.40
- ext2fs_dup_handle@Base 1.37
- ext2fs_expand_dir@Base 1.37
- ext2fs_ext_attr_hash_entry@Base 1.41.0
- ext2fs_extent_delete@Base 1.41.0
- ext2fs_extent_fix_parents@Base 1.42.7
- ext2fs_extent_free@Base 1.41.0
- ext2fs_extent_get@Base 1.41.0
- ext2fs_extent_get_info@Base 1.41.0
- ext2fs_extent_goto@Base 1.41.0
- ext2fs_extent_goto2@Base 1.42.7
- ext2fs_extent_header_verify@Base 1.41.0
- ext2fs_extent_insert@Base 1.41.0
- ext2fs_extent_node_split@Base 1.42.7
- ext2fs_extent_open2@Base 1.41.6
- ext2fs_extent_open@Base 1.41.0
- ext2fs_extent_replace@Base 1.41.0
- ext2fs_extent_set_bmap@Base 1.41.0
- ext2fs_fast_clear_bit64@Base 1.42
- ext2fs_fast_clear_bit@Base 1.39
- ext2fs_fast_mark_block_bitmap2@Base 1.42
- ext2fs_fast_mark_block_bitmap@Base 1.37
- ext2fs_fast_mark_block_bitmap_range2@Base 1.42
- ext2fs_fast_mark_block_bitmap_range@Base 1.37
- ext2fs_fast_mark_inode_bitmap2@Base 1.42
- ext2fs_fast_mark_inode_bitmap@Base 1.37
- ext2fs_fast_set_bit64@Base 1.42
- ext2fs_fast_set_bit@Base 1.39
- ext2fs_fast_test_block_bitmap2@Base 1.42
- ext2fs_fast_test_block_bitmap@Base 1.37
- ext2fs_fast_test_block_bitmap_range2@Base 1.42
- ext2fs_fast_test_block_bitmap_range@Base 1.37
- ext2fs_fast_test_inode_bitmap2@Base 1.42
- ext2fs_fast_test_inode_bitmap@Base 1.37
- ext2fs_fast_unmark_block_bitmap2@Base 1.42
- ext2fs_fast_unmark_block_bitmap@Base 1.37
- ext2fs_fast_unmark_block_bitmap_range2@Base 1.42
- ext2fs_fast_unmark_block_bitmap_range@Base 1.37
- ext2fs_fast_unmark_inode_bitmap2@Base 1.42
- ext2fs_fast_unmark_inode_bitmap@Base 1.37
- ext2fs_file_acl_block@Base 1.42
- ext2fs_file_acl_block_set@Base 1.42
- ext2fs_file_block_offset_too_big@Base 1.42.9
- ext2fs_file_close@Base 1.37
- ext2fs_file_flush@Base 1.37
- ext2fs_file_get_fs@Base 1.37
- ext2fs_file_get_inode@Base 1.42
- ext2fs_file_get_inode_num@Base 1.42.1
- ext2fs_file_get_lsize@Base 1.37
- ext2fs_file_get_size@Base 1.37
- ext2fs_file_llseek@Base 1.37
- ext2fs_file_lseek@Base 1.37
- ext2fs_file_open2@Base 1.37
- ext2fs_file_open@Base 1.37
- ext2fs_file_read@Base 1.37
- ext2fs_file_set_size2@Base 1.42
- ext2fs_file_set_size@Base 1.37
- ext2fs_file_write@Base 1.37
- ext2fs_find_block_device@Base 1.37
- ext2fs_find_first_zero_block_bitmap2@Base 1.42.2
- ext2fs_find_first_zero_generic_bitmap@Base 1.42.3
- ext2fs_find_first_zero_generic_bmap@Base 1.42.2
- ext2fs_find_first_zero_inode_bitmap2@Base 1.42.2
- ext2fs_flush2@Base 1.42
- ext2fs_flush@Base 1.37
- ext2fs_flush_icache@Base 1.37
- ext2fs_follow_link@Base 1.37
- ext2fs_free@Base 1.37
- ext2fs_free_block_bitmap@Base 1.37
- ext2fs_free_blocks_count@Base 1.42
- ext2fs_free_blocks_count_add@Base 1.42
- ext2fs_free_blocks_count_set@Base 1.42
- ext2fs_free_dblist@Base 1.37
- ext2fs_free_generic_bitmap@Base 1.37
- ext2fs_free_generic_bmap@Base 1.42
- ext2fs_free_icount@Base 1.37
- ext2fs_free_inode_bitmap@Base 1.37
- ext2fs_free_mem@Base 1.37
- ext2fs_fstat@Base 1.42
- ext2fs_fudge_block_bitmap_end2@Base 1.42
- ext2fs_fudge_block_bitmap_end@Base 1.37
- ext2fs_fudge_generic_bitmap_end@Base 1.41.0
- ext2fs_fudge_generic_bmap_end@Base 1.42
- ext2fs_fudge_inode_bitmap_end@Base 1.37
- ext2fs_get_array@Base 1.40.3
- ext2fs_get_arrayzero@Base 1.42
- ext2fs_get_bitmap_granularity@Base 1.42
- ext2fs_get_block_bitmap_end2@Base 1.42
- ext2fs_get_block_bitmap_end@Base 1.37
- ext2fs_get_block_bitmap_range2@Base 1.42
- ext2fs_get_block_bitmap_range@Base 1.41.0
- ext2fs_get_block_bitmap_start2@Base 1.42
- ext2fs_get_block_bitmap_start@Base 1.37
- ext2fs_get_blocks@Base 1.37
- ext2fs_get_data_io@Base 1.37
- ext2fs_get_device_phys_sectsize@Base 1.41.12
- ext2fs_get_device_sectsize@Base 1.37
- ext2fs_get_device_size2@Base 1.41.4
- ext2fs_get_device_size@Base 1.37
- ext2fs_get_dio_alignment@Base 1.42.3
- ext2fs_get_free_blocks2@Base 1.42
- ext2fs_get_free_blocks@Base 1.37
- ext2fs_get_generic_bitmap_end@Base 1.41.0
- ext2fs_get_generic_bitmap_range@Base 1.41.0
- ext2fs_get_generic_bitmap_start@Base 1.41.0
- ext2fs_get_generic_bmap_end@Base 1.42
- ext2fs_get_generic_bmap_range@Base 1.42
- ext2fs_get_generic_bmap_start@Base 1.42
- ext2fs_get_icount_size@Base 1.37
- ext2fs_get_inode_bitmap_end2@Base 1.42
- ext2fs_get_inode_bitmap_end@Base 1.37
- ext2fs_get_inode_bitmap_range2@Base 1.42
- ext2fs_get_inode_bitmap_range@Base 1.41.0
- ext2fs_get_inode_bitmap_start2@Base 1.42
- ext2fs_get_inode_bitmap_start@Base 1.37
- ext2fs_get_library_version@Base 1.37
- ext2fs_get_mem@Base 1.37
- ext2fs_get_memalign@Base 1.41.13
- ext2fs_get_memzero@Base 1.42
- ext2fs_get_next_inode@Base 1.37
- ext2fs_get_next_inode_full@Base 1.37
- ext2fs_get_num_dirs@Base 1.37
- ext2fs_get_pathname@Base 1.37
- ext2fs_get_rec_len@Base 1.41.7
- ext2fs_group_blocks_count@Base 1.42
- ext2fs_group_desc_csum@Base 1.42.2
- ext2fs_group_desc@Base 1.42
- ext2fs_group_desc_csum_set@Base 1.41.0
- ext2fs_group_desc_csum_verify@Base 1.41.0
- ext2fs_group_first_block2@Base 1.42
- ext2fs_group_first_block@Base 1.40
- ext2fs_group_last_block2@Base 1.42
- ext2fs_group_last_block@Base 1.40
- ext2fs_group_of_blk2@Base 1.42
- ext2fs_group_of_blk@Base 1.37
- ext2fs_group_of_ino@Base 1.37
- ext2fs_iblk_add_blocks@Base 1.41.0
- ext2fs_iblk_set@Base 1.41.0
- ext2fs_iblk_sub_blocks@Base 1.41.0
- ext2fs_icount_decrement@Base 1.37
- ext2fs_icount_fetch@Base 1.37
- ext2fs_icount_increment@Base 1.37
- ext2fs_icount_store@Base 1.37
- ext2fs_icount_validate@Base 1.37
- ext2fs_image_bitmap_read@Base 1.37
- ext2fs_image_bitmap_write@Base 1.37
- ext2fs_image_inode_read@Base 1.37
- ext2fs_image_inode_write@Base 1.37
- ext2fs_image_super_read@Base 1.37
- ext2fs_image_super_write@Base 1.37
- ext2fs_init_dblist@Base 1.37
- ext2fs_initialize@Base 1.37
- ext2fs_inode_alloc_stats2@Base 1.37
- ext2fs_inode_alloc_stats@Base 1.37
- ext2fs_inode_bitmap_loc@Base 1.42
- ext2fs_inode_bitmap_loc_set@Base 1.42
- ext2fs_inode_data_blocks2@Base 1.42
- ext2fs_inode_data_blocks@Base 1.37
- ext2fs_inode_has_valid_blocks@Base 1.37
- ext2fs_inode_has_valid_blocks2@Base 1.42
- ext2fs_inode_i_blocks@Base 1.42
- ext2fs_inode_io_intern2@Base 1.37
- ext2fs_inode_io_intern@Base 1.37
- ext2fs_inode_scan_flags@Base 1.37
- ext2fs_inode_scan_goto_blockgroup@Base 1.37
- ext2fs_inode_table_loc@Base 1.42
- ext2fs_inode_table_loc_set@Base 1.42
- ext2fs_link@Base 1.37
- ext2fs_llseek@Base 1.37
- ext2fs_lookup@Base 1.37
- ext2fs_make_generic_bitmap@Base 1.41.0
- ext2fs_map_cluster_block@Base 1.42.9
- ext2fs_mark_bb_dirty@Base 1.37
- ext2fs_mark_block_bitmap2@Base 1.42
- ext2fs_mark_block_bitmap@Base 1.37
- ext2fs_mark_block_bitmap_range2@Base 1.42
- ext2fs_mark_block_bitmap_range@Base 1.37
- ext2fs_mark_changed@Base 1.37
- ext2fs_mark_generic_bitmap@Base 1.37
- ext2fs_mark_generic_bmap@Base 1.42
- ext2fs_mark_ib_dirty@Base 1.37
- ext2fs_mark_inode_bitmap2@Base 1.42
- ext2fs_mark_inode_bitmap@Base 1.37
- ext2fs_mark_super_dirty@Base 1.37
- ext2fs_mark_valid@Base 1.37
- ext2fs_mem_is_zero@Base 1.42
- ext2fs_mkdir@Base 1.37
- ext2fs_mmp_clear@Base 1.42
- ext2fs_mmp_init@Base 1.42
- ext2fs_mmp_new_seq@Base 1.42
- ext2fs_mmp_read@Base 1.42
- ext2fs_mmp_start@Base 1.42
- ext2fs_mmp_stop@Base 1.42
- ext2fs_mmp_update@Base 1.42
- ext2fs_mmp_write@Base 1.42
- ext2fs_namei@Base 1.37
- ext2fs_namei_follow@Base 1.37
- ext2fs_native_flag@Base 1.37
- ext2fs_new_block2@Base 1.42
- ext2fs_new_block@Base 1.37
- ext2fs_new_dir_block@Base 1.37
- ext2fs_new_inode@Base 1.37
- ext2fs_numeric_progress_close@Base 1.42
- ext2fs_numeric_progress_init@Base 1.42
- ext2fs_numeric_progress_update@Base 1.42
- ext2fs_open2@Base 1.37
- ext2fs_open@Base 1.37
- ext2fs_open_file@Base 1.42
- ext2fs_open_inode_scan@Base 1.37
- ext2fs_parse_version_string@Base 1.37
- ext2fs_process_dir_block@Base 1.37
- ext2fs_punch@Base 1.42
- ext2fs_r_blocks_count@Base 1.42
- ext2fs_r_blocks_count_add@Base 1.42
- ext2fs_r_blocks_count_set@Base 1.42
- ext2fs_rb_augment_erase_begin@Base 1.42.1
- ext2fs_rb_augment_erase_end@Base 1.42.1
- ext2fs_rb_augment_insert@Base 1.42.1
- ext2fs_rb_erase@Base 1.42.1
- ext2fs_rb_first@Base 1.42.1
- ext2fs_rb_insert_color@Base 1.42.1
- ext2fs_rb_last@Base 1.42.1
- ext2fs_rb_next@Base 1.42.1
- ext2fs_rb_prev@Base 1.42.1
- ext2fs_rb_replace_node@Base 1.42.1
- ext2fs_read_bb_FILE2@Base 1.37
- ext2fs_read_bb_FILE@Base 1.37
- ext2fs_read_bb_inode@Base 1.37
- ext2fs_read_bitmaps@Base 1.37
- ext2fs_read_block_bitmap@Base 1.37
- ext2fs_read_dir_block2@Base 1.37
- ext2fs_read_dir_block3@Base 1.42
- ext2fs_read_dir_block@Base 1.37
- ext2fs_read_ext_attr2@Base 1.42
- ext2fs_read_ext_attr@Base 1.37
- ext2fs_read_ind_block@Base 1.37
- ext2fs_read_inode@Base 1.37
- ext2fs_read_inode_bitmap@Base 1.37
- ext2fs_read_inode_full@Base 1.37
- ext2fs_reserve_super_and_bgd@Base 1.37
- ext2fs_resize_block_bitmap2@Base 1.42
- ext2fs_resize_block_bitmap@Base 1.37
- ext2fs_resize_generic_bitmap@Base 1.37
- ext2fs_resize_generic_bmap@Base 1.42
- ext2fs_resize_inode_bitmap2@Base 1.42
- ext2fs_resize_inode_bitmap@Base 1.37
- ext2fs_resize_mem@Base 1.37
- ext2fs_rewrite_to_io@Base 1.37
- ext2fs_set_alloc_block_callback@Base 1.41.0
- ext2fs_set_bit64@Base 1.42
- ext2fs_set_bit@Base 1.37
- ext2fs_set_bitmap_padding@Base 1.37
- ext2fs_set_block_alloc_stats_callback@Base 1.41.0
- ext2fs_set_block_bitmap_range2@Base 1.42
- ext2fs_set_block_bitmap_range@Base 1.41.0
- ext2fs_set_data_io@Base 1.37
- ext2fs_set_dir_block2@Base 1.42
- ext2fs_set_dir_block@Base 1.37
- ext2fs_set_gdt_csum@Base 1.41.0
- ext2fs_set_generic_bitmap_padding@Base 1.41.0
- ext2fs_set_generic_bitmap_range@Base 1.41.0
- ext2fs_set_generic_bmap_padding@Base 1.42
- ext2fs_set_generic_bmap_range@Base 1.42
- ext2fs_set_inode_bitmap_range2@Base 1.42
- ext2fs_set_inode_bitmap_range@Base 1.41.0
- ext2fs_set_inode_callback@Base 1.37
- ext2fs_set_rec_len@Base 1.41.7
- ext2fs_stat@Base 1.42
- ext2fs_super_and_bgd_loc2@Base 1.42
- ext2fs_super_and_bgd_loc@Base 1.37
- ext2fs_swab16@Base 1.37
- ext2fs_swab32@Base 1.37
- ext2fs_swab64@Base 1.40
- ext2fs_symlink@Base 1.42.7
- ext2fs_sync_device@Base 1.37
- ext2fs_tdb_append@Base 1.40
- ext2fs_tdb_chainlock@Base 1.40
- ext2fs_tdb_chainlock_mark@Base 1.40.7
- ext2fs_tdb_chainlock_nonblock@Base 1.40.7
- ext2fs_tdb_chainlock_read@Base 1.40
- ext2fs_tdb_chainlock_unmark@Base 1.40.7
- ext2fs_tdb_chainunlock@Base 1.40
- ext2fs_tdb_chainunlock_read@Base 1.40
- ext2fs_tdb_close@Base 1.40
- ext2fs_tdb_delete@Base 1.40
- ext2fs_tdb_dump_all@Base 1.40
- ext2fs_tdb_enable_seqnum@Base 1.40.7
- ext2fs_tdb_error@Base 1.40
- ext2fs_tdb_errorstr@Base 1.40
- ext2fs_tdb_exists@Base 1.40
- ext2fs_tdb_fd@Base 1.40
- ext2fs_tdb_fetch@Base 1.40
- ext2fs_tdb_firstkey@Base 1.40
- ext2fs_tdb_get_flags@Base 1.40
- ext2fs_tdb_get_logging_private@Base 1.40
- ext2fs_tdb_get_seqnum@Base 1.40
- ext2fs_tdb_hash_size@Base 1.40
- ext2fs_tdb_increment_seqnum_nonblock@Base 1.40.7
- ext2fs_tdb_lock_nonblock@Base 1.40.7
- ext2fs_tdb_lockall@Base 1.40
- ext2fs_tdb_lockall_mark@Base 1.40.7
- ext2fs_tdb_lockall_nonblock@Base 1.40.7
- ext2fs_tdb_lockall_read@Base 1.40
- ext2fs_tdb_lockall_read_nonblock@Base 1.40.7
- ext2fs_tdb_lockall_unmark@Base 1.40.7
- ext2fs_tdb_log_fn@Base 1.40
- ext2fs_tdb_map_size@Base 1.40
- ext2fs_tdb_name@Base 1.40
- ext2fs_tdb_nextkey@Base 1.40
- ext2fs_tdb_open@Base 1.40
- ext2fs_tdb_open_ex@Base 1.40
- ext2fs_tdb_parse_record@Base 1.40
- ext2fs_tdb_printfreelist@Base 1.40
- ext2fs_tdb_reopen@Base 1.40
- ext2fs_tdb_reopen_all@Base 1.40
- ext2fs_tdb_set_logging_function@Base 1.40
- ext2fs_tdb_set_max_dead@Base 1.40
- ext2fs_tdb_store@Base 1.40
- ext2fs_tdb_transaction_cancel@Base 1.40
- ext2fs_tdb_transaction_commit@Base 1.40
- ext2fs_tdb_transaction_recover@Base 1.40
- ext2fs_tdb_transaction_start@Base 1.40
- ext2fs_tdb_traverse@Base 1.40
- ext2fs_tdb_traverse_read@Base 1.40
- ext2fs_tdb_unlockall@Base 1.40
- ext2fs_tdb_unlockall_read@Base 1.40
- ext2fs_tdb_validate_freelist@Base 1.40
- ext2fs_test_bb_dirty@Base 1.37
- ext2fs_test_bit64@Base 1.42
- ext2fs_test_bit@Base 1.37
- ext2fs_test_block_bitmap2@Base 1.42
- ext2fs_test_block_bitmap@Base 1.37
- ext2fs_test_block_bitmap_range2@Base 1.42
- ext2fs_test_block_bitmap_range@Base 1.37
- ext2fs_test_changed@Base 1.37
- ext2fs_test_generic_bitmap@Base 1.37
- ext2fs_test_generic_bmap@Base 1.42
- ext2fs_test_ib_dirty@Base 1.37
- ext2fs_test_inode_bitmap2@Base 1.42
- ext2fs_test_inode_bitmap@Base 1.37
- ext2fs_test_inode_bitmap_range@Base 1.41.8
- ext2fs_test_valid@Base 1.37
- ext2fs_u32_copy@Base 1.37
- ext2fs_u32_list_add@Base 1.37
- ext2fs_u32_list_count@Base 1.37
- ext2fs_u32_list_create@Base 1.37
- ext2fs_u32_list_del@Base 1.37
- ext2fs_u32_list_equal@Base 1.37
- ext2fs_u32_list_find@Base 1.37
- ext2fs_u32_list_free@Base 1.37
- ext2fs_u32_list_iterate@Base 1.37
- ext2fs_u32_list_iterate_begin@Base 1.37
- ext2fs_u32_list_iterate_end@Base 1.37
- ext2fs_u32_list_test@Base 1.37
- ext2fs_unlink@Base 1.37
- ext2fs_unmark_block_bitmap2@Base 1.42
- ext2fs_unmark_block_bitmap@Base 1.37
- ext2fs_unmark_block_bitmap_range2@Base 1.42
- ext2fs_unmark_block_bitmap_range@Base 1.37
- ext2fs_unmark_generic_bitmap@Base 1.37
- ext2fs_unmark_generic_bmap@Base 1.42
- ext2fs_unmark_inode_bitmap2@Base 1.42
- ext2fs_unmark_inode_bitmap@Base 1.37
- ext2fs_unmark_valid@Base 1.37
- ext2fs_update_bb_inode@Base 1.37
- ext2fs_update_dynamic_rev@Base 1.37
- ext2fs_warn_bitmap2@Base 1.37
- ext2fs_warn_bitmap32@Base 1.42
- ext2fs_warn_bitmap@Base 1.37
- ext2fs_write_bb_FILE@Base 1.37
- ext2fs_write_bitmaps@Base 1.37
- ext2fs_write_block_bitmap@Base 1.37
- ext2fs_write_dir_block2@Base 1.37
- ext2fs_write_dir_block3@Base 1.42
- ext2fs_write_dir_block@Base 1.37
- ext2fs_write_ext_attr2@Base 1.42
- ext2fs_write_ext_attr@Base 1.37
- ext2fs_write_ind_block@Base 1.37
- ext2fs_write_inode@Base 1.37
- ext2fs_write_inode_bitmap@Base 1.37
- ext2fs_write_inode_full@Base 1.37
- ext2fs_write_new_inode@Base 1.37
- ext2fs_zero_blocks2@Base 1.42
- ext2fs_zero_blocks@Base 1.41.0
- initialize_ext2_error_table@Base 1.37
- initialize_ext2_error_table_r@Base 1.37
- inode_io_manager@Base 1.37
- io_channel_alloc_buf@Base 1.42.3
- io_channel_discard@Base 1.42
- io_channel_read_blk64@Base 1.41.1
- io_channel_set_options@Base 1.37
- io_channel_write_blk64@Base 1.41.1
- io_channel_write_byte@Base 1.37
- qcow2_read_header@Base 1.42
- qcow2_write_raw_image@Base 1.42
- set_undo_io_backing_manager@Base 1.41.0
- set_undo_io_backup_file@Base 1.41.0
- test_io_backing_manager@Base 1.37
- test_io_cb_read_blk64@Base 1.41.0
- test_io_cb_read_blk@Base 1.37
- test_io_cb_set_blksize@Base 1.37
- test_io_cb_write_blk64@Base 1.41.0
- test_io_cb_write_blk@Base 1.37
- test_io_cb_write_byte@Base 1.37
- test_io_manager@Base 1.37
- undo_io_manager@Base 1.41.0
- unix_io_manager@Base 1.37
diff --git a/debian/e2fsprogs-l10n.copyright b/debian/e2fsprogs-l10n.copyright
new file mode 100644
index 0000000..9dbe5c0
--- /dev/null
+++ b/debian/e2fsprogs-l10n.copyright
@@ -0,0 +1,26 @@
+This is the Debian GNU/Linux prepackaged version of the translation
+files of the EXT2 file system utilities.  The EXT2 utilities were
+written by Theodore Ts'o <tytso@mit.edu> and Remy Card
+<card@masi.ibp.fr>.
+
+Sources were obtained from http://sourceforge.net/projects/e2fsprogs
+
+Packaging is Copyright (c) 2003-2006 Theodore Ts'o <tytso@mit.edu>
+             Copyright (c) 1997-2003 Yann Dirson <dirson@debian.org>
+	     Copyright (c) 2001 Alcove <http://www.alcove.com/>
+	     Copyright (c) 1997 Klee Dienes
+	     Copyright (c) 1995-1996 Michael Nonweiler <mrn20@cam.ac.uk>
+
+Upstream Author: Theodore Ts'o <tytso@mit.edu>
+
+Copyright notice:
+
+This package, the EXT2 filesystem utilities, is protected by the GNU
+General Public License.
+
+	Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+	2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Theodore Ts'o
+
+On Debian GNU systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL-2'.
+
diff --git a/debian/e2fsprogs-l10n.install b/debian/e2fsprogs-l10n.install
new file mode 100644
index 0000000..3635480
--- /dev/null
+++ b/debian/e2fsprogs-l10n.install
@@ -0,0 +1 @@
+usr/share/locale
diff --git a/debian/e2fsprogs-udeb.install b/debian/e2fsprogs-udeb.install
new file mode 100644
index 0000000..a6d6867
--- /dev/null
+++ b/debian/e2fsprogs-udeb.install
@@ -0,0 +1,11 @@
+etc/mke2fs.conf
+lib/*/lib*.so.*
+sbin/badblocks
+sbin/e2fsck
+sbin/mke2fs
+sbin/resize2fs
+sbin/tune2fs
+sbin/e2label
+sbin/e2mmpstatus
+sbin/fsck.ext?
+sbin/mkfs.ext?
diff --git a/debian/e2fsprogs-udeb.lintian-overrides b/debian/e2fsprogs-udeb.lintian-overrides
new file mode 100644
index 0000000..683a11f
--- /dev/null
+++ b/debian/e2fsprogs-udeb.lintian-overrides
@@ -0,0 +1,2 @@
+e2fsprogs-udeb udeb: package-name-doesnt-match-sonames libcom-err2 libe2p2 libext2fs2 libss2
+
diff --git a/debian/e2fsprogs.docs b/debian/e2fsprogs.docs
index 7af9733..e845566 100644
--- a/debian/e2fsprogs.docs
+++ b/debian/e2fsprogs.docs
@@ -1,2 +1 @@
 README
-RELEASE-NOTES
diff --git a/debian/e2fsprogs.files b/debian/e2fsprogs.files
deleted file mode 100644
index 37e54da..0000000
--- a/debian/e2fsprogs.files
+++ /dev/null
@@ -1,6 +0,0 @@
-sbin
-usr/bin
-usr/sbin
-usr/share/man
-usr/share/locale
-etc
diff --git a/debian/e2fsprogs.install b/debian/e2fsprogs.install
new file mode 100755
index 0000000..8cf07a6
--- /dev/null
+++ b/debian/e2fsprogs.install
@@ -0,0 +1,53 @@
+#!/usr/bin/dh-exec
+sbin/badblocks
+sbin/debugfs
+sbin/dumpe2fs
+sbin/e2fsck
+sbin/e2image
+sbin/e2label
+sbin/e2mmpstatus
+[linux-any] sbin/e2scrub
+[linux-any] sbin/e2scrub_all
+sbin/e2undo
+sbin/fsck.ext?
+sbin/mke2fs
+sbin/mkfs.ext?
+sbin/resize2fs
+sbin/tune2fs
+usr/bin/chattr
+usr/bin/lsattr
+[linux-any] usr/lib/*/e2fsprogs/e2scrub_all_cron
+[linux-any] usr/lib/*/e2fsprogs/e2scrub_fail
+usr/sbin/e2freefrag
+[linux-any] usr/sbin/e4crypt
+[linux-any] usr/sbin/e4defrag
+usr/sbin/filefrag
+usr/sbin/mklost+found
+usr/share/man/man1/chattr.1
+usr/share/man/man1/lsattr.1
+usr/share/man/man5/e2fsck.conf.5
+usr/share/man/man5/ext?.5
+usr/share/man/man5/mke2fs.conf.5
+usr/share/man/man8/badblocks.8
+usr/share/man/man8/debugfs.8
+usr/share/man/man8/dumpe2fs.8
+usr/share/man/man8/e2freefrag.8
+usr/share/man/man8/e2fsck.8
+usr/share/man/man8/e2image.8
+usr/share/man/man8/e2label.8
+usr/share/man/man8/e2mmpstatus.8
+[linux-any] usr/share/man/man8/e2scrub.8
+[linux-any] usr/share/man/man8/e2scrub_all.8
+usr/share/man/man8/e2undo.8
+[linux-any] usr/share/man/man8/e4crypt.8
+[linux-any] usr/share/man/man8/e4defrag.8
+usr/share/man/man8/filefrag.8
+usr/share/man/man8/fsck.ext?.8
+usr/share/man/man8/mke2fs.8
+usr/share/man/man8/mkfs.ext?.8
+usr/share/man/man8/mklost+found.8
+usr/share/man/man8/resize2fs.8
+usr/share/man/man8/tune2fs.8
+etc
+[linux-any] lib/udev/rules.d
+[linux-any] lib/systemd/system
diff --git a/debian/e2fsprogs.lintian-overrides b/debian/e2fsprogs.lintian-overrides
new file mode 100644
index 0000000..b40d113
--- /dev/null
+++ b/debian/e2fsprogs.lintian-overrides
@@ -0,0 +1 @@
+e2fsprogs: package-supports-alternative-init-but-no-init.d-script
diff --git a/debian/e2fsprogs.postinst b/debian/e2fsprogs.postinst
new file mode 100644
index 0000000..00ac363
--- /dev/null
+++ b/debian/e2fsprogs.postinst
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Abort on error.
+set -e
+
+if [ -x /usr/sbin/update-initramfs -a \
+	-e /etc/initramfs-tools/initramfs.conf ]; then
+    update-initramfs -u
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/e2fsprogs.postinst.dh9 b/debian/e2fsprogs.postinst.dh9
new file mode 100644
index 0000000..e7acb0e
--- /dev/null
+++ b/debian/e2fsprogs.postinst.dh9
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Abort on error.
+set -e
+
+if [ -x /usr/sbin/update-initramfs -a \
+	-e /etc/initramfs-tools/initramfs.conf ]; then
+    update-initramfs -u
+fi
+
+#DEBHELPER#
+
+# debhelper doesn't know what timers are...
+update_svc() {
+	deb-systemd-helper unmask "$1" >/dev/null || true
+
+	if deb-systemd-helper --quiet was-enabled "$1"; then
+		deb-systemd-helper enable "$1" >/dev/null || true
+	else
+		deb-systemd-helper update-state "$1" >/dev/null || true
+	fi
+}
+update_svc e2scrub_all.timer
+update_svc e2scrub_reap.service
+
+# Start our new services
+if [ -d /run/systemd/system ]; then
+	systemctl --system daemon-reload >/dev/null || true
+	deb-systemd-invoke start e2scrub_all.timer >/dev/null || true
+fi
+
+exit 0
diff --git a/debian/e2fsprogs.postrm.dh9 b/debian/e2fsprogs.postrm.dh9
new file mode 100644
index 0000000..32cb642
--- /dev/null
+++ b/debian/e2fsprogs.postrm.dh9
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+update_svc() {
+	deb-systemd-helper mask "$1" >/dev/null || true
+
+	if deb-systemd-helper --quiet was-enabled "$1"; then
+		# Enables the unit on first installation, creates new
+		# symlinks on upgrades if the unit file has changed.
+		deb-systemd-helper disable "$1" >/dev/null || true
+	fi
+}
+
+if [ "$1" != "upgrade" ]; then
+	# Abort on error.
+	set -e
+
+	if [ -x /usr/sbin/update-initramfs -a \
+		-e /etc/initramfs-tools/initramfs.conf ]; then
+	    update-initramfs -u
+	fi
+
+	#DEBHELPER#
+
+	# debhelper doesn't know what timers are...
+	update_svc e2scrub_all.timer
+	update_svc e2scrub_reap.service
+
+	# Start our new services
+	if [ -d /run/systemd/system ]; then
+		deb-systemd-invoke stop e2scrub_all.timer >/dev/null || true
+	fi
+fi
+
+exit 0
+
diff --git a/debian/e2fsprogs.shlibs.local b/debian/e2fsprogs.shlibs.local
new file mode 100644
index 0000000..a99d2a0
--- /dev/null
+++ b/debian/e2fsprogs.shlibs.local
@@ -0,0 +1,2 @@
+libext2fs 2 libext2fs2 (= ${binary:Version})
+libe2p 2 libext2fs2 (= ${binary:Version})
diff --git a/debian/e2fsprogs.shlibs.local.in b/debian/e2fsprogs.shlibs.local.in
deleted file mode 100644
index db1b75a..0000000
--- a/debian/e2fsprogs.shlibs.local.in
+++ /dev/null
@@ -1,8 +0,0 @@
-libcom_err 2 libcomerr2 (>= 1.42~WIP-2011-10-05-1)
-libss 2 libss2 (>= 1.34-1)
-ifdef(`UTIL_LINUX_NG',,
-``libuuid 1 libuuid1 (>= 1.34-1)
-libblkid 1 libblkid1 (>= 1.34-1)
-'')dnl
-libext2fs 2 e2fslibs (= ${Source-Version})
-libe2p 2 e2fslibs (= ${Source-Version})
diff --git a/debian/fuse2fs.install b/debian/fuse2fs.install
new file mode 100644
index 0000000..2ed4c3c
--- /dev/null
+++ b/debian/fuse2fs.install
@@ -0,0 +1,2 @@
+/usr/bin/fuse2fs
+/usr/share/man/man1/fuse2fs.1
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..c974add
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,4 @@
+[DEFAULT]
+pristine-tar = True
+upstream-tag='v%(version)s'
+debian-branch=debian/master
diff --git a/debian/libblkid-dev.files.in b/debian/libblkid-dev.install
similarity index 100%
rename from debian/libblkid-dev.files.in
rename to debian/libblkid-dev.install
diff --git a/debian/libblkid1.files.in b/debian/libblkid1.install
similarity index 100%
rename from debian/libblkid1.files.in
rename to debian/libblkid1.install
diff --git a/debian/libcomerr2.copyright b/debian/libcom-err2.copyright
similarity index 100%
rename from debian/libcomerr2.copyright
rename to debian/libcom-err2.copyright
diff --git a/debian/libcomerr2.files.in b/debian/libcom-err2.install
similarity index 100%
rename from debian/libcomerr2.files.in
rename to debian/libcom-err2.install
diff --git a/debian/libcom-err2.symbols b/debian/libcom-err2.symbols
new file mode 100644
index 0000000..1c96fa5
--- /dev/null
+++ b/debian/libcom-err2.symbols
@@ -0,0 +1,22 @@
+libcom_err.so.2 libcom-err2 #MINVER#
+* Build-Depends-Package: comerr-dev
+ _et_dynamic_list@Base 1.43.9
+ _et_list@Base 1.43.9
+ add_error_table@Base 1.43.9
+ add_to_error_table@Base 1.43.9
+ com_err@Base 1.43.9
+ com_err_hook@Base 1.43.9
+ com_err_va@Base 1.43.9
+ com_right@Base 1.43.9
+ com_right_r@Base 1.43.9
+ error_message@Base 1.43.9
+ error_table_name@Base 1.43.9
+ et_list_lock@Base 1.43.9
+ et_list_unlock@Base 1.43.9
+ free_error_table@Base 1.43.9
+ init_error_table@Base 1.43.9
+ initialize_error_table_r@Base 1.43.9
+ remove_error_table@Base 1.43.9
+ reset_com_err_hook@Base 1.43.9
+ set_com_err_gettext@Base 1.43.9
+ set_com_err_hook@Base 1.43.9
diff --git a/debian/libcomerr2.symbols b/debian/libcomerr2.symbols
deleted file mode 100644
index ce3b74a..0000000
--- a/debian/libcomerr2.symbols
+++ /dev/null
@@ -1,21 +0,0 @@
-libcom_err.so.2 libcomerr2 #MINVER#
- _et_dynamic_list@Base 1.38
- _et_list@Base 1.01
- add_error_table@Base 1.34
- add_to_error_table@Base 1.34
- com_err@Base 1.01
- com_err_hook@Base 1.01
- com_err_va@Base 1.01
- com_right@Base 1.34
- com_right_r@Base 1.41.11
- error_message@Base 1.01
- error_table_name@Base 1.01
- et_list_lock@Base 1.41.2
- et_list_unlock@Base 1.41.2
- free_error_table@Base 1.34
- init_error_table@Base 1.01
- initialize_error_table_r@Base 1.34
- remove_error_table@Base 1.34
- reset_com_err_hook@Base 1.01
- set_com_err_gettext@Base 1.41.99
- set_com_err_hook@Base 1.01
diff --git a/debian/libext2fs-dev.doc-base b/debian/libext2fs-dev.doc-base
new file mode 100644
index 0000000..b115117
--- /dev/null
+++ b/debian/libext2fs-dev.doc-base
@@ -0,0 +1,10 @@
+Document: libext2fs
+Title: The EXT2FS library
+Author: Theodore Ts'o
+Abstract: The EXT2FS library is designed to allow
+ user-level programs to manipulate an ext2 filesystem.
+Section: Programming
+
+Format: HTML
+Index: /usr/share/doc/libext2fs2/html-info/libext2fs.html
+Files: /usr/share/doc/libext2fs2/html-info/*.html 
diff --git a/debian/e2fslibs-dev.files.in b/debian/libext2fs-dev.install
similarity index 100%
rename from debian/e2fslibs-dev.files.in
rename to debian/libext2fs-dev.install
diff --git a/debian/e2fslibs.files.in b/debian/libext2fs2.install
similarity index 100%
rename from debian/e2fslibs.files.in
rename to debian/libext2fs2.install
diff --git a/debian/libext2fs2.symbols b/debian/libext2fs2.symbols
new file mode 100644
index 0000000..7cd7cd8
--- /dev/null
+++ b/debian/libext2fs2.symbols
@@ -0,0 +1,699 @@
+libe2p.so.2 libext2fs2 #MINVER#
+* Build-Depends-Package: libext2fs-dev
+ e2p_edit_feature2@Base 1.40.7
+ e2p_edit_feature@Base 1.37
+ e2p_edit_mntopts@Base 1.37
+ e2p_encmode2string@Base 1.43
+ e2p_encoding2str@Base 1.45.1
+ e2p_errcode2str@Base 1.46.0
+ e2p_feature2string@Base 1.37
+ e2p_feature_to_string@Base 1.45.6
+ e2p_get_encoding_flags@Base 1.45
+ e2p_hash2string@Base 1.37
+ e2p_is_null_uuid@Base 1.37
+ e2p_jrnl_feature2string@Base 1.41.1
+ e2p_jrnl_string2feature@Base 1.41.1
+ e2p_list_journal_super@Base 1.43.5
+ e2p_mntopt2string@Base 1.37
+ e2p_os2string@Base 1.37
+ e2p_percent@Base 1.40
+ e2p_str2encoding@Base 1.45
+ e2p_str2encoding_flags@Base 1.45
+ e2p_string2encmode@Base 1.43
+ e2p_string2feature@Base 1.37
+ e2p_string2hash@Base 1.37
+ e2p_string2mntopt@Base 1.37
+ e2p_string2os@Base 1.37
+ e2p_uuid2str@Base 1.37
+ e2p_uuid_to_str@Base 1.37
+ fgetflags@Base 1.37
+ fgetproject@Base 1.43
+ fgetversion@Base 1.37
+ fsetflags@Base 1.37
+ fsetproject@Base 1.43
+ fsetversion@Base 1.37
+ getflags@Base 1.37
+ getversion@Base 1.37
+ iterate_on_dir@Base 1.37
+ list_super2@Base 1.37
+ list_super@Base 1.37
+ parse_num_blocks2@Base 1.42
+ parse_num_blocks@Base 1.37
+ print_flags@Base 1.37
+ print_fs_errors@Base 1.37
+ print_fs_state@Base 1.37
+ setflags@Base 1.37
+ setversion@Base 1.37
+libext2fs.so.2 libext2fs2 #MINVER#
+* Build-Depends-Package: libext2fs-dev
+ badblocks_list_add@Base 1.37
+ badblocks_list_create@Base 1.37
+ badblocks_list_free@Base 1.37
+ badblocks_list_iterate@Base 1.37
+ badblocks_list_iterate_begin@Base 1.37
+ badblocks_list_iterate_end@Base 1.37
+ badblocks_list_test@Base 1.37
+ et_ext2_error_table@Base 1.37
+ ext2fs_add_dir_block2@Base 1.42
+ ext2fs_add_dir_block@Base 1.37
+ ext2fs_add_exit_fn@Base 1.43
+ ext2fs_add_journal_device@Base 1.37
+ ext2fs_add_journal_inode2@Base 1.42.9-3~
+ ext2fs_add_journal_inode3@Base 1.46.0
+ ext2fs_add_journal_inode@Base 1.37
+ ext2fs_adjust_ea_refcount2@Base 1.42
+ ext2fs_adjust_ea_refcount3@Base 1.43
+ ext2fs_adjust_ea_refcount@Base 1.37
+ ext2fs_alloc_block2@Base 1.42
+ ext2fs_alloc_block3@Base 1.44.0~rc1
+ ext2fs_alloc_block@Base 1.37
+ ext2fs_alloc_generic_bmap@Base 1.42
+ ext2fs_alloc_range@Base 1.43
+ ext2fs_allocate_block_bitmap@Base 1.37
+ ext2fs_allocate_generic_bitmap@Base 1.37
+ ext2fs_allocate_group_table@Base 1.37
+ ext2fs_allocate_inode_bitmap@Base 1.37
+ ext2fs_allocate_subcluster_bitmap@Base 1.42
+ ext2fs_allocate_tables@Base 1.37
+ ext2fs_badblocks_copy@Base 1.37
+ ext2fs_badblocks_equal@Base 1.37
+ ext2fs_badblocks_list_add@Base 1.37
+ ext2fs_badblocks_list_create@Base 1.37
+ ext2fs_badblocks_list_del@Base 1.37
+ ext2fs_badblocks_list_free@Base 1.37
+ ext2fs_badblocks_list_iterate@Base 1.37
+ ext2fs_badblocks_list_iterate_begin@Base 1.37
+ ext2fs_badblocks_list_iterate_end@Base 1.37
+ ext2fs_badblocks_list_test@Base 1.37
+ ext2fs_bg_checksum@Base 1.42
+ ext2fs_bg_checksum_set@Base 1.42
+ ext2fs_bg_flags@Base 1.42
+ ext2fs_bg_flags_clear@Base 1.42
+ ext2fs_bg_flags_set@Base 1.42
+ ext2fs_bg_flags_test@Base 1.42
+ ext2fs_bg_flags_zap@Base 1.42
+ ext2fs_bg_free_blocks_count@Base 1.42
+ ext2fs_bg_free_blocks_count_set@Base 1.42
+ ext2fs_bg_free_inodes_count@Base 1.42
+ ext2fs_bg_free_inodes_count_set@Base 1.42
+ ext2fs_bg_has_super@Base 1.37
+ ext2fs_bg_itable_unused@Base 1.42
+ ext2fs_bg_itable_unused_set@Base 1.42
+ ext2fs_bg_used_dirs_count@Base 1.42
+ ext2fs_bg_used_dirs_count_set@Base 1.42
+ ext2fs_bitcount@Base 1.42.7
+ ext2fs_blkmap64_bitarray@Base 1.42
+ ext2fs_blkmap64_rbtree@Base 1.42.1
+ ext2fs_block_alloc_stats2@Base 1.42
+ ext2fs_block_alloc_stats@Base 1.37
+ ext2fs_block_alloc_stats_range@Base 1.42.9-3~
+ ext2fs_block_bitmap_checksum@Base 1.43
+ ext2fs_block_bitmap_csum_set@Base 1.43
+ ext2fs_block_bitmap_csum_verify@Base 1.43
+ ext2fs_block_bitmap_loc@Base 1.42
+ ext2fs_block_bitmap_loc_set@Base 1.42
+ ext2fs_block_iterate2@Base 1.37
+ ext2fs_block_iterate3@Base 1.42
+ ext2fs_block_iterate@Base 1.37
+ ext2fs_blocks_count@Base 1.42
+ ext2fs_blocks_count_add@Base 1.42
+ ext2fs_blocks_count_set@Base 1.42
+ ext2fs_bmap2@Base 1.41.0
+ ext2fs_bmap@Base 1.37
+ ext2fs_calculate_summary_stats@Base 1.46.0
+ ext2fs_casefold_cmp@Base 1.46.0
+ ext2fs_check_desc@Base 1.37
+ ext2fs_check_directory@Base 1.37
+ ext2fs_check_encoded_name@Base 1.46.0
+ ext2fs_check_if_mounted@Base 1.37
+ ext2fs_check_mount_point@Base 1.37
+ ext2fs_clear_bit64@Base 1.42
+ ext2fs_clear_bit@Base 1.37
+ ext2fs_clear_block_bitmap@Base 1.37
+ ext2fs_clear_block_uninit@Base 1.43
+ ext2fs_clear_generic_bitmap@Base 1.41.0
+ ext2fs_clear_generic_bmap@Base 1.42
+ ext2fs_clear_inode_bitmap@Base 1.37
+ ext2fs_close2@Base 1.42
+ ext2fs_close@Base 1.37
+ ext2fs_close_free@Base 1.42.11
+ ext2fs_close_inode_scan@Base 1.37
+ ext2fs_compare_block_bitmap@Base 1.37
+ ext2fs_compare_generic_bitmap@Base 1.41.0
+ ext2fs_compare_generic_bmap@Base 1.42
+ ext2fs_compare_inode_bitmap@Base 1.37
+ ext2fs_const_inode@Base 1.43
+ ext2fs_convert_subcluster_bitmap@Base 1.42
+ ext2fs_copy_bitmap@Base 1.37
+ ext2fs_copy_dblist@Base 1.37
+ ext2fs_copy_generic_bitmap@Base 1.41.0
+ ext2fs_copy_generic_bmap@Base 1.42
+ ext2fs_count_blocks@Base 1.46.0
+ ext2fs_count_used_clusters@Base 1.46.0
+ ext2fs_crc16@Base 1.41.1
+ ext2fs_crc32_be@Base 1.43
+ ext2fs_crc32c_le@Base 1.42
+ ext2fs_create_icount2@Base 1.37
+ ext2fs_create_icount@Base 1.37
+ ext2fs_create_icount_tdb@Base 1.40
+ ext2fs_create_inode_cache@Base 1.43
+ ext2fs_create_journal_superblock2@Base 1.46.0
+ ext2fs_create_journal_superblock@Base 1.37
+ ext2fs_create_resize_inode@Base 1.37
+ ext2fs_dblist_count2@Base 1.42
+ ext2fs_dblist_count@Base 1.37
+ ext2fs_dblist_dir_iterate@Base 1.37
+ ext2fs_dblist_drop_last@Base 1.40.8
+ ext2fs_dblist_get_last2@Base 1.42
+ ext2fs_dblist_get_last@Base 1.40.8
+ ext2fs_dblist_iterate2@Base 1.42
+ ext2fs_dblist_iterate3@Base 1.43
+ ext2fs_dblist_iterate@Base 1.37
+ ext2fs_dblist_sort2@Base 1.42
+ ext2fs_dblist_sort@Base 1.37
+ ext2fs_decode_extent@Base 1.46.0
+ ext2fs_default_journal_size@Base 1.40
+ ext2fs_descriptor_block_loc2@Base 1.42
+ ext2fs_descriptor_block_loc@Base 1.37
+ ext2fs_dir_block_csum_set@Base 1.43
+ ext2fs_dir_block_csum_verify@Base 1.43
+ ext2fs_dir_iterate2@Base 1.37
+ ext2fs_dir_iterate@Base 1.37
+ ext2fs_dirent_csum_verify@Base 1.43
+ ext2fs_dirent_file_type@Base 1.43
+ ext2fs_dirent_has_tail@Base 1.43
+ ext2fs_dirent_name_len@Base 1.43
+ ext2fs_dirent_set_file_type@Base 1.43
+ ext2fs_dirent_set_name_len@Base 1.43
+ ext2fs_dirent_swab_in2@Base 1.43
+ ext2fs_dirent_swab_in@Base 1.43
+ ext2fs_dirent_swab_out2@Base 1.43
+ ext2fs_dirent_swab_out@Base 1.43
+ ext2fs_dirhash2@Base 1.45
+ ext2fs_dirhash@Base 1.37
+ ext2fs_div64_ceil@Base 1.42
+ ext2fs_div_ceil@Base 1.40
+ ext2fs_djb2_hash@Base 1.44.3~rc1
+ ext2fs_dup_handle@Base 1.37
+ ext2fs_dx_csum@Base 1.46~WIP.2019.10.09
+ ext2fs_expand_dir@Base 1.37
+ ext2fs_ext_attr_block_csum_set@Base 1.43
+ ext2fs_ext_attr_block_csum_verify@Base 1.43
+ ext2fs_ext_attr_block_rehash@Base 1.44.0~rc1
+ ext2fs_ext_attr_hash_entry2@Base 1.44.0~rc1
+ ext2fs_ext_attr_hash_entry@Base 1.41.0
+ ext2fs_extent_block_csum_set@Base 1.43
+ ext2fs_extent_block_csum_verify@Base 1.43
+ ext2fs_extent_delete@Base 1.41.0
+ ext2fs_extent_fix_parents@Base 1.42.7
+ ext2fs_extent_free@Base 1.41.0
+ ext2fs_extent_get@Base 1.41.0
+ ext2fs_extent_get_info@Base 1.41.0
+ ext2fs_extent_goto2@Base 1.42.7
+ ext2fs_extent_goto@Base 1.41.0
+ ext2fs_extent_header_verify@Base 1.41.0
+ ext2fs_extent_insert@Base 1.41.0
+ ext2fs_extent_node_split@Base 1.42.7
+ ext2fs_extent_open2@Base 1.41.6
+ ext2fs_extent_open@Base 1.41.0
+ ext2fs_extent_replace@Base 1.41.0
+ ext2fs_extent_set_bmap@Base 1.41.0
+ ext2fs_fallocate@Base 1.43
+ ext2fs_fast_clear_bit64@Base 1.42
+ ext2fs_fast_clear_bit@Base 1.39
+ ext2fs_fast_mark_block_bitmap2@Base 1.42
+ ext2fs_fast_mark_block_bitmap@Base 1.37
+ ext2fs_fast_mark_block_bitmap_range2@Base 1.42
+ ext2fs_fast_mark_block_bitmap_range@Base 1.37
+ ext2fs_fast_mark_inode_bitmap2@Base 1.42
+ ext2fs_fast_mark_inode_bitmap@Base 1.37
+ ext2fs_fast_set_bit64@Base 1.42
+ ext2fs_fast_set_bit@Base 1.39
+ ext2fs_fast_test_block_bitmap2@Base 1.42
+ ext2fs_fast_test_block_bitmap@Base 1.37
+ ext2fs_fast_test_block_bitmap_range2@Base 1.42
+ ext2fs_fast_test_block_bitmap_range@Base 1.37
+ ext2fs_fast_test_inode_bitmap2@Base 1.42
+ ext2fs_fast_test_inode_bitmap@Base 1.37
+ ext2fs_fast_unmark_block_bitmap2@Base 1.42
+ ext2fs_fast_unmark_block_bitmap@Base 1.37
+ ext2fs_fast_unmark_block_bitmap_range2@Base 1.42
+ ext2fs_fast_unmark_block_bitmap_range@Base 1.37
+ ext2fs_fast_unmark_inode_bitmap2@Base 1.42
+ ext2fs_fast_unmark_inode_bitmap@Base 1.37
+ ext2fs_file_acl_block@Base 1.42
+ ext2fs_file_acl_block_set@Base 1.42
+ ext2fs_file_block_offset_too_big@Base 1.42.9
+ ext2fs_file_close@Base 1.37
+ ext2fs_file_flush@Base 1.37
+ ext2fs_file_get_fs@Base 1.37
+ ext2fs_file_get_inode@Base 1.42
+ ext2fs_file_get_inode_num@Base 1.42.1
+ ext2fs_file_get_lsize@Base 1.37
+ ext2fs_file_get_size@Base 1.37
+ ext2fs_file_llseek@Base 1.37
+ ext2fs_load_nls_table@Base 1.45.1
+ ext2fs_file_lseek@Base 1.37
+ ext2fs_file_open2@Base 1.37
+ ext2fs_file_open@Base 1.37
+ ext2fs_file_read@Base 1.37
+ ext2fs_file_set_size2@Base 1.42
+ ext2fs_file_set_size@Base 1.37
+ ext2fs_file_write@Base 1.37
+ ext2fs_find_block_device@Base 1.37
+ ext2fs_find_first_set_block_bitmap2@Base 1.42.9-3~
+ ext2fs_find_first_set_generic_bitmap@Base 1.42.9-3~
+ ext2fs_find_first_set_generic_bmap@Base 1.42.9-3~
+ ext2fs_find_first_set_inode_bitmap2@Base 1.42.9-3~
+ ext2fs_find_first_zero_block_bitmap2@Base 1.42.2
+ ext2fs_find_first_zero_generic_bitmap@Base 1.42.3
+ ext2fs_find_first_zero_generic_bmap@Base 1.42.2
+ ext2fs_find_first_zero_inode_bitmap2@Base 1.42.2
+ ext2fs_find_inode_goal@Base 1.43
+ ext2fs_fix_extents_checksums@Base 1.45
+ ext2fs_flush2@Base 1.42
+ ext2fs_flush@Base 1.37
+ ext2fs_flush_icache@Base 1.37
+ ext2fs_follow_link@Base 1.37
+ ext2fs_free@Base 1.37
+ ext2fs_free_block_bitmap@Base 1.37
+ ext2fs_free_blocks_count@Base 1.42
+ ext2fs_free_blocks_count_add@Base 1.42
+ ext2fs_free_blocks_count_set@Base 1.42
+ ext2fs_free_dblist@Base 1.37
+ ext2fs_free_ext_attr@Base 1.43
+ ext2fs_free_generic_bitmap@Base 1.37
+ ext2fs_free_generic_bmap@Base 1.42
+ ext2fs_free_icount@Base 1.37
+ ext2fs_free_inode_bitmap@Base 1.37
+ ext2fs_free_inode_cache@Base 1.43
+ ext2fs_free_mem@Base 1.37
+ ext2fs_fstat@Base 1.42
+ ext2fs_fudge_block_bitmap_end2@Base 1.42
+ ext2fs_fudge_block_bitmap_end@Base 1.37
+ ext2fs_fudge_generic_bitmap_end@Base 1.41.0
+ ext2fs_fudge_generic_bmap_end@Base 1.42
+ ext2fs_fudge_inode_bitmap_end@Base 1.37
+ ext2fs_get_array@Base 1.40.3
+ ext2fs_get_arrayzero@Base 1.42
+ ext2fs_get_bitmap_granularity@Base 1.42
+ ext2fs_get_block_bitmap_end2@Base 1.42
+ ext2fs_get_block_bitmap_end@Base 1.37
+ ext2fs_get_block_bitmap_range2@Base 1.42
+ ext2fs_get_block_bitmap_range@Base 1.41.0
+ ext2fs_get_block_bitmap_start2@Base 1.42
+ ext2fs_get_block_bitmap_start@Base 1.37
+ ext2fs_get_blocks@Base 1.37
+ ext2fs_get_data_io@Base 1.37
+ ext2fs_get_device_phys_sectsize@Base 1.41.12
+ ext2fs_get_device_sectsize@Base 1.37
+ ext2fs_get_device_size2@Base 1.41.4
+ ext2fs_get_device_size@Base 1.37
+ ext2fs_get_dio_alignment@Base 1.42.3
+ ext2fs_get_dx_countlimit@Base 1.43
+ ext2fs_get_ea_inode_hash@Base 1.44.0~rc1
+ ext2fs_get_ea_inode_ref@Base 1.44.0~rc1
+ ext2fs_get_free_blocks2@Base 1.42
+ ext2fs_get_free_blocks@Base 1.37
+ ext2fs_get_generic_bitmap_end@Base 1.41.0
+ ext2fs_get_generic_bitmap_range@Base 1.41.0
+ ext2fs_get_generic_bitmap_start@Base 1.41.0
+ ext2fs_get_generic_bmap_end@Base 1.42
+ ext2fs_get_generic_bmap_range@Base 1.42
+ ext2fs_get_generic_bmap_start@Base 1.42
+ ext2fs_get_icount_size@Base 1.37
+ ext2fs_get_inode_bitmap_end2@Base 1.42
+ ext2fs_get_inode_bitmap_end@Base 1.37
+ ext2fs_get_inode_bitmap_range2@Base 1.42
+ ext2fs_get_inode_bitmap_range@Base 1.41.0
+ ext2fs_get_inode_bitmap_start2@Base 1.42
+ ext2fs_get_inode_bitmap_start@Base 1.37
+ ext2fs_get_journal_params@Base 1.46.0
+ ext2fs_get_library_version@Base 1.37
+ ext2fs_get_mem@Base 1.37
+ ext2fs_get_memalign@Base 1.41.13
+ ext2fs_get_memzero@Base 1.42
+ ext2fs_get_next_inode@Base 1.37
+ ext2fs_get_next_inode_full@Base 1.37
+ ext2fs_get_num_dirs@Base 1.37
+ ext2fs_get_pathname@Base 1.37
+ ext2fs_get_rec_len@Base 1.41.7
+ ext2fs_get_stat_i_blocks@Base 1.45.5
+ ext2fs_group_blocks_count@Base 1.42
+ ext2fs_group_desc@Base 1.42
+ ext2fs_group_desc_csum@Base 1.42.2
+ ext2fs_group_desc_csum_set@Base 1.41.0
+ ext2fs_group_desc_csum_verify@Base 1.41.0
+ ext2fs_group_first_block2@Base 1.42
+ ext2fs_group_first_block@Base 1.40
+ ext2fs_group_last_block2@Base 1.42
+ ext2fs_group_last_block@Base 1.40
+ ext2fs_group_of_blk2@Base 1.42
+ ext2fs_group_of_blk@Base 1.37
+ ext2fs_group_of_ino@Base 1.37
+ ext2fs_hashmap_add@Base 1.44.3~rc1
+ ext2fs_hashmap_create@Base 1.44.3~rc1
+ ext2fs_hashmap_free@Base 1.44.3~rc1
+ ext2fs_hashmap_iter_in_order@Base 1.44.3~rc1
+ ext2fs_hashmap_lookup@Base 1.44.3~rc1
+ ext2fs_htree_intnode_maxrecs@Base 1.44.0~rc1
+ ext2fs_iblk_add_blocks@Base 1.41.0
+ ext2fs_iblk_set@Base 1.41.0
+ ext2fs_iblk_sub_blocks@Base 1.41.0
+ ext2fs_icount_decrement@Base 1.37
+ ext2fs_icount_fetch@Base 1.37
+ ext2fs_icount_increment@Base 1.37
+ ext2fs_icount_store@Base 1.37
+ ext2fs_icount_validate@Base 1.37
+ ext2fs_image_bitmap_read@Base 1.37
+ ext2fs_image_bitmap_write@Base 1.37
+ ext2fs_image_inode_read@Base 1.37
+ ext2fs_image_inode_write@Base 1.37
+ ext2fs_image_super_read@Base 1.37
+ ext2fs_image_super_write@Base 1.37
+ ext2fs_init_csum_seed@Base 1.43
+ ext2fs_init_dblist@Base 1.37
+ ext2fs_initialize@Base 1.37
+ ext2fs_initialize_dirent_tail@Base 1.43
+ ext2fs_inline_data_dir_iterate@Base 1.43
+ ext2fs_inline_data_ea_remove@Base 1.43
+ ext2fs_inline_data_expand@Base 1.43
+ ext2fs_inline_data_get@Base 1.43
+ ext2fs_inline_data_init@Base 1.43
+ ext2fs_inline_data_set@Base 1.43
+ ext2fs_inline_data_size@Base 1.43
+ ext2fs_inode@Base 1.43
+ ext2fs_inode_alloc_stats2@Base 1.37
+ ext2fs_inode_alloc_stats@Base 1.37
+ ext2fs_inode_bitmap_checksum@Base 1.43
+ ext2fs_inode_bitmap_csum_set@Base 1.43
+ ext2fs_inode_bitmap_csum_verify@Base 1.43
+ ext2fs_inode_bitmap_loc@Base 1.42
+ ext2fs_inode_bitmap_loc_set@Base 1.42
+ ext2fs_inode_csum_set@Base 1.43
+ ext2fs_inode_csum_verify@Base 1.43
+ ext2fs_inode_data_blocks2@Base 1.42
+ ext2fs_inode_data_blocks@Base 1.37
+ ext2fs_inode_has_valid_blocks2@Base 1.42
+ ext2fs_inode_has_valid_blocks@Base 1.37
+ ext2fs_inode_i_blocks@Base 1.42
+ ext2fs_inode_io_intern2@Base 1.37
+ ext2fs_inode_io_intern@Base 1.37
+ ext2fs_inode_scan_flags@Base 1.37
+ ext2fs_inode_scan_goto_blockgroup@Base 1.37
+ ext2fs_inode_size_set@Base 1.42.12
+ ext2fs_inode_table_loc@Base 1.42
+ ext2fs_inode_table_loc_set@Base 1.42
+ ext2fs_is_fast_symlink@Base 1.44.0~rc1
+ ext2fs_journal_sb_start@Base 1.42.12
+ ext2fs_link@Base 1.37
+ ext2fs_llseek@Base 1.37
+ ext2fs_lookup@Base 1.37
+ ext2fs_make_generic_bitmap@Base 1.41.0
+ ext2fs_map_cluster_block@Base 1.42.9
+ ext2fs_mark_bb_dirty@Base 1.37
+ ext2fs_mark_block_bitmap2@Base 1.42
+ ext2fs_mark_block_bitmap@Base 1.37
+ ext2fs_mark_block_bitmap_range2@Base 1.42
+ ext2fs_mark_block_bitmap_range@Base 1.37
+ ext2fs_mark_changed@Base 1.37
+ ext2fs_mark_generic_bitmap@Base 1.37
+ ext2fs_mark_generic_bmap@Base 1.42
+ ext2fs_mark_ib_dirty@Base 1.37
+ ext2fs_mark_inode_bitmap2@Base 1.42
+ ext2fs_mark_inode_bitmap@Base 1.37
+ ext2fs_mark_super_dirty@Base 1.37
+ ext2fs_mark_valid@Base 1.37
+ ext2fs_max_extent_depth@Base 1.43
+ ext2fs_mem_is_zero@Base 1.42
+ ext2fs_mkdir@Base 1.37
+ ext2fs_mmp_clear@Base 1.42
+ ext2fs_mmp_csum_set@Base 1.43
+ ext2fs_mmp_csum_verify@Base 1.43
+ ext2fs_mmp_init@Base 1.42
+ ext2fs_mmp_new_seq@Base 1.42
+ ext2fs_mmp_read@Base 1.42
+ ext2fs_mmp_start@Base 1.42
+ ext2fs_mmp_stop@Base 1.42
+ ext2fs_mmp_update2@Base 1.43
+ ext2fs_mmp_update@Base 1.42
+ ext2fs_mmp_write@Base 1.42
+ ext2fs_namei@Base 1.37
+ ext2fs_namei_follow@Base 1.37
+ ext2fs_native_flag@Base 1.37
+ ext2fs_new_block2@Base 1.42
+ ext2fs_new_block3@Base 1.44.0~rc1
+ ext2fs_new_block@Base 1.37
+ ext2fs_new_dir_block@Base 1.37
+ ext2fs_new_dir_inline_data@Base 1.43
+ ext2fs_new_inode@Base 1.37
+ ext2fs_new_range@Base 1.43
+ ext2fs_numeric_progress_close@Base 1.42
+ ext2fs_numeric_progress_init@Base 1.42
+ ext2fs_numeric_progress_ops@Base 1.43
+ ext2fs_numeric_progress_update@Base 1.42
+ ext2fs_open2@Base 1.37
+ ext2fs_open@Base 1.37
+ ext2fs_open_file@Base 1.42
+ ext2fs_open_inode_scan@Base 1.37
+ ext2fs_parse_version_string@Base 1.37
+ ext2fs_process_dir_block@Base 1.37
+ ext2fs_punch@Base 1.42
+ ext2fs_r_blocks_count@Base 1.42
+ ext2fs_r_blocks_count_add@Base 1.42
+ ext2fs_r_blocks_count_set@Base 1.42
+ ext2fs_rb_augment_erase_begin@Base 1.42.1
+ ext2fs_rb_augment_erase_end@Base 1.42.1
+ ext2fs_rb_augment_insert@Base 1.42.1
+ ext2fs_rb_erase@Base 1.42.1
+ ext2fs_rb_first@Base 1.42.1
+ ext2fs_rb_insert_color@Base 1.42.1
+ ext2fs_rb_last@Base 1.42.1
+ ext2fs_rb_next@Base 1.42.1
+ ext2fs_rb_prev@Base 1.42.1
+ ext2fs_rb_replace_node@Base 1.42.1
+ ext2fs_read_bb_FILE2@Base 1.37
+ ext2fs_read_bb_FILE@Base 1.37
+ ext2fs_read_bb_inode@Base 1.37
+ ext2fs_read_bitmaps@Base 1.37
+ ext2fs_read_block_bitmap@Base 1.37
+ ext2fs_read_dir_block2@Base 1.37
+ ext2fs_read_dir_block3@Base 1.42
+ ext2fs_read_dir_block4@Base 1.43
+ ext2fs_read_dir_block@Base 1.37
+ ext2fs_read_ext_attr2@Base 1.42
+ ext2fs_read_ext_attr3@Base 1.43
+ ext2fs_read_ext_attr@Base 1.37
+ ext2fs_read_ind_block@Base 1.37
+ ext2fs_read_inode2@Base 1.45
+ ext2fs_read_inode@Base 1.37
+ ext2fs_read_inode_bitmap@Base 1.37
+ ext2fs_read_inode_full@Base 1.37
+ ext2fs_remove_exit_fn@Base 1.43
+ ext2fs_reserve_super_and_bgd@Base 1.37
+ ext2fs_resize_array@Base 1.45.6
+ ext2fs_resize_block_bitmap2@Base 1.42
+ ext2fs_resize_block_bitmap@Base 1.37
+ ext2fs_resize_generic_bitmap@Base 1.37
+ ext2fs_resize_generic_bmap@Base 1.42
+ ext2fs_resize_inode_bitmap2@Base 1.42
+ ext2fs_resize_inode_bitmap@Base 1.37
+ ext2fs_resize_mem@Base 1.37
+ ext2fs_rewrite_to_io@Base 1.37
+ ext2fs_rw_bitmaps@Base 1.46.0
+ ext2fs_set_alloc_block_callback@Base 1.41.0
+ ext2fs_set_bit64@Base 1.42
+ ext2fs_set_bit@Base 1.37
+ ext2fs_set_bitmap_padding@Base 1.37
+ ext2fs_set_block_alloc_stats_callback@Base 1.41.0
+ ext2fs_set_block_alloc_stats_range_callback@Base 1.43
+ ext2fs_set_block_bitmap_range2@Base 1.42
+ ext2fs_set_block_bitmap_range@Base 1.41.0
+ ext2fs_set_data_io@Base 1.37
+ ext2fs_set_dir_block2@Base 1.42
+ ext2fs_set_dir_block@Base 1.37
+ ext2fs_set_ea_inode_hash@Base 1.44.0~rc1
+ ext2fs_set_ea_inode_ref@Base 1.44.0~rc1
+ ext2fs_set_gdt_csum@Base 1.41.0
+ ext2fs_set_generic_bitmap_padding@Base 1.41.0
+ ext2fs_set_generic_bitmap_range@Base 1.41.0
+ ext2fs_set_generic_bmap_padding@Base 1.42
+ ext2fs_set_generic_bmap_range@Base 1.42
+ ext2fs_set_inode_bitmap_range2@Base 1.42
+ ext2fs_set_inode_bitmap_range@Base 1.41.0
+ ext2fs_set_inode_callback@Base 1.37
+ ext2fs_set_new_range_callback@Base 1.43
+ ext2fs_set_rec_len@Base 1.41.7
+ ext2fs_sha512@Base 1.43
+ ext2fs_stat@Base 1.42
+ ext2fs_super_and_bgd_loc2@Base 1.42
+ ext2fs_super_and_bgd_loc@Base 1.37
+ ext2fs_superblock_csum_set@Base 1.43
+ ext2fs_superblock_csum_verify@Base 1.43
+ ext2fs_swab16@Base 1.37
+ ext2fs_swab32@Base 1.37
+ ext2fs_swab64@Base 1.40
+ ext2fs_swap_ext_attr@Base 1.40
+ ext2fs_swap_ext_attr_entry@Base 1.41
+ ext2fs_swap_ext_attr_header@Base 1.41
+ ext2fs_swap_group_desc2@Base 1.42
+ ext2fs_swap_group_desc@Base 1.37
+ ext2fs_swap_inode@Base 1.37
+ ext2fs_swap_inode_full@Base 1.40
+ ext2fs_swap_mmp@Base 1.42
+ ext2fs_swap_super@Base 1.37
+ ext2fs_symlink@Base 1.42.7
+ ext2fs_sync_device@Base 1.37
+ ext2fs_tdb_append@Base 1.40
+ ext2fs_tdb_chainlock@Base 1.40
+ ext2fs_tdb_chainlock_mark@Base 1.40.7
+ ext2fs_tdb_chainlock_nonblock@Base 1.40.7
+ ext2fs_tdb_chainlock_read@Base 1.40
+ ext2fs_tdb_chainlock_unmark@Base 1.40.7
+ ext2fs_tdb_chainunlock@Base 1.40
+ ext2fs_tdb_chainunlock_read@Base 1.40
+ ext2fs_tdb_close@Base 1.40
+ ext2fs_tdb_delete@Base 1.40
+ ext2fs_tdb_dump_all@Base 1.40
+ ext2fs_tdb_enable_seqnum@Base 1.40.7
+ ext2fs_tdb_error@Base 1.40
+ ext2fs_tdb_errorstr@Base 1.40
+ ext2fs_tdb_exists@Base 1.40
+ ext2fs_tdb_fd@Base 1.40
+ ext2fs_tdb_fetch@Base 1.40
+ ext2fs_tdb_firstkey@Base 1.40
+ ext2fs_tdb_flush@Base 1.43
+ ext2fs_tdb_get_flags@Base 1.40
+ ext2fs_tdb_get_logging_private@Base 1.40
+ ext2fs_tdb_get_seqnum@Base 1.40
+ ext2fs_tdb_hash_size@Base 1.40
+ ext2fs_tdb_increment_seqnum_nonblock@Base 1.40.7
+ ext2fs_tdb_lock_nonblock@Base 1.40.7
+ ext2fs_tdb_lockall@Base 1.40
+ ext2fs_tdb_lockall_mark@Base 1.40.7
+ ext2fs_tdb_lockall_nonblock@Base 1.40.7
+ ext2fs_tdb_lockall_read@Base 1.40
+ ext2fs_tdb_lockall_read_nonblock@Base 1.40.7
+ ext2fs_tdb_lockall_unmark@Base 1.40.7
+ ext2fs_tdb_log_fn@Base 1.40
+ ext2fs_tdb_map_size@Base 1.40
+ ext2fs_tdb_name@Base 1.40
+ ext2fs_tdb_nextkey@Base 1.40
+ ext2fs_tdb_open@Base 1.40
+ ext2fs_tdb_open_ex@Base 1.40
+ ext2fs_tdb_parse_record@Base 1.40
+ ext2fs_tdb_printfreelist@Base 1.40
+ ext2fs_tdb_reopen@Base 1.40
+ ext2fs_tdb_reopen_all@Base 1.40
+ ext2fs_tdb_set_logging_function@Base 1.40
+ ext2fs_tdb_set_max_dead@Base 1.40
+ ext2fs_tdb_store@Base 1.40
+ ext2fs_tdb_transaction_cancel@Base 1.40
+ ext2fs_tdb_transaction_commit@Base 1.40
+ ext2fs_tdb_transaction_recover@Base 1.40
+ ext2fs_tdb_transaction_start@Base 1.40
+ ext2fs_tdb_traverse@Base 1.40
+ ext2fs_tdb_traverse_read@Base 1.40
+ ext2fs_tdb_unlockall@Base 1.40
+ ext2fs_tdb_unlockall_read@Base 1.40
+ ext2fs_tdb_validate_freelist@Base 1.40
+ ext2fs_test_bb_dirty@Base 1.37
+ ext2fs_test_bit64@Base 1.42
+ ext2fs_test_bit@Base 1.37
+ ext2fs_test_block_bitmap2@Base 1.42
+ ext2fs_test_block_bitmap@Base 1.37
+ ext2fs_test_block_bitmap_range2@Base 1.42
+ ext2fs_test_block_bitmap_range@Base 1.37
+ ext2fs_test_changed@Base 1.37
+ ext2fs_test_generic_bitmap@Base 1.37
+ ext2fs_test_generic_bmap@Base 1.42
+ ext2fs_test_ib_dirty@Base 1.37
+ ext2fs_test_inode_bitmap2@Base 1.42
+ ext2fs_test_inode_bitmap@Base 1.37
+ ext2fs_test_inode_bitmap_range@Base 1.41.8
+ ext2fs_test_valid@Base 1.37
+ ext2fs_u32_copy@Base 1.37
+ ext2fs_u32_list_add@Base 1.37
+ ext2fs_u32_list_count@Base 1.37
+ ext2fs_u32_list_create@Base 1.37
+ ext2fs_u32_list_del@Base 1.37
+ ext2fs_u32_list_equal@Base 1.37
+ ext2fs_u32_list_find@Base 1.37
+ ext2fs_u32_list_free@Base 1.37
+ ext2fs_u32_list_iterate@Base 1.37
+ ext2fs_u32_list_iterate_begin@Base 1.37
+ ext2fs_u32_list_iterate_end@Base 1.37
+ ext2fs_u32_list_test@Base 1.37
+ ext2fs_unlink@Base 1.37
+ ext2fs_unmark_block_bitmap2@Base 1.42
+ ext2fs_unmark_block_bitmap@Base 1.37
+ ext2fs_unmark_block_bitmap_range2@Base 1.42
+ ext2fs_unmark_block_bitmap_range@Base 1.37
+ ext2fs_unmark_generic_bitmap@Base 1.37
+ ext2fs_unmark_generic_bmap@Base 1.42
+ ext2fs_unmark_inode_bitmap2@Base 1.42
+ ext2fs_unmark_inode_bitmap@Base 1.37
+ ext2fs_unmark_valid@Base 1.37
+ ext2fs_update_bb_inode@Base 1.37
+ ext2fs_update_dynamic_rev@Base 1.37
+ ext2fs_verify_csum_type@Base 1.43
+ ext2fs_warn_bitmap2@Base 1.37
+ ext2fs_warn_bitmap32@Base 1.42
+ ext2fs_warn_bitmap@Base 1.37
+ ext2fs_write_bb_FILE@Base 1.37
+ ext2fs_write_bitmaps@Base 1.37
+ ext2fs_write_block_bitmap@Base 1.37
+ ext2fs_write_dir_block2@Base 1.37
+ ext2fs_write_dir_block3@Base 1.42
+ ext2fs_write_dir_block4@Base 1.43
+ ext2fs_write_dir_block@Base 1.37
+ ext2fs_write_ext_attr2@Base 1.42
+ ext2fs_write_ext_attr3@Base 1.43
+ ext2fs_write_ext_attr@Base 1.37
+ ext2fs_write_ind_block@Base 1.37
+ ext2fs_write_inode2@Base 1.45
+ ext2fs_write_inode@Base 1.37
+ ext2fs_write_inode_bitmap@Base 1.37
+ ext2fs_write_inode_full@Base 1.37
+ ext2fs_write_new_inode@Base 1.37
+ ext2fs_xattr_get@Base 1.43
+ ext2fs_xattr_inode_max_size@Base 1.43
+ ext2fs_xattr_remove@Base 1.43
+ ext2fs_xattr_set@Base 1.43
+ ext2fs_xattrs_close@Base 1.43
+ ext2fs_xattrs_count@Base 1.43
+ ext2fs_xattrs_flags@Base 1.43.4~WIP.2017.01.30
+ ext2fs_xattrs_iterate@Base 1.43
+ ext2fs_xattrs_open@Base 1.43
+ ext2fs_xattrs_read@Base 1.43
+ ext2fs_xattrs_write@Base 1.43
+ ext2fs_zero_blocks2@Base 1.42
+ ext2fs_zero_blocks@Base 1.41.0
+ initialize_ext2_error_table@Base 1.37
+ initialize_ext2_error_table_r@Base 1.37
+ inode_io_manager@Base 1.37
+ io_channel_alloc_buf@Base 1.42.3
+ io_channel_cache_readahead@Base 1.43
+ io_channel_discard@Base 1.42
+ io_channel_read_blk64@Base 1.41.1
+ io_channel_set_options@Base 1.37
+ io_channel_write_blk64@Base 1.41.1
+ io_channel_write_byte@Base 1.37
+ io_channel_zeroout@Base 1.43
+ qcow2_read_header@Base 1.42
+ qcow2_write_raw_image@Base 1.42
+ set_undo_io_backing_manager@Base 1.41.0
+ set_undo_io_backup_file@Base 1.41.0
+ sparse_io_manager@Base 1.44.0~rc1
+ sparsefd_io_manager@Base 1.44.0~rc1
+ test_io_backing_manager@Base 1.37
+ test_io_cb_read_blk64@Base 1.41.0
+ test_io_cb_read_blk@Base 1.37
+ test_io_cb_set_blksize@Base 1.37
+ test_io_cb_write_blk64@Base 1.41.0
+ test_io_cb_write_blk@Base 1.37
+ test_io_cb_write_byte@Base 1.37
+ test_io_manager@Base 1.37
+ undo_io_manager@Base 1.41.0
+ unix_io_manager@Base 1.37
+ unixfd_io_manager@Base 1.43.2
diff --git a/debian/libss2.copyright b/debian/libss2.copyright
index eb261c3..f039832 100644
--- a/debian/libss2.copyright
+++ b/debian/libss2.copyright
@@ -1,5 +1,5 @@
 This is the Debian GNU/Linux prepackaged version of the ss
-command-line interface parsing library library. It is currently
+command-line interface parsing library. It is currently
 distributed together with the EXT2 file system utilities, which are
 otherwise packaged as "e2fsprogs".
 
diff --git a/debian/libss2.files.in b/debian/libss2.install
similarity index 100%
rename from debian/libss2.files.in
rename to debian/libss2.install
diff --git a/debian/libss2.symbols b/debian/libss2.symbols
index b6fe40b..74358eb 100644
--- a/debian/libss2.symbols
+++ b/debian/libss2.symbols
@@ -1,4 +1,5 @@
 libss.so.2 libss2 #MINVER#
+* Build-Depends-Package: ss-dev
  _ss_pager_name@Base 1.01
  _ss_table@Base 1.01
  et_ss_error_table@Base 1.35
diff --git a/debian/libuuid1.files.in b/debian/libuuid1.install
similarity index 100%
rename from debian/libuuid1.files.in
rename to debian/libuuid1.install
diff --git a/debian/logsave.install b/debian/logsave.install
new file mode 100644
index 0000000..dd5b065
--- /dev/null
+++ b/debian/logsave.install
@@ -0,0 +1,2 @@
+sbin/logsave
+usr/share/man/man8/logsave.8
diff --git a/debian/rules b/debian/rules
index 245cf50..e36bcaa 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,612 +1,154 @@
 #! /usr/bin/make -f
-# -*- makefile -*-
-#
-# Invoke each target with `./debian/rules <target>'.  All targets should be
-# invoked with the package root as the current directory.
-#
-# The `binary' target must be run as root, as it needs to install files with
-# specific ownerships.
 
--include debian/rules.custom
+# export DH_VERBOSE=1
+
+export DEB_BUILD_MAINT_OPTIONS ?= hardening=+all
+
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
 
 # be paranoid
 export LC_ALL ?= C
 
-# These are used for cross-compiling and for saving the configure script
-# from having to guess our platform (since we know it already)
-DEB_HOST_ARCH		?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_BUILD_ARCH		?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
-DEB_HOST_OS		?= $(shell dpkg-architecture -qDEB_HOST_OS)
-DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_MULTIARCH	?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)
-
-# Allow distro-specific behaviour
-DISTRO :=$(shell sed -ne '/DISTRIB_ID/s/.*=//p' /etc/lsb-release 2>/dev/null || echo Debian)
-SYS_BLKID_VER := $(shell dpkg-query -W libblkid1:$(DEB_HOST_ARCH) | cut -f 2 | cut -b 1)
-ifeq ($(SYS_BLKID_VER),2)
-UTIL_LINUX_NG ?= yes
+ifeq ($(DEB_HOST_ARCH_OS), hurd)
+SKIP_FUSE2FS=yes
 endif
 
-# find the version for the main package, from changelog file
-MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
-# find versions for libraries going into their own packages, from their Makefile.in's,
-# and sonames for all libs
+ifneq ($(filter pkg.e2fsprogs.no-fuse2fs,$(DEB_BUILD_PROFILES)),)
+SKIP_FUSE2FS=yes
+endif
+
 COMERR_VERSION ?= $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
-COMERR_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/et/Makefile.in | cut '-d ' -f3)
 SS_VERSION ?= $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
-SS_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
-
-ifneq ($(UTIL_LINUX_NG),yes)
-UUID_VERSION ?= $(shell grep ELF_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
-UUID_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
-
-BLKID_VERSION ?= $(shell grep ELF_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
-BLKID_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
-endif
-
-EXT2FS_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/ext2fs/Makefile.in | cut '-d ' -f3)
-E2P_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/e2p/Makefile.in | cut '-d ' -f3)
-
-package		?= e2fsprogs
 
 topdir		?= $(shell pwd)
-debdir		?= ${topdir}/debian
-tmpdir		?= ${debdir}/tmp
-udebdir		?= ${debdir}/e2fsprogs-udeb
-ifneq ($(UTIL_LINUX_NG),yes)
-blkidudebdir	?= ${debdir}/libblkid1-udeb
-uuidudebdir	?= ${debdir}/libuuid1-udeb
-endif
-libcomerrdir	?= ${debdir}/libcomerr${COMERR_SOVERSION}
-comerrdevdir	?= ${debdir}/comerr-dev
-libcomerrdbgdir	?= ${debdir}/libcomerr2-dbg
-libssdir	?= ${debdir}/libss${SS_SOVERSION}
-ssdevdir	?= ${debdir}/ss-dev
-libssdbgdir	?= ${debdir}/libss2-dbg
-ifneq ($(UTIL_LINUX_NG),yes)
-libblkiddir	?= ${debdir}/libblkid${BLKID_SOVERSION}
-libblkiddevdir	?= ${debdir}/libblkid-dev
-libblkiddbgdir	?= ${debdir}/libblkid1-dbg
-libuuiddir	?= ${debdir}/libuuid${UUID_SOVERSION}
-uuiddevdir	?= ${debdir}/uuid-dev
-libuuiddbgdir	?= ${debdir}/libuuid1-dbg
-uuidruntimedir	?= ${debdir}/uuid-runtime
-uuidruntimedbgdir ?= ${debdir}/uuid-runtime-dbg
-endif
-libext2dir	?= ${debdir}/e2fslibs
-libext2devdir	?= ${debdir}/e2fslibs-dev
-libext2dbgdir	?= ${debdir}/e2fslibs-dbg
-maindir		?= ${debdir}/e2fsprogs
-e2fsckstaticdir	?= ${debdir}/e2fsck-static
-debugdir	?= ${debdir}/e2fsprogs-dbg
-stdbuilddir	?= ${debdir}/BUILD-STD
-staticbuilddir	?= ${debdir}/BUILD-STATIC
-mipsbuilddir	?= ${debdir}/BUILD-MIPS
-mipsbuilddir64	?= ${debdir}/BUILD-MIPS-64
-# docdir	?= ${maindir}/usr/share/doc/${package}
-MANDIR		?= /usr/share/man
-mandir		?= ${tmpdir}${MANDIR}
-
-UDEB_NAME 	?= $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
-UDEB_PRIORITY	?= $(shell grep '^Package: e2fsprogs-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2)
-
-ifneq ($(UTIL_LINUX_NG),yes)
-BLKID_UDEB_NAME ?= libblkid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
-BLKID_UDEB_PRIORITY ?= $(shell grep '^Package: libblkid1-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2)
-
-UUID_UDEB_NAME ?= libuuid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
-UUID_UDEB_PRIORITY ?= $(shell grep '^Package: libuuid1-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2)
-endif
-
-STAMPSDIR	?= debian/stampdir
-CFGSTDSTAMP	?= ${STAMPSDIR}/configure-std-stamp
-CFGBFSTAMP	?= ${STAMPSDIR}/configure-bf-stamp
-CFGSTATICSTAMP	?= ${STAMPSDIR}/configure-static-stamp
-BUILDSTDSTAMP	?= ${STAMPSDIR}/build-std-stamp
-BUILDBFSTAMP	?= ${STAMPSDIR}/build-bf-stamp
-BUILDSTATICSTAMP ?=${STAMPSDIR}/build-static-stamp
+tmpdir		?= ${topdir}/debian/tmp
+udebdir		?= ${topdir}/debian/e2fsprogs-udeb
+stdbuilddir	?= ${topdir}/debian/BUILD-STD
 
 INSTALL ?= install
 INSTALL_PROGRAM ?= $(INSTALL) -p -o root -g root -m 0755
 
-#ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-#INSTALL_PROGRAM += -s
-#endif
-
-DEFAULT_CFLAGS ?= -g -O2
-DEFAULT_LDFLAGS ?= -Wl,-Bsymbolic-functions
-
-CFLAGS ?= $(shell if dpkg-buildflags > /dev/null 2>&1 ; then \
-	dpkg-buildflags --get CFLAGS; else echo $(DEFAULT_CFLAGS) ; fi)
-LDFLAGS ?= $(shell if dpkg-buildflags > /dev/null 2>&1 ; then \
-	dpkg-buildflags --get LDFLAGS; else echo $(DEFAULT_LDFLAGS) ; fi)
-CPPFLAGS ?= $(shell if dpkg-buildflags > /dev/null 2>&1 ; then \
-	dpkg-buildflags --get CPPFLAGS; fi)
-
-ifeq (${DEB_HOST_ARCH},alpha)
-CFLAGS += -DHAVE_NETINET_IN_H
-else
-CFLAGS += -D__NO_STRING_INLINES
+ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
+SYMBOL_LIBS := libext2fs libcomerr2 libss2
 endif
 
-ifneq (${DEB_HOST_ARCH_OS},linux)
-SKIP_STATIC = yes
+CFLAGS_SHLIB = $(CFLAGS)
+CFLAGS_STLIB = $(CFLAGS)
+LDFLAGS_SHLIB = $(LDFLAGS)
+LDFLAGS_STATIC = $(filter-out -fPIE -fpie -pie,$(LDFLAGS))
+
+BACKTRACE_CONF_FLAGS ?= $(shell if debian/scripts/test-backtrace ; then echo --disable-backtrace ; fi)
+
+COMMON_CONF_FLAGS = --enable-elf-shlibs --disable-ubsan \
+	--disable-addrsan --disable-threadsan --disable-e2initrd-helper \
+	--disable-fsck --disable-libblkid --disable-libuuid --disable-uuidd \
+	--infodir=/usr/share/info  --enable-symlink-install \
+	--with-multiarch=$(DEB_HOST_MULTIARCH) \
+	$(BACKTRACE_CONF_FLAGS) ${EXTRA_CONF_FLAGS}
+
+ifneq ($(SKIP_FUSE2FS),)
+COMMON_CONF_FLAGS +=  --disable-fuse2fs
 endif
 
-ifeq ($(SKIP_STATIC),yes)
-BUILD_STATIC =
-E2FSCK_STATIC = ${stdbuilddir}/e2fsck/e2fsck.static
-else
-BUILD_STATIC = build-static
-E2FSCK_STATIC = ${staticbuilddir}/e2fsck/e2fsck.static
+ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+CC ?= $(DEB_HOST_GNU_TYPE)-gcc
+COMMON_CONF_FLAGS += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
 endif
 
-ifeq ($(SKIP_BF),yes)
-BUILD_BF =
-bfbuilddir	?= ${stdbuilddir}
-else
-BUILD_BF = build-bf
-bfbuilddir	?= ${debdir}/BUILD-BF
-endif
+%:
+	dh $@ -B${stdbuilddir}
 
-BF_CFLAGS = -Os -fomit-frame-pointer
+override_dh_autoreconf:
 
-COMMON_CONF_FLAGS = --disable-e2initrd-helper --enable-elf-shlibs \
-	--enable-quota --infodir=/usr/share/info
-ifeq ($(UTIL_LINUX_NG),yes)
-COMMON_CONF_FLAGS += --disable-fsck --disable-libblkid \
-			--disable-libuuid --disable-uuidd
-else
-COMMON_CONF_FLAGS += --enable-fsck
-endif
-
-ifneq ($(strip $(DEB_HOST_MULTIARCH)),)
-MULTIARCH_CONF ?= --with-multiarch=$(DEB_HOST_MULTIARCH)
-# This doesn't work yet because gdb and lintian don't expect and/or
-# don't work with /usr/lib/<triplet>/debug
-#USRLIB = /usr/lib/$(DEB_HOST_MULTIARCH)
-USRLIB ?= /usr/lib
-else
-USRLIB ?= /usr/lib
-endif
-
-BACKTRACE_CONF_FLAGS ?= $(shell if ${debdir}/scripts/test-backtrace ; then echo --disable-backtrace ; fi)
-
-STD_CONF_FLAGS ?= --enable-symlink-install $(MULTIARCH_CONF) $(BACKTRACE_CONF_FLAGS)
-
-BF_CONF_FLAGS ?= --disable-nls --disable-imager --disable-testio-debug \
-	--disable-uuidd --disable-tls --disable-debugfs
-
-STATIC_CONF_FLAGS ?= --disable-nls --disable-imager \
-	--disable-uuidd --disable-tls
-
-MIPS_NOPIC_CONF_FLAGS ?= --disable-nls --disable-imager \
-	--disable-uuidd --disable-tls \
-        --disable-resizer # --disable-debugfs
-
-# we can't use those flags at configure time
-MIPS_CFLAGS ?= -G 0 -fno-pic -mno-abicalls
-MIPS_CFLAGS_64 ?= -mabi=64 -G 0 -fno-pic -mno-abicalls
-
-ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
-ifneq (,$(findstring $(DEB_BUILD_ARCH),mips mipsel))
-ismips=ismips
-endif
-endif
-
-M4_ARGS=
-ifeq ($(UTIL_LINUX_NG),yes)
-M4_ARGS+=-DUTIL_LINUX_NG
-else
-M4_ARGS+=-UUTIL_LINUX_NG
-endif
-
-ifneq ($(strip $(DEB_HOST_MULTIARCH)),)
-M4_ARGS+=-DDO_MULTIARCH
-else
-M4_ARGS+=-UDO_MULTIARCH
-endif
-
-ifneq ($(SKIP_DIETLIBC),)
-M4_ARGS+=-UDIETLIBC
-WITH_DIET_LIBC = 
-else
-M4_ARGS+=-DDIETLIBC
-WITH_DIET_LIBC = --with-diet-libc 
-endif
-
-ifneq ($(BUILD_E2FSCK_STATIC),no)
-M4_ARGS+=-DE2FSCK_STATIC
-else
-M4_ARGS+=-UE2FSCK_STATIC
-endif
-
-FILES_FIXUP= libcomerr2.files comerr-dev.files libss2.files ss-dev.files \
-	libuuid1.files uuid-dev.files libblkid1.files libblkid-dev.files \
-	e2fslibs.files e2fslibs-dev.files
-
-debian-files: debian/control debian/e2fsprogs.shlibs.local
-ifeq ($(strip $(DEB_HOST_MULTIARCH)),)
-	for i in $(FILES_FIXUP); do \
-		sed -e 's;lib/\*/;lib/;' debian/$$i.in > debian/$$i; \
-	done
-else
-	for i in $(FILES_FIXUP); do cp debian/$$i.in debian/$$i; done
-endif
-
-mrproper: clean
-	rm debian/control debian/e2fsprogs.shlibs.local
-
-debian/control: debian/control.in debian/rules
-	m4 $(M4_ARGS) < debian/control.in | grep -v ^REMOVE_ME$$ > $@
-
-debian/e2fsprogs.shlibs.local: debian/e2fsprogs.shlibs.local.in
-	m4 $(M4_ARGS) < debian/e2fsprogs.shlibs.local.in > $@
-
-${CFGSTDSTAMP}:
-	dh_testdir
-
-	# Make sure we don't try to rebuild the configure scripts
-	find . -name configure | xargs touch
-
+override_dh_auto_configure:
 	mkdir -p ${stdbuilddir}
-ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
 	cd ${stdbuilddir} && AWK=/usr/bin/awk \
-		${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} ${EXTRA_CONF_FLAGS} \
-		CFLAGS="${CFLAGS}" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
-else
-	cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
-		${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} ${EXTRA_CONF_FLAGS} \
-		--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
-		CFLAGS="${CFLAGS}" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
-endif
+		../../configure ${COMMON_CONF_FLAGS}
 
-  # specially-built MIPS libs
-ifneq ($(ismips),)
-	mkdir -p ${mipsbuilddir} ${mipsbuilddir64}
-	cd ${mipsbuilddir} && AWK=/usr/bin/awk \
-		${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS} \
-		CFLAGS="${CFLAGS}" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
-	cd ${mipsbuilddir64} && AWK=/usr/bin/awk \
-		${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS} \
-		CFLAGS="${CFLAGS}" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
-endif
-
-	mkdir -p ${STAMPSDIR}
-	touch ${CFGSTDSTAMP}
-
-${CFGBFSTAMP}:
-	dh_testdir
-	rm -f config.cache
-
-	mkdir -p ${bfbuilddir}
-ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
-	cd ${bfbuilddir} && AWK=/usr/bin/awk \
-		${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} ${EXTRA_CONF_FLAGS} \
-		CFLAGS="${CFLAGS} ${BF_CFLAGS}" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
-else
-	cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
-		${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} ${EXTRA_CONF_FLAGS} \
-		--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
-		CFLAGS="${CFLAGS}" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
-endif
-	mkdir -p ${STAMPSDIR}
-	touch ${CFGBFSTAMP}
-
-${CFGSTATICSTAMP}:
-	dh_testdir
-	rm -f config.cache
-
-	mkdir -p ${staticbuilddir}
-ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
-	if type diet > /dev/null  2>&1 ; then \
-		cd ${staticbuilddir} && AWK=/usr/bin/awk \
-		${topdir}/configure ${STATIC_CONF_FLAGS} ${EXTRA_CONF_FLAGS} \
-		${WITH_DIET_LIBC} CFLAGS="${CFLAGS}" \
-		CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"; \
-	else \
-		cd ${staticbuilddir} && AWK=/usr/bin/awk \
-			${topdir}/configure ${STATIC_CONF_FLAGS} ${EXTRA_CONF_FLAGS} \
-			CFLAGS="${CFLAGS}" CPPFLAGS="$(CPPFLAGS)" \
-			LDFLAGS="$(LDFLAGS)"; \
-	fi
-else
-	cd ${staticbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
-		${topdir}/configure ${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} ${EXTRA_CONF_FLAGS} \
-		--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
-		CFLAGS="${CFLAGS}" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)"
-endif
-	mkdir -p ${STAMPSDIR}
-	touch ${CFGSTATICSTAMP}
-
-build-arch: build
-build-indep: build
-build: build-std $(BUILD_BF) $(BUILD_STATIC)
-
-build-std: ${BUILDSTDSTAMP}
-${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
-	dh_testdir
+override_dh_auto_build:
 	$(MAKE) -C ${stdbuilddir} V=1 all
-ifneq ($(BUILD_E2FSCK_STATIC),no)
+ifeq (,$(filter pkg.e2fsprogs.no-static,$(DEB_BUILD_PROFILES)))
 	$(MAKE) -C ${stdbuilddir}/e2fsck V=1 e2fsck.static
 endif
+	if ! test -d debian/orig-gmo ; then \
+		mkdir debian/orig-gmo ; \
+		mv po/*.gmo po/*.po debian/orig-gmo ; \
+		cp debian/orig-gmo/*.po po ; \
+	fi
 	$(MAKE) -C ${stdbuilddir}/po V=1 update-gmo
 
-	( cd ${stdbuilddir}/doc && $(MAKE) V=1 libext2fs.html )
-	( cd ${stdbuilddir}/lib/et && $(MAKE) V=1 com_err.info com_err.html )
+	$(MAKE) -C ${stdbuilddir}/doc V=1 libext2fs.html
+	$(MAKE) -C ${stdbuilddir}/lib/et V=1 com_err.info com_err.html
+	cat $(shell /bin/ls -1 ./doc/RelNotes/*.txt | tac) | \
+		gzip -9n > ${stdbuilddir}/NEWS.gz
 
-  # specially-built MIPS libs
-ifneq ($(ismips),)
-	$(MAKE) -C ${mipsbuilddir}/util V=1
-	$(MAKE) -C ${mipsbuilddir} V=1 \
-		CFLAGS="${CFLAGS} ${MIPS_CFLAGS}" \
-		LIB_SUBDIRS="lib/et lib/ext2fs" libs
-	$(MAKE) -C ${mipsbuilddir64}/util V=1
-	$(MAKE) -C ${mipsbuilddir64} V=1 \
-		CFLAGS="${CFLAGS} ${MIPS_CFLAGS_64}" \
-		LIB_SUBDIRS="lib/et lib/ext2fs" libs
-endif
+override_dh_auto_clean:
+	if test -d debian/orig-gmo ; then \
+		rm -f po/*.gmo po/*.po ; \
+		mv debian/orig-gmo/* po ; \
+		rmdir debian/orig-gmo ; \
+	fi
+	rm -rf ${stdbuilddir}
 
-	touch ${BUILDSTDSTAMP}
-
-build-bf: ${BUILDBFSTAMP}
-${BUILDBFSTAMP}: ${CFGBFSTAMP}
-	dh_testdir
-	$(MAKE) -C ${bfbuilddir} V=1 libs
-	$(MAKE) -C ${bfbuilddir}/e2fsck V=1 all
-	$(MAKE) -C ${bfbuilddir}/misc V=1 all
-	$(MAKE) -C ${bfbuilddir}/resize V=1 all
-	touch ${BUILDBFSTAMP}
-
-build-static: ${BUILDSTATICSTAMP}
-${BUILDSTATICSTAMP}: ${CFGSTATICSTAMP}
-	dh_testdir
-	$(MAKE) -C ${staticbuilddir} V=1 libs
-ifneq ($(BUILD_E2FSCK_STATIC),no)
-	$(MAKE) -C ${staticbuilddir}/e2fsck V=1 all e2fsck.static
-endif
-	touch ${BUILDSTATICSTAMP}
-
-clean:
-	dh_testdir
-	rm -rf ${STAMPSDIR}
-	[ ! -f ${stdbuilddir}/Makefile ] || $(MAKE) -C ${stdbuilddir} V=1 distclean
-	[ ! -f ${bfbuilddir}/Makefile ] || $(MAKE) -C ${bfbuilddir} V=1 distclean
-	[ ! -f ${staticbuilddir}/Makefile ] || $(MAKE) -C ${staticbuilddir} V=1 distclean
-	rm -rf ${stdbuilddir} ${bfbuilddir} ${staticbuilddir} ${mipsbuilddir} ${mipsbuilddir64}
-	rm -f debian/*.substvars
-	dh_clean
-
-install: cleanup install-std
-
-# This rule allows to factorize the dh_clean between the 2 install rules
-# This must be launched before install-* (if launching them by hand, for
-# exemple) or results are unpredictable
-cleanup:
-	dh_testdir
-	dh_testroot
-	dh_prep
-
-install-std: DH_OPTIONS=
-install-std: build
-	dh_testdir
-	dh_testroot
-	dh_installdirs
-
+override_dh_auto_install:
 	mkdir -p ${tmpdir}/sbin
 	$(MAKE) -C ${stdbuilddir} V=1 install DESTDIR=${tmpdir} \
 		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
   # static libs and .h files
 	$(MAKE) -C ${stdbuilddir} V=1 install-libs DESTDIR=${tmpdir} LDCONFIG=true
 
-ifneq ($(BUILD_E2FSCK_STATIC),no)
+ifeq (,$(filter pkg.e2fsprogs.no-static,$(DEB_BUILD_PROFILES)))
   # statically-linked fsck
-	${INSTALL_PROGRAM} $(E2FSCK_STATIC) ${tmpdir}/sbin
-	cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
+	${INSTALL_PROGRAM} ${stdbuilddir}/e2fsck/e2fsck.static ${tmpdir}/sbin
+	(cd debian/tmp/usr/share/man/man8 ; cp e2fsck.8 e2fsck.static.8)
 endif
 
-  # remove static quota library for now
-	rm ${tmpdir}/usr/include/quota/mkquota.h
-	find ${tmpdir} -name quota.pc -o -name libquota.a | xargs rm
-
-ifeq ($(DEB_BUILD_GNU_SYSTEM), gnu) 
+ifeq ($(DEB_HOST_ARCH_OS), hurd)
 	${INSTALL} -m 0644 misc/mke2fs-hurd.conf ${tmpdir}/etc/mke2fs.conf
 endif
 
-	dh_movefiles
-	test -z "`find ${tmpdir} -type f`"
+override_dh_install:
+	dh_install -p e2fsprogs --sourcedir=${stdbuilddir} NEWS.gz \
+		usr/share/doc/e2fsprogs
+	dh_install
+	dh_missing --fail-missing
 
-  # specially-built MIPS libs
-ifneq ($(ismips),)
-	$(INSTALL) -p -m 0644 ${mipsbuilddir}/lib/libext2fs.a \
-		${debdir}/e2fslibs-dev/usr/lib/libext2fs-nopic.a
-	$(INSTALL) -p -m 0644 ${mipsbuilddir64}/lib/libext2fs.a \
-		${debdir}/e2fslibs-dev/usr/lib/lib64ext2fs-nopic.a
+ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES)))
+override_dh_lintian:
+	dh_lintian
+	$(INSTALL) -D -p -m644 debian/e2fsprogs-udeb.lintian-overrides \
+	    debian/e2fsprogs-udeb/usr/share/lintian/overrides/e2fsprogs-udeb
 endif
 
-install-udeb: DH_OPTIONS=
-install-udeb: build
-	dh_testdir
-	dh_testroot
-
-	$(MAKE) -C ${bfbuilddir} V=1 install-shlibs-libs-recursive DESTDIR=${udebdir} \
-		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
-	$(MAKE) -C ${bfbuilddir}/e2fsck V=1 install DESTDIR=${udebdir} \
-		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
-	$(MAKE) -C ${bfbuilddir}/misc V=1 install DESTDIR=${udebdir} \
-		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
-	$(MAKE) -C ${bfbuilddir}/resize V=1 install DESTDIR=${udebdir} \
-		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
-
-	rm -rf ${udebdir}/usr
-	find ${udebdir}/sbin -type f -a ! -name e2fsck \
-		-a ! -name mke2fs -a ! -name tune2fs \
-		-a ! -name resize2fs -a ! -name badblocks -print | xargs rm
-
-	(cd ${udebdir}/sbin; ln -sf e2fsck fsck.ext2 ; \
-		ln -sf e2fsck fsck.ext3 ; ln -sf e2fsck fsck.ext4 ; \
-		ln -sf mke2fs mkfs.ext2 ; ln -sf mke2fs mkfs.ext3 ; \
-		ln -sf mke2fs mkfs.ext4)
-
-ifneq ($(UTIL_LINUX_NG),yes)
-	mkdir -p ${blkidudebdir}/lib
-	mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib
-
-	mkdir -p ${uuidudebdir}/lib
-	mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib
-endif
-
-binary-indep: 
-  # no arch-independant debs.
-
-binary-arch: DH_OPTIONS= -a
-binary-arch: install install-udeb
-	dh_testdir
-	dh_testroot
-
-  # lintian overrides
-	for i in $$(cd debian && echo *.lintian-overrides); do \
-		pkg=$${i%.lintian-overrides} ;\
-		if test "$${pkg}" != source ; then \
-			$(INSTALL) -m 0644 -D -p debian/$$i ${debdir}/$${pkg}/usr/share/lintian/overrides/$${pkg} ;\
-		fi ;\
-	done
-
-  # symlinks to prepare dh_installdocs run
-
-ifneq ($(UTIL_LINUX_NG),yes)
-	mkdir -p ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}
-	mkdir -p ${debdir}/libblkid-dev/usr/share/doc
-	ln -sf libblkid${BLKID_SOVERSION} ${debdir}/libblkid-dev/usr/share/doc/libblkid-dev
-endif
-
-	mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
-	mkdir -p ${debdir}/ss-dev/usr/share/doc
-	ln -sf libss${SS_SOVERSION} ${debdir}/ss-dev/usr/share/doc/ss-dev
-
-	mkdir -p ${debdir}/libcomerr${COMERR_SOVERSION}/usr/share/doc/libcomerr${COMERR_SOVERSION}
-	mkdir -p ${debdir}/comerr-dev/usr/share/doc
-	ln -sf libcomerr${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev
-
-ifneq ($(UTIL_LINUX_NG),yes)
-	mkdir -p ${debdir}/libuuid${UUID_SOVERSION}/usr/share/doc/libuuid${UUID_SOVERSION}
-	mkdir -p ${debdir}/uuid-dev/usr/share/doc
-#	ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev
-endif
-
-	mkdir -p ${debdir}/e2fslibs/usr/share/doc/e2fslibs
-	mkdir -p ${debdir}/e2fslibs-dev/usr/share/doc
-	ln -sf e2fslibs ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs-dev
-
-ifneq ($(UTIL_LINUX_NG),yes)
-	$(INSTALL) -p -m 0644 debian/libblkid.copyright \
-		${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright
-endif
-
-	dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
-
+override_dh_installinfo:
   # HTML docs
-	$(INSTALL) -d ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
+	$(INSTALL) -d debian/libext2fs-dev/usr/share/doc/libext2fs2/html-info/
 	$(INSTALL) -p -m 0644 ${stdbuilddir}/doc/*.html \
-	   ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
-	$(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
+	   debian/libext2fs-dev/usr/share/doc/libext2fs2/html-info/
+	$(INSTALL) -d debian/comerr-dev/usr/share/doc/comerr-dev/html-info/
 	$(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/*.html \
-	   ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
+	   debian/comerr-dev/usr/share/doc/comerr-dev/html-info/
 
   # texinfo docs
-	mkdir -p ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}
+	mkdir -p debian/comerr-dev/usr/share/doc/comerr-dev
 	$(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
-	   ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/libext2fs.texi
+	   debian/libext2fs-dev/usr/share/doc/libext2fs2/libext2fs.texi
 	$(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
-	   ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/com_err.texi
+	   debian/comerr-dev/usr/share/doc/comerr-dev/com_err.texi
 
-	$(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
+	$(INSTALL) -d debian/comerr-dev/usr/share/doc/comerr-dev/examples
 	$(INSTALL) -p -m 0644 lib/ss/ss_err.et \
 		${stdbuilddir}/lib/ext2fs/ext2_err.et \
-		${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
-	$(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
+		debian/comerr-dev/usr/share/doc/comerr-dev/examples
+	$(INSTALL) -d debian/ss-dev/usr/share/doc/ss-dev/examples
 	$(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
-		${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
+		debian/ss-dev/usr/share/doc/ss-dev/examples
 
 	dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
-	dh_installinfo -pe2fslibs-dev ${stdbuilddir}/doc/libext2fs.info
+	dh_installinfo -plibext2fs-dev ${stdbuilddir}/doc/libext2fs.info
 
-	DH_OPTIONS= dh_installchangelogs -pe2fsprogs \
-		-plibcomerr${COMERR_SOVERSION} \
-		-plibss${SS_SOVERSION} \
-		-pe2fslibs \
-		-pe2fsprogs-dbg -pe2fslibs-dbg \
-		-plibcomerr2-dbg -plibss2-dbg
-ifneq ($(BUILD_E2FSCK_STATIC),no)
-	DH_OPTIONS= dh_installchangelogs -pe2fsck-static
-endif
-ifneq ($(UTIL_LINUX_NG),yes)
-	DH_OPTIONS= dh_installchangelogs -plibuuid${UUID_SOVERSION} \
-		-puuid-dev -puuid-runtime -puuid-runtime-dbg -plibuuid1-dbg \
-		-plibblkid${BLKID_SOVERSION} -plibblkid1-dbg
-endif
-
-	dh_fixperms
-ifneq ($(ismips),)
-	dh_strip -k -Xlib64ext2fs-nopic.a
-else
-	dh_strip -k
-endif
-
-	# debug package stuff
-	rm -rf ${udebdir}/usr
-ifneq ($(UTIL_LINUX_NG),yes)
-	rm -rf ${blkidudebdir}/usr
-	rm -rf ${uuidudebdir}/usr
-endif
-
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-	mkdir -p ${debugdir}/$(USRLIB)
-	mv ${maindir}/usr/lib/debug ${debugdir}/$(USRLIB)
-	rm -rf ${maindir}/usr/lib/debug
-
-ifneq ($(BUILD_E2FSCK_STATIC),no)
-	mv ${e2fsckstaticdir}/usr/lib/debug/sbin/* \
-		${debugdir}/$(USRLIB)/debug
-	rm -rf ${e2fsckstaticdir}/usr/lib
-endif
-
-ifneq ($(UTIL_LINUX_NG),yes)
-	mkdir -p ${uuidruntimedbgdir}/$(USRLIB)
-	mv ${uuidruntimedir}/usr/lib/debug ${uuidruntimedbgdir}/$(USRLIB)
-	rmdir ${uuidruntimedir}/usr/lib
-endif
-
-	mkdir -p ${libext2dbgdir}/$(USRLIB)
-	mv ${libext2dir}/usr/lib/debug ${libext2dbgdir}/$(USRLIB)
-	rmdir ${libext2dir}/usr/lib
-
-	mkdir -p ${libcomerrdbgdir}/$(USRLIB)
-	mv ${libcomerrdir}/usr/lib/debug ${libcomerrdbgdir}/$(USRLIB)
-	rmdir ${libcomerrdir}/usr/lib
-
-	mkdir -p ${libssdbgdir}/$(USRLIB)
-	mv ${libssdir}/usr/lib/debug ${libssdbgdir}/$(USRLIB)
-	rmdir ${libssdir}/usr/lib
-
-ifneq ($(UTIL_LINUX_NG),yes)
-	mkdir -p ${libuuiddbgdir}/$(USRLIB)
-	mv ${libuuiddir}/usr/lib/debug ${libuuiddbgdir}/$(USRLIB)
-	rmdir ${libuuiddir}/usr/lib
-
-	mkdir -p ${libblkiddbgdir}/$(USRLIB)
-	mv ${libblkiddir}/usr/lib/debug ${libblkiddbgdir}/$(USRLIB)
-	rmdir ${libblkiddir}/usr/lib
-endif
-endif
-
-	# dpkg symbol handling
-ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
-SYMBOL_LIBS := e2fslibs libcomerr2 libss2
-ifneq ($(UTIL_LINUX_NG),yes)
-SYMBOL_LIBS += libblkid1 libuuid1
-endif
+override_dh_makeshlibs:
 	for i in $(SYMBOL_LIBS); \
 	do \
 		echo "Generating symbols for $$i..."; \
@@ -615,86 +157,30 @@
 		patch debian/$$i.symbols < debian/$$i.tmp-patch; \
 		/bin/rm debian/$$i.tmp-patch; \
 	done
-endif
+	dh_makeshlibs $(if $(filter noudeb,$(DEB_BUILD_PROFILES)),,--add-udeb=e2fsprogs-udeb)
 
-	for i in e2fsprogs e2fsprogs-dbg e2fslibs e2fslibs-dbg; do \
-	   $(INSTALL) -p -m 0644 debian/copyright \
-		${debdir}/$$i/usr/share/doc/$$i/copyright; \
-	done
-
-ifneq ($(UTIL_LINUX_NG),yes)
-	$(INSTALL) -p -m 0644 debian/uuid-runtime.copyright \
-		${uuidruntimedbgdir}/usr/share/doc/uuid-runtime-dbg/copyright
-endif
-
-	$(INSTALL) -p -m 0644 debian/libcomerr2.copyright \
-		${libcomerrdbgdir}/usr/share/doc/libcomerr2-dbg/copyright
-
-	$(INSTALL) -p -m 0644 debian/libss2.copyright \
-		${libssdbgdir}/usr/share/doc/libss2-dbg/copyright
-
-ifneq ($(UTIL_LINUX_NG),yes)
-	$(INSTALL) -p -m 0644 debian/libblkid.copyright \
-		${libblkiddbgdir}/usr/share/doc/libblkid1-dbg/copyright
-
-	$(INSTALL) -p -m 0644 debian/libuuid1.copyright \
-		${libuuiddbgdir}/usr/share/doc/libuuid1-dbg/copyright
-endif
-
-	dh_compress
-
-	dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
-	dh_makeshlibs --add-udeb=e2fsprogs-udeb -plibcomerr${COMERR_SOVERSION} \
-		-V 'libcomerr2 (>= 1.33-3)'
-ifneq ($(UTIL_LINUX_NG),yes)
-	dh_makeshlibs -plibblkid${BLKID_SOVERSION} -V 'libblkid1 (>= 1.39-1)'
-	echo "udeb: libblkid 1 libblkid1-udeb" >> \
-		debian/libblkid1/DEBIAN/shlibs
-	echo "udeb: libuuid 1 libuuid1-udeb" >> debian/libuuid1/DEBIAN/shlibs
-endif
-
-	dh_installdeb
-	dh_shlibdeps -l${stdbuilddir}/lib
+override_dh_shlibdeps:
 	dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
-		-u"-Ldebian/e2fsprogs.shlibs.local"
+		-- -Ldebian/e2fsprogs.shlibs.local
+ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES)))
 	dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
-		-u"-Ldebian/e2fsprogs-udeb.shlibs.local"
-
-	dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
-		-Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
-	DH_OPTIONS= dh_gencontrol -pcomerr-dev \
-	  -u '-v${COMERR_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
-	DH_OPTIONS= dh_gencontrol -pss-dev \
-	  -u '-v${SS_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
-ifneq ($(UTIL_LINUX_NG),yes)
-	DH_OPTIONS= dh_gencontrol -puuid-dev \
-	  -u '-v${UUID_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
+		-- -Ldebian/e2fsprogs-udeb.shlibs.local
 endif
-	dh_gencontrol	-pe2fsprogs-udeb -- -fdebian/files~
-ifneq ($(UTIL_LINUX_NG),yes)
-	dh_gencontrol	-plibblkid1-udeb -- -fdebian/files~
-	dh_gencontrol	-plibuuid1-udeb -- -fdebian/files~
+ifeq ($(SKIP_FUSE2FS),)
+	dh_shlibdeps -pfuse2fs -l${stdbuilddir}/lib \
+		-- -Ldebian/e2fsprogs.shlibs.local
+endif
+	dh_shlibdeps --remaining-packages -l${stdbuilddir}/lib
+
+override_dh_gencontrol:
+	dh_gencontrol -pcomerr-dev -- -v${COMERR_VERSION}-${DEB_VERSION} -VmainBinary=${DEB_VERSION}
+	dh_gencontrol -pss-dev -- -v${SS_VERSION}-${DEB_VERSION} -VmainBinary=${DEB_VERSION}
+	dh_gencontrol --remaining-packages
+
+override_dh_auto_test:
+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+	$(MAKE) -C ${stdbuilddir} V=1 check
 endif
 
-	dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
-ifneq ($(UTIL_LINUX_NG),yes)
-	dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY)
-	dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
-endif
-	dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
-	dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
-	dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME)
-ifneq ($(UTIL_LINUX_NG),yes)
-	dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
-	dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
-endif
-
-binary: binary-indep binary-arch
-
-.PHONY: binary binary-arch binary-indep clean checkroot mrproper \
-	debug_flags debian-files
-
-debug_flags:
-	@echo CFLAGS is $(CFLAGS)
-	@echo LDFLAGS is $(LDFLAGS)
-	@echo CPPFLAGS is $(CPPFLAGS)
+test_printenv:
+	printenv | sort
diff --git a/debian/source.lintian-overrides b/debian/source.lintian-overrides
deleted file mode 100644
index 8c0cd0f..0000000
--- a/debian/source.lintian-overrides
+++ /dev/null
@@ -1,3 +0,0 @@
-e2fsprogs source: weak-library-dev-dependency ss-dev on libss2 (= ${mainBinary})
-e2fsprogs source: weak-library-dev-dependency comerr-dev on libcomerr2 (= ${mainBinary})
-e2fsprogs source: weak-library-dev-dependency uuid-dev on libuuid1 (= ${mainBinary})
diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
new file mode 100644
index 0000000..52e733e
--- /dev/null
+++ b/debian/source/lintian-overrides
@@ -0,0 +1,2 @@
+e2fsprogs source: weak-library-dev-dependency ss-dev on libss2 (= ${mainBinary})
+e2fsprogs source: weak-library-dev-dependency comerr-dev on libcom-err2 (= ${mainBinary})
diff --git a/debian/ss-dev.files.in b/debian/ss-dev.install
similarity index 100%
rename from debian/ss-dev.files.in
rename to debian/ss-dev.install
diff --git a/debian/ss-dev.postinst b/debian/ss-dev.postinst
new file mode 100644
index 0000000..bf49c9d
--- /dev/null
+++ b/debian/ss-dev.postinst
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Abort on error.
+set -e
+
+symlink_match()
+{
+	local SYMLINK="$1"
+	local SYMLINK_TARGET="$2"
+
+	[ "$(readlink "$SYMLINK")" = "$SYMLINK_TARGET" ] || \
+	[ "$(readlink -f "$SYMLINK")" = "$SYMLINK_TARGET" ]
+}
+
+SYMLINK=/usr/share/doc/ss-dev
+SYMLINK_TARGET=libss2
+
+if [ "$1" = "configure" ] && [ -h "${SYMLINK}.dpkg-backup" ] &&
+   symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET"
+then
+	rm -f "${SYMLINK}.dpkg-backup"
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/ss-dev.postrm b/debian/ss-dev.postrm
new file mode 100644
index 0000000..c625aae
--- /dev/null
+++ b/debian/ss-dev.postrm
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Abort on error.
+set -e
+
+symlink_match()
+{
+	local SYMLINK="$1"
+	local SYMLINK_TARGET="$2"
+
+	[ "$(readlink "$SYMLINK")" = "$SYMLINK_TARGET" ] || \
+	[ "$(readlink -f "$SYMLINK")" = "$SYMLINK_TARGET" ]
+}
+
+SYMLINK=/usr/share/doc/ss-dev
+SYMLINK_TARGET=libss2
+
+if [ "$1" = "purge" ] && [ -h "${SYMLINK}.dpkg-backup" ]
+then
+    rm -f "${SYMLINK}.dpkg-backup"
+fi
+if [ "$1" = "abort-install" -o "$1" = "abort-upgrade" ] &&
+   [ -n "$2" ] && [ ! -e "$SYMLINK" ] && [ -h "${SYMLINK}.dpkg-backup" ] &&
+   symlink_match "${SYMLINK}.dpkg-backup" "$SYMLINK_TARGET"
+then
+    echo "Restoring backup of $SYMLINK ..."
+    mv "${SYMLINK}.dpkg-backup" "$SYMLINK"
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/ss-dev.preinst b/debian/ss-dev.preinst
new file mode 100644
index 0000000..8da566e
--- /dev/null
+++ b/debian/ss-dev.preinst
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# Abort on error.
+set -e
+
+symlink_match()
+{
+	local SYMLINK="$1"
+	local SYMLINK_TARGET="$2"
+
+	[ "$(readlink "$SYMLINK")" = "$SYMLINK_TARGET" ] || \
+	[ "$(readlink -f "$SYMLINK")" = "$SYMLINK_TARGET" ]
+}
+
+SYMLINK=/usr/share/doc/ss-dev
+SYMLINK_TARGET=libss2
+
+if [ "$1" = "install" -o "$1" = "upgrade" ] &&
+   [ -n "$2" ] && [ -h "$SYMLINK" ] &&
+   symlink_match "$SYMLINK" "$SYMLINK_TARGET"
+then
+    mv -f "$SYMLINK" "${SYMLINK}.dpkg-backup"
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..e149342
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,6 @@
+Tests: smoke
+Depends: e2fsprogs
+
+Tests: fuse2fs
+Depends: fuse2fs, fuse3
+Restrictions: isolation-machine
diff --git a/debian/tests/fuse2fs b/debian/tests/fuse2fs
new file mode 100755
index 0000000..8b4e08a
--- /dev/null
+++ b/debian/tests/fuse2fs
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+TDIR=${AUTOPKGTEST_TMP:-/tmp/fuse_dir}
+LOGDIR=${AUTOPKGTEST_ARTIFACTS:-/tmp/fuse_dir_log}
+IMG=$TDIR/test-image.img
+MNT=$TDIR/mnt
+
+# some autopkgtest environments may not have /etc/mtab and/or /proc/mounts
+EXT2FS_NO_MTAB_OK=yes
+export EXT2FS_NO_MTAB_OK
+
+mkdir -p $LOGDIR $TDIR $MNT
+
+/sbin/mke2fs -E root_owner -q -t ext4 -d e2fsck $IMG 8M
+/sbin/e2label $IMG test
+fuse2fs $IMG $MNT > $LOGDIR/fuse2fs.log 2>&1
+if test $? -ne 0 ; then
+   echo "fuse2fs failed; see $LOGDIR/fuse2fs.log"
+   exit 1
+fi
+diff e2fsck/pass1.c $MNT/pass1.c
+echo foobar > $MNT/testfile
+fusermount -u $MNT > $LOGDIR/fusermount.log 2>&1
+if test $? -ne 0 ; then
+   echo "fusermount failed; see $LOGDIR/fusermount.log"
+   exit 1
+fi
+/sbin/e2fsck -fy $IMG > $LOGDIR/e2fsck.log 2>&1
+if test $? -ne 0 ; then
+   echo "e2fsck failed; see $LOGDIR/e2fsck.log"
+   exit 1
+fi
+contents=$(/sbin/debugfs -R "cat testfile" $IMG 2> $LOGDIR/debugfs.log)
+if test "$contents" != foobar ; then
+   echo "testfile does not contain expected output"
+   exit 1
+fi
diff --git a/debian/tests/smoke b/debian/tests/smoke
new file mode 100755
index 0000000..966be96
--- /dev/null
+++ b/debian/tests/smoke
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+TDIR=${AUTOPKGTEST_TMP:-/tmp/test_dir}
+LOGDIR=${AUTOPKGTEST_ARTIFACTS:-/tmp/test_dir_log}
+IMG=$TDIR/test-image.img
+
+# some autopkgtest environments may not have /etc/mtab and/or /proc/mounts
+EXT2FS_NO_MTAB_OK=yes
+export EXT2FS_NO_MTAB_OK
+
+mkdir -p $LOGDIR $TDIR
+
+/sbin/mke2fs -q -t ext4 -d e2fsck $IMG 8M
+/sbin/e2label $IMG test
+/sbin/e2fsck -fy $IMG > $LOGDIR/e2fsck.1.log 2>&1
+if test $? -ne 0 ; then
+   echo "First e2fsck failed; see $LOGDIR/e2fsck.1.log"
+   exit 1
+fi
+/sbin/resize2fs $IMG 16M > $LOGDIR/resize2fs.log 2>&1
+if test $? -ne 0 ; then
+   echo "Resize2fs failed; see $LOGDIR/e2fsck.1.log"
+   exit 1
+fi
+/sbin/e2fsck -fy $IMG > $LOGDIR/e2fsck.2.log 2>&1
+if test $? -ne 0 ; then
+   echo "Second e2fsck failed; see $LOGDIR/e2fsck.2.log"
+   exit 1
+fi
+/sbin/debugfs -R "dump pass1.c $TDIR/pass1.c" $IMG > $LOGDIR/debugfs.log 2>&1
+diff $TDIR/pass1.c e2fsck/pass1.c
+
diff --git a/debian/upstream/signing-key.asc b/debian/upstream/signing-key.asc
new file mode 100644
index 0000000..e225998
--- /dev/null
+++ b/debian/upstream/signing-key.asc
@@ -0,0 +1,156 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1
+
+mQINBEz4F48BEADrt5DOsqL84FrVCYnI3MPZV9cEwvQSZmTyoSyU90Vl16Es7XuF
+y45WhR5tQG6W6iKTnQpIEcxKpTdLG8cxGwc5gOsCzmoEBgHGA23Itx7BVqkB8vSA
+aQDNAsQ4sFUUFBhkHa0d+N6RsrT0EHpK9gUP0paTiybqGn/yIOZ5tyw+jzN5Iae/
+RLbIH5UQ8+XWV7MAFWLBahPJJTVNcASK8h/ZxvNLkIRb5SFO2oqew26VuRi3R0sT
+Pvue14K0JP5KsZ2HEQ8nNWyFhRbMJR32lqFNGNzPgupAdWzXKQT2R/UZ1WsMeQ1i
+TM+HfN3idrJ+u2STXVv1oTkKGFsyhq2gdUcv5o/tpqgkQ8F9K8rKZI/EHzh3ZU0o
+qYAgXECQsoS2hS1qc38EcrE3tKJsXztGpWujf8gbJivs1/pz7bEQiCxtF//Ze2dn
+19CSf7r/WKTecxbkx+eupme3ThqsKWR6v6qaSCA223kiUMb8b8zpJ5+NOxhmgssl
+PPU5EHJaBwZrfritjgwOiEAlyjYZZ4IkA88tAimtYU3nbpn099zSfmvaD8lQUK+e
+NzzUlszJFGEqna4/+nGc0m2rgfbSvyWO4MQz85Fh5cSeUxiWCPNjWTJpRoPPXSIQ
+D+GteZ1rlvA2VmBKLSA8F7BL/lvuUrfjNF2OyLqhOI3TtGe3N+89Q1qsywARAQAB
+tB1UaGVvZG9yZSBUcydvIDx0eXRzb0BtaXQuZWR1PokCOgQTAQgAJAIbAwIeAQIX
+gAIZAQUCVRr3hgULCQgHAwUVCgkICwUWAgMBAAAKCRDTb3abwRgE8LAwD/9B/KUj
+0KpAe2ooXEinS380mkiGzWDJIncEynubiNm5Nl8Zo8hwtjXfagTqucUmnnu8NJ1O
+lwigw5/vJXpTo7maSeyJImaRZaYyzoh8Bv11t1ymbTvr5ab7ZgSGmaak3IjIM8cW
+vv/Wx+yf+LYS03+6GOMdGLq1mF2KgXpHBdK2Wpl/8jlOmry+wccgXBekZP7ZIF0V
+wNFq/q8c6zW2yHs2w6i/pkVHJJm3kyaBe+6U6njq1/HBCnlGin7iYfpxZ0d8FoiL
+4CEUAHfpFP2DKTO+KJJjphZctya0nCBRzQI3Zk8a0/ITCWJr/pw77yysIRiMO0s4
+BjHzzM7edlJA7dILutX8XrnAAkIOdfzWvHuLtLpEcDRP+gowYYO7PjMfb61zsP9L
+dXS1bDrXI2pn2SdRFmaodSBaaAaJoTj55ZbjM2Ckv4lpGYGozreav9suLrYiZIeI
+QRcqL1QIKM9WZPUkfbNSMiLLccOmEpKcqyauh3QJiKdT+lFpRBZY34TSI4R5EKMm
+dJqD/xaZ4nDpfOxbqocEXDGgstmsCgxzLrYc7lVB+1IRnTW2rFlQteFAZucq8Dwb
+xvkOdVY1pJo1vf8UkMPxoexMt7xSSLDQxxRzEtfQSzKLw7Iyf2eTm4OgCN8PocFI
+J7LaqOvyq0YvxCVGrPD9bSCU/H5CAuPJa4WuzrQgVGhlb2RvcmUgVHMnbyA8dHl0
+c29AZGViaWFuLm9yZz6JAjcEEwEIACECGwMCHgECF4AFAlUa95gFCwkIBwMFFQoJ
+CAsFFgIDAQAACgkQ0292m8EYBPBqVg/+JrVNl+yoGyIJ3e85Ts7Ko65UQ+xM71Ad
+OecDUUSx3beSe/Trc76ElvzGu/zMtstu9uH8DnmnjscN1CfqpHK6Rhck69RQDCy+
+c114Q8pa/bzAuWPH4vGHE5BvPZjIc67cZ3T5kHpAaew5ltZG6YhpOBRTRr55ZfO3
+hHQCxOdTmqKWXB1HRXRTu7hlI4WmRpSBf9y4sVwIaraSgtNRhKb/Ff1iPHFCVdoK
++UtfWJrbpJ+HpHAcboNsfC1PQZ8E6eHYiaG0EUlSrpjeCH66kBgkIkbt4RZf+R23
+ZNonE8Hddw6ZR5zMxOfIbK5pBkcEUgOFogwwHL3b/lFdj0t1ggN6eRDVsk9kYYga
+kXypR4DYKSs484Y4OroFccw/M69gFjI3f5AIb3HQzb1cV9ocDnqJtzPLAQJTUiIb
+OJlFUjsvlg8romKV9lodzdS7zO/t2iQF4Hm2ThuS7R93MZEi4Z7WRgKueIBEhHm7
+WBbtnWzlKZDdsILyIUn7L6WE1iT+d+zvUHz6rYY/b1b7VQzH0UXWtwzPKCyLSLuM
+g9q7rm5PMuaMn05zjN2gVy8rfbC7NTTo8f256YT0kmZmO5Kx9fpGYoPIMJp8aiDY
+fUfg2rwWkMxO6uxiEe3xCOVzgQcK7NPZS0NbhdRcrmqN3vyiVLY8Qi2a+xQjesJG
+RAgdhyJkESC0IFRoZW9kb3JlIFRzJ28gPHR5dHNvQGdvb2dsZS5jb20+iQI3BBMB
+CAAhAhsDAh4BAheABQJVGvebBQsJCAcDBRUKCQgLBRYCAwEAAAoJENNvdpvBGATw
+kB0P+wQj8exoDTL8/m+Wuju1CMvHty1i4eBKqzM04OdcBQI3/0zOFmub/VnJVB2L
+92UhEvqclbwWsijz7G1Vr7wsUPkftCoJICYqjPpZf3BKvyGXkatrMUs0ry1xZ15Q
+A4f/9YuiUOykIQiROS+lUa7HqS6dkEj+/2xXheZKcnrv0pz0PayzWbonukRY7Jxe
+UcTAXnX1p9fM7+Y9xx5mkwwe4lN02zGextCw1C77EDGhH8GtgnhyfsFkDLjWmNg8
+xjbGKvYYRU18uu0DYTj7ERrDhYy+Aft91F1ZUN9xPgyMx1uWcuyWPV57L3hdwxUX
+i64TV4CzMOsolytdUikw57pcjyjdn7kPJlgg+1clrtnrCsmwWQYDMfap3pTOCoj5
+8YVjF+j8ngORLw1tNYZdwPVdeTmuWEv0ufgxDjQtD01yHI2PyGYtZBcTZurdYxth
+1Z1+aDyi3kyi6JN8dteA4rUrTxPCI/6GspXQKOlXPKeSijBAG2KdNNNgkWPSVC7q
+xwhGruYYq5QA98nA8Hhe89KTwz3fbTCqr59QfEmpKaB9Uvmx6p0Bvj/zL7+N9VpN
+vIyxRcG9cfbBWkq18TC6cZMeHUHjwh8ttC7sq/GxdhEW4Qn4ZsvbevozAhd2sMQP
+FUUAH0IA1zzIL+UG1AvyQ69kWpoG8Fr9ttIZc5mYUDwL2m1KuQINBEz4GJ4BEADM
+e5nhgwGPH9Ti2TSBlADnsZ3ygrA1UEaTUBxPHm0IYdfqMflqbw+XkxHQqRQzYyah
+Bc1EBj1Fdl907ozRPnm4VzMgEzXZlN2wjmgUhz1gHZmMcCBxnC/p/FdWmEQwJLNg
+TsmnS/seFRw2pwkFtiDYlqXUwU1pDjTLztOMVheQpBlLOg/oHGcZB+llLNPRzCok
+mfNv4ShTygDpYtniQdVg57Qyriz3tvCDE+va8HL96SuCNV1vy+ZJa42KNhhMrHqY
+C5t7hTNaJTyk25Lmwd5aKrSZjS4goHJcP9Ry3Sit467TRGEaqOi3fO0qTiTnW2Gz
+9Cq0xDCOdd3CEbLajMwxM9+UKh+65/nGzh5bYC6zSitXMC1tWUvDEQpk/tiGV8E3
+c2YYbIRcCvOHBoqqIZryi4HqXFyatijEfA9yYc3J8IgmHG9Vc7rBgwdeLGQs9hfp
+6IAFtmZHdupYLOUZk+HVNITESgiT6zICFoxNM0jrhkjqdK4ZtlTAiOTIidr1zVTd
+je0Hr/Su3H/FluG5cXOZJqqcwQak98Li/Qe4dZl0t99V1s7NafDadSAtNOyMUplt
+wSHWzx6PiA3oYMWbQO9S5D7/QK2scNFf7QnWFWYEcuhMlfKAodowI8swljrtgsir
+7ZxRZ4YhSlBx1fgs1W09lIxmW7nufZAce/OzPgQsmQARAQABiQIfBBgBCAAJBQJM
++BieAhsMAAoJENNvdpvBGATwjq0P/1ZkCLDRvERSHvLZw2dYMSVNZalQq5MO689B
+pcFF9M4CB0IRG+fSf7EkvTrlHnv9euhWAtucs6BITWPdtUORKl/jVcUme+QFBO/n
+usVKVr0G0IJrz3Db0IVAC7I0uFttuANX0oc0Z3C1J9RukGapYbKDQF9RizdiqFPP
+q/o700sDTnAroib1q3bDqOSrg0ewuJKpgUxLSiQ+GoZMX/8zWKMsadyguBvQl4fi
+RSso075/WpzjjkHgZ/TRv/hX4cBpXJLK12yv4P6mEHlwp+FXmH/KRqsyQQaQouUZ
+iD8tUK1hAsPB8xYrIZNSbLqsNHjLjtXsFsJU+7jSntVX2XB1nvyaoE8XNKudGoWN
+xbUDaBmFozvK5uBRBFogNZuw+8kCYcVi8iuIHrQMjWwL4zq7CpLxQCKfYlhXasIM
+p+ggwKewfOA10g5QvYCcqcFtWkIsF9dxOSkfJFY31CMQkxHKc5MF1LsGTRv5HIAm
+rb3XAztlmQ0936Zp8+h9DDLV5LF17oiKDYQygHFcYDgBudH78bwYw8hZ2Nkr52v6
+6fHCMGUMfkC8IYP0jVokqS27Aw6IKKlCisJqnGxpXC7Nb/8LNDCKBTNpIKeENARK
+Xz9msd6s3gjC9ug2Ea3mrPDNmVnTkdvrLTtA0klCrxZgWml0BOjoEyB75BCe2fZ9
+4VRmJHKDuQINBFLoZCgBEADGR4Xgf1j5Of7pwIzpMgz/HZxwjxibW+EC+ALwMicJ
+BoxTmNp5GZ41Rle7frNGRe4R3fUbpdDI9nODFREezNnTFCPYMA1B2U7hxxlcyH1N
+rRYkkbeSWBNVgBIZ0rBnXI1qrZjONrpTLsHX3GdAShzpYu5zyt2a7tSMhmkwzidt
+jmWYt3BqOH4C/CYOqUnZJhzZ44+LXT68+AcL+rqWo+cTOSDlmrvs9yJCFm4Y75A+
+fd+raUZ8OhhmvHAA+IiRnHG9NrqprhVu+J4xSulfkyF8ziXl3HMC6aeHVS1F8UO+
+jg7nAmgyDi6IuJznZB01KCplVDE9E/8neZfF5WMzti7DiVvkrwf4YoOcsl9tkda7
+iH/ka03ZLdMYELss+lmgLnVDWDdrrJWTAY4rXEWx4UE2O03yPVKwp1Dq8eJazJrv
+ECDTN1U464FvSmO2Xrj7gUphOPSW2IjUYOBkFB9mMlwRKt0gDvre3M9Ix0IOKCo7
+ELqalW92rSb3+eTZVen1WoCTFBWWwSPXjsDixzJjuKOCuLIieMCt63Eng2d+cCIj
+ymJ744efKeRJaNvF2iXBCJfQGEixlG1H4KSTjBnKGDWi0clijpJQJfJRnMLRLjP8
+aA5RVzwsARZ91YQp6SKu3zFP+Z8/XwhbeeDlsmkbQ8aoRcXhdhs/pMJ02A8C6k2T
+pQARAQABiQIfBBgBCAAJBQJS6GQoAhsgAAoJENNvdpvBGATwSx4P/0lbTys+j9AM
+UEfEYjcG+C8lsqrqnK9u1bjDAQBNldg7IzeUIeQlZZF8d2RDemtxnMzs0B4MMEPK
+AgAltWfkezk12g1vroo1m2fKxSWEDq7pyUhRlBeggFLDWagyushIHrAXhcNvyf5n
+03EZ4n8EZ03ejxN+6IWxViV14t0KuzccKPYTwLhlbNQN8YB1k0Y6ezZd8gpX4+e2
+K3WD83mxpFmhhNsGqvbLsuJfXdPcWrAYpFgBF04qvYmgSdPeSid68k3Mek0eQyFj
+gCBA0RktKaLVWEslAXyzG1iVzTydabhFQrfA1/GMVJwDgN9HjhzZecerg88KiY03
+pI5dNuzQZnt0Cs0oPcL409ZYBCiv4b6JwLxMaPAAkruqp75Eb3RRzvM8netevnt2
+lMSYDR8Kt1TjPfPWH64vuSLoJ0ihSEHd4G92CN5xYVYOwBrwokJy2rj/Gaz9fZHn
+xOaFtWtkR9hytlqsz4qpZ71dKgsZ5LxXETygRQ0RSbMT5uKIMhRbSbOVB3gE8gwU
+rhWObwGL2WVaSDEM4SyaJEWyHy6+38ir7QhVTDcHQRoU0/N0Acy1AsltoJUIiaqU
+TdWxjplUY0GFt0OQINvEdhWtEBe4ATFK/17BKLxKk22kVbx0fMd0mR939AYIbwNi
+dWWyjlhmVl4Uqre/7WqbsR7nT9Sd+fbIuQENBFUa+BEBCACrJ+CRz1mNqq0Qcofc
++4h9PzMBLApwGNQySQ5QCMtIu5Iz4rTT305iFFQSBFzKQSNPjm7pkAzMMs+CWaD8
+0gazgiO8yvm1Fa00hGJWCxr5dbp9/w8u1hfXUSMVg6mf+D09iBLMa2a4pNJcafvp
+1/Edk7VAG0q7WrhIBErHclWSh6T05jIjS81ydeO6mp8At8Vkw2oEM1RGnBGYCIq4
+pPhKkQsBDRcz3h1BSrv5uPGyBvXVBJZ4n38m3iETG8jHFPS5OiHSzU4j9Q4nVutb
+Wk26l33VObkd4NYru95UsQ2ZGETBCW5tkLwugW7A8D2mQkTQsRLv9KO0hudY0HqX
+uh3pABEBAAGJA0QEGAEIAA8CGwIFAlc0FXQFCQMGa2MBKcBdIAQZAQgABgUCVRr4
+EQAKCRDy+VlWlQ2Bo19UCACAVs9F065EDpeZJcH1ep6dzS/qdctES0qDl6F+CVOj
+v9iCTs1OkpZ9Y8gOazEfeCT5tXylyr82RV28CImAKER8tIhAi9Bvss9abXihoKpL
+t8en97QTBIveZ+4MXwzbJGljIuZ/Ytfz33o8T4Ojd4QLPuLq75uESnum3KcoF3LA
+MUCrpsoKsggp2VQHtFxgFsSd3GjIJBy+efexz5F+uM8Q1BrkZh2kwq9NZ3QdG2Kq
+wTVTMI6MIty5UV4re1v25VrmbCrHmWtWw2aY90HWikfMQuF0n+PWyRI1dhNaFvG7
+SeMXCgdOEvhYzbQ/HBePrrV+G4fjeODu70mZZZIecDC9CRDTb3abwRgE8D0CD/0S
+gvkU/3GJR1ntplro3/uzZ0fcZL/Ea7ydSEGpsZVJq/nH64BDXQZSZ7UJotQdAlQ6
+f72/V3r57Aix2rtF90Vu6olUtBdYEkadaSMTVkI8jjHvWeRs8iY8iOIdflikzF6b
+92nGxckjSAUL6GYTnxWizw39s20K6cO4zOC/0CDhjzvtmoA0OinkWUbjWMWf9pLP
+3KKfD7p+hrUzO4GrPx7mwNoj6uA1KUVynQSGa0V6OXUGjQ3ey7xDL2a32dF9PI8e
+UMAW4klzxX9Kbcam+NxiHtTAjMBBQ0Xt0j6irJPmsmxm8pa/D+4SlEDjsQU2q6eE
+UwPvKBtxdS1N1AdZWqMlQSHnGNOWkljMi9nrhyHAXgeJjbnIFryHW4/+aBLccdaL
+mnMwetaDRDj8EmPDZTiNHQUDCCFYoZ+Kc76kGd4UadxpW3LOg8sjmn3MYdiXXRQs
+/2p+Q6iFACuVSxnCz12sumynfHWiQwVGAd1FBuIgb7FuxX6FOLaybew/IMg5RzuD
+y9fI7Z3yHtHUcMZhhQaQvkiebbZcQlZhkZIX6Uk8csCBcClFrH9wG4NU2Jr+25oa
+nHoyj2c+ABd5mZ6P90UC80xSllOoH5DkCeRUBKuAZG0g+g64QKWTjwSxfY6sFd+h
+210NTXaQ9iRPNVNv8cjHY0HHPzw9mQBi5CojnSgyLrkBDQRVGvi/AQgAryab03tW
+ugiN40UYPEASlLcR0e01ZAwrESMwCexNejebacke6fk1v4pEebBvm0fu/8GeIY78
+ley9CBIoDOHzTTQMWXUBMtG5vxPzUgP5U/R0CWvXF9PgyrCOsWQjORqfIfUctQ2Q
+KjaSEi3jt0U9gVM84Dtj/SlyfZyJvuTy15Q3mNLEA2hiEkLCYS77+tUaXeCFl5en
+p2mQgBSrfnmzfCckuwa0nbmo4p6V0yreX6939c9zakMxzvWCh/SlZUyLgRkH5FOk
+gb3Of6lR0DHkNG9uJOMEr+f6XCbwYPDTU6EZumyVQ2WW98s0uIIU0Qmbc/EnpnYc
+zlbbdNS8C8aq8QARAQABiQIlBBgBCAAPAhsMBQJXNBWHBQkDBmrIAAoJENNvdpvB
+GATwTaMQAIumhk7daTsZ0XFfDszHwiig+Kw46KpWoCm0zZn9rPxYbU+s8+qe2E/W
+G4HxdwwKDMjBajsEzHgjj/p02et5LGZMKN+TT2sZX0oYhVLS8/BLrXW4Nhq9+qL1
+uGUTOcctR3ebsqNTFpevtqD4jD7galFv38BIa0G8M6YdKiH5kFzWfz760L03jdNn
+HmnnG+x/S/5+uHj5ClpRjhzskS5Bn1gWAqvARcbst/jfwXV43o5Pprno3kfNkWEA
+QYVLlOY8+i4JP0xBlx7sYN+s9FE00vYZWdABKis9+OoD4qnhxVE6EbHhfoW0pFei
+osDr3/iWfWP1Bcrv2EPO23R7etRf5p7ERKt0p1qYPAiAJuLKzvuAreVdBszYRJSo
+zM8Ka+t2Be95HDSBhonI+n2ec8J2IS/dfnUOXwg+MNMcX5jOyxo0RMkhKu8+4iN3
+ECB2+zA8OQswDklU3OfGlWwHKwbgcAicuj6yHQqpyheuRsNHq1wCTbkDYoGoI0mV
+PNl5ZjIC1RhnEzfdXww6lZ//P9KuZm9oyhaRVKhEzRP/X8Py8Q78kcnFenF0MsEg
+2LB3+NMIdzFRG1rjHLYuxUD28jHVx/i6LDIVVVuNZXGupZD3m2akgnCoTQdnjmob
+f8VjXorvasXo5vDJWTGegQbq0vI6RmJ2fnIVj4W/H6bW8gU4GFdruQENBFUbKLcB
+CACwhMqbwVAiwY2NvYvSuzyPAojv7DhTEsuSvyEhLoWUUs+HvkTc6yV3OEikM4/5
+ztfv5s8PFBBzi4i0WdSa4DivBe3rCyv4KUN7TFSZzTpAh/bCYBCXaU/hWAzRn1pX
+JrRA8dkt4KXcTzkCJV1yuwcGOojMdmU64orSgZAwykf2dc/mUkSM1pMPD2ZwC0Uc
+0zm0e6gfndJu2p3O1pUgKRciJe+eKlvhXTg0l8/hKH8KvUnlWrFePTbQ/zWQq4YC
+lNI1rUo2Gf6zJBCwhe1Bata8dqtIpagiMCegr8069Mts9V2H2SdMIPNyWP6CP5ON
+UfESWt+AYZHMEFAsoJJrK/YXABEBAAGJAiUEGAEIAA8CGyAFAlc0FZsFCQMGOuQA
+CgkQ0292m8EYBPCanA//aA+ByDFR/JyzsWnFXwgkcR6CYRqYwq4cxIoL97RGIAdn
+ZFyqWAMr0TGofFrcy0U2yHKUPa6ia0QI64Lq+SzibmmVqSqq5u+d/b6ZfgvBgN6o
+FGwSAlwJwgXi0sK/jC+RYzw9oLWvOd+KTtKG4spNoHYKkP/Hwka9gieuuyg1hjB+
+gi1b3RKKsXB7/Q0E7lkO/UqxZqyP7gCa7bYMhfrC8Y7HSsJ5QtGy9VBf4b+U4PEK
+FLYV4SZHh7LYlQaxSgzXarH+0u2Rrds+Kfwxwxs0k7fl7gCPj7gBhzErEcFYqhmg
+NGgjrxA9Zw+HXmvtdRRWBU8l/L4DPNRW4SeBkNJUAa6SfJ9fMhflzV0lx+AlP/XN
+Ftv2HJ7jbwUDq3vAK/dLKINrAMYOgG16pQY7HRicP63//BXqq7Sh5cbr/uvAN+aK
+YYoOaIo3KjMxhev2MLENS9BuN1ACUVqWO9aXJ1VmVoroiyLxFjrxOEEGNQY7Vws1
+Slzhvb504g9Uo+cBy9HsXYh5BXZeaqra1qbMerN/WJPOCfQENE2g8jj9x4Mi4mZo
+1gmiwCZiD+KvXfmwtZsvrLaV9FAnWDkJu8w/8yFUWeNVuvW0t5xXcZNv/Nwb2ONO
+vsF9NoZ1s0BZ++jraVFCtbO0yETBj4YBP0T5aFKBM3zUE6HGz3E3xgx1w0dAg4c=
+=oRMW
+-----END PGP PUBLIC KEY BLOCK-----
diff --git a/debian/uuid-dev.README.Debian b/debian/uuid-dev.README.Debian
index 3d8cc89..a4f047e 100644
--- a/debian/uuid-dev.README.Debian
+++ b/debian/uuid-dev.README.Debian
@@ -1,5 +1,5 @@
 
-In order to santize e2fsprogs to be DFSG free, the file
+In order to sanitize e2fsprogs to be DFSG free, the file
 draft-leach-uuids-guids-01.txt has been removed.  It can be obtained
 by downloading e2fsprogs from the upstream sources.  It may also be
 available from other sites on the network, if you do a quick web
@@ -16,7 +16,7 @@
 purity shouldn't be denied to Ubuntu users.
 
 					Theodore Ts'o
-					Ocotober 3, 2006
+					October 3, 2006
 
 
 
diff --git a/debian/uuid-dev.files.in b/debian/uuid-dev.install
similarity index 100%
rename from debian/uuid-dev.files.in
rename to debian/uuid-dev.install
diff --git a/debian/uuid-runtime.files b/debian/uuid-runtime.install
similarity index 100%
rename from debian/uuid-runtime.files
rename to debian/uuid-runtime.install
diff --git a/debian/watch b/debian/watch
index 96f61d3..f2df3dd 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,4 +1,5 @@
-version=3
-http://sf.net/e2fsprogs/e2fsprogs-([0-9].+)\.tar\.gz
+version=4
+opts="pgpsigurlmangle=s%$%.asc%" \
+	http://sf.net/e2fsprogs/e2fsprogs-([0-9].+)\.tar\.gz
 #ftp://ftp.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/e2fsprogs-([0-9].+)\.tar\.gz
 
diff --git a/debugfs/Android.bp b/debugfs/Android.bp
new file mode 100644
index 0000000..b9f299b
--- /dev/null
+++ b/debugfs/Android.bp
@@ -0,0 +1,73 @@
+// Copyright 2017 The Android Open Source Project
+
+//########################
+// Build the debugfs binary
+
+cc_defaults {
+    name: "debugfs-defaults",
+    defaults: ["e2fsprogs-defaults"],
+    srcs: [
+        "debug_cmds.c",
+        "debugfs.c",
+        "util.c",
+        "ncheck.c",
+        "icheck.c",
+        "ls.c",
+        "lsdel.c",
+        "dump.c",
+        "set_fields.c",
+        "logdump.c",
+        "htree.c",
+        "unused.c",
+        "e2freefrag.c",
+        "filefrag.c",
+        "extent_cmds.c",
+        "extent_inode.c",
+        "zap.c",
+        "quota.c",
+        "xattrs.c",
+        "journal.c",
+        "revoke.c",
+        "recovery.c",
+        "do_journal.c",
+    ],
+    cflags: [
+        "-Wno-unused-variable",
+        "-fno-strict-aliasing",
+        "-DDEBUGFS",
+    ],
+    include_dirs: [
+        "external/e2fsprogs/misc",
+        "external/e2fsprogs/e2fsck"
+    ],
+}
+
+debugfs_libs = [
+    "libext2_misc",
+    "libext2fs",
+    "libext2_blkid",
+    "libext2_uuid",
+    "libext2_ss",
+    "libext2_quota",
+    "libext2_com_err",
+    "libext2_e2p",
+    "libext2_support",
+]
+
+cc_binary {
+    name: "debugfs",
+    host_supported: true,
+    defaults: ["debugfs-defaults"],
+
+    shared_libs: debugfs_libs,
+    system_shared_libs: ["libc", "libdl"],
+}
+
+cc_binary {
+    name: "debugfs_static",
+    static_executable: true,
+    host_supported: true,
+    defaults: ["debugfs-defaults"],
+
+    static_libs: debugfs_libs,
+}
diff --git a/debugfs/Makefile.in b/debugfs/Makefile.in
index bf037e0..ed4ea8d 100644
--- a/debugfs/Makefile.in
+++ b/debugfs/Makefile.in
@@ -8,43 +8,55 @@
 top_builddir = ..
 my_dir = debugfs
 INSTALL = @INSTALL@
+MKDIR_P = @MKDIR_P@
 
 @MCONFIG@
 
 PROGS=		debugfs
 MANPAGES=	debugfs.8
 
-MK_CMDS=	_SS_DIR_OVERRIDE=../lib/ss ../lib/ss/mk_cmds
+MK_CMDS=	_SS_DIR_OVERRIDE=$(srcdir)/../lib/ss ../lib/ss/mk_cmds
 
 DEBUG_OBJS= debug_cmds.o debugfs.o util.o ncheck.o icheck.o ls.o \
 	lsdel.o dump.o set_fields.o logdump.o htree.o unused.o e2freefrag.o \
-	filefrag.o extent_cmds.o extent_inode.o zap.o
+	filefrag.o extent_cmds.o extent_inode.o zap.o create_inode.o \
+	quota.o xattrs.o journal.o revoke.o recovery.o do_journal.o
 
 RO_DEBUG_OBJS= ro_debug_cmds.o ro_debugfs.o util.o ncheck.o icheck.o ls.o \
 	lsdel.o logdump.o htree.o e2freefrag.o filefrag.o extent_cmds.o \
-	extent_inode.o
+	extent_inode.o quota.o xattrs.o
 
 SRCS= debug_cmds.c $(srcdir)/debugfs.c $(srcdir)/util.c $(srcdir)/ls.c \
 	$(srcdir)/ncheck.c $(srcdir)/icheck.c $(srcdir)/lsdel.c \
 	$(srcdir)/dump.c $(srcdir)/set_fields.c ${srcdir}/logdump.c \
 	$(srcdir)/htree.c $(srcdir)/unused.c ${srcdir}/../misc/e2freefrag.c \
-	$(srcdir)/filefrag.c $(srcdir)/extent_inode.c $(srcdir)/zap.c
+	$(srcdir)/filefrag.c $(srcdir)/extent_inode.c $(srcdir)/zap.c \
+	$(srcdir)/../misc/create_inode.c $(srcdir)/xattrs.c $(srcdir)/quota.c \
+	$(srcdir)/journal.c $(srcdir)/../e2fsck/revoke.c \
+	$(srcdir)/../e2fsck/recovery.c $(srcdir)/do_journal.c
 
-LIBS= $(LIBEXT2FS) $(LIBE2P) $(LIBSS) $(LIBCOM_ERR) $(LIBBLKID) \
-	$(LIBUUID)
-DEPLIBS= $(LIBEXT2FS) $(LIBE2P) $(DEPLIBSS) $(DEPLIBCOM_ERR) \
+LIBS= $(LIBSUPPORT) $(LIBEXT2FS) $(LIBE2P) $(LIBSS) $(LIBCOM_ERR) $(LIBBLKID) \
+	$(LIBUUID) $(LIBMAGIC) $(SYSLIBS)
+DEPLIBS= $(DEPLIBSUPPORT) $(LIBEXT2FS) $(LIBE2P) $(DEPLIBSS) $(DEPLIBCOM_ERR) \
 	$(DEPLIBBLKID) $(DEPLIBUUID)
 
-STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBSS) $(STATIC_LIBCOM_ERR) \
-	$(STATIC_LIBBLKID) $(STATIC_LIBUUID) $(STATIC_LIBE2P)
+STATIC_LIBS= $(STATIC_LIBSUPPORT) $(STATIC_LIBEXT2FS) $(STATIC_LIBSS) \
+	$(STATIC_LIBCOM_ERR) $(STATIC_LIBBLKID) $(STATIC_LIBUUID) \
+	$(STATIC_LIBE2P) $(LIBMAGIC) $(SYSLIBS)
 STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBSS) \
 		$(DEPSTATIC_LIBCOM_ERR) $(DEPSTATIC_LIBUUID) \
 		$(DEPSTATIC_LIBE2P)
 
+# This nastiness is needed because of jfs_user.h hackery; when we finally
+# clean up this mess, we should be able to drop it
+LOCAL_CFLAGS = -I$(srcdir)/../e2fsck -DDEBUGFS
+DEPEND_CFLAGS = -I$(srcdir)
+
 .c.o:
 	$(E) "	CC $<"
 	$(Q) $(CC) -c $(ALL_CFLAGS) $< -o $@
 	$(Q) $(CHECK_CMD) $(ALL_CFLAGS) $<
+	$(Q) $(CPPCHECK_CMD) $(CPPFLAGS) $<
 
 all:: $(PROGS) $(MANPAGES)
 
@@ -57,6 +69,11 @@
 	$(Q) $(CC) $(LDFLAGS_STATIC) -o debugfs.static $(DEBUG_OBJS) \
 		$(STATIC_LIBS) $(READLINE_LIB)
 
+debugfs.static-libs: $(DEBUG_OBJS) $(STATIC_DEPLIBS)
+	$(E) "	LD $@"
+	$(Q) $(CC) -o debugfs.static-libs $(DEBUG_OBJS) \
+		$(STATIC_LIBS) $(READLINE_LIB)
+
 rdebugfs: $(RO_DEBUG_OBJS) $(DEPLIBS)
 	$(E) "	LD $@"
 	$(Q) $(CC) $(ALL_LDFLAGS) -o rdebugfs $(RO_DEBUG_OBJS) $(LIBS)
@@ -79,15 +96,30 @@
 
 e2freefrag.o: $(srcdir)/../misc/e2freefrag.c
 	$(E) "	CC $@"
-	$(Q) $(CC) -c $(ALL_CFLAGS) -I$(srcdir) $< -DDEBUGFS -o $@
+	$(Q) $(CC) -c $(ALL_CFLAGS) -I$(srcdir) $< -o $@
+
+recovery.o: $(srcdir)/../e2fsck/recovery.c
+	$(E) "	CC $@"
+	$(Q) $(CC) -c $(ALL_CFLAGS) -I$(srcdir) \
+		$(srcdir)/../e2fsck/recovery.c -o $@
+
+revoke.o: $(srcdir)/../e2fsck/revoke.c
+	$(E) "	CC $@"
+	$(Q) $(CC) -c $(ALL_CFLAGS) -I$(srcdir) \
+		$(srcdir)/../e2fsck/revoke.c -o $@
+
+create_inode.o: $(srcdir)/../misc/create_inode.c
+	$(E) "	CC $@"
+	$(Q) $(CC) -c $(ALL_CFLAGS) -I$(srcdir) \
+		 $(srcdir)/../misc/create_inode.c -o $@
 
 debugfs.8: $(DEP_SUBSTITUTE) $(srcdir)/debugfs.8.in
 	$(E) "	SUBST $@"
 	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/debugfs.8.in debugfs.8
 
 installdirs:
-	$(E) "	MKINSTALLDIRS $(root_sbindir) $(man8dir)"
-	$(Q) $(MKINSTALLDIRS) $(DESTDIR)$(root_sbindir) \
+	$(E) "	MKDIR_P $(root_sbindir) $(man8dir)"
+	$(Q) $(MKDIR_P) $(DESTDIR)$(root_sbindir) \
 		$(DESTDIR)$(man8dir)
 
 install: $(PROGS) $(MANPAGES) installdirs
@@ -117,14 +149,24 @@
 		$(RM) -f $(DESTDIR)$(man8dir)/$$i; \
 	done
 
-clean:
+clean::
 	$(RM) -f $(PROGS) debugfs.8 \#* *.s *.o *.a *~ debug_cmds.c \
-		extent_cmds.c ro_debug_cmds.c core rdebugfs debugfs.static
+		extent_cmds.c ro_debug_cmds.c core rdebugfs debugfs.static \
+		debugfs.static-libs tst_set_fields
 
 mostlyclean: clean
 distclean: clean
 	$(RM) -f debug_cmds.c .depend Makefile $(srcdir)/TAGS \
-		$(srcdir)/Makefile.in.old
+		$(srcdir)/Makefile.in.old $(srcdir)/recovery.c \
+		$(srcdir)/revoke.c
+
+tst_set_fields: set_fields.c util.c
+	$(E) "  LD $@"
+	$(Q) $(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(SYSLIBS) -DUNITTEST \
+		-o tst_set_fields $(srcdir)/set_fields.c $(srcdir)/util.c $(LIBS)
+
+fullcheck check:: tst_set_fields
+	$(TESTENV) ./tst_set_fields
 
 # +++ Dependency line eater +++
 # 
@@ -133,76 +175,250 @@
 #
 debug_cmds.o: debug_cmds.c $(top_srcdir)/lib/ss/ss.h \
  $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
-debugfs.o: $(srcdir)/debugfs.c $(top_srcdir)/lib/et/com_err.h \
- $(top_srcdir)/lib/ss/ss.h $(top_builddir)/lib/ss/ss_err.h \
+debugfs.o: $(srcdir)/debugfs.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h $(top_srcdir)/version.h \
+ $(srcdir)/../e2fsck/jfs_user.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
+ $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
+ $(top_srcdir)/lib/ext2fs/compiler.h $(top_srcdir)/lib/support/plausible.h
+util.o: $(srcdir)/util.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
  $(srcdir)/debugfs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
  $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
  $(top_srcdir)/lib/ext2fs/ext3_extents.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
  $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
- $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/version.h $(srcdir)/jfs_user.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/ext2fs/kernel-list.h
-util.o: $(srcdir)/util.c $(srcdir)/debugfs.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+ls.o: $(srcdir)/ls.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
- $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
- $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
-ls.o: $(srcdir)/ls.c $(srcdir)/debugfs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+ncheck.o: $(srcdir)/ncheck.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+icheck.o: $(srcdir)/icheck.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+lsdel.o: $(srcdir)/lsdel.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+dump.o: $(srcdir)/dump.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+set_fields.o: $(srcdir)/set_fields.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+logdump.o: $(srcdir)/logdump.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h $(srcdir)/../e2fsck/jfs_user.h \
+ $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
+ $(top_srcdir)/lib/ext2fs/kernel-list.h $(top_srcdir)/lib/ext2fs/compiler.h \
+ $(top_srcdir)/lib/ext2fs/fast_commit.h
+htree.o: $(srcdir)/htree.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+unused.o: $(srcdir)/unused.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+e2freefrag.o: $(srcdir)/../misc/e2freefrag.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
  $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
  $(top_srcdir)/lib/ext2fs/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
-ncheck.o: $(srcdir)/ncheck.c $(srcdir)/debugfs.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/e2freefrag.h \
+ $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+filefrag.o: $(srcdir)/filefrag.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+extent_inode.o: $(srcdir)/extent_inode.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+zap.o: $(srcdir)/zap.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+create_inode.o: $(srcdir)/../misc/create_inode.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
+ $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
+ $(top_srcdir)/lib/ext2fs/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/fiemap.h \
+ $(srcdir)/../misc/create_inode.h $(top_srcdir)/lib/e2p/e2p.h \
+ $(top_srcdir)/lib/support/nls-enable.h
+xattrs.o: $(srcdir)/xattrs.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/support/cstring.h \
+ $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+quota.o: $(srcdir)/quota.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h
+journal.o: $(srcdir)/journal.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/journal.h \
+ $(srcdir)/../e2fsck/jfs_user.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
+ $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
+ $(top_srcdir)/lib/ext2fs/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
+ $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
+ $(top_srcdir)/lib/ext2fs/compiler.h
+revoke.o: $(srcdir)/../e2fsck/revoke.c $(srcdir)/../e2fsck/jfs_user.h \
  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
  $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
  $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
-icheck.o: $(srcdir)/icheck.c $(srcdir)/debugfs.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
+ $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
+ $(top_srcdir)/lib/ext2fs/compiler.h
+recovery.o: $(srcdir)/../e2fsck/recovery.c $(srcdir)/../e2fsck/jfs_user.h \
  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
  $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
  $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
-lsdel.o: $(srcdir)/lsdel.c $(srcdir)/debugfs.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
+ $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
+ $(top_srcdir)/lib/ext2fs/compiler.h
+do_journal.o: $(srcdir)/do_journal.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
- $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
- $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
-dump.o: $(srcdir)/dump.c $(srcdir)/debugfs.h \
- $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
- $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
- $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
-set_fields.o: $(srcdir)/set_fields.c $(srcdir)/debugfs.h \
- $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
- $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
- $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
- $(top_srcdir)/lib/e2p/e2p.h
-logdump.o: $(srcdir)/logdump.c $(srcdir)/debugfs.h \
- $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
- $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
- $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
- $(srcdir)/jfs_user.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
- $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h
-htree.o: $(srcdir)/htree.c $(srcdir)/debugfs.h \
- $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
- $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
- $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
- $(top_srcdir)/lib/e2p/e2p.h
-unused.o: $(srcdir)/unused.c $(srcdir)/debugfs.h \
- $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
- $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \
- $(top_builddir)/lib/ext2fs/ext2_err.h \
- $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h
+ $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \
+ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/../misc/create_inode.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/support/quotaio.h \
+ $(top_srcdir)/lib/support/dqblk_v2.h \
+ $(top_srcdir)/lib/support/quotaio_tree.h \
+ $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
+ $(top_srcdir)/lib/ext2fs/kernel-list.h $(top_srcdir)/lib/ext2fs/compiler.h \
+ $(srcdir)/journal.h $(srcdir)/../e2fsck/jfs_user.h
diff --git a/debugfs/debug_cmds.c b/debugfs/debug_cmds.c
new file mode 100644
index 0000000..385d6e0
--- /dev/null
+++ b/debugfs/debug_cmds.c
@@ -0,0 +1,724 @@
+/* ./debug_cmds.c - automatically generated from ./debug_cmds.ct */
+#include <ss/ss.h>
+
+static char const * const ssu00001[] = {
+"show_debugfs_params",
+    "params",
+    (char const *)0
+};
+extern void do_show_debugfs_params __SS_PROTO;
+static char const * const ssu00002[] = {
+"open_filesys",
+    "open",
+    (char const *)0
+};
+extern void do_open_filesys __SS_PROTO;
+static char const * const ssu00003[] = {
+"close_filesys",
+    "close",
+    (char const *)0
+};
+extern void do_close_filesys __SS_PROTO;
+static char const * const ssu00004[] = {
+"freefrag",
+    "e2freefrag",
+    (char const *)0
+};
+extern void do_freefrag __SS_PROTO;
+static char const * const ssu00005[] = {
+"feature",
+    "features",
+    (char const *)0
+};
+extern void do_features __SS_PROTO;
+static char const * const ssu00006[] = {
+"dirty_filesys",
+    "dirty",
+    (char const *)0
+};
+extern void do_dirty_filesys __SS_PROTO;
+static char const * const ssu00007[] = {
+"init_filesys",
+    (char const *)0
+};
+extern void do_init_filesys __SS_PROTO;
+static char const * const ssu00008[] = {
+"show_super_stats",
+    "stats",
+    (char const *)0
+};
+extern void do_show_super_stats __SS_PROTO;
+static char const * const ssu00009[] = {
+"ncheck",
+    (char const *)0
+};
+extern void do_ncheck __SS_PROTO;
+static char const * const ssu00010[] = {
+"icheck",
+    (char const *)0
+};
+extern void do_icheck __SS_PROTO;
+static char const * const ssu00011[] = {
+"change_root_directory",
+    "chroot",
+    (char const *)0
+};
+extern void do_chroot __SS_PROTO;
+static char const * const ssu00012[] = {
+"change_working_directory",
+    "cd",
+    (char const *)0
+};
+extern void do_change_working_dir __SS_PROTO;
+static char const * const ssu00013[] = {
+"list_directory",
+    "ls",
+    (char const *)0
+};
+extern void do_list_dir __SS_PROTO;
+static char const * const ssu00014[] = {
+"show_inode_info",
+    "stat",
+    (char const *)0
+};
+extern void do_stat __SS_PROTO;
+static char const * const ssu00015[] = {
+"dump_extents",
+    "extents",
+    "ex",
+    (char const *)0
+};
+extern void do_dump_extents __SS_PROTO;
+static char const * const ssu00016[] = {
+"blocks",
+    (char const *)0
+};
+extern void do_blocks __SS_PROTO;
+static char const * const ssu00017[] = {
+"filefrag",
+    (char const *)0
+};
+extern void do_filefrag __SS_PROTO;
+static char const * const ssu00018[] = {
+"link",
+    "ln",
+    (char const *)0
+};
+extern void do_link __SS_PROTO;
+static char const * const ssu00019[] = {
+"unlink",
+    (char const *)0
+};
+extern void do_unlink __SS_PROTO;
+static char const * const ssu00020[] = {
+"mkdir",
+    (char const *)0
+};
+extern void do_mkdir __SS_PROTO;
+static char const * const ssu00021[] = {
+"rmdir",
+    (char const *)0
+};
+extern void do_rmdir __SS_PROTO;
+static char const * const ssu00022[] = {
+"rm",
+    (char const *)0
+};
+extern void do_rm __SS_PROTO;
+static char const * const ssu00023[] = {
+"kill_file",
+    (char const *)0
+};
+extern void do_kill_file __SS_PROTO;
+static char const * const ssu00024[] = {
+"copy_inode",
+    (char const *)0
+};
+extern void do_copy_inode __SS_PROTO;
+static char const * const ssu00025[] = {
+"clri",
+    (char const *)0
+};
+extern void do_clri __SS_PROTO;
+static char const * const ssu00026[] = {
+"freei",
+    (char const *)0
+};
+extern void do_freei __SS_PROTO;
+static char const * const ssu00027[] = {
+"seti",
+    (char const *)0
+};
+extern void do_seti __SS_PROTO;
+static char const * const ssu00028[] = {
+"testi",
+    (char const *)0
+};
+extern void do_testi __SS_PROTO;
+static char const * const ssu00029[] = {
+"freeb",
+    (char const *)0
+};
+extern void do_freeb __SS_PROTO;
+static char const * const ssu00030[] = {
+"setb",
+    (char const *)0
+};
+extern void do_setb __SS_PROTO;
+static char const * const ssu00031[] = {
+"testb",
+    (char const *)0
+};
+extern void do_testb __SS_PROTO;
+static char const * const ssu00032[] = {
+"modify_inode",
+    "mi",
+    (char const *)0
+};
+extern void do_modify_inode __SS_PROTO;
+static char const * const ssu00033[] = {
+"find_free_block",
+    "ffb",
+    (char const *)0
+};
+extern void do_find_free_block __SS_PROTO;
+static char const * const ssu00034[] = {
+"find_free_inode",
+    "ffi",
+    (char const *)0
+};
+extern void do_find_free_inode __SS_PROTO;
+static char const * const ssu00035[] = {
+"print_working_directory",
+    "pwd",
+    (char const *)0
+};
+extern void do_print_working_directory __SS_PROTO;
+static char const * const ssu00036[] = {
+"expand_dir",
+    "expand",
+    (char const *)0
+};
+extern void do_expand_dir __SS_PROTO;
+static char const * const ssu00037[] = {
+"mknod",
+    (char const *)0
+};
+extern void do_mknod __SS_PROTO;
+static char const * const ssu00038[] = {
+"list_deleted_inodes",
+    "lsdel",
+    (char const *)0
+};
+extern void do_lsdel __SS_PROTO;
+static char const * const ssu00039[] = {
+"undelete",
+    "undel",
+    (char const *)0
+};
+extern void do_undel __SS_PROTO;
+static char const * const ssu00040[] = {
+"write",
+    (char const *)0
+};
+extern void do_write __SS_PROTO;
+static char const * const ssu00041[] = {
+"dump_inode",
+    "dump",
+    (char const *)0
+};
+extern void do_dump __SS_PROTO;
+static char const * const ssu00042[] = {
+"cat",
+    (char const *)0
+};
+extern void do_cat __SS_PROTO;
+static char const * const ssu00043[] = {
+"lcd",
+    (char const *)0
+};
+extern void do_lcd __SS_PROTO;
+static char const * const ssu00044[] = {
+"rdump",
+    (char const *)0
+};
+extern void do_rdump __SS_PROTO;
+static char const * const ssu00045[] = {
+"set_super_value",
+    "ssv",
+    (char const *)0
+};
+extern void do_set_super __SS_PROTO;
+static char const * const ssu00046[] = {
+"set_inode_field",
+    "sif",
+    (char const *)0
+};
+extern void do_set_inode __SS_PROTO;
+static char const * const ssu00047[] = {
+"set_block_group",
+    "set_bg",
+    (char const *)0
+};
+extern void do_set_block_group_descriptor __SS_PROTO;
+static char const * const ssu00048[] = {
+"logdump",
+    (char const *)0
+};
+extern void do_logdump __SS_PROTO;
+static char const * const ssu00049[] = {
+"htree_dump",
+    "htree",
+    (char const *)0
+};
+extern void do_htree_dump __SS_PROTO;
+static char const * const ssu00050[] = {
+"dx_hash",
+    "hash",
+    (char const *)0
+};
+extern void do_dx_hash __SS_PROTO;
+static char const * const ssu00051[] = {
+"dirsearch",
+    (char const *)0
+};
+extern void do_dirsearch __SS_PROTO;
+static char const * const ssu00052[] = {
+"bmap",
+    (char const *)0
+};
+extern void do_bmap __SS_PROTO;
+static char const * const ssu00053[] = {
+"fallocate",
+    (char const *)0
+};
+extern void do_fallocate __SS_PROTO;
+static char const * const ssu00054[] = {
+"punch",
+    "truncate",
+    (char const *)0
+};
+extern void do_punch __SS_PROTO;
+static char const * const ssu00055[] = {
+"symlink",
+    (char const *)0
+};
+extern void do_symlink __SS_PROTO;
+static char const * const ssu00056[] = {
+"imap",
+    (char const *)0
+};
+extern void do_imap __SS_PROTO;
+static char const * const ssu00057[] = {
+"dump_unused",
+    (char const *)0
+};
+extern void do_dump_unused __SS_PROTO;
+static char const * const ssu00058[] = {
+"set_current_time",
+    (char const *)0
+};
+extern void do_set_current_time __SS_PROTO;
+static char const * const ssu00059[] = {
+"supported_features",
+    (char const *)0
+};
+extern void do_supported_features __SS_PROTO;
+static char const * const ssu00060[] = {
+"dump_mmp",
+    (char const *)0
+};
+extern void do_dump_mmp __SS_PROTO;
+static char const * const ssu00061[] = {
+"set_mmp_value",
+    "smmp",
+    (char const *)0
+};
+extern void do_set_mmp_value __SS_PROTO;
+static char const * const ssu00062[] = {
+"extent_open",
+    "eo",
+    (char const *)0
+};
+extern void do_extent_open __SS_PROTO;
+static char const * const ssu00063[] = {
+"zap_block",
+    "zap",
+    (char const *)0
+};
+extern void do_zap_block __SS_PROTO;
+static char const * const ssu00064[] = {
+"block_dump",
+    "bdump",
+    "bd",
+    (char const *)0
+};
+extern void do_block_dump __SS_PROTO;
+static char const * const ssu00065[] = {
+"ea_list",
+    (char const *)0
+};
+extern void do_list_xattr __SS_PROTO;
+static char const * const ssu00066[] = {
+"ea_get",
+    (char const *)0
+};
+extern void do_get_xattr __SS_PROTO;
+static char const * const ssu00067[] = {
+"ea_set",
+    (char const *)0
+};
+extern void do_set_xattr __SS_PROTO;
+static char const * const ssu00068[] = {
+"ea_rm",
+    (char const *)0
+};
+extern void do_rm_xattr __SS_PROTO;
+static char const * const ssu00069[] = {
+"list_quota",
+    "lq",
+    (char const *)0
+};
+extern void do_list_quota __SS_PROTO;
+static char const * const ssu00070[] = {
+"get_quota",
+    "gq",
+    (char const *)0
+};
+extern void do_get_quota __SS_PROTO;
+static char const * const ssu00071[] = {
+"inode_dump",
+    "idump",
+    "id",
+    (char const *)0
+};
+extern void do_idump __SS_PROTO;
+static char const * const ssu00072[] = {
+"journal_open",
+    "jo",
+    (char const *)0
+};
+extern void do_journal_open __SS_PROTO;
+static char const * const ssu00073[] = {
+"journal_close",
+    "jc",
+    (char const *)0
+};
+extern void do_journal_close __SS_PROTO;
+static char const * const ssu00074[] = {
+"journal_write",
+    "jw",
+    (char const *)0
+};
+extern void do_journal_write __SS_PROTO;
+static char const * const ssu00075[] = {
+"journal_run",
+    "jr",
+    (char const *)0
+};
+extern void do_journal_run __SS_PROTO;
+static ss_request_entry ssu00076[] = {
+    { ssu00001,
+      do_show_debugfs_params,
+      "Show debugfs parameters",
+      0 },
+    { ssu00002,
+      do_open_filesys,
+      "Open a filesystem",
+      0 },
+    { ssu00003,
+      do_close_filesys,
+      "Close the filesystem",
+      0 },
+    { ssu00004,
+      do_freefrag,
+      "Report free space fragmentation",
+      0 },
+    { ssu00005,
+      do_features,
+      "Set/print superblock features",
+      0 },
+    { ssu00006,
+      do_dirty_filesys,
+      "Mark the filesystem as dirty",
+      0 },
+    { ssu00007,
+      do_init_filesys,
+      "Initialize a filesystem (DESTROYS DATA)",
+      0 },
+    { ssu00008,
+      do_show_super_stats,
+      "Show superblock statistics",
+      0 },
+    { ssu00009,
+      do_ncheck,
+      "Do inode->name translation",
+      0 },
+    { ssu00010,
+      do_icheck,
+      "Do block->inode translation",
+      0 },
+    { ssu00011,
+      do_chroot,
+      "Change root directory",
+      0 },
+    { ssu00012,
+      do_change_working_dir,
+      "Change working directory",
+      0 },
+    { ssu00013,
+      do_list_dir,
+      "List directory",
+      0 },
+    { ssu00014,
+      do_stat,
+      "Show inode information ",
+      0 },
+    { ssu00015,
+      do_dump_extents,
+      "Dump extents information ",
+      0 },
+    { ssu00016,
+      do_blocks,
+      "Dump blocks used by an inode ",
+      0 },
+    { ssu00017,
+      do_filefrag,
+      "Report fragmentation information for an inode",
+      0 },
+    { ssu00018,
+      do_link,
+      "Create directory link",
+      0 },
+    { ssu00019,
+      do_unlink,
+      "Delete a directory link",
+      0 },
+    { ssu00020,
+      do_mkdir,
+      "Create a directory",
+      0 },
+    { ssu00021,
+      do_rmdir,
+      "Remove a directory",
+      0 },
+    { ssu00022,
+      do_rm,
+      "Remove a file (unlink and kill_file, if appropriate)",
+      0 },
+    { ssu00023,
+      do_kill_file,
+      "Deallocate an inode and its blocks",
+      0 },
+    { ssu00024,
+      do_copy_inode,
+      "Copy the inode structure",
+      0 },
+    { ssu00025,
+      do_clri,
+      "Clear an inode's contents",
+      0 },
+    { ssu00026,
+      do_freei,
+      "Clear an inode's in-use flag",
+      0 },
+    { ssu00027,
+      do_seti,
+      "Set an inode's in-use flag",
+      0 },
+    { ssu00028,
+      do_testi,
+      "Test an inode's in-use flag",
+      0 },
+    { ssu00029,
+      do_freeb,
+      "Clear a block's in-use flag",
+      0 },
+    { ssu00030,
+      do_setb,
+      "Set a block's in-use flag",
+      0 },
+    { ssu00031,
+      do_testb,
+      "Test a block's in-use flag",
+      0 },
+    { ssu00032,
+      do_modify_inode,
+      "Modify an inode by structure",
+      0 },
+    { ssu00033,
+      do_find_free_block,
+      "Find free block(s)",
+      0 },
+    { ssu00034,
+      do_find_free_inode,
+      "Find free inode(s)",
+      0 },
+    { ssu00035,
+      do_print_working_directory,
+      "Print current working directory",
+      0 },
+    { ssu00036,
+      do_expand_dir,
+      "Expand directory",
+      0 },
+    { ssu00037,
+      do_mknod,
+      "Create a special file",
+      0 },
+    { ssu00038,
+      do_lsdel,
+      "List deleted inodes",
+      0 },
+    { ssu00039,
+      do_undel,
+      "Undelete file",
+      0 },
+    { ssu00040,
+      do_write,
+      "Copy a file from your native filesystem",
+      0 },
+    { ssu00041,
+      do_dump,
+      "Dump an inode out to a file",
+      0 },
+    { ssu00042,
+      do_cat,
+      "Dump an inode out to stdout",
+      0 },
+    { ssu00043,
+      do_lcd,
+      "Change the current directory on your native filesystem",
+      0 },
+    { ssu00044,
+      do_rdump,
+      "Recursively dump a directory to the native filesystem",
+      0 },
+    { ssu00045,
+      do_set_super,
+      "Set superblock value",
+      0 },
+    { ssu00046,
+      do_set_inode,
+      "Set inode field",
+      0 },
+    { ssu00047,
+      do_set_block_group_descriptor,
+      "Set block group descriptor field",
+      0 },
+    { ssu00048,
+      do_logdump,
+      "Dump the contents of the journal",
+      0 },
+    { ssu00049,
+      do_htree_dump,
+      "Dump a hash-indexed directory",
+      0 },
+    { ssu00050,
+      do_dx_hash,
+      "Calculate the directory hash of a filename",
+      0 },
+    { ssu00051,
+      do_dirsearch,
+      "Search a directory for a particular filename",
+      0 },
+    { ssu00052,
+      do_bmap,
+      "Calculate the logical->physical block mapping for an inode",
+      0 },
+    { ssu00053,
+      do_fallocate,
+      "Allocate uninitialized blocks to an inode",
+      0 },
+    { ssu00054,
+      do_punch,
+      "Punch (or truncate) blocks from an inode by deallocating them",
+      0 },
+    { ssu00055,
+      do_symlink,
+      "Create a symbolic link",
+      0 },
+    { ssu00056,
+      do_imap,
+      "Calculate the location of an inode",
+      0 },
+    { ssu00057,
+      do_dump_unused,
+      "Dump unused blocks",
+      0 },
+    { ssu00058,
+      do_set_current_time,
+      "Set current time to use when setting filesystem fields",
+      0 },
+    { ssu00059,
+      do_supported_features,
+      "Print features supported by this version of e2fsprogs",
+      0 },
+    { ssu00060,
+      do_dump_mmp,
+      "Dump MMP information",
+      0 },
+    { ssu00061,
+      do_set_mmp_value,
+      "Set MMP value",
+      0 },
+    { ssu00062,
+      do_extent_open,
+      "Open inode for extent manipulation",
+      0 },
+    { ssu00063,
+      do_zap_block,
+      "Zap block: fill with 0, pattern, flip bits etc.",
+      0 },
+    { ssu00064,
+      do_block_dump,
+      "Dump contents of a block",
+      0 },
+    { ssu00065,
+      do_list_xattr,
+      "List extended attributes of an inode",
+      0 },
+    { ssu00066,
+      do_get_xattr,
+      "Get an extended attribute of an inode",
+      0 },
+    { ssu00067,
+      do_set_xattr,
+      "Set an extended attribute of an inode",
+      0 },
+    { ssu00068,
+      do_rm_xattr,
+      "Remove an extended attribute of an inode",
+      0 },
+    { ssu00069,
+      do_list_quota,
+      "List quota",
+      0 },
+    { ssu00070,
+      do_get_quota,
+      "Get quota",
+      0 },
+    { ssu00071,
+      do_idump,
+      "Dump the inode structure in hex",
+      0 },
+    { ssu00072,
+      do_journal_open,
+      "Open the journal",
+      0 },
+    { ssu00073,
+      do_journal_close,
+      "Close the journal",
+      0 },
+    { ssu00074,
+      do_journal_write,
+      "Write a transaction to the journal",
+      0 },
+    { ssu00075,
+      do_journal_run,
+      "Recover the journal",
+      0 },
+    { 0, 0, 0, 0 }
+};
+
+ss_request_table debug_cmds = { 2, ssu00076 };
diff --git a/debugfs/debug_cmds.ct b/debugfs/debug_cmds.ct
index 96ff00f..1ff6c9d 100644
--- a/debugfs/debug_cmds.ct
+++ b/debugfs/debug_cmds.ct
@@ -73,6 +73,9 @@
 request do_kill_file, "Deallocate an inode and its blocks",
 	kill_file;
 
+request do_copy_inode, "Copy the inode structure",
+	copy_inode;
+
 request do_clri, "Clear an inode's contents",
 	clri;
 
@@ -157,6 +160,9 @@
 request do_bmap, "Calculate the logical->physical block mapping for an inode",
 	bmap;
 
+request do_fallocate, "Allocate uninitialized blocks to an inode",
+	fallocate;
+
 request do_punch, "Punch (or truncate) blocks from an inode by deallocating them",
 	punch, truncate;
 
@@ -188,7 +194,40 @@
 	zap_block, zap;
 
 request do_block_dump, "Dump contents of a block",
-	block_dump, bd;
+	block_dump, bdump, bd;
+
+request do_list_xattr, "List extended attributes of an inode",
+	ea_list;
+
+request do_get_xattr, "Get an extended attribute of an inode",
+	ea_get;
+
+request do_set_xattr, "Set an extended attribute of an inode",
+	ea_set;
+
+request do_rm_xattr, "Remove an extended attribute of an inode",
+	ea_rm;
+
+request do_list_quota, "List quota",
+	list_quota, lq;
+
+request do_get_quota, "Get quota",
+	get_quota, gq;
+
+request do_idump, "Dump the inode structure in hex",
+	inode_dump, idump, id;
+
+request do_journal_open, "Open the journal",
+	journal_open, jo;
+
+request do_journal_close, "Close the journal",
+	journal_close, jc;
+
+request do_journal_write, "Write a transaction to the journal",
+	journal_write, jw;
+
+request do_journal_run, "Recover the journal",
+	journal_run, jr;
 
 end;
 
diff --git a/debugfs/debugfs.8.in b/debugfs/debugfs.8.in
index 73254d3..393c000 100644
--- a/debugfs/debugfs.8.in
+++ b/debugfs/debugfs.8.in
@@ -8,7 +8,7 @@
 .SH SYNOPSIS
 .B debugfs
 [
-.B \-DVwci
+.B \-DVwcin
 ]
 [
 .B \-b
@@ -31,6 +31,10 @@
 data_source_device
 ]
 [
+.B \-z
+.I undo_file
+]
+[
 device
 ]
 .SH DESCRIPTION
@@ -38,16 +42,20 @@
 .B debugfs
 program is an interactive file system debugger. It can be used to
 examine and change the state of an ext2, ext3, or ext4 file system.
-.br
+.PP
 .I device
-is the special file corresponding to the device containing the
-file system (e.g /dev/hdXX).
+is a block device (e.g., /dev/sdXX) or a file containing the file system.
 .SH OPTIONS
 .TP
 .I \-w
 Specifies that the file system should be opened in read-write mode.
 Without this option, the file system is opened in read-only mode.
 .TP
+.I \-n
+Disables metadata checksum verification.  This should only be used if
+you believe the metadata to be correct despite the complaints of
+e2fsprogs.
+.TP
 .I \-c
 Specifies that the file system should be opened in catastrophic mode, in
 which the inode and group bitmaps are not read initially.  This can be
@@ -86,8 +94,10 @@
 This includes data, directory, and indirect blocks.
 .TP
 .I -b blocksize
-Forces the use of the given block size for the file system, rather than
-detecting the correct block size as normal.
+Forces the use of the given block size (in bytes) for the file system,
+rather than detecting the correct block size automatically.  (This
+option is rarely needed; it is used primarily when the file system is
+extremely badly damaged/corrupted.)
 .TP
 .I -s superblock
 Causes the file system superblock to be read from the given block
@@ -96,7 +106,9 @@
 .I -s
 option, you must also provide the blocksize of the filesystem via the
 .I -b
-option.
+option.   (This
+option is rarely needed; it is used primarily when the file system is
+extremely badly damaged/corrupted.)
 .TP
 .I -f cmd_file
 Causes
@@ -125,6 +137,16 @@
 print the version number of
 .B debugfs
 and exit.
+.TP
+.BI \-z " undo_file"
+Before overwriting a file system block, write the old contents of the block to
+an undo file.  This undo file can be used with e2undo(8) to restore the old
+contents of the file system should something go wrong.  If the empty string is
+passed as the undo_file argument, the undo file will be written to a file named
+debugfs-\fIdevice\fR.e2undo in the directory specified via the
+\fIE2FSPROGS_UNDO_DIR\fR environment variable.
+
+WARNING: The undo file cannot be used to recover from a power or system crash.
 .SH SPECIFYING FILES
 Many
 .B debugfs
@@ -157,24 +179,32 @@
 .B debugfs
 supports.
 .TP
-.BI blocks " filespace"
+.BI blocks " filespec"
 Print the blocks used by the inode
 .I filespec
 to stdout.
 .TP
-.BI bmap " filespec logical_block"
-Print the physical block number corresponding to the logical block number
+.BI bmap " [ -a ] filespec logical_block [physical_block]"
+Print or set the physical block number corresponding to the logical block number
 .I logical_block
 in the inode
 .IR filespec .
+If the
+.I \-a
+flag is specified, try to allocate a block if necessary.
 .TP
-.BI block_dump " [-f filespec] block_num"
+.BI block_dump " '[ -x ] [-f filespec] block_num"
 Dump the filesystem block given by
 .I block_num
 in hex and ASCII format to the console.  If the
-.I -f
+.I \-f
 option is specified, the block number is relative to the start of the given
 .BR filespec .
+If the
+.I \-x
+option is specified, the block is interpreted as an extended attribute
+block and printed to show the structure of extended attribute data
+structures.
 .TP
 .BI cat " filespec"
 Dump the contents of the inode
@@ -200,14 +230,23 @@
 Clear the contents of the inode
 .IR filespec .
 .TP
+.BI copy_inode " source_inode destination_inode"
+Copy the contents of the inode structure in
+.I source_inode
+and use it to overwrite the inode structure at
+.IR destination_inode .
+.TP
 .BI dirsearch " filespec filename"
 Search the directory
 .I filespec
 for
 .IR filename .
 .TP
-.B dirty
+.BI dirty " [-clean]"
 Mark the filesystem as dirty, so that the superblocks will be written on exit.
+Additionally, clear the superblock's valid flag, or set it if
+.I -clean
+is specified.
 .TP
 .BI dump " [-p] filespec out_file"
 Dump the contents of the inode
@@ -221,8 +260,13 @@
 to match
 .IR filespec .
 .TP
-.B dump_mmp
-Display the multiple-mount protection (mmp) field values.
+.BI dump_mmp " [mmp_block]"
+Display the multiple-mount protection (mmp) field values.  If
+.I mmp_block
+is specified then verify and dump the MMP values from the given block
+number, otherwise use the
+.B s_mmp_block
+field in the superblock to locate and use the existing MMP block.
 .TP
 .BI dx_hash " [-h hash_alg] [-s hash_seed] filename"
 Calculate the directory hash of
@@ -254,10 +298,46 @@
 may not necessarily by accurate and does not indicate a problem or
 corruption in the file system.)
 .TP
+.B dump_unused
+Dump unused blocks which contain non-null bytes.
+.TP
+.BI ea_get " [-f outfile]|[-xVC] [-r] filespec attr_name"
+Retrieve the value of the extended attribute
+.I attr_name
+in the file
+.I filespec
+and write it either to stdout or to \fIoutfile\fR.
+.TP
+.BI ea_list " filespec
+List the extended attributes associated with the file
+.I filespec
+to standard output.
+.TP
+.BI ea_set " [-f infile] [-r] filespec attr_name attr_value
+Set the value of the extended attribute
+.I attr_name
+in the file
+.I filespec
+to the string value
+.I attr_value
+or read it from \fIinfile\fR.
+.TP
+.BI ea_rm " filespec attr_names...
+Remove the extended attribute
+.I attr_name
+from the file \fIfilespec\fR.
+.TP
 .BI expand_dir " filespec"
 Expand the directory
 .IR filespec .
 .TP
+.BI fallocate " filespec start_block [end_block]
+Allocate and map uninitialized blocks into \fIfilespec\fR between
+logical block \fIstart_block\fR and \fIend_block\fR, inclusive.  If
+\fIend_block\fR is not supplied, this function maps until it runs out
+of free disk blocks or the maximum file size is reached.  Existing
+mappings are left alone.
+.TP
 .BI feature " [fs_feature] [-fs_feature] ..."
 Set or clear various filesystem features in the superblock.  After setting
 or clearing any filesystem features that were requested, print the current
@@ -333,6 +413,9 @@
 .I num
 is specified, also clear num-1 inodes after the specified inode.
 .TP
+.BI get_quota " quota_type id"
+Display quota information for given quota type (user, group, or project) and ID.
+.TP
 .B help
 Print a list of commands understood by
 .BR debugfs .
@@ -346,6 +429,21 @@
 Print a listing of the inodes which use the one or more blocks specified
 on the command line.
 .TP
+.BI inode_dump " [-b]|[-e]|[-x] filespec"
+Print the contents of the inode data structure in hex and ASCII format.
+The
+.I \-b
+option causes the command to only dump the contents of the
+.B i_blocks
+array.  The
+.I \-e
+option causes the command to only dump the contents of the extra inode
+space, which is used to store in-line extended attributes. The
+.I \-x
+option causes the command to dump the extra inode space interpreted and
+extended attributes.  This is useful to debug corrupted inodes
+containing extended attributes.
+.TP
 .BI imap " filespec"
 Print the location of the inode data structure (in the inode table)
 of the inode
@@ -362,6 +460,26 @@
 program.  This is just a call to the low-level library, which sets up
 the superblock and block descriptors.
 .TP
+.BI journal_close
+Close the open journal.
+.TP
+.BI journal_open " [-c] [-v ver] [-f ext_jnl]
+Opens the journal for reading and writing.  Journal checksumming can
+be enabled by supplying \fI-c\fR; checksum formats 2 and 3 can be
+selected with the \fI-v\fR option.  An external journal can be loaded
+from \fIext_jnl\fR.
+.TP
+.BI journal_run
+Replay all transactions in the open journal.
+.TP
+.BI journal_write " [-b blocks] [-r revoke] [-c] file
+Write a transaction to the open journal.  The list of blocks to write
+should be supplied as a comma-separated list in \fIblocks\fR; the
+blocks themselves should be readable from \fIfile\fR.  A list of
+blocks to revoke can be supplied as a comma-separated list in
+\fIrevoke\fR.  By default, a commit record is written at the end; the
+\fI-c\fR switch writes an uncommitted transaction.
+.TP
 .BI kill_file " filespec"
 Deallocate the inode
 .I filespec
@@ -377,6 +495,9 @@
 .I directory
 on the native filesystem.
 .TP
+.BI list_quota " quota_type"
+Display quota information for given quota type (user, group, or project).
+.TP
 .BI ln " filespec dest_file"
 Create a link named
 .I dest_file
@@ -384,7 +505,7 @@
 .IR filespec .
 Note this does not adjust the inode reference counts.
 .TP
-.BI logdump " [-acs] [-b block] [-i filespec] [-f journal_file] [output_file]"
+.BI logdump " [-acsOS] [-b block] [-i filespec] [-f journal_file] [output_file]"
 Dump the contents of the ext3 journal.  By default, dump the journal inode as
 specified in the superblock.  However, this can be overridden with the
 .I \-i
@@ -398,6 +519,12 @@
 journal.
 .IP
 The
+.I \-S
+option causes
+.B logdump
+to print the contents of the journal superblock.
+.IP
+The
 .I \-a
 option causes the
 .B logdump
@@ -406,7 +533,7 @@
 .I \-b
 option causes
 .B logdump
-to print all journal records that are refer to the specified block.
+to print all journal records that refer to the specified block.
 The
 .I \-c
 option will print out the contents of all of the data blocks selected by
@@ -415,11 +542,20 @@
 and
 .I \-b
 options.
+.IP
+The
+.I \-O
+option causes logdump to display old (checkpointed) journal entries.
+This can be used to try to track down journal problems even after the
+journal has been replayed.
 .TP
-.BI ls " [-d] [-l] [-p] filespec"
+.BI ls " [-l] [-c] [-d] [-p] [-r] filespec"
 Print a listing of the files in the directory
 .IR filespec .
 The
+.I \-c
+flag causes directory block checksums (if present) to be displayed.
+The
 .I \-d
 flag will list deleted entries in the directory.
 The
@@ -430,6 +566,9 @@
 flag will list the files in a format which is more easily parsable by
 scripts, as well as making it more clear when there are spaces or other
 non-printing characters at the end of filenames.
+The
+.I \-r
+flag will force the printing of the filename, even if it is encrypted.
 .TP
 .BI list_deleted_inodes " [limit]"
 List deleted inodes, optionally limited to those deleted within
@@ -466,7 +605,7 @@
 flag will enable checking the file type information in the directory
 entry to make sure it matches the inode's type.
 .TP
-.BI open " [-weficD] [-b blocksize] [-s superblock] device"
+.BI open " [-weficD] [-b blocksize] [-d image_filename] [-s superblock] [-z undo_file] device"
 Open a filesystem for editing.  The
 .I -f
 flag forces the filesystem to be opened even if there are some unknown
@@ -474,7 +613,7 @@
 prevent the filesystem from being opened.  The
 .I -e
 flag causes the filesystem to be opened in exclusive mode.  The
-.IR -b ", " -c ", " -i ", " -s ", " -w ", and " -D
+.IR -b ", " -c ", " -d ", " -i ", " -s ", " -w ", and " -D
 options behave the same as the command-line options to
 .BR debugfs .
 .TP
@@ -500,12 +639,14 @@
 Quit
 .B debugfs
 .TP
-.BI rdump " directory destination"
+.BI rdump " directory[...] destination"
 Recursively dump
-.I directory
+.IR directory ,
+or multiple
+.IR directories ,
 and all its contents (including regular files, symbolic links, and other
 directories) into the named
-.I destination
+.IR destination ,
 which should be an existing directory on the native filesystem.
 .TP
 .BI rm " pathname"
@@ -543,6 +684,10 @@
 Also available as
 .BR set_bg .
 .TP
+.BI set_current_time " time"
+Set current time in seconds since Unix epoch to use when setting filesystem
+fields.
+.TP
 .BI seti " filespec [num]"
 Mark inode
 .I filespec
@@ -585,6 +730,11 @@
 Also available as
 .BR ssv .
 .TP
+.B show_debugfs_params
+Display
+.B debugfs
+parameters such as information about currently opened filesystem.
+.TP
 .BI show_super_stats " [-h]"
 List the contents of the super block and the block group descriptors.  If the
 .I -h
@@ -595,6 +745,10 @@
 Display the contents of the inode structure of the inode
 .IR filespec .
 .TP
+.B supported_features
+Display filesystem features supported by this version of
+.BR debugfs .
+.TP
 .BI testb " block [count]"
 Test if the block number
 .I block
@@ -645,7 +799,6 @@
 .IR out_file .
 .TP
 .BI zap_block " [-f filespec] [-o offset] [-l length] [-p pattern] block_num"
-.TP
 Overwrite the block specified by
 .I block_num
 with zero (NUL) bytes, or if
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 80662b1..b67a88b 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -8,12 +8,14 @@
  * Modifications by Robert Sanders <gt8134b@prism.gatech.edu>
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
 #include <time.h>
+#include <libgen.h>
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
 #else
@@ -24,8 +26,9 @@
 #include <errno.h>
 #endif
 #include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 
 #include "debugfs.h"
 #include "uuid/uuid.h"
@@ -35,34 +38,113 @@
 
 #include "../version.h"
 #include "jfs_user.h"
+#include "support/plausible.h"
 
 #ifndef BUFSIZ
 #define BUFSIZ 8192
 #endif
 
-/* 64KiB is the minimium blksize to best minimize system call overhead. */
-#ifndef IO_BUFSIZE
-#define IO_BUFSIZE 64*1024
+#ifdef CONFIG_JBD_DEBUG		/* Enabled by configure --enable-jbd-debug */
+int journal_enable_debug = -1;
 #endif
 
-/* Block size for `st_blocks' */
-#ifndef S_BLKSIZE
-#define S_BLKSIZE 512
-#endif
-
+/*
+ * There must be only one definition if we're hooking in extra commands or
+ * chaging default prompt. Use -DSKIP_GLOBDEF for that.
+ */
+#ifndef SKIP_GLOBDEFS
 ss_request_table *extra_cmds;
 const char *debug_prog_name;
-int sci_idx;
+#endif
+int ss_sci_idx;
 
-ext2_filsys	current_fs = NULL;
+ext2_filsys	current_fs;
+quota_ctx_t	current_qctx;
 ext2_ino_t	root, cwd;
+int		no_copy_xattrs;
+
+static int debugfs_setup_tdb(const char *device_name, char *undo_file,
+			     io_manager *io_ptr)
+{
+	errcode_t retval = ENOMEM;
+	const char	*tdb_dir = NULL;
+	char		*tdb_file = NULL;
+	char		*dev_name, *tmp_name;
+
+	/* (re)open a specific undo file */
+	if (undo_file && undo_file[0] != 0) {
+		retval = set_undo_io_backing_manager(*io_ptr);
+		if (retval)
+			goto err;
+		*io_ptr = undo_io_manager;
+		retval = set_undo_io_backup_file(undo_file);
+		if (retval)
+			goto err;
+		printf("Overwriting existing filesystem; this can be undone "
+			"using the command:\n"
+			"    e2undo %s %s\n\n",
+			undo_file, device_name);
+		return retval;
+	}
+
+	/*
+	 * Configuration via a conf file would be
+	 * nice
+	 */
+	tdb_dir = ss_safe_getenv("E2FSPROGS_UNDO_DIR");
+	if (!tdb_dir)
+		tdb_dir = "/var/lib/e2fsprogs";
+
+	if (!strcmp(tdb_dir, "none") || (tdb_dir[0] == 0) ||
+	    access(tdb_dir, W_OK))
+		return 0;
+
+	tmp_name = strdup(device_name);
+	if (!tmp_name)
+		goto errout;
+	dev_name = basename(tmp_name);
+	tdb_file = malloc(strlen(tdb_dir) + 9 + strlen(dev_name) + 7 + 1);
+	if (!tdb_file) {
+		free(tmp_name);
+		goto errout;
+	}
+	sprintf(tdb_file, "%s/debugfs-%s.e2undo", tdb_dir, dev_name);
+	free(tmp_name);
+
+	if ((unlink(tdb_file) < 0) && (errno != ENOENT)) {
+		retval = errno;
+		com_err("debugfs", retval,
+			"while trying to delete %s", tdb_file);
+		goto errout;
+	}
+
+	retval = set_undo_io_backing_manager(*io_ptr);
+	if (retval)
+		goto errout;
+	*io_ptr = undo_io_manager;
+	retval = set_undo_io_backup_file(tdb_file);
+	if (retval)
+		goto errout;
+	printf("Overwriting existing filesystem; this can be undone "
+		"using the command:\n"
+		"    e2undo %s %s\n\n", tdb_file, device_name);
+
+	free(tdb_file);
+	return 0;
+errout:
+	free(tdb_file);
+err:
+	com_err("debugfs", retval, "while trying to setup undo file\n");
+	return retval;
+}
 
 static void open_filesystem(char *device, int open_flags, blk64_t superblock,
 			    blk64_t blocksize, int catastrophic,
-			    char *data_filename)
+			    char *data_filename, char *undo_file)
 {
 	int	retval;
 	io_channel data_io = 0;
+	io_manager io_ptr = unix_io_manager;
 
 	if (superblock != 0 && blocksize == 0) {
 		com_err(device, 0, "if you specify the superblock, you must also specify the block size");
@@ -85,18 +167,29 @@
 		}
 	}
 
-	if (catastrophic && (open_flags & EXT2_FLAG_RW)) {
-		com_err(device, 0,
-			"opening read-only because of catastrophic mode");
-		open_flags &= ~EXT2_FLAG_RW;
-	}
 	if (catastrophic)
-		open_flags |= EXT2_FLAG_SKIP_MMP;
+		open_flags |= EXT2_FLAG_SKIP_MMP | EXT2_FLAG_IGNORE_SB_ERRORS;
 
+	if (undo_file) {
+		retval = debugfs_setup_tdb(device, undo_file, &io_ptr);
+		if (retval)
+			exit(1);
+	}
+
+try_open_again:
 	retval = ext2fs_open(device, open_flags, superblock, blocksize,
-			     unix_io_manager, &current_fs);
+			     io_ptr, &current_fs);
+	if (retval && (retval == EXT2_ET_SB_CSUM_INVALID) &&
+	    !(open_flags & EXT2_FLAG_IGNORE_CSUM_ERRORS)) {
+		open_flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
+		printf("Checksum errors in superblock!  Retrying...\n");
+		goto try_open_again;
+	}
 	if (retval) {
-		com_err(device, retval, "while opening filesystem");
+		com_err(debug_prog_name, retval,
+			"while trying to open %s", device);
+		if (retval == EXT2_ET_BAD_MAGIC)
+			check_plausibility(device, CHECK_FS_EXIST, NULL);
 		current_fs = NULL;
 		return;
 	}
@@ -105,14 +198,10 @@
 	if (catastrophic)
 		com_err(device, 0, "catastrophic mode - not reading inode or group bitmaps");
 	else {
-		retval = ext2fs_read_inode_bitmap(current_fs);
+		retval = ext2fs_read_bitmaps(current_fs);
 		if (retval) {
-			com_err(device, retval, "while reading inode bitmap");
-			goto errout;
-		}
-		retval = ext2fs_read_block_bitmap(current_fs);
-		if (retval) {
-			com_err(device, retval, "while reading block bitmap");
+			com_err(device, retval,
+				"while reading allocation bitmaps");
 			goto errout;
 		}
 	}
@@ -130,23 +219,25 @@
 	return;
 
 errout:
-	retval = ext2fs_close(current_fs);
+	retval = ext2fs_close_free(&current_fs);
 	if (retval)
 		com_err(device, retval, "while trying to close filesystem");
-	current_fs = NULL;
 }
 
-void do_open_filesys(int argc, char **argv)
+void do_open_filesys(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		     void *infop EXT2FS_ATTR((unused)))
 {
 	int	c, err;
 	int	catastrophic = 0;
 	blk64_t	superblock = 0;
 	blk64_t	blocksize = 0;
-	int	open_flags = EXT2_FLAG_SOFTSUPP_FEATURES | EXT2_FLAG_64BITS; 
+	int	open_flags = EXT2_FLAG_SOFTSUPP_FEATURES | EXT2_FLAG_64BITS |
+		EXT2_FLAG_THREADS;
 	char	*data_filename = 0;
+	char	*undo_file = NULL;
 
 	reset_getopt();
-	while ((c = getopt (argc, argv, "iwfecb:s:d:D")) != EOF) {
+	while ((c = getopt(argc, argv, "iwfecb:s:d:Dz:")) != EOF) {
 		switch (c) {
 		case 'i':
 			open_flags |= EXT2_FLAG_IMAGE_FILE;
@@ -180,10 +271,18 @@
 				return;
 			break;
 		case 's':
-			err = strtoblk(argv[0], optarg, &superblock);
+			err = strtoblk(argv[0], optarg,
+				       "superblock block number", &superblock);
 			if (err)
 				return;
 			break;
+		case 'z':
+#ifdef READ_ONLY
+			goto print_usage;
+#else
+			undo_file = optarg;
+#endif
+			break;
 		default:
 			goto print_usage;
 		}
@@ -195,19 +294,21 @@
 		return;
 	open_filesystem(argv[optind], open_flags,
 			superblock, blocksize, catastrophic,
-			data_filename);
+			data_filename, undo_file);
 	return;
 
 print_usage:
 	fprintf(stderr, "%s: Usage: open [-s superblock] [-b blocksize] "
-		"[-d image_filename] [-c] [-i] [-f] [-e] [-D] "
-#ifndef READ_ONLY
-		"[-w] "
+#ifdef READ_ONLY
+		"[-d image_filename] [-z undo_file] [-c] [-i] [-f] [-e] [-D] "
+#else
+		"[-d image_filename] [-c] [-i] [-f] [-e] [-D] [-w] "
 #endif
 		"<device>\n", argv[0]);
 }
 
-void do_lcd(int argc, char **argv)
+void do_lcd(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+	    void *infop EXT2FS_ATTR((unused)))
 {
 	if (argc != 2) {
 		com_err(argv[0], 0, "Usage: %s %s", argv[0], "<native dir>");
@@ -236,14 +337,16 @@
 		if (retval)
 			com_err("ext2fs_write_block_bitmap", retval, 0);
 	}
-	retval = ext2fs_close(current_fs);
+	if (current_qctx)
+		quota_release_context(&current_qctx);
+	retval = ext2fs_close_free(&current_fs);
 	if (retval)
 		com_err("ext2fs_close", retval, 0);
-	current_fs = NULL;
 	return;
 }
 
-void do_close_filesys(int argc, char **argv)
+void do_close_filesys(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		      void *infop EXT2FS_ATTR((unused)))
 {
 	int	c;
 
@@ -271,7 +374,8 @@
 }
 
 #ifndef READ_ONLY
-void do_init_filesys(int argc, char **argv)
+void do_init_filesys(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		     void *infop EXT2FS_ATTR((unused)))
 {
 	struct ext2_super_block param;
 	errcode_t	retval;
@@ -283,12 +387,10 @@
 		return;
 
 	memset(&param, 0, sizeof(struct ext2_super_block));
-	err = strtoblk(argv[0], argv[2], &blocks);
+	err = strtoblk(argv[0], argv[2], "blocks count", &blocks);
 	if (err)
 		return;
 	ext2fs_blocks_count_set(&param, blocks);
-	if (err)
-		return;
 	retval = ext2fs_initialize(argv[1], 0, &param,
 				   unix_io_manager, &current_fs);
 	if (retval) {
@@ -333,7 +435,9 @@
 	}
 }
 
-void do_show_super_stats(int argc, char *argv[])
+void do_show_super_stats(int argc, char *argv[],
+			 int sci_idx EXT2FS_ATTR((unused)),
+			 void *infop EXT2FS_ATTR((unused)))
 {
 	const char *units ="block";
 	dgrp_t	i;
@@ -358,33 +462,43 @@
 		return;
 	out = open_pager();
 
-	if (EXT2_HAS_RO_COMPAT_FEATURE(current_fs->super,
-				       EXT4_FEATURE_RO_COMPAT_BIGALLOC))
+	if (ext2fs_has_feature_bigalloc(current_fs->super))
 		units = "cluster";
 
 	list_super2(current_fs->super, out);
+	if (ext2fs_has_feature_metadata_csum(current_fs->super) &&
+	    !ext2fs_superblock_csum_verify(current_fs,
+					   current_fs->super)) {
+		__u32 orig_csum = current_fs->super->s_checksum;
+
+		ext2fs_superblock_csum_set(current_fs,
+					   current_fs->super);
+		fprintf(out, "Expected Checksum:        0x%08x\n",
+			current_fs->super->s_checksum);
+		current_fs->super->s_checksum = orig_csum;
+	}
 	for (i=0; i < current_fs->group_desc_count; i++)
 		numdirs += ext2fs_bg_used_dirs_count(current_fs, i);
-	fprintf(out, "Directories:              %d\n", numdirs);
+	fprintf(out, "Directories:              %u\n", numdirs);
 
 	if (header_only) {
 		close_pager(out);
 		return;
 	}
 
-	gdt_csum = EXT2_HAS_RO_COMPAT_FEATURE(current_fs->super,
-					      EXT4_FEATURE_RO_COMPAT_GDT_CSUM);
+	gdt_csum = ext2fs_has_group_desc_csum(current_fs);
 	for (i = 0; i < current_fs->group_desc_count; i++) {
 		fprintf(out, " Group %2d: block bitmap at %llu, "
 		        "inode bitmap at %llu, "
 		        "inode table at %llu\n"
 		        "           %u free %s%s, "
 		        "%u free %s, "
-		        "%u used %s%s",
-		        i, ext2fs_block_bitmap_loc(current_fs, i),
-		        ext2fs_inode_bitmap_loc(current_fs, i),
-			ext2fs_inode_table_loc(current_fs, i),
-		        ext2fs_bg_free_blocks_count(current_fs, i), units,
+		        "%u used %s%s", i,
+		        (unsigned long long) ext2fs_block_bitmap_loc(current_fs, i),
+		        (unsigned long long) ext2fs_inode_bitmap_loc(current_fs, i),
+			(unsigned long long) ext2fs_inode_table_loc(current_fs, i),
+		        ext2fs_bg_free_blocks_count(current_fs, i),
+			units,
 		        ext2fs_bg_free_blocks_count(current_fs, i) != 1 ?
 			"s" : "",
 		        ext2fs_bg_free_inodes_count(current_fs, i),
@@ -414,12 +528,14 @@
 	close_pager(out);
 	return;
 print_usage:
-	fprintf(stderr, "%s: Usage: show_super [-h]\n", argv[0]);
+	fprintf(stderr, "%s: Usage: show_super_stats [-h]\n", argv[0]);
 }
 
 #ifndef READ_ONLY
 void do_dirty_filesys(int argc EXT2FS_ATTR((unused)),
-		      char **argv EXT2FS_ATTR((unused)))
+		      char **argv EXT2FS_ATTR((unused)),
+		      int sci_idx EXT2FS_ATTR((unused)),
+		      void *infop EXT2FS_ATTR((unused)))
 {
 	if (check_fs_open(argv[0]))
 		return;
@@ -452,11 +568,13 @@
 		fprintf(lb->f, ", ");
 	if (lb->first_block == lb->last_block)
 		fprintf(lb->f, "(%lld):%llu",
-			(long long)lb->first_bcnt, lb->first_block);
+			(long long)lb->first_bcnt,
+			(unsigned long long) lb->first_block);
 	else
 		fprintf(lb->f, "(%lld-%lld):%llu-%llu",
 			(long long)lb->first_bcnt, (long long)lb->last_bcnt,
-			lb->first_block, lb->last_block);
+			(unsigned long long) lb->first_block,
+			(unsigned long long) lb->last_block);
 	lb->first_block = 0;
 }
 
@@ -505,37 +623,11 @@
 	return 0;
 }
 
-static void dump_xattr_string(FILE *out, const char *str, int len)
-{
-	int printable = 0;
-	int i;
-
-	/* check: is string "printable enough?" */
-	for (i = 0; i < len; i++)
-		if (isprint(str[i]))
-			printable++;
-
-	if (printable <= len*7/8)
-		printable = 0;
-
-	for (i = 0; i < len; i++)
-		if (printable)
-			fprintf(out, isprint(str[i]) ? "%c" : "\\%03o",
-				(unsigned char)str[i]);
-		else
-			fprintf(out, "%02x ", (unsigned char)str[i]);
-}
-
 static void internal_dump_inode_extra(FILE *out,
 				      const char *prefix EXT2FS_ATTR((unused)),
 				      ext2_ino_t inode_num EXT2FS_ATTR((unused)),
 				      struct ext2_inode_large *inode)
 {
-	struct ext2_ext_attr_entry *entry;
-	__u32 *magic;
-	char *start, *end;
-	unsigned int storage_size;
-
 	fprintf(out, "Size of extra inode fields: %u\n", inode->i_extra_isize);
 	if (inode->i_extra_isize > EXT2_INODE_SIZE(current_fs->super) -
 			EXT2_GOOD_OLD_INODE_SIZE) {
@@ -543,34 +635,6 @@
 				inode->i_extra_isize);
 		return;
 	}
-	storage_size = EXT2_INODE_SIZE(current_fs->super) -
-			EXT2_GOOD_OLD_INODE_SIZE -
-			inode->i_extra_isize;
-	magic = (__u32 *)((char *)inode + EXT2_GOOD_OLD_INODE_SIZE +
-			inode->i_extra_isize);
-	if (*magic == EXT2_EXT_ATTR_MAGIC) {
-		fprintf(out, "Extended attributes stored in inode body: \n");
-		end = (char *) inode + EXT2_INODE_SIZE(current_fs->super);
-		start = (char *) magic + sizeof(__u32);
-		entry = (struct ext2_ext_attr_entry *) start;
-		while (!EXT2_EXT_IS_LAST_ENTRY(entry)) {
-			struct ext2_ext_attr_entry *next =
-				EXT2_EXT_ATTR_NEXT(entry);
-			if (entry->e_value_size > storage_size ||
-					(char *) next >= end) {
-				fprintf(out, "invalid EA entry in inode\n");
-				return;
-			}
-			fprintf(out, "  ");
-			dump_xattr_string(out, EXT2_EXT_ATTR_NAME(entry),
-					  entry->e_name_len);
-			fprintf(out, " = \"");
-			dump_xattr_string(out, start + entry->e_value_offs,
-						entry->e_value_size);
-			fprintf(out, "\" (%u)\n", entry->e_value_size);
-			entry = next;
-		}
-	}
 }
 
 static void dump_blocks(FILE *f, const char *prefix, ext2_ino_t inode)
@@ -660,18 +724,18 @@
 					info.curr_level, info.max_depth,
 					info.curr_entry, info.num_entries,
 					logical_width,
-					extent.e_lblk,
+					(unsigned long long) extent.e_lblk,
 					logical_width,
-					extent.e_lblk + (extent.e_len - 1),
+					(unsigned long long) extent.e_lblk + (extent.e_len - 1),
 					physical_width,
-					extent.e_pblk,
+					(unsigned long long) extent.e_pblk,
 					physical_width+3, "", extent.e_len);
 				continue;
 			}
 
-			fprintf(f, "%s(ETB%d):%lld",
+			fprintf(f, "%s(ETB%d):%llu",
 				printed ? ", " : "", info.curr_level,
-				extent.e_pblk);
+				(unsigned long long) extent.e_pblk);
 			printed = 1;
 			continue;
 		}
@@ -682,13 +746,13 @@
 				info.curr_level, info.max_depth,
 				info.curr_entry, info.num_entries,
 				logical_width,
-				extent.e_lblk,
+				(unsigned long long) extent.e_lblk,
 				logical_width,
-				extent.e_lblk + (extent.e_len - 1),
+				(unsigned long long) extent.e_lblk + (extent.e_len - 1),
 				physical_width,
-				extent.e_pblk,
+				(unsigned long long) extent.e_pblk,
 				physical_width,
-				extent.e_pblk + (extent.e_len - 1),
+				(unsigned long long) extent.e_pblk + (extent.e_len - 1),
 				extent.e_len,
 				extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT ?
 					"Uninit" : "");
@@ -701,24 +765,64 @@
 			fprintf(f,
 				"%s(%lld%s):%lld",
 				printed ? ", " : "",
-				extent.e_lblk,
+				(unsigned long long) extent.e_lblk,
 				extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT ?
 				"[u]" : "",
-				extent.e_pblk);
+				(unsigned long long) extent.e_pblk);
 		else
 			fprintf(f,
 				"%s(%lld-%lld%s):%lld-%lld",
 				printed ? ", " : "",
-				extent.e_lblk,
-				extent.e_lblk + (extent.e_len - 1),
+				(unsigned long long) extent.e_lblk,
+				(unsigned long long) extent.e_lblk + (extent.e_len - 1),
 				extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT ?
 					"[u]" : "",
-				extent.e_pblk,
-				extent.e_pblk + (extent.e_len - 1));
+				(unsigned long long) extent.e_pblk,
+				(unsigned long long) extent.e_pblk + (extent.e_len - 1));
 		printed = 1;
 	}
 	if (printed)
 		fprintf(f, "\n");
+	ext2fs_extent_free(handle);
+}
+
+static void dump_inline_data(FILE *out, const char *prefix, ext2_ino_t inode_num)
+{
+	errcode_t retval;
+	size_t size;
+
+	retval = ext2fs_inline_data_size(current_fs, inode_num, &size);
+	if (!retval)
+		fprintf(out, "%sSize of inline data: %zu\n", prefix, size);
+}
+
+static void dump_inline_symlink(FILE *out, ext2_ino_t inode_num,
+				struct ext2_inode *inode, const char *prefix)
+{
+	errcode_t retval;
+	char *buf = NULL;
+	size_t size;
+
+	retval = ext2fs_inline_data_size(current_fs, inode_num, &size);
+	if (retval)
+		goto out;
+
+	retval = ext2fs_get_memzero(size + 1, &buf);
+	if (retval)
+		goto out;
+
+	retval = ext2fs_inline_data_get(current_fs, inode_num,
+					inode, buf, &size);
+	if (retval)
+		goto out;
+
+	fprintf(out, "%sFast link dest: \"%.*s\"\n", prefix,
+		(int)size, buf);
+out:
+	if (buf)
+		ext2fs_free_mem(&buf);
+	if (retval)
+		com_err(__func__, retval, "while dumping link destination");
 }
 
 void internal_dump_inode(FILE *out, const char *prefix,
@@ -744,8 +848,8 @@
 	else if (LINUX_S_ISSOCK(inode->i_mode)) i_type = "socket";
 	else i_type = "bad type";
 	fprintf(out, "%sInode: %u   Type: %s    ", prefix, inode_num, i_type);
-	fprintf(out, "%sMode:  %04o   Flags: 0x%x\n",
-		prefix, inode->i_mode & 0777, inode->i_flags);
+	fprintf(out, "%sMode:  0%03o   Flags: 0x%x\n",
+		prefix, inode->i_mode & 07777, inode->i_flags);
 	if (is_large_inode && large_inode->i_extra_isize >= 24) {
 		fprintf(out, "%sGeneration: %u    Version: 0x%08x:%08x\n",
 			prefix, inode->i_generation, large_inode->i_version_hi,
@@ -754,32 +858,34 @@
 		fprintf(out, "%sGeneration: %u    Version: 0x%08x\n", prefix,
 			inode->i_generation, inode->osd1.linux1.l_i_version);
 	}
-	fprintf(out, "%sUser: %5d   Group: %5d   Size: ",
+	fprintf(out, "%sUser: %5d   Group: %5d",
 		prefix, inode_uid(*inode), inode_gid(*inode));
-	if (LINUX_S_ISREG(inode->i_mode))
-		fprintf(out, "%llu\n", EXT2_I_SIZE(inode));
+	if (is_large_inode && large_inode->i_extra_isize >= 32)
+		fprintf(out, "   Project: %5d", large_inode->i_projid);
+	fputs("   Size: ", out);
+	if (LINUX_S_ISREG(inode->i_mode) || LINUX_S_ISDIR(inode->i_mode))
+		fprintf(out, "%llu\n", (unsigned long long) EXT2_I_SIZE(inode));
 	else
-		fprintf(out, "%d\n", inode->i_size);
+		fprintf(out, "%u\n", inode->i_size);
 	if (os == EXT2_OS_HURD)
 		fprintf(out,
-			"%sFile ACL: %d    Directory ACL: %d Translator: %d\n",
+			"%sFile ACL: %u Translator: %u\n",
 			prefix,
-			inode->i_file_acl, LINUX_S_ISDIR(inode->i_mode) ? inode->i_dir_acl : 0,
+			inode->i_file_acl,
 			inode->osd1.hurd1.h_i_translator);
 	else
-		fprintf(out, "%sFile ACL: %llu    Directory ACL: %d\n",
+		fprintf(out, "%sFile ACL: %llu\n",
 			prefix,
 			inode->i_file_acl | ((long long)
-				(inode->osd2.linux2.l_i_file_acl_high) << 32),
-			LINUX_S_ISDIR(inode->i_mode) ? inode->i_dir_acl : 0);
-	if (os == EXT2_OS_LINUX)
-		fprintf(out, "%sLinks: %d   Blockcount: %llu\n",
+				(inode->osd2.linux2.l_i_file_acl_high) << 32));
+	if (os != EXT2_OS_HURD)
+		fprintf(out, "%sLinks: %u   Blockcount: %llu\n",
 			prefix, inode->i_links_count,
 			(((unsigned long long)
 			  inode->osd2.linux2.l_i_blocks_hi << 32)) +
 			inode->i_blocks);
 	else
-		fprintf(out, "%sLinks: %d   Blockcount: %u\n",
+		fprintf(out, "%sLinks: %u   Blockcount: %u\n",
 			prefix, inode->i_links_count, inode->i_blocks);
 	switch (os) {
 	    case EXT2_OS_HURD:
@@ -789,38 +895,63 @@
 	    default:
 		frag = fsize = 0;
 	}
-	fprintf(out, "%sFragment:  Address: %d    Number: %d    Size: %d\n",
+	fprintf(out, "%sFragment:  Address: %u    Number: %u    Size: %u\n",
 		prefix, inode->i_faddr, frag, fsize);
 	if (is_large_inode && large_inode->i_extra_isize >= 24) {
 		fprintf(out, "%s ctime: 0x%08x:%08x -- %s", prefix,
 			inode->i_ctime, large_inode->i_ctime_extra,
-			time_to_string(inode->i_ctime));
+			inode_time_to_string(inode->i_ctime,
+					     large_inode->i_ctime_extra));
 		fprintf(out, "%s atime: 0x%08x:%08x -- %s", prefix,
 			inode->i_atime, large_inode->i_atime_extra,
-			time_to_string(inode->i_atime));
+			inode_time_to_string(inode->i_atime,
+					     large_inode->i_atime_extra));
 		fprintf(out, "%s mtime: 0x%08x:%08x -- %s", prefix,
 			inode->i_mtime, large_inode->i_mtime_extra,
-			time_to_string(inode->i_mtime));
+			inode_time_to_string(inode->i_mtime,
+					     large_inode->i_mtime_extra));
 		fprintf(out, "%scrtime: 0x%08x:%08x -- %s", prefix,
 			large_inode->i_crtime, large_inode->i_crtime_extra,
-			time_to_string(large_inode->i_crtime));
+			inode_time_to_string(large_inode->i_crtime,
+					     large_inode->i_crtime_extra));
+		if (inode->i_dtime)
+			fprintf(out, "%s dtime: 0x%08x:(%08x) -- %s", prefix,
+				large_inode->i_dtime, large_inode->i_ctime_extra,
+				inode_time_to_string(inode->i_dtime,
+						     large_inode->i_ctime_extra));
 	} else {
 		fprintf(out, "%sctime: 0x%08x -- %s", prefix, inode->i_ctime,
-			time_to_string(inode->i_ctime));
+			time_to_string((__s32) inode->i_ctime));
 		fprintf(out, "%satime: 0x%08x -- %s", prefix, inode->i_atime,
-			time_to_string(inode->i_atime));
+			time_to_string((__s32) inode->i_atime));
 		fprintf(out, "%smtime: 0x%08x -- %s", prefix, inode->i_mtime,
-			time_to_string(inode->i_mtime));
+			time_to_string((__s32) inode->i_mtime));
+		if (inode->i_dtime)
+			fprintf(out, "%sdtime: 0x%08x -- %s", prefix,
+				inode->i_dtime,
+				time_to_string((__s32) inode->i_dtime));
 	}
-	if (inode->i_dtime)
-	  fprintf(out, "%sdtime: 0x%08x -- %s", prefix, inode->i_dtime,
-		  time_to_string(inode->i_dtime));
 	if (EXT2_INODE_SIZE(current_fs->super) > EXT2_GOOD_OLD_INODE_SIZE)
 		internal_dump_inode_extra(out, prefix, inode_num,
 					  (struct ext2_inode_large *) inode);
-	if (LINUX_S_ISLNK(inode->i_mode) && ext2fs_inode_data_blocks(current_fs,inode) == 0)
-		fprintf(out, "%sFast_link_dest: %.*s\n", prefix,
-			(int) inode->i_size, (char *)inode->i_block);
+	dump_inode_attributes(out, inode_num);
+	if (ext2fs_has_feature_metadata_csum(current_fs->super)) {
+		__u32 crc = inode->i_checksum_lo;
+		if (is_large_inode &&
+		    large_inode->i_extra_isize >=
+				(offsetof(struct ext2_inode_large,
+					  i_checksum_hi) -
+				 EXT2_GOOD_OLD_INODE_SIZE))
+			crc |= ((__u32)large_inode->i_checksum_hi) << 16;
+		fprintf(out, "Inode checksum: 0x%08x\n", crc);
+	}
+
+	if (LINUX_S_ISLNK(inode->i_mode) && ext2fs_is_fast_symlink(inode))
+		fprintf(out, "%sFast link dest: \"%.*s\"\n", prefix,
+			(int)EXT2_I_SIZE(inode), (char *)inode->i_block);
+	else if (LINUX_S_ISLNK(inode->i_mode) &&
+		   (inode->i_flags & EXT4_INLINE_DATA_FL))
+		dump_inline_symlink(out, inode_num, inode, prefix);
 	else if (LINUX_S_ISBLK(inode->i_mode) || LINUX_S_ISCHR(inode->i_mode)) {
 		int major, minor;
 		const char *devnote;
@@ -841,6 +972,8 @@
 		if (inode->i_flags & EXT4_EXTENTS_FL)
 			dump_extents(out, prefix, inode_num,
 				     DUMP_LEAF_EXTENTS|DUMP_NODE_EXTENTS, 0, 0);
+		else if (inode->i_flags & EXT4_INLINE_DATA_FL)
+			dump_inline_data(out, prefix, inode_num);
 		else
 			dump_blocks(out, prefix, inode_num);
 	}
@@ -855,7 +988,8 @@
 	close_pager(out);
 }
 
-void do_stat(int argc, char *argv[])
+void do_stat(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	inode;
 	struct ext2_inode * inode_buf;
@@ -875,8 +1009,8 @@
 		return;
 	}
 
-	if (debugfs_read_inode_full(inode, inode_buf, argv[0],
-					EXT2_INODE_SIZE(current_fs->super))) {
+	if (debugfs_read_inode2(inode, inode_buf, argv[0],
+				EXT2_INODE_SIZE(current_fs->super), 0)) {
 		free(inode_buf);
 		return;
 	}
@@ -886,7 +1020,8 @@
 	return;
 }
 
-void do_dump_extents(int argc, char **argv)
+void do_dump_extents(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		     void *infop EXT2FS_ATTR((unused)))
 {
 	struct ext2_inode inode;
 	ext2_ino_t	ino;
@@ -953,11 +1088,12 @@
 			     int ref_offset EXT2FS_ATTR((unused)),
 			     void *private EXT2FS_ATTR((unused)))
 {
-	printf("%llu ", *blocknr);
+	printf("%llu ", (unsigned long long) *blocknr);
 	return 0;
 }
 
-void do_blocks(int argc, char *argv[])
+void do_blocks(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	       void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	inode;
 
@@ -974,7 +1110,8 @@
 	return;
 }
 
-void do_chroot(int argc, char *argv[])
+void do_chroot(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	       void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t inode;
 	int retval;
@@ -991,7 +1128,8 @@
 }
 
 #ifndef READ_ONLY
-void do_clri(int argc, char *argv[])
+void do_clri(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t inode;
 	struct ext2_inode inode_buf;
@@ -1006,7 +1144,8 @@
 		return;
 }
 
-void do_freei(int argc, char *argv[])
+void do_freei(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
 	unsigned int	len = 1;
 	int		err = 0;
@@ -1036,7 +1175,8 @@
 	ext2fs_mark_ib_dirty(current_fs);
 }
 
-void do_seti(int argc, char *argv[])
+void do_seti(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	unsigned int	len = 1;
 	int		err = 0;
@@ -1067,7 +1207,8 @@
 }
 #endif /* READ_ONLY */
 
-void do_testi(int argc, char *argv[])
+void do_testi(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t inode;
 
@@ -1081,7 +1222,8 @@
 }
 
 #ifndef READ_ONLY
-void do_freeb(int argc, char *argv[])
+void do_freeb(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
 	blk64_t block;
 	blk64_t count = 1;
@@ -1093,14 +1235,15 @@
 	while (count-- > 0) {
 		if (!ext2fs_test_block_bitmap2(current_fs->block_map,block))
 			com_err(argv[0], 0, "Warning: block %llu already clear",
-				block);
+				(unsigned long long) block);
 		ext2fs_unmark_block_bitmap2(current_fs->block_map,block);
 		block++;
 	}
 	ext2fs_mark_bb_dirty(current_fs);
 }
 
-void do_setb(int argc, char *argv[])
+void do_setb(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	blk64_t block;
 	blk64_t count = 1;
@@ -1112,7 +1255,7 @@
 	while (count-- > 0) {
 		if (ext2fs_test_block_bitmap2(current_fs->block_map,block))
 			com_err(argv[0], 0, "Warning: block %llu already set",
-				block);
+				(unsigned long long) block);
 		ext2fs_mark_block_bitmap2(current_fs->block_map,block);
 		block++;
 	}
@@ -1120,7 +1263,8 @@
 }
 #endif /* READ_ONLY */
 
-void do_testb(int argc, char *argv[])
+void do_testb(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
 	blk64_t block;
 	blk64_t count = 1;
@@ -1129,9 +1273,11 @@
 		return;
 	while (count-- > 0) {
 		if (ext2fs_test_block_bitmap2(current_fs->block_map,block))
-			printf("Block %llu marked in use\n", block);
+			printf("Block %llu marked in use\n",
+			       (unsigned long long) block);
 		else
-			printf("Block %llu not in use\n", block);
+			printf("Block %llu not in use\n",
+			       (unsigned long long) block);
 		block++;
 	}
 }
@@ -1204,7 +1350,8 @@
 }
 
 
-void do_modify_inode(int argc, char *argv[])
+void do_modify_inode(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		     void *infop EXT2FS_ATTR((unused)))
 {
 	struct ext2_inode inode;
 	ext2_ino_t	inode_num;
@@ -1244,10 +1391,9 @@
 	modify_u32(argv[0], "Reserved1", decimal_format, &inode.i_reserved1);
 #endif
 	modify_u32(argv[0], "File acl", decimal_format, &inode.i_file_acl);
-	if (LINUX_S_ISDIR(inode.i_mode))
-		modify_u32(argv[0], "Directory acl", decimal_format, &inode.i_dir_acl);
-	else
-		modify_u32(argv[0], "High 32bits of size", decimal_format, &inode.i_size_high);
+
+	modify_u32(argv[0], "High 32bits of size", decimal_format,
+		   &inode.i_size_high);
 
 	if (os == EXT2_OS_HURD)
 		modify_u32(argv[0], "Translator Block",
@@ -1268,7 +1414,7 @@
 		modify_u8(argv[0], "Fragment size", decimal_format, fsize);
 
 	for (i=0;  i < EXT2_NDIR_BLOCKS; i++) {
-		sprintf(buf, "Direct Block #%d", i);
+		sprintf(buf, "Direct Block #%u", i);
 		modify_u32(argv[0], buf, decimal_format, &inode.i_block[i]);
 	}
 	modify_u32(argv[0], "Indirect Block", decimal_format,
@@ -1282,7 +1428,9 @@
 }
 #endif /* READ_ONLY */
 
-void do_change_working_dir(int argc, char *argv[])
+void do_change_working_dir(int argc, char *argv[],
+			   int sci_idx EXT2FS_ATTR((unused)),
+			   void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	inode;
 	int		retval;
@@ -1299,7 +1447,9 @@
 	return;
 }
 
-void do_print_working_directory(int argc, char *argv[])
+void do_print_working_directory(int argc, char *argv[],
+				int sci_idx EXT2FS_ATTR((unused)),
+				void *infop EXT2FS_ATTR((unused)))
 {
 	int	retval;
 	char	*pathname = NULL;
@@ -1388,7 +1538,8 @@
 }
 
 
-void do_link(int argc, char *argv[])
+void do_link(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	if (common_args_process(argc, argv, 3, 3, "link",
 				"<source file> <dest_name>", CHECK_FS_RW))
@@ -1410,7 +1561,8 @@
 	return 0;
 }
 
-void do_undel(int argc, char *argv[])
+void do_undel(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	ino;
 	struct ext2_inode inode;
@@ -1473,7 +1625,8 @@
 	return;
 }
 
-void do_unlink(int argc, char *argv[])
+void do_unlink(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	       void *infop EXT2FS_ATTR((unused)))
 {
 	if (common_args_process(argc, argv, 2, 2, "link",
 				"<pathname>", CHECK_FS_RW))
@@ -1481,9 +1634,39 @@
 
 	unlink_file_by_name(argv[1]);
 }
+
+void do_copy_inode(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		   void *infop EXT2FS_ATTR((unused)))
+{
+	ext2_ino_t	src_ino, dest_ino;
+	unsigned char	buf[4096];
+
+	if (common_args_process(argc, argv, 3, 3, "copy_inode",
+				"<source file> <dest_name>", CHECK_FS_RW))
+		return;
+
+	src_ino = string_to_inode(argv[1]);
+	if (!src_ino)
+		return;
+
+	dest_ino = string_to_inode(argv[2]);
+	if (!dest_ino)
+		return;
+
+	if (debugfs_read_inode2(src_ino, (struct ext2_inode *) buf,
+				argv[0], sizeof(buf), 0))
+		return;
+
+	if (debugfs_write_inode2(dest_ino, (struct ext2_inode *) buf,
+				 argv[0], sizeof(buf), 0))
+		return;
+}
+
 #endif /* READ_ONLY */
 
-void do_find_free_block(int argc, char *argv[])
+void do_find_free_block(int argc, char *argv[],
+			int sci_idx EXT2FS_ATTR((unused)),
+			void *infop EXT2FS_ATTR((unused)))
 {
 	blk64_t	free_blk, goal, first_free = 0;
  	int		count;
@@ -1530,12 +1713,14 @@
 			com_err("ext2fs_new_block", retval, 0);
 			return;
 		} else
-			printf("%llu ", free_blk);
+			printf("%llu ", (unsigned long long) free_blk);
 	}
  	printf("\n");
 }
 
-void do_find_free_inode(int argc, char *argv[])
+void do_find_free_inode(int argc, char *argv[],
+			int sci_idx EXT2FS_ATTR((unused)),
+			void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	free_inode, dir;
 	int		mode;
@@ -1543,7 +1728,7 @@
 	char		*tmp;
 
 	if (argc > 3 || (argc>1 && *argv[1] == '?')) {
-		com_err(argv[0], 0, "Usage: find_free_inode [dir] [mode]");
+		com_err(argv[0], 0, "Usage: find_free_inode [dir [mode]]");
 		return;
 	}
 	if (check_fs_open(argv[0]))
@@ -1575,189 +1760,27 @@
 }
 
 #ifndef READ_ONLY
-static errcode_t copy_file(int fd, ext2_ino_t newfile, int bufsize, int make_holes)
+void do_write(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
-	ext2_file_t	e2_file;
 	errcode_t	retval;
-	int		got;
-	unsigned int	written;
-	char		*buf;
-	char		*ptr;
-	char		*zero_buf;
-	int		cmp;
-
-	retval = ext2fs_file_open(current_fs, newfile,
-				  EXT2_FILE_WRITE, &e2_file);
-	if (retval)
-		return retval;
-
-	retval = ext2fs_get_mem(bufsize, &buf);
-	if (retval) {
-		com_err("copy_file", retval, "can't allocate buffer\n");
-		return retval;
-	}
-
-	/* This is used for checking whether the whole block is zero */
-	retval = ext2fs_get_memzero(bufsize, &zero_buf);
-	if (retval) {
-		com_err("copy_file", retval, "can't allocate buffer\n");
-		ext2fs_free_mem(&buf);
-		return retval;
-	}
-
-	while (1) {
-		got = read(fd, buf, bufsize);
-		if (got == 0)
-			break;
-		if (got < 0) {
-			retval = errno;
-			goto fail;
-		}
-		ptr = buf;
-
-		/* Sparse copy */
-		if (make_holes) {
-			/* Check whether all is zero */
-			cmp = memcmp(ptr, zero_buf, got);
-			if (cmp == 0) {
-				 /* The whole block is zero, make a hole */
-				retval = ext2fs_file_lseek(e2_file, got, EXT2_SEEK_CUR, NULL);
-				if (retval)
-					goto fail;
-				got = 0;
-			}
-		}
-
-		/* Normal copy */
-		while (got > 0) {
-			retval = ext2fs_file_write(e2_file, ptr,
-						   got, &written);
-			if (retval)
-				goto fail;
-
-			got -= written;
-			ptr += written;
-		}
-	}
-	ext2fs_free_mem(&buf);
-	ext2fs_free_mem(&zero_buf);
-	retval = ext2fs_file_close(e2_file);
-	return retval;
-
-fail:
-	ext2fs_free_mem(&buf);
-	ext2fs_free_mem(&zero_buf);
-	(void) ext2fs_file_close(e2_file);
-	return retval;
-}
-
-
-void do_write(int argc, char *argv[])
-{
-	int		fd;
-	struct stat	statbuf;
-	ext2_ino_t	newfile;
-	errcode_t	retval;
-	struct ext2_inode inode;
-	int		bufsize = IO_BUFSIZE;
-	int		make_holes = 0;
 
 	if (common_args_process(argc, argv, 3, 3, "write",
 				"<native file> <new file>", CHECK_FS_RW))
 		return;
 
-	fd = open(argv[1], O_RDONLY);
-	if (fd < 0) {
-		com_err(argv[1], errno, 0);
-		return;
-	}
-	if (fstat(fd, &statbuf) < 0) {
-		com_err(argv[1], errno, 0);
-		close(fd);
-		return;
-	}
-
-	retval = ext2fs_namei(current_fs, root, cwd, argv[2], &newfile);
-	if (retval == 0) {
-		com_err(argv[0], 0, "The file '%s' already exists\n", argv[2]);
-		close(fd);
-		return;
-	}
-
-	retval = ext2fs_new_inode(current_fs, cwd, 010755, 0, &newfile);
-	if (retval) {
+	retval = do_write_internal(current_fs, cwd, argv[1], argv[2], root);
+	if (retval)
 		com_err(argv[0], retval, 0);
-		close(fd);
-		return;
-	}
-	printf("Allocated inode: %u\n", newfile);
-	retval = ext2fs_link(current_fs, cwd, argv[2], newfile,
-			     EXT2_FT_REG_FILE);
-	if (retval == EXT2_ET_DIR_NO_SPACE) {
-		retval = ext2fs_expand_dir(current_fs, cwd);
-		if (retval) {
-			com_err(argv[0], retval, "while expanding directory");
-			close(fd);
-			return;
-		}
-		retval = ext2fs_link(current_fs, cwd, argv[2], newfile,
-				     EXT2_FT_REG_FILE);
-	}
-	if (retval) {
-		com_err(argv[2], retval, 0);
-		close(fd);
-		return;
-	}
-        if (ext2fs_test_inode_bitmap2(current_fs->inode_map,newfile))
-		com_err(argv[0], 0, "Warning: inode already set");
-	ext2fs_inode_alloc_stats2(current_fs, newfile, +1, 0);
-	memset(&inode, 0, sizeof(inode));
-	inode.i_mode = (statbuf.st_mode & ~LINUX_S_IFMT) | LINUX_S_IFREG;
-	inode.i_atime = inode.i_ctime = inode.i_mtime =
-		current_fs->now ? current_fs->now : time(0);
-	inode.i_links_count = 1;
-	inode.i_size = statbuf.st_size;
-	if (current_fs->super->s_feature_incompat &
-	    EXT3_FEATURE_INCOMPAT_EXTENTS) {
-		int i;
-		struct ext3_extent_header *eh;
-
-		eh = (struct ext3_extent_header *) &inode.i_block[0];
-		eh->eh_depth = 0;
-		eh->eh_entries = 0;
-		eh->eh_magic = ext2fs_cpu_to_le16(EXT3_EXT_MAGIC);
-		i = (sizeof(inode.i_block) - sizeof(*eh)) /
-			sizeof(struct ext3_extent);
-		eh->eh_max = ext2fs_cpu_to_le16(i);
-		inode.i_flags |= EXT4_EXTENTS_FL;
-	}
-	if (debugfs_write_new_inode(newfile, &inode, argv[0])) {
-		close(fd);
-		return;
-	}
-	if (LINUX_S_ISREG(inode.i_mode)) {
-		if (statbuf.st_blocks < statbuf.st_size / S_BLKSIZE) {
-			make_holes = 1;
-			/*
-			 * Use I/O blocksize as buffer size when
-			 * copying sparse files.
-			 */
-			bufsize = statbuf.st_blksize;
-		}
-		retval = copy_file(fd, newfile, bufsize, make_holes);
-		if (retval)
-			com_err("copy_file", retval, 0);
-	}
-	close(fd);
 }
 
-void do_mknod(int argc, char *argv[])
+void do_mknod(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
-	unsigned long	mode, major, minor;
-	ext2_ino_t	newfile;
+	unsigned long	major, minor;
 	errcode_t 	retval;
-	struct ext2_inode inode;
-	int		filetype, nr;
+	int		nr;
+	struct stat	st;
 
 	if (check_fs_open(argv[0]))
 		return;
@@ -1766,115 +1789,54 @@
 		com_err(argv[0], 0, "Usage: mknod <name> [p| [c|b] <major> <minor>]");
 		return;
 	}
-	mode = minor = major = 0;
+
+	minor = major = 0;
 	switch (argv[2][0]) {
 		case 'p':
-			mode = LINUX_S_IFIFO;
-			filetype = EXT2_FT_FIFO;
+			st.st_mode = S_IFIFO;
 			nr = 3;
 			break;
 		case 'c':
-			mode = LINUX_S_IFCHR;
-			filetype = EXT2_FT_CHRDEV;
+			st.st_mode = S_IFCHR;
 			nr = 5;
 			break;
 		case 'b':
-			mode = LINUX_S_IFBLK;
-			filetype = EXT2_FT_BLKDEV;
+			st.st_mode = S_IFBLK;
 			nr = 5;
 			break;
 		default:
-			filetype = 0;
 			nr = 0;
 	}
+
 	if (nr == 5) {
 		major = strtoul(argv[3], argv+3, 0);
 		minor = strtoul(argv[4], argv+4, 0);
 		if (major > 65535 || minor > 65535 || argv[3][0] || argv[4][0])
 			nr = 0;
 	}
+
 	if (argc != nr)
 		goto usage;
-	if (check_fs_read_write(argv[0]))
-		return;
-	retval = ext2fs_new_inode(current_fs, cwd, 010755, 0, &newfile);
-	if (retval) {
+
+	st.st_rdev = makedev(major, minor);
+	retval = do_mknod_internal(current_fs, cwd, argv[1],
+				   st.st_mode, st.st_rdev);
+	if (retval)
 		com_err(argv[0], retval, 0);
-		return;
-	}
-	printf("Allocated inode: %u\n", newfile);
-	retval = ext2fs_link(current_fs, cwd, argv[1], newfile, filetype);
-	if (retval == EXT2_ET_DIR_NO_SPACE) {
-		retval = ext2fs_expand_dir(current_fs, cwd);
-		if (retval) {
-			com_err(argv[0], retval, "while expanding directory");
-			return;
-		}
-		retval = ext2fs_link(current_fs, cwd, argv[1], newfile,
-				     filetype);
-	}
-	if (retval) {
-		com_err(argv[1], retval, 0);
-		return;
-	}
-        if (ext2fs_test_inode_bitmap2(current_fs->inode_map,newfile))
-		com_err(argv[0], 0, "Warning: inode already set");
-	ext2fs_inode_alloc_stats2(current_fs, newfile, +1, 0);
-	memset(&inode, 0, sizeof(inode));
-	inode.i_mode = mode;
-	inode.i_atime = inode.i_ctime = inode.i_mtime =
-		current_fs->now ? current_fs->now : time(0);
-	if ((major < 256) && (minor < 256)) {
-		inode.i_block[0] = major*256+minor;
-		inode.i_block[1] = 0;
-	} else {
-		inode.i_block[0] = 0;
-		inode.i_block[1] = (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
-	}
-	inode.i_links_count = 1;
-	if (debugfs_write_new_inode(newfile, &inode, argv[0]))
-		return;
 }
 
-void do_mkdir(int argc, char *argv[])
+void do_mkdir(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
-	char	*cp;
-	ext2_ino_t	parent;
-	char	*name;
 	errcode_t retval;
 
 	if (common_args_process(argc, argv, 2, 2, "mkdir",
 				"<filename>", CHECK_FS_RW))
 		return;
 
-	cp = strrchr(argv[1], '/');
-	if (cp) {
-		*cp = 0;
-		parent = string_to_inode(argv[1]);
-		if (!parent) {
-			com_err(argv[1], ENOENT, 0);
-			return;
-		}
-		name = cp+1;
-	} else {
-		parent = cwd;
-		name = argv[1];
-	}
-
-try_again:
-	retval = ext2fs_mkdir(current_fs, parent, 0, name);
-	if (retval == EXT2_ET_DIR_NO_SPACE) {
-		retval = ext2fs_expand_dir(current_fs, parent);
-		if (retval) {
-			com_err(argv[0], retval, "while expanding directory");
-			return;
-		}
-		goto try_again;
-	}
-	if (retval) {
-		com_err("ext2fs_mkdir", retval, 0);
-		return;
-	}
+	retval = do_mkdir_internal(current_fs, cwd, argv[1], root);
+	if (retval)
+		com_err(argv[0], retval, 0);
 
 }
 
@@ -1882,11 +1844,17 @@
 			       e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
 			       blk64_t ref_block EXT2FS_ATTR((unused)),
 			       int ref_offset EXT2FS_ATTR((unused)),
-			       void *private EXT2FS_ATTR((unused)))
+			       void *private)
 {
-	blk64_t	block;
+	blk64_t	block = *blocknr;
+	blk64_t *last_cluster = (blk64_t *)private;
+	blk64_t cluster = EXT2FS_B2C(fs, block);
 
-	block = *blocknr;
+	if (cluster == *last_cluster)
+		return 0;
+
+	*last_cluster = cluster;
+
 	ext2fs_block_alloc_stats2(fs, block, -1);
 	return 0;
 }
@@ -1900,18 +1868,19 @@
 	inode_buf.i_dtime = current_fs->now ? current_fs->now : time(0);
 	if (debugfs_write_inode(inode, &inode_buf, 0))
 		return;
-	if (!ext2fs_inode_has_valid_blocks2(current_fs, &inode_buf))
-		return;
-
-	ext2fs_block_iterate3(current_fs, inode, BLOCK_FLAG_READ_ONLY, NULL,
-			      release_blocks_proc, NULL);
+	if (ext2fs_inode_has_valid_blocks2(current_fs, &inode_buf)) {
+		blk64_t last_cluster = 0;
+		ext2fs_block_iterate3(current_fs, inode, BLOCK_FLAG_READ_ONLY,
+				      NULL, release_blocks_proc, &last_cluster);
+	}
 	printf("\n");
 	ext2fs_inode_alloc_stats2(current_fs, inode, -1,
 				  LINUX_S_ISDIR(inode_buf.i_mode));
 }
 
 
-void do_kill_file(int argc, char *argv[])
+void do_kill_file(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t inode_num;
 
@@ -1921,7 +1890,8 @@
 	kill_file_by_inode(inode_num);
 }
 
-void do_rm(int argc, char *argv[])
+void do_rm(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	   void *infop EXT2FS_ATTR((unused)))
 {
 	int retval;
 	ext2_ino_t inode_num;
@@ -1971,9 +1941,9 @@
 
 	if (dirent->inode == 0)
 		return 0;
-	if (((dirent->name_len&0xFF) == 1) && (dirent->name[0] == '.'))
+	if ((ext2fs_dirent_name_len(dirent) == 1) && (dirent->name[0] == '.'))
 		return 0;
-	if (((dirent->name_len&0xFF) == 2) && (dirent->name[0] == '.') &&
+	if ((ext2fs_dirent_name_len(dirent) == 2) && (dirent->name[0] == '.') &&
 	    (dirent->name[1] == '.')) {
 		rds->parent = dirent->inode;
 		return 0;
@@ -1982,7 +1952,8 @@
 	return 0;
 }
 
-void do_rmdir(int argc, char *argv[])
+void do_rmdir(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
 	int retval;
 	ext2_ino_t inode_num;
@@ -2040,7 +2011,9 @@
 #endif /* READ_ONLY */
 
 void do_show_debugfs_params(int argc EXT2FS_ATTR((unused)),
-			    char *argv[] EXT2FS_ATTR((unused)))
+			    char *argv[] EXT2FS_ATTR((unused)),
+			    int sci_idx EXT2FS_ATTR((unused)),
+			    void *infop EXT2FS_ATTR((unused)))
 {
 	if (current_fs)
 		printf("Open mode: read-%s\n",
@@ -2050,7 +2023,8 @@
 }
 
 #ifndef READ_ONLY
-void do_expand_dir(int argc, char *argv[])
+void do_expand_dir(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		    void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t inode;
 	int retval;
@@ -2064,7 +2038,8 @@
 	return;
 }
 
-void do_features(int argc, char *argv[])
+void do_features(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
 {
 	int	i;
 
@@ -2085,34 +2060,73 @@
 }
 #endif /* READ_ONLY */
 
-void do_bmap(int argc, char *argv[])
+void do_bmap(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	ino;
-	blk64_t		blk, pblk;
-	int		err;
+	blk64_t		blk, pblk = 0;
+	int		c, err, flags = 0, ret_flags = 0;
 	errcode_t	errcode;
 
-	if (common_args_process(argc, argv, 3, 3, argv[0],
-				"<file> logical_blk", 0))
+	if (check_fs_open(argv[0]))
 		return;
 
-	ino = string_to_inode(argv[1]);
+	reset_getopt();
+	while ((c = getopt (argc, argv, "a")) != EOF) {
+		switch (c) {
+		case 'a':
+			flags |= BMAP_ALLOC;
+			break;
+		default:
+			goto print_usage;
+		}
+	}
+
+	if (argc <= optind+1) {
+	print_usage:
+		com_err(0, 0,
+			"Usage: bmap [-a] <file> logical_blk [physical_blk]");
+		return;
+	}
+
+	ino = string_to_inode(argv[optind++]);
 	if (!ino)
 		return;
-	err = strtoblk(argv[0], argv[2], &blk);
+	err = strtoblk(argv[0], argv[optind++], "logical block", &blk);
 	if (err)
 		return;
 
-	errcode = ext2fs_bmap2(current_fs, ino, 0, 0, 0, blk, 0, &pblk);
+	if (argc > optind+1)
+		goto print_usage;
+
+	if (argc == optind+1) {
+		err = strtoblk(argv[0], argv[optind++],
+			       "physical block", &pblk);
+		if (err)
+			return;
+		if (flags & BMAP_ALLOC) {
+			com_err(0, 0, "Can't set and allocate a block");
+			return;
+		}
+		flags |= BMAP_SET;
+	}
+
+	errcode = ext2fs_bmap2(current_fs, ino, 0, 0, flags, blk,
+			       &ret_flags, &pblk);
 	if (errcode) {
 		com_err(argv[0], errcode,
-			"while mapping logical block %llu\n", blk);
+			"while mapping logical block %llu\n",
+			(unsigned long long) blk);
 		return;
 	}
-	printf("%llu\n", pblk);
+	printf("%llu", (unsigned long long) pblk);
+	if (ret_flags & BMAP_RET_UNINIT)
+		fputs(" (uninit)", stdout);
+	fputc('\n', stdout);
 }
 
-void do_imap(int argc, char *argv[])
+void do_imap(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	ino;
 	unsigned long 	group, block, block_nr, offset;
@@ -2137,23 +2151,95 @@
 		block;
 	offset &= (EXT2_BLOCK_SIZE(current_fs->super) - 1);
 
-	printf("Inode %d is part of block group %lu\n"
+	printf("Inode %u is part of block group %lu\n"
 	       "\tlocated at block %lu, offset 0x%04lx\n", ino, group,
 	       block_nr, offset);
 
 }
 
-#ifndef READ_ONLY
-void do_set_current_time(int argc, char *argv[])
+void do_idump(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
-	time_t now;
+	struct ext2_inode_large *inode;
+	ext2_ino_t	ino;
+	unsigned char	*buf;
+	errcode_t	err;
+	unsigned int	isize, size, offset = 0;
+	int		c, mode = 0;
+
+	reset_getopt();
+	while ((c = getopt (argc, argv, "bex")) != EOF) {
+		if (mode || c == '?') {
+			com_err(argv[0], 0,
+				"Usage: inode_dump [-b]|[-e] <file>");
+			return;
+		}
+		mode = c;
+	}
+	if (optind != argc-1)
+		return;
+
+	if (check_fs_open(argv[0]))
+		return;
+
+	ino = string_to_inode(argv[optind]);
+	if (!ino)
+		return;
+
+	isize = EXT2_INODE_SIZE(current_fs->super);
+	err = ext2fs_get_mem(isize, &buf);
+	if (err) {
+		com_err(argv[0], err, "while allocating memory");
+		return;
+	}
+
+	err = ext2fs_read_inode_full(current_fs, ino,
+				     (struct ext2_inode *)buf, isize);
+	if (err) {
+		com_err(argv[0], err, "while reading inode %u", ino);
+		goto err;
+	}
+
+	inode = (struct ext2_inode_large *) buf;
+	size = isize;
+	switch (mode) {
+	case 'b':
+		offset = ((char *) (&inode->i_block)) - ((char *) buf);
+		size = sizeof(inode->i_block);
+		break;
+	case 'x':
+	case 'e':
+		if (size <= EXT2_GOOD_OLD_INODE_SIZE) {
+			com_err(argv[0], 0, "No extra space in inode");
+			goto err;
+		}
+		offset = EXT2_GOOD_OLD_INODE_SIZE + inode->i_extra_isize;
+		if (offset > size)
+			goto err;
+		size -= offset;
+		break;
+	}
+	if (mode == 'x')
+		raw_inode_xattr_dump(stdout, buf + offset, size);
+	else
+		do_byte_hexdump(stdout, buf + offset, size);
+err:
+	ext2fs_free_mem(&buf);
+}
+
+#ifndef READ_ONLY
+void do_set_current_time(int argc, char *argv[],
+			 int sci_idx EXT2FS_ATTR((unused)),
+			 void *infop EXT2FS_ATTR((unused)))
+{
+	__s64 now;
 
 	if (common_args_process(argc, argv, 2, 2, argv[0],
 				"<time>", 0))
 		return;
 
 	now = string_to_time(argv[1]);
-	if (now == ((time_t) -1)) {
+	if (now == -1) {
 		com_err(argv[0], 0, "Couldn't parse argument as a time: %s\n",
 			argv[1]);
 		return;
@@ -2203,15 +2289,17 @@
 	return 0;
 }
 
-void do_supported_features(int argc, char *argv[])
+void do_supported_features(int argc, char *argv[],
+			   int sci_idx EXT2FS_ATTR((unused)),
+			   void *infop EXT2FS_ATTR((unused)))
 {
         int	ret;
 	__u32	supp[3] = { EXT2_LIB_FEATURE_COMPAT_SUPP,
 			    EXT2_LIB_FEATURE_INCOMPAT_SUPP,
 			    EXT2_LIB_FEATURE_RO_COMPAT_SUPP };
-	__u32	jrnl_supp[3] = { JFS_KNOWN_COMPAT_FEATURES,
-				 JFS_KNOWN_INCOMPAT_FEATURES,
-				 JFS_KNOWN_ROCOMPAT_FEATURES };
+	__u32	jrnl_supp[3] = { JBD2_KNOWN_COMPAT_FEATURES,
+				 JBD2_KNOWN_INCOMPAT_FEATURES,
+				 JBD2_KNOWN_ROCOMPAT_FEATURES };
 
 	if (argc > 1) {
 		ret = find_supp_feature(supp, E2P_FS_FEATURE, argv[1]);
@@ -2231,7 +2319,8 @@
 }
 
 #ifndef READ_ONLY
-void do_punch(int argc, char *argv[])
+void do_punch(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	ino;
 	blk64_t		start, end;
@@ -2246,11 +2335,11 @@
 	ino = string_to_inode(argv[1]);
 	if (!ino)
 		return;
-	err = strtoblk(argv[0], argv[2], &start);
+	err = strtoblk(argv[0], argv[2], "logical block", &start);
 	if (err)
 		return;
 	if (argc == 4) {
-		err = strtoblk(argv[0], argv[3], &end);
+		err = strtoblk(argv[0], argv[3], "logical block", &end);
 		if (err)
 			return;
 	} else
@@ -2265,62 +2354,90 @@
 		return;
 	}
 }
-#endif /* READ_ONLY */
 
-void do_symlink(int argc, char *argv[])
+void do_fallocate(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
 {
-	char		*cp;
-	ext2_ino_t	parent;
-	char		*name, *target;
+	ext2_ino_t	ino;
+	blk64_t		start, end;
+	int		err;
+	errcode_t	errcode;
+
+	if (common_args_process(argc, argv, 3, 4, argv[0],
+				"<file> start_blk [end_blk]",
+				CHECK_FS_RW | CHECK_FS_BITMAPS))
+		return;
+
+	ino = string_to_inode(argv[1]);
+	if (!ino)
+		return;
+	err = strtoblk(argv[0], argv[2], "logical block", &start);
+	if (err)
+		return;
+	if (argc == 4) {
+		err = strtoblk(argv[0], argv[3], "logical block", &end);
+		if (err)
+			return;
+	} else
+		end = ~0;
+
+	errcode = ext2fs_fallocate(current_fs, EXT2_FALLOCATE_INIT_BEYOND_EOF,
+				   ino, NULL, ~0ULL, start, end - start + 1);
+
+	if (errcode) {
+		com_err(argv[0], errcode,
+			"while fallocating inode %u from %llu to %llu\n", ino,
+			(unsigned long long) start, (unsigned long long) end);
+		return;
+	}
+}
+
+void do_symlink(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		void *infop EXT2FS_ATTR((unused)))
+{
 	errcode_t	retval;
 
 	if (common_args_process(argc, argv, 3, 3, "symlink",
 				"<filename> <target>", CHECK_FS_RW))
 		return;
 
-	cp = strrchr(argv[1], '/');
-	if (cp) {
-		*cp = 0;
-		parent = string_to_inode(argv[1]);
-		if (!parent) {
-			com_err(argv[1], ENOENT, 0);
-			return;
-		}
-		name = cp+1;
-	} else {
-		parent = cwd;
-		name = argv[1];
-	}
-	target = argv[2];
-
-try_again:
-	retval = ext2fs_symlink(current_fs, parent, 0, name, target);
-	if (retval == EXT2_ET_DIR_NO_SPACE) {
-		retval = ext2fs_expand_dir(current_fs, parent);
-		if (retval) {
-			com_err(argv[0], retval, "while expanding directory");
-			return;
-		}
-		goto try_again;
-	}
-	if (retval) {
-		com_err("ext2fs_symlink", retval, 0);
-		return;
-	}
+	retval = do_symlink_internal(current_fs, cwd, argv[1], argv[2], root);
+	if (retval)
+		com_err(argv[0], retval, 0);
 
 }
+#endif /* READ_ONLY */
 
-void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[])
+#if CONFIG_MMP
+void do_dump_mmp(int argc EXT2FS_ATTR((unused)), char *argv[],
+		 int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
 {
-	struct ext2_super_block *sb;
 	struct mmp_struct *mmp_s;
+	unsigned long long mmp_block;
 	time_t t;
 	errcode_t retval = 0;
 
 	if (check_fs_open(argv[0]))
 		return;
 
-	sb  = current_fs->super;
+	if (argc > 1) {
+		char *end = NULL;
+		mmp_block = strtoull(argv[1], &end, 0);
+		if (end == argv[0] || mmp_block == 0) {
+			fprintf(stderr, "%s: invalid MMP block '%s' given\n",
+				argv[0], argv[1]);
+			return;
+		}
+	} else {
+		mmp_block = current_fs->super->s_mmp_block;
+	}
+
+	if (mmp_block == 0) {
+		fprintf(stderr, "%s: MMP: not active on this filesystem.\n",
+			argv[0]);
+		return;
+	}
 
 	if (current_fs->mmp_buf == NULL) {
 		retval = ext2fs_get_mem(current_fs->blocksize,
@@ -2333,24 +2450,39 @@
 
 	mmp_s = current_fs->mmp_buf;
 
-	retval = ext2fs_mmp_read(current_fs, current_fs->super->s_mmp_block,
-				 current_fs->mmp_buf);
+	retval = ext2fs_mmp_read(current_fs, mmp_block, current_fs->mmp_buf);
 	if (retval) {
-		com_err(argv[0], retval, "reading MMP block.\n");
+		com_err(argv[0], retval, "reading MMP block %llu.\n",
+			(unsigned long long) mmp_block);
 		return;
 	}
 
 	t = mmp_s->mmp_time;
-	fprintf(stdout, "block_number: %llu\n", current_fs->super->s_mmp_block);
+	fprintf(stdout, "block_number: %llu\n",
+		(unsigned long long) current_fs->super->s_mmp_block);
 	fprintf(stdout, "update_interval: %d\n",
 		current_fs->super->s_mmp_update_interval);
 	fprintf(stdout, "check_interval: %d\n", mmp_s->mmp_check_interval);
 	fprintf(stdout, "sequence: %08x\n", mmp_s->mmp_seq);
-	fprintf(stdout, "time: %lld -- %s", mmp_s->mmp_time, ctime(&t));
-	fprintf(stdout, "node_name: %s\n", mmp_s->mmp_nodename);
-	fprintf(stdout, "device_name: %s\n", mmp_s->mmp_bdevname);
+	fprintf(stdout, "time: %llu -- %s",
+		(unsigned long long) mmp_s->mmp_time, ctime(&t));
+	fprintf(stdout, "node_name: %.*s\n",
+		EXT2_LEN_STR(mmp_s->mmp_nodename));
+	fprintf(stdout, "device_name: %.*s\n",
+		EXT2_LEN_STR(mmp_s->mmp_bdevname));
 	fprintf(stdout, "magic: 0x%x\n", mmp_s->mmp_magic);
+	fprintf(stdout, "checksum: 0x%08x\n", mmp_s->mmp_checksum);
 }
+#else
+void do_dump_mmp(int argc EXT2FS_ATTR((unused)),
+		 char *argv[] EXT2FS_ATTR((unused)),
+		 int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
+{
+	fprintf(stdout, "MMP is unsupported, please recompile with "
+	                "--enable-mmp\n");
+}
+#endif
 
 static int source_file(const char *cmd_file, int ss_idx)
 {
@@ -2376,6 +2508,10 @@
 	while (!feof(f)) {
 		if (fgets(buf, sizeof(buf), f) == NULL)
 			break;
+		if (buf[0] == '#') {
+			printf("%s", buf);
+			continue;
+		}
 		cp = strchr(buf, '\n');
 		if (cp)
 			*cp = 0;
@@ -2399,13 +2535,14 @@
 	int		retval;
 	const char	*usage = 
 		"Usage: %s [-b blocksize] [-s superblock] [-f cmd_file] "
-		"[-R request] [-V] ["
+		"[-R request] [-d data_source_device] [-i] [-n] [-D] [-V] ["
 #ifndef READ_ONLY
-		"[-w] "
+		"[-w] [-z undo_file] "
 #endif
-		"[-c] device]";
+		"[-c]] [device]";
 	int		c;
-	int		open_flags = EXT2_FLAG_SOFTSUPP_FEATURES | EXT2_FLAG_64BITS;
+	int		open_flags = EXT2_FLAG_SOFTSUPP_FEATURES |
+				EXT2_FLAG_64BITS | EXT2_FLAG_THREADS;
 	char		*request = 0;
 	int		exit_status = 0;
 	char		*cmd_file = 0;
@@ -2414,9 +2551,13 @@
 	int		catastrophic = 0;
 	char		*data_filename = 0;
 #ifdef READ_ONLY
-	const char	*opt_string = "icR:f:b:s:Vd:D";
+	const char	*opt_string = "nicR:f:b:s:Vd:D";
 #else
-	const char	*opt_string = "iwcR:f:b:s:Vd:D";
+	const char	*opt_string = "niwcR:f:b:s:Vd:Dz:";
+#endif
+	char		*undo_file = NULL;
+#ifdef CONFIG_JBD_DEBUG
+	char		*jbd_debug;
 #endif
 
 	if (debug_prog_name == 0)
@@ -2429,6 +2570,19 @@
 	fprintf (stderr, "%s %s (%s)\n", debug_prog_name,
 		 E2FSPROGS_VERSION, E2FSPROGS_DATE);
 
+#ifdef CONFIG_JBD_DEBUG
+	jbd_debug = ss_safe_getenv("DEBUGFS_JBD_DEBUG");
+	if (jbd_debug) {
+		int res = sscanf(jbd_debug, "%d", &journal_enable_debug);
+
+		if (res != 1) {
+			fprintf(stderr,
+				"DEBUGFS_JBD_DEBUG \"%s\" not an integer\n\n",
+				jbd_debug);
+			exit(1);
+		}
+	}
+#endif
 	while ((c = getopt (argc, argv, opt_string)) != EOF) {
 		switch (c) {
 		case 'R':
@@ -2443,6 +2597,9 @@
 		case 'i':
 			open_flags |= EXT2_FLAG_IMAGE_FILE;
 			break;
+		case 'n':
+			open_flags |= EXT2_FLAG_IGNORE_CSUM_ERRORS;
+			break;
 #ifndef READ_ONLY
 		case 'w':
 			open_flags |= EXT2_FLAG_RW;
@@ -2456,7 +2613,9 @@
 						"block size", 0);
 			break;
 		case 's':
-			retval = strtoblk(argv[0], optarg, &superblock);
+			retval = strtoblk(argv[0], optarg,
+					  "superblock block number",
+					  &superblock);
 			if (retval)
 				return 1;
 			break;
@@ -2468,6 +2627,11 @@
 			fprintf(stderr, "\tUsing %s\n",
 				error_message(EXT2_ET_BASE));
 			exit(0);
+#ifndef READ_ONLY
+		case 'z':
+			undo_file = optarg;
+			break;
+#endif
 		default:
 			com_err(argv[0], 0, usage, debug_prog_name);
 			return 1;
@@ -2476,41 +2640,41 @@
 	if (optind < argc)
 		open_filesystem(argv[optind], open_flags,
 				superblock, blocksize, catastrophic,
-				data_filename);
+				data_filename, undo_file);
 
-	sci_idx = ss_create_invocation(debug_prog_name, "0.0", (char *) NULL,
-				       &debug_cmds, &retval);
+	ss_sci_idx = ss_create_invocation(debug_prog_name, "0.0", (char *) NULL,
+					  &debug_cmds, &retval);
 	if (retval) {
-		ss_perror(sci_idx, retval, "creating invocation");
+		ss_perror(ss_sci_idx, retval, "creating invocation");
 		exit(1);
 	}
-	ss_get_readline(sci_idx);
+	ss_get_readline(ss_sci_idx);
 
-	(void) ss_add_request_table (sci_idx, &ss_std_requests, 1, &retval);
+	(void) ss_add_request_table(ss_sci_idx, &ss_std_requests, 1, &retval);
 	if (retval) {
-		ss_perror(sci_idx, retval, "adding standard requests");
+		ss_perror(ss_sci_idx, retval, "adding standard requests");
 		exit (1);
 	}
 	if (extra_cmds)
-		ss_add_request_table (sci_idx, extra_cmds, 1, &retval);
+		ss_add_request_table(ss_sci_idx, extra_cmds, 1, &retval);
 	if (retval) {
-		ss_perror(sci_idx, retval, "adding extra requests");
+		ss_perror(ss_sci_idx, retval, "adding extra requests");
 		exit (1);
 	}
 	if (request) {
 		retval = 0;
-		retval = ss_execute_line(sci_idx, request);
+		retval = ss_execute_line(ss_sci_idx, request);
 		if (retval) {
-			ss_perror(sci_idx, retval, request);
+			ss_perror(ss_sci_idx, retval, request);
 			exit_status++;
 		}
 	} else if (cmd_file) {
-		exit_status = source_file(cmd_file, sci_idx);
+		exit_status = source_file(cmd_file, ss_sci_idx);
 	} else {
-		ss_listen(sci_idx);
+		ss_listen(ss_sci_idx);
 	}
 
-	ss_delete_invocation(sci_idx);
+	ss_delete_invocation(ss_sci_idx);
 
 	if (current_fs)
 		close_filesystem();
diff --git a/debugfs/debugfs.h b/debugfs/debugfs.h
index 6b4f6ef..39bc024 100644
--- a/debugfs/debugfs.h
+++ b/debugfs/debugfs.h
@@ -5,6 +5,8 @@
 #include "ss/ss.h"
 #include "ext2fs/ext2_fs.h"
 #include "ext2fs/ext2fs.h"
+#include "../misc/create_inode.h"
+#include "support/quotaio.h"
 
 #ifdef __STDC__
 #define NOARGS void
@@ -21,8 +23,9 @@
 #define CHECK_FS_NOTOPEN	0x0004
 
 extern ext2_filsys current_fs;
+extern quota_ctx_t current_qctx;
 extern ext2_ino_t	root, cwd;
-extern int sci_idx;
+extern int ss_sci_idx;
 extern ss_request_table debug_cmds, extent_cmds;
 
 extern void reset_getopt(void);
@@ -33,13 +36,15 @@
 extern int check_fs_read_write(char *name);
 extern int check_fs_bitmaps(char *name);
 extern ext2_ino_t string_to_inode(char *str);
-extern char *time_to_string(__u32);
-extern time_t string_to_time(const char *);
+extern char *inode_time_to_string(__u32 xtime, __u32 xtime_extra);
+extern char *time_to_string(__s64);
+extern __s64 string_to_time(const char *);
 extern unsigned long parse_ulong(const char *str, const char *cmd,
 				 const char *descr, int *err);
 extern unsigned long long parse_ulonglong(const char *str, const char *cmd,
 					  const char *descr, int *err);
-extern int strtoblk(const char *cmd, const char *str, blk64_t *ret);
+extern int strtoblk(const char *cmd, const char *str, const char *errmsg,
+		    blk64_t *ret);
 extern int common_args_process(int argc, char *argv[], int min_argc,
 			       int max_argc, const char *cmd,
 			       const char *usage, int flags);
@@ -49,12 +54,12 @@
 				     blk64_t *block, blk64_t *count);
 extern int debugfs_read_inode(ext2_ino_t ino, struct ext2_inode * inode,
 			      const char *cmd);
-extern int debugfs_read_inode_full(ext2_ino_t ino, struct ext2_inode * inode,
-				   const char *cmd, int bufsize);
+extern int debugfs_read_inode2(ext2_ino_t ino, struct ext2_inode * inode,
+			       const char *cmd, int bufsize, int flags);
 extern int debugfs_write_inode(ext2_ino_t ino, struct ext2_inode * inode,
 			       const char *cmd);
-extern int debugfs_write_inode_full(ext2_ino_t ino, struct ext2_inode * inode,
-				    const char *cmd, int bufsize);
+extern int debugfs_write_inode2(ext2_ino_t ino, struct ext2_inode * inode,
+				const char *cmd, int bufsize, int flags);
 extern int debugfs_write_new_inode(ext2_ino_t ino, struct ext2_inode * inode,
 				   const char *cmd);
 extern int ext2_file_type(unsigned int mode);
@@ -62,117 +67,144 @@
 /* ss command functions */
 
 /* dump.c */
-extern void do_dump(int argc, char **argv);
-extern void do_cat(int argc, char **argv);
-extern void do_rdump(int argc, char **argv);
+extern void do_dump(int argc, char **argv, int sci_idx, void *infop);
+extern void do_cat(int argc, char **argv, int sci_idx, void *infop);
+extern void do_rdump(int argc, char **argv, int sci_idx, void *infop);
 
 /* extent_inode.c */
-extern void do_extent_open(int argc, char **argv);
-extern void do_extent_close(int argc, char **argv);
-extern void do_current_node(int argc, char **argv);
-extern void do_root_node(int argc, char **argv);
-extern void do_last_leaf(int argc, char **argv);
-extern void do_first_sib(int argc, char **argv);
-extern void do_last_sib(int argc, char **argv);
-extern void do_next_sib(int argc, char **argv);
-extern void do_prev_sib(int argc, char **argv);
-extern void do_next_leaf(int argc, char **argv);
-extern void do_prev_leaf(int argc, char **argv);
-extern void do_next(int argc, char **argv);
-extern void do_prev(int argc, char **argv);
-extern void do_up(int argc, char **argv);
-extern void do_down(int argc, char **argv);
-extern void do_delete_node(int argc, char **argv);
-extern void do_replace_node(int argc, char **argv);
-extern void do_split_node(int argc, char **argv);
-extern void do_insert_node(int argc, char **argv);
-extern void do_set_bmap(int argc, char **argv);
-extern void do_print_all(int argc, char **argv);
-extern void do_fix_parents(int argc, char **argv);
-extern void do_info(int argc, char **argv);
-extern void do_goto_block(int argc, char **argv);
+extern void do_extent_open(int argc, char **argv, int sci_idx, void *infop);
+extern void do_extent_close(int argc, char **argv, int sci_idx, void *infop);
+extern void do_current_node(int argc, char **argv, int sci_idx, void *infop);
+extern void do_root_node(int argc, char **argv, int sci_idx, void *infop);
+extern void do_last_leaf(int argc, char **argv, int sci_idx, void *infop);
+extern void do_first_sib(int argc, char **argv, int sci_idx, void *infop);
+extern void do_last_sib(int argc, char **argv, int sci_idx, void *infop);
+extern void do_next_sib(int argc, char **argv, int sci_idx, void *infop);
+extern void do_prev_sib(int argc, char **argv, int sci_idx, void *infop);
+extern void do_next_leaf(int argc, char **argv, int sci_idx, void *infop);
+extern void do_prev_leaf(int argc, char **argv, int sci_idx, void *infop);
+extern void do_next(int argc, char **argv, int sci_idx, void *infop);
+extern void do_prev(int argc, char **argv, int sci_idx, void *infop);
+extern void do_up(int argc, char **argv, int sci_idx, void *infop);
+extern void do_down(int argc, char **argv, int sci_idx, void *infop);
+extern void do_delete_node(int argc, char **argv, int sci_idx, void *infop);
+extern void do_replace_node(int argc, char **argv, int sci_idx, void *infop);
+extern void do_split_node(int argc, char **argv, int sci_idx, void *infop);
+extern void do_insert_node(int argc, char **argv, int sci_idx, void *infop);
+extern void do_set_bmap(int argc, char **argv, int sci_idx, void *infop);
+extern void do_print_all(int argc, char **argv, int sci_idx, void *infop);
+extern void do_fix_parents(int argc, char **argv, int sci_idx, void *infop);
+extern void do_info(int argc, char **argv, int sci_idx, void *infop);
+extern void do_goto_block(int argc, char **argv, int sci_idx, void *infop);
 
 /* htree.c */
-extern void do_htree_dump(int argc, char **argv);
-extern void do_dx_hash(int argc, char **argv);
-extern void do_dirsearch(int argc, char **argv);
+extern void do_htree_dump(int argc, char **argv, int sci_idx, void *infop);
+extern void do_dx_hash(int argc, char **argv, int sci_idx, void *infop);
+extern void do_dirsearch(int argc, char **argv, int sci_idx, void *infop);
 
 /* logdump.c */
-extern void do_logdump(int argc, char **argv);
+extern void do_logdump(int argc, char **argv, int sci_idx, void *infop);
 
 /* lsdel.c */
-extern void do_lsdel(int argc, char **argv);
+extern void do_lsdel(int argc, char **argv, int sci_idx, void *infop);
 
 /* icheck.c */
-extern void do_icheck(int argc, char **argv);
+extern void do_icheck(int argc, char **argv, int sci_idx, void *infop);
 
 /* ncheck.c */
-extern void do_ncheck(int argc, char **argv);
+extern void do_ncheck(int argc, char **argv, int sci_idx, void *infop);
 
 /* set_fields.c */
-extern void do_set_super(int argc, char **);
-extern void do_set_inode(int argc, char **);
-extern void do_set_block_group_descriptor(int argc, char **);
+extern void do_set_super(int argc, char **, int sci_idx, void *infop);
+extern void do_set_inode(int argc, char **, int sci_idx, void *infop);
+extern void do_set_block_group_descriptor(int argc, char **, int sci_idx, void *infop);
 
 /* unused.c */
-extern void do_dump_unused(int argc, char **argv);
+extern void do_dump_unused(int argc, char **argv, int sci_idx, void *infop);
 
 /* debugfs.c */
+extern ss_request_table *extra_cmds;
+extern const char *debug_prog_name;
 extern void internal_dump_inode(FILE *, const char *, ext2_ino_t,
 				struct ext2_inode *, int);
 
-extern void do_dirty_filesys(int argc, char **argv);
-extern void do_open_filesys(int argc, char **argv);
-extern void do_close_filesys(int argc, char **argv);
-extern void do_lcd(int argc, char **argv);
-extern void do_init_filesys(int argc, char **argv);
-extern void do_show_super_stats(int argc, char **argv);
-extern void do_kill_file(int argc, char **argv);
-extern void do_rm(int argc, char **argv);
-extern void do_link(int argc, char **argv);
-extern void do_undel(int argc, char **argv);
-extern void do_unlink(int argc, char **argv);
-extern void do_find_free_block(int argc, char **argv);
-extern void do_find_free_inode(int argc, char **argv);
-extern void do_stat(int argc, char **argv);
-extern void do_dump_extents(int argc, char **argv);
-extern void do_blocks(int argc, char *argv[]);
+extern void do_dirty_filesys(int argc, char **argv, int sci_idx, void *infop);
+extern void do_open_filesys(int argc, char **argv, int sci_idx, void *infop);
+extern void do_close_filesys(int argc, char **argv, int sci_idx, void *infop);
+extern void do_lcd(int argc, char **argv, int sci_idx, void *infop);
+extern void do_init_filesys(int argc, char **argv, int sci_idx, void *infop);
+extern void do_show_super_stats(int argc, char **argv, int sci_idx, void *infop);
+extern void do_kill_file(int argc, char **argv, int sci_idx, void *infop);
+extern void do_rm(int argc, char **argv, int sci_idx, void *infop);
+extern void do_link(int argc, char **argv, int sci_idx, void *infop);
+extern void do_undel(int argc, char **argv, int sci_idx, void *infop);
+extern void do_unlink(int argc, char **argv, int sci_idx, void *infop);
+extern void do_copy_inode(int argc, char *argv[], int sci_idx, void *infop);
+extern void do_find_free_block(int argc, char **argv, int sci_idx, void *infop);
+extern void do_find_free_inode(int argc, char **argv, int sci_idx, void *infop);
+extern void do_stat(int argc, char **argv, int sci_idx, void *infop);
+extern void do_dump_extents(int argc, char **argv, int sci_idx, void *infop);
+extern void do_blocks(int argc, char *argv[], int sci_idx, void *infop);
 
-extern void do_chroot(int argc, char **argv);
-extern void do_clri(int argc, char **argv);
-extern void do_freei(int argc, char **argv);
-extern void do_seti(int argc, char **argv);
-extern void do_testi(int argc, char **argv);
-extern void do_freeb(int argc, char **argv);
-extern void do_setb(int argc, char **argv);
-extern void do_testb(int argc, char **argv);
-extern void do_modify_inode(int argc, char **argv);
-extern void do_list_dir(int argc, char **argv);
-extern void do_change_working_dir(int argc, char **argv);
-extern void do_print_working_directory(int argc, char **argv);
-extern void do_write(int argc, char **argv);
-extern void do_mknod(int argc, char **argv);
-extern void do_mkdir(int argc, char **argv);
-extern void do_rmdir(int argc, char **argv);
-extern void do_show_debugfs_params(int argc, char **argv);
-extern void do_expand_dir(int argc, char **argv);
-extern void do_features(int argc, char **argv);
-extern void do_bmap(int argc, char **argv);
-extern void do_imap(int argc, char **argv);
-extern void do_set_current_time(int argc, char **argv);
-extern void do_supported_features(int argc, char **argv);
-extern void do_punch(int argc, char **argv);
-extern void do_symlink(int argc, char **argv);
+extern void do_chroot(int argc, char **argv, int sci_idx, void *infop);
+extern void do_clri(int argc, char **argv, int sci_idx, void *infop);
+extern void do_freei(int argc, char **argv, int sci_idx, void *infop);
+extern void do_seti(int argc, char **argv, int sci_idx, void *infop);
+extern void do_testi(int argc, char **argv, int sci_idx, void *infop);
+extern void do_freeb(int argc, char **argv, int sci_idx, void *infop);
+extern void do_setb(int argc, char **argv, int sci_idx, void *infop);
+extern void do_testb(int argc, char **argv, int sci_idx, void *infop);
+extern void do_modify_inode(int argc, char **argv, int sci_idx, void *infop);
+extern void do_list_dir(int argc, char **argv, int sci_idx, void *infop);
+extern void do_change_working_dir(int argc, char **argv, int sci_idx, void *infop);
+extern void do_print_working_directory(int argc, char **argv, int sci_idx, void *infop);
+extern void do_write(int argc, char **argv, int sci_idx, void *infop);
+extern void do_mknod(int argc, char **argv, int sci_idx, void *infop);
+extern void do_mkdir(int argc, char **argv, int sci_idx, void *infop);
+extern void do_rmdir(int argc, char **argv, int sci_idx, void *infop);
+extern void do_show_debugfs_params(int argc, char **argv, int sci_idx, void *infop);
+extern void do_expand_dir(int argc, char **argv, int sci_idx, void *infop);
+extern void do_features(int argc, char **argv, int sci_idx, void *infop);
+extern void do_bmap(int argc, char **argv, int sci_idx, void *infop);
+extern void do_imap(int argc, char **argv, int sci_idx, void *infop);
+extern void do_idump(int argc, char *argv[], int sci_idx, void *infop);
+extern void do_set_current_time(int argc, char **argv, int sci_idx, void *infop);
+extern void do_supported_features(int argc, char **argv, int sci_idx, void *infop);
+extern void do_punch(int argc, char **argv, int sci_idx, void *infop);
+extern void do_fallocate(int argc, char **argv, int sci_idx, void *infop);
+extern void do_symlink(int argc, char **argv, int sci_idx, void *infop);
 
-extern void do_dump_mmp(int argc, char **argv);
-extern void do_set_mmp_value(int argc, char **argv);
+extern void do_dump_mmp(int argc, char **argv, int sci_idx, void *infop);
+extern void do_set_mmp_value(int argc, char **argv, int sci_idx, void *infop);
 
-extern void do_freefrag(int argc, char **argv);
-extern void do_filefrag(int argc, char *argv[]);
+extern void do_freefrag(int argc, char **argv, int sci_idx, void *infop);
+extern void do_filefrag(int argc, char *argv[], int sci_idx, void *infop);
+
+/* do_journal.c */
+
+extern void do_journal_write(int argc, char *argv[], int sci_idx, void *infop);
+extern void do_journal_open(int argc, char *argv[], int sci_idx, void *infop);
+extern void do_journal_close(int argc, char *argv[], int sci_idx, void *infop);
+extern void do_journal_run(int argc, char *argv[], int sci_idx, void *infop);
+
+/* quota.c */
+extern void do_list_quota(int argc, char *argv[], int sci_idx, void *infop);
+extern void do_get_quota(int argc, char *argv[], int sci_idx, void *infop);
 
 /* util.c */
-extern time_t string_to_time(const char *arg);
+extern __s64 string_to_time(const char *arg);
+extern errcode_t read_list(char *str, blk64_t **list, size_t *len);
+extern void do_byte_hexdump(FILE *fp, unsigned char *buf, size_t bufsize);
+
+/* xattrs.c */
+void dump_inode_attributes(FILE *out, ext2_ino_t ino);
+void do_get_xattr(int argc, char **argv, int sci_idx, void *infop);
+void do_set_xattr(int argc, char **argv, int sci_idx, void *infop);
+void do_rm_xattr(int argc, char **argv, int sci_idx, void *infop);
+void do_list_xattr(int argc, char **argv, int sci_idx, void *infop);
+void raw_inode_xattr_dump(FILE *f, unsigned char *buf, unsigned int len);
+void block_xattr_dump(FILE *f, unsigned char *buf, unsigned int len);
 
 /* zap.c */
-extern void do_zap_block(int argc, char **argv);
-extern void do_block_dump(int argc, char **argv);
+extern void do_zap_block(int argc, char **argv, int sci_idx, void *infop);
+extern void do_block_dump(int argc, char **argv, int sci_idx, void *infop);
diff --git a/debugfs/do_journal.c b/debugfs/do_journal.c
new file mode 100644
index 0000000..38439c6
--- /dev/null
+++ b/debugfs/do_journal.c
@@ -0,0 +1,972 @@
+/*
+ * do_journal.c --- Scribble onto the journal!
+ *
+ * Copyright (C) 2014 Oracle.  This file may be redistributed
+ * under the terms of the GNU Public License.
+ */
+
+#include "config.h"
+#include <stdio.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#else
+extern int optind;
+extern char *optarg;
+#endif
+#include <ctype.h>
+#include <unistd.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include "debugfs.h"
+#include "ext2fs/kernel-jbd.h"
+#include "journal.h"
+
+#undef DEBUG
+
+#ifdef DEBUG
+# define dbg_printf(f, a...)  do {printf("JFS DEBUG: " f, ## a); \
+	fflush(stdout); \
+} while (0)
+#else
+# define dbg_printf(f, a...)
+#endif
+
+#define JOURNAL_CHECK_TRANS_MAGIC(x)	\
+	do { \
+		if ((x)->magic != J_TRANS_MAGIC) \
+			return EXT2_ET_INVALID_ARGUMENT; \
+	} while (0)
+
+#define J_TRANS_MAGIC		0xD15EA5ED
+#define J_TRANS_OPEN		1
+#define J_TRANS_COMMITTED	2
+struct journal_transaction_s {
+	unsigned int magic;
+	ext2_filsys fs;
+	journal_t *journal;
+	blk64_t block;
+	blk64_t start, end;
+	tid_t tid;
+	int flags;
+};
+
+typedef struct journal_transaction_s journal_transaction_t;
+
+static journal_t *current_journal = NULL;
+
+static void journal_dump_trans(journal_transaction_t *trans EXT2FS_ATTR((unused)),
+			       const char *tag EXT2FS_ATTR((unused)))
+{
+	dbg_printf("TRANS %p(%s): tid=%u start=%llu block=%llu end=%llu "
+		   "flags=0x%x\n", trans, tag, trans->tid, trans->start,
+		   trans->block, trans->end, trans->flags);
+}
+
+static errcode_t journal_commit_trans(journal_transaction_t *trans)
+{
+	struct buffer_head *bh, *cbh = NULL;
+	struct commit_header *commit;
+#ifdef HAVE_SYS_TIME_H
+	struct timeval tv;
+#endif
+	errcode_t err;
+
+	JOURNAL_CHECK_TRANS_MAGIC(trans);
+
+	if ((trans->flags & J_TRANS_COMMITTED) ||
+	    !(trans->flags & J_TRANS_OPEN))
+		return EXT2_ET_INVALID_ARGUMENT;
+
+	bh = getblk(trans->journal->j_dev, 0, trans->journal->j_blocksize);
+	if (bh == NULL)
+		return ENOMEM;
+
+	/* write the descriptor block header */
+	commit = (struct commit_header *)bh->b_data;
+	commit->h_magic = ext2fs_cpu_to_be32(JBD2_MAGIC_NUMBER);
+	commit->h_blocktype = ext2fs_cpu_to_be32(JBD2_COMMIT_BLOCK);
+	commit->h_sequence = ext2fs_cpu_to_be32(trans->tid);
+	if (jbd2_has_feature_checksum(trans->journal)) {
+		__u32 csum_v1 = ~0;
+		blk64_t cblk;
+
+		cbh = getblk(trans->journal->j_dev, 0,
+			     trans->journal->j_blocksize);
+		if (cbh == NULL) {
+			err = ENOMEM;
+			goto error;
+		}
+
+		for (cblk = trans->start; cblk < trans->block; cblk++) {
+			err = jbd2_journal_bmap(trans->journal, cblk,
+						&cbh->b_blocknr);
+			if (err)
+				goto error;
+			mark_buffer_uptodate(cbh, 0);
+			ll_rw_block(REQ_OP_READ, 0, 1, &cbh);
+			err = cbh->b_err;
+			if (err)
+				goto error;
+			csum_v1 = ext2fs_crc32_be(csum_v1,
+					(unsigned char const *)cbh->b_data,
+					cbh->b_size);
+		}
+
+		commit->h_chksum_type = JBD2_CRC32_CHKSUM;
+		commit->h_chksum_size = JBD2_CRC32_CHKSUM_SIZE;
+		commit->h_chksum[0] = ext2fs_cpu_to_be32(csum_v1);
+	} else {
+		commit->h_chksum_type = 0;
+		commit->h_chksum_size = 0;
+		commit->h_chksum[0] = 0;
+	}
+#ifdef HAVE_SYS_TIME_H
+	gettimeofday(&tv, NULL);
+	commit->h_commit_sec = ext2fs_cpu_to_be32(tv.tv_sec);
+	commit->h_commit_nsec = ext2fs_cpu_to_be32(tv.tv_usec * 1000);
+#else
+	commit->h_commit_sec = 0;
+	commit->h_commit_nsec = 0;
+#endif
+
+	/* Write block */
+	jbd2_commit_block_csum_set(trans->journal, bh);
+	err = jbd2_journal_bmap(trans->journal, trans->block, &bh->b_blocknr);
+	if (err)
+		goto error;
+
+	dbg_printf("Writing commit block at %llu:%llu\n", trans->block,
+		   bh->b_blocknr);
+	mark_buffer_dirty(bh);
+	ll_rw_block(REQ_OP_WRITE, 0, 1, &bh);
+	err = bh->b_err;
+	if (err)
+		goto error;
+	trans->flags |= J_TRANS_COMMITTED;
+	trans->flags &= ~J_TRANS_OPEN;
+	trans->block++;
+
+	ext2fs_set_feature_journal_needs_recovery(trans->fs->super);
+	ext2fs_mark_super_dirty(trans->fs);
+error:
+	if (cbh)
+		brelse(cbh);
+	brelse(bh);
+	return err;
+}
+
+static errcode_t journal_add_revoke_to_trans(journal_transaction_t *trans,
+					     blk64_t *revoke_list,
+					     size_t revoke_len)
+{
+	jbd2_journal_revoke_header_t *jrb;
+	void *buf;
+	size_t i, offset;
+	blk64_t curr_blk;
+	unsigned int sz;
+	unsigned csum_size = 0;
+	struct buffer_head *bh;
+	errcode_t err;
+
+	JOURNAL_CHECK_TRANS_MAGIC(trans);
+
+	if ((trans->flags & J_TRANS_COMMITTED) ||
+	    !(trans->flags & J_TRANS_OPEN))
+		return EXT2_ET_INVALID_ARGUMENT;
+
+	if (revoke_len == 0)
+		return 0;
+
+	/* Do we need to leave space at the end for a checksum? */
+	if (jbd2_journal_has_csum_v2or3(trans->journal))
+		csum_size = sizeof(struct jbd2_journal_block_tail);
+
+	curr_blk = trans->block;
+
+	bh = getblk(trans->journal->j_dev, curr_blk,
+		    trans->journal->j_blocksize);
+	if (bh == NULL)
+		return ENOMEM;
+	jrb = buf = bh->b_data;
+	jrb->r_header.h_magic = ext2fs_cpu_to_be32(JBD2_MAGIC_NUMBER);
+	jrb->r_header.h_blocktype = ext2fs_cpu_to_be32(JBD2_REVOKE_BLOCK);
+	jrb->r_header.h_sequence = ext2fs_cpu_to_be32(trans->tid);
+	offset = sizeof(*jrb);
+
+	if (jbd2_has_feature_64bit(trans->journal))
+		sz = 8;
+	else
+		sz = 4;
+
+	for (i = 0; i < revoke_len; i++) {
+		/* Block full, write to journal */
+		if (offset + sz > trans->journal->j_blocksize - csum_size) {
+			jrb->r_count = ext2fs_cpu_to_be32(offset);
+			jbd2_revoke_csum_set(trans->journal, bh);
+
+			err = jbd2_journal_bmap(trans->journal, curr_blk,
+						&bh->b_blocknr);
+			if (err)
+				goto error;
+			dbg_printf("Writing revoke block at %llu:%llu\n",
+				   curr_blk, bh->b_blocknr);
+			mark_buffer_dirty(bh);
+			ll_rw_block(REQ_OP_WRITE, 0, 1, &bh);
+			err = bh->b_err;
+			if (err)
+				goto error;
+
+			offset = sizeof(*jrb);
+			curr_blk++;
+		}
+
+		if (revoke_list[i] >=
+		    ext2fs_blocks_count(trans->journal->j_fs_dev->k_fs->super)) {
+			err = EXT2_ET_BAD_BLOCK_NUM;
+			goto error;
+		}
+
+		if (jbd2_has_feature_64bit(trans->journal))
+			*((__u64 *)(&((char *)buf)[offset])) =
+				ext2fs_cpu_to_be64(revoke_list[i]);
+		else
+			*((__u32 *)(&((char *)buf)[offset])) =
+				ext2fs_cpu_to_be32(revoke_list[i]);
+		offset += sz;
+	}
+
+	if (offset > 0) {
+		jrb->r_count = ext2fs_cpu_to_be32(offset);
+		jbd2_revoke_csum_set(trans->journal, bh);
+
+		err = jbd2_journal_bmap(trans->journal, curr_blk,
+					&bh->b_blocknr);
+		if (err)
+			goto error;
+		dbg_printf("Writing revoke block at %llu:%llu\n",
+			   curr_blk, bh->b_blocknr);
+		mark_buffer_dirty(bh);
+		ll_rw_block(REQ_OP_WRITE, 0, 1, &bh);
+		err = bh->b_err;
+		if (err)
+			goto error;
+		curr_blk++;
+	}
+
+error:
+	trans->block = curr_blk;
+	brelse(bh);
+	return err;
+}
+
+static errcode_t journal_add_blocks_to_trans(journal_transaction_t *trans,
+				      blk64_t *block_list, size_t block_len,
+				      FILE *fp)
+{
+	blk64_t curr_blk, jdb_blk;
+	size_t i, j;
+	int csum_size = 0;
+	journal_header_t *jdb;
+	journal_block_tag_t *jdbt;
+	int tag_bytes;
+	void *buf = NULL, *jdb_buf = NULL;
+	struct buffer_head *bh = NULL, *data_bh;
+	errcode_t err;
+
+	JOURNAL_CHECK_TRANS_MAGIC(trans);
+
+	if ((trans->flags & J_TRANS_COMMITTED) ||
+	    !(trans->flags & J_TRANS_OPEN))
+		return EXT2_ET_INVALID_ARGUMENT;
+
+	if (block_len == 0)
+		return 0;
+
+	/* Do we need to leave space at the end for a checksum? */
+	if (jbd2_journal_has_csum_v2or3(trans->journal))
+		csum_size = sizeof(struct jbd2_journal_block_tail);
+
+	curr_blk = jdb_blk = trans->block;
+
+	data_bh = getblk(trans->journal->j_dev, curr_blk,
+			 trans->journal->j_blocksize);
+	if (data_bh == NULL)
+		return ENOMEM;
+	buf = data_bh->b_data;
+
+	/* write the descriptor block header */
+	bh = getblk(trans->journal->j_dev, curr_blk,
+		    trans->journal->j_blocksize);
+	if (bh == NULL) {
+		err = ENOMEM;
+		goto error;
+	}
+	jdb = jdb_buf = bh->b_data;
+	jdb->h_magic = ext2fs_cpu_to_be32(JBD2_MAGIC_NUMBER);
+	jdb->h_blocktype = ext2fs_cpu_to_be32(JBD2_DESCRIPTOR_BLOCK);
+	jdb->h_sequence = ext2fs_cpu_to_be32(trans->tid);
+	jdbt = (journal_block_tag_t *)(jdb + 1);
+
+	curr_blk++;
+	for (i = 0; i < block_len; i++) {
+		j = fread(data_bh->b_data, trans->journal->j_blocksize, 1, fp);
+		if (j != 1) {
+			err = errno;
+			goto error;
+		}
+
+		tag_bytes = journal_tag_bytes(trans->journal);
+
+		/* No space left in descriptor block, write it out */
+		if ((char *)jdbt + tag_bytes >
+		    (char *)jdb_buf + trans->journal->j_blocksize - csum_size) {
+			jbd2_descr_block_csum_set(trans->journal, bh);
+			err = jbd2_journal_bmap(trans->journal, jdb_blk,
+					   &bh->b_blocknr);
+			if (err)
+				goto error;
+			dbg_printf("Writing descriptor block at %llu:%llu\n",
+				   jdb_blk, bh->b_blocknr);
+			mark_buffer_dirty(bh);
+			ll_rw_block(REQ_OP_WRITE, 0, 1, &bh);
+			err = bh->b_err;
+			if (err)
+				goto error;
+
+			jdbt = (journal_block_tag_t *)(jdb + 1);
+			jdb_blk = curr_blk;
+			curr_blk++;
+		}
+
+		if (block_list[i] >=
+		    ext2fs_blocks_count(trans->journal->j_fs_dev->k_fs->super)) {
+			err = EXT2_ET_BAD_BLOCK_NUM;
+			goto error;
+		}
+
+		/* Fill out the block tag */
+		jdbt->t_blocknr = ext2fs_cpu_to_be32(block_list[i] & 0xFFFFFFFF);
+		jdbt->t_flags = 0;
+		if (jdbt != (journal_block_tag_t *)(jdb + 1))
+			jdbt->t_flags |= ext2fs_cpu_to_be16(JBD2_FLAG_SAME_UUID);
+		else {
+			memcpy(jdbt + tag_bytes,
+			       trans->journal->j_superblock->s_uuid,
+			       sizeof(trans->journal->j_superblock->s_uuid));
+			tag_bytes += 16;
+		}
+		if (i == block_len - 1)
+			jdbt->t_flags |= ext2fs_cpu_to_be16(JBD2_FLAG_LAST_TAG);
+		if (*((__u32 *)buf) == ext2fs_cpu_to_be32(JBD2_MAGIC_NUMBER)) {
+			*((__u32 *)buf) = 0;
+			jdbt->t_flags |= ext2fs_cpu_to_be16(JBD2_FLAG_ESCAPE);
+		}
+		if (jbd2_has_feature_64bit(trans->journal))
+			jdbt->t_blocknr_high = ext2fs_cpu_to_be32(block_list[i] >> 32);
+		jbd2_block_tag_csum_set(trans->journal, jdbt, data_bh,
+					trans->tid);
+
+		/* Write the data block */
+		err = jbd2_journal_bmap(trans->journal, curr_blk,
+					&data_bh->b_blocknr);
+		if (err)
+			goto error;
+		dbg_printf("Writing data block %llu at %llu:%llu tag %d\n",
+			   block_list[i], curr_blk, data_bh->b_blocknr,
+			   tag_bytes);
+		mark_buffer_dirty(data_bh);
+		ll_rw_block(REQ_OP_WRITE, 0, 1, &data_bh);
+		err = data_bh->b_err;
+		if (err)
+			goto error;
+
+		curr_blk++;
+		jdbt = (journal_block_tag_t *)(((char *)jdbt) + tag_bytes);
+	}
+
+	/* Write out the last descriptor block */
+	if (jdbt != (journal_block_tag_t *)(jdb + 1)) {
+		jbd2_descr_block_csum_set(trans->journal, bh);
+		err = jbd2_journal_bmap(trans->journal, jdb_blk,
+					&bh->b_blocknr);
+		if (err)
+			goto error;
+		dbg_printf("Writing descriptor block at %llu:%llu\n",
+			   jdb_blk, bh->b_blocknr);
+		mark_buffer_dirty(bh);
+		ll_rw_block(REQ_OP_WRITE, 0, 1, &bh);
+		err = bh->b_err;
+		if (err)
+			goto error;
+	}
+
+error:
+	trans->block = curr_blk;
+	if (bh)
+		brelse(bh);
+	brelse(data_bh);
+	return err;
+}
+
+static blk64_t journal_guess_blocks(journal_t *journal, blk64_t data_blocks,
+				    blk64_t revoke_blocks)
+{
+	blk64_t ret = 1;
+	unsigned int bs, sz;
+
+	/* Estimate # of revoke blocks */
+	bs = journal->j_blocksize;
+	if (jbd2_journal_has_csum_v2or3(journal))
+		bs -= sizeof(struct jbd2_journal_block_tail);
+	sz = jbd2_has_feature_64bit(journal) ? sizeof(__u64) : sizeof(__u32);
+	ret += revoke_blocks * sz / bs;
+
+	/* Estimate # of data blocks */
+	bs = journal->j_blocksize - 16;
+	if (jbd2_journal_has_csum_v2or3(journal))
+		bs -= sizeof(struct jbd2_journal_block_tail);
+	sz = journal_tag_bytes(journal);
+	ret += data_blocks * sz / bs;
+
+	ret += data_blocks;
+
+	return ret;
+}
+
+static errcode_t journal_open_trans(journal_t *journal,
+				    journal_transaction_t *trans,
+				    blk64_t blocks)
+{
+	trans->fs = journal->j_fs_dev->k_fs;
+	trans->journal = journal;
+	trans->flags = J_TRANS_OPEN;
+
+	if (journal->j_tail == 0) {
+		/* Clean journal, start at the tail */
+		trans->tid = journal->j_tail_sequence;
+		trans->start = journal->j_first;
+	} else {
+		/* Put new transaction at the head of the list */
+		trans->tid = journal->j_transaction_sequence;
+		trans->start = journal->j_head;
+	}
+
+	trans->block = trans->start;
+	if (trans->start + blocks > journal->j_last)
+		return ENOSPC;
+	trans->end = trans->block + blocks;
+	journal_dump_trans(trans, "new transaction");
+
+	trans->magic = J_TRANS_MAGIC;
+	return 0;
+}
+
+static errcode_t journal_close_trans(journal_transaction_t *trans)
+{
+	journal_t *journal;
+
+	JOURNAL_CHECK_TRANS_MAGIC(trans);
+
+	if (!(trans->flags & J_TRANS_COMMITTED))
+		return 0;
+
+	journal = trans->journal;
+	if (journal->j_tail == 0) {
+		/* Update the tail */
+		journal->j_tail_sequence = trans->tid;
+		journal->j_tail = trans->start;
+		journal->j_superblock->s_start = ext2fs_cpu_to_be32(trans->start);
+	}
+
+	/* Update the head */
+	journal->j_head = trans->end + 1;
+	journal->j_transaction_sequence = trans->tid + 1;
+
+	trans->magic = 0;
+
+	/* Mark ourselves as needing recovery */
+	if (!ext2fs_has_feature_journal_needs_recovery(trans->fs->super)) {
+		ext2fs_set_feature_journal_needs_recovery(trans->fs->super);
+		ext2fs_mark_super_dirty(trans->fs);
+	}
+
+	return 0;
+}
+
+#define JOURNAL_WRITE_NO_COMMIT		1
+static errcode_t journal_write(journal_t *journal,
+			       int flags, blk64_t *block_list,
+			       size_t block_len, blk64_t *revoke_list,
+			       size_t revoke_len, FILE *fp)
+{
+	blk64_t blocks;
+	journal_transaction_t trans;
+	errcode_t err;
+
+	if (revoke_len > 0) {
+		jbd2_set_feature_revoke(journal);
+		mark_buffer_dirty(journal->j_sb_buffer);
+	}
+
+	blocks = journal_guess_blocks(journal, block_len, revoke_len);
+	err = journal_open_trans(journal, &trans, blocks);
+	if (err)
+		goto error;
+
+	err = journal_add_blocks_to_trans(&trans, block_list, block_len, fp);
+	if (err)
+		goto error;
+
+	err = journal_add_revoke_to_trans(&trans, revoke_list, revoke_len);
+	if (err)
+		goto error;
+
+	if (!(flags & JOURNAL_WRITE_NO_COMMIT)) {
+		err = journal_commit_trans(&trans);
+		if (err)
+			goto error;
+	}
+
+	err = journal_close_trans(&trans);
+error:
+	return err;
+}
+
+void do_journal_write(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		      void *infop EXT2FS_ATTR((unused)))
+{
+	blk64_t *blist = NULL, *rlist = NULL;
+	size_t bn = 0, rn = 0;
+	FILE *fp = NULL;
+	int opt;
+	int flags = 0;
+	errcode_t err;
+
+	if (current_journal == NULL) {
+		printf("Journal not open.\n");
+		return;
+	}
+
+	reset_getopt();
+	while ((opt = getopt(argc, argv, "b:r:c")) != -1) {
+		switch (opt) {
+		case 'b':
+			err = read_list(optarg, &blist, &bn);
+			if (err) {
+				com_err(argv[0], err,
+					"while reading block list");
+				goto out;
+			}
+			break;
+		case 'r':
+			err = read_list(optarg, &rlist, &rn);
+			if (err) {
+				com_err(argv[0], err,
+					"while reading revoke list");
+				goto out;
+			}
+			break;
+		case 'c':
+			flags |= JOURNAL_WRITE_NO_COMMIT;
+			break;
+		default:
+			printf("%s [-b blocks] [-r revoke] [-c] file\n",
+			       argv[0]);
+			printf("-b: Write these blocks into transaction.\n");
+			printf("-c: Do not commit transaction.\n");
+			printf("-r: Revoke these blocks from transaction.\n");
+
+			goto out;
+		}
+	}
+
+	if (bn > 0 && optind != argc - 1) {
+		printf("Need a file to read blocks from.\n");
+		return;
+	}
+
+	if (bn > 0) {
+		fp = fopen(argv[optind], "r");
+		if (fp == NULL) {
+			com_err(argv[0], errno,
+				"while opening journal data file");
+			goto out;
+		}
+	}
+
+	err = journal_write(current_journal, flags, blist, bn,
+			    rlist, rn, fp);
+	if (err)
+		com_err("journal_write", err, "while writing journal");
+
+	if (fp)
+		fclose(fp);
+out:
+	if (blist)
+		free(blist);
+	if (rlist)
+		free(rlist);
+}
+
+/* Make sure we wrap around the log correctly! */
+#define wrap(journal, var)						\
+do {									\
+	if (var >= (journal)->j_last)					\
+		var -= ((journal)->j_last - (journal)->j_first);	\
+} while (0)
+
+/*
+ * Count the number of in-use tags in a journal descriptor block.
+ */
+
+static int count_tags(journal_t *journal, char *buf)
+{
+	char			*tagp;
+	journal_block_tag_t	*tag;
+	int			nr = 0, size = journal->j_blocksize;
+	int			tag_bytes = journal_tag_bytes(journal);
+
+	if (jbd2_journal_has_csum_v2or3(journal))
+		size -= sizeof(struct jbd2_journal_block_tail);
+
+	tagp = buf + sizeof(journal_header_t);
+
+	while ((tagp - buf + tag_bytes) <= size) {
+		tag = (journal_block_tag_t *) tagp;
+
+		nr++;
+		tagp += tag_bytes;
+		if (!(tag->t_flags & ext2fs_cpu_to_be16(JBD2_FLAG_SAME_UUID)))
+			tagp += 16;
+
+		if (tag->t_flags & ext2fs_cpu_to_be16(JBD2_FLAG_LAST_TAG))
+			break;
+	}
+
+	return nr;
+}
+
+static errcode_t journal_find_head(journal_t *journal)
+{
+	unsigned int		next_commit_ID;
+	blk64_t			next_log_block, head_block;
+	int			err;
+	journal_superblock_t	*sb;
+	journal_header_t	*tmp;
+	struct buffer_head	*bh;
+	unsigned int		sequence;
+	int			blocktype;
+
+	/*
+	 * First thing is to establish what we expect to find in the log
+	 * (in terms of transaction IDs), and where (in terms of log
+	 * block offsets): query the superblock.
+	 */
+
+	sb = journal->j_superblock;
+	next_commit_ID = ext2fs_be32_to_cpu(sb->s_sequence);
+	next_log_block = ext2fs_be32_to_cpu(sb->s_start);
+	head_block = next_log_block;
+
+	if (next_log_block == 0)
+		return 0;
+
+	bh = getblk(journal->j_dev, 0, journal->j_blocksize);
+	if (bh == NULL)
+		return ENOMEM;
+
+	/*
+	 * Now we walk through the log, transaction by transaction,
+	 * making sure that each transaction has a commit block in the
+	 * expected place.  Each complete transaction gets replayed back
+	 * into the main filesystem.
+	 */
+	while (1) {
+		dbg_printf("Scanning for sequence ID %u at %lu/%lu\n",
+			  next_commit_ID, (unsigned long)next_log_block,
+			  journal->j_last);
+
+		/* Skip over each chunk of the transaction looking
+		 * either the next descriptor block or the final commit
+		 * record. */
+		err = jbd2_journal_bmap(journal, next_log_block,
+					&bh->b_blocknr);
+		if (err)
+			goto err;
+		mark_buffer_uptodate(bh, 0);
+		ll_rw_block(REQ_OP_READ, 0, 1, &bh);
+		err = bh->b_err;
+		if (err)
+			goto err;
+
+		next_log_block++;
+		wrap(journal, next_log_block);
+
+		/* What kind of buffer is it?
+		 *
+		 * If it is a descriptor block, check that it has the
+		 * expected sequence number.  Otherwise, we're all done
+		 * here. */
+
+		tmp = (journal_header_t *)bh->b_data;
+
+		if (tmp->h_magic != ext2fs_cpu_to_be32(JBD2_MAGIC_NUMBER)) {
+			dbg_printf("JBD2: wrong magic 0x%x\n", tmp->h_magic);
+			goto err;
+		}
+
+		blocktype = ext2fs_be32_to_cpu(tmp->h_blocktype);
+		sequence = ext2fs_be32_to_cpu(tmp->h_sequence);
+		dbg_printf("Found magic %d, sequence %d\n",
+			  blocktype, sequence);
+
+		if (sequence != next_commit_ID) {
+			dbg_printf("JBD2: Wrong sequence %d (wanted %d)\n",
+				   sequence, next_commit_ID);
+			goto err;
+		}
+
+		/* OK, we have a valid descriptor block which matches
+		 * all of the sequence number checks.  What are we going
+		 * to do with it?  That depends on the pass... */
+
+		switch (blocktype) {
+		case JBD2_DESCRIPTOR_BLOCK:
+			next_log_block += count_tags(journal, bh->b_data);
+			wrap(journal, next_log_block);
+			continue;
+
+		case JBD2_COMMIT_BLOCK:
+			head_block = next_log_block;
+			next_commit_ID++;
+			continue;
+
+		case JBD2_REVOKE_BLOCK:
+			continue;
+
+		default:
+			dbg_printf("Unrecognised magic %d, end of scan.\n",
+				  blocktype);
+			err = -EINVAL;
+			goto err;
+		}
+	}
+
+err:
+	if (err == 0) {
+		dbg_printf("head seq=%d blk=%llu\n", next_commit_ID,
+			   head_block);
+		journal->j_transaction_sequence = next_commit_ID;
+		journal->j_head = head_block;
+	}
+	brelse(bh);
+	return err;
+}
+
+static void update_journal_csum(journal_t *journal, int ver)
+{
+	journal_superblock_t *jsb;
+
+	if (journal->j_format_version < 2)
+		return;
+
+	if (journal->j_tail != 0 ||
+	    ext2fs_has_feature_journal_needs_recovery(
+					journal->j_fs_dev->k_fs->super)) {
+		printf("Journal needs recovery, will not add csums.\n");
+		return;
+	}
+
+	/* metadata_csum implies journal csum v3 */
+	jsb = journal->j_superblock;
+	if (ext2fs_has_feature_metadata_csum(journal->j_fs_dev->k_fs->super)) {
+		printf("Setting csum v%d\n", ver);
+		switch (ver) {
+		case 2:
+			jbd2_clear_feature_csum3(journal);
+			jbd2_set_feature_csum2(journal);
+			jbd2_clear_feature_checksum(journal);
+			break;
+		case 3:
+			jbd2_set_feature_csum3(journal);
+			jbd2_clear_feature_csum2(journal);
+			jbd2_clear_feature_checksum(journal);
+			break;
+		default:
+			printf("Unknown checksum v%d\n", ver);
+			break;
+		}
+		journal->j_superblock->s_checksum_type = JBD2_CRC32C_CHKSUM;
+		journal->j_csum_seed = jbd2_chksum(journal, ~0, jsb->s_uuid,
+						   sizeof(jsb->s_uuid));
+	} else {
+		jbd2_clear_feature_csum3(journal);
+		jbd2_clear_feature_csum2(journal);
+		jbd2_set_feature_checksum(journal);
+	}
+}
+
+static void update_uuid(journal_t *journal)
+{
+	size_t z;
+	ext2_filsys fs;
+
+	if (journal->j_format_version < 2)
+		return;
+
+	for (z = 0; z < sizeof(journal->j_superblock->s_uuid); z++)
+		if (journal->j_superblock->s_uuid[z])
+			break;
+	if (z == 0)
+		return;
+
+	fs = journal->j_fs_dev->k_fs;
+	if (!ext2fs_has_feature_64bit(fs->super))
+		return;
+
+	if (jbd2_has_feature_64bit(journal) &&
+	    ext2fs_has_feature_64bit(fs->super))
+		return;
+
+	if (journal->j_tail != 0 ||
+	    ext2fs_has_feature_journal_needs_recovery(fs->super)) {
+		printf("Journal needs recovery, will not set 64bit.\n");
+		return;
+	}
+
+	memcpy(journal->j_superblock->s_uuid, fs->super->s_uuid,
+	       sizeof(fs->super->s_uuid));
+}
+
+static void update_64bit_flag(journal_t *journal)
+{
+	if (journal->j_format_version < 2)
+		return;
+
+	if (!ext2fs_has_feature_64bit(journal->j_fs_dev->k_fs->super))
+		return;
+
+	if (jbd2_has_feature_64bit(journal) &&
+	    ext2fs_has_feature_64bit(journal->j_fs_dev->k_fs->super))
+		return;
+
+	if (journal->j_tail != 0 ||
+	    ext2fs_has_feature_journal_needs_recovery(
+				journal->j_fs_dev->k_fs->super)) {
+		printf("Journal needs recovery, will not set 64bit.\n");
+		return;
+	}
+
+	jbd2_set_feature_64bit(journal);
+}
+
+void do_journal_open(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		     void *infop EXT2FS_ATTR((unused)))
+{
+	int opt, enable_csum = 0, csum_ver = 3;
+	journal_t *journal;
+	errcode_t err;
+
+	if (check_fs_open(argv[0]))
+		return;
+	if (check_fs_read_write(argv[0]))
+		return;
+	if (check_fs_bitmaps(argv[0]))
+		return;
+	if (current_journal) {
+		printf("Journal is already open.\n");
+		return;
+	}
+	if (!ext2fs_has_feature_journal(current_fs->super)) {
+		printf("Journalling is not enabled on this filesystem.\n");
+		return;
+	}
+
+	reset_getopt();
+	while ((opt = getopt(argc, argv, "cv:f:")) != -1) {
+		switch (opt) {
+		case 'c':
+			enable_csum = 1;
+			break;
+		case 'f':
+			if (current_fs->journal_name)
+				free(current_fs->journal_name);
+			current_fs->journal_name = strdup(optarg);
+			break;
+		case 'v':
+			csum_ver = atoi(optarg);
+			if (csum_ver != 2 && csum_ver != 3) {
+				printf("Unknown journal csum v%d\n", csum_ver);
+				csum_ver = 3;
+			}
+			break;
+		default:
+			printf("%s: [-c] [-v ver] [-f ext_jnl]\n", argv[0]);
+			printf("-c: Enable journal checksumming.\n");
+			printf("-v: Use this version checksum format.\n");
+			printf("-f: Load this external journal.\n");
+		}
+	}
+
+	err = ext2fs_open_journal(current_fs, &current_journal);
+	if (err) {
+		com_err(argv[0], err, "while opening journal");
+		return;
+	}
+	journal = current_journal;
+
+	dbg_printf("JOURNAL: seq=%u tailseq=%u start=%lu first=%lu "
+		   "maxlen=%lu\n", journal->j_tail_sequence,
+		   journal->j_transaction_sequence, journal->j_tail,
+		   journal->j_first, journal->j_last);
+
+	update_uuid(journal);
+	update_64bit_flag(journal);
+	if (enable_csum)
+		update_journal_csum(journal, csum_ver);
+
+	err = journal_find_head(journal);
+	if (err)
+		com_err(argv[0], err, "while examining journal");
+}
+
+void do_journal_close(int argc EXT2FS_ATTR((unused)),
+		      char *argv[] EXT2FS_ATTR((unused)),
+		      int sci_idx EXT2FS_ATTR((unused)),
+		      void *infop EXT2FS_ATTR((unused)))
+{
+	if (current_journal == NULL) {
+		printf("Journal not open.\n");
+		return;
+	}
+
+	ext2fs_close_journal(current_fs, &current_journal);
+}
+
+void do_journal_run(int argc EXT2FS_ATTR((unused)), char *argv[],
+		    int sci_idx EXT2FS_ATTR((unused)),
+		    void *infop EXT2FS_ATTR((unused)))
+{
+	errcode_t err;
+
+	if (check_fs_open(argv[0]))
+		return;
+	if (check_fs_read_write(argv[0]))
+		return;
+	if (check_fs_bitmaps(argv[0]))
+		return;
+	if (current_journal) {
+		printf("Please close the journal before recovering it.\n");
+		return;
+	}
+
+	err = ext2fs_run_ext3_journal(&current_fs);
+	if (err)
+		com_err("journal_run", err, "while recovering journal");
+	else {
+		ext2fs_clear_feature_journal_needs_recovery(current_fs->super);
+		ext2fs_mark_super_dirty(current_fs);
+	}
+}
diff --git a/debugfs/dump.c b/debugfs/dump.c
index 750ff3c..42f5204 100644
--- a/debugfs/dump.c
+++ b/debugfs/dump.c
@@ -9,6 +9,7 @@
 #define _GNU_SOURCE /* for O_LARGEFILE */
 #endif
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -80,19 +81,16 @@
 		com_err(cmd, errno, "while setting permissions of %s", name);
 
 #ifndef HAVE_FCHOWN
-	i = chown(name, inode->i_uid, inode->i_gid);
+	i = chown(name, inode_uid(*inode), inode_gid(*inode));
 #else
 	if (fd != -1)
-		i = fchown(fd, inode->i_uid, inode->i_gid);
+		i = fchown(fd, inode_uid(*inode), inode_gid(*inode));
 	else
-		i = chown(name, inode->i_uid, inode->i_gid);
+		i = chown(name, inode_uid(*inode), inode_gid(*inode));
 #endif
 	if (i == -1)
 		com_err(cmd, errno, "while changing ownership of %s", name);
 
-	if (fd != -1)
-		close(fd);
-
 	ut.actime = inode->i_atime;
 	ut.modtime = inode->i_mtime;
 	if (utime(name, &ut) == -1)
@@ -146,7 +144,8 @@
 	return;
 }
 
-void do_dump(int argc, char **argv)
+void do_dump(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	inode;
 	int		fd;
@@ -210,9 +209,7 @@
 		goto errout;
 	}
 
-	/* Apparently, this is the right way to detect and handle fast
-	 * symlinks; see do_stat() in debugfs.c. */
-	if (inode->i_blocks == 0)
+	if (ext2fs_is_fast_symlink(inode))
 		strcpy(buf, (char *) inode->i_block);
 	else {
 		unsigned bytes = inode->i_size;
@@ -271,12 +268,12 @@
 		int fd;
 		fd = open(fullname, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, S_IRWXU);
 		if (fd == -1) {
-			com_err("rdump", errno, "while dumping %s", fullname);
+			com_err("rdump", errno, "while opening %s", fullname);
 			goto errout;
 		}
 		dump_file("rdump", ino, fd, 1, fullname);
 		if (close(fd) != 0) {
-			com_err("rdump", errno, "while dumping %s", fullname);
+			com_err("rdump", errno, "while closing %s", fullname);
 			goto errout;
 		}
 	}
@@ -286,7 +283,7 @@
 		/* Create the directory with 0700 permissions, because we
 		 * expect to have to create entries it.  Then fix its perms
 		 * once we've done the traversal. */
-		if (mkdir(fullname, S_IRWXU) == -1) {
+		if (name[0] && mkdir(fullname, S_IRWXU) == -1) {
 			com_err("rdump", errno, "while making directory %s", fullname);
 			goto errout;
 		}
@@ -314,7 +311,7 @@
 	const char *dumproot = private;
 	struct ext2_inode inode;
 
-	thislen = dirent->name_len & 0xFF;
+	thislen = ext2fs_dirent_name_len(dirent);
 	strncpy(name, dirent->name, thislen);
 	name[thislen] = 0;
 
@@ -326,46 +323,53 @@
 	return 0;
 }
 
-void do_rdump(int argc, char **argv)
+void do_rdump(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
-	ext2_ino_t ino;
-	struct ext2_inode inode;
 	struct stat st;
+	char *dest_dir;
 	int i;
-	char *p;
 
-	if (common_args_process(argc, argv, 3, 3, "rdump",
-				"<directory> <native directory>", 0))
+	if (common_args_process(argc, argv, 3, INT_MAX, "rdump",
+				"<directory>... <native directory>", 0))
 		return;
 
-	ino = string_to_inode(argv[1]);
-	if (!ino)
-		return;
+	/* Pull out last argument */
+	dest_dir = argv[argc - 1];
+	argc--;
 
-	/* Ensure ARGV[2] is a directory. */
-	i = stat(argv[2], &st);
-	if (i == -1) {
-		com_err("rdump", errno, "while statting %s", argv[2]);
+	/* Ensure last arg is a directory. */
+	if (stat(dest_dir, &st) == -1) {
+		com_err("rdump", errno, "while statting %s", dest_dir);
 		return;
 	}
 	if (!S_ISDIR(st.st_mode)) {
-		com_err("rdump", 0, "%s is not a directory", argv[2]);
+		com_err("rdump", 0, "%s is not a directory", dest_dir);
 		return;
 	}
 
-	if (debugfs_read_inode(ino, &inode, argv[1]))
-		return;
+	for (i = 1; i < argc; i++) {
+		char *arg = argv[i], *basename;
+		struct ext2_inode inode;
+		ext2_ino_t ino = string_to_inode(arg);
+		if (!ino)
+			continue;
 
-	p = strrchr(argv[1], '/');
-	if (p)
-		p++;
-	else
-		p = argv[1];
+		if (debugfs_read_inode(ino, &inode, arg))
+			continue;
 
-	rdump_inode(ino, &inode, p, argv[2]);
+		basename = strrchr(arg, '/');
+		if (basename)
+			basename++;
+		else
+			basename = arg;
+
+		rdump_inode(ino, &inode, basename, dest_dir);
+	}
 }
 
-void do_cat(int argc, char **argv)
+void do_cat(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+	    void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	inode;
 
diff --git a/debugfs/extent_cmds.c b/debugfs/extent_cmds.c
new file mode 100644
index 0000000..284db7d
--- /dev/null
+++ b/debugfs/extent_cmds.c
@@ -0,0 +1,240 @@
+/* ./extent_cmds.c - automatically generated from ./extent_cmds.ct */
+#include <ss/ss.h>
+
+static char const * const ssu00001[] = {
+"current_node",
+    "current",
+    (char const *)0
+};
+extern void do_current_node __SS_PROTO;
+static char const * const ssu00002[] = {
+"root_node",
+    "root",
+    (char const *)0
+};
+extern void do_root_node __SS_PROTO;
+static char const * const ssu00003[] = {
+"last_leaf",
+    (char const *)0
+};
+extern void do_last_leaf __SS_PROTO;
+static char const * const ssu00004[] = {
+"first_sibling",
+    "first_sib",
+    (char const *)0
+};
+extern void do_first_sib __SS_PROTO;
+static char const * const ssu00005[] = {
+"last_sibling",
+    "last_sib",
+    (char const *)0
+};
+extern void do_last_sib __SS_PROTO;
+static char const * const ssu00006[] = {
+"next_sibling",
+    "next_sib",
+    "ns",
+    (char const *)0
+};
+extern void do_next_sib __SS_PROTO;
+static char const * const ssu00007[] = {
+"prev_sibling",
+    "prev_sib",
+    "ps",
+    (char const *)0
+};
+extern void do_prev_sib __SS_PROTO;
+static char const * const ssu00008[] = {
+"next_leaf",
+    "nl",
+    (char const *)0
+};
+extern void do_next_leaf __SS_PROTO;
+static char const * const ssu00009[] = {
+"prev_leaf",
+    "pl",
+    (char const *)0
+};
+extern void do_prev_leaf __SS_PROTO;
+static char const * const ssu00010[] = {
+"next",
+    "n",
+    (char const *)0
+};
+extern void do_next __SS_PROTO;
+static char const * const ssu00011[] = {
+"previous",
+    "prev",
+    "p",
+    (char const *)0
+};
+extern void do_prev __SS_PROTO;
+static char const * const ssu00012[] = {
+"up_node",
+    "up",
+    "u",
+    (char const *)0
+};
+extern void do_up __SS_PROTO;
+static char const * const ssu00013[] = {
+"down_node",
+    "down",
+    "d",
+    (char const *)0
+};
+extern void do_down __SS_PROTO;
+static char const * const ssu00014[] = {
+"delete_node",
+    "delete",
+    (char const *)0
+};
+extern void do_delete_node __SS_PROTO;
+static char const * const ssu00015[] = {
+"insert_node",
+    "insert",
+    (char const *)0
+};
+extern void do_insert_node __SS_PROTO;
+static char const * const ssu00016[] = {
+"split_node",
+    "split",
+    (char const *)0
+};
+extern void do_split_node __SS_PROTO;
+static char const * const ssu00017[] = {
+"fix_parents",
+    "fixp",
+    (char const *)0
+};
+extern void do_fix_parents __SS_PROTO;
+static char const * const ssu00018[] = {
+"set_bmap",
+    (char const *)0
+};
+extern void do_set_bmap __SS_PROTO;
+static char const * const ssu00019[] = {
+"replace_node",
+    "replace",
+    (char const *)0
+};
+extern void do_replace_node __SS_PROTO;
+static char const * const ssu00020[] = {
+"print_all",
+    "all",
+    (char const *)0
+};
+extern void do_print_all __SS_PROTO;
+static char const * const ssu00021[] = {
+"goto_block",
+    "goto",
+    (char const *)0
+};
+extern void do_goto_block __SS_PROTO;
+static char const * const ssu00022[] = {
+"info",
+    (char const *)0
+};
+extern void do_info __SS_PROTO;
+static char const * const ssu00023[] = {
+"extent_close",
+    "ec",
+    (char const *)0
+};
+extern void do_extent_close __SS_PROTO;
+static ss_request_entry ssu00024[] = {
+    { ssu00001,
+      do_current_node,
+      "Current extent node",
+      0 },
+    { ssu00002,
+      do_root_node,
+      "Goto root extent",
+      0 },
+    { ssu00003,
+      do_last_leaf,
+      "Goto last leaf",
+      0 },
+    { ssu00004,
+      do_first_sib,
+      "Goto first sibling",
+      0 },
+    { ssu00005,
+      do_last_sib,
+      "Goto last sibling",
+      0 },
+    { ssu00006,
+      do_next_sib,
+      "Goto next sibling",
+      0 },
+    { ssu00007,
+      do_prev_sib,
+      "Goto previous sibling",
+      0 },
+    { ssu00008,
+      do_next_leaf,
+      "Goto next leaf",
+      0 },
+    { ssu00009,
+      do_prev_leaf,
+      "Goto previous leaf",
+      0 },
+    { ssu00010,
+      do_next,
+      "Goto next node",
+      0 },
+    { ssu00011,
+      do_prev,
+      "Goto previous node",
+      0 },
+    { ssu00012,
+      do_up,
+      "Up node",
+      0 },
+    { ssu00013,
+      do_down,
+      "Down node",
+      0 },
+    { ssu00014,
+      do_delete_node,
+      "Delete node",
+      0 },
+    { ssu00015,
+      do_insert_node,
+      "Insert node",
+      0 },
+    { ssu00016,
+      do_split_node,
+      "Split node",
+      0 },
+    { ssu00017,
+      do_fix_parents,
+      "Fix parents",
+      0 },
+    { ssu00018,
+      do_set_bmap,
+      "Set block mapping",
+      0 },
+    { ssu00019,
+      do_replace_node,
+      "Insert node",
+      0 },
+    { ssu00020,
+      do_print_all,
+      "Iterate over all nodes and print them",
+      0 },
+    { ssu00021,
+      do_goto_block,
+      "Goto extent containing specified block",
+      0 },
+    { ssu00022,
+      do_info,
+      "Print extent info",
+      0 },
+    { ssu00023,
+      do_extent_close,
+      "Close extent handle",
+      0 },
+    { 0, 0, 0, 0 }
+};
+
+ss_request_table extent_cmds = { 2, ssu00024 };
diff --git a/debugfs/extent_inode.c b/debugfs/extent_inode.c
index 25b8946..e4e815e 100644
--- a/debugfs/extent_inode.c
+++ b/debugfs/extent_inode.c
@@ -5,6 +5,7 @@
  * under the terms of the GNU Public License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -32,8 +33,9 @@
 	if (desc)
 		printf("%s: ", desc);
 	printf("extent: lblk %llu--%llu, len %u, pblk %llu, flags: ",
-	       extent->e_lblk, extent->e_lblk + extent->e_len - 1,
-	       extent->e_len, extent->e_pblk);
+	       (unsigned long long) extent->e_lblk,
+	       (unsigned long long) extent->e_lblk + extent->e_len - 1,
+	       extent->e_len, (unsigned long long) extent->e_pblk);
 	if (extent->e_flags & EXT2_EXTENT_FLAGS_LEAF)
 		fputs("LEAF ", stdout);
 	if (extent->e_flags & EXT2_EXTENT_FLAGS_UNINIT)
@@ -63,7 +65,8 @@
 
 static char *orig_prompt, *extent_prompt;
 
-void do_extent_open(int argc, char *argv[])
+void do_extent_open(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		    void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	inode;
 	int		ret;
@@ -75,7 +78,7 @@
 
 	if (argc == 1) {
 		if (current_ino)
-			printf("Current inode is %d\n", current_ino);
+			printf("Current inode is %u\n", current_ino);
 		else
 			printf("No current inode\n");
 		return;
@@ -96,18 +99,24 @@
 
 	orig_prompt = ss_get_prompt(sci_idx);
 	extent_prompt = malloc(strlen(orig_prompt) + 32);
+	if (extent_prompt == NULL) {
+		com_err(argv[1], retval, "out of memory");
+		return;
+	}
+
 	strcpy(extent_prompt, orig_prompt);
 	cp = strchr(extent_prompt, ':');
 	if (cp)
 		*cp = 0;
-	sprintf(extent_prompt + strlen(extent_prompt), " (extent ino %d): ",
+	sprintf(extent_prompt + strlen(extent_prompt), " (extent ino %u): ",
 		current_ino);
 	ss_add_request_table(sci_idx, &extent_cmds, 1, &ret);
 	ss_set_prompt(sci_idx, extent_prompt);
 	return;
 }
 
-void do_extent_close(int argc, char *argv[])
+void do_extent_close(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		     void *infop EXT2FS_ATTR((unused)))
 {
 	int ret;
 
@@ -152,72 +161,86 @@
 	dbg_print_extent(0, &extent);
 }
 
-void do_current_node(int argc, char *argv[])
+void do_current_node(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		     void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("current_node", argc, argv, EXT2_EXTENT_CURRENT);
 }
 
-void do_root_node(int argc, char *argv[])
+void do_root_node(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("root_node", argc, argv, EXT2_EXTENT_ROOT);
 }
 
-void do_last_leaf(int argc, char *argv[])
+void do_last_leaf(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("last_leaf", argc, argv, EXT2_EXTENT_LAST_LEAF);
 }
 
-void do_first_sib(int argc, char *argv[])
+void do_first_sib(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("first_sib", argc, argv, EXT2_EXTENT_FIRST_SIB);
 }
 
-void do_last_sib(int argc, char *argv[])
+void do_last_sib(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("next_sib", argc, argv, EXT2_EXTENT_LAST_SIB);
 }
 
-void do_next_sib(int argc, char *argv[])
+void do_next_sib(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("next_sib", argc, argv, EXT2_EXTENT_NEXT_SIB);
 }
 
-void do_prev_sib(int argc, char *argv[])
+void do_prev_sib(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("prev_sib", argc, argv, EXT2_EXTENT_PREV_SIB);
 }
 
-void do_next_leaf(int argc, char *argv[])
+void do_next_leaf(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("next_leaf", argc, argv, EXT2_EXTENT_NEXT_LEAF);
 }
 
-void do_prev_leaf(int argc, char *argv[])
+void do_prev_leaf(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("prev_leaf", argc, argv, EXT2_EXTENT_PREV_LEAF);
 }
 
-void do_next(int argc, char *argv[])
+void do_next(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("next", argc, argv, EXT2_EXTENT_NEXT);
 }
 
-void do_prev(int argc, char *argv[])
+void do_prev(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("prev", argc, argv, EXT2_EXTENT_PREV);
 }
 
-void do_up(int argc, char *argv[])
+void do_up(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	   void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("up", argc, argv, EXT2_EXTENT_UP);
 }
 
-void do_down(int argc, char *argv[])
+void do_down(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	generic_goto_node("down", argc, argv, EXT2_EXTENT_DOWN);
 }
 
-void do_delete_node(int argc, char *argv[])
+void do_delete_node(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		    void *infop EXT2FS_ATTR((unused)))
 {
 	struct ext2fs_extent extent;
 	errcode_t	retval;
@@ -239,7 +262,8 @@
 	dbg_print_extent(0, &extent);
 }
 
-void do_replace_node(int argc, char *argv[])
+void do_replace_node(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		     void *infop EXT2FS_ATTR((unused)))
 {
 	const char	*usage = "[--uninit] <lblk> <len> <pblk>";
 	errcode_t	retval;
@@ -263,15 +287,15 @@
 		return;
 	}
 
-	err = strtoblk(argv[0], argv[1], &extent.e_lblk);
+	err = strtoblk(argv[0], argv[1], "logical block", &extent.e_lblk);
 	if (err)
 		return;
 
-	extent.e_len = parse_ulong(argv[2], argv[0], "logical block", &err);
+	extent.e_len = parse_ulong(argv[2], argv[0], "length", &err);
 	if (err)
 		return;
 
-	err = strtoblk(argv[0], argv[3], &extent.e_pblk);
+	err = strtoblk(argv[0], argv[3], "physical block", &extent.e_pblk);
 	if (err)
 		return;
 
@@ -283,7 +307,8 @@
 	generic_goto_node(NULL, argc, argv, EXT2_EXTENT_CURRENT);
 }
 
-void do_split_node(int argc, char *argv[])
+void do_split_node(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		   void *infop EXT2FS_ATTR((unused)))
 {
 	errcode_t	retval;
 
@@ -299,7 +324,8 @@
 	generic_goto_node(NULL, argc, argv, EXT2_EXTENT_CURRENT);
 }
 
-void do_insert_node(int argc, char *argv[])
+void do_insert_node(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		    void *infop EXT2FS_ATTR((unused)))
 {
 	const char	*usage = "[--after] [--uninit] <lblk> <len> <pblk>";
 	errcode_t	retval;
@@ -337,16 +363,15 @@
 		return;
 	}
 
-	err = strtoblk(cmd, argv[1], &extent.e_lblk);
+	err = strtoblk(cmd, argv[1], "logical block", &extent.e_lblk);
 	if (err)
 		return;
 
-	extent.e_len = parse_ulong(argv[2], cmd,
-				    "length", &err);
+	extent.e_len = parse_ulong(argv[2], cmd, "length", &err);
 	if (err)
 		return;
 
-	err = strtoblk(cmd, argv[3], &extent.e_pblk);
+	err = strtoblk(cmd, argv[3], "physical block", &extent.e_pblk);
 	if (err)
 		return;
 
@@ -358,7 +383,8 @@
 	generic_goto_node(NULL, argc, argv, EXT2_EXTENT_CURRENT);
 }
 
-void do_set_bmap(int argc, char **argv)
+void do_set_bmap(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
 {
 	const char	*usage = "[--uninit] <lblk> <pblk>";
 	struct ext2fs_extent extent;
@@ -384,11 +410,11 @@
 		return;
 	}
 
-	err = strtoblk(cmd, argv[1], &logical);
+	err = strtoblk(cmd, argv[1], "logical block", &logical);
 	if (err)
 		return;
 
-	err = strtoblk(cmd, argv[2], &physical);
+	err = strtoblk(cmd, argv[2], "physical block", &physical);
 	if (err)
 		return;
 
@@ -406,7 +432,8 @@
 	dbg_print_extent(0, &extent);
 }
 
-void do_print_all(int argc, char **argv)
+void do_print_all(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
 {
 	const char	*usage = "[--leaf-only|--reverse|--reverse-leaf]";
 	struct ext2fs_extent	extent;
@@ -457,7 +484,8 @@
 	}
 }
 
-void do_fix_parents(int argc, char **argv)
+void do_fix_parents(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		    void *infop EXT2FS_ATTR((unused)))
 {
 	errcode_t		retval;
 
@@ -472,7 +500,8 @@
 	}
 }
 
-void do_info(int argc, char **argv)
+void do_info(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+	     void *infop EXT2FS_ATTR((unused)))
 {
 	struct ext2fs_extent	extent;
 	struct ext2_extent_info	info;
@@ -499,13 +528,15 @@
 	printf("Current handle location: %d/%d (max: %d, bytes %d), level %d/%d\n",
 	       info.curr_entry, info.num_entries, info.max_entries,
 	       info.bytes_avail, info.curr_level, info.max_depth);
-	printf("\tmax lblk: %llu, max pblk: %llu\n", info.max_lblk,
-	       info.max_pblk);
+	printf("\tmax lblk: %llu, max pblk: %llu\n",
+	       (unsigned long long) info.max_lblk,
+	       (unsigned long long) info.max_pblk);
 	printf("\tmax_len: %u, max_uninit_len: %u\n", info.max_len,
 	       info.max_uninit_len);
 }
 
-void do_goto_block(int argc, char **argv)
+void do_goto_block(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		   void *infop EXT2FS_ATTR((unused)))
 {
 	errcode_t		retval;
 	blk64_t			blk;
@@ -515,7 +546,7 @@
 				       "block [level]", 0))
 		return;
 
-	if (strtoblk(argv[0], argv[1], &blk))
+	if (strtoblk(argv[0], argv[1], NULL, &blk))
 		return;
 
 	if (argc == 3) {
diff --git a/debugfs/filefrag.c b/debugfs/filefrag.c
index 67a7678..31c1440 100644
--- a/debugfs/filefrag.c
+++ b/debugfs/filefrag.c
@@ -5,6 +5,7 @@
  * under the terms of the GNU Public License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -84,14 +85,17 @@
 			fprintf(fs->f, "%4d %*lu %*llu %*llu %*lu\n", fs->ext,
 				fs->logical_width,
 				(unsigned long) fs->logical_start,
-				fs->physical_width, fs->physical_start,
-				fs->physical_width, fs->expected,
+				fs->physical_width,
+				(unsigned long long) fs->physical_start,
+				fs->physical_width,
+				(unsigned long long) fs->expected,
 				fs->logical_width, (unsigned long) fs->num);
 		else
 			fprintf(fs->f, "%4d %*lu %*llu %*s %*lu\n", fs->ext,
 				fs->logical_width,
 				(unsigned long) fs->logical_start,
-				fs->physical_width, fs->physical_start,
+				fs->physical_width,
+				(unsigned long long) fs->physical_start,
 				fs->physical_width, "",
 				fs->logical_width, (unsigned long) fs->num);
 	}
@@ -144,20 +148,22 @@
 	if (fs->options & VERBOSE_OPT) {
 		blk64_t num_blocks = ext2fs_inode_i_blocks(current_fs, inode);
 
-		if (!(current_fs->super->s_feature_ro_compat &
-		     EXT4_FEATURE_RO_COMPAT_HUGE_FILE) ||
+		if (!ext2fs_has_feature_huge_file(current_fs->super) ||
 		    !(inode->i_flags & EXT4_HUGE_FILE_FL))
 			num_blocks /= current_fs->blocksize / 512;
 
 		fprintf(fs->f, "\n%s has %llu block(s), i_size is %llu\n",
-			fs->name, num_blocks, EXT2_I_SIZE(inode));
+			fs->name, (unsigned long long) num_blocks,
+			(unsigned long long) EXT2_I_SIZE(inode));
 	}
 	print_header(fs);
-	retval = ext2fs_block_iterate3(current_fs, ino,
-				       BLOCK_FLAG_READ_ONLY, NULL,
-				       filefrag_blocks_proc, fs);
-	if (retval)
-		com_err("ext2fs_block_iterate3", retval, 0);
+	if (ext2fs_inode_has_valid_blocks2(current_fs, inode)) {
+		retval = ext2fs_block_iterate3(current_fs, ino,
+					       BLOCK_FLAG_READ_ONLY, NULL,
+					       filefrag_blocks_proc, fs);
+		if (retval)
+			com_err("ext2fs_block_iterate3", retval, 0);
+	}
 
 	report_filefrag(fs);
 	fprintf(fs->f, "%s: %d contiguous extents%s\n", fs->name, fs->ext,
@@ -182,7 +188,7 @@
 	if (entry == DIRENT_DELETED_FILE)
 		return 0;
 
-	thislen = dirent->name_len & 0xFF;
+	thislen = ext2fs_dirent_name_len(dirent);
 	strncpy(name, dirent->name, thislen);
 	name[thislen] = '\0';
 	ino = dirent->inode;
@@ -258,7 +264,8 @@
 	}
 }
 
-void do_filefrag(int argc, char *argv[])
+void do_filefrag(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
 {
 	struct filefrag_struct fs;
 	struct ext2_inode inode;
diff --git a/debugfs/htree.c b/debugfs/htree.c
index 03b62a7..a9f9211 100644
--- a/debugfs/htree.c
+++ b/debugfs/htree.c
@@ -5,6 +5,7 @@
  * under the terms of the GNU Public License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -43,20 +44,27 @@
 	ext2_dirhash_t 	hash, minor_hash;
 	unsigned int	rec_len;
 	int		hash_alg;
+	int		hash_flags = inode->i_flags & EXT4_CASEFOLD_FL;
+	int		csum_size = 0;
+
+	if (ext2fs_has_feature_metadata_csum(fs->super))
+		csum_size = sizeof(struct ext2_dir_entry_tail);
 
 	errcode = ext2fs_bmap2(fs, ino, inode, buf, 0, blk, 0, &pblk);
 	if (errcode) {
 		com_err("htree_dump_leaf_node", errcode,
-			"while mapping logical block %llu\n", blk);
+			"while mapping logical block %llu\n",
+			(unsigned long long) blk);
 		return;
 	}
 
-	fprintf(pager, "Reading directory block %llu, phys %llu\n", blk, pblk);
-	errcode = ext2fs_read_dir_block2(current_fs, pblk, buf, 0);
+	fprintf(pager, "Reading directory block %llu, phys %llu\n",
+		(unsigned long long) blk, (unsigned long long) pblk);
+	errcode = ext2fs_read_dir_block4(current_fs, pblk, buf, 0, ino);
 	if (errcode) {
 		com_err("htree_dump_leaf_node", errcode,
 			"while reading block %llu (%llu)\n",
-			blk, pblk);
+			(unsigned long long) blk, (unsigned long long) pblk);
 		return;
 	}
 	hash_alg = rootnode->hash_version;
@@ -73,25 +81,41 @@
 				(unsigned long) blk);
 			return;
 		}
+		thislen = ext2fs_dirent_name_len(dirent);
 		if (((offset + rec_len) > fs->blocksize) ||
 		    (rec_len < 8) ||
 		    ((rec_len % 4) != 0) ||
-		    ((((unsigned) dirent->name_len & 0xFF)+8) > rec_len)) {
+		    ((unsigned) thislen + 8 > rec_len)) {
 			fprintf(pager, "Corrupted directory block (%llu)!\n",
-				blk);
+				(unsigned long long) blk);
 			break;
 		}
-		thislen = dirent->name_len & 0xFF;
 		strncpy(name, dirent->name, thislen);
 		name[thislen] = '\0';
-		errcode = ext2fs_dirhash(hash_alg, name,
-					 thislen, fs->super->s_hash_seed,
-					 &hash, &minor_hash);
+		errcode = ext2fs_dirhash2(hash_alg, name, thislen,
+					  fs->encoding, hash_flags,
+					  fs->super->s_hash_seed,
+					  &hash, &minor_hash);
 		if (errcode)
 			com_err("htree_dump_leaf_node", errcode,
 				"while calculating hash");
-		snprintf(tmp, EXT2_NAME_LEN + 64, "%u 0x%08x-%08x (%d) %s   ",
-			dirent->inode, hash, minor_hash, rec_len, name);
+		if ((offset == fs->blocksize - csum_size) &&
+		    (dirent->inode == 0) &&
+		    (dirent->rec_len == csum_size) &&
+		    (dirent->name_len == EXT2_DIR_NAME_LEN_CSUM)) {
+			struct ext2_dir_entry_tail *t;
+
+			t = (struct ext2_dir_entry_tail *) dirent;
+
+			snprintf(tmp, EXT2_NAME_LEN + 64,
+				 "leaf block checksum: 0x%08x  ",
+				 t->det_checksum);
+		} else {
+			snprintf(tmp, EXT2_NAME_LEN + 64,
+				 "%u 0x%08x-%08x (%d) %s   ",
+				 dirent->inode, hash, minor_hash,
+				 rec_len, name);
+		}
 		thislen = strlen(tmp);
 		if (col + thislen > 80) {
 			fprintf(pager, "\n");
@@ -114,22 +138,38 @@
 static void htree_dump_int_node(ext2_filsys fs, ext2_ino_t ino,
 				struct ext2_inode *inode,
 				struct ext2_dx_root_info * rootnode,
-				struct ext2_dx_entry *ent,
+				struct ext2_dx_entry *ent, __u32 crc,
 				char *buf, int level)
 {
-	struct ext2_dx_countlimit	limit;
-	struct ext2_dx_entry		e;
+	struct ext2_dx_countlimit	dx_countlimit;
+	struct ext2_dx_tail		*tail;
 	int				hash, i;
+	int				limit, count;
+	int				remainder;
 
+	dx_countlimit = *((struct ext2_dx_countlimit *) ent);
+	count = ext2fs_le16_to_cpu(dx_countlimit.count);
+	limit = ext2fs_le16_to_cpu(dx_countlimit.limit);
 
-	limit = *((struct ext2_dx_countlimit *) ent);
-	limit.count = ext2fs_le16_to_cpu(limit.count);
-	limit.limit = ext2fs_le16_to_cpu(limit.limit);
+	fprintf(pager, "Number of entries (count): %d\n", count);
+	fprintf(pager, "Number of entries (limit): %d\n", limit);
 
-	fprintf(pager, "Number of entries (count): %d\n", limit.count);
-	fprintf(pager, "Number of entries (limit): %d\n", limit.limit);
+	remainder = fs->blocksize - (limit * sizeof(struct ext2_dx_entry));
+	if (ent == (struct ext2_dx_entry *)(rootnode + 1))
+		remainder -= sizeof(struct ext2_dx_root_info) + 24;
+	else
+		remainder -= 8;
+	if (ext2fs_has_feature_metadata_csum(fs->super) &&
+	    remainder == sizeof(struct ext2_dx_tail)) {
+		tail = (struct ext2_dx_tail *)(ent + limit);
+		fprintf(pager, "Checksum: 0x%08x",
+			ext2fs_le32_to_cpu(tail->dt_checksum));
+		if (tail->dt_checksum != crc)
+			fprintf(pager, " --- EXPECTED: 0x%08x", crc);
+		fputc('\n', pager);
+	}
 
-	for (i=0; i < limit.count; i++) {
+	for (i=0; i < count; i++) {
 		hash = i ? ext2fs_le32_to_cpu(ent[i].hash) : 0;
 		fprintf(pager, "Entry #%d: Hash 0x%08x%s, block %u\n", i,
 			hash, (hash & 1) ? " (**)" : "",
@@ -138,17 +178,19 @@
 
 	fprintf(pager, "\n");
 
-	for (i=0; i < limit.count; i++) {
-		e.hash = ext2fs_le32_to_cpu(ent[i].hash);
-		e.block = ext2fs_le32_to_cpu(ent[i].block);
+	for (i=0; i < count; i++) {
+		unsigned int hashval, block;
+
+		hashval = ext2fs_le32_to_cpu(ent[i].hash);
+		block = ext2fs_le32_to_cpu(ent[i].block);
 		fprintf(pager, "Entry #%d: Hash 0x%08x, block %u\n", i,
-		       i ? e.hash : 0, e.block);
+		       i ? hashval : 0, block);
 		if (level)
 			htree_dump_int_block(fs, ino, inode, rootnode,
-					     e.block, buf, level-1);
+					     block, buf, level-1);
 		else
 			htree_dump_leaf_node(fs, ino, inode, rootnode,
-					     e.block, buf);
+					     block, buf);
 	}
 
 	fprintf(pager, "---------------------\n");
@@ -162,6 +204,7 @@
 	char		*cbuf;
 	errcode_t	errcode;
 	blk64_t		pblk;
+	__u32		crc;
 
 	cbuf = malloc(fs->blocksize);
 	if (!cbuf) {
@@ -172,27 +215,38 @@
 	errcode = ext2fs_bmap2(fs, ino, inode, buf, 0, blk, 0, &pblk);
 	if (errcode) {
 		com_err("htree_dump_int_block", errcode,
-			"while mapping logical block %llu\n", blk);
+			"while mapping logical block %llu\n",
+			(unsigned long long) blk);
 		goto errout;
 	}
 
 	errcode = io_channel_read_blk64(current_fs->io, pblk, 1, buf);
 	if (errcode) {
 		com_err("htree_dump_int_block", errcode,
-			"while 	reading block %llu\n", blk);
+			"while reading block %llu\n",
+			(unsigned long long) blk);
 		goto errout;
 	}
 
+	errcode = ext2fs_dx_csum(current_fs, ino,
+				 (struct ext2_dir_entry *) buf, &crc, NULL);
+	if (errcode) {
+		com_err("htree_dump_int_block", errcode,
+			"while calculating checksum for logical block %llu\n",
+			(unsigned long long) blk);
+		crc = (unsigned int) -1;
+	}
 	htree_dump_int_node(fs, ino, inode, rootnode,
 			    (struct ext2_dx_entry *) (buf+8),
-			    cbuf, level);
+			    crc, cbuf, level);
 errout:
 	free(cbuf);
 }
 
 
 
-void do_htree_dump(int argc, char *argv[])
+void do_htree_dump(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		   void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	ino;
 	struct ext2_inode inode;
@@ -201,6 +255,7 @@
 	struct 		ext2_dx_root_info  *rootnode;
 	struct 		ext2_dx_entry *ent;
 	errcode_t	errcode;
+	__u32		crc;
 
 	if (check_fs_open(argv[0]))
 		return;
@@ -250,11 +305,19 @@
 	fprintf(pager, "\t Hash Version: %d\n", rootnode->hash_version);
 	fprintf(pager, "\t Info length: %d\n", rootnode->info_length);
 	fprintf(pager, "\t Indirect levels: %d\n", rootnode->indirect_levels);
-	fprintf(pager, "\t Flags: %d\n", rootnode->unused_flags);
+	fprintf(pager, "\t Flags: %#x\n", rootnode->unused_flags);
 
-	ent = (struct ext2_dx_entry *) (buf + 24 + rootnode->info_length);
+	ent = (struct ext2_dx_entry *)
+		((char *)rootnode + rootnode->info_length);
 
-	htree_dump_int_node(current_fs, ino, &inode, rootnode, ent,
+	errcode = ext2fs_dx_csum(current_fs, ino,
+				 (struct ext2_dir_entry *) buf, &crc, NULL);
+	if (errcode) {
+		com_err("htree_dump_int_block", errcode,
+			"while calculating checksum for htree root\n");
+		crc = (unsigned int) -1;
+	}
+	htree_dump_int_node(current_fs, ino, &inode, rootnode, ent, crc,
 			    buf + current_fs->blocksize,
 			    rootnode->indirect_levels);
 
@@ -266,18 +329,21 @@
 /*
  * This function prints the hash of a given file.
  */
-void do_dx_hash(int argc, char *argv[])
+void do_dx_hash(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_dirhash_t hash, minor_hash;
 	errcode_t	err;
 	int		c;
 	int		hash_version = 0;
 	__u32		hash_seed[4];
+	int		hash_flags = 0;
+	const struct ext2fs_nls_table *encoding = NULL;
 
 	hash_seed[0] = hash_seed[1] = hash_seed[2] = hash_seed[3] = 0;
 
 	reset_getopt();
-	while ((c = getopt (argc, argv, "h:s:")) != EOF) {
+	while ((c = getopt(argc, argv, "h:s:ce:")) != EOF) {
 		switch (c) {
 		case 'h':
 			hash_version = e2p_string2hash(optarg);
@@ -291,6 +357,17 @@
 				return;
 			}
 			break;
+		case 'c':
+			hash_flags |= EXT4_CASEFOLD_FL;
+			break;
+		case 'e':
+			encoding = ext2fs_load_nls_table(e2p_str2encoding(optarg));
+			if (!encoding) {
+				fprintf(stderr, "Invalid encoding: %s\n",
+					optarg);
+				return;
+			}
+			break;
 		default:
 			goto print_usage;
 		}
@@ -298,13 +375,15 @@
 	if (optind != argc-1) {
 	print_usage:
 		com_err(argv[0], 0, "usage: dx_hash [-h hash_alg] "
-			"[-s hash_seed] filename");
+			"[-s hash_seed] [-c] [-e encoding] filename");
 		return;
 	}
-	err = ext2fs_dirhash(hash_version, argv[optind], strlen(argv[optind]),
-			     hash_seed, &hash, &minor_hash);
+	err = ext2fs_dirhash2(hash_version, argv[optind],
+			      strlen(argv[optind]), encoding, hash_flags,
+			      hash_seed, &hash, &minor_hash);
+
 	if (err) {
-		com_err(argv[0], err, "while caclulating hash");
+		com_err(argv[0], err, "while calculating hash");
 		return;
 	}
 	printf("Hash of %s is 0x%0x (minor 0x%0x)\n", argv[optind],
@@ -326,7 +405,8 @@
 			    e2_blkcnt_t blockcnt, blk64_t ref_blk,
 			    int ref_offset, void *priv_data);
 
-void do_dirsearch(int argc, char *argv[])
+void do_dirsearch(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
 {
 	ext2_ino_t	inode;
 	struct process_block_struct pb;
@@ -392,12 +472,12 @@
 			return BLOCK_ABORT;
 		}
 		if (dirent->inode &&
-		    p->len == (dirent->name_len & 0xFF) &&
+		    p->len == ext2fs_dirent_name_len(dirent) &&
 		    strncmp(p->search_name, dirent->name,
 			    p->len) == 0) {
 			printf("Entry found at logical block %lld, "
 			       "phys %llu, offset %u\n", (long long)blockcnt,
-			       *blocknr, offset);
+			       (unsigned long long) *blocknr, offset);
 			printf("offset %u\n", offset);
 			return BLOCK_ABORT;
 		}
diff --git a/debugfs/icheck.c b/debugfs/icheck.c
index 57fa80b..ed6e950 100644
--- a/debugfs/icheck.c
+++ b/debugfs/icheck.c
@@ -5,6 +5,7 @@
  * under the terms of the GNU Public License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -52,7 +53,8 @@
 	return 0;
 }
 
-void do_icheck(int argc, char **argv)
+void do_icheck(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+	       void *infop EXT2FS_ATTR((unused)))
 {
 	struct block_walk_struct bw;
 	struct block_info	*binfo;
@@ -85,7 +87,7 @@
 	}
 
 	for (i=1; i < argc; i++) {
-		if (strtoblk(argv[0], argv[i], &bw.barray[i-1].blk))
+		if (strtoblk(argv[0], argv[i], NULL, &bw.barray[i-1].blk))
 			goto error_out;
 	}
 
@@ -157,10 +159,12 @@
 	printf("Block\tInode number\n");
 	for (i=0, binfo = bw.barray; i < bw.num_blocks; i++, binfo++) {
 		if (binfo->ino == 0) {
-			printf("%llu\t<block not found>\n", binfo->blk);
+			printf("%llu\t<block not found>\n",
+			       (unsigned long long) binfo->blk);
 			continue;
 		}
-		printf("%llu\t%u\n", binfo->blk, binfo->ino);
+		printf("%llu\t%u\n", (unsigned long long) binfo->blk,
+		       binfo->ino);
 	}
 
 error_out:
diff --git a/debugfs/jfs_user.h b/debugfs/jfs_user.h
deleted file mode 100644
index 3070cd5..0000000
--- a/debugfs/jfs_user.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef _JFS_USER_H
-#define _JFS_USER_H
-
-typedef unsigned short kdev_t;
-
-#include <ext2fs/kernel-jbd.h>
-
-#endif /* _JFS_USER_H */
diff --git a/debugfs/journal.c b/debugfs/journal.c
new file mode 100644
index 0000000..e8872f0
--- /dev/null
+++ b/debugfs/journal.c
@@ -0,0 +1,948 @@
+/*
+ * journal.c --- code for handling the "ext3" journal
+ *
+ * Copyright (C) 2000 Andreas Dilger
+ * Copyright (C) 2000 Theodore Ts'o
+ *
+ * Parts of the code are based on fs/jfs/journal.c by Stephen C. Tweedie
+ * Copyright (C) 1999 Red Hat Software
+ *
+ * This file may be redistributed under the terms of the
+ * GNU General Public License version 2 or at your discretion
+ * any later version.
+ */
+
+#include "config.h"
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/param.h>
+#include <sys/mount.h>
+#define MNT_FL (MS_MGC_VAL | MS_RDONLY)
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#define E2FSCK_INCLUDE_INLINE_FUNCS
+#include "uuid/uuid.h"
+#include "journal.h"
+
+#ifdef CONFIG_JBD_DEBUG		/* Enabled by configure --enable-jfs-debug */
+static int bh_count = 0;
+#endif
+
+#if EXT2_FLAT_INCLUDES
+#include "blkid.h"
+#else
+#include "blkid/blkid.h"
+#endif
+
+/*
+ * Define USE_INODE_IO to use the inode_io.c / fileio.c codepaths.
+ * This creates a larger static binary, and a smaller binary using
+ * shared libraries.  It's also probably slightly less CPU-efficient,
+ * which is why it's not on by default.  But, it's a good way of
+ * testing the functions in inode_io.c and fileio.c.
+ */
+#undef USE_INODE_IO
+
+/* Checksumming functions */
+static int ext2fs_journal_verify_csum_type(journal_t *j,
+					   journal_superblock_t *jsb)
+{
+	if (!jbd2_journal_has_csum_v2or3(j))
+		return 1;
+
+	return jsb->s_checksum_type == JBD2_CRC32C_CHKSUM;
+}
+
+static __u32 ext2fs_journal_sb_csum(journal_superblock_t *jsb)
+{
+	__u32 crc, old_crc;
+
+	old_crc = jsb->s_checksum;
+	jsb->s_checksum = 0;
+	crc = ext2fs_crc32c_le(~0, (unsigned char *)jsb,
+			       sizeof(journal_superblock_t));
+	jsb->s_checksum = old_crc;
+
+	return crc;
+}
+
+static int ext2fs_journal_sb_csum_verify(journal_t *j,
+					 journal_superblock_t *jsb)
+{
+	__u32 provided, calculated;
+
+	if (!jbd2_journal_has_csum_v2or3(j))
+		return 1;
+
+	provided = ext2fs_be32_to_cpu(jsb->s_checksum);
+	calculated = ext2fs_journal_sb_csum(jsb);
+
+	return provided == calculated;
+}
+
+static errcode_t ext2fs_journal_sb_csum_set(journal_t *j,
+					    journal_superblock_t *jsb)
+{
+	__u32 crc;
+
+	if (!jbd2_journal_has_csum_v2or3(j))
+		return 0;
+
+	crc = ext2fs_journal_sb_csum(jsb);
+	jsb->s_checksum = ext2fs_cpu_to_be32(crc);
+	return 0;
+}
+
+/* Kernel compatibility functions for handling the journal.  These allow us
+ * to use the recovery.c file virtually unchanged from the kernel, so we
+ * don't have to do much to keep kernel and user recovery in sync.
+ */
+int jbd2_journal_bmap(journal_t *journal, unsigned long block,
+		      unsigned long long *phys)
+{
+#ifdef USE_INODE_IO
+	*phys = block;
+	return 0;
+#else
+	struct inode	*inode = journal->j_inode;
+	errcode_t	retval;
+	blk64_t		pblk;
+
+	if (!inode) {
+		*phys = block;
+		return 0;
+	}
+
+	retval = ext2fs_bmap2(inode->i_fs, inode->i_ino,
+			      &inode->i_ext2, NULL, 0, (blk64_t) block,
+			      0, &pblk);
+	*phys = pblk;
+	return (int) retval;
+#endif
+}
+
+struct buffer_head *getblk(kdev_t kdev, unsigned long long blocknr,
+			   int blocksize)
+{
+	struct buffer_head *bh;
+	int bufsize = sizeof(*bh) + kdev->k_fs->blocksize -
+		sizeof(bh->b_data);
+	errcode_t retval;
+
+	retval = ext2fs_get_memzero(bufsize, &bh);
+	if (retval)
+		return NULL;
+
+#ifdef CONFIG_JBD_DEBUG
+	if (journal_enable_debug >= 3)
+		bh_count++;
+#endif
+	jfs_debug(4, "getblk for block %llu (%d bytes)(total %d)\n",
+		  blocknr, blocksize, bh_count);
+
+	bh->b_fs = kdev->k_fs;
+	if (kdev->k_dev == K_DEV_FS)
+		bh->b_io = kdev->k_fs->io;
+	else
+		bh->b_io = kdev->k_fs->journal_io;
+	bh->b_size = blocksize;
+	bh->b_blocknr = blocknr;
+
+	return bh;
+}
+
+int sync_blockdev(kdev_t kdev)
+{
+	io_channel	io;
+
+	if (kdev->k_dev == K_DEV_FS)
+		io = kdev->k_fs->io;
+	else
+		io = kdev->k_fs->journal_io;
+
+	return io_channel_flush(io) ? EIO : 0;
+}
+
+void ll_rw_block(int rw, int op_flags, int nr, struct buffer_head *bhp[])
+{
+	errcode_t retval;
+	struct buffer_head *bh;
+
+	for (; nr > 0; --nr) {
+		bh = *bhp++;
+		if (rw == REQ_OP_READ && !bh->b_uptodate) {
+			jfs_debug(3, "reading block %llu/%p\n",
+				  bh->b_blocknr, (void *) bh);
+			retval = io_channel_read_blk64(bh->b_io,
+						     bh->b_blocknr,
+						     1, bh->b_data);
+			if (retval) {
+				com_err(bh->b_fs->device_name, retval,
+					"while reading block %llu\n",
+					bh->b_blocknr);
+				bh->b_err = (int) retval;
+				continue;
+			}
+			bh->b_uptodate = 1;
+		} else if (rw == REQ_OP_WRITE && bh->b_dirty) {
+			jfs_debug(3, "writing block %llu/%p\n",
+				  bh->b_blocknr,
+				  (void *) bh);
+			retval = io_channel_write_blk64(bh->b_io,
+						      bh->b_blocknr,
+						      1, bh->b_data);
+			if (retval) {
+				com_err(bh->b_fs->device_name, retval,
+					"while writing block %llu\n",
+					bh->b_blocknr);
+				bh->b_err = (int) retval;
+				continue;
+			}
+			bh->b_dirty = 0;
+			bh->b_uptodate = 1;
+		} else {
+			jfs_debug(3, "no-op %s for block %llu\n",
+				  rw == REQ_OP_READ ? "read" : "write",
+				  bh->b_blocknr);
+		}
+	}
+}
+
+void mark_buffer_dirty(struct buffer_head *bh)
+{
+	bh->b_dirty = 1;
+}
+
+static void mark_buffer_clean(struct buffer_head *bh)
+{
+	bh->b_dirty = 0;
+}
+
+void brelse(struct buffer_head *bh)
+{
+	if (bh->b_dirty)
+		ll_rw_block(REQ_OP_WRITE, 0, 1, &bh);
+	jfs_debug(3, "freeing block %llu/%p (total %d)\n",
+		  bh->b_blocknr, (void *) bh, --bh_count);
+	ext2fs_free_mem(&bh);
+}
+
+int buffer_uptodate(struct buffer_head *bh)
+{
+	return bh->b_uptodate;
+}
+
+void mark_buffer_uptodate(struct buffer_head *bh, int val)
+{
+	bh->b_uptodate = val;
+}
+
+void wait_on_buffer(struct buffer_head *bh)
+{
+	if (!bh->b_uptodate)
+		ll_rw_block(REQ_OP_READ, 0, 1, &bh);
+}
+
+
+static void ext2fs_clear_recover(ext2_filsys fs, int error)
+{
+	ext2fs_clear_feature_journal_needs_recovery(fs->super);
+
+	/* if we had an error doing journal recovery, we need a full fsck */
+	if (error)
+		fs->super->s_state &= ~EXT2_VALID_FS;
+	/*
+	 * If we replayed the journal by definition the file system
+	 * was mounted since the last time it was checked
+	 */
+	if (fs->super->s_lastcheck >= fs->super->s_mtime)
+		fs->super->s_lastcheck = fs->super->s_mtime - 1;
+	ext2fs_mark_super_dirty(fs);
+}
+
+/*
+ * This is a helper function to check the validity of the journal.
+ */
+struct process_block_struct {
+	e2_blkcnt_t	last_block;
+};
+
+static int process_journal_block(ext2_filsys fs,
+				 blk64_t	*block_nr,
+				 e2_blkcnt_t blockcnt,
+				 blk64_t ref_block EXT2FS_ATTR((unused)),
+				 int ref_offset EXT2FS_ATTR((unused)),
+				 void *priv_data)
+{
+	struct process_block_struct *p;
+	blk64_t	blk = *block_nr;
+
+	p = (struct process_block_struct *) priv_data;
+
+	if (!blk || blk < fs->super->s_first_data_block ||
+	    blk >= ext2fs_blocks_count(fs->super))
+		return BLOCK_ABORT;
+
+	if (blockcnt >= 0)
+		p->last_block = blockcnt;
+	return 0;
+}
+
+static errcode_t ext2fs_get_journal(ext2_filsys fs, journal_t **ret_journal)
+{
+	struct process_block_struct pb;
+	struct ext2_super_block *sb = fs->super;
+	struct ext2_super_block jsuper;
+	struct buffer_head	*bh;
+	struct inode		*j_inode = NULL;
+	struct kdev_s		*dev_fs = NULL, *dev_journal;
+	const char		*journal_name = 0;
+	journal_t		*journal = NULL;
+	errcode_t		retval = 0;
+	io_manager		io_ptr = 0;
+	unsigned long long	start = 0;
+	int			ext_journal = 0;
+	int			tried_backup_jnl = 0;
+
+	retval = ext2fs_get_memzero(sizeof(journal_t), &journal);
+	if (retval)
+		return retval;
+
+	retval = ext2fs_get_memzero(2 * sizeof(struct kdev_s), &dev_fs);
+	if (retval)
+		goto errout;
+	dev_journal = dev_fs+1;
+
+	dev_fs->k_fs = dev_journal->k_fs = fs;
+	dev_fs->k_dev = K_DEV_FS;
+	dev_journal->k_dev = K_DEV_JOURNAL;
+
+	journal->j_dev = dev_journal;
+	journal->j_fs_dev = dev_fs;
+	journal->j_inode = NULL;
+	journal->j_blocksize = fs->blocksize;
+
+	if (uuid_is_null(sb->s_journal_uuid)) {
+		if (!sb->s_journal_inum) {
+			retval = EXT2_ET_BAD_INODE_NUM;
+			goto errout;
+		}
+		retval = ext2fs_get_memzero(sizeof(*j_inode), &j_inode);
+		if (retval)
+			goto errout;
+
+		j_inode->i_fs = fs;
+		j_inode->i_ino = sb->s_journal_inum;
+
+		retval = ext2fs_read_inode(fs, sb->s_journal_inum,
+					   &j_inode->i_ext2);
+		if (retval) {
+try_backup_journal:
+			if (sb->s_jnl_backup_type != EXT3_JNL_BACKUP_BLOCKS ||
+			    tried_backup_jnl)
+				goto errout;
+			memset(&j_inode->i_ext2, 0, sizeof(struct ext2_inode));
+			memcpy(&j_inode->i_ext2.i_block[0], sb->s_jnl_blocks,
+			       EXT2_N_BLOCKS*4);
+			j_inode->i_ext2.i_size_high = sb->s_jnl_blocks[15];
+			j_inode->i_ext2.i_size = sb->s_jnl_blocks[16];
+			j_inode->i_ext2.i_links_count = 1;
+			j_inode->i_ext2.i_mode = LINUX_S_IFREG | 0600;
+			tried_backup_jnl++;
+		}
+		if (!j_inode->i_ext2.i_links_count ||
+		    !LINUX_S_ISREG(j_inode->i_ext2.i_mode)) {
+			retval = EXT2_ET_NO_JOURNAL;
+			goto try_backup_journal;
+		}
+		if (EXT2_I_SIZE(&j_inode->i_ext2) / journal->j_blocksize <
+		    JBD2_MIN_JOURNAL_BLOCKS) {
+			retval = EXT2_ET_JOURNAL_TOO_SMALL;
+			goto try_backup_journal;
+		}
+		pb.last_block = -1;
+		retval = ext2fs_block_iterate3(fs, j_inode->i_ino,
+					       BLOCK_FLAG_HOLE, 0,
+					       process_journal_block, &pb);
+		if ((pb.last_block + 1) * fs->blocksize <
+		    (int) EXT2_I_SIZE(&j_inode->i_ext2)) {
+			retval = EXT2_ET_JOURNAL_TOO_SMALL;
+			goto try_backup_journal;
+		}
+		if (tried_backup_jnl && (fs->flags & EXT2_FLAG_RW)) {
+			retval = ext2fs_write_inode(fs, sb->s_journal_inum,
+						    &j_inode->i_ext2);
+			if (retval)
+				goto errout;
+		}
+
+		journal->j_total_len = EXT2_I_SIZE(&j_inode->i_ext2) /
+			journal->j_blocksize;
+
+#ifdef USE_INODE_IO
+		retval = ext2fs_inode_io_intern2(fs, sb->s_journal_inum,
+						 &j_inode->i_ext2,
+						 &journal_name);
+		if (retval)
+			goto errout;
+
+		io_ptr = inode_io_manager;
+#else
+		journal->j_inode = j_inode;
+		fs->journal_io = fs->io;
+		retval = (errcode_t) jbd2_journal_bmap(journal, 0, &start);
+		if (retval)
+			goto errout;
+#endif
+	} else {
+		ext_journal = 1;
+		if (!fs->journal_name) {
+			char uuid[37];
+			blkid_cache blkid;
+
+			blkid_get_cache(&blkid, NULL);
+			uuid_unparse(sb->s_journal_uuid, uuid);
+			fs->journal_name = blkid_get_devname(blkid,
+							      "UUID", uuid);
+			if (!fs->journal_name)
+				fs->journal_name = blkid_devno_to_devname(sb->s_journal_dev);
+			blkid_put_cache(blkid);
+		}
+		journal_name = fs->journal_name;
+
+		if (!journal_name) {
+			retval = EXT2_ET_LOAD_EXT_JOURNAL;
+			goto errout;
+		}
+
+		jfs_debug(1, "Using journal file %s\n", journal_name);
+		io_ptr = unix_io_manager;
+	}
+
+#if 0
+	test_io_backing_manager = io_ptr;
+	io_ptr = test_io_manager;
+#endif
+#ifndef USE_INODE_IO
+	if (ext_journal)
+#endif
+	{
+		retval = io_ptr->open(journal_name, fs->flags & EXT2_FLAG_RW,
+				      &fs->journal_io);
+	}
+	if (retval)
+		goto errout;
+
+	io_channel_set_blksize(fs->journal_io, fs->blocksize);
+
+	if (ext_journal) {
+		blk64_t maxlen;
+
+		start = ext2fs_journal_sb_start(fs->blocksize) - 1;
+		bh = getblk(dev_journal, start, fs->blocksize);
+		if (!bh) {
+			retval = EXT2_ET_NO_MEMORY;
+			goto errout;
+		}
+		ll_rw_block(REQ_OP_READ, 0, 1, &bh);
+		retval = bh->b_err;
+		if (retval) {
+			brelse(bh);
+			goto errout;
+		}
+		memcpy(&jsuper, start ? bh->b_data :
+				bh->b_data + SUPERBLOCK_OFFSET,
+		       sizeof(jsuper));
+#ifdef WORDS_BIGENDIAN
+		if (jsuper.s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC))
+			ext2fs_swap_super(&jsuper);
+#endif
+		if (jsuper.s_magic != EXT2_SUPER_MAGIC ||
+		    !ext2fs_has_feature_journal_dev(&jsuper)) {
+			retval = EXT2_ET_LOAD_EXT_JOURNAL;
+			brelse(bh);
+			goto errout;
+		}
+		/* Make sure the journal UUID is correct */
+		if (memcmp(jsuper.s_uuid, fs->super->s_journal_uuid,
+			   sizeof(jsuper.s_uuid))) {
+			retval = EXT2_ET_LOAD_EXT_JOURNAL;
+			brelse(bh);
+			goto errout;
+		}
+
+		/* Check the superblock checksum */
+		if (ext2fs_has_feature_metadata_csum(&jsuper)) {
+			struct struct_ext2_filsys fsx;
+			struct ext2_super_block	superx;
+			void *p;
+
+			p = start ? bh->b_data : bh->b_data + SUPERBLOCK_OFFSET;
+			memcpy(&fsx, fs, sizeof(fsx));
+			memcpy(&superx, fs->super, sizeof(superx));
+			fsx.super = &superx;
+			ext2fs_set_feature_metadata_csum(fsx.super);
+			if (!ext2fs_superblock_csum_verify(&fsx, p)) {
+				retval = EXT2_ET_LOAD_EXT_JOURNAL;
+				brelse(bh);
+				goto errout;
+			}
+		}
+		brelse(bh);
+
+		maxlen = ext2fs_blocks_count(&jsuper);
+		journal->j_total_len = (maxlen < 1ULL << 32) ? maxlen :
+				    (1ULL << 32) - 1;
+		start++;
+	}
+
+	bh = getblk(dev_journal, start, journal->j_blocksize);
+	if (!bh) {
+		retval = EXT2_ET_NO_MEMORY;
+		goto errout;
+	}
+
+	journal->j_sb_buffer = bh;
+	journal->j_superblock = (journal_superblock_t *)bh->b_data;
+
+#ifdef USE_INODE_IO
+	if (j_inode)
+		ext2fs_free_mem(&j_inode);
+#endif
+
+	*ret_journal = journal;
+	return 0;
+
+errout:
+	if (dev_fs)
+		ext2fs_free_mem(&dev_fs);
+	if (j_inode)
+		ext2fs_free_mem(&j_inode);
+	if (journal)
+		ext2fs_free_mem(&journal);
+	return retval;
+}
+
+static errcode_t ext2fs_journal_fix_bad_inode(ext2_filsys fs)
+{
+	struct ext2_super_block *sb = fs->super;
+	int recover = ext2fs_has_feature_journal_needs_recovery(fs->super);
+	int has_journal = ext2fs_has_feature_journal(fs->super);
+
+	if (has_journal || sb->s_journal_inum) {
+		/* The journal inode is bogus, remove and force full fsck */
+		return EXT2_ET_BAD_INODE_NUM;
+	} else if (recover) {
+		return EXT2_ET_UNSUPP_FEATURE;
+	}
+	return 0;
+}
+
+#define V1_SB_SIZE	0x0024
+static void clear_v2_journal_fields(journal_t *journal)
+{
+	ext2_filsys fs = journal->j_dev->k_fs;
+
+	memset(((char *) journal->j_superblock) + V1_SB_SIZE, 0,
+	       fs->blocksize-V1_SB_SIZE);
+	mark_buffer_dirty(journal->j_sb_buffer);
+}
+
+
+static errcode_t ext2fs_journal_load(journal_t *journal)
+{
+	ext2_filsys fs = journal->j_dev->k_fs;
+	journal_superblock_t *jsb;
+	struct buffer_head *jbh = journal->j_sb_buffer;
+
+	ll_rw_block(REQ_OP_READ, 0, 1, &jbh);
+	if (jbh->b_err)
+		return jbh->b_err;
+
+	jsb = journal->j_superblock;
+	/* If we don't even have JBD2_MAGIC, we probably have a wrong inode */
+	if (jsb->s_header.h_magic != htonl(JBD2_MAGIC_NUMBER))
+		return ext2fs_journal_fix_bad_inode(fs);
+
+	switch (ntohl(jsb->s_header.h_blocktype)) {
+	case JBD2_SUPERBLOCK_V1:
+		journal->j_format_version = 1;
+		if (jsb->s_feature_compat ||
+		    jsb->s_feature_incompat ||
+		    jsb->s_feature_ro_compat ||
+		    jsb->s_nr_users)
+			clear_v2_journal_fields(journal);
+		break;
+
+	case JBD2_SUPERBLOCK_V2:
+		journal->j_format_version = 2;
+		if (ntohl(jsb->s_nr_users) > 1 &&
+		    uuid_is_null(fs->super->s_journal_uuid))
+			clear_v2_journal_fields(journal);
+		if (ntohl(jsb->s_nr_users) > 1)
+			return EXT2_ET_JOURNAL_UNSUPP_VERSION;
+		break;
+
+	/*
+	 * These should never appear in a journal super block, so if
+	 * they do, the journal is badly corrupted.
+	 */
+	case JBD2_DESCRIPTOR_BLOCK:
+	case JBD2_COMMIT_BLOCK:
+	case JBD2_REVOKE_BLOCK:
+		return EXT2_ET_CORRUPT_JOURNAL_SB;
+
+	/* If we don't understand the superblock major type, but there
+	 * is a magic number, then it is likely to be a new format we
+	 * just don't understand, so leave it alone. */
+	default:
+		return EXT2_ET_JOURNAL_UNSUPP_VERSION;
+	}
+
+	if (JBD2_HAS_INCOMPAT_FEATURE(journal, ~JBD2_KNOWN_INCOMPAT_FEATURES))
+		return EXT2_ET_UNSUPP_FEATURE;
+
+	if (JBD2_HAS_RO_COMPAT_FEATURE(journal, ~JBD2_KNOWN_ROCOMPAT_FEATURES))
+		return EXT2_ET_RO_UNSUPP_FEATURE;
+
+	/* Checksum v1-3 are mutually exclusive features. */
+	if (jbd2_has_feature_csum2(journal) && jbd2_has_feature_csum3(journal))
+		return EXT2_ET_CORRUPT_JOURNAL_SB;
+
+	if (jbd2_journal_has_csum_v2or3(journal) &&
+	    jbd2_has_feature_checksum(journal))
+		return EXT2_ET_CORRUPT_JOURNAL_SB;
+
+	if (!ext2fs_journal_verify_csum_type(journal, jsb) ||
+	    !ext2fs_journal_sb_csum_verify(journal, jsb))
+		return EXT2_ET_CORRUPT_JOURNAL_SB;
+
+	if (jbd2_journal_has_csum_v2or3(journal))
+		journal->j_csum_seed = jbd2_chksum(journal, ~0, jsb->s_uuid,
+						   sizeof(jsb->s_uuid));
+
+	/* We have now checked whether we know enough about the journal
+	 * format to be able to proceed safely, so any other checks that
+	 * fail we should attempt to recover from. */
+	if (jsb->s_blocksize != htonl(journal->j_blocksize))
+		return EXT2_ET_CORRUPT_JOURNAL_SB;
+
+	if (ntohl(jsb->s_maxlen) < journal->j_total_len)
+		journal->j_total_len = ntohl(jsb->s_maxlen);
+	else if (ntohl(jsb->s_maxlen) > journal->j_total_len)
+		return EXT2_ET_CORRUPT_JOURNAL_SB;
+
+	journal->j_tail_sequence = ntohl(jsb->s_sequence);
+	journal->j_transaction_sequence = journal->j_tail_sequence;
+	journal->j_tail = ntohl(jsb->s_start);
+	journal->j_first = ntohl(jsb->s_first);
+	journal->j_last = ntohl(jsb->s_maxlen);
+
+	return 0;
+}
+
+static void ext2fs_journal_release(ext2_filsys fs, journal_t *journal,
+				   int reset, int drop)
+{
+	journal_superblock_t *jsb;
+
+	if (drop)
+		mark_buffer_clean(journal->j_sb_buffer);
+	else if (fs->flags & EXT2_FLAG_RW) {
+		jsb = journal->j_superblock;
+		jsb->s_sequence = htonl(journal->j_tail_sequence);
+		if (reset)
+			jsb->s_start = 0; /* this marks the journal as empty */
+		ext2fs_journal_sb_csum_set(journal, jsb);
+		mark_buffer_dirty(journal->j_sb_buffer);
+	}
+	brelse(journal->j_sb_buffer);
+
+	if (fs && fs->journal_io) {
+		if (fs->io != fs->journal_io)
+			io_channel_close(fs->journal_io);
+		fs->journal_io = NULL;
+		free(fs->journal_name);
+		fs->journal_name = NULL;
+	}
+
+#ifndef USE_INODE_IO
+	if (journal->j_inode)
+		ext2fs_free_mem(&journal->j_inode);
+#endif
+	if (journal->j_fs_dev)
+		ext2fs_free_mem(&journal->j_fs_dev);
+	ext2fs_free_mem(&journal);
+}
+
+/*
+ * This function makes sure that the superblock fields regarding the
+ * journal are consistent.
+ */
+static errcode_t ext2fs_check_ext3_journal(ext2_filsys fs)
+{
+	struct ext2_super_block *sb = fs->super;
+	journal_t *journal;
+	int recover = ext2fs_has_feature_journal_needs_recovery(fs->super);
+	errcode_t retval;
+
+	/* If we don't have any journal features, don't do anything more */
+	if (!ext2fs_has_feature_journal(sb) &&
+	    !recover && sb->s_journal_inum == 0 && sb->s_journal_dev == 0 &&
+	    uuid_is_null(sb->s_journal_uuid))
+		return 0;
+
+	retval = ext2fs_get_journal(fs, &journal);
+	if (retval)
+		return retval;
+
+	retval = ext2fs_journal_load(journal);
+	if (retval)
+		goto err;
+
+	/*
+	 * We want to make the flags consistent here.  We will not leave with
+	 * needs_recovery set but has_journal clear.  We can't get in a loop
+	 * with -y, -n, or -p, only if a user isn't making up their mind.
+	 */
+	if (!ext2fs_has_feature_journal(sb)) {
+		retval = EXT2_ET_JOURNAL_FLAGS_WRONG;
+		goto err;
+	}
+
+	if (ext2fs_has_feature_journal(sb) &&
+	    !ext2fs_has_feature_journal_needs_recovery(sb) &&
+	    journal->j_superblock->s_start != 0) {
+		retval = EXT2_ET_JOURNAL_FLAGS_WRONG;
+		goto err;
+	}
+
+	/*
+	 * If we don't need to do replay the journal, check to see if
+	 * the journal's errno is set; if so, we need to mark the file
+	 * system as being corrupt and clear the journal's s_errno.
+	 */
+	if (!ext2fs_has_feature_journal_needs_recovery(sb) &&
+	    journal->j_superblock->s_errno) {
+		fs->super->s_state |= EXT2_ERROR_FS;
+		ext2fs_mark_super_dirty(fs);
+		journal->j_superblock->s_errno = 0;
+		ext2fs_journal_sb_csum_set(journal, journal->j_superblock);
+		mark_buffer_dirty(journal->j_sb_buffer);
+	}
+
+err:
+	ext2fs_journal_release(fs, journal, 0, retval ? 1 : 0);
+	return retval;
+}
+
+static errcode_t recover_ext3_journal(ext2_filsys fs)
+{
+	journal_t *journal;
+	errcode_t retval;
+
+	retval = jbd2_journal_init_revoke_record_cache();
+	if (retval)
+		return retval;
+
+	retval = jbd2_journal_init_revoke_table_cache();
+	if (retval)
+		return retval;
+
+	retval = ext2fs_get_journal(fs, &journal);
+	if (retval)
+		return retval;
+
+	retval = ext2fs_journal_load(journal);
+	if (retval)
+		goto errout;
+
+	retval = jbd2_journal_init_revoke(journal, 1024);
+	if (retval)
+		goto errout;
+
+	retval = -jbd2_journal_recover(journal);
+	if (retval)
+		goto errout;
+
+	if (journal->j_failed_commit) {
+		journal->j_superblock->s_errno = -EINVAL;
+		mark_buffer_dirty(journal->j_sb_buffer);
+	}
+
+errout:
+	jbd2_journal_destroy_revoke(journal);
+	jbd2_journal_destroy_revoke_record_cache();
+	jbd2_journal_destroy_revoke_table_cache();
+	ext2fs_journal_release(fs, journal, 1, 0);
+	return retval;
+}
+
+errcode_t ext2fs_run_ext3_journal(ext2_filsys *fsp)
+{
+	ext2_filsys fs = *fsp;
+	io_manager io_ptr = fs->io->manager;
+	errcode_t	retval, recover_retval;
+	io_stats	stats = 0;
+	unsigned long long kbytes_written = 0;
+	char *fsname;
+	int fsflags;
+	int fsblocksize;
+
+	if (!(fs->flags & EXT2_FLAG_RW))
+		return EXT2_ET_FILE_RO;
+
+	if (fs->flags & EXT2_FLAG_DIRTY)
+		ext2fs_flush(fs);	/* Force out any modifications */
+
+	recover_retval = recover_ext3_journal(fs);
+
+	/*
+	 * Reload the filesystem context to get up-to-date data from disk
+	 * because journal recovery will change the filesystem under us.
+	 */
+	if (fs->super->s_kbytes_written &&
+	    fs->io->manager->get_stats)
+		fs->io->manager->get_stats(fs->io, &stats);
+	if (stats && stats->bytes_written)
+		kbytes_written = stats->bytes_written >> 10;
+
+	ext2fs_mmp_stop(fs);
+	fsname = fs->device_name;
+	fs->device_name = NULL;
+	fsflags = fs->flags;
+	fsblocksize = fs->blocksize;
+	ext2fs_free(fs);
+	*fsp = NULL;
+	retval = ext2fs_open(fsname, fsflags, 0, fsblocksize, io_ptr, fsp);
+	ext2fs_free_mem(&fsname);
+	if (retval)
+		return retval;
+
+	fs = *fsp;
+	fs->flags |= EXT2_FLAG_MASTER_SB_ONLY;
+	fs->super->s_kbytes_written += kbytes_written;
+
+	/* Set the superblock flags */
+	ext2fs_clear_recover(fs, recover_retval != 0);
+
+	/*
+	 * Do one last sanity check, and propagate journal->s_errno to
+	 * the EXT2_ERROR_FS flag in the fs superblock if needed.
+	 */
+	retval = ext2fs_check_ext3_journal(fs);
+	return retval ? retval : recover_retval;
+}
+
+errcode_t ext2fs_open_journal(ext2_filsys fs, journal_t **j)
+{
+	journal_t *journal;
+	errcode_t retval;
+
+	retval = jbd2_journal_init_revoke_record_cache();
+	if (retval)
+		return retval;
+
+	retval = jbd2_journal_init_revoke_table_cache();
+	if (retval)
+		return retval;
+
+	retval = ext2fs_get_journal(fs, &journal);
+	if (retval)
+		return retval;
+
+	retval = ext2fs_journal_load(journal);
+	if (retval)
+		goto errout;
+
+	retval = jbd2_journal_init_revoke(journal, 1024);
+	if (retval)
+		goto errout;
+
+	if (journal->j_failed_commit) {
+		journal->j_superblock->s_errno = -EINVAL;
+		mark_buffer_dirty(journal->j_sb_buffer);
+	}
+
+	*j = journal;
+	return 0;
+
+errout:
+	jbd2_journal_destroy_revoke(journal);
+	jbd2_journal_destroy_revoke_record_cache();
+	jbd2_journal_destroy_revoke_table_cache();
+	ext2fs_journal_release(fs, journal, 1, 0);
+	return retval;
+}
+
+errcode_t ext2fs_close_journal(ext2_filsys fs, journal_t **j)
+{
+	journal_t *journal = *j;
+
+	jbd2_journal_destroy_revoke(journal);
+	jbd2_journal_destroy_revoke_record_cache();
+	jbd2_journal_destroy_revoke_table_cache();
+	ext2fs_journal_release(fs, journal, 0, 0);
+	*j = NULL;
+
+	return 0;
+}
+
+void jbd2_commit_block_csum_set(journal_t *j, struct buffer_head *bh)
+{
+	struct commit_header *h;
+	__u32 csum;
+
+	if (!jbd2_journal_has_csum_v2or3(j))
+		return;
+
+	h = (struct commit_header *)(bh->b_data);
+	h->h_chksum_type = 0;
+	h->h_chksum_size = 0;
+	h->h_chksum[0] = 0;
+	csum = jbd2_chksum(j, j->j_csum_seed, bh->b_data, j->j_blocksize);
+	h->h_chksum[0] = ext2fs_cpu_to_be32(csum);
+}
+
+void jbd2_revoke_csum_set(journal_t *j, struct buffer_head *bh)
+{
+	jbd2_descr_block_csum_set(j, bh);
+}
+
+void jbd2_descr_block_csum_set(journal_t *j, struct buffer_head *bh)
+{
+	struct jbd2_journal_block_tail *tail;
+	__u32 csum;
+
+	if (!jbd2_journal_has_csum_v2or3(j))
+		return;
+
+	tail = (struct jbd2_journal_block_tail *)(bh->b_data + j->j_blocksize -
+			sizeof(struct jbd2_journal_block_tail));
+	tail->t_checksum = 0;
+	csum = jbd2_chksum(j, j->j_csum_seed, bh->b_data, j->j_blocksize);
+	tail->t_checksum = ext2fs_cpu_to_be32(csum);
+}
+
+void jbd2_block_tag_csum_set(journal_t *j, journal_block_tag_t *tag,
+			     struct buffer_head *bh, __u32 sequence)
+{
+	journal_block_tag3_t *tag3 = (journal_block_tag3_t *)tag;
+	__u32 csum32;
+	__be32 seq;
+
+	if (!jbd2_journal_has_csum_v2or3(j))
+		return;
+
+	seq = ext2fs_cpu_to_be32(sequence);
+	csum32 = jbd2_chksum(j, j->j_csum_seed, (__u8 *)&seq, sizeof(seq));
+	csum32 = jbd2_chksum(j, csum32, bh->b_data, bh->b_size);
+
+	if (jbd2_has_feature_csum3(j))
+		tag3->t_checksum = ext2fs_cpu_to_be32(csum32);
+	else
+		tag->t_checksum = ext2fs_cpu_to_be16(csum32);
+}
+
diff --git a/debugfs/journal.h b/debugfs/journal.h
new file mode 100644
index 0000000..10b638e
--- /dev/null
+++ b/debugfs/journal.h
@@ -0,0 +1,25 @@
+/*
+ * journal.h
+ *
+ * Copyright (C) 2000 Andreas Dilger
+ * Copyright (C) 2000 Theodore Ts'o
+ *
+ * Parts of the code are based on fs/jfs/journal.c by Stephen C. Tweedie
+ * Copyright (C) 1999 Red Hat Software
+ *
+ * This file may be redistributed under the terms of the
+ * GNU General Public License version 2 or at your discretion
+ * any later version.
+ */
+
+#include "jfs_user.h"
+
+/* journal.c */
+errcode_t ext2fs_open_journal(ext2_filsys fs, journal_t **j);
+errcode_t ext2fs_close_journal(ext2_filsys fs, journal_t **j);
+errcode_t ext2fs_run_ext3_journal(ext2_filsys *fs);
+void jbd2_commit_block_csum_set(journal_t *j, struct buffer_head *bh);
+void jbd2_revoke_csum_set(journal_t *j, struct buffer_head *bh);
+void jbd2_descr_block_csum_set(journal_t *j, struct buffer_head *bh);
+void jbd2_block_tag_csum_set(journal_t *j, journal_block_tag_t *tag,
+			     struct buffer_head *bh, __u32 sequence);
diff --git a/debugfs/logdump.c b/debugfs/logdump.c
index f257171..27e2e72 100644
--- a/debugfs/logdump.c
+++ b/debugfs/logdump.c
@@ -1,7 +1,7 @@
 /*
  * logdump.c --- dump the contents of the journal out to a file
  *
- * Authro: Stephen C. Tweedie, 2001  <sct@redhat.com>
+ * Author: Stephen C. Tweedie, 2001  <sct@redhat.com>
  * Copyright (C) 2001 Red Hat, Inc.
  * Based on portions  Copyright (C) 1994 Theodore Ts'o.
  *
@@ -9,6 +9,7 @@
  * License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -32,13 +33,14 @@
 #include "debugfs.h"
 #include "blkid/blkid.h"
 #include "jfs_user.h"
+#include "ext2fs/fast_commit.h"
 #include <uuid/uuid.h>
 
 enum journal_location {JOURNAL_IS_INTERNAL, JOURNAL_IS_EXTERNAL};
 
 #define ANY_BLOCK ((blk64_t) -1)
 
-static int		dump_all, dump_contents, dump_descriptors;
+static int		dump_all, dump_super, dump_old, dump_contents, dump_descriptors;
 static blk64_t		block_to_dump, bitmap_to_dump, inode_block_to_dump;
 static unsigned int	group_to_dump, inode_offset_to_dump;
 static ext2_ino_t	inode_to_dump;
@@ -54,7 +56,7 @@
 
 static void dump_descriptor_block(FILE *, struct journal_source *,
 				  char *, journal_superblock_t *,
-				  unsigned int *, int, tid_t);
+				  unsigned int *, int, __u32, tid_t);
 
 static void dump_revoke_block(FILE *, char *, journal_superblock_t *,
 				  unsigned int, int, tid_t);
@@ -64,14 +66,17 @@
 				unsigned int, unsigned int, unsigned int,
 				int, tid_t);
 
+static void dump_fc_block(FILE *out_file, char *buf, int blocksize,
+			  int transaction, int *fc_done, int dump_old);
+
 static void do_hexdump (FILE *, char *, int);
 
-#define WRAP(jsb, blocknr)					\
-	if (blocknr >= be32_to_cpu((jsb)->s_maxlen))		\
-		blocknr -= (be32_to_cpu((jsb)->s_maxlen) -	\
-			    be32_to_cpu((jsb)->s_first));
+#define WRAP(jsb, blocknr, maxlen)					\
+	if (blocknr >= (maxlen))					\
+	    blocknr -= (maxlen - be32_to_cpu((jsb)->s_first));
 
-void do_logdump(int argc, char **argv)
+void do_logdump(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		    void *infop EXT2FS_ATTR((unused)))
 {
 	int		c;
 	int		retval;
@@ -80,11 +85,11 @@
 
 	char		*inode_spec = NULL;
 	char		*journal_fn = NULL;
-	int		journal_fd = 0;
+	int		journal_fd = -1;
 	int		use_sb = 0;
 	ext2_ino_t	journal_inum;
 	struct ext2_inode journal_inode;
-	ext2_file_t 	journal_file;
+	ext2_file_t 	journal_file = NULL;
 	char		*tmp;
 	struct journal_source journal_source;
 	struct ext2_super_block *es = NULL;
@@ -93,7 +98,9 @@
 	journal_source.fd = 0;
 	journal_source.file = 0;
 	dump_all = 0;
+	dump_old = 0;
 	dump_contents = 0;
+	dump_super = 0;
 	dump_descriptors = 1;
 	block_to_dump = ANY_BLOCK;
 	bitmap_to_dump = -1;
@@ -101,7 +108,7 @@
 	inode_to_dump = -1;
 
 	reset_getopt();
-	while ((c = getopt (argc, argv, "ab:ci:f:s")) != EOF) {
+	while ((c = getopt (argc, argv, "ab:ci:f:OsS")) != EOF) {
 		switch (c) {
 		case 'a':
 			dump_all++;
@@ -125,9 +132,15 @@
 			inode_spec = optarg;
 			dump_descriptors = 0;
 			break;
+		case 'O':
+			dump_old++;
+			break;
 		case 's':
 			use_sb++;
 			break;
+		case 'S':
+			dump_super++;
+			break;
 		default:
 			goto print_usage;
 		}
@@ -136,9 +149,6 @@
 		goto print_usage;
 	}
 
-	if (current_fs)
-		es = current_fs->super;
-
 	if (inode_spec) {
 		int inode_group, group_offset, inodes_per_block;
 
@@ -149,6 +159,7 @@
 		if (!inode_to_dump)
 			return;
 
+		es = current_fs->super;
 		inode_group = ((inode_to_dump - 1)
 			       / es->s_inodes_per_group);
 		group_offset = ((inode_to_dump - 1)
@@ -163,7 +174,8 @@
 					* sizeof(struct ext2_inode));
 		printf("Inode %u is at group %u, block %llu, offset %u\n",
 		       inode_to_dump, inode_group,
-		       inode_block_to_dump, inode_offset_to_dump);
+		       (unsigned long long) inode_block_to_dump,
+		       inode_offset_to_dump);
 	}
 
 	if (optind == argc) {
@@ -174,37 +186,44 @@
 		if (!out_file) {
 			com_err(argv[0], errno, "while opening %s for logdump",
 				out_fn);
-			goto errout;
+			goto cleanup;
 		}
 	}
 
-	if (block_to_dump != ANY_BLOCK && current_fs != NULL) {
+	if (block_to_dump != ANY_BLOCK) {
+		if (check_fs_open(argv[0]))
+			goto cleanup;
+		es = current_fs->super;
 		group_to_dump = ((block_to_dump -
 				  es->s_first_data_block)
 				 / es->s_blocks_per_group);
 		bitmap_to_dump = ext2fs_block_bitmap_loc(current_fs, group_to_dump);
 	}
 
-	if (!journal_fn && check_fs_open(argv[0]))
-		goto errout;
-
 	if (journal_fn) {
 		/* Set up to read journal from a regular file somewhere */
 		journal_fd = open(journal_fn, O_RDONLY, 0);
 		if (journal_fd < 0) {
 			com_err(argv[0], errno, "while opening %s for logdump",
 				journal_fn);
-			goto errout;
+			goto cleanup;
 		}
-
 		journal_source.where = JOURNAL_IS_EXTERNAL;
 		journal_source.fd = journal_fd;
-	} else if ((journal_inum = es->s_journal_inum)) {
+		dump_journal(argv[0], out_file, &journal_source);
+		goto cleanup;
+
+	}
+	if (check_fs_open(argv[0]))
+		goto cleanup;
+	es = current_fs->super;
+
+	if ((journal_inum = es->s_journal_inum)) {
 		if (use_sb) {
 			if (es->s_jnl_backup_type != EXT3_JNL_BACKUP_BLOCKS) {
 				com_err(argv[0], 0,
 					"no journal backup in super block\n");
-				goto errout;
+				goto cleanup;
 			}
 			memset(&journal_inode, 0, sizeof(struct ext2_inode));
 			memcpy(&journal_inode.i_block[0], es->s_jnl_blocks,
@@ -216,14 +235,14 @@
 		} else {
 			if (debugfs_read_inode(journal_inum, &journal_inode,
 					       argv[0]))
-				goto errout;
+				goto cleanup;
 		}
 
 		retval = ext2fs_file_open2(current_fs, journal_inum,
 					   &journal_inode, 0, &journal_file);
 		if (retval) {
 			com_err(argv[0], retval, "while opening ext2 file");
-			goto errout;
+			goto cleanup;
 		}
 		journal_source.where = JOURNAL_IS_INTERNAL;
 		journal_source.file = journal_file;
@@ -236,14 +255,14 @@
 				journal_fn = blkid_devno_to_devname(es->s_journal_dev);
 		if (!journal_fn) {
 			com_err(argv[0], 0, "filesystem has no journal");
-			goto errout;
+			goto cleanup;
 		}
 		journal_fd = open(journal_fn, O_RDONLY, 0);
 		if (journal_fd < 0) {
 			com_err(argv[0], errno, "while opening %s for logdump",
 				journal_fn);
 			free(journal_fn);
-			goto errout;
+			goto cleanup;
 		}
 		fprintf(out_file, "Using external journal found at %s\n",
 			journal_fn);
@@ -251,78 +270,76 @@
 		journal_source.where = JOURNAL_IS_EXTERNAL;
 		journal_source.fd = journal_fd;
 	}
-
 	dump_journal(argv[0], out_file, &journal_source);
-
-	if (journal_source.where == JOURNAL_IS_INTERNAL)
-		ext2fs_file_close(journal_file);
-	else
+cleanup:
+	if (journal_fd >= 0)
 		close(journal_fd);
-
-errout:
+	if (journal_file)
+		ext2fs_file_close(journal_file);
 	if (out_file && (out_file != stdout))
 		fclose(out_file);
 
 	return;
 
 print_usage:
-	fprintf(stderr, "%s: Usage: logdump [-acs] [-b<block>] [-i<filespec>]\n\t"
+	fprintf(stderr, "%s: Usage: logdump [-acsOS] [-b<block>] [-i<filespec>]\n\t"
 		"[-f<journal_file>] [output_file]\n", argv[0]);
 }
 
 
 static int read_journal_block(const char *cmd, struct journal_source *source,
-			      off_t offset, char *buf, int size,
-			      unsigned int *got)
+			      ext2_loff_t offset, char *buf, unsigned int size)
 {
 	int retval;
+	unsigned int got;
 
 	if (source->where == JOURNAL_IS_EXTERNAL) {
 		if (lseek(source->fd, offset, SEEK_SET) < 0) {
 			retval = errno;
-			com_err(cmd, retval, "while seeking in reading journal");
-			return retval;
+			goto seek_err;
 		}
 		retval = read(source->fd, buf, size);
-		if (retval >= 0) {
-			*got = retval;
-			retval = 0;
-		} else
+		if (retval < 0) {
 			retval = errno;
+			goto read_err;
+		}
+		got = retval;
+		retval = 0;
 	} else {
-		retval = ext2fs_file_lseek(source->file, offset,
-					   EXT2_SEEK_SET, NULL);
+		retval = ext2fs_file_llseek(source->file, offset,
+					    EXT2_SEEK_SET, NULL);
 		if (retval) {
+		seek_err:
 			com_err(cmd, retval, "while seeking in reading journal");
 			return retval;
 		}
-
-		retval = ext2fs_file_read(source->file, buf, size, got);
+		retval = ext2fs_file_read(source->file, buf, size, &got);
+		if (retval) {
+		read_err:
+			com_err(cmd, retval, "while reading journal");
+			return retval;
+		}
 	}
-
-	if (retval)
-		com_err(cmd, retval, "while reading journal");
-	else if (*got != (unsigned int) size) {
-		com_err(cmd, 0, "short read (read %d, expected %d) "
-			"while reading journal", *got, size);
+	if (got != size) {
+		com_err(cmd, 0, "short read (read %u, expected %u) "
+			"while reading journal", got, size);
 		retval = -1;
 	}
-
 	return retval;
 }
 
 static const char *type_to_name(int btype)
 {
 	switch (btype) {
-	case JFS_DESCRIPTOR_BLOCK:
+	case JBD2_DESCRIPTOR_BLOCK:
 		return "descriptor block";
-	case JFS_COMMIT_BLOCK:
+	case JBD2_COMMIT_BLOCK:
 		return "commit block";
-	case JFS_SUPERBLOCK_V1:
+	case JBD2_SUPERBLOCK_V1:
 		return "V1 superblock";
-	case JFS_SUPERBLOCK_V2:
+	case JBD2_SUPERBLOCK_V2:
 		return "V2 superblock";
-	case JFS_REVOKE_BLOCK:
+	case JBD2_REVOKE_BLOCK:
 		return "revoke table";
 	}
 	return "unrecognised type";
@@ -334,20 +351,20 @@
 {
 	struct ext2_super_block *sb;
 	char			jsb_buffer[1024];
-	char			buf[8192];
+	char			buf[EXT2_MAX_BLOCK_SIZE];
 	journal_superblock_t	*jsb;
 	unsigned int		blocksize = 1024;
-	unsigned int		got;
 	int			retval;
 	__u32			magic, sequence, blocktype;
 	journal_header_t	*header;
-
 	tid_t			transaction;
 	unsigned int		blocknr = 0;
+	int			fc_done;
+	__u64			total_len;
+	__u32			maxlen;
 
 	/* First, check to see if there's an ext2 superblock header */
-	retval = read_journal_block(cmdname, source, 0,
-				    buf, 2048, &got);
+	retval = read_journal_block(cmdname, source, 0, buf, 2048);
 	if (retval)
 		return;
 
@@ -358,9 +375,9 @@
 		ext2fs_swap_super(sb);
 #endif
 
-	if ((be32_to_cpu(jsb->s_header.h_magic) != JFS_MAGIC_NUMBER) &&
+	if ((be32_to_cpu(jsb->s_header.h_magic) != JBD2_MAGIC_NUMBER) &&
 	    (sb->s_magic == EXT2_SUPER_MAGIC) &&
-	    (sb->s_feature_incompat & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)) {
+	    ext2fs_has_feature_journal_dev(sb)) {
 		blocksize = EXT2_BLOCK_SIZE(sb);
 		blocknr = (blocksize == 1024) ? 2 : 1;
 		uuid_unparse(sb->s_uuid, jsb_buffer);
@@ -374,35 +391,72 @@
 	}
 
 	/* Next, read the journal superblock */
-
-	retval = read_journal_block(cmdname, source, blocknr*blocksize,
-				    jsb_buffer, 1024, &got);
+	retval = read_journal_block(cmdname, source,
+				    ((ext2_loff_t) blocknr) * blocksize,
+				    jsb_buffer, 1024);
 	if (retval)
 		return;
 
+	if (dump_super) {
+		e2p_list_journal_super(out_file, jsb_buffer,
+				       current_fs->blocksize, 0);
+		fputc('\n', out_file);
+	}
+
 	jsb = (journal_superblock_t *) jsb_buffer;
-	if (be32_to_cpu(jsb->s_header.h_magic) != JFS_MAGIC_NUMBER) {
+	if (be32_to_cpu(jsb->s_header.h_magic) != JBD2_MAGIC_NUMBER) {
 		fprintf(out_file,
 			"Journal superblock magic number invalid!\n");
 		return;
 	}
 	blocksize = be32_to_cpu(jsb->s_blocksize);
+	if ((current_fs && (blocksize != current_fs->blocksize)) ||
+	    (!current_fs && (!blocksize || (blocksize & (blocksize - 1)) ||
+			     (blocksize > EXT2_MAX_BLOCK_SIZE)))) {
+		fprintf(out_file,
+			"Journal block size invalid: %u (%u)\n",
+			be32_to_cpu(jsb->s_blocksize), blocksize);
+		return;
+	}
 	transaction = be32_to_cpu(jsb->s_sequence);
 	blocknr = be32_to_cpu(jsb->s_start);
+	if (source->where == JOURNAL_IS_INTERNAL) {
+		retval = ext2fs_file_get_lsize(source->file, &total_len);
+		if (retval) {
+		stat_err:
+			com_err("dump_journal", retval,
+				"while getting journal inode size");
+			return;
+		}
+		total_len /= blocksize;
+	} else {
+			struct stat st;
+
+			if (fstat(source->fd, &st) < 0)
+				goto stat_err;
+			total_len = st.st_size / blocksize;
+	}
+	maxlen = be32_to_cpu(jsb->s_maxlen);
+	if (maxlen > total_len)
+		maxlen = total_len;
 
 	fprintf(out_file, "Journal starts at block %u, transaction %u\n",
 		blocknr, transaction);
 
-	if (!blocknr)
+	if (!blocknr) {
 		/* Empty journal, nothing to do. */
-		return;
+		if (!dump_old)
+			goto fc;
+		else
+			blocknr = 1;
+	}
 
 	while (1) {
 		retval = read_journal_block(cmdname, source,
-					    blocknr*blocksize, buf,
-					    blocksize, &got);
-		if (retval || got != blocksize)
-			return;
+				((ext2_loff_t) blocknr) * blocksize,
+				buf, blocksize);
+		if (retval)
+			break;
 
 		header = (journal_header_t *) buf;
 
@@ -410,17 +464,18 @@
 		sequence = be32_to_cpu(header->h_sequence);
 		blocktype = be32_to_cpu(header->h_blocktype);
 
-		if (magic != JFS_MAGIC_NUMBER) {
+		if (magic != JBD2_MAGIC_NUMBER) {
 			fprintf (out_file, "No magic number at block %u: "
 				 "end of journal.\n", blocknr);
-			return;
+			break;
 		}
 
 		if (sequence != transaction) {
 			fprintf (out_file, "Found sequence %u (not %u) at "
 				 "block %u: end of journal.\n",
 				 sequence, transaction, blocknr);
-			return;
+			if (!dump_old)
+				break;
 		}
 
 		if (dump_descriptors) {
@@ -431,61 +486,188 @@
 		}
 
 		switch (blocktype) {
-		case JFS_DESCRIPTOR_BLOCK:
+		case JBD2_DESCRIPTOR_BLOCK:
 			dump_descriptor_block(out_file, source, buf, jsb,
-					      &blocknr, blocksize,
+					      &blocknr, blocksize, maxlen,
 					      transaction);
 			continue;
 
-		case JFS_COMMIT_BLOCK:
+		case JBD2_COMMIT_BLOCK:
 			transaction++;
 			blocknr++;
-			WRAP(jsb, blocknr);
+			WRAP(jsb, blocknr, maxlen);
 			continue;
 
-		case JFS_REVOKE_BLOCK:
+		case JBD2_REVOKE_BLOCK:
 			dump_revoke_block(out_file, buf, jsb,
 					  blocknr, blocksize,
 					  transaction);
 			blocknr++;
-			WRAP(jsb, blocknr);
+			WRAP(jsb, blocknr, maxlen);
 			continue;
 
 		default:
 			fprintf (out_file, "Unexpected block type %u at "
 				 "block %u.\n", blocktype, blocknr);
-			return;
+			break;
 		}
 	}
+
+fc:
+	blocknr = maxlen - jbd2_journal_get_num_fc_blks(jsb) + 1;
+	while (blocknr <= maxlen) {
+		retval = read_journal_block(cmdname, source,
+				((ext2_loff_t) blocknr) * blocksize,
+				buf, blocksize);
+		if (retval)
+			return;
+
+		dump_fc_block(out_file, buf, blocksize, transaction, &fc_done,
+			dump_old);
+		if (!dump_old && fc_done)
+			break;
+		blocknr++;
+	}
 }
 
+static inline size_t journal_super_tag_bytes(journal_superblock_t *jsb)
+{
+	size_t sz;
+
+	if (JSB_HAS_INCOMPAT_FEATURE(jsb, JBD2_FEATURE_INCOMPAT_CSUM_V3))
+		return sizeof(journal_block_tag3_t);
+
+	sz = sizeof(journal_block_tag_t);
+
+	if (JSB_HAS_INCOMPAT_FEATURE(jsb, JBD2_FEATURE_INCOMPAT_CSUM_V2))
+		sz += sizeof(__u16);
+
+	if (JSB_HAS_INCOMPAT_FEATURE(jsb, JBD2_FEATURE_INCOMPAT_64BIT))
+		return sz;
+
+	return sz - sizeof(__u32);
+}
+
+static void dump_fc_block(FILE *out_file, char *buf, int blocksize,
+	int transaction, int *fc_done, int dump_old)
+{
+	struct ext4_fc_tl	*tl;
+	struct ext4_fc_head	*head;
+	struct ext4_fc_add_range	*add_range;
+	struct ext4_fc_del_range	*del_range;
+	struct ext4_fc_dentry_info	*dentry_info;
+	struct ext4_fc_tail		*tail;
+	struct ext3_extent	*ex;
+
+	*fc_done = 0;
+	fc_for_each_tl(buf, buf + blocksize, tl) {
+		switch (le16_to_cpu(tl->fc_tag)) {
+		case EXT4_FC_TAG_ADD_RANGE:
+			add_range =
+				(struct ext4_fc_add_range *)ext4_fc_tag_val(tl);
+			ex = (struct ext3_extent *)add_range->fc_ex;
+			fprintf(out_file,
+				"tag %s, inode %d, lblk %u, pblk %llu, len %lu\n",
+				tag2str(tl->fc_tag),
+				le32_to_cpu(add_range->fc_ino),
+				le32_to_cpu(ex->ee_block),
+				le32_to_cpu(ex->ee_start) +
+				(((unsigned long long) le16_to_cpu(ex->ee_start_hi)) << 32),
+				le16_to_cpu(ex->ee_len) > EXT_INIT_MAX_LEN ?
+				le16_to_cpu(ex->ee_len) - EXT_INIT_MAX_LEN :
+				le16_to_cpu(ex->ee_len));
+			break;
+		case EXT4_FC_TAG_DEL_RANGE:
+			del_range =
+				(struct ext4_fc_del_range *)ext4_fc_tag_val(tl);
+			fprintf(out_file, "tag %s, inode %d, lblk %d, len %d\n",
+				tag2str(tl->fc_tag),
+				le32_to_cpu(del_range->fc_ino),
+				le32_to_cpu(del_range->fc_lblk),
+				le32_to_cpu(del_range->fc_len));
+			break;
+		case EXT4_FC_TAG_LINK:
+		case EXT4_FC_TAG_UNLINK:
+		case EXT4_FC_TAG_CREAT:
+			dentry_info =
+				(struct ext4_fc_dentry_info *)
+					ext4_fc_tag_val(tl);
+			fprintf(out_file,
+				"tag %s, parent %d, ino %d, name \"%s\"\n",
+				tag2str(tl->fc_tag),
+				le32_to_cpu(dentry_info->fc_parent_ino),
+				le32_to_cpu(dentry_info->fc_ino),
+				dentry_info->fc_dname);
+			break;
+		case EXT4_FC_TAG_INODE:
+			fprintf(out_file, "tag %s, inode %d\n",
+				tag2str(tl->fc_tag),
+				le32_to_cpu(((struct ext4_fc_inode *)
+					ext4_fc_tag_val(tl))->fc_ino));
+			break;
+		case EXT4_FC_TAG_PAD:
+			fprintf(out_file, "tag %s\n", tag2str(tl->fc_tag));
+			break;
+		case EXT4_FC_TAG_TAIL:
+			tail = (struct ext4_fc_tail *)ext4_fc_tag_val(tl);
+			fprintf(out_file, "tag %s, tid %d\n",
+				tag2str(tl->fc_tag),
+				le32_to_cpu(tail->fc_tid));
+			if (!dump_old &&
+				le32_to_cpu(tail->fc_tid) < transaction) {
+				*fc_done = 1;
+				return;
+			}
+			break;
+		case EXT4_FC_TAG_HEAD:
+			fprintf(out_file, "\n*** Fast Commit Area ***\n");
+			head = (struct ext4_fc_head *)ext4_fc_tag_val(tl);
+			fprintf(out_file, "tag %s, features 0x%x, tid %d\n",
+				tag2str(tl->fc_tag),
+				le32_to_cpu(head->fc_features),
+				le32_to_cpu(head->fc_tid));
+			if (!dump_old &&
+				le32_to_cpu(head->fc_tid) < transaction) {
+				*fc_done = 1;
+				return;
+			}
+			break;
+		default:
+			*fc_done = 1;
+			break;
+		}
+	}
+}
 
 static void dump_descriptor_block(FILE *out_file,
 				  struct journal_source *source,
 				  char *buf,
 				  journal_superblock_t *jsb,
 				  unsigned int *blockp, int blocksize,
+				  __u32 maxlen,
 				  tid_t transaction)
 {
-	int			offset, tag_size = JBD_TAG_SIZE32;
+	int			offset, tag_size, csum_size = 0;
 	char			*tagp;
 	journal_block_tag_t	*tag;
 	unsigned int		blocknr;
 	__u32			tag_block;
 	__u32			tag_flags;
 
-	if (be32_to_cpu(jsb->s_feature_incompat) & JFS_FEATURE_INCOMPAT_64BIT)
-		tag_size = JBD_TAG_SIZE64;
-
+	tag_size = journal_super_tag_bytes(jsb);
 	offset = sizeof(journal_header_t);
 	blocknr = *blockp;
 
+	if (JSB_HAS_INCOMPAT_FEATURE(jsb, JBD2_FEATURE_INCOMPAT_CSUM_V3) ||
+	    JSB_HAS_INCOMPAT_FEATURE(jsb, JBD2_FEATURE_INCOMPAT_CSUM_V2))
+		csum_size = sizeof(struct jbd2_journal_block_tail);
+
 	if (dump_all)
 		fprintf(out_file, "Dumping descriptor block, sequence %u, at "
 			"block %u:\n", transaction, blocknr);
 
 	++blocknr;
-	WRAP(jsb, blocknr);
+	WRAP(jsb, blocknr, maxlen);
 
 	do {
 		/* Work out the location of the current tag, and skip to
@@ -496,13 +678,13 @@
 
 		/* ... and if we have gone too far, then we've reached the
 		   end of this block. */
-		if (offset > blocksize)
+		if (offset > blocksize - csum_size)
 			break;
 
 		tag_block = be32_to_cpu(tag->t_blocknr);
-		tag_flags = be32_to_cpu(tag->t_flags);
+		tag_flags = be16_to_cpu(tag->t_flags);
 
-		if (!(tag_flags & JFS_FLAG_SAME_UUID))
+		if (!(tag_flags & JBD2_FLAG_SAME_UUID))
 			offset += 16;
 
 		dump_metadata_block(out_file, source, jsb,
@@ -510,9 +692,9 @@
 				    transaction);
 
 		++blocknr;
-		WRAP(jsb, blocknr);
+		WRAP(jsb, blocknr, maxlen);
 
-	} while (!(tag_flags & JFS_FLAG_LAST_TAG));
+	} while (!(tag_flags & JBD2_FLAG_LAST_TAG));
 
 	*blockp = blocknr;
 }
@@ -525,29 +707,44 @@
 			      tid_t transaction)
 {
 	int			offset, max;
-	journal_revoke_header_t *header;
-	unsigned int		*entry, rblock;
+	jbd2_journal_revoke_header_t *header;
+	unsigned long long	rblock;
+	int			tag_size = sizeof(__u32);
 
 	if (dump_all)
 		fprintf(out_file, "Dumping revoke block, sequence %u, at "
 			"block %u:\n", transaction, blocknr);
 
-	header = (journal_revoke_header_t *) buf;
-	offset = sizeof(journal_revoke_header_t);
+	if (be32_to_cpu(jsb->s_feature_incompat) & JBD2_FEATURE_INCOMPAT_64BIT)
+		tag_size = sizeof(__u64);
+
+	header = (jbd2_journal_revoke_header_t *) buf;
+	offset = sizeof(jbd2_journal_revoke_header_t);
 	max = be32_to_cpu(header->r_count);
+	if (max > jsb->s_blocksize) {
+		fprintf(out_file, "Revoke block's r_count invalid: %u\b",
+			max);
+		max = jsb->s_blocksize;
+	}
 
 	while (offset < max) {
-		entry = (unsigned int *) (buf + offset);
-		rblock = be32_to_cpu(*entry);
+		if (tag_size == sizeof(__u32)) {
+			__u32 *entry = (__u32 *) (buf + offset);
+			rblock = be32_to_cpu(*entry);
+		} else {
+			__u64 *entry = (__u64 *) (buf + offset);
+			rblock = ext2fs_be64_to_cpu(*entry);
+		}
 		if (dump_all || rblock == block_to_dump) {
-			fprintf(out_file, "  Revoke FS block %u", rblock);
+			fprintf(out_file, "  Revoke FS block %llu",
+				(unsigned long long) rblock);
 			if (dump_all)
 				fprintf(out_file, "\n");
 			else
 				fprintf(out_file," at block %u, sequence %u\n",
 					blocknr, transaction);
 		}
-		offset += 4;
+		offset += tag_size;
 	}
 }
 
@@ -575,9 +772,8 @@
 				int blocksize,
 				tid_t transaction)
 {
-	unsigned int 	got;
 	int		retval;
-	char 		buf[8192];
+	char 		buf[EXT2_MAX_BLOCK_SIZE];
 
 	if (!(dump_all
 	      || (fs_blocknr == block_to_dump)
@@ -610,8 +806,8 @@
 		return;
 
 	retval = read_journal_block("logdump", source,
-				    blocksize * log_blocknr,
-				    buf, blocksize, &got);
+				    ((ext2_loff_t) log_blocknr) * blocksize,
+				    buf, blocksize);
 	if (retval)
 		return;
 
@@ -625,7 +821,7 @@
 
 		fprintf(out_file, "    (block bitmap for block %llu: "
 			"block is %s)\n",
-			block_to_dump,
+			(unsigned long long) block_to_dump,
 			ext2fs_test_bit(offset, buf) ? "SET" : "CLEAR");
 	}
 
diff --git a/debugfs/ls.c b/debugfs/ls.c
index f21e96e..525f084 100644
--- a/debugfs/ls.c
+++ b/debugfs/ls.c
@@ -5,6 +5,7 @@
  * under the terms of the GNU Public License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -29,18 +30,48 @@
  */
 
 #define LONG_OPT	0x0001
-#define DELETED_OPT	0x0002
-#define PARSE_OPT	0x0004
+#define PARSE_OPT	0x0002
+#define RAW_OPT		0x0004
+#define ENCRYPT_OPT	0x8000
 
 struct list_dir_struct {
 	FILE	*f;
 	int	col;
 	int	options;
+	int	state;
 };
 
 static const char *monstr[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
 				"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
 
+static int print_filename(FILE *f, struct ext2_dir_entry *dirent, int options)
+{
+	unsigned char	ch;
+	const char *cp = dirent->name;
+	int len = ext2fs_dirent_name_len(dirent);
+	int retlen = 0;
+
+	if ((options & ENCRYPT_OPT) && !(options & RAW_OPT)) {
+		if (f)
+			return fprintf(f, "<encrypted (%d)>", len);
+		else
+			return snprintf(NULL, 0, "<encrypted (%d)>", len);
+	}
+	while (len--) {
+		ch = *cp++;
+		if (ch < 32 || ch >= 127 || ch == '\\') {
+			if (f)
+				fprintf(f, "\\x%02x", ch);
+			retlen += 4;
+		} else {
+			if (f)
+				fputc(ch, f);
+			retlen++;
+		}
+	}
+	return retlen;
+}
+
 static int list_dir_proc(ext2_ino_t dir EXT2FS_ATTR((unused)),
 			 int	entry,
 			 struct ext2_dir_entry *dirent,
@@ -53,17 +84,21 @@
 	ext2_ino_t		ino;
 	struct tm		*tm_p;
 	time_t			modtime;
-	char			name[EXT2_NAME_LEN + 1];
 	char			tmp[EXT2_NAME_LEN + 16];
 	char			datestr[80];
 	char			lbr, rbr;
 	int			thislen;
+	int			options;
 	struct list_dir_struct *ls = (struct list_dir_struct *) private;
+	struct ext2_dir_entry_tail *t = (struct ext2_dir_entry_tail *) dirent;
 
-	thislen = dirent->name_len & 0xFF;
-	strncpy(name, dirent->name, thislen);
-	name[thislen] = '\0';
+	thislen = ext2fs_dirent_name_len(dirent);
 	ino = dirent->inode;
+	options = ls->options;
+	if (ls->state < 2) {
+		ls->state++;
+		options |= RAW_OPT;
+	}
 
 	if (entry == DIRENT_DELETED_FILE) {
 		lbr = '<';
@@ -72,21 +107,23 @@
 	} else {
 		lbr = rbr = ' ';
 	}
-	if (ls->options & PARSE_OPT) {
+	if (options & PARSE_OPT) {
 		if (ino) {
-			if (debugfs_read_inode(ino, &inode, name))
+			if (debugfs_read_inode(ino, &inode, "ls"))
 				return 0;
 		} else
 			memset(&inode, 0, sizeof(struct ext2_inode));
-		fprintf(ls->f,"/%u/%06o/%d/%d/%s/",ino,inode.i_mode,inode.i_uid, inode.i_gid,name);
+		fprintf(ls->f,"/%u/%06o/%d/%d/%.*s/", ino, inode.i_mode,
+			inode_uid(inode), inode_gid(inode), thislen, dirent->name);
 		if (LINUX_S_ISDIR(inode.i_mode))
 			fprintf(ls->f, "/");
 		else
-			fprintf(ls->f, "%lld/", EXT2_I_SIZE(&inode));
+			fprintf(ls->f, "%llu/",
+				(unsigned long long) EXT2_I_SIZE(&inode));
 		fprintf(ls->f, "\n");
-	} else if (ls->options & LONG_OPT) {
+	} else if (options & LONG_OPT) {
 		if (ino) {
-			if (debugfs_read_inode(ino, &inode, name))
+			if (debugfs_read_inode(ino, &inode, "ls"))
 				return 0;
 			modtime = inode.i_mtime;
 			tm_p = localtime(&modtime);
@@ -98,53 +135,83 @@
 			strcpy(datestr, "                 ");
 			memset(&inode, 0, sizeof(struct ext2_inode));
 		}
-		fprintf(ls->f, "%c%6u%c %6o (%d)  %5d  %5d   ", lbr, ino, rbr,
-			inode.i_mode, dirent->name_len >> 8,
+		fprintf(ls->f, "%c%6u%c %6o ", lbr, ino, rbr, inode.i_mode);
+		if (entry == DIRENT_CHECKSUM) {
+			fprintf(ls->f, "(dirblock checksum: 0x%08x)\n",
+				t->det_checksum);
+			return 0;
+		}
+		fprintf(ls->f, "(%d)  %5d  %5d   ",
+			ext2fs_dirent_file_type(dirent),
 			inode_uid(inode), inode_gid(inode));
-		if (LINUX_S_ISDIR(inode.i_mode))
-			fprintf(ls->f, "%5d", inode.i_size);
-		else
-			fprintf(ls->f, "%5llu", EXT2_I_SIZE(&inode));
-		fprintf (ls->f, " %s %s\n", datestr, name);
+			fprintf(ls->f, "%5llu",
+				(unsigned long long) EXT2_I_SIZE(&inode));
+		fprintf(ls->f, " %s ", datestr);
+		print_filename(ls->f, dirent, options);
+		fputc('\n', ls->f);
 	} else {
-		sprintf(tmp, "%c%u%c (%d) %s   ", lbr, dirent->inode, rbr,
-			dirent->rec_len, name);
-		thislen = strlen(tmp);
+		if (entry == DIRENT_CHECKSUM) {
+			sprintf(tmp, "%c%u%c (dirblock checksum: 0x%08x)   ",
+				lbr, dirent->inode, rbr, t->det_checksum);
+			thislen = strlen(tmp);
+			if (ls->col + thislen > 80) {
+				fputc('\n', ls->f);
+				ls->col = 0;
+			}
+			fprintf(ls->f, "%s", tmp);
+			ls->col += thislen;
+			return 0;
+		}
+		sprintf(tmp, "%c%u%c (%d) ", lbr, dirent->inode, rbr,
+			dirent->rec_len);
+		thislen = strlen(tmp) + 3;
+		thislen += print_filename(NULL, dirent, options);
 
 		if (ls->col + thislen > 80) {
-			fprintf(ls->f, "\n");
+			fputc('\n', ls->f);
 			ls->col = 0;
 		}
 		fprintf(ls->f, "%s", tmp);
+		print_filename(ls->f, dirent, options);
+		fputs("   ", ls->f);
 		ls->col += thislen;
 	}
 	return 0;
 }
 
-void do_list_dir(int argc, char *argv[])
+void do_list_dir(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
 {
-	ext2_ino_t	inode;
+	struct ext2_inode inode;
+	ext2_ino_t	ino;
 	int		retval;
 	int		c;
-	int		flags;
+	int		flags = DIRENT_FLAG_INCLUDE_EMPTY;
 	struct list_dir_struct ls;
 
 	ls.options = 0;
+	ls.state = 0;
 	if (check_fs_open(argv[0]))
 		return;
 
 	reset_getopt();
-	while ((c = getopt (argc, argv, "dlp")) != EOF) {
+	while ((c = getopt (argc, argv, "cdlpr")) != EOF) {
 		switch (c) {
+		case 'c':
+			flags |= DIRENT_FLAG_INCLUDE_CSUM;
+			break;
 		case 'l':
 			ls.options |= LONG_OPT;
 			break;
 		case 'd':
-			ls.options |= DELETED_OPT;
+			flags |= DIRENT_FLAG_INCLUDE_REMOVED;
 			break;
 		case 'p':
 			ls.options |= PARSE_OPT;
 			break;
+		case 'r':
+			ls.options |= RAW_OPT;
+			break;
 		default:
 			goto print_usage;
 		}
@@ -152,24 +219,27 @@
 
 	if (argc > optind+1) {
 	print_usage:
-		com_err(0, 0, "Usage: ls [-l] [-d] [-p] file");
+		com_err(0, 0, "Usage: ls [-c] [-d] [-l] [-p] [-r] file");
 		return;
 	}
 
 	if (argc == optind)
-		inode = cwd;
+		ino = cwd;
 	else
-		inode = string_to_inode(argv[optind]);
-	if (!inode)
+		ino = string_to_inode(argv[optind]);
+	if (!ino)
 		return;
 
 	ls.f = open_pager();
 	ls.col = 0;
-	flags = DIRENT_FLAG_INCLUDE_EMPTY;
-	if (ls.options & DELETED_OPT)
-		flags |= DIRENT_FLAG_INCLUDE_REMOVED;
 
-	retval = ext2fs_dir_iterate2(current_fs, inode, flags,
+	if (debugfs_read_inode(ino, &inode, argv[0]))
+		return;
+
+	if (inode.i_flags & EXT4_ENCRYPT_FL)
+		ls.options |= ENCRYPT_OPT;
+
+	retval = ext2fs_dir_iterate2(current_fs, ino, flags,
 				    0, list_dir_proc, &ls);
 	fprintf(ls.f, "\n");
 	close_pager(ls.f);
diff --git a/debugfs/lsdel.c b/debugfs/lsdel.c
index ecc8a88..52c7419 100644
--- a/debugfs/lsdel.c
+++ b/debugfs/lsdel.c
@@ -6,6 +6,7 @@
  * the GNU Public License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -70,7 +71,8 @@
 	return 0;
 }
 
-void do_lsdel(int argc, char **argv)
+void do_lsdel(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+	      void *infop EXT2FS_ATTR((unused)))
 {
 	struct lsdel_struct 	lsd;
 	struct deleted_info	*delarray;
@@ -132,7 +134,7 @@
 
 	while (ino) {
 		if ((inode.i_dtime == 0) ||
-		    (secs && ((unsigned) abs(now - secs) > inode.i_dtime)))
+		    (secs && (labs(now - secs) > (long) inode.i_dtime)))
 			goto next;
 
 		lsd.inode = ino;
@@ -140,15 +142,19 @@
 		lsd.free_blocks = 0;
 		lsd.bad_blocks = 0;
 
-		retval = ext2fs_block_iterate3(current_fs, ino,
-					       BLOCK_FLAG_READ_ONLY, block_buf,
-					       lsdel_proc, &lsd);
-		if (retval) {
-			com_err("ls_deleted_inodes", retval,
-				"while calling ext2fs_block_iterate2");
-			goto next;
+		if (ext2fs_inode_has_valid_blocks2(current_fs, &inode)) {
+			retval = ext2fs_block_iterate3(current_fs, ino,
+						       BLOCK_FLAG_READ_ONLY,
+						       block_buf,
+						       lsdel_proc, &lsd);
+			if (retval) {
+				com_err("ls_deleted_inodes", retval,
+					"while calling ext2fs_block_iterate2");
+				goto next;
+			}
 		}
-		if (lsd.free_blocks && !lsd.bad_blocks) {
+		if ((lsd.free_blocks && !lsd.bad_blocks) ||
+		    inode.i_flags & EXT4_INLINE_DATA_FL) {
 			if (num_delarray >= max_delarray) {
 				max_delarray += 50;
 				delarray = realloc(delarray,
@@ -165,7 +171,7 @@
 			delarray[num_delarray].mode = inode.i_mode;
 			delarray[num_delarray].uid = inode_uid(inode);
 			delarray[num_delarray].size = EXT2_I_SIZE(&inode);
-			delarray[num_delarray].dtime = inode.i_dtime;
+			delarray[num_delarray].dtime = (__s32) inode.i_dtime;
 			delarray[num_delarray].num_blocks = lsd.num_blocks;
 			delarray[num_delarray].free_blocks = lsd.free_blocks;
 			num_delarray++;
@@ -192,8 +198,10 @@
 	for (i = 0; i < num_delarray; i++) {
 		fprintf(out, "%6u %6d %6o %6llu %6lld/%6lld %s",
 			delarray[i].ino,
-			delarray[i].uid, delarray[i].mode, delarray[i].size,
-			delarray[i].free_blocks, delarray[i].num_blocks,
+			delarray[i].uid, delarray[i].mode,
+			(unsigned long long) delarray[i].size,
+			(long long) delarray[i].free_blocks,
+			(long long) delarray[i].num_blocks,
 			time_to_string(delarray[i].dtime));
 	}
 	fprintf(out, "%d deleted inodes found.\n", num_delarray);
diff --git a/debugfs/ncheck.c b/debugfs/ncheck.c
index b7faa63..011f26d 100644
--- a/debugfs/ncheck.c
+++ b/debugfs/ncheck.c
@@ -5,6 +5,7 @@
  * under the terms of the GNU Public License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -27,7 +28,7 @@
 struct inode_walk_struct {
 	ext2_ino_t		dir;
 	ext2_ino_t		*iarray;
-	int			inodes_left;
+	int			names_left;
 	int			num_inodes;
 	int			position;
 	char			*parent;
@@ -44,7 +45,7 @@
 	struct inode_walk_struct *iw = (struct inode_walk_struct *) private;
 	struct ext2_inode inode;
 	errcode_t	retval;
-	int		filetype = dirent->name_len >> 8;
+	int		filetype = ext2fs_dirent_file_type(dirent);
 	int		i;
 
 	iw->position++;
@@ -65,11 +66,13 @@
 			if (iw->parent)
 				printf("%u\t%s/%.*s", iw->iarray[i],
 				       iw->parent,
-				       (dirent->name_len & 0xFF), dirent->name);
+				       ext2fs_dirent_name_len(dirent),
+				       dirent->name);
 			else
 				printf("%u\t<%u>/%.*s", iw->iarray[i],
 				       iw->dir,
-				       (dirent->name_len & 0xFF), dirent->name);
+				       ext2fs_dirent_name_len(dirent),
+				       dirent->name);
 			if (iw->check_dirent && filetype) {
 				if (!debugfs_read_inode(dirent->inode, &inode,
 							"ncheck") &&
@@ -78,15 +81,17 @@
 				}
 			}
 			putc('\n', stdout);
+			iw->names_left--;
 		}
 	}
-	if (!iw->inodes_left)
+	if (!iw->names_left)
 		return DIRENT_ABORT;
 
 	return 0;
 }
 
-void do_ncheck(int argc, char **argv)
+void do_ncheck(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+	       void *infop EXT2FS_ATTR((unused)))
 {
 	struct inode_walk_struct iw;
 	int			c, i;
@@ -108,10 +113,8 @@
 			goto print_usage;
 		}
 	}
-	argc -= optind;
-	argv += optind;
 
-	if (argc < 1) {
+	if (argc <= 1) {
 	print_usage:
 		com_err(argv[0], 0, "Usage: ncheck [-c] <inode number> ...");
 		return;
@@ -119,6 +122,8 @@
 	if (check_fs_open(argv[0]))
 		return;
 
+	argc -= optind;
+	argv += optind;
 	iw.iarray = malloc(sizeof(ext2_ino_t) * argc);
 	if (!iw.iarray) {
 		com_err("ncheck", ENOMEM,
@@ -127,15 +132,22 @@
 	}
 	memset(iw.iarray, 0, sizeof(ext2_ino_t) * argc);
 
+	iw.names_left = 0;
 	for (i=0; i < argc; i++) {
 		iw.iarray[i] = strtol(argv[i], &tmp, 0);
 		if (*tmp) {
-			com_err(argv[0], 0, "Bad inode - %s", argv[i]);
+			com_err("ncheck", 0, "Bad inode - %s", argv[i]);
 			goto error_out;
 		}
+		if (debugfs_read_inode(iw.iarray[i], &inode, *argv))
+			goto error_out;
+		if (LINUX_S_ISDIR(inode.i_mode))
+			iw.names_left += 1;
+		else
+			iw.names_left += inode.i_links_count;
 	}
 
-	iw.num_inodes = iw.inodes_left = argc;
+	iw.num_inodes = argc;
 
 	retval = ext2fs_open_inode_scan(current_fs, 0, &scan);
 	if (retval) {
@@ -179,7 +191,7 @@
 			goto next;
 		}
 
-		if (iw.inodes_left == 0)
+		if (iw.names_left == 0)
 			break;
 
 	next:
diff --git a/debugfs/quota.c b/debugfs/quota.c
new file mode 100644
index 0000000..f792bd7
--- /dev/null
+++ b/debugfs/quota.c
@@ -0,0 +1,172 @@
+/*
+ * quota.c --- debugfs quota commands
+ *
+ * Copyright (C) 2014 Theodore Ts'o.  This file may be redistributed
+ * under the terms of the GNU Public License.
+ */
+
+#include "config.h"
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <time.h>
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#include <sys/types.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#else
+extern int optind;
+extern char *optarg;
+#endif
+
+#include "debugfs.h"
+
+const char *quota_type[] = { "user", "group", "project", NULL };
+
+static int load_quota_ctx(char *progname)
+{
+	errcode_t	retval;
+
+	if (check_fs_open(progname))
+		return 1;
+
+	if (!ext2fs_has_feature_quota(current_fs->super)) {
+		com_err(progname, 0, "quota feature not enabled");
+		return 1;
+	}
+
+	if (current_qctx)
+		return 0;
+
+	retval = quota_init_context(&current_qctx, current_fs, 0);
+	if (retval) {
+		com_err(current_fs->device_name, retval,
+			"while trying to load quota information");
+		return 1;
+	}
+	return 0;
+}
+
+static int parse_quota_type(const char *cmdname, const char *str)
+{
+	errcode_t	retval;
+	char		*t;
+	int		flags = 0;
+	int		i;
+
+	for (i = 0; i < MAXQUOTAS; i++) {
+		if (strcasecmp(str, quota_type[i]) == 0)
+			break;
+	}
+	if (i >= MAXQUOTAS) {
+		i = strtol(str, &t, 0);
+		if (*t)
+			i = -1;
+	}
+	if (i < 0 || i >= MAXQUOTAS) {
+		com_err(0, 0, "Invalid quota type: %s", str);
+		printf("Valid quota types are: ");
+		for (i = 0; i < MAXQUOTAS; i++)
+			printf("%s ", quota_type[i]);
+		printf("\n");
+		return -1;
+	}
+
+	if (current_fs->flags & EXT2_FLAG_RW)
+		flags |= EXT2_FILE_WRITE;
+
+	retval = quota_file_open(current_qctx, NULL, 0, i, -1, flags);
+	if (retval) {
+		com_err(cmdname, retval,
+			"while opening quota inode (type %d)", i);
+		return -1;
+	}
+	return i;
+}
+
+
+static int list_quota_callback(struct dquot *dq,
+			       void *cb_data EXT2FS_ATTR((unused)))
+{
+	printf("%10u   %8lld %8lld %8lld    %8lld %8lld %8lld\n",
+	       dq->dq_id, (long long)dq->dq_dqb.dqb_curspace,
+	       (long long)dq->dq_dqb.dqb_bsoftlimit,
+	       (long long)dq->dq_dqb.dqb_bhardlimit,
+	       (long long)dq->dq_dqb.dqb_curinodes,
+	       (long long)dq->dq_dqb.dqb_isoftlimit,
+	       (long long)dq->dq_dqb.dqb_ihardlimit);
+	return 0;
+}
+
+void do_list_quota(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		   void *infop EXT2FS_ATTR((unused)))
+{
+	errcode_t	retval;
+	int		type;
+	struct quota_handle *qh;
+
+	if (load_quota_ctx(argv[0]))
+		return;
+
+	if (argc != 2) {
+		com_err(0, 0, "Usage: list_quota <quota_type>\n");
+		return;
+	}
+
+	type = parse_quota_type(argv[0], argv[1]);
+	if (type < 0)
+		return;
+
+	printf("%7s %2s   %8s %8s %8s    %8s %8s %8s\n",
+	       quota_type[type], "id",
+	       "blocks", "quota", "limit", "inodes", "quota", "limit");
+	qh = current_qctx->quota_file[type];
+	retval = qh->qh_ops->scan_dquots(qh, list_quota_callback, NULL);
+	if (retval) {
+		com_err(argv[0], retval, "while scanning dquots");
+		return;
+	}
+}
+
+void do_get_quota(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
+{
+	int		err, type;
+	struct quota_handle *qh;
+	struct dquot	*dq;
+	qid_t		id;
+
+	if (load_quota_ctx(argv[0]))
+		return;
+
+	if (argc != 3) {
+		com_err(0, 0, "Usage: get_quota <quota_type> <id>\n");
+		return;
+	}
+
+	type = parse_quota_type(argv[0], argv[1]);
+	if (type < 0)
+		return;
+
+	id = parse_ulong(argv[2], argv[0], "id", &err);
+	if (err)
+		return;
+
+	printf("%7s %2s   %8s %8s %8s    %8s %8s %8s\n",
+	       quota_type[type], "id",
+	       "blocks", "quota", "limit", "inodes", "quota", "limit");
+
+	qh = current_qctx->quota_file[type];
+
+	dq = qh->qh_ops->read_dquot(qh, id);
+	if (dq) {
+		list_quota_callback(dq, NULL);
+		ext2fs_free_mem(&dq);
+	} else {
+		com_err(argv[0], 0, "couldn't read quota record");
+	}
+}
diff --git a/debugfs/ro_debug_cmds.ct b/debugfs/ro_debug_cmds.ct
index 8226d1a..736ade6 100644
--- a/debugfs/ro_debug_cmds.ct
+++ b/debugfs/ro_debug_cmds.ct
@@ -90,5 +90,10 @@
 request do_extent_open, "Open inode for extent manipulation",
 	extent_open, eo;
 
-end;
+request do_list_quota, "List quota",
+	lost_quota, lq;
 
+request do_get_quota, "Get quota",
+	get_quota, gq;
+
+end;
diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c
index 116a15a..b001579 100644
--- a/debugfs/set_fields.c
+++ b/debugfs/set_fields.c
@@ -17,6 +17,7 @@
 #define STRTOULL strtoul
 #endif
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -29,6 +30,7 @@
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
+#include <assert.h>
 #if HAVE_STRINGS_H
 #include <strings.h>
 #endif
@@ -38,6 +40,7 @@
 #include "debugfs.h"
 #include "uuid/uuid.h"
 #include "e2p/e2p.h"
+#include "support/quotaio.h"
 
 static struct ext2_super_block set_sb;
 static struct ext2_inode_large set_inode;
@@ -49,6 +52,8 @@
 static int array_idx;
 
 #define FLAG_ARRAY	0x0001
+#define FLAG_ALIAS	0x0002	/* Data intersects with other field */
+#define FLAG_CSUM	0x0004
 
 struct field_set_info {
 	const char	*name;
@@ -65,12 +70,20 @@
 static errcode_t parse_string(struct field_set_info *info, char *field, char *arg);
 static errcode_t parse_uuid(struct field_set_info *info, char *field, char *arg);
 static errcode_t parse_hashalg(struct field_set_info *info, char *field, char *arg);
+static errcode_t parse_encoding(struct field_set_info *info, char *field, char *arg);
 static errcode_t parse_time(struct field_set_info *info, char *field, char *arg);
 static errcode_t parse_bmap(struct field_set_info *info, char *field, char *arg);
 static errcode_t parse_gd_csum(struct field_set_info *info, char *field, char *arg);
+static errcode_t parse_inode_csum(struct field_set_info *info, char *field,
+				  char *arg);
 static errcode_t parse_mmp_clear(struct field_set_info *info, char *field,
 				 char *arg);
 
+#if __GNUC_PREREQ (4, 6) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
 static struct field_set_info super_fields[] = {
 	{ "inodes_count", &set_sb.s_inodes_count, NULL, 4, parse_uint },
 	{ "blocks_count", &set_sb.s_blocks_count, &set_sb.s_blocks_count_hi,
@@ -109,7 +122,6 @@
 	{ "uuid", &set_sb.s_uuid, NULL, 16, parse_uuid },
 	{ "volume_name",  &set_sb.s_volume_name, NULL, 16, parse_string },
 	{ "last_mounted",  &set_sb.s_last_mounted, NULL, 64, parse_string },
-	{ "lastcheck",  &set_sb.s_lastcheck, NULL, 4, parse_uint },
 	{ "algorithm_usage_bitmap", &set_sb.s_algorithm_usage_bitmap, NULL,
 		  4, parse_uint },
 	{ "prealloc_blocks", &set_sb.s_prealloc_blocks, NULL, 1, parse_uint },
@@ -134,7 +146,6 @@
 	{ "want_extra_isize", &set_sb.s_want_extra_isize, NULL, 2, parse_uint },
 	{ "flags", &set_sb.s_flags, NULL, 4, parse_uint },
 	{ "raid_stride", &set_sb.s_raid_stride, NULL, 2, parse_uint },
-	{ "min_extra_isize", &set_sb.s_min_extra_isize, NULL, 4, parse_uint },
 	{ "mmp_interval", &set_sb.s_mmp_update_interval, NULL, 2, parse_uint },
 	{ "mmp_block", &set_sb.s_mmp_block, NULL, 8, parse_uint },
 	{ "raid_stripe_width", &set_sb.s_raid_stripe_width, NULL, 4, parse_uint },
@@ -148,21 +159,46 @@
 	{ "mount_opts",  &set_sb.s_mount_opts, NULL, 64, parse_string },
 	{ "usr_quota_inum", &set_sb.s_usr_quota_inum, NULL, 4, parse_uint },
 	{ "grp_quota_inum", &set_sb.s_grp_quota_inum, NULL, 4, parse_uint },
-	{ "overhead_blocks", &set_sb.s_overhead_blocks, NULL, 4, parse_uint },
+	{ "prj_quota_inum", &set_sb.s_prj_quota_inum, NULL, 4, parse_uint },
+	{ "overhead_clusters", &set_sb.s_overhead_clusters, NULL, 4, parse_uint },
+	{ "backup_bgs", &set_sb.s_backup_bgs[0], NULL, 4, parse_uint,
+	  FLAG_ARRAY, 2 },
 	{ "checksum", &set_sb.s_checksum, NULL, 4, parse_uint },
+	{ "checksum_type", &set_sb.s_checksum_type, NULL, 1, parse_uint },
+	{ "encryption_level", &set_sb.s_encryption_level, NULL, 1, parse_uint },
+	{ "error_count", &set_sb.s_error_count, NULL, 4, parse_uint },
+	{ "first_error_time", &set_sb.s_first_error_time, NULL, 4, parse_time },
+	{ "first_error_ino", &set_sb.s_first_error_ino, NULL, 4, parse_uint },
+	{ "first_error_block", &set_sb.s_first_error_block, NULL, 8, parse_uint },
+	{ "first_error_func", &set_sb.s_first_error_func, NULL, 32, parse_string },
+	{ "first_error_line", &set_sb.s_first_error_line, NULL, 4, parse_uint },
+	{ "last_error_time", &set_sb.s_last_error_time, NULL, 4, parse_time },
+	{ "last_error_ino", &set_sb.s_last_error_ino, NULL, 4, parse_uint },
+	{ "last_error_block", &set_sb.s_last_error_block, NULL, 8, parse_uint },
+	{ "last_error_func", &set_sb.s_last_error_func, NULL, 32, parse_string },
+	{ "last_error_line", &set_sb.s_last_error_line, NULL, 4, parse_uint },
+	{ "encrypt_algos", &set_sb.s_encrypt_algos, NULL, 1, parse_uint,
+	  FLAG_ARRAY, 4 },
+	{ "encrypt_pw_salt", &set_sb.s_encrypt_pw_salt, NULL, 16, parse_uuid },
+	{ "lpf_ino", &set_sb.s_lpf_ino, NULL, 4, parse_uint },
+	{ "checksum_seed", &set_sb.s_checksum_seed, NULL, 4, parse_uint },
+	{ "encoding", &set_sb.s_encoding, NULL, 2, parse_encoding },
 	{ 0, 0, 0, 0 }
 };
 
 static struct field_set_info inode_fields[] = {
-	{ "inodes_count", &set_sb.s_inodes_count, NULL, 4, parse_uint },
 	{ "mode", &set_inode.i_mode, NULL, 2, parse_uint },
 	{ "uid", &set_inode.i_uid, &set_inode.osd2.linux2.l_i_uid_high,
 		2, parse_uint },
 	{ "size", &set_inode.i_size, &set_inode.i_size_high, 4, parse_uint },
-	{ "atime", &set_inode.i_atime, NULL, 4, parse_time },
-	{ "ctime", &set_inode.i_ctime, NULL, 4, parse_time },
-	{ "mtime", &set_inode.i_mtime, NULL, 4, parse_time },
-	{ "dtime", &set_inode.i_dtime, NULL, 4, parse_time },
+	{ "atime", &set_inode.i_atime, &set_inode.i_atime_extra,
+		4, parse_time },
+	{ "ctime", &set_inode.i_ctime, &set_inode.i_ctime_extra,
+		4, parse_time },
+	{ "mtime", &set_inode.i_mtime, &set_inode.i_mtime_extra,
+		4, parse_time },
+	{ "dtime", &set_inode.i_dtime, NULL,
+		4, parse_time },
 	{ "gid", &set_inode.i_gid, &set_inode.osd2.linux2.l_i_gid_high,
 		2, parse_uint },
 	{ "links_count", &set_inode.i_links_count, NULL, 2, parse_uint },
@@ -172,7 +208,8 @@
 	{ "flags", &set_inode.i_flags, NULL, 4, parse_uint },
 	{ "version", &set_inode.osd1.linux1.l_i_version,
 		&set_inode.i_version_hi, 4, parse_uint },
-	{ "translator", &set_inode.osd1.hurd1.h_i_translator, NULL, 4, parse_uint },
+	{ "translator", &set_inode.osd1.hurd1.h_i_translator, NULL,
+		4, parse_uint, FLAG_ALIAS },
 	{ "block", &set_inode.i_block[0], NULL, 4, parse_uint, FLAG_ARRAY,
 	  EXT2_NDIR_BLOCKS },
 	{ "block[IND]", &set_inode.i_block[EXT2_IND_BLOCK], NULL, 4, parse_uint },
@@ -182,25 +219,26 @@
 	/* Special case: i_file_acl_high is 2 bytes */
 	{ "file_acl", &set_inode.i_file_acl, 
 		&set_inode.osd2.linux2.l_i_file_acl_high, 6, parse_uint },
-	{ "dir_acl", &set_inode.i_dir_acl, NULL, 4, parse_uint },
 	{ "faddr", &set_inode.i_faddr, NULL, 4, parse_uint },
-	{ "frag", &set_inode.osd2.hurd2.h_i_frag, NULL, 1, parse_uint },
+	{ "frag", &set_inode.osd2.hurd2.h_i_frag, NULL, 1, parse_uint, FLAG_ALIAS },
 	{ "fsize", &set_inode.osd2.hurd2.h_i_fsize, NULL, 1, parse_uint },
 	{ "checksum", &set_inode.osd2.linux2.l_i_checksum_lo, 
-		&set_inode.i_checksum_hi, 2, parse_uint },
+		&set_inode.i_checksum_hi, 2, parse_inode_csum, FLAG_CSUM },
 	{ "author", &set_inode.osd2.hurd2.h_i_author, NULL,
-		4, parse_uint },
+		4, parse_uint, FLAG_ALIAS },
 	{ "extra_isize", &set_inode.i_extra_isize, NULL,
 		2, parse_uint },
 	{ "ctime_extra", &set_inode.i_ctime_extra, NULL,
-		4, parse_uint },
+		4, parse_uint, FLAG_ALIAS },
 	{ "mtime_extra", &set_inode.i_mtime_extra, NULL,
-		4, parse_uint },
+		4, parse_uint, FLAG_ALIAS  },
 	{ "atime_extra", &set_inode.i_atime_extra, NULL,
-		4, parse_uint },
-	{ "crtime", &set_inode.i_crtime, NULL, 4, parse_uint },
+		4, parse_uint, FLAG_ALIAS },
+	{ "crtime", &set_inode.i_crtime, &set_inode.i_crtime_extra,
+		4, parse_time },
 	{ "crtime_extra", &set_inode.i_crtime_extra, NULL,
-		4, parse_uint },
+		4, parse_uint, FLAG_ALIAS },
+	{ "projid", &set_inode.i_projid, NULL, 4, parse_uint },
 	{ "bmap", NULL, NULL, 4, parse_bmap, FLAG_ARRAY },
 	{ 0, 0, 0, 0 }
 };
@@ -245,7 +283,8 @@
 };
 
 static struct field_set_info mmp_fields[] = {
-	{ "clear", &set_mmp.mmp_magic, NULL, sizeof(set_mmp), parse_mmp_clear },
+	{ "clear", &set_mmp.mmp_magic, NULL, sizeof(set_mmp),
+		parse_mmp_clear, FLAG_ALIAS },
 	{ "magic", &set_mmp.mmp_magic, NULL, 4, parse_uint },
 	{ "seq", &set_mmp.mmp_seq, NULL, 4, parse_uint },
 	{ "time", &set_mmp.mmp_time, NULL, 8, parse_uint },
@@ -254,7 +293,64 @@
 	{ "bdevname", &set_mmp.mmp_bdevname, NULL, sizeof(set_mmp.mmp_bdevname),
 		parse_string },
 	{ "check_interval", &set_mmp.mmp_check_interval, NULL, 2, parse_uint },
+	{ "checksum", &set_mmp.mmp_checksum, NULL, 4, parse_uint },
+	{ 0, 0, 0, 0 }
 };
+#if __GNUC_PREREQ (4, 6)
+#pragma GCC diagnostic pop
+#endif
+
+#ifdef UNITTEST
+
+
+static void do_verify_field_set_info(struct field_set_info *fields,
+		const void *data, size_t size)
+{
+	struct field_set_info *ss, *ss2;
+	const char *begin = (char *)data;
+	const char *end = begin + size;
+
+	for (ss = fields ; ss->name ; ss++) {
+		const char *ptr;
+
+		/* Check pointers */
+		ptr = ss->ptr;
+		assert(!ptr || (ptr >= begin && ptr < end));
+		ptr = ss->ptr2;
+		assert(!ptr || (ptr >= begin && ptr < end));
+
+		/* Check function */
+		assert(ss->func);
+
+		for (ss2 = fields ; ss2 != ss ; ss2++) {
+			/* Check duplicate names */
+			assert(strcmp(ss->name, ss2->name));
+
+			if (ss->flags & FLAG_ALIAS || ss2->flags & FLAG_ALIAS)
+				continue;
+			/* Check false aliases, might be copy-n-paste error */
+			assert(!ss->ptr || (ss->ptr != ss2->ptr &&
+					    ss->ptr != ss2->ptr2));
+			assert(!ss->ptr2 || (ss->ptr2 != ss2->ptr &&
+					     ss->ptr2 != ss2->ptr2));
+		}
+	}
+}
+
+int main(int argc, char **argv)
+{
+	do_verify_field_set_info(super_fields, &set_sb, sizeof(set_sb));
+	do_verify_field_set_info(inode_fields, &set_inode, sizeof(set_inode));
+	do_verify_field_set_info(ext2_bg_fields, &set_gd, sizeof(set_gd));
+	do_verify_field_set_info(ext4_bg_fields, &set_gd4, sizeof(set_gd4));
+	do_verify_field_set_info(mmp_fields, &set_mmp, sizeof(set_mmp));
+	return 0;
+}
+
+ext2_filsys current_fs;
+ext2_ino_t root, cwd;
+
+#endif /* UNITTEST */
 
 static int check_suffix(const char *field)
 {
@@ -307,8 +403,11 @@
 	 */
 	if (idx) {
 		array_idx = strtol(idx, &tmp, 0);
-		if (*tmp)
+		if (*tmp) {
+			*(--idx) = '[';
+			*delim = ']';
 			idx = 0;
+		}
 	}
 
 	/*
@@ -339,7 +438,7 @@
 
 /*
  * Note: info->size == 6 is special; this means a base size 4 bytes,
- * and secondiory (high) size of 2 bytes.  This is needed for the
+ * and secondary (high) size of 2 bytes.  This is needed for the
  * special case of i_blocks_high and i_file_acl_high.
  */
 static errcode_t parse_uint(struct field_set_info *info, char *field,
@@ -388,10 +487,7 @@
 	n = num & mask;
 	switch (size) {
 	case 8:
-		/* Should never get here */
-		fprintf(stderr, "64-bit field %s has a second 64-bit field\n"
-			"defined; BUG?!?\n", info->name);
-		*u.ptr64 = 0;
+		*u.ptr64 = n;
 		break;
 	case 4:
 		*u.ptr32 = n;
@@ -405,13 +501,16 @@
 	}
 	if (!field2)
 		return 0;
-	n = num >> (size*8);
+	n = (size == 8) ? 0 : (num >> (size*8));
 	u.ptr8 = (__u8 *) field2;
 	if (info->size == 6)
 		size = 2;
 	switch (size) {
 	case 8:
-		*u.ptr64 = n;
+		/* Should never get here */
+		fprintf(stderr, "64-bit field %s has a second 64-bit field\n"
+			"defined; BUG?!?\n", info->name);
+		*u.ptr64 = 0;
 		break;
 	case 4:
 		*u.ptr32 = n;
@@ -473,21 +572,30 @@
 }
 
 static errcode_t parse_time(struct field_set_info *info,
-			    char *field EXT2FS_ATTR((unused)), char *arg)
+			    char *field, char *arg)
 {
-	time_t		t;
-	__u32		*ptr32;
+	__s64		t;
+	__u32		t_low, t_high;
+	__u32		*ptr_low, *ptr_high;
 
-	ptr32 = (__u32 *) info->ptr;
+	if (check_suffix(field))
+		return parse_uint(info, field, arg);
+
+	ptr_low  = (__u32 *) info->ptr;
+	ptr_high = (__u32 *) info->ptr2;
 
 	t = string_to_time(arg);
 
-	if (t == ((time_t) -1)) {
+	if (t == -1) {
 		fprintf(stderr, "Couldn't parse '%s' for field %s.\n",
 			arg, info->name);
 		return EINVAL;
 	}
-	*ptr32 = t;
+	t_low = (__u32) t;
+	t_high = ((t - (__s32)t) >> 32) & EXT4_EPOCH_MASK;
+	*ptr_low = t_low;
+	if (ptr_high)
+		*ptr_high = (*ptr_high & ~EXT4_EPOCH_MASK) | t_high;
 	return 0;
 }
 
@@ -525,6 +633,19 @@
 	return 0;
 }
 
+static errcode_t parse_encoding(struct field_set_info *info,
+				char *field EXT2FS_ATTR((unused)), char *arg)
+{
+	int	encoding;
+	unsigned char	*p = (unsigned char *) info->ptr;
+
+	encoding = e2p_str2encoding(arg);
+	if (encoding < 0)
+		return parse_uint(info, field, arg);
+	*p = encoding;
+	return 0;
+}
+
 static errcode_t parse_bmap(struct field_set_info *info,
 			    char *field EXT2FS_ATTR((unused)), char *arg)
 {
@@ -540,8 +661,9 @@
 	}
 
 	retval = ext2fs_bmap2(current_fs, set_ino,
-			     (struct ext2_inode *) &set_inode,
-			     NULL, BMAP_SET, array_idx, NULL, &blk);
+			      (struct ext2_inode *) &set_inode,
+			      NULL, BMAP_ALLOC | BMAP_SET, array_idx, NULL,
+			      &blk);
 	if (retval) {
 		com_err("set_inode", retval, "while setting block map");
 	}
@@ -551,18 +673,74 @@
 static errcode_t parse_gd_csum(struct field_set_info *info, char *field,
 			       char *arg)
 {
+	__u16 *checksum = info->ptr;
 
 	if (strcmp(arg, "calc") == 0) {
-		ext2fs_group_desc_csum_set(current_fs, set_bg);
-		memcpy(&set_gd, ext2fs_group_desc(current_fs,
-					current_fs->group_desc,
-					set_bg),
-			sizeof(set_gd));
-		printf("Checksum set to 0x%04x\n",
-		       ext2fs_bg_checksum(current_fs, set_bg));
+		*checksum = ext2fs_group_desc_csum(current_fs, set_bg);
+		printf("Checksum set to 0x%04x\n", *checksum);
 		return 0;
 	}
+	return parse_uint(info, field, arg);
+}
 
+static errcode_t parse_inode_csum(struct field_set_info *info, char *field,
+				  char *arg)
+{
+	errcode_t	retval = 0;
+	__u32		crc;
+	int		is_large_inode = 0;
+
+	if (strcmp(arg, "calc") == 0) {
+		size_t sz = EXT2_INODE_SIZE(current_fs->super);
+		struct ext2_inode_large *tmp_inode = NULL;
+
+		retval = ext2fs_get_mem(sz, &tmp_inode);
+		if (retval)
+			goto out;
+
+		retval = ext2fs_read_inode_full(current_fs, set_ino,
+				     (struct ext2_inode *) tmp_inode,
+				     sz);
+		if (retval)
+			goto out;
+
+#ifdef WORDS_BIGENDIAN
+		ext2fs_swap_inode_full(current_fs, tmp_inode,
+				       tmp_inode, 1, sz);
+#endif
+
+		if (sz > EXT2_GOOD_OLD_INODE_SIZE)
+			is_large_inode = 1;
+
+		retval = ext2fs_inode_csum_set(current_fs, set_ino,
+					       tmp_inode);
+		if (retval)
+			goto out;
+#ifdef WORDS_BIGENDIAN
+		crc = set_inode.i_checksum_lo =
+			ext2fs_swab16(tmp_inode->i_checksum_lo);
+
+#else
+		crc = set_inode.i_checksum_lo = tmp_inode->i_checksum_lo;
+#endif
+		if (is_large_inode &&
+		    set_inode.i_extra_isize >=
+				(offsetof(struct ext2_inode_large,
+					  i_checksum_hi) -
+				 EXT2_GOOD_OLD_INODE_SIZE)) {
+#ifdef WORDS_BIGENDIAN
+			set_inode.i_checksum_lo =
+				ext2fs_swab16(tmp_inode->i_checksum_lo);
+#else
+			set_inode.i_checksum_hi = tmp_inode->i_checksum_hi;
+#endif
+			crc |= ((__u32)set_inode.i_checksum_hi) << 16;
+		}
+		printf("Checksum set to 0x%08x\n", crc);
+	out:
+		ext2fs_free_mem(&tmp_inode);
+		return retval;
+	}
 	return parse_uint(info, field, arg);
 }
 
@@ -624,7 +802,8 @@
 }
 
 
-void do_set_super(int argc, char *argv[])
+void do_set_super(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
 {
 	const char *usage = "<field> <value>\n"
 		"\t\"set_super_value -l\" will list the names of "
@@ -651,7 +830,8 @@
 	}
 }
 
-void do_set_inode(int argc, char *argv[])
+void do_set_inode(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
 {
 	const char *usage = "<inode> <field> <value>\n"
 		"\t\"set_inode_field -l\" will list the names of "
@@ -676,23 +856,28 @@
 	if (!set_ino)
 		return;
 
-	if (debugfs_read_inode_full(set_ino,
-			(struct ext2_inode *) &set_inode, argv[1],
-				    sizeof(set_inode)))
+	if (debugfs_read_inode2(set_ino,
+				(struct ext2_inode *) &set_inode, argv[1],
+				sizeof(set_inode),
+				(ss->flags & FLAG_CSUM) ?
+				READ_INODE_NOCSUM : 0))
 		return;
 
 	if (ss->func(ss, argv[2], argv[3]) == 0) {
-		if (debugfs_write_inode_full(set_ino, 
-			     (struct ext2_inode *) &set_inode,
-			     argv[1], sizeof(set_inode)))
-			return;
+		debugfs_write_inode2(set_ino,
+				     (struct ext2_inode *) &set_inode,
+				     argv[1], sizeof(set_inode),
+				     (ss->flags & FLAG_CSUM) ?
+				     WRITE_INODE_NOCSUM : 0);
 	}
 }
 
-void do_set_block_group_descriptor(int argc, char *argv[])
+void do_set_block_group_descriptor(int argc, char *argv[],
+				   int sci_idx EXT2FS_ATTR((unused)),
+				   void *infop EXT2FS_ATTR((unused)))
 {
 	const char *usage = "<bg number> <field> <value>\n"
-		"\t\"set_block_group_descriptor -l\" will list the names of "
+		"\t\"set_block_group -l\" will list the names of "
 		"the fields in a block group descriptor\n\twhich can be set.";
 	struct field_set_info	*table;
 	struct field_set_info	*ss;
@@ -723,7 +908,7 @@
 		return;
 	}
 
-	if (common_args_process(argc, argv, 4, 4, "set_block_group_descriptor",
+	if (common_args_process(argc, argv, 4, 4, "set_block_group",
 				usage, CHECK_FS_RW))
 		return;
 
@@ -766,7 +951,9 @@
 	return 1; /* we don't need the MMP block written again */
 }
 
-void do_set_mmp_value(int argc, char *argv[])
+#ifdef CONFIG_MMP
+void do_set_mmp_value(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		      void *infop EXT2FS_ATTR((unused)))
 {
 	const char *usage = "<field> <value>\n"
 		"\t\"set_mmp_value -l\" will list the names of "
@@ -823,4 +1010,14 @@
 		*mmp_s = set_mmp;
 	}
 }
+#else
+void do_set_mmp_value(int argc EXT2FS_ATTR((unused)),
+		      char *argv[] EXT2FS_ATTR((unused)),
+		      int sci_idx EXT2FS_ATTR((unused)),
+		      void *infop EXT2FS_ATTR((unused)))
+{
+	fprintf(stdout, "MMP is unsupported, please recompile with "
+	                "--enable-mmp\n");
+}
+#endif
 
diff --git a/debugfs/unused.c b/debugfs/unused.c
index b78d70b..08191a0 100644
--- a/debugfs/unused.c
+++ b/debugfs/unused.c
@@ -5,6 +5,7 @@
  * under the terms of the GNU Public License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -24,7 +25,9 @@
 
 #include "debugfs.h"
 
-void do_dump_unused(int argc EXT2FS_ATTR((unused)), char **argv)
+void do_dump_unused(int argc EXT2FS_ATTR((unused)), char **argv,
+		    int sci_idx EXT2FS_ATTR((unused)),
+		    void *infop EXT2FS_ATTR((unused)))
 {
 	blk64_t		blk;
 	unsigned char	buf[EXT2_MAX_BLOCK_SIZE];
@@ -50,7 +53,7 @@
 		if (i >= current_fs->blocksize)
 			continue;
 		printf("\nUnused block %llu contains non-zero data:\n\n",
-		       blk);
+		       (unsigned long long) blk);
 		for (i=0; i < current_fs->blocksize; i++)
 			fputc(buf[i], stdout);
 	}
diff --git a/debugfs/util.c b/debugfs/util.c
index 8b34490..9e88054 100644
--- a/debugfs/util.c
+++ b/debugfs/util.c
@@ -8,6 +8,7 @@
 
 #define _XOPEN_SOURCE 600 /* needed for strptime */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -118,7 +119,7 @@
 	 */
 	if ((len > 2) && (str[0] == '<') && (str[len-1] == '>')) {
 		ino = strtoul(str+1, &end, 0);
-		if (*end=='>')
+		if (*end=='>' && (ino <= current_fs->super->s_inodes_count))
 			return ino;
 	}
 
@@ -127,6 +128,11 @@
 		com_err(str, retval, 0);
 		return 0;
 	}
+	if (ino > current_fs->super->s_inodes_count) {
+		com_err(str, 0, "resolves to an illegal inode number: %u\n",
+			ino);
+		return 0;
+	}
 	return ino;
 }
 
@@ -185,22 +191,30 @@
 	return 0;
 }
 
+char *inode_time_to_string(__u32 xtime, __u32 xtime_extra)
+{
+	__s64 t = (__s32) xtime;
+
+	t += (__s64) (xtime_extra & EXT4_EPOCH_MASK) << 32;
+	return time_to_string(t);
+}
+
 /*
- * This function takes a __u32 time value and converts it to a string,
+ * This function takes a __s64 time value and converts it to a string,
  * using ctime
  */
-char *time_to_string(__u32 cl)
+char *time_to_string(__s64 cl)
 {
 	static int	do_gmt = -1;
 	time_t		t = (time_t) cl;
 	const char	*tz;
 
 	if (do_gmt == -1) {
-		/* The diet libc doesn't respect the TZ environemnt variable */
+		/* The diet libc doesn't respect the TZ environment variable */
 		tz = ss_safe_getenv("TZ");
 		if (!tz)
 			tz = "";
-		do_gmt = !strcmp(tz, "GMT");
+		do_gmt = !strcmp(tz, "GMT") || !strcmp(tz, "GMT0");
 	}
 
 	return asctime((do_gmt) ? gmtime(&t) : localtime(&t));
@@ -210,10 +224,10 @@
  * Parse a string as a time.  Return ((time_t)-1) if the string
  * doesn't appear to be a sane time.
  */
-time_t string_to_time(const char *arg)
+extern __s64 string_to_time(const char *arg)
 {
 	struct	tm	ts;
-	time_t		ret;
+	__s64		ret;
 	char *tmp;
 
 	if (strcmp(arg, "now") == 0) {
@@ -221,32 +235,52 @@
 	}
 	if (arg[0] == '@') {
 		/* interpret it as an integer */
-		ret = strtoul(arg+1, &tmp, 0);
+		arg++;
+	fallback:
+		ret = strtoll(arg, &tmp, 0);
 		if (*tmp)
-			return ((time_t) -1);
+			return -1;
 		return ret;
 	}
 	memset(&ts, 0, sizeof(ts));
 #ifdef HAVE_STRPTIME
-	strptime(arg, "%Y%m%d%H%M%S", &ts);
+	tmp = strptime(arg, "%Y%m%d%H%M%S", &ts);
+	if (tmp == NULL)
+		tmp = strptime(arg, "%Y%m%d%H%M", &ts);
+	if (tmp == NULL)
+		tmp = strptime(arg, "%Y%m%d", &ts);
+	if (tmp == NULL)
+		goto fallback;
 #else
 	sscanf(arg, "%4d%2d%2d%2d%2d%2d", &ts.tm_year, &ts.tm_mon,
 	       &ts.tm_mday, &ts.tm_hour, &ts.tm_min, &ts.tm_sec);
 	ts.tm_year -= 1900;
 	ts.tm_mon -= 1;
 	if (ts.tm_year < 0 || ts.tm_mon < 0 || ts.tm_mon > 11 ||
-	    ts.tm_mday < 0 || ts.tm_mday > 31 || ts.tm_hour > 23 ||
+	    ts.tm_mday <= 0 || ts.tm_mday > 31 || ts.tm_hour > 23 ||
 	    ts.tm_min > 59 || ts.tm_sec > 61)
-		ts.tm_mday = 0;
+		goto fallback;
 #endif
 	ts.tm_isdst = -1;
-	ret = mktime(&ts);
-	if (ts.tm_mday == 0 || ret == ((time_t) -1)) {
-		/* Try it as an integer... */
-		ret = strtoul(arg, &tmp, 0);
-		if (*tmp)
-			return ((time_t) -1);
-	}
+	/* strptime() may only update the specified fields, which does not
+	 * necessarily include ts.tm_yday (%j).  Calculate this if unset:
+	 *
+	 * Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
+	 * 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+	 *
+	 * Start with 31 days per month.  Even months have only 30 days, but
+	 * reverse in August, subtract one day for those months. February has
+	 * only 28 days, not 30, subtract two days. Add day of month, minus
+	 * one, since day is not finished yet.  Leap years handled afterward. */
+	if (ts.tm_yday == 0)
+		ts.tm_yday = (ts.tm_mon * 31) -
+			((ts.tm_mon - (ts.tm_mon > 7)) / 2) -
+			2 * (ts.tm_mon > 1) + ts.tm_mday - 1;
+	ret = ts.tm_sec + ts.tm_min*60 + ts.tm_hour*3600 + ts.tm_yday*86400 +
+		((__s64) ts.tm_year-70)*31536000 +
+		(((__s64) ts.tm_year-69)/4)*86400 -
+		(((__s64) ts.tm_year-1)/100)*86400 +
+		(((__s64) ts.tm_year+299)/400)*86400;
 	return ret;
 }
 
@@ -300,17 +334,20 @@
 
 /*
  * This function will convert a string to a block number.  It returns
- * 0 on success, 1 on failure.
+ * 0 on success, 1 on failure.  On failure, it outputs either an optionally
+ * specified error message or a default.
  */
-int strtoblk(const char *cmd, const char *str, blk64_t *ret)
+int strtoblk(const char *cmd, const char *str, const char *errmsg,
+	     blk64_t *ret)
 {
 	blk64_t	blk;
 	int	err;
 
-	blk = parse_ulonglong(str, cmd, "block number", &err);
+	if (errmsg == NULL)
+		blk = parse_ulonglong(str, cmd, "block number", &err);
+	else
+		blk = parse_ulonglong(str, cmd, errmsg, &err);
 	*ret = blk;
-	if (err)
-		com_err(cmd, 0, "Invalid block number: %s", str);
 	return err;
 }
 
@@ -368,27 +405,27 @@
 				"<block> [count]", CHECK_FS_BITMAPS))
 		return 1;
 
-	if (strtoblk(argv[0], argv[1], block))
+	if (strtoblk(argv[0], argv[1], NULL, block))
 		return 1;
 	if (*block == 0) {
 		com_err(argv[0], 0, "Invalid block number 0");
-		err = 1;
+		return 1;
 	}
 
 	if (argc > 2) {
-		err = strtoblk(argv[0], argv[2], count);
+		err = strtoblk(argv[0], argv[2], "count", count);
 		if (err)
 			return 1;
 	}
 	return 0;
 }
 
-int debugfs_read_inode_full(ext2_ino_t ino, struct ext2_inode * inode,
-			const char *cmd, int bufsize)
+int debugfs_read_inode2(ext2_ino_t ino, struct ext2_inode * inode,
+			const char *cmd, int bufsize, int flags)
 {
 	int retval;
 
-	retval = ext2fs_read_inode_full(current_fs, ino, inode, bufsize);
+	retval = ext2fs_read_inode2(current_fs, ino, inode, bufsize, flags);
 	if (retval) {
 		com_err(cmd, retval, "while reading inode %u", ino);
 		return 1;
@@ -409,15 +446,14 @@
 	return 0;
 }
 
-int debugfs_write_inode_full(ext2_ino_t ino,
-			     struct ext2_inode *inode,
-			     const char *cmd,
-			     int bufsize)
+int debugfs_write_inode2(ext2_ino_t ino,
+			 struct ext2_inode *inode,
+			 const char *cmd,
+			 int bufsize, int flags)
 {
 	int retval;
 
-	retval = ext2fs_write_inode_full(current_fs, ino,
-					 inode, bufsize);
+	retval = ext2fs_write_inode2(current_fs, ino, inode, bufsize, flags);
 	if (retval) {
 		com_err(cmd, retval, "while writing inode %u", ino);
 		return 1;
@@ -479,3 +515,86 @@
 
 	return 0;
 }
+
+errcode_t read_list(char *str, blk64_t **list, size_t *len)
+{
+	blk64_t *lst = *list;
+	size_t ln = *len;
+	char *tok, *p = str;
+	errcode_t retval = 0;
+
+	while ((tok = strtok(p, ","))) {
+		blk64_t *l;
+		blk64_t x, y;
+		char *e;
+
+		errno = 0;
+		y = x = strtoull(tok, &e, 0);
+		if (errno) {
+			retval = errno;
+			break;
+		}
+		if (*e == '-') {
+			y = strtoull(e + 1, NULL, 0);
+			if (errno) {
+				retval = errno;
+				break;
+			}
+		} else if (*e != 0) {
+			retval = EINVAL;
+			break;
+		}
+		if (y < x) {
+			retval = EINVAL;
+			break;
+		}
+		l = realloc(lst, sizeof(blk64_t) * (ln + y - x + 1));
+		if (l == NULL) {
+			retval = ENOMEM;
+			break;
+		}
+		lst = l;
+		for (; x <= y; x++)
+			lst[ln++] = x;
+		p = NULL;
+	}
+
+	*list = lst;
+	*len = ln;
+	return retval;
+}
+
+void do_byte_hexdump(FILE *fp, unsigned char *buf, size_t bufsize)
+{
+	size_t		i, j, max;
+	int		suppress = -1;
+
+	for (i = 0; i < bufsize; i += 16) {
+		max = (bufsize - i > 16) ? 16 : bufsize - i;
+		if (suppress < 0) {
+			if (i && memcmp(buf + i, buf + i - max, max) == 0) {
+				suppress = i;
+				fprintf(fp, "*\n");
+				continue;
+			}
+		} else {
+			if (memcmp(buf + i, buf + suppress, max) == 0)
+				continue;
+			suppress = -1;
+		}
+		fprintf(fp, "%04o  ", (unsigned int)i);
+		for (j = 0; j < 16; j++) {
+			if (j < max)
+				fprintf(fp, "%02x", buf[i+j]);
+			else
+				fprintf(fp, "  ");
+			if ((j % 2) == 1)
+				fprintf(fp, " ");
+		}
+		fprintf(fp, " ");
+		for (j = 0; j < max; j++)
+			fprintf(fp, "%c", isprint(buf[i+j]) ? buf[i+j] : '.');
+		fprintf(fp, "\n");
+	}
+	fprintf(fp, "\n");
+}
diff --git a/debugfs/xattrs.c b/debugfs/xattrs.c
new file mode 100644
index 0000000..bd11450
--- /dev/null
+++ b/debugfs/xattrs.c
@@ -0,0 +1,503 @@
+/*
+ * xattrs.c --- Modify extended attributes via debugfs.
+ *
+ * Copyright (C) 2014 Oracle.  This file may be redistributed
+ * under the terms of the GNU Public License.
+ */
+
+#include "config.h"
+#include <stdio.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#else
+extern int optind;
+extern char *optarg;
+#endif
+#include <ctype.h>
+#include "support/cstring.h"
+
+#include "debugfs.h"
+
+#define PRINT_XATTR_HEX		0x01
+#define PRINT_XATTR_RAW		0x02
+#define PRINT_XATTR_C		0x04
+#define PRINT_XATTR_STATFMT	0x08
+#define PRINT_XATTR_NOQUOTES	0x10
+
+/* Dump extended attributes */
+static void print_xattr_hex(FILE *f, const char *str, int len)
+{
+	int i;
+
+	for (i = 0; i < len; i++)
+		fprintf(f, "%02x ", (unsigned char)str[i]);
+}
+
+/* Dump extended attributes */
+static void print_xattr_string(FILE *f, const char *str, int len, int flags)
+{
+	int printable = 0;
+	int i;
+
+	if (flags & PRINT_XATTR_RAW) {
+		fwrite(str, len, 1, f);
+		return;
+	}
+
+	if ((flags & PRINT_XATTR_C) == 0) {
+		/* check: is string "printable enough?" */
+		for (i = 0; i < len; i++)
+			if (isprint(str[i]))
+				printable++;
+
+		if (printable <= len*7/8)
+			flags |= PRINT_XATTR_HEX;
+	}
+
+	if (flags & PRINT_XATTR_HEX) {
+		print_xattr_hex(f, str, len);
+	} else {
+		if ((flags & PRINT_XATTR_NOQUOTES) == 0)
+			fputc('\"', f);
+		print_c_string(f, str, len);
+		if ((flags & PRINT_XATTR_NOQUOTES) == 0)
+			fputc('\"', f);
+	}
+}
+
+static void print_xattr(FILE *f, char *name, char *value, size_t value_len,
+			int print_flags)
+{
+	print_xattr_string(f, name, strlen(name), PRINT_XATTR_NOQUOTES);
+	fprintf(f, " (%zu)", value_len);
+	if ((print_flags & PRINT_XATTR_STATFMT) &&
+	    (strcmp(name, "system.data") == 0))
+		value_len = 0;
+	if (value_len != 0 &&
+	    (!(print_flags & PRINT_XATTR_STATFMT) || (value_len < 40))) {
+		fprintf(f, " = ");
+		print_xattr_string(f, value, value_len, print_flags);
+	}
+	fputc('\n', f);
+}
+
+static int dump_attr(char *name, char *value, size_t value_len, void *data)
+{
+	FILE *out = data;
+
+	fprintf(out, "  ");
+	print_xattr(out, name, value, value_len, PRINT_XATTR_STATFMT);
+	return 0;
+}
+
+void dump_inode_attributes(FILE *out, ext2_ino_t ino)
+{
+	struct ext2_xattr_handle *h;
+	size_t sz;
+	errcode_t err;
+
+	err = ext2fs_xattrs_open(current_fs, ino, &h);
+	if (err)
+		return;
+
+	err = ext2fs_xattrs_read(h);
+	if (err)
+		goto out;
+
+	err = ext2fs_xattrs_count(h, &sz);
+	if (err || sz == 0)
+		goto out;
+
+	fprintf(out, "Extended attributes:\n");
+	err = ext2fs_xattrs_iterate(h, dump_attr, out);
+	if (err)
+		goto out;
+
+out:
+	err = ext2fs_xattrs_close(&h);
+}
+
+void do_list_xattr(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		   void *infop EXT2FS_ATTR((unused)))
+{
+	ext2_ino_t ino;
+
+	if (argc != 2) {
+		printf("%s: Usage: %s <file>\n", argv[0],
+		       argv[0]);
+		return;
+	}
+
+	if (check_fs_open(argv[0]))
+		return;
+
+	ino = string_to_inode(argv[1]);
+	if (!ino)
+		return;
+
+	dump_inode_attributes(stdout, ino);
+}
+
+void do_get_xattr(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
+{
+	ext2_ino_t ino;
+	struct ext2_xattr_handle *h;
+	FILE *fp = NULL;
+	char *buf = NULL;
+	size_t buflen;
+	int i;
+	int print_flags = 0;
+	unsigned int handle_flags = 0;
+	errcode_t err;
+
+	reset_getopt();
+	while ((i = getopt(argc, argv, "Cf:rxV")) != -1) {
+		switch (i) {
+		case 'f':
+			if (fp)
+				fclose(fp);
+			fp = fopen(optarg, "w");
+			if (fp == NULL) {
+				perror(optarg);
+				return;
+			}
+			break;
+		case 'r':
+			handle_flags |= XATTR_HANDLE_FLAG_RAW;
+			break;
+		case 'x':
+			print_flags |= PRINT_XATTR_HEX;
+			break;
+		case 'V':
+			print_flags |= PRINT_XATTR_RAW|
+				PRINT_XATTR_NOQUOTES;
+			break;
+		case 'C':
+			print_flags |= PRINT_XATTR_C;
+			break;
+		default:
+			goto usage;
+		}
+	}
+
+	if (optind != argc - 2) {
+	usage:
+		printf("%s: Usage: %s [-f outfile]|[-xVC] [-r] <file> <attr>\n",
+			       argv[0], argv[0]);
+
+		goto out2;
+	}
+
+	if (check_fs_open(argv[0]))
+		goto out2;
+
+	ino = string_to_inode(argv[optind]);
+	if (!ino)
+		goto out2;
+
+	err = ext2fs_xattrs_open(current_fs, ino, &h);
+	if (err)
+		goto out2;
+
+	err = ext2fs_xattrs_flags(h, &handle_flags, NULL);
+	if (err)
+		goto out;
+
+	err = ext2fs_xattrs_read(h);
+	if (err)
+		goto out;
+
+	err = ext2fs_xattr_get(h, argv[optind + 1], (void **)&buf, &buflen);
+	if (err)
+		goto out;
+
+	if (fp) {
+		fwrite(buf, buflen, 1, fp);
+	} else {
+		if (print_flags & PRINT_XATTR_RAW) {
+			if (print_flags & (PRINT_XATTR_HEX|PRINT_XATTR_C))
+				print_flags &= ~PRINT_XATTR_RAW;
+			print_xattr_string(stdout, buf, buflen, print_flags);
+		} else {
+			print_xattr(stdout, argv[optind + 1],
+				    buf, buflen, print_flags);
+		}
+		printf("\n");
+	}
+
+	ext2fs_free_mem(&buf);
+out:
+	ext2fs_xattrs_close(&h);
+	if (err)
+		com_err(argv[0], err, "while getting extended attribute");
+out2:
+	if (fp)
+		fclose(fp);
+}
+
+void do_set_xattr(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		  void *infop EXT2FS_ATTR((unused)))
+{
+	ext2_ino_t ino;
+	struct ext2_xattr_handle *h;
+	FILE *fp = NULL;
+	char *buf = NULL;
+	size_t buflen;
+	unsigned int handle_flags = 0;
+	int i;
+	errcode_t err;
+
+	reset_getopt();
+	while ((i = getopt(argc, argv, "f:r")) != -1) {
+		switch (i) {
+		case 'f':
+			if (fp)
+				fclose(fp);
+			fp = fopen(optarg, "r");
+			if (fp == NULL) {
+				perror(optarg);
+				return;
+			}
+			break;
+		case 'r':
+			handle_flags |= XATTR_HANDLE_FLAG_RAW;
+			break;
+		default:
+			goto print_usage;
+		}
+	}
+
+	if (!(fp && optind == argc - 2) && !(!fp && optind == argc - 3)) {
+	print_usage:
+		printf("Usage:\t%s [-r] <file> <attr> <value>\n", argv[0]);
+		printf("\t%s -f <value_file> [-r] <file> <attr>\n", argv[0]);
+		goto out2;
+	}
+
+	if (check_fs_open(argv[0]))
+		goto out2;
+	if (check_fs_read_write(argv[0]))
+		goto out2;
+	if (check_fs_bitmaps(argv[0]))
+		goto out2;
+
+	ino = string_to_inode(argv[optind]);
+	if (!ino)
+		goto out2;
+
+	err = ext2fs_xattrs_open(current_fs, ino, &h);
+	if (err)
+		goto out2;
+
+	err = ext2fs_xattrs_flags(h, &handle_flags, NULL);
+	if (err)
+		goto out;
+
+	err = ext2fs_xattrs_read(h);
+	if (err)
+		goto out;
+
+	if (fp) {
+		err = ext2fs_get_mem(current_fs->blocksize, &buf);
+		if (err)
+			goto out;
+		buflen = fread(buf, 1, current_fs->blocksize, fp);
+	} else {
+		buf = argv[optind + 2];
+		buflen = parse_c_string(buf);
+	}
+
+	err = ext2fs_xattr_set(h, argv[optind + 1], buf, buflen);
+out:
+	ext2fs_xattrs_close(&h);
+	if (err)
+		com_err(argv[0], err, "while setting extended attribute");
+out2:
+	if (fp) {
+		fclose(fp);
+		ext2fs_free_mem(&buf);
+	}
+}
+
+void do_rm_xattr(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+		 void *infop EXT2FS_ATTR((unused)))
+{
+	ext2_ino_t ino;
+	struct ext2_xattr_handle *h;
+	int i;
+	errcode_t err;
+
+	if (argc < 3) {
+		printf("%s: Usage: %s <file> <attrs>...\n", argv[0], argv[0]);
+		return;
+	}
+
+	if (check_fs_open(argv[0]))
+		return;
+	if (check_fs_read_write(argv[0]))
+		return;
+	if (check_fs_bitmaps(argv[0]))
+		return;
+
+	ino = string_to_inode(argv[1]);
+	if (!ino)
+		return;
+
+	err = ext2fs_xattrs_open(current_fs, ino, &h);
+	if (err)
+		return;
+
+	err = ext2fs_xattrs_read(h);
+	if (err)
+		goto out;
+
+	for (i = 2; i < argc; i++) {
+		err = ext2fs_xattr_remove(h, argv[i]);
+		if (err)
+			goto out;
+	}
+out:
+	ext2fs_xattrs_close(&h);
+	if (err)
+		com_err(argv[0], err, "while removing extended attribute");
+}
+
+/*
+ * Return non-zero if the string has a minimal number of non-printable
+ * characters.
+ */
+static int is_mostly_printable(const char *cp, int len)
+{
+	int	np = 0;
+
+	if (len < 0)
+		len = strlen(cp);
+
+	while (len--) {
+		if (!isprint(*cp++)) {
+			np++;
+			if (np > 3)
+				return 0;
+		}
+	}
+	return 1;
+}
+
+static void safe_print(FILE *f, const char *cp, int len)
+{
+	unsigned char	ch;
+
+	if (len < 0)
+		len = strlen(cp);
+
+	while (len--) {
+		ch = *cp++;
+		if (ch > 128) {
+			fputs("M-", f);
+			ch -= 128;
+		}
+		if ((ch < 32) || (ch == 0x7f)) {
+			fputc('^', f);
+			ch ^= 0x40; /* ^@, ^A, ^B; ^? for DEL */
+		}
+		fputc(ch, f);
+	}
+}
+
+static void dump_xattr_raw_entries(FILE *f, unsigned char *buf,
+				   unsigned int start, unsigned int len,
+				   unsigned value_start)
+{
+	struct ext2_ext_attr_entry ent;
+	unsigned int off = start;
+	unsigned int vstart;
+
+	while (off < len) {
+		if ((*(__u16 *) (buf + off)) == 0) {
+			fprintf(f, "last entry found at offset %u (%04o)\n",
+				off, off);
+			break;
+		}
+		if ((off + sizeof(struct ext2_ext_attr_entry)) >= len) {
+			fprintf(f, "xattr buffer overrun at %u (len = %u)\n",
+				off, len);
+			break;
+		}
+#if WORDS_BIGENDIAN
+		ext2fs_swap_ext_attr_entry(&ent,
+			(struct ext2_ext_attr_entry *) (buf + off));
+#else
+		ent = *((struct ext2_ext_attr_entry *) (buf + off));
+#endif
+		fprintf(f, "offset = %d (%04o), name_len = %u, "
+			"name_index = %u\n",
+			off, off, ent.e_name_len, ent.e_name_index);
+		vstart = value_start + ent.e_value_offs;
+		fprintf(f, "value_offset = %d (%04o), value_inum = %u, "
+			"value_size = %u\n", ent.e_value_offs,
+			vstart, ent.e_value_inum, ent.e_value_size);
+		off += sizeof(struct ext2_ext_attr_entry);
+		fprintf(f, "name = ");
+		if ((off + ent.e_name_len) >= len)
+			fprintf(f, "<runs off end>");
+		else
+			safe_print(f, (char *)(buf + off), ent.e_name_len);
+		fputc('\n', f);
+		if (ent.e_value_size == 0)
+			goto skip_value;
+		fprintf(f, "value = ");
+		if (ent.e_value_inum)
+			fprintf(f, "<ino %u>", ent.e_value_inum);
+		else if (ent.e_value_offs >= len ||
+			 (vstart + ent.e_value_size) > len)
+			fprintf(f, "<runs off end>");
+		else if (is_mostly_printable((char *)(buf + vstart),
+					ent.e_value_size))
+			safe_print(f, (char *)(buf + vstart),
+				   ent.e_value_size);
+		else {
+			fprintf(f, "<hexdump>\n");
+			do_byte_hexdump(f, (unsigned char *)(buf + vstart),
+					ent.e_value_size);
+		}
+		fputc('\n', f);
+	skip_value:
+		fputc('\n', f);
+		off += (ent.e_name_len + 3) & ~3;
+	}
+}
+
+void raw_inode_xattr_dump(FILE *f, unsigned char *buf, unsigned int len)
+{
+	__u32 magic = ext2fs_le32_to_cpu(*((__le32 *) buf));
+
+	fprintf(f, "magic = %08x, length = %u, value_start =4 \n\n",
+		magic, len);
+	if (magic == EXT2_EXT_ATTR_MAGIC)
+		dump_xattr_raw_entries(f, buf, 4, len, 4);
+}
+
+void block_xattr_dump(FILE *f, unsigned char *buf, unsigned int len)
+{
+	struct ext2_ext_attr_header header;
+
+#ifdef WORDS_BIGENDIAN
+	ext2fs_swap_ext_attr_header(&header,
+				    (struct ext2_ext_attr_header *) buf);
+#else
+	header = *((struct ext2_ext_attr_header *) buf);
+#endif
+	fprintf(f, "magic = %08x, length = %u\n", header.h_magic, len);
+	if (header.h_magic != EXT2_EXT_ATTR_MAGIC)
+		return;
+	fprintf(f, "refcount = %u, blocks = %u\n", header.h_refcount,
+		header.h_blocks);
+	fprintf(f, "hash = %08x, checksum = %08x\n", header.h_hash,
+		header.h_checksum);
+	fprintf(f, "reserved: %08x %08x %08x\n\n", header.h_reserved[0],
+		header.h_reserved[1], header.h_reserved[2]);
+
+	dump_xattr_raw_entries(f, buf,
+			       sizeof(struct ext2_ext_attr_header), len, 0);
+}
diff --git a/debugfs/zap.c b/debugfs/zap.c
index 1d4d02e..f862482 100644
--- a/debugfs/zap.c
+++ b/debugfs/zap.c
@@ -5,6 +5,7 @@
  * under the terms of the GNU Public License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -24,7 +25,8 @@
 
 #include "debugfs.h"
 
-void do_zap_block(int argc, char *argv[])
+void do_zap_block(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		    void *infop EXT2FS_ATTR((unused)))
 {
 	unsigned long	pattern = 0;
 	unsigned char	*buf;
@@ -131,7 +133,8 @@
 				       block, 0, &block);
 		if (errcode) {
 			com_err(argv[0], errcode,
-				"while mapping logical block %llu\n", block);
+				"while mapping logical block %llu\n",
+				(unsigned long long) block);
 			return;
 		}
 	}
@@ -145,7 +148,8 @@
 	errcode = io_channel_read_blk64(current_fs->io, block, 1, buf);
 	if (errcode) {
 		com_err(argv[0], errcode,
-			"while reading block %llu\n", block);
+			"while reading block %llu\n",
+			(unsigned long long) block);
 		goto errout;
 	}
 
@@ -157,7 +161,8 @@
 	errcode = io_channel_write_blk64(current_fs->io, block, 1, buf);
 	if (errcode) {
 		com_err(argv[0], errcode,
-			"while write block %llu\n", block);
+			"while write block %llu\n",
+			(unsigned long long) block);
 		goto errout;
 	}
 
@@ -166,27 +171,29 @@
 	return;
 }
 
-void do_block_dump(int argc, char *argv[])
+void do_block_dump(int argc, char *argv[], int sci_idx EXT2FS_ATTR((unused)),
+		    void *infop EXT2FS_ATTR((unused)))
 {
 	unsigned char	*buf;
 	ext2_ino_t	inode;
 	errcode_t	errcode;
 	blk64_t		block;
 	char		*file = NULL;
-	unsigned int	i, j;
+	int		xattr_dump = 0;
 	int		c, err;
-	int		suppress = -1;
 
 	if (check_fs_open(argv[0]))
 		return;
 
 	reset_getopt();
-	while ((c = getopt (argc, argv, "f:")) != EOF) {
+	while ((c = getopt (argc, argv, "f:x")) != EOF) {
 		switch (c) {
 		case 'f':
 			file = optarg;
 			break;
-
+		case 'x':
+			xattr_dump = 1;
+			break;
 		default:
 			goto print_usage;
 		}
@@ -194,7 +201,7 @@
 
 	if (argc != optind + 1) {
 	print_usage:
-		com_err(0, 0, "Usage: block_dump [-f inode] block_num");
+		com_err(0, 0, "Usage: block_dump [-x] [-f inode] block_num");
 		return;
 	}
 
@@ -210,7 +217,8 @@
 				       block, 0, &block);
 		if (errcode) {
 			com_err(argv[0], errcode,
-				"while mapping logical block %llu\n", block);
+				"while mapping logical block %llu\n",
+				(unsigned long long) block);
 			return;
 		}
 	}
@@ -224,36 +232,15 @@
 	errcode = io_channel_read_blk64(current_fs->io, block, 1, buf);
 	if (errcode) {
 		com_err(argv[0], errcode,
-			"while reading block %llu\n", block);
+			"while reading block %llu\n",
+			(unsigned long long) block);
 		goto errout;
 	}
 
-	for (i=0; i < current_fs->blocksize; i += 16) {
-		if (suppress < 0) {
-			if (i && memcmp(buf + i, buf + i - 16, 16) == 0) {
-				suppress = i;
-				printf("*\n");
-				continue;
-			}
-		} else {
-			if (memcmp(buf + i, buf + suppress, 16) == 0)
-				continue;
-			suppress = -1;
-		}
-		printf("%04o  ", i);
-		for (j = 0; j < 16; j++) {
-			printf("%02x", buf[i+j]);
-			if ((j % 2) == 1)
-				putchar(' ');
-		}
-		putchar(' ');
-		for (j = 0; j < 16; j++)
-			printf("%c", isprint(buf[i+j]) ? buf[i+j] : '.');
-		putchar('\n');
-	}
-	putchar('\n');
-
+	if (xattr_dump)
+		block_xattr_dump(stdout, buf, current_fs->blocksize);
+	else
+		do_byte_hexdump(stdout, buf, current_fs->blocksize);
 errout:
 	free(buf);
-	return;
 }
diff --git a/doc/Makefile.in b/doc/Makefile.in
index a2b2612..a359453 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -8,10 +8,11 @@
 top_builddir = ..
 my_dir = doc
 INSTALL = @INSTALL@
+MKDIR_P = @MKDIR_P@
 
 @MCONFIG@
 
-DVI=texi2dvi
+DVI=texi2dvi --clean
 DVIPS=dvips -o "$@"
 INFO=@MAKEINFO@
 HTML=makeinfo --html --no-split
@@ -21,14 +22,14 @@
 
 install-doc-libs: libext2fs.info libext2fs.dvi
 	$(Q) $(RM) -rf $(DESTDIR)$(infodir)/libext2fs.info*
-	$(E) "	MKINSTALLDIRS $(infodir)"
-	$(Q) $(MKINSTALLDIRS) $(DESTDIR)$(infodir)
+	$(E) "	MKDIR_P $(infodir)"
+	$(Q) $(MKDIR_P) $(DESTDIR)$(infodir)
 	-$(Q) for i in libext2fs.info* ; do \
 		echo "	INSTALL_DATA $(infodir)/$$i" ; \
 		$(INSTALL_DATA) $$i $(DESTDIR)$(infodir)/$$i ; \
 	done
 	$(E) "	GZIP $(infodir)/libext2fs.info*"
-	-$(Q) gzip -9 $(DESTDIR)$(infodir)/libext2fs.info*
+	-$(Q) gzip -9n $(DESTDIR)$(infodir)/libext2fs.info*
 
 uninstall-doc-libs:
 	$(RM) -rf $(DESTDIR)$(infodir)/libext2fs.info*
diff --git a/doc/RelNotes/v1.02.txt b/doc/RelNotes/v1.02.txt
new file mode 100644
index 0000000..27dce52
--- /dev/null
+++ b/doc/RelNotes/v1.02.txt
@@ -0,0 +1,25 @@
+E2fsprogs 1.02 (January 16, 1996)
+=================================
+
+Fix to allow e2fsprogs to be compiled on recent 1.3 (pl45+) kernels.
+
+Change e2fsck to print statistics of how many non-contiguous files are
+on the system.  Note that a file which is larger than 8k blocks, it is
+guaranteed to be non-contiguous.
+
+In mke2fs, print a warning message if a user tries to format a whole
+disk (/dev/hda versus /dev/hda1).  If a user really wants to format a
+whole disk, the -F (force) option forces mke2fs to format a whole disk
+as a filesystem.
+
+Fix a bug in fsck where in some cases it might start checking
+partitions in the next pass before it finishes checking partitions in
+the current pass.  This still won't cause two partitions on the same
+disk will be checked, so it's rarely a problem in real life.
+
+Patch lsattr so that it won't hang when checking a named pipe.
+
+Minor compilation fixes:
+	* Fix the order of libraries that were linked in debugfs.
+	* Allow the sources to be compiled with -ansi turned on.
+
diff --git a/doc/RelNotes/v1.03.txt b/doc/RelNotes/v1.03.txt
new file mode 100644
index 0000000..3e6b25e
--- /dev/null
+++ b/doc/RelNotes/v1.03.txt
@@ -0,0 +1,33 @@
+E2fsprogs 1.03 (March 27, 1996)
+===============================
+
+Change the m68k bit numbering for bitmasks to match the bit numbering
+used by all other ext2 implementations.  (This change was requested by
+the m68k kernel development team.)
+
+Support (in-development) filesystem format revision which supports
+(among other things) dynamically sized inodes.
+
+Fixed a bug in the ext2 library so that an intelligent error is
+returned if mke2fs is run with a ridiculously small number of blocks
+for a partition.
+
+Fixed a bug in the ext2 library which required that the device be
+openable in read/write mode in order to determine its size.  This
+caused e2fsck -n to require read/write access when it was not
+previously necessary.
+
+Fixed a bug in e2fsck which caused it to occasionally fail the test
+suite depending on which version of the floating point library it was
+using.
+
+Fixed a bug in e2fsck so that it now halts with a fatal error when
+certain superblock consistency checks fail.  Previously it continued
+running e2fsck, with some potential confusing/damaging consequences.
+
+Added new flag to fsck which allows the root to be checked in parallel
+with other filesystems.  This is not the safest thing in the world to
+do, but some system administrators really wanted it.
+
+Fixed -Wall flames in lib/ss.
+
diff --git a/doc/RelNotes/v1.04.txt b/doc/RelNotes/v1.04.txt
new file mode 100644
index 0000000..0120c90
--- /dev/null
+++ b/doc/RelNotes/v1.04.txt
@@ -0,0 +1,49 @@
+E2fsprogs 1.04 (May 16, 1996)
+=============================
+
+First "official" (1.03 was a limited release only) to support building
+e2fsprogs under Linux 2.0 kernels (as well as late model 1.3 and 1.99
+kernels).
+
+This package includes a RPM specs file, that it can be built using the
+RedHat Package Manager.
+
+E2fsck now prints a hint that if there are lots of incorrectly located
+inode bitmaps, block bitmaps, and inode table blocks, the user might
+want to try using e2fsck -b 8193 first, to see if that fares any
+better.
+
+For ext2 filesystem written with the hurd, debugfs will now print out
+the translator field when printing an inode structure.
+
+Lots of miscellaneous linking/installation cleanups:
+
+  Libraries are now linked using a relative pathname, instead of
+  relying on -L working correct.  It doesn't, in many cases, including
+  current versions of GNU ld.  This guarantees that the build tree is
+  linking with the right libraries, instead of the ones installed in
+  /usr/lib.
+
+  Header files, man pages, and the et/ss shell scripts are now
+  generated using a custom substitution script, instead of relying on
+  the configure script.  This prevents needless recompilation of
+  files; in addition, the custom substitution script is much faster.
+
+  e2fsck may now be linked dynamically, by using the
+  --enable-dynamic-e2fsck flag to configure.  This is not recommended,
+  since it increases e2fsck's dependence on other files, but some
+  people need to save disk space, and other critical programs on their
+  systems were being linked dynamically anyway.
+
+  Programs such as fsck which didn't need to be linked against
+  libext2fs (or mke2fs which didn't need to be linked against libe2p)
+  only link against libraries they actually need.  Otherwise, those
+  programs would require the presence of libraries that otherwise
+  could be removed from a rescue diskette.
+
+  The ss include files are now installed correctly so they can
+  actually be used by another package.
+
+  If the profiling libraries are built, they are now installed on a
+  "make install-libs".
+
diff --git a/doc/RelNotes/v1.05.txt b/doc/RelNotes/v1.05.txt
new file mode 100644
index 0000000..b1d22c1
--- /dev/null
+++ b/doc/RelNotes/v1.05.txt
@@ -0,0 +1,104 @@
+E2fsprogs 1.05 (September 7, 1996)
+==================================
+
+Add support for new fields in the ext2 superblock --- volume name,
+volume UUID, and last mounted field.  Dumpe2fs displays these fields,
+tune2fs and mke2fs allows you to set them.  E2fsck will automatically
+generate a UUID for those volumes that don't have them.  
+
+Put in support for e2fsck to recognize HURD specific ext2 features ---
+most notably, the translator block.  The e2fsprogs tools will now use
+the creator_os field in the superblock to correctly handle different
+OS-specific variants of the ext2 filesystem.
+
+E2fsck now fixes inodes which have a the deletion time set, but which
+have a non-zero i_link_count field by offering to clear the deletion
+time.  Previously e2fsck assumed that the inode was deleted (per 0.3c
+ext2 kernel behavior) and offered to unlink the file.
+
+If e2fsck sets the clean bit, but nothing else, set the exit code
+FSCK_NONDESTRUCT.  After all, e2fsck did fix a filesystem error --- it
+set the filesystem valid bit when it was previously cleared.  :-) This
+was needed to make the HURD fsck driver happy.
+
+If the  user  refuses to attach an  unattached  inode, e2fsck  will no
+longer set the inode's link count.  Otherwise, the  inode would end up
+getting marked as unused, which might cause loss of data later.
+
+Make the message issued by e2fsck when the superblock is corrupt less
+confusing for users.  It now mentions that another reason for the
+"corrupt superblock" message might be that the partition might not be
+an ext2 filesystem at all (it might swap, msdos filesystem, ufs, etc.)
+
+Make the libext2 library more robust so that e2fsck won't coredump on
+an illegal superblock where the blocksize is zero.  (f_crashdisk is
+the test case).
+
+By default, create filesystems where the default checkinterval is 6
+months (180 days).  Linux servers can be robust enough that 20 reboots
+can be a long, long time.
+
+Added configure flag --enable-old-bitops, which forces the bitops to
+use the old (native) bitmask operations.  By default on the sparc
+platform, the standard ext2 bit ordering is now used.
+
+Added a new feature to e2fsck to byte-swap filesystems; this can be
+used to convert old m68k filesystems to use the standard byte-order
+storage for the superblock, inodes, and directory blocks.  This
+function is invoked by using the '-s' option to e2fsck.
+
+Debugfs's "dump" command has been enhanced so that it writes out the
+exact size of the file so that the nulls at the end of the file are
+eliminated.  The command also accept a new "-p" option which will
+attempt to preserve the ownership, permissions, and file
+modification/access times.
+
+Debugfs has two new options, -f and -R.  The -R option allows the user
+to execute a single debugfs command from the command line.  The -f
+option allows the user to specify a "command file" containing debugfs
+commands which will get executed.
+
+Dumpe2fs now pretty prints the check interval, instead of just
+printing the check interval as a number of seconds.
+
+Fix bugs in debugfs: the params command when no filesystem is opened
+no longer causes a core dump.  It is now possible to unlink a file
+when a pathname containing a '/' is specified.
+
+Tune2fs has a new -C option which sets the number of times the
+filesystem has been mounted.
+
+Fix the chattr '-v' option so that it actually works.  Chattr was
+being buggy about the -v option parsing.
+
+Programmers' notes:
+-------------------
+
+The directory lib/uuid contains a set of library routines to generate
+DCE compatible UUIDs.  
+
+Extended ext2fs_namei() to handle symbolic links.  Added new function
+ext2fs_nami_follow() which will follow last symbolic link in the case
+where the pathname points to a sym link.
+
+The ext2fs_block_iterate function will now return the HURD translator
+block, if present.  The new flag BLOCK_FLAG_DATA_ONLY will cause the
+iterator to return data blocks only.  The ext2fs.h file now defines
+constants BLOCK_COUNT_IND, BLOCK_COUNT_DIND, BLOCK_COUNT_TIND, and
+BLOCK_COUNT_TRANSLATOR, which are the magic values passed in the block
+count field of the iterator callback function.
+
+The test script driver now takes an optional second argument, which is
+the test case to be run.  This allows you to run a test case without
+needing to run the entire test suite.
+
+On Linux ELF systems, install the .so files in the correct places
+(/usr/lib).  The .so files must be stored in the same directory as the
+.a files.
+
+Fixed miscellaneous HURD compilation issues with header file being
+included in the right order.
+
+Fixed debugfs so that it resets optind to zero, not one, since setting
+optind to zero is more correct.
+
diff --git a/doc/RelNotes/v1.06.txt b/doc/RelNotes/v1.06.txt
new file mode 100644
index 0000000..c6b8c92
--- /dev/null
+++ b/doc/RelNotes/v1.06.txt
@@ -0,0 +1,51 @@
+E2fsprogs 1.06 (October 7, 1996)
+================================
+
+Fixed serious bug in e2fsck: if the block descriptors are bad, don't
+smash the backup copies in ext2fs_close().  (The problem was that when
+e2fsck -p discovered the problem, while it was closing the filesystem
+and exiting, it was also blowing away the backup superblocks on the
+disk, which was less than friendly.)  We now make it the case that we
+only write out the backup superblock and the back block descriptors if
+the filesystem is completely free from problems.
+
+Fixed a bug in block_interate in the lib/ext2fs library which caused
+e2fsck to fail on GNU Hurd-created filesystems.
+
+Add support for Linux/FT's bootloader, which actually uses
+EXT2_BOOT_LOADER, and sets its mode bits which caused e2fsck to want
+to clear the inode.
+
+Add support for the "A" (no atime update) attribute.  (Note: this
+attribute is not yet in production kernels.)
+
+The test suite is not automatically run when doing a "make all" from
+the top level directory.  Users should manually run "make check" if
+they wish to run the test suite.
+
+Upon a preenhalt(), make the printed message more explicit that
+running e2fsck "MANUALLY" means without the -p or -a options.
+
+In e2fsck, if a disconnected inode is zero-length, offer to clear it
+instead of offering to connect it to lost+found.
+
+In e2fsck, if a filesystem was just unmounted uncleanly, and needs
+e2fsck to be run over it, change e2fsck to explicitly display this
+fact.
+
+For dumpe2fs and e2fsck, cause the -V option to print out which
+version of the ext2fs library is actually getting used.  (This will
+help detect mismatches of using a 1.06 utility with a 1.05 library,
+etc.)
+
+Programmers' notes:
+-------------------
+
+EXT2_SWAP_BYTES was changed to EXT2_FLAG_SWAP_BYTES, which better fits
+the naming convention.
+
+In ext2fs_initialize(), make sure the description for the inode bitmap
+is correctly initialize.
+
+Fixed minor type typo in ext2fs_allocate_generic_bitmap();
+
diff --git a/doc/RelNotes/v1.07.txt b/doc/RelNotes/v1.07.txt
new file mode 100644
index 0000000..d780c93
--- /dev/null
+++ b/doc/RelNotes/v1.07.txt
@@ -0,0 +1,122 @@
+E2fsprogs 1.07 (March 9, 1997)
+==============================
+
+E2fsck is now uses much less memory when checking really large
+filesystems (or rather, filesystems with a large number of inodes).
+Previously a filesystem with 1 million inodes required 4 megabytes of
+memory to store inode count statistics; that storage requirement has
+now been reduced to roughly half a megabyte.
+
+E2fsck can now properly deal with bad blocks appearing inside the
+inode table.  Instead of trying to relocate the inode table (which
+often failed because there wasn't enough space), the inodes in the bad
+block are marked as in use.
+
+E2fsck will automatically try to use the backup superblocks if the
+primary superblocks have a bad magic number or have missing meta-data
+blocks (or meta-data blocks which are out of range).
+
+E2fsck's pass 3 has been made more efficient; most noticeable on
+filesystems with a very large number of directories.
+
+Completely revamped e2fsck's system of printing problem reports.  It
+is now table driven, to make them more easily customizable and
+extendable.  Error messages which can be printed out during preen mode
+are now one line long.
+
+Fixed e2fsck's filesystem swapping code so that it won't try to swap
+fast symbolic links or deleted files.
+
+Fixed e2fsck core dumping when fixing a filesystem which has no
+directories (not even a root directory).
+
+Added a check to e2fsck to make sure that the length of every
+directory entry is a multiple of 4 (since the kernel complains if it
+isn't).
+
+Added a check to e2fsck to make sure that a directory entry isn't a
+link to the root directory, since that isn't allowed.
+
+Added a check to e2fsck to now make sure the '.' and '..' directory
+entries are null terminated, since the 2.0 kernel requires it.
+
+Added check to write_bitmaps() to make sure the superblock doesn't get
+trashed if the inode or block bitmap is marked as being block zero.
+
+Added checking of the new feature set fields in the superblock, to
+avoid dealing with new filesystem features that this package wasn't
+set up to handle.
+
+Fixed a fencepost error in ext2fs_new_block() which would occasionally
+try to allocate a block beyond the end of a filesystem.
+
+When the UUID library picks a random IEEE 802 address (because it
+can't find one from a network card), it sets the multicast bit, to
+avoid conflicting with a legitimate IEEE 802 address.
+
+Mke2fs now sets the root directory's owner to be the real uid of the
+user running mke2fs.  If the real uid is non-zero, it also sets
+the group ownership of the root directory to be the real group-id of
+the user running mke2fs.
+
+Mke2fs now has more intelligent error checking when it is given a
+non-existent device.
+
+When badblocks is given the -vv option, it now updates the block that
+it is currently testing on every block.
+
+Fixed a bug in fsck where it wouldn't modify the PATH environment
+currently correctly if PATH wasn't already set.
+
+Shared libraries now built with dependencies.  This allows the shared
+library files to be used with dlopen(); it also makes the transition
+to libc 6 easier, since ld.so can tell which libc a particular shared
+library expects to use.
+
+Programmer's notes:
+-------------------
+
+Added new abstraction (defined in dblist.c) for maintaining a list of
+blocks which belongs to directories.  This is used in e2fsck and other
+programs which need to iterate over all directories.
+
+Added new functions which test to see if a contiguous range of blocks
+(or inodes) are available.  (ext2fs_*_bitmap_range).
+
+Added new function (ext2_inode_has_valid_blocks) which returns true if
+an inode has valid blocks.  (moved from e2fsck code).
+
+Added new function (ext2fs_allocate_tables) which allocates the
+meta-data blocks as part of initializing a filesystem.  (moved from
+mke2fs code).
+
+Added a new I/O manager for testing purposes.  It will either allow a
+program to intercept I/O requests, or print debugging messages to
+trace the activity of a program using the I/O manager.
+
+The badblocks_list functions now store the bad blocks in a sorted
+order, and use a binary search to speed up badblocks_list_test.
+
+The inode scan function ext2fs_get_next_inode() may now return a soft
+error returns: MISSING_INODE_TABLE and BAD_BLOCK_IN_INODE_TABLE in
+those cases where part of an inode table is missing or there is a bad
+block in the inode table.  
+
+Added a new function (ext2fs_block_iterate2) which adds new arguments to
+the callback function to return a pointer (block and offset) to the
+reference of the block.
+
+Added new function (ext2fs_inode_scan_goto_blockgroup) which allows an
+application to jump to a particular block group while doing an inode
+scan.
+
+The badblocks list functions were renamed from badblocks_* to
+ext2fs_badblocks_*.  Backwards compatibility functions are available
+for now, but programs should be modified to use the new interface.
+
+Some of the library functions were reorganized into separate files to
+reduce the size of some programs which statically link against the
+ext2 library.
+
+Put in some miscellaneous fixes for the Alpha platform.
+
diff --git a/doc/RelNotes/v1.08.txt b/doc/RelNotes/v1.08.txt
new file mode 100644
index 0000000..f33ead5
--- /dev/null
+++ b/doc/RelNotes/v1.08.txt
@@ -0,0 +1,75 @@
+E2fsprogs 1.08 (April 10, 1997)
+===============================
+
+E2fsck 1.07 was very slow when checking very large filesystems with a
+lot of files that had hard links (i.e., news spools).  This was fixed
+by seriously revamping the icount abstraction.  Added a formal test
+suite for the icount abstraction.
+
+Debugfs now has a "-l" option to the "ls" command, which lists the
+inode number, permissions, owner, group, size, and name of the files
+in the directory.
+
+Fix a bug in e2fsck where when a directory had its blocks moved to
+another location during the pass 1b processing, the directory block
+list wasn't updated, so pass 2 wouldn't check (and correct) the
+correct directory block.
+
+E2fsck will now treat inodes which contain blocks which are claimed by
+the filesystem metadata by treating them as multiply claimed blocks.
+This way, the data in those blocks can be copied to a new block during
+the pass 1b--1d processing.
+
+E2fsck will attempt to determine the correct superblock number and
+display it in the diagnostic and warning messages if possible.
+
+Add support for a new (incompatible) feature, "sparse_super".  This
+feature reduces the number of blocks which contain copies of backup
+superblocks and block group descriptors.  (It is only an incompatible
+feature because of a bug in ext2_free_blocks.)  mke2fs and tune2fs now
+support a new -s option; e2fsck will recognize filesystems built with
+this feature turned on.
+
+E2fsck now checks the library to make sure is the correct version,
+using new library functions.  (This helps to diagnose incorrectly
+installed e2fsprogs distributions.)
+
+Dumpe2fs now prints more information; its now prints the the
+filesystem revision number, the filesystem sparse_super feature (if
+present), the block ranges for each block group, and the offset from
+the beginning of the block group.
+
+Mke2fs now distributes the inode and block bitmap blok so that the
+won't be concentrated in one or two disks in RAID/striping setups.
+Also, if the user chooses a 2k or 4k block group, mke2fs will try to
+choose the largest blocks per group that be chosen.  (For 2k blocks,
+you can have up to 16384 blocks/group; for 4k blocks, you can have up
+to 32768 blocks/group.)  Previously mke2fs would not allow
+specification of more than 8192 blocks per group, even if you were
+using a 2k or 4k block group.
+
+Programmer's notes:
+-------------------
+
+Added a new function ext2fs_create_icount2() which takes a "hint"
+argument.  This hint argument presets the icount array with the list
+of inodes which actually need to be in the icount array.  This really
+helps to speed up e2fsck.
+
+Added a new function ext2fs_icount_validate() which checks the rep
+invariant for the icount structure.  This is used mostly for testing.
+
+The error message given when a bad inode number is passed to
+test_generic_bitmap to reflect EXT2FS_TEST_ERROR (instead of
+EXT2FS_UNMARK_ERROR).
+
+Added a new function ext2fs_set_dir_block which sets the block of a
+dblist entry, given the directory inode and blockcnt.
+
+Added a new function ext2fs_get_library_version() which returns the
+current library version, and ext2fs_parse_version_string() which
+returns a version number based on a e2fsprogs version string.
+
+The icount functions will return EINVAL if the passed in inode number
+is out of bounds.
+
diff --git a/doc/RelNotes/v1.09.txt b/doc/RelNotes/v1.09.txt
new file mode 100644
index 0000000..415de75
--- /dev/null
+++ b/doc/RelNotes/v1.09.txt
@@ -0,0 +1,14 @@
+E2fsprogs 1.09 (April 14, 1997)
+===============================
+
+Fixed bug in mke2fs (really in lib/ext2fs/initialize.c) which was
+accidentally introduced in the 1.08 release.  The overhead calculation
+was accidentally removed, which caused ext2fs_initialize() to not
+notice when the filesystem size needed to be adjusted down because
+there wasn't enough space in the last block group.
+
+Fixed bug in version parsing library routine; it was always parsing
+the library version string, instead of using the passed-in string.
+
+Clarified chattr man page.
+
diff --git a/doc/RelNotes/v1.10.txt b/doc/RelNotes/v1.10.txt
new file mode 100644
index 0000000..1fa0a5e
--- /dev/null
+++ b/doc/RelNotes/v1.10.txt
@@ -0,0 +1,56 @@
+E2fsprogs 1.10 (April 24, 1997)
+===============================
+
+Mke2fs once again defaults to creating revision #0 filesystems, since
+people were complaining about breaking compatibility with 1.2 kernels.
+Warning messages were added to the mke2fs and tune2fs man pages that
+the sparse superblock option isn't supported by most kernels yet (1.2
+and 2.0 both don't support parse superblocks.)
+
+Added new flag to mke2fs, -R <raid options>, which allows the user to
+tell mke2fs about the RAID configuration of the filesystem.  Currently
+the only supported raid option is "stride" which specifies the width
+of the RAID stripe.
+
+Fixed bug in e2fsck where pass1b would bomb out if there were any
+blocks marked bad in the inode table.
+
+Fixed rare bug in mke2fs where if the user had a very unlucky number
+of blocks in a filesystem (probability less than .002) the resulting
+filesystem would be corrupt in the last block group.
+
+Fixed bug where if e2fsck tried to allocate a block to fix a
+filesystem corruption problem and the filesystem had no free blocks,
+ext2fs_new_block() would loop forever.
+
+The configure script now checks explicitly to see if "-static" works,
+since that can't be assumed to be true --- RedHat doesn't install
+libc-static by default.
+
+Fixed bug in libext2's block iterator functions where under some
+circumstances, file with holes would cause the bcount parameter to the
+callback function to be incorrect.  This bug didn't affect any of
+e2fsprogs programs, but it was discovered by Paul Mackerras, the
+author of the PPC boot loader.
+
+Removed use of static variables to store the inode cache in libext2fs.
+This caused problems if more than one filesystem was accessed via
+libext2fs (static variables in libraries are generally a bad idea).
+Again, this didn't affect e2fsprogs programs, but it was discovered by
+Paul Mackerras.
+
+Fixed minor bugs and version code drift to assure that e2fsprogs 1.10
+will compile cleanly with 1.2.13 kernels (even with a.out shared
+libraries!)
+
+Programmer's notes:
+-------------------
+
+Added new functions to duplicate an ext2 filesystem handle, and its
+associated substructure.  New functions: ext2fs_dup_handle(),
+ext2fs_copy_dblist(), ext2fs_badblocks_copy(), ext2fs_copy_bitmap().
+Other structures, such as the io_channel and the inode_cache, now have
+a ref count so that they only get freed when they are no longer used
+by any filesystem handle.  (These functions were added as part of the
+development effort for an ext2 resizer).
+
diff --git a/doc/RelNotes/v1.11.txt b/doc/RelNotes/v1.11.txt
new file mode 100644
index 0000000..33c89d5
--- /dev/null
+++ b/doc/RelNotes/v1.11.txt
@@ -0,0 +1,61 @@
+E2fsprogs 1.11 (June 17, 1997)
+==============================
+
+Fixed e2fsck to detect (previously ignored) conflicts between the
+superblock or block group descriptors and block bitmaps, inode
+bitmaps, and inode tables.
+
+Fixed bug in e2fsck so that when the message printed out when a block
+or inode bitmap conflicts with other data, it has the correct group
+number.
+
+Fixed bug in e2fsck and mke2fs where the blocksize wasn't being passed
+to badblocks.  This meant that not all of the filesystem was being
+tested for bad blocks! 
+
+Fixed an array boundary overrun case which cropped up in
+ext2fs_badblocks_list_test when a user tried running "mke2fs -c 
+-b 4096".
+
+Adjusted the number of columns printed by mke2fs when displaying the
+superblock backups to avoid running over 80 columns when making a
+really big filesystem.
+
+Fixed up the man pages for e2fsck, debugfs, badblocks, chattr,
+dumpe2fs, fsck, mke2fs, and tune2fs (typos and other minor grammar
+fixes), thanks to some suggestions from Bill Hawes (whawes@star.net).
+
+Programmer's notes:
+-------------------
+
+Fixed install rule in lib/ss so that ss_err.h is actually getting
+installed.
+
+Fixed bug in ext2fs_copy_bitmap; the destination bitmap wasn't getting
+passed back to the caller.
+
+Fixed bug in ext2fs_inode_scan_goto_blockgroup; it had not been
+setting the current inode number (which meant this function wasn't
+working at all).
+
+Fixed bug in ext2fs_resize_generic_bitmap; it had not be zeroing all
+blocks in the bitmap when increasing the size of the bitmap.
+
+Changed the initial number of blocks allocated by ext2fs_init_dblist()
+to be more realistic.
+
+Added a new function ext2fs_allocate_group_table, which sets up the
+group descriptor information (and allocates inode and block bitmaps,
+and inode tables for a particular group).  The function was created by
+factoring out code form ext2fs_allocate_tables().
+
+Added a new function ext2fs_move_blocks which takes a bitmap of the
+blocks to be moved, and moves them to another location on the
+boardboard.
+
+Make the unix_io channel's io_channel_flush implementation calls sync()
+to to flush the kernel buffers to disk.
+
+Added a new function ext2fs_dblist_count returns the number of
+directory blocks in dblist.
+
diff --git a/doc/RelNotes/v1.12.txt b/doc/RelNotes/v1.12.txt
new file mode 100644
index 0000000..9a11cd0
--- /dev/null
+++ b/doc/RelNotes/v1.12.txt
@@ -0,0 +1,153 @@
+E2fsprogs 1.12 (July 9, 1998)
+==================================
+
+E2fsprogs now works with glibc (at least with the version shipped with
+RedHat 5.0).  The ext2fs_llseek() function should now work even with
+i386 ELF shared libraries and if llseek() is not present.  We also
+explicitly do a configure test to see if (a) llseek is in libc, and
+(b) if llseek is declared in the system header files.  (See standard
+complaints about libc developers don't understand the concept of
+compatibility with previous versions of libc.)
+
+The ext2fs library now writes out the block group number in each of
+the superblock copies.  This makes it easier to automatically
+determine the starting block group of the filesystem when the block
+group information is trashed.
+
+Added support for the EXT2_FEATURE_INCOMPAT_FILETYPE feature,
+which means that e2fsprogs will ignore the high 8 bits of the
+directory entry's name_len field, so that it can be used for other
+purposes.
+
+Added support for the EXT2_FEATURE_RO_COMPAT_LARGE_FILE feature.
+E2fsprogs will now support filesystems with 64-bit sized files.
+
+Added support for the EXT2_FEATURE_COMPAT_DIR_PREALLOC feature.
+
+Added new program "e2label", contributed by Andries Brouwer.  E2label
+provides an easy-to-use interface to modify the filesystem label.
+
+Fixed bug so that lsattr -v works instead of producing a core dump.
+
+Fixed a minor bug in mke2fs so that all groups with bad superblock
+backup blocks are printed (not just the first one).
+
+Mke2fs will check the size of the device, and if the user specifies a
+filesystem size larger than the apparent size of the device it will
+print a warning message and ask if the user wants to proceed.
+
+E2fsck has a new option -C, which sends completion information to the
+specified file descriptor.  For the most part, this is intended for
+programs to use, although -C 0 will print a spinning character to the
+stdout device, which may be useful for users who want to see something
+happening while e2fsck goes about its business.
+
+Fixed a bug in e2fsck which could cause a core dump when it needs to
+expand the /lost+found directory, and sometimes the bitmaps haven't
+been merged in.  Also fixed a related bug where ext2fs_write_dir_block
+was used to write out a non-directory block.  (Which would be bad on a
+non-Intel platform with byte swapping going on.)
+
+Fixed bug in e2fsck where it would print a "programming error" message
+instead of correctly identifying where a bad block was in used when
+the bad block was in a non-primary superblock or block group
+descriptor.  Also fixed a related bug when sparse superblocks are in
+use and there is a bad block where a superblock or block group
+descriptor would have been in a group that doesn't include a
+superblock.
+
+Fixed a bug in e2fsck (really in libext2fs's dblist function) where if
+the block group descriptor table is corrupt, it was possible to try to
+allocate a huge array, fail, and then abort e2fsck.
+ext2fs_get_num_dirs() now sanity checks the block group descriptor,
+and substitutes reasonable values if the descriptors are obviously bogus.
+
+If e2fsck finds a device file which has the immutable flag set and the
+i_blocks beyond the normal device number are non-zero, e2fsck will
+offer to remove it, since it's probably caused by garbage in the inode
+table.
+
+When opening a filesystem, e2fsck specially checks for the EROFS error
+code, and prints a specific error message to the user which is more
+user friendly.
+
+If the filesystem revision is too high, change the e2fsck to print
+that this is either because e2fsck is out of date, or because the
+superblock is corrupt.  
+
+E2fsck now checks for directories that have duplicate '.' and '..'
+entries, and fixes this corruption.
+
+E2fsck no longer forces a sync of the filesystem (with attendant sleep
+calls) at all times.  The ext2fs_flush() function now performs a sync
+only if it needed to write data blocks to disk.
+
+Fixed a minor bug in e2fsck's pass1b's file cloning function, where
+certain errors would not be properly reported.
+
+Updated and expanded a few points in the man pages which users
+complained weren't explicit enough.
+
+Added special case byte-swapping code if compiling on the PowerPC, to
+accommodate the strange big-endian variant of the ext2 filesystem that
+was previously used on the PowerPC port.
+
+
+Programmer's notes:
+-------------------
+
+Removed C++ keywords from the ext2fs libraries so that it could be
+compiled with C++.
+
+E2fsck's internal organization has now been massively reorganized so
+that pass*.c don't have any printf statements.  Instead, all problems
+are reported through the fix_problem() abstraction interface.  E2fsck
+has also been revamped so that it can be called as a library from a
+application.
+
+Added new fileio primitives in libext2fs for reading and writing
+files on an unmounted ext2 filesystem.  This interface is now used by
+debugfs.
+
+Added a new libext2fs function for mapping logical block numbers of
+a file to a physical block number.
+
+Added a new libext2fs function, ext2fs_alloc_block(), which allocates
+a block, zeros it, and updates the filesystem accounting records
+appropriately.
+
+Added a new libext2fs function, ext2fs_set_bitmap_padding(), which
+sets the padding of the bitmap to be all one's.  Used by e2fsck pass 5.
+
+The libext2fs functions now use a set of memory allocation wrapper
+functions: ext2fs_get_mem, ext2fs_free_mem, and ext2fs_resize_mem,
+instead of malloc, free, and resize.  This makes it easier for us to
+be ported to strange environments where malloc, et. al. aren't
+necessarily available.
+
+Change the libext2fs function to return ext2-specific error codes
+(EXT2_DIR_EXISTS and EXT2_DB_NOT_FOUND, for example) instead of using
+and depending on the existence of system error codes (such as EEXIST
+and ENOENT).
+
+Renamed io.h to ext2_io.h to avoid collision with other OS's header
+files.
+
+Add protection against ext2_io.h and ext2fs.h being included multiple
+times.
+
+The types used for memory lengths, etc. have been made more portable.
+In general, the code has been made 16-bit safe.  Added Mark
+Habersack's contributed DOS disk i/o routines.
+
+Miscellaneous portability fixes, including not depending on char's
+being signed.
+
+The io_channel structure has a new element, app_data, which is
+initialized by the ext2fs routines to contain a copy of the filesystem
+handle.
+
+ext2fs_check_directory()'s callback function may now return the error
+EXT2_ET_CALLBACK_NOTHANDLED if it wishes ext2fs_check_directory() to
+really do the checking, despite the presence of the callback function.
+
diff --git a/doc/RelNotes/v1.13.txt b/doc/RelNotes/v1.13.txt
new file mode 100644
index 0000000..35a69e6
--- /dev/null
+++ b/doc/RelNotes/v1.13.txt
@@ -0,0 +1,64 @@
+E2fsprogs 1.13 (December 15, 1998)
+==================================
+
+Fixed a bug in debugfs where an error messages weren't getting printed
+when the ext2 library routines to read inodes returned errors in the
+stat, cmri and rm commands.
+
+Fixed a bug in mke2fs so that if a ridiculous inode ratio parameter is
+provided, it won't create an inode table smaller than the minimum
+number of inodes required for a proper ext2 filesystem.
+
+Fsck now parses the /etc/fstab file directly (instead of using
+getmntent()), so that it can distinguish between a missing pass number
+field and pass number field of zero.  This caused problems for
+diskless workstations where all of the filesystems in /etc/fstab have
+an explicit pass number of zero, and fsck could not distinguish this
+from a /etc/fstab file with missing pass numbers.
+
+E2fsck will create a /lost+found directory if there isn't one in the
+filesystem, since it's safer to create the lost+found directory before
+it's needed.
+
+Fixed e2fsck so that it would detect bogus immutable inodes which
+happen to be sockets and FIFO files, and offer to clear them.
+
+If a filesystem has multiple reasons why it needs to be checked, and
+one of the reasons is that it is uncleanly mounted, e2fsck will print
+that as the reason why the filesystem is being checked.
+
+Cleaned up the output routines of mke2fs so that it doesn't overflow
+an 80 column display when formatting really big filesystems.
+
+Added a sanity check to e2fsck to make sure that file descriptors 0,
+1, 2 are open before opening the hard disk.  This avoids a problem
+where a broken program might exec e2fsck with those file descriptors
+closed, which would cause disastrous results if the kernel returns a
+file descriptor for the block device which is also used by FILE *
+stdout.
+
+Fixed up the e2fsck progress reporting functions so that the values
+reliably reach 100% at the completion of all of the e2fsck passes.
+
+Fixed minor documentation bugs in man pages and usage messages.
+
+Programmer's notes:
+-------------------
+
+Fixed a number of lint warnings in the ext2fs library and potential
+portability problems from other OS's header files that might define
+CPP macros for names like "max" and "min".
+
+ext2fs_badblocks_list_add() has been made more efficient when it needs
+to grow the bad blocks list.
+
+Fixed a bug in e2fsck which caused it to dereference a freed pointer
+just before exiting.
+
+Fixed the substitution process for generating the mk_cmds and compile_et
+scripts so that they will work outside of the build tree.
+
+Add sanity check to e2fsck so that if an internal routine
+(ext2fs_get_dir_info) returns NULL, avoid dereferencing the pointer
+and causing a core dump.  This should never happen, but...
+
diff --git a/doc/RelNotes/v1.14.txt b/doc/RelNotes/v1.14.txt
new file mode 100644
index 0000000..1653587
--- /dev/null
+++ b/doc/RelNotes/v1.14.txt
@@ -0,0 +1,34 @@
+E2fsprogs 1.14 (January 9, 1999)
+================================
+
+Fix the fstab parsing code so that it can handle blank lines and
+comment characters.  Also, missing pass numbers need to be treated as
+zero.
+
+Fixed a bug in e2fsck where under some circumstances (when e2fsck
+needs to restart processing after fixing an egregious inconsistency)
+it would try to access already freed memory.
+
+E2fsck now prints non-printable characters in directory entries and
+pathnames using '^' and 'M-' notation.
+
+Fixed chattr so that it will ignore symbolic links when doing
+recursive descent traversals.  For both chattr and lsattr, no longer
+print the version string unless the -V option is given.
+
+Allow the system administrator to directly specify the number of
+inodes desired in the filesystem, for some special cases where this is
+necessary.
+
+Fix portability problems so that e2fsprogs can be compiled under Linux
+1.2 systems and Solaris systems.
+
+Update the config.guess file with a more recent version that will
+identify newer Linux platforms.
+
+Programmer's notes
+------------------
+
+Ext2fs_read_inode and ext2fs_write_inode will now return an error if
+an inode number of zero is passed to them.
+
diff --git a/doc/RelNotes/v1.15.txt b/doc/RelNotes/v1.15.txt
new file mode 100644
index 0000000..1b132bb
--- /dev/null
+++ b/doc/RelNotes/v1.15.txt
@@ -0,0 +1,122 @@
+E2fsprogs 1.15 (July 18, 1999)
+==============================
+
+Add configuration checks so that e2fsprogs will compile cleanly on
+Linux 2.3 kernels that have renamed i_version to i_generation.
+
+E2fsck now prints a progress/completion bar (and not just a simple
+spinner) if the -C0 option is requested or if it receives a SIGUSR1
+signal.  Fsck will automatically manage the (potentially multiple)
+e2fsck processes to print completion bars if it is given a -C option,
+with the right thing happening if multiple filesystems are being
+checked in parallel.
+
+Mke2fs now has better automatic heuristics to determine the filesystem
+parameters to be used for a particular filesystem.  Added a new option
+-T which allows the user to specify how the filesystem is to be used,
+which helps mke2fs do a better job selecting the filesystem parameters.
+
+Mke2fs now creates revision 1 filesystems by default, and with the
+sparse superblock feature enabled.  The sparse superblock feature is
+not understood by Linux 2.0 kernels, so they will only allow read-only
+mounts of filesystems with this sparse superblocks.
+
+Fix bug where if /dev/null couldn't be opened (should never happen),
+e2fsck would hang in a tight loop.
+
+Make e2fsck handle the case where /lost+found isn't a directory.
+
+E2fsck now uses mallinfo if it exists to get accurate statistics about
+its memory usage.
+
+Fix bug in e2fsck where it wouldn't check to see if a disconnected
+inode had any problems before connecting it to /lost+found.
+
+Add check to e2fsck so it makes sure that total number of inodes in
+the filesystem is a sane number.
+
+Fix fencepost error when clearing an the end of the block bitmap which
+caused the last block in the bitmap not to get cleared.
+
+Cleaned up a number of messages in e2fsck:
+	* The message "Group's #'s copy of the group descriptor..."
+		was fixed so that the correct number would be displayed.
+	* Added missing space in the "disk write-protected" error message
+	* Cleaned up the error message printed when a non-interactive
+		e2fsck needs to abort a check because the filesystem
+		appears to be mounted.
+
+Added a new command-line utility, uuidgen, which will create and print
+a UUID.
+
+Make debugfs's icheck command more robust by checking to make sure an
+inode has valid blocks before iterating over the inode's blocks.
+
+UUID generation now uses a random-based scheme whenever possible to
+prevent potential privacy problems.
+
+Man pages for all of the UUID functions in the library were added.
+
+Fixed bug in fsck so it won't coredump if a filesystem not in
+/etc/fstab is given to it.
+
+Fsck now understands the UUID=xxxx and LABEL=yyyy forms in /etc/fstab
+that most of the other mount utilities understands.
+
+Mke2fs will make a filesystem even if it appears mounted if the force
+option is given.
+
+Dumpe2fs has new command-line options which allow a filesystem expert
+to specify the superblock and blocksize when opening a filesystem.
+This is mainly useful when examining the remains of a toasted
+filesystem.
+
+The badblocks program has been updated to display correctly on disks
+with large block numbers.
+
+The badblocks program no longer gives spurious errors when errors
+occur on non-block boundaries, which is common if the blocksize is
+larger than 1k.
+
+Mke2fs will sync the disk device every MKE2FS_SYNC block groups if the
+MKE2FS_SYNC environment variable is set.  This is to work around a VM
+bug in the 2.0 kernel.  I've heard a report that a RAID user was able
+to trigger it even using a 2.2 kernel, but hopefully it will not be
+needed for most Linux 2.2 users.
+
+Fixed miscellaneous documentation and man pages.
+
+Programmer's notes:
+-------------------
+
+Cleaned up functions such as pass1_get_blocks, pass1_read_inode which
+in e2fsck's pass1.c really should have been static.
+
+The return value of the uuid_compare() function was changed to make it
+match with the conventions used by strcmp, memcmp, and Paul Leach's
+UUID sample document.
+
+The "make depend" process has now been made more automated; it now
+automatically word-wraps the dependencies, and only replaces source
+Makefile.in if there has been a change in the dependencies.  Also, a
+top-level "make depend" now recurses through all the subdirectories
+automatically.
+
+The Makefile in .../util has been changed so that subst is built using
+the native C compiler during a cross-compilation, since the subst
+program is only used during the build process.  Also add an explicit
+rule to build util/subst by cd'ing to the correct directory and
+running Makefile.
+
+The man directories are defined in terms mandir, so that the configure
+script can override the location of the manual pages.
+
+The config files have been updated to recognize new machine types for
+both the i386 and alpha families.
+
+Fsck has been modified so that it will accurately create an
+fsck_instance even when the noexecute flag is set.  This allows for
+accurate debugging of the fsck pass structure.  Also, when the verbose
+flag is given twice, fsck will print debugging information about when
+fsck is waiting for jobs to finish.
+
diff --git a/doc/RelNotes/v1.16.txt b/doc/RelNotes/v1.16.txt
new file mode 100644
index 0000000..babf0fa
--- /dev/null
+++ b/doc/RelNotes/v1.16.txt
@@ -0,0 +1,87 @@
+E2fsprogs 1.16 (October 22, 1999)
+=================================
+
+Fixed a race condition bug in fsck; when printing a progress bar, if
+checking multiple filesystems in parallel, it was possible for fsck to
+send e2fsck a SIGUSR1 signal before e2fsck had installed its signal
+handler, which would cause it to terminate with a signal 10.
+
+E2fsck now properly handles filesystems that have the
+INCOMPAT_FILETYPE feature turned on.  It can be used to convert a
+filesystem into using or not using FILETYPE feature.
+
+E2fsck now properly handles filesystems that have the IMAGIC feature
+turned on (this is used on Linux AFS servers).
+
+The mke2fs program now creates filesystems that have the filetype and
+sparse_superblock features enabled by default, unless it is run on a
+pre-2.2 kernel.  These features are not supported by a pre-2.2 kernel,
+so there is now a new flag -O which allows the user to specify with
+which features she would like to create the filesystem; "mke2fs -O
+none" will create a filesystem compatible with 2.0 kernels.
+
+The tune2fs program now has a -O option which allows the user to set
+and reset "safe" filesystem features.  Currently, the only ones which
+allows to be modified are the filetype and sparse_superblock features.
+Note setting or clearing either feature will require running e2fsck on
+the filesystem afterwards.  (n.b. Clearing the sparse_superblock feature
+requires that there is enough free space on the filesystem for the
+extra superblocks which will be created by e2fsck.)
+
+Debugfs can now set and print filesystem features in the superblock
+using the "features" command.  Dumpe2fs will print out the complete
+set of features when listing the superblock.
+
+Dumpe2fs has new options -f (force) and -h (header-only).
+
+Fixed a bug in e2fsck which could cause the PROGRAMMING ERROR/bonehead
+message to come up.  This could happen when decrementing or
+incrementing a link count could result in an overflow.
+
+Fixed a bug in e2fsck where the block count on the lost+found
+directory would not be properly incremented when the directory was
+expanded to the point where an indirect block needed to be allocated.
+
+E2fsck now makes some additional sanity checks on the superblock to
+avoid crashing or giving a memory allocation error if some of the
+values in the superblock are unreasonable (but the superblock otherwise
+looks valid).
+
+Fixed a bug in e2fsck where a very badly corrupted filesystem might
+require two passes to completely fix the filesystem.  This happened if
+an inode claimed blocks that was part of the filesystem metadata
+(typically, when garbage was written into an inode table or indirect
+block, since this kind of filesystem corruption normally doesn't
+happen otherwise).
+
+On the Alpha, glibc declares st_flags although it isn't actually used;
+the configure script was improved to detect this case so that
+e2fsprogs can avoid using the non-functional stat field.
+
+The manual pages were updated to use a more consistent formatting
+style consistent with standard Unix man pages.  Mke2fs's man page
+added documentation for a few previously undocumented options.
+
+Fixed minor display bugs in tune2fs and mke2fs.
+
+Programmer's notes:
+-------------------
+
+Improved portability of e2fsprogs to non-Unix systems (in particular, NT).
+
+Added features to parse and print feature strings into the e2p library.  
+(e2p_feature2string, e2p_string2feature, e2p_edit_feature).
+
+ext2fs_mkdir() and ext2fs_new_dir_block() now creates directories
+whose directory entries contain proper filetype information if the
+filesystem supports it.
+
+ext2fs_link() now uses the low 3 bits of its flags parameter to pass
+the directory entry filetype information.  This is used to set the
+directory entry filetype information if the filesystem supports it.
+
+Fixed a bug in ext2fs_expand_dir() where the block count in a
+directory's inode would not be properly incremented when the directory
+was expanded to the point where an indirect block needed to be
+allocated.
+
diff --git a/doc/RelNotes/v1.17.txt b/doc/RelNotes/v1.17.txt
new file mode 100644
index 0000000..21ba194
--- /dev/null
+++ b/doc/RelNotes/v1.17.txt
@@ -0,0 +1,32 @@
+E2fsprogs 1.17 (October 26, 1999)
+=================================
+
+Fixed nasty typo in fsck which caused parallelized fsck's to go into an
+infinite loop.
+
+Fixed a bug in fsck where it used strncmp to compare a binary UUID,
+thus potentially causing problems if a binary UUID contained a NULL
+character.
+
+E2fsck now uses stricter checks for directory entries in pass 2:
+zero-length filenames are not allowed; neither are 8 byte long
+directory entries.
+
+The debugfs "dirty" command now clears the filesystem valid bit.
+(Previously this just set the dirty-as-in-needs-writing-out-to-disk
+bit in the in-core superblock image.  The new functionality is more
+what the user expects, and is more useful.)
+
+Added a debugging hook to test parallel fsck; if the environment
+variable FSCK_FORCE_ALL_PARALLEL, then filesystems on the same drive
+will be checked in parallel when they normally would not be.
+
+Programmer's notes:
+-------------------
+
+Fixed some #ifdef's for compilation under the Hurd OS.
+
+Fixed minor W2K compatibility problems.
+
+Fixed some miscellaneous GCC warnings.
+
diff --git a/doc/RelNotes/v1.18.txt b/doc/RelNotes/v1.18.txt
new file mode 100644
index 0000000..17cc283
--- /dev/null
+++ b/doc/RelNotes/v1.18.txt
@@ -0,0 +1,46 @@
+E2fsprogs 1.18 (November 10, 1999)
+==================================
+
+Fix a core dumping bug in e2fsck if an imagic inode is present or
+(more rarely) if the filesystem is badly corrupted enough that e2fsck
+has to restart pass 1 processing.  E2fsck now closes the filesystem
+before freeing a large number of its data structures, so in the case
+of future memory faults, at least the fixed filesystem will be fully
+written out.
+
+If a filesystem doesn't support imagic inodes, and e2fsck discovers an
+imagic inode, it will offer to clear the imagic flag.
+
+E2fsck will now offer to clear the immutable flag on special files
+(device/socket/fifos) when running it in non-preen mode.
+
+E2fsck will now set the filetype when creating /lost+found, and when
+connected orphaned inodes to /lost+found.
+
+Debugfs's ncheck and icheck commands now handles the case where there
+are bad blocks in the inode table without bombing out.
+
+The badblocks list processing code has been made more efficiently for
+appending a large number of (ordered) badblocks to the badblocks list.
+
+Some minor man page updates.
+
+Fsck now allows interactive e2fsck's when using fsck -As (not a common
+mode, but some people like to do this in boot scripts for silly reasons).
+
+Programmer's notes:
+-------------------
+
+The internal e2fsck problem code for PR_2_SPLIT_DOT was fixed to meet
+with the problem code convention.
+
+The badblocks list regression test program has been updated to work
+with previously made API name changes.
+
+The ext2fs_free() command now uses the new badblocks API to avoid
+using the compatibility layer.
+
+Added new regression test cases; the run_e2fsck test script now
+supports the ability for a test case to run a preparatory command
+before running e2fsck.
+
diff --git a/doc/RelNotes/v1.19.txt b/doc/RelNotes/v1.19.txt
new file mode 100644
index 0000000..1b8bbc6
--- /dev/null
+++ b/doc/RelNotes/v1.19.txt
@@ -0,0 +1,180 @@
+E2fsprogs 1.19 (July 13, 2000)
+==============================
+
+Release the resize2fs program since the timeout before it could
+be released under the GPL has finally expired.
+
+Add experimental support needed for the ext2 compression patches.
+This requires compiling e2fsprogs with the --enable-compression flag
+to the configure script.
+
+Added ext3 journalling support.  E2fsck will run the journal (if
+necessary) by temporarily mounting the filesystem.  /sbin/fsck.ext3 is
+installed as a symlink to e2fsck.  Fsck has been taught about ext3,
+and treats it the same as ext2 in terms of the progress bar logic.
+Dumpe2fs will display the superblock journalling information if the
+filesystem has a journal.  The ext2 library will now permit opening an
+ext3 filesystem with the recovery flag set.  This is necessary for
+on-line dump's to work correctly, but there may be issues with this
+working well since ext3 is much less aggressive about syncing blocks to
+the filesystem, since they're safe on the journal.
+
+Tune2fs and e2fsck have been changed to allow the mount_count check to
+be disabled by setting max_mount_count to -1.  (This was already
+supported by the kernel.)
+
+Create a symbolic link for fsck.ext3, since the e2fsprogs utilities
+are used for ext3 as well.
+
+Added internationalization support for e2fsprogs; must be enabled
+by passing --enable-nls to configure.
+
+Always use the provided ext2fs header files to insulate ourselves from
+kernel version changes.  Which include files are used by e2fsprogs
+have also been cleaned up to improve portability.
+
+Limit the number of times that e2fsck updates the progress bar so that
+people who are booting using a 9600 baud console don't get swamped by
+too many updates.
+
+Improved the loop detection algorithm in e2sck's pass #3 so that it is
+much, much faster for large filesystems with a large number of
+directories.
+
+The memory footprint for e2fsck is now slightly smaller than before.
+
+E2fsck now checks if special devices have a non-zero size, and offers
+to clear the size field if it finds such an inode.  
+
+E2fsck now checks if special devices have the append-only flag set,
+and offers to clear the inode.
+
+E2fsck now properly handles some "should never fail" cases during a
+bitmap copy in pass5.
+
+E2fsck now properly prints control characters in filenames as ^A .. ^Z.
+
+E2fsck now calculates the correct location of the backup superblock in
+the case of filesystem blocksizes > 1k.
+
+Fixed a bug in e2fsck's calculation of the number of inodes_per_block
+which normally didn't cause problems under most filesystem parameters,
+but could cause a valid superblock to be rejected in extreme cases.
+Other checks for validating superblock values were made more
+stringent.
+
+Added non-destructive write testing to the badblocks program, courtesy
+of David Beattie.  The badblocks also now has an option to input the
+current set of bad blocks, so that known bad blocks are skipped to
+speed up the badblocks test.  There is also a persistent rescan
+feature which causes badblocks to run until it has completed some
+number of passes without discovering any new bad blocks.
+
+Badblocks now checks to see if the device is mounted and refuses to do
+the tests involving writing to the device if it is mounted.  Also,
+badblocks now allows the number of blocks to be checked to be
+defaulted to the size of the partition.
+
+Fixed a bug in fsck which didn't allow non-root users to be able to
+check filesystems if there were any LABEL= or UUID= entries in
+/etc/fstab.
+
+The Hurd doesn't support the filetype filesystem feature.  The mke2fs
+program now makes sure that for the Hurd, the filetype feature is
+turned off.  E2fsck will check to see if the filetype feature is
+turned on for Hurd filesystems, and offer to turn off the feature.
+
+Mke2fs now has a safety check to make sure the number of blocks do not
+exceed 32 bits even on a 64 bit platform.
+
+Really fixed a bug in fsck to allow "fsck -As" to run interactive
+fsck's.  (For those people who like to do interactive fsck's in the
+/etc/rc scripts!?!)
+
+Debugfs has a few new features: the rdump command, which will do a
+recursive dump of a directory and all of its contents, and the lcd
+command which does a local chdir (much like the ftp command of the
+same name).  In addition, the debugfs program and the open_filesystem
+command now takes three new options: -b and -s, which allows the
+blocksize and superblock location to be specified, and the -c option
+which is used in catastrophic situations where the block group
+descriptors are corrupt.  If the -c option is specified, debugfs will
+skip trying to read in the block and inode bitmaps.
+
+Debugfs's lsdel command was fixed to handle bad blocks in the inode
+table.
+
+A Y2K bug in debugfs's "ls -l" handling was fixed by switching to use
+4 digit years.
+
+General improvements in error messages
+
+  - Mke2fs prints a sane error message if the partition size is zero
+	(usually because the partition table wasn't reread by the
+	kernel due to the partition being busy), instead of "invalid
+	argument passed to ext2 library while initializing superblock".
+
+  - Fsck now prints more self-explanatory message if an invalid UUID=
+	or LABEL= specification is passed to it.
+
+UUID library changed to use the LGPL.
+
+Fixed a bug in the UUID library where very rapid calls to the
+time-based UUID generator could cause duplicate UUID's to be returned.
+This was not a problem for e2fsprogs, but it could be a problem for
+other users of the library.
+
+Make the UUID library more robust in the face of missing or an
+improper /dev/urandom or /dev/random files.
+
+Added some random portability fixes for Solaris.
+
+Some minor man page updates.
+
+Fixed a memory leak in the ss library.
+
+
+Programmer's notes:
+-------------------
+
+We now try to use lseek64 and open64 from the LFS if possible.
+
+The 3rd parameter in e2p's print_flags is now a flags word, instead of
+a boolean option.
+
+The mark and unmark bitmap functions now return the previous state of
+the bit that was being changed, which is useful for some speed
+optimizations.
+
+The following functions have been added to enhance the badblocks list
+handling in libext2fs: ext2fs_write_bb_FILE, ext2fs_read_bb_FILE2, and
+ext2fs_badblocks_equal.
+
+The ext2 header files now have the latest journalling fields to the
+superblock.
+
+The ext2fs_mkdir function in libext2fs now properly backs out of error
+conditions robustly.
+
+Cleaned up makefiles:
+  - to cleanly  compile with the -j flag.
+  - so distclean removes all generated files.
+  - so in case of an error while installing header files, the make aborts.
+
+Fix test_script so that it works correctly when compiling in the
+source directory.
+
+The random UUID generation routine has been made slightly better in
+the case where /dev/random doesn't exist.  (Use of randomly-based UUID
+is still not recommended if /dev/random doesn't exist, however; it's
+better to use the time/ethernet MAC address UUID in this case.)
+
+Clean up the build process so it's more friendly in case of missing
+directories.
+
+The ext2fs header file can now be #include'd into C++ programs.
+
+The e2p.h header file is now installed.
+
+Added workaround to a gawk 3.0.5 bug in lib/ss/mk_cmds.
+
diff --git a/doc/RelNotes/v1.20.txt b/doc/RelNotes/v1.20.txt
new file mode 100644
index 0000000..c2423ad
--- /dev/null
+++ b/doc/RelNotes/v1.20.txt
@@ -0,0 +1,206 @@
+E2fsprogs 1.20 (May 20, 2001)
+=============================
+
+Add support for replaying the ext3 journal purely in user mode,
+including handling the orphaned inode list.  Used code contributed by
+Andreas Dilger, with bug fixes and the orphaned inode handling done
+by Theodore Ts'o.
+
+The mke2fs and tune2fs programs can create or modify a filesystem to
+include an ext3 journal.  Tune2fs also can be used to remove an ext3
+journal from a filesystem.
+
+E2fsck will now check for the existence of a linked list of orphan
+inodes in the superblock, and clear those inodes before starting the
+rest of the filesystem check (but after the journal playback).
+
+E2fsck now validates the file descriptor passed to the -C option,
+which saves against the completion bar getting written to an
+unexpected location, such as the disk being checked.  (Debian
+bug/wishlist #55220)
+
+E2fsck will now bump the filesystem revision number from zero to one
+if any of the compatibility bits are set.
+
+Fixed a bug where a badly corrupted directory on a big endian system
+could cause e2fsck to die with a bus error.  The
+ext2fs_read_dir_block() and ext2fs_process_dir_block() functions in
+the ext2 library now does alignment sanity checks on the rec_len field
+of the directory entry before using it.
+
+The ext2 library has been enhanced to make tune2fs safe to run on
+mounted filesystems.  (Users could usually get away with using tune2fs
+on mounted filesystems before, but with the advent of ext3 and
+journalling, it became important to make tune2fs was *really* safe for
+use even when the filesystem being modified is mounted.)  E2label is
+now implemented by tune2fs using an argv[0] dispatch, so that e2label
+is also now safe for use on mounted filesystems.
+
+Added a new program, e2image, which creates a backup of critical ext2
+filesystem data structures.  The generated image file can be examined
+using dumpe2fs and debugfs.  In the future, e2fsck will be able to use
+the image file to help recover very badly damaged filesystems.
+
+Fixed a number of LFS bugs in e2fsck; very, very large (> 2**42) files
+no longer cause e2fsck to bomb out.  Also treat files > 2GB as being
+large file when deciding whether or not the filesystem has large files.
+
+Fixed lsattr and chattr so that they work correctly on large files.
+(Fixes Debian bug #72690.)
+
+Removed limitation in get_device_size() which imposed a one terabyte
+filesystem limitation.  (Most 2.2 kernels still have a signed int
+problem which cause 1 TB block device limitation.  Fortunately, the
+kernel patches to fix this are much easier than fixing the 2TB
+limitation in the kernel.  :-)
+
+A max_mount_count of zero is now treated as if no mount count were
+set.  (Previously, no mount count was indicated by using -1, and a
+mount count of zero caused e2fsck to always be run.)
+
+Mke2fs supports two new filesystem types largefile and largefile4.
+
+Mke2fs now adds some randomness in s_max_mount_count so that multiple
+filesystems won't be all checked at the same time under normal
+operations.
+
+Fixed bug in the progress bar printing code which could cause e2fsck
+to core dump on an illegal filesystem.
+
+Fixed bug in fsck which could allow more than one instance of e2fsck
+to be printing a progress bar.  (Debian bug #65267)
+
+Fsck using a UUID or a LABEL specifier will work even if devfs is
+compiled into the kernel and not mounted.  If the pathnames in
+/proc/partitions are incorrect, fsck will search /dev for the correct
+device (using the new ext2fs_find_block_device library function).
+Fsck now also checks the RAID devices first so that they are properly
+found when they are in use.  Support has also been added to support
+additional IDE disks and the DAC 960 device names.  (Debian bug #94159)
+
+Fixed a bug in fsck which caused it not deal properly with 16
+byte long filesystem labels.
+
+Fsck's -t option has been made a lot more flexible.  The semantics for
+what happens if a comma-separated list to fsck has been regularized,
+and it is now possible to filter what filesystems will get checked
+based what is in the filesystem's fstab entry's option field.  (Debian
+bug #89483.)
+
+The dumpe2fs program can now print out the group description
+information in hex, and also prints the location of the superblock and
+block group descriptor for those block groups that have them.
+
+Mke2fs now clears the ext2 superblock before it starts creating a
+filesystem, so that the superblock magic number is only written if the
+filesystem creation process successfully completes.
+
+The debugfs program's stat command now pretty-prints the blocks used
+by an inode so that it's more compact and informative.
+
+The debugfs stats command now uses the same libe2p code (which is used
+by dumpe2fs) to print the superblock header information.  This is more
+complete, and it avoids a bit of code duplication.
+
+Added a new debugfs command, set_super_value (ssv) which allows the
+user to set arbitrary superblock fields.
+
+Debugfs was extended to support inode numbers in hex (by prefixing
+them with 0x), and so that modify_inode can set the inode generation
+number.  Also, there is now a new function command called logdump
+which will dump an ext3 journal.
+
+Fixed a bug in debugfs so that quitting out of the pager doesn't kill
+debugfs.
+
+Debugfs's dump command now stops immediately upon reporting a disk
+read error.  (Fixed a bug in ext2fs_file_read library routine which
+caused debugfs not to stop.)  (Debian bug #79163)
+
+On systems with /proc/mounts (mainly Linux systems), /proc/mounts is
+checked before /etc/mtab is used, since /proc/mounts is more likely to
+be accurate.
+
+Added portability fixes for Solaris and Linux/ia64.
+
+Various manual pages were clarified and cleaned up.  (Fixed debian
+bugs #63442, #67446, and #87216)
+
+
+Programmer's notes:
+-------------------
+
+The e2fsck message printer now supports %Iu and %Ig, which will print
+out the inode's user and group owners, respectively.
+
+E2fsprogs now includes its own version of include/linux/ext2_fs.h, so
+that no longer dependent on the system having the correct version of
+the kernel header files.
+
+Added a new function to libext2, ext2fs_find_block_device(), which
+searches the system (i.e., /dev, /devfs, /devices) for a pathname to a
+device given its device number.
+
+Added a new function to libext2, ext2fs_sync_device, which centralizes
+all of the places which might try to use the BLKFLSBUF or FDFLUSH
+ioctls (and usually failing to define them since the system header
+files don't usually do this for us, and we're trying to avoid usage of
+kernel include files now).
+
+Added new utility programs in tests/progs: random_exercise and
+hold_inode.  They aren't built by default; they're useful for
+exercising ext3 filesystem code.
+
+Added a new ext2 filesystem flag, EXT2_FLAG_SUPER_ONLY, which causes
+the filesystem close functions to only update the superblock, and to
+not touch the block group descriptors.  Needed by tune2fs when
+modifying a mounted filesystem.
+
+Got rid of struct ext2fs_sb and replaced it with the standard struct
+ext2_super_block from include/linux/ext2_fs.h.  Note: this may break
+source (but not binary) compatibility of some users of the ext2
+library.  Those applications should just simply do a global search and
+replace of struct ext2fs_sb with struct ext2_super_block, and include
+the new header file <ext2fs/ext2_fs.h> which defines it.
+
+The ino_t type has been renamed ext2_ino_t to protect applications
+that attempt to compile -D_FILE_OFFSET_BITS=64, since this
+inexplicably changes ino_t(!?).  So we use ext2_ino_t to avoid an
+unexpected ABI change.
+
+The Makefiles have been reworked so that "make check" can be run from
+the top-level Makefile.
+
+Fix general gcc -Wall complaints and removed dead code.
+
+Remove use of NOARGS, because we assume everyone does ANSI C these
+days.
+
+Added build-rpm script from sct.
+
+New functions ext2fs_image_{inode,super,bitmap}_{read,write} added 
+to support e2image.
+
+New function ext2fs_flush_icache which must be called if the
+application program modifies the inode table blocks without going
+through ext2fs_write_inode() interface.
+
+New ext2fs_check_mount_point() function, which will return the mount
+point of a device if mounted.
+
+The io_channel abstraction now has an optional interface,
+io_channel_write_range, which allows specific byte ranges to be
+written.  
+
+The unix_io IO channel now supports write-through caching, so that
+journal creation is more efficient.
+
+Added x86 assembly language routines to support byte swapping, to
+reduce executable size.
+
+Fixed bug in the utility program subst so that it's possible to
+replace a substitution variable with a zero-length string.
+
+Fixed numbering e2fsck pass1 problem numbers; an extra zero had
+slipped into some of the problem number.
+
diff --git a/doc/RelNotes/v1.21.txt b/doc/RelNotes/v1.21.txt
new file mode 100644
index 0000000..c0a56e3
--- /dev/null
+++ b/doc/RelNotes/v1.21.txt
@@ -0,0 +1,119 @@
+E2fsprogs 1.21 (June 15, 2001)
+==============================
+
+Added new configure flags which allow a subset e2fsprogs to be built;
+this is most useful for boot floppies, since the resulting shared
+libraries and programs are slimmed down by removing features that
+aren't necessary for a boot floppy.  The new flags that were added
+are: --disable-swapfs, which removes support for byte swapping old
+legacy PPC/68k filesystems, --disable-debugfs, which removes support
+for debugfs from the libext2fs library, --disable-imager, which
+removes support for the e2image program, and --disable-resizer, which
+removes support for resize2fs.
+
+E2fsck now prints the number of mounts or days elapsed since the last
+check when e2fsck is forced to check an otherwise clean filesystem.
+
+Tune2fs now prints an informative message about how often a filesystem
+will be checked when adding a journal to the filesystem, to remind the
+user that he/she may want to adjust those parameters using tune2fs
+-c/-i.
+
+Worked around hurd brain-damage which causes e2fsck to sometimes
+believe a filesystem is the root filesystem based on device numbers
+(since Hurd doesn't have dev_t's, which is arguably a POSIX.1
+violation).
+
+Fixed a bug introduced in 1.20 which caused e2fsck to abort with an
+erroneous error with the -F option was specified.
+
+Fixed a ext3 recovery bug in the revoke handling; synchronized with
+ext3 0.7a.
+
+Fixed two bugs in e2fsck's handling of dup block handling, dealing
+with relatively uncommon edge cases: a directory with an indirect
+block which is claimed by another file, and when the last inode in the
+filesystem has blocks claimed by another file.
+
+E2fsck now checks to see if the i_size field of a fast symlink is too
+big, and offers to clear the symlink if so.
+
+E2fsck now checks to see if i_size_high of special files is non-zero,
+and offers to clear i_size_high.
+
+Fix e2fsck's handling of incompatible journal flags so that the user
+has chance to abort, and then has the option to clear out the journal
+entirely.  (Addresses Debian bug #98527.)
+
+Fixed a bug in fsck which could cause it to core dump if a mix of
+standard and non-standard device names are used in /etc/fstab.
+(Debian bug #100559)
+
+Fixed a bug in debugfs which caused read errors when copying a file to
+not be noticed.
+
+The debugfs set_super_value command can now modify the s_lastcheck field.
+
+Fixed a bug in lsattr and chattr which was accidentally introduced in
+1.20 to support > 2GB files; both lsattr and chattr wasn't reading
+directories correctly because the change modified the layout of struct
+dirent to be incompatible with the libe2p shared library.
+
+Cleaned up the mke2fs manual page and included a discussion about why
+it's good to periodically check the filesystem even when journalling is
+enabled.
+
+Programmer's notes:
+-------------------
+
+Fix general gcc -Wall complaints.
+
+The types needed by the ext2 header files are now provided by
+lib/ext2fs/ext2_types.h, instead of include/asm/types.h.
+
+Integers are now preferred to longs when trying to find a 32-bit type
+in ext2_types.h.  Also, if linux/types.h has already been defined,
+don't try to redefine the types.
+
+Fixed make depend script so that it automatically corrects the
+pathname cleanups performed by make -M, so I don't have to fix them up
+by hand.
+
+Fixed the d_loaddump test case to be more robust, and not depend on
+bash'isms.
+
+Removed debugfs's dependence on pread(), which was accidentally
+introduced in e2fsprogs 1.20
+
+Fixed a performance bug in the libext2fs's icount routine; the size
+estimate of the icount array was incorrectly being calculated.
+
+Removed use of the badblocks compatibility functions in the e2fsprogs
+programs.
+
+Added paranoia code which protects against strange cases where /etc
+isn't on the root filesystem, or if /etc/mtab doesn't exist.
+
+The header file ext2_types.h is now installed.
+
+Autoconf is used to determine when we are on big-endian machines,
+instead of doing run-time tests, to save a few bytes of code.
+
+The ext2fs_mark_generic_bitmap and ext2fs_unmark_generic_bitmap
+functions are no longer inline functions, which saves space and
+doesn't really cost any real performance.
+
+The ext2fs library no longer depends on the e2p library.  (What need
+there was of it --- namely, fsetflags, was coded in-line).
+
+Fixed the makefile so that lib/ext2fs/ext2_types.h is generated even
+when the user is stupid and tries compiling the package using "make
+install" as root.
+
+Miscellaneous code cleanups:
+	* Added missing files from Makefile.in's SRCS file, so that 
+		their dependencies would be properly calculated.
+	* Removed redundant code
+	* Fixed comments in code
+	* Removed no-longer needed argsused #pragma.
+
diff --git a/doc/RelNotes/v1.22.txt b/doc/RelNotes/v1.22.txt
new file mode 100644
index 0000000..204a0c5
--- /dev/null
+++ b/doc/RelNotes/v1.22.txt
@@ -0,0 +1,31 @@
+E2fsprogs 1.22 (June 22, 2001)
+==============================
+
+Fixed a bug in e2fsck's handling of orphan inodes which are special
+files (i.e., block/character device files, named FIFO's, etc.).
+
+Fixed a bug accidentally introduced in e2fsprogs 1.21 which caused
+tune2fs to fail at adding a journal to a mounted filesystem.
+
+Fixed a few big-endian bugs in e2fsprogs
+	* The directory block functions were accidentally reporting
+		some directories as corrupted when they weren't.
+	* If e2fsprogs is compiled --disable-swapfs, the C language 
+		equivalents weren't being included for big-endian platforms.
+		(Fixes Debian bug #101686).
+
+Fixed a Hurd compilation problem.  (Addresses Debian bug #101361)
+
+Programmer's notes:
+-------------------
+
+Use platform independent method of defining the BLKFLSBUF and FDFLUSH
+ioctls, and allow them to be defined for non-i386 platforms.
+
+The uuid.h header file is now protected against multiple inclusions.
+
+E2fsprogs is now being developed using BitKeeper.  Changed the test
+scripts to deal with BK's stripping CR characters from text files,
+and changed the top-level Makefile.in to avoid including BitKeeper
+files when generating the source tarball.
+
diff --git a/doc/RelNotes/v1.23.txt b/doc/RelNotes/v1.23.txt
new file mode 100644
index 0000000..c62b6f2
--- /dev/null
+++ b/doc/RelNotes/v1.23.txt
@@ -0,0 +1,65 @@
+E2fsprogs 1.23 (August 15, 2001)
+================================
+
+Add initial support for extended attributes (EA); e2fsck will
+correctly handle a filesystem with EA's and check the EA blocks for
+corruptions.
+
+E2fsck's symlink sanity checking has been cleaned up.  It now checks
+the i_size value of fast symlinks, and checks for immutable flags
+being set of symlinks, etc.
+
+E2fsck now offers to clear inodes which are special files that have a
+non-zero i_blocks or i_size field.  (The i_size field check was in the
+previous version of the code, but due to a bug it didn't offer to
+clear the inode unless i_size and i_size_high were both non-zero.)
+
+E2image can now create "raw" image files, which only contain the
+filesystem metadata placed in a spare file so that e2fsck, dumpe2fs,
+debugfs, etc., can be run directly on the raw image file.
+
+Add support for the 64-bit block device patches.
+
+Fixed bugs in creating external journals with a 1k blocksize.
+
+Add initial support for external journals (so long as the external
+journal only supports a single filesystem) in e2fsck.
+
+Remove requirement for needing to run fsck on a filesystem after
+removing a journal (either internal or external).
+
+The man pages now document how to create and manage external journals.
+
+Speed up the check of an ext3 filesystems by avoiding a needless flush
+of all of the superblock and block group descriptors.
+
+Speed up creating an internal journal using tune2fs in the case where
+the filesystem has a lot blocks already allocated.
+
+Tune2fs has been fixed to make sure that only error messages go to
+stderr, and normal message go to stdout. (Addresses Debian bug #108555)
+
+Fixed a minor bug in mke2fs; if -O none is passed to mke2fs, it will
+now not set the sparse_super feature.  (Addresses Debian bug #108165)
+
+Add support in fsck for the filesystem type "auto".
+
+Fsck -A will not try to interpret device names for filesystems which
+have a pass number is 0.  (Addresses Debian bug #106696).
+
+Fsck prints a warning message if now valid filesystems are passed to
+it.  (Addresses Debian Bug #107458.)
+
+E2fsck now gives an explicit warning if there filesystem still has
+errors at the end of the run. (Addresses Debian bug #104502)
+
+E2fsck will set the EXT2_ERROR_FS flag if the journal superblock
+reflects an error.  E2fsck will also not run the orphan list if the
+filesystem contains errors, since the orphan list might be corrupted.
+
+E2fsck now prints the number of large files when given the -v option.
+
+Fixed minor memory leaks in e2fsck.
+
+Some minor man pages updates. (Addresses Debian bug #30833, #108174)
+
diff --git a/doc/RelNotes/v1.24.txt b/doc/RelNotes/v1.24.txt
new file mode 100644
index 0000000..f8fd56c
--- /dev/null
+++ b/doc/RelNotes/v1.24.txt
@@ -0,0 +1,38 @@
+E2fsprogs 1.24a (September 2, 2001)
+===================================
+
+Fix brown-paper bug in mke2fs which caused it to segfault when
+printing the version string.
+
+
+E2fsprogs 1.24 (August 30, 2001)
+================================
+
+Revert the BLKGETSIZE64 support, since for some distributions, this
+ioctl has been used by an unofficial kernel patch to update the last
+sector on the disk, and this was causing disk corruption problems as a
+result.
+
+Mke2fs is now more careful about zapping swap space signatures and
+other filesystem/raid superblock magic values so that programs like
+mount who try to use heuristics to determine the filesystem type of a
+partition are less likely to be confused.
+
+E2fsck will no longer complain if the the mode of EXT2_RESIZE_INO is a
+regular file (since Andreas Dilger's on-line resizing tools will set
+its mode bits).
+
+Fixed some minor texinfo, man pages nits for spelling errors,
+texinfo warnings, etc.  (Addresses Debian bug #110621.)
+
+E2fsprogs program no longer print the filesystem version number
+(i.e. 0.5b), since it only confuses people and doesn't serve any real
+purpose.
+
+E2fsck will once again compile under libc5, since it will supply its
+own version of strnlen if necessary.
+
+mke2fs and tune2fs will allow the use of UUID= or LABEL= specifiers
+when specifying the external journal device.  tune2fs will also search
+devices looking for the external journal device when removing it.
+
diff --git a/doc/RelNotes/v1.25.txt b/doc/RelNotes/v1.25.txt
new file mode 100644
index 0000000..2f3be23
--- /dev/null
+++ b/doc/RelNotes/v1.25.txt
@@ -0,0 +1,46 @@
+E2fsprogs 1.25 (September 20, 2001)
+===================================
+
+This is primarily a bug-fix release; no new features were added, but
+there are a number of embarrassing bug fixes and cleanups applied.
+
+Fix a bug mke2fs which causes stack garbage to be written to disk when
+zapping disk sectors.  (This bug could cause mke2fs to core dump for
+some kernels, I suspect with security enhancement patches.)
+
+Remove unneeded #include of <linux/config.h> which was breaking
+building e2fsprogs on the Hurd.  (Addresses Debian bug #112414.)
+
+Updated tune2fs man page to reflect the fact that adding or removing a
+journal doesn't require running e2fsck.
+
+Remove use of AC_REQUIRE from autoconf which had been used to prevent
+AC_CANONICAL_HOST from being called twice; unfortunately this causes
+recent autoconf to bomb out since they don't allow AC_REQUIRE to be
+used outside of autoconf macros.  Fortunately, it doesn't seem to be
+necessary any more, anyway.
+
+E2fsck will now not fall back to an alternate superblock if the user
+specifies the superblock location explicitly on the command-line.
+This allows easier recovery from a situation where the primary
+superblock and block groups are slightly corrupted, but the backup
+superblocks are completely broken.  
+
+Fix problem which caused compile_et and mk_cmds to blow up if
+e2fsprogs was in a directory with a pathname that contained spaces.
+
+We are now more paranoid about checking the entry in /etc/mtab to make
+sure the filesystem is really mounted, since some broken distributions
+(read: Slackware) don't initialize /etc/mtab before checking non-root
+filesystems.  (Slackware also doesn't check the root filesystem
+separately, and reboot if the root filesystem had changes applied to
+it, which is dangerous and broken, but there's nothing I can do about
+that.)
+
+Make UUID library C++ friendly by adding appropriate extern "C"
+declarations and using const in the function declarations.
+
+Fix up the com_err texinfo file so that it can product a valid info
+file (previously, it could only be used to generate paper
+documentation using texinfo.tex).
+
diff --git a/doc/RelNotes/v1.26.txt b/doc/RelNotes/v1.26.txt
new file mode 100644
index 0000000..0c4609c
--- /dev/null
+++ b/doc/RelNotes/v1.26.txt
@@ -0,0 +1,164 @@
+E2fsprogs 1.26 (February 3, 2002)
+=================================
+
+Dumpe2fs will keep going now if the bad block inode can't be read.
+(Previously it stopped with a fatal error.)
+
+E2fsck will now give an opportunity to run the journal even if the
+recovery flag is not set.  This is the default behaviour if e2fsck is
+using a backup superblock, since the needs_recovery flag will never be
+set in the backup superblock copies.
+
+E2fsck now automatically finds the backup superblock/group descriptors
+even when the primary superblock is completely destroyed for 2k and 4k
+filesystems.  (Previously it just guessed/assumed that we were dealing
+with a 1k filesystem in that case, and users had to manually specify
+the backup superblock number.)
+
+Fixed a bug in e2fsck where it dereferences a null pointer when there
+is a problem opening a filesystem in preen mode.
+
+E2fsck now handles external journals correctly; previously it trashed
+the external journal device if the journal needed to be replayed.
+
+Work around ulimit incompatibility problem caused by recent 2.4
+kernels; the unix IO module will automatically try to set any resource
+limits to be infinite on startup.
+
+Fixed a bug in e2fsck where it wasn't allocating a new block or inode
+bitmap if it wasn't present and the blocksize was 2k or 4k.
+ (Addresses Debian Bug #116975)
+
+E2fsck will check and fix botched ext3 V1 to V2 superblock updates by
+clearing the new V2 fields if they do not make sense or if the ext3
+superblock is version 1 superblock.
+
+E2fsck will automatically relocate the ext3 journal from a visible
+file (i.e., /.journal) to an hidden inode if the filesystem has been
+opened read/write.  This allows the users to add a journal while the
+filesystem is mounted, but the next time the system is rebooted, the
+journal file will disappear.  This avoids problems with backups,
+stupid operators with superuser bits, etc.
+
+Fix a bug in fsck where it would not support a filesystem type of
+"auto" if the device was specified in terms of LABEL=xxx or UUID=xxx.
+
+Fsck now supports fstab entries of the form "ext3,ext2".  It will also
+automatically identify reiserfs filesystems.
+
+The number of processes spawned by fsck can now be limited using the
+FSCK_MAX_INST environment variable.
+
+Fsck now searches the LVM proc hierarchy to find logical volumes which
+should be searched for  UUID and label information.
+
+Work around a bug in 2.4.10+ kernels by trying to unset the filesize
+limit if at all possible, when opening a block device.  (The filesize
+limit shouldn't be applied against writes to a block device.)
+
+In mke2fs and e2fsck, specifying the -c option twice will now do
+a read/write test on the disk.  Update the man pages to encourage
+using the -c option, and to discouraging running badblocks separately,
+since users tend to forget to set the blocksize when running 
+badblocks.
+
+Mke2fs now automatically clears the immutable attribute on a
+pre-existing .journal file left over from a previous failed attempt to
+add a journal to an already-mounted filesystem.
+
+Fixed mke2fs's exit codes to consistently indicate when the mke2fs
+operation failed.
+
+Mke2fs now creates the lost+found directory with permissions of 0700,
+so that files that had previously lived in protected directory are
+safe if they get dropped in lost+found and the system administrator
+doesn't deal with immediately.  (Addresses Debian #bug 118443)
+
+Mke2fs and e2fsck (and all programs that use the
+ext2fs_check_if_mounted function) will now properly identify that a
+device is mounted, even in cases where devfs has confused things with
+multiple devices names with the same identity, or if a dim-witted
+system administrator has done something stupid like creating device
+file aliases in their home directory.  Also now checks for swap devices
+by using /proc/swaps.  (Addresses Debian bug #106622)
+
+Added a new option (-T) to tune2fs which sets the time a filesystem
+was last checked.
+
+Speed up e2image when creating sparse raw image files by optimizing
+away excess lseek() system calls.
+
+Fix support of large (> 2GB) files when used as a filesystem in
+mke2fs, tune2fs, debugfs, and findsuper.
+
+Debugfs's stat and icheck commands now properly deals with large (>
+2GB) files.
+
+Debugfs's set_super_value command now prints out the list of valid
+superblock fields which can be set using the command.
+
+Debugfs's rm and kill_file command now updates the superblock free block
+and inode counts, thus keeping the filesystem consistent.
+
+Debugfs's lsdel command now takes an optional argument which allows
+the user to only see the most recently deleted files.
+
+A new command (undel) was added to debugfs which automates
+undeleting a deleted inode and linking it back to a directory.
+
+Debugfs's ls command now takes a new option, -d, which lists 
+deleted directory entries.
+
+Debugfs's testb, freeb, setb, and find_free_block commands now take an
+optional count argument.
+
+Add support for a new ext2 file attribute, EXT2_NOTAIL_FL, which will
+be used to signal that a particular inode should not be eligible for
+tail-merging --- this is needed for programs like LILO.
+
+The findsuper (an unreleased, uninstalled utility program) has been
+improved to add extra validity checks and to add a progress meter.
+(It is still an unsupported program; the officially supported way to
+recover from a trashed partition table is to use gpart; findsuper is
+for wizards only.  :-)
+
+Debugfs was fixed to compile with "configure --disable-swapfs".
+
+Cleaned up various manual pages.   (Addresses Debian bug #119624, #120171)
+
+Added new translation file for Turkish.
+
+Programmer's notes:
+-------------------
+
+Fix general gcc -Wall complaints.
+
+E2fsprogs (mostly) works with the dietlibc.
+
+The programming texinfo file has been expanded to include description
+of additional libext2fs functions.  (Still not completely done, but a
+lot of the more important functions have been documented.)
+
+Added a umask structure to struct_ext2_filsys, which currently only
+modifies the behaviour of ext2fs_mkdir(), but if we add any file
+creation functions to libext2fs, we should also make sure they respect
+the umask setting.
+
+The build-rpm script was fixed to be a bit more safe.
+
+The tests' Makefile now has a way of automating test case creation 
+for e2fsck, using "make testnew".
+
+Created a new function, ext2fs_dir_iterate2 which passes more
+information to the callback function (identical to the one used by
+ext2fs_dblist_dir_iterate).  The directory iterator functions take a
+new flag, DIRENT_FLAG_INCLUDE_REMOVED, which will return deleted
+directory entries.  If the directory entry is deleted, the callback
+function will be called with the entry parameter set to
+DIRENT_DELETED_FILE.
+  
+Added new functions, ext2fs_inode_alloc_stats and
+ext2fs_block_alloc_stats, which takes updates block/inode allocation
+statistics in the bitmaps, block group descriptors, and superblock
+when inodes or blocks are allocated or deallocated.
+
diff --git a/doc/RelNotes/v1.27.txt b/doc/RelNotes/v1.27.txt
new file mode 100644
index 0000000..fc302af
--- /dev/null
+++ b/doc/RelNotes/v1.27.txt
@@ -0,0 +1,60 @@
+E2fsprogs 1.27 (March 8, 2002)
+==============================
+
+The warning messages for mke2fs now go to standard error.
+
+Fixed to make sure "make check" runs all of the test programs with
+LD_LIBRARY_PATH set, so that we test the libraries in the build tree.
+
+The mke2fs program checks the boot sector for the BSD disk label, and
+avoids erasing it if it is there.
+
+Fixed a bug in e2fsck which caused it to core dump if the journal
+inode was missing when it was supposed to be there.
+
+E2fsck now prints ranges in pass 5 when printing deltas for the block
+and inode bitmaps.
+
+Debugfs's "ls -l" command now will print out the file type information
+in the directory entry.
+
+Create man pages and hard links for fsck.ext3 and mkfs.ext3.  If
+mke2fs is invoked as mkfs.ext3, create the filesystem with a journal.
+
+Debugfs can now examine the experimental directory indexing
+information.
+
+Fixed bug in debugfs which caused it to core dump if modify_inode is
+called without an open filesystem.
+
+The debugfs lsdel command now runs its output through a pager first.
+
+When installing manual pages, remove the compressed manual pages first.
+
+Synchronized with Debian's packaging information for e2fsprogs-1.26-1.
+
+Fix the 2.4 resource limitation workaround introduced in 1.26 which
+actually broke things on mips32, sparc32, and Alpha platforms.
+
+Updated the I18N code so that calls to setlocate(LC_CTYPE, 0) are made
+(which is required by the newer libintl libraries).
+
+Programmer's notes:
+-------------------
+
+Fixed various gcc -Wall complaints.
+
+Fixed a few memory leaks in the e2fsck journalling code, and in the
+ismounted code checking for a swap device.
+
+Add new inode I/O abstraction interface which exports an inode as
+an I/O object.
+  
+Exported ext2_file_flush as a public interface.
+  
+In ext2_file_write, we now mark the buffer void * argument as a const, since ext2_file_write doesn't modify the buffer.
+
+Lots of small random portability fixes to make e2fsprogs build under
+AIX --- even without the 5L compatibility toolkit, and even using the
+uber-crippled AIX native C compiler.
+
diff --git a/doc/RelNotes/v1.28.txt b/doc/RelNotes/v1.28.txt
new file mode 100644
index 0000000..4463996
--- /dev/null
+++ b/doc/RelNotes/v1.28.txt
@@ -0,0 +1,146 @@
+E2fsprogs 1.28 (August 31, 2002)
+================================
+
+Add support for the Hashed-Tree Directory Indexing to e2fsck.  Support
+for setting the htree flag is not included yet, although it can be
+manually turned on via the debugfs program.
+
+Clarified e2fsck error message which is printed when it cannot find
+sufficient contiguous block when relocating filesystem metadata.
+
+Added support for building an EVMS plugin module for ext2/3.  This
+module is substantially the same as the EVMS module shipping with EVMS
+1.1, with one or two bugfixes.  E2fsprogs can also build this plugin
+for use with EVMS 1.0 (which did not include the ext2 plugin module),
+if the configure --enable-old-evms flag is given.
+
+Fsck will search through EVMS volumes when trying to resolve
+filesystem specifications such as LABEL=xxx or UUID=xxx.
+  
+Added a new utility program, /sbin/findfs, which will return
+filesystem specifications such as LABEL=xxx or UUID=xxx, and prints
+the device name.
+
+Update and clarified various man pages. (addresses Debian Bug #145044,
+#146437, #131350, #151990, #144621, #141938)
+
+If there are no filesystems specified on fsck's command line, fsck now
+treat that as if the -As options were given.  Previously it would
+simply do nothing.  (Addresses Debian Bug #153102)
+
+Mke2fs no longer treats a failure to be able to clear the MD signature
+at the end of the filesystem as a fatal error.  (Addresses Debian Bug
+#155007)
+
+The e2p library functions (which are used by lsattr and chattr) now
+double check to make sure the file is a regular file or directory
+before attempting to use the ext2 ioctls.  Some device drivers
+unfortunately respond to the ext2 ioctl's with unknown behaviour.
+(Addresses Debian Bug #152029).
+
+The extended attribute handling has been updated to correspond with
+the latest V2 bestbits ACL code.
+
+Fixed bug in e2fsck which caused it to not clear the dtime field when
+processing truncated inodes on the orphan list.  This could cause data
+loss(!) if a filesystem is rebooted before a truncate has been
+committed.
+
+E2fsck now uses red/black trees in pass1b, which removes some O(n**2)
+algorithms.  This makes e2fsck much faster in the case of severely
+corrupted filesystems where a large number of blocks are claimed by a
+large number of inodes.  (Thanks to the 2.5 IDE device driver for
+inspiring this work.)
+
+Resize2fs has been significantly sped up when shrinking and expanding
+a filesystem by a very small number of blocks (for example, when EVMS
+is converting a partition to be an EVMS legacy volume).
+
+Added a new option to e2fsck, -D, which will optimize or compress all
+of the directories in the filesystem.
+
+E2fsck now catches SIGINT and SIGTERM to make sure it will can
+properly clean up and only exit at safe points.  Fsck will pass
+SIGINT/SIGTERM to its child processes, and wait until they have all
+exited before it exits.
+
+The uuid parsing code in the uuid library now properly complains when
+an illegally formatted uuid is presented to it.  (Addresses Debian bug
+#152891)
+
+Restrict use of the 2.4 setrlimit ABI f*ckup to kernels between 2.4.10
+and 2.4.17, since the workaround can cause problems when using a 2.4
+kernel with an old version of glibc built with the 2.2 headers.
+
+Fixed a bug in mke2fs where it wasn't properly clearing the initial
+superblock used by other filesystems.  (Addresses Debian bug #147256.)
+
+Added support for the synchronous directory feature written by Andrew
+Morton.
+
+The debugfs program can delete directories using the rmdir command.
+
+Add support for 8k and 16k filesystems (for systems with page sizes
+that are greater or equal to 8k or 16k, respectively).  Note that
+these filesystems can not be mounted on x86 systems, or other systems
+with only 4k page sizes, due to limitations in the current Linux VM
+code.
+
+Resize2fs requires that the filesystem state be valid and have no
+errors; otherwise, e2fsck -f must be run first.  (Previously it simply
+required that the last fsck time be greater than the last mount time.)
+
+Configure now defaults the man pages directory to /usr/share/man on
+Linux systems.
+
+E2fsck now offers to truncate inodes which contain too many blocks (so
+that i_blocks would overflow.  Also fixed handling of large sparse
+files.
+
+E2fsck now more completely checks for symlink validity, including
+requiring NULL termination and length checks.
+
+E2fsck will offer to try forcing a disk write to remap a bad block
+after finding a read error when reading a filesystem metadata block.
+
+Fixed a bug in debugfs which caused the -b and -s options to crash
+debugfs, as well as breaking the testb, setb, and clearb functions.
+
+Added a bmap command to debugfs which calculates the logical to
+physical block mapping for a particular inode.
+
+Fixed a bug in code which checked to see if a device was mounted which
+sometimes (rarely) failed in the case of a plain file.
+
+Fixed a bug in resize2fs where when it reported an error, it would
+print a message erroneously indicating that the filesystem had been
+resized before it aborted.
+
+When resizing a plain file which is smaller than the requested size,
+resize2fs will attempt to extended the file so that programs like
+e2fsck will not complain that the file is too small.
+
+Resize2fs will print the actual new size of the filesystem when it is
+finished resizing.
+
+Fixed a bug in debugfs where "ls -l" would report incorrect file type
+information on big-endian systems.
+
+
+Programmer's notes:
+-------------------
+
+Fixed collisions with C++ reserved words.
+
+Added portability fixes for building e2fsprogs on the HURD and AIX.
+
+Added the ext2ed program for creation of test cases.  (ext2ed has many
+limitations and bugs which make it unsuitable for production use.)
+
+The ext2fs_read_dir_block2 and ext2fs_write_dir_block now take a new
+flag, EXT2_DIRBLOCK_V2_STRUCT, which will will reverse when the
+name_len field is byte swapped on big-endian machines, since in the
+V2 structure, name_len is a char field which is doesn't need to be
+byte swapped --- except if an old-style kernel had byte-swapped the
+name_len field as part of the V1 structure.
+  
diff --git a/doc/RelNotes/v1.29.txt b/doc/RelNotes/v1.29.txt
new file mode 100644
index 0000000..8a060eb
--- /dev/null
+++ b/doc/RelNotes/v1.29.txt
@@ -0,0 +1,31 @@
+E2fsprogs 1.29 (September 24, 2002)
+===================================
+
+Fixed a bug in e2fsck which could corrupt a directory when optimizing
+it (via the -D option) or rebuilding the hash tree index with a 1 in
+512 probability, due to a fence post error.
+
+Fixed a bug in the LVM support code which caused LABEL='xxx' not to
+work correctly.
+
+Mke2fs now enables the directory indexing flag by default.  (Since
+this is a compatible feature flag, it's safe to do so.)
+
+Tune2fs will support setting the directory indexing feature flag.  It
+will automatically set up the default hash algorithm and hash seed
+fields in the superblock.
+
+If the bone-headed user enters the root filesystem twice in
+/etc/fstab, the -R option which skips the root filesystem will skip
+all of them.  (Addresses Debian bug #159423).  Note!  This is not a
+precedent for dealing intelligently with any other kind of doubled
+entry in /etc/fstab!
+
+
+Programmer's notes: 
+-------------------
+
+Removed perror declaration in lib/et/internal.h.  All modern systems
+can be expected to define perror() these days.  Besides, the lib/et
+code wasn't using perror at all anyway.  :-)
+
diff --git a/doc/RelNotes/v1.30.txt b/doc/RelNotes/v1.30.txt
new file mode 100644
index 0000000..36b2f14
--- /dev/null
+++ b/doc/RelNotes/v1.30.txt
@@ -0,0 +1,122 @@
+E2fsprogs 1.30 (October 31, 2002)
+=================================
+
+When resizing a filesystem, and inodes need to moved, resize2fs will
+update the inode's ctime field, and the mtime field of the containing
+directories, so that incremental backups using dump/restore will work
+correctly.
+
+In order to avoid spurious errors, e2fsck will check the last
+superblock write time to determine whether or not it can safely use
+the LOW_DTIME checks to determine if there are inodes on the orphan
+inode linked list that had somehow gotten disconnected.  (Addresses
+Sourceforge bug #620980)
+
+Partition in /proc/partitions that being with the string "lvm" are
+considered real partitions even if they do not end with a number.
+
+Fixed a bug in the the uuid generation function, where if /dev/urandom
+is not present, but /dev/random is, and there isn't sufficient
+entropy, the get_random_byte function could spin a loop forever.
+
+E2fsck, mke2fs, etc. will now reliably notice when image files are
+mounted using the loopback interface.  (Addresses Sourceforge bug
+#619119)
+
+When flushing buffers (as is done by badblocks, for example) check to
+see if the BLKFLSBUF ioctl succeeds, and if so, avoid using the
+FDFLUSH ioctl which causes the MD device driver which causes confusing
+syslog messages about obsolete ioctl messages.  (Addresses Sourceforge
+bug #545832).
+
+Debugfs's write command now checks to see if the destination filename
+exists before creating it.  (Addresses Sourceforge bug #478195.)
+
+When installing man pages, search for compressed man pages using all
+commonly used compression extensions (i.e., .Z, .gz, .bz2, etc.)
+
+Fixed a bug in fsck where multiple filesystems specified on the
+command were not being checked in parallel due to a logic bug
+introduced to support the FSCK_MAX_INST environment variable.
+
+We have added a new superblock field, s_mkfs_time, which indicates
+when a filesystem was created.  It is set via mke2fs, and printed out
+by dumpe2fs, but is not actually touched by the kernel.
+
+Dumpe2fs has been made more robust by not aborting if there is an
+error reading the block/inode bitmaps; instead it will still print out
+the location of the block/inode bitmaps and inode table.
+
+Add support for the an alternative block group descriptor layout which
+allows for on-line resizing without needing to prepare the filesystem
+in advance.  (This is the incompat feature flag meta_bg.)
+
+Add support for storing default mount options in the superblock, so
+that the filesystem can be mounted with specific mount options without
+needing to specify them on the mount command line or in the /etc/fstab
+file.
+
+Add support for a new inode flag, which is to be used for indicating
+the top of directory hierarchies for the Orlov block allocator.
+
+Fix e2fsck so that if it creates the lost+found directory, it does so
+with the more appropriate permissions of 0700.  Also change
+mklost+found so that it also creates the directory 0700.
+
+Fixed format bug in e2fsck if NLS is in use.
+  
+Add a German translation for e2fsprogs's NLS support.
+
+Fixed e2fsck so that it more handles BAD_BLOCK_IN_INODE_TABLE even at
+the beginning of the inode table.  This won't matter much, since if
+there is a bad block at the beginning of the inode table, the root
+directory won't be available.  But at least e2fsck won't crash in this
+case.
+
+Fixed endian problems in the htree code for e2fsck and debugfs.
+  
+When byte-swapping a filesystem on a PPC architecture, byte-swap the
+bitmaps since the historical big-endian ext2 variant had byte-swapped
+bitmaps, and the ext2fs library assumes this.  This fixes the
+regression test suite on PPC machines.
+
+Fix e2image so that it handles a bad block in the inode table
+appropriately.
+
+E2fsck now uses a more sophisticated algorithm to salvage corrupted
+directories that recovers more information in the corrupted directory
+block.
+
+E2fsck now performs additional consistency checks on indexed (HTREE)
+directories.
+
+Fix a bug where e2fsck might get confused about whether a completely
+empty directory block is an empty leaf block or an interior htree
+node.  This could cause e2fsck to get confused into think that a valid
+indexed directory was corrupted.
+
+E2fsck no longer creates an empty directory entry at the end of a
+directory block when optimizing a directory.  This would cause some
+earlier versions of the dxdir kernel code to corrupt the directory
+when attempting to split a node containing an empty directory entry.
+
+E2fsck could sometimes in rare circumstances leave the indexed flag
+set after a small directory was optimized by compressing it instead of
+indexing it.  (This should never happen in real life, since
+directories that small wouldn't have been indexed, but better safe
+than sorry.)
+
+E2fsck now only updates the master superblock in all cases.  This
+slightly shortens its run time.
+
+Ext2ed can deal with directory entries of length 0; previously it
+would get stuck in an infinite loop.
+
+Fsck now has support for reiserfs volumes when parsing LABEL= and UUID=
+specifiers.  (Sourceforge patch #613447)
+
+Badblocks will now work correctly on read-only devices such as
+CD-ROM's.  (Sourceforge patch #600451)
+
+Updated and clarified man pages.  (Addresses Debian bug #167108)
+
diff --git a/doc/RelNotes/v1.31.txt b/doc/RelNotes/v1.31.txt
new file mode 100644
index 0000000..fcc55ac
--- /dev/null
+++ b/doc/RelNotes/v1.31.txt
@@ -0,0 +1,39 @@
+E2fsprogs 1.31 (November 8, 2002)
+=================================
+
+Update EVMS ext2fsim plugin with EVMS 1.2.  (We still support
+compiling the fsim plugin with EVMS 1.0 and 1.1.)  Add better error
+handling for child process that die unexpectedly.  Add a hack to force
+mkfs to create filesystems that won't cause problems with hardware
+that has 2k or 4k minimum blocksize requirements.  Read from child
+processes in non-blocking mode, so that the GUI continues to update.
+
+Fix e2fsck so that it returns the appropriate exit code when the root
+filesystem has been changed, so that system's rc scripts will be told that 
+the system needs to be rebooted.
+
+Fix a bug in ext2fs_flush/ext2fs_close; when the MASTER_SB_ONLY flag
+was set, some of the descriptor blocks that should have been written
+out were getting skipped.
+
+Changed e2fsck to force out changes to the backup copies of the
+superblock and block group descriptors when important changes are made
+to those data structures.
+
+Fix a bug where e2fsck could erroneously mark a filesystem as being
+clean if a check of dirty filesystem is interrupted with a ^C.  (Bug
+introduced in e2fsprogs 1.28.)
+
+If journal debugging is enabled using --enable-jbd-debug, the debugging
+level is now set via the E2FSCK_JBD_DEBUG environment variable.
+
+If byteswapping support is disabled using configure --disable-swapfs,
+skip the tests which depend on byte-swapping, so that "make check"
+won't bomb out.
+
+Lsattr will now display the indexed directory flag.  Also, some of
+the more esoteric compression flags are suppressed unless compression
+support has been enabled.
+
+Update man pages.
+
diff --git a/doc/RelNotes/v1.32.txt b/doc/RelNotes/v1.32.txt
new file mode 100644
index 0000000..15af94d
--- /dev/null
+++ b/doc/RelNotes/v1.32.txt
@@ -0,0 +1,14 @@
+E2fsprogs 1.32 (November 9, 2002)
+=================================
+
+Fixed a bug in the Unix I/O routines which caused needless writebacks
+of clean blocks from the unix_io cache (they were erroneously marked
+as being dirty, so they were getting written back to disk before
+getting evicted from the disk cache).  This was harmless, but it
+significantly slowed down e2fsck.
+
+Made some other minor optimizations to the Unix I/O routines to save a
+small amount of CPU time.
+
+Updated internationalization files.
+
diff --git a/doc/RelNotes/v1.33.txt b/doc/RelNotes/v1.33.txt
new file mode 100644
index 0000000..d0f1742
--- /dev/null
+++ b/doc/RelNotes/v1.33.txt
@@ -0,0 +1,142 @@
+E2fsprogs 1.33 (April 21, 2003)
+===============================
+
+Added a new utility program, logsave, which captures the output of a
+command in a log file, even if the containing directory hasn't been
+mounted yet (in which case the it saves the output in memory until it
+can write out the logfile).  This is useful for capturing the
+output of fsck during the boot sequence.
+
+Fixed some portability problems that were causing problems under
+the Cygwin32 environment.
+
+Mke2fs now interprets a negative number to the -b option as a minimum
+block size.
+
+Fixed a bug in mke2fs which was incorrectly checking the argument to
+the -g option if the default block size was used.  (Addresses Debian
+bug #188319)
+
+Fsck now explicitly ignores tmpfs and devpts, and it will complain if
+it can not find filesystem checkers for jfs, reseirfs, and xfs.
+
+E2fsck now updates the global free block and inode counters from the
+block group specific counters quietly.  This is needed for an
+experimental patch which eliminates locking the entire filesystem when
+allocating blocks or inodes; if the filesystem is not unmounted
+cleanly, the global counts may not be accurate.
+
+Imported bug fixes to the EVMS plugin from the EVMS 2.0 tree.  (EVMS
+2.0 is not yet supported; this only pulled in the bug fixes: fixed
+possible hangs caused by bugs in calling waitpid, and not setting the
+pipe to non-blocking mode; also fixed a file descriptor leak; made
+sure all functions call log entry/exit functions.)
+
+Badblocks now flushes its output file as bad blocks are discovered.
+
+The uuid library is now more paranoid about assuming the correctness
+of the /dev/random device; it mixes in a stream of bytes from
+random/srandom, just in case.
+
+Update Debian files to reflect the fact that I am now the Debian
+maintainer of e2fsprogs.  Other various Debian-specific packaging
+cleanups.
+
+Move the source tarball generation functions from the top-level
+makefile to the util/gen-tarball script.  
+
+Updated the Turkish .po translation file.
+
+Added Heimdal and MIT krb5 extensions to the com_err library to make
+it more compatible with com_err libraries from those distributions.
+
+Changed dumpe2fs to always display the superblock fields relating to
+the journalling and/or directory indexing feature even if those
+features are not enabled.
+
+Updated and clarify copyright statement vis-a-vis alpha releases of
+e2fsprogs.
+
+The ss library will now try to dynamically link to the readline
+library and use it if it is present in the system.  This means that
+the debugfs program now has line editing and history features.  The
+SS_READLINE_PATH environment variable is used to find a readline or
+readline-compatible library.
+
+E2fsck now finds most duplicate filenames (all when rebuilding all
+directories via the -D option) and offers to delete or rename
+duplicate filenames/directory entries.  (Addresses Debian Bug #176814).
+
+Fix bug in e2image.  When writing out a raw image file, include data
+blocks from symlinks that do not store the symlink within the inode.
+
+Fix bug in resize2fs which incorrectly moved the block and inode
+bitmaps for sparse superblock filesystems and incorrectly marked
+blocks as in use.  (Addresses Debian bug #174766)
+ 
+Added a new shared library, the blkid library, which efficiently
+allows fsck, mke2fs, e2fsck, and tune2fs to be able to look up LABEL
+and UUID filesystem specifiers without needing to search all of the
+devices in the system.  Instead, the device is looked up in a cache
+file, and then verified to make sure the blkid cache is correct.
+
+Tune2fs and e2label will accept LABEL=xxx and UID=yyy specifiers for
+the device name, using the blkid library.  (Addresses Debian bugs
+#166048, #179671)
+
+Fsck now supports backslash escapes in /etc/fstab so that \040 can be
+used for spaces in device labels.
+
+Removed 32-bit limitations for debugfs's dump command.
+
+If the user specifies a large number of inodes, Mke2fs will
+automatically adjust the number of blocks per group to find a valid
+set of filesystem parameters.
+
+Add workaround to detect broken MD devices where when some of the
+underlying devices are marked read-only, writes to the MD device are
+silently dropped.  E2fsck will detect if there is an attempt to run
+the journal twice, and abort with an error if this is the case.
+(Addresses IBM Bugzilla bug #1226)
+
+E2fsck will print an error if more than one of the -p/-a, -n or -y
+options are specified.
+
+E2fsck will fix HTREE corruptions in preen mode, without stopping the
+boot process.  This is needed because the 2.4 ext2 filesystem
+accidentally had the INDEX_FL backwards compatibility code removed.
+
+Mke2fs no longer creates filesystems with the dir_index flag set by
+default; the user has to specifically request it.
+
+Update and clarified various man pages. (Addresses Debian bugs
+#173612, #175233, #175113, and #170497, #185945, #188318)
+
+Created man page for the mk_cmds program (from the libss library).
+
+Programmer's notes: 
+-------------------
+
+Fix various gcc -Wall nits.
+
+Fixed a lot of portability problems that caused e2fsprogs not to build
+successfully under Solaris and Apple/Darwin.
+
+Fixed a Makefile dependency to allow building e2fsprogs using parallel
+make jobs.
+
+Changes to create a subset distribution which consists only of the
+et, ss, uuid, and blkid libraries.  The configure script and top-level
+makefile were changed to support working with a subset distribution.
+
+Removed EXT2_FEATURE_RO_COMPAT_BTREE_DIR mention of since it's not
+actually used, and might people who are looking for
+EXT2_FEATURE_COMPAT_DIR_INDEX, which is in use.
+
+Updated debian files to fix a number of Lintian warnings.
+
+Updated config.guess and config.sub with newer versions from the FSF.
+
+Removed unnecessary libraries from being linked into the fsck, lsattr, 
+chattr, and blkid executables.
+
diff --git a/doc/RelNotes/v1.34.txt b/doc/RelNotes/v1.34.txt
new file mode 100644
index 0000000..f61095c
--- /dev/null
+++ b/doc/RelNotes/v1.34.txt
@@ -0,0 +1,130 @@
+E2fsprogs 1.34 (July 25, 2003)
+===============================
+
+Fixed a bug introduced in E2fsprogs 1.30 which caused fsck to spin in
+a tight loop while waiting for a child fsck to exit in some cases.
+This burns CPU times which slows down the low-level filesystem check.
+
+Added code to mke2fs to assure that the default block size for a
+filesystem is at least as big as the sector size of the device, if it
+can be determined.
+
+Changed mke2fs and resize2fs to round the default size of a filesystem
+to be an even multiple of the VM pagesize in order to avoid a Linux
+kernel bug introduced when the storage of the buffer cache was moved
+into the page cache.
+
+Mke2fs will warn the user when creating a filesystem with journalling
+and a blocksize greater than 4096.  (Addresses Debian bug #193773)
+
+Fixed a bug in resize2fs which caused it to fail on filesystems with a
+non-empty bad block list.  Resize2fs now discards any blocks on the
+badblock list which are no longer part of the filesystem as the result
+of a filesystem shrink.  (Note: this means that shrinking and then
+enlarging a filesystem is no longer a reversible operation;
+information about bad blocks in the part of the filesystem which is to
+be chopped off will be lost.)
+
+Changed resize2fs so the user can use prefixes to specify the units of
+the new filesystem size (sectors, kilobytes, megabytes, or gigabytes),
+and to make the error and informational messages explicitly display
+the blocksize used by the filesystem, in order to avoid confusion.
+(Addresses Debian bug: #189814)
+
+Added a new debugfs command, dump_unused, which dumps the contents of
+all unused blocks to stdout.  (Useful as an emergency try-to-find
+deleted data command.)
+
+Added a new debugfs command, imap, which prints the location of a
+specified inode in the inode table.
+
+Fixed a bug in the badblocks program which caused it to use one bit of
+randomness in its non-destructive read/write test, instead of using a
+full 8 bits of randomness.
+
+Added a new option (-t) to badblocks, which allows the user to control
+the test pattern(s) used when checking a disk.
+
+The blkid probe function now more correctly detects UDF filesystems.
+
+Fixed a bug in the blkid library which caused it to not update its
+cache if a filesystem changes from having a label to not having a
+label.
+
+Fixed a bug in the blkid library which could avoid an infinite loop
+in blkid_find_dev_with_tag() if /proc is not mounted and there the
+/etc/blkid.tab file has not yet been created.
+
+Fixed the badblocks program so that the destructive read/write test
+honors the -c option, and to use O_DIRECT when possible to avoid
+thrashing the system block buffer cache.
+
+Fixed various NLS issues.
+ - Added Czech and Swedish translations
+ - Removed testing NYC translation
+ - Fixed NLS support for message abbreviations in e2fsck
+ - Remove de-utf.po, since we shouldn't have two versions using different
+	charset encodings.
+ - Used ngettext() (abbreviated with the macro P_(str1, str2, n)) to
+	simplify the statistics reporting in e2fsck.
+
+Changed configure.in so that its defaults for *BSD systems no longer
+build an fsck wrapper, and not to install in /usr/local by default.
+
+Fixed some minor spelling errors/typo's in e2fsck and the configure
+script.
+
+Fixed various Debian packaging issues (see debian/changelog). 
+
+Updated and clarified man pages.  (Addresses Debian Bug #195616)
+
+Programmer's notes: 
+-------------------
+
+Fix gcc -Wall nitpicks.
+
+Updated gettext implementation used by e2fsprogs to 0.11.5, and enable
+NLS support by default.  (Added partial workaround for gettext/Darwin
+incompatibility problems.)
+
+Added full MIT KRB5 and Himdall compatibility support to the com_err
+library and the compile_et program.  (Addresses Debian bug #191900)
+
+Added the blkid_known_fstype() function to the blkid library, which
+returns true if it is passed a filesystem type which is recognized by
+the blkid probing functions.
+
+Improved the documentation for the blkid library.
+
+Added the ext2fs_get_device_sectsize() function the the ext2fs library, which
+returns the hardware sector size of a device, if it is available.
+
+Added a dependency in the blkid library's .so file to the uuid
+library, since the former uses the latter.  (Addresses Debian bug
+#194094)
+
+Added --with-diet-libc and --disable-evms to the configure script.
+
+Fixed a minor memory leak in the badblocks program.
+
+Fixed a portability problem in tune2fs --- not all systems have strptime().
+
+Fixed a portability problem in debugfs with the use of getopt() more
+than once.  Old-style BSD, new-style BSD, and Linux C libraries all do
+things differently.
+
+Add support Windows support to ext2fs_get_device_size().
+
+Added (normally disabled) debugging code to the Unix I/O manager which
+causes it to disable all userspace caching if the NO_IO_CACHE is
+defined.
+
+Changed the test I/O manager so it can always be linked into e2fsck,
+mke2fs, and tune2fs if enabled via --enable-test-io-debug to the
+configure script.  The test I/O manager will only print any debugging
+information if the TEST_IO_FLAGS or TEST_IO_BLOCK environment
+variables are set, which specifies which I/O operations are logged and
+a block number to watch, respectively.  The log messages are sent to
+stderr by default, unless a filename is specified via the
+TEST_IO_LOGFILE environment variable.
+
diff --git a/doc/RelNotes/v1.35.txt b/doc/RelNotes/v1.35.txt
new file mode 100644
index 0000000..2a4c520
--- /dev/null
+++ b/doc/RelNotes/v1.35.txt
@@ -0,0 +1,166 @@
+E2fsprogs 1.35 (February 28, 2004) 
+==================================
+
+E2fsck has a new -k option, which in conjunction with the -c options,
+preserves the existing badblocks list.
+
+Cleaned up e2fsck's preen-mode messages during the passes 1b, 1c, and 1d.
+
+E2fsprogs will now deal correctly with symlinks that contain
+extended attribute information, which can be created using SE Linux.
+(Addresses Debian Bug #232328)
+                                                                               
+Remove a double longjmp into an invalid stack frame bug in e2fsck.
+(This was during an abort sequence, which normally worked on Linux and
+caused a core dump on other operating systems.)
+
+Fix NLS bug in e2fsck, by avoiding trying to expand an empty string
+(the NLS library will replace "" with the .po header information).
+ 
+Fix a bug in mke2fs which caused -T largefile or -T largefile4 to core
+dump due to a division by zero error.  (Addresses Debian bug #207082)
+
+Fixed a bug in e2fsck which caused it to incorrectly fix a filesystem
+when reconnecting a directory requires creating a lost+found
+directory.  (Addresses Debian bug #219640).
+
+Fixed a bug where e2fsck would bomb out if a journal needed to be
+replayed when using an alternate superblock.
+ 
+E2fsck will give an extra grace period before actually forcing a check
+if the laptop is running on battery.  The next time fsck runs while
+the system is on the AC mains, or after the grace period is exceeded,
+the filesystem will be checked.  (Addresses Debian bug #205177)
+
+E2fsck will inform the user when there are 5 or fewer mounts before a
+filesystem check will be forced.  (Addresses Debian bug #157194)
+
+Fix e2fsck's handling of corrupted indirect blocks in the bad block.
+We now correctly handle the case where there is an overlap between a
+block group descriptor or a superblock and a bad block indirect block.
+In the case where the indirect block is corrupted, we now suggest
+"e2fsck -c".
+
+Fix byte swap bugs in e2fsck that caused the journal backup location 
+in the superblock and symlinks created by SE Linux to be cleared
+by e2fsck on big-endian machines.  (Addresses Debian bug #228723)
+
+E2fsck -c now replaces the current list of bad blocks with the ones
+found by badblocks.
+
+Fix bugs in e2fsck and tune2fs which could cause a core dump if a
+non-existent LABEL or UUID specifier is to e2fsck or tune2fs.
+
+Fix a potential bug in e2fsck which could cause it to core dump when
+trying to print the location of the backup superblock.
+
+Protect against a potential core dump in e2fsck when printing a
+message about backup superblocks.
+
+Add support for backing up the journal inode location in the
+superblock.  E2fsck will automatically save the journal information in
+the superblock if it is not there already, and will use it if the
+journal inode appears to be corrupted.  ext2fs_add_journal_inode()
+will also save the backup information, so that new filesystems created
+by mke2fs and filesystems that have journals added via tune2fs will
+also have journal location written to the superblock as well.
+Debugfs's logdump command has been enhanced so that it can use the
+journal information in the superblock.
+
+E2fsck will now update all superblocks when moving the journal inode.
+  
+Shrink the size of the e2fsck executable by moving some initialized
+variables to the BSS segment.
+
+E2fsck will avoid printing the ^A and ^B characters which bracket the
+progress bar when stdout and stdin are a tty device instead of a pipe
+to another program.  (Addresses Debian bug #204137)
+
+Debugfs's mkdir command will automatically expand the directory if
+necessary.  (Addresses Debian Bug: #217892)
+ 
+Fixed a bug in debugfs so that copying a file from /dev/null uses the
+correct mode bits.  (Addresses Debian Bug: #217456)
+ 
+If the environment variables DEBUFS_PAGER and PAGER are not set,
+debugfs now searches for the appropriate pager to use, beginning with
+/usr/bin/pager, and then falling back to 'more' and 'less'.
+(Addresses Debian bug #221977)
+
+Debugfs will now support 2.6 device numbers where the major or minor
+number may be larger than 255.  (Addresses Sourceforge bug #865289)
+ 
+Fix debugging printf in resize2fs.  (Addresses Debian Bug #271605)
+
+Chattr now stops processing options when it sees '--'.  (Addresses
+Debian bug #225188)
+
+Fix regression tests so they work correctly when e2fsprogs is compiled
+with configure --disable-htree.
+
+Fix bug in uuid library when there is no network card and the library
+is generating a time-based uuid.  The random MAC address was not
+correctly generated to be a multicast address.
+ 
+Add compile_et extensions from Heimdall that were missed the first time
+around.
+
+Fix bug in badblocks when using O_DIRECT; we need to make sure that
+we're reading from an offset which is page aligned.  For read-only and
+read-write tests, we try to recover after an error so that we can
+continue reading on page-aligned boundaries.  (Addresses Debian Bug
+#203713)
+  
+Badblocks now checks 64 blocks at a time instead of 16.  (Addresses
+Debian bug #232240)
+ 
+Updated and clarified various man pages.  (Addresses Debian Bug
+#206845, #222606, #214920, #232406)
+
+Updated and fixed translations.   (Addresses Debian bugs #200086, #214633)
+
+Fixed various Debian packaging issues (see debian/changelog).
+
+Programmer's notes: 
+-------------------
+
+Fixed a build problem so that e2fsprogs would compile with the
+--enable-profile option to configure selected.  (Addresses Sourceforge
+bug #811408)
+ 
+Fixed C++ problems with the ext2fs.h header.  (Addresses Red Hat
+Bugzilla Bug #112448)
+                                                                               
+Centralize code which calculates the location of the superblock
+and block group descriptors so that it is in a single library routine.
+
+Added two new functions, ext2fs_file_open2() and
+ext2fs_inode_io_intern2() which take a pointer to an inode structure.
+
+Fix compile_et to output the correct prototype for
+initialize_xxx_err_table_r() in the header file.  (Addresses Debian
+bug #204332)
+
+In the lib/et makefile, make sure com_err.info is deleted on "make clean".
+  
+Fix 64-bit warnings in e2fsprogs pass1b by using inttypes.h if
+present.  This is for when we try stuffing an int into void * pointer.
+
+Fix type-punning which can cause gcc 3.x to miscompile code by getting
+confused about pointer aliasing.  ext2fs_getmem(), ext2fs_free_mem(),
+and ext2fs_resize_mem() all now take a 'void *' instead of a 'void
+**'.  The EVMS code uses an ugly union approach since we don't want to
+modify the EVMS interfaces. 
+
+Make sure all Makefiles use $(MAKE) rather than hardcoded "make", to
+aid build process on systems can use invoke GNU make as "gmake".
+
+Added regression testing for mke2fs.
+
+Fixed gcc -Wall nitpicks.
+
+Fixed various compiler warnings.
+
+Add portability fixes for FreeBSD and for using fsctl under Darwin to
+support ext2 ioctl's.
+
diff --git a/doc/RelNotes/v1.36.txt b/doc/RelNotes/v1.36.txt
new file mode 100644
index 0000000..912bad2
--- /dev/null
+++ b/doc/RelNotes/v1.36.txt
@@ -0,0 +1,302 @@
+E2fsprogs 1.36 (February 4, 2005)
+=================================
+
+All of the patches that were applied to Fedora Core 3's
+e2fsprogs-1.35-11.2 have been integrated, although sometimes with a
+lot of bug fixes first.  Users of Fedora Core 3 are strongly
+encouraged to upgrade to e2fsprogs 1.36 as soon as possible.
+
+Add support for filesystem with the online resizing via resize inode
+feature.  Fixed numerous bugs from the Fedora patches.  The Fedora
+patches also didn't bother to do any consistency checking on the
+resize inode, or add any tests to the regression test suite.  The "-R
+resize=4g" option to mke2fs was a no-op in the Fedora patches, despite
+being listed in mke2fs's usage message.  All of these shortcomings
+have been corrected.
+
+E2fsck can also also fix filesystems trashed by Fedora's resize2fs
+program.  In order to do this, the user must run the commands:
+
+	debugfs -w /dev/hdXXX -R "features ^resize_inode"
+        e2fsck -f /dev/hdXXX
+
+Optionally, the ext2prepare command can be used to re-enable online
+resizing after the filesystem has been fixed.
+
+The fsck program will now accept an optional filedescriptor argument
+to the -C option.  (The Fedora version of this patch would sometimes
+cause fsck to ignore a parameter on fsck's command line in some rare
+cases, sigh.)
+
+Make sure e2fsprogs doesn't write garbage into the reserved portion of
+large inodes.
+
+Make sure resize2fs releases the blocks belonging to the old inode
+table blocks when moving the inode table.  (Addresses Debian Bug:
+#290894)
+
+Skip the r_resize_inode test if resize2fs is not compiled (due to
+configure --disable-resizer)
+
+E2fsck now checks the summary filesystem accounting information, and
+if any of the information is obviously wrong, it will force a full
+filesystem check.  (Addresses Debian Bug #291571)
+
+Fix e2fsck to not complain when the resize_inode feature is enabled,
+s_reserved_gdt_blocks is zero, and there is no DIND block allocated in
+the resize inode.
+
+Fix e2fsck to note delete symlinks that contain an extended attribute
+after the ext_attr feature flag has been cleared.  (Addresses Red Hat
+Bugzilla #146284).
+
+Add new utility program, copy_sparse.c, which is very useful
+for dealing with large sparse files (such as e2image files).
+
+Add support for jnl_blocks[] for debugfs's set_super_value.
+
+Fix filefrag so that it works correctly with sparse files.
+
+Filefrag -v will print first and last blocks.
+
+Add interpretation of OS Creator values for FreeBSD and Lites in mke2fs
+and dumpe2fs.
+
+Add mke2fs support so that it can support filesystems larger than 4TB
+automatically, by retrying with a 4k blocksize if the device size is
+too big to be expressed using a 1k blocksize.  (Addresses Sourceforge
+bug #1106631)
+
+Change blkid to test for NTFS first because Windows sometimes doesn't
+clear enough of the partition to confuse the probing routines into
+thinking the old filesystem type is still valid.  (Addresses Debian
+Bug #291990)
+
+Add support for swap partition label and uuid's in the blkid library.
+
+Add support to the blkid library to recognize Oracle ASM volumes.
+
+Make blkid -t display all devices that match the specified criteria,
+not just the first one, and work more consistently when the blkid
+cache file is not available or set to /dev/null.  (Addresses Debian
+Bug #290530 and #292425)
+
+Badblocks will now correctly display block numbers greater than
+999,999,999 in its progress display.
+
+The tune2fs program will not allow the user from setting a ridiculous
+number of reserved blocks which would cause e2fsck to assume the
+superblock was corrupt.  E2fsck's standards for what is a ridiculous
+number of reserved block has also been relaxed to 50% of the blocks in
+the filesystem.
+
+The blkid library will return vfat in preference to msdos, and ext3 in
+preference to ext2 (if the journalling flag is set) so that mount will
+do the right thing.  (Addresses Debian bug #287455)
+  
+Mke2fs will now use the -E option for extended options; the old -R
+(raid options) option is still accepted for backwards compatibility.
+Fix a double-free problem in resize2fs.  (Red Hat Bugzilla #132707)
+
+Mke2fs will now accept a size in megabytes, gigabytes, and other units
+(via "32m" or "4g" on the command line) if the user finds this more
+convenient than specifying a block count.
+
+Fix an obscure, hard-to find bug in "e2fsck -S" caused by an inode
+cache coherency problem.
+
+Debugfs now supports a new command, set_inode_field, which allows a
+user to manually set a specific inode field more conveniently, as well
+as set entries in the indirect block map.
+
+Debugfs's set_super_value command has been enhanced so that the user
+can set most superblock fields, including the date/time fields and
+some of the more newly added superblock fields.
+
+E2fsprogs programs now accept an offset to be passed to the file
+specifiers, via the syntax: "/tmp/test.img?offset=1024".
+
+E2fsprogs programs will now accept blocksizes up to 65536; kernel
+support on the x86 doesn't exist for now, but it can be useful on
+other architectures with page sizes greater than 4k.  There are 2.6
+kernel patches out there which enable this, but they are of this
+writing still experimental.
+
+The e2image command now takes the -s option which will scramble
+directory entries for raw image files.
+
+Fix a file descriptor leak in the filefrag program.
+
+Make sure e2fsck doesn't crash when /proc/acpi/ac_adapter is not
+present.
+
+Fix bug in debugfs where kill_file would lead to errors when deleting
+devices and symlinks.  (Sourceforge Bugs #954741 and #957244)
+
+Fix bug in the blkid library when detecting the ocfs1 filesystem 
+
+Remove obsolete EVMS 1.x and a.out DLL support.
+
+E2fsck will attempt to recover from a journal containing illegal blocks.
+
+Fixed two potential ordering constraint problems in e2fsck which might
+cause the filesystem to be corrupted if e2fsck is interrupted during a
+(extremely narrow) race window.  Thanks to Junfeng Yang from the
+Stanford Metacompilation group for pointing this out.
+
+Fixed bug in e2fsck where it would not accurately detect whether or
+not the system is running on adaptor if the ACPI device representing
+the AC adapter didn't correspond to the what was used on IBM
+Thinkpads.
+
+Change e2fsck to accept directories greater than 32MB.
+
+Fix e2fsck so that a checkinterval of zero disables a time-based check
+of the filesystem.
+
+Debugfs will check the DEBUGFS_PAGER environment variable in preference
+to the PAGER environment variable.  (Addresses Debian Bug #239547)
+
+Tune2fs will not mark rewrite the superblock if the feature bitmasks 
+are not modified.
+
+The debugfs program will set the filetype information when creating a
+link.
+
+Add debugfs -d option to use a separate source of data blocks when
+reading from an e2image file.
+
+Add e2image -I option which allows the e2image metadata to be
+installed into a filesystem.
+
+Fixed bug in the badblocks program which caused "done" to always
+appear in English even when a translation was available.  (Addresses
+Debian Bug #252836)
+
+The blkid program has a new option -o which controls the output format
+of the blkid program; this is makes blkid more convenient to use in
+shell scripts.
+
+Fix a minor bug in uuid library, which was not using the full 14 bits
+of clock sequence when generating UUID's.
+
+Fix a Y8.8888K problem in the uuid library.
+
+Logsave now creates a new session id for itself to avoid getting
+killed by init when transitioning between init levels.
+
+Change the licensing of the UUID library to be the 3-clause BSD-style
+license; this allows Apple to use the uuid library in Darwin.
+
+Add ocfs and ocfs2 probe support into the blkid library.
+
+Fix a memory and file descriptor leak in the blkid library.
+
+The blkid library will revalidate the device if the system time is
+earlier than last verification time of the device, since that
+indicates that the system time is probably not trustworthy.
+
+The blkid library will override the default location of the blkid.tab
+file by the BLKID_FILE environment variable, if it is available.
+
+Change the getsize functions to use the BLKGETSIZE64 ioctl on Linux 2.6.
+
+Add various portability fixes for lame new versions of glibc, Darwin
+and GNU/KFreeBSD, as well as removing XSI:ism's.  (Addresses Debian
+Bugs #239934, #264630, #269044, #255589, #289133)
+
+Add support for Windows 9x/NT under Cygwin.
+
+Updated and clarified various man pages.  (Addresses Debian Bugs #236383,
+	#241940, #238741, #242995, #256669, #268148, #256760, #273679)
+
+Updated and fixed translations.   (Addresses Debian bugs #244105, #262836)
+
+Update the rpm spec files so that it works better with Fedora core 2
+and RH9.
+
+Fixed various Debian packaging issues (see debian/changelog).  In
+particular, fixed the Debian initrd scripts.  (#241183, #248050,
+#253595, #247775)
+
+
+Programmer's notes: 
+-------------------
+
+Fixed various gcc -Wall warnings.
+
+The uuid library now has new functions uuid_unparse_upper() and
+uuid_unparse_lower() which forces the case of the hex digits to be
+upper case, or lower case.
+
+The build process has been sped up by enhancing the subst program
+to update the modtime on the generated files even when the generated
+file hasn't changed.
+
+The uuid library now uses C99 stdint.h types instead of custom types.
+
+Updated config.guess and config.sub with newer versions from the FSF.
+
+Removed out of date .cvsignore files from the source distribution.
+
+The ext2fs_unlink() function will return an error if both the name and
+inode number are unspecified, to avoid doing something surprising
+(such as unconditionally deleting the first directory entry).
+Directory entries are now deleted by coalescing them with the previous
+directory entry if possible, to avoid directory fragmentation.  This
+is not an issue with the e2fsprogs suite, but may be a problem for
+some of the users of libext2fs, such as e2tools.
+
+Add support for version numbers of the form "1.36-rc1".
+
+Fix build of mke2fs.static.
+
+Add basic ext2fs library support for large (EA in inode) inodes.
+
+The test_io mechanism can now abort after n reads or writes to a
+particular block.  The block is specified by TEST_IO_BLOCK environment
+variable, and the read/write count by the TEST_IO_READ_ABORT and
+TEST_IO_WRITE_ABORT environment variables.  The block data is now only
+dumped if the 0x10 bit is set in TEST_IO_FLAGS.
+
+UUID_DEFINE() in the uuid library now creates a static variable, with
+__attribute__ ((unused)) if we are using GCC, so that UUID_DEFINE can
+be used in header files.
+
+Add support for the install-strip and install-shlibs-strip targets, as
+suggested by the GNU coding guidelines.  "make install" no longer
+strips the binaries which are installed.
+
+Remove support for the --enable-old-bitops configure option which was
+only for very old sparc systems.
+
+Remove support for --enable-clear-htree; this was only needed during
+the early development of the htree patch.
+
+Use Linux-kernel-style makefile output so it is easier to see compiler
+warnings.
+
+Update gettext files to version 0.14.1.
+
+Update to use autoconf 2.5x.
+
+Improved support for compiling e2fsprogs under dietlibc.
+
+Make e2fsprogs portable to Solaris and FreeBSD systems.
+
+Add blkid_verify(), blkid_get_library_version(), and
+blkid_parse_version_string() functions to the blkid library.
+
+Add pkg-config files for e2fsprogs's libraries.
+
+Fix "make uninstall" to so that it removes everything that is installed.
+
+Add a configure --enable-maintainer-mode option which enables the
+makefile rules to rebuild the configure script from configure.in, and
+to rebuild the .gmo files in po directory.
+
+Drop the sparc assembly bitwise operations; it's less efficient
+than the GCC 3.4 compile code and triggers compiler warnings on
+sparc64.  Thanks to Matthias Andree for his analysis and suggestions.
+(Addresses Debian Bug #232326)
+
diff --git a/doc/RelNotes/v1.37.txt b/doc/RelNotes/v1.37.txt
new file mode 100644
index 0000000..2b2646b
--- /dev/null
+++ b/doc/RelNotes/v1.37.txt
@@ -0,0 +1,55 @@
+E2fsprogs 1.37 (March 21, 2005)
+===============================
+
+Add support for checking the validity of Extended Attributes stored in
+inodes to e2fsck.
+
+Add support for dumping the contents of large inodes to debugfs,
+including the extended attributes stored in inodes.
+
+Fix mke2fs, e2fsck, debugfs, and the ext2fs_mkdir function so that
+when we create a new inode we make sure that the extra information in
+the inode (any extra fields in a large inode and any ea-in-inode
+information) is initialized correctly.  This can take place when
+mke2fs creates the root and lost+found directory, when e2fsck creates
+a new root inode or a new lost+found directory, and when the user uses
+the debugfs write, mknod, or mkdir commands.  Otherwise, the newly
+create inode could inherit garbage (or old EA information) from a
+previously deleted inode.
+
+Fixed a bug in e2fsck so it would notice if a file with an extended
+attribute block was exactly 2**32 blocks, such that i_blocks wrapped
+to zero.
+
+Added support to filefrag to detect files which are using the new
+experimental file extents format, and use the non-ext2 algorithm in
+that case.  Fixed a bug to avoid reporting a false discontinuity if
+there is one or more unallocated blocks at the beginning of a file.
+
+Duplicated a check for noticing whether or not the number of blocks
+(given a certain blocksize) is greater than 2**32 when the
+BLKGETSIZE64 ioctl is not available to ext2fs_get_device_size().  This
+allows mke2fs to automatically use a larger blocksize when creating a
+filesystem on a very large device when run on systems that do not
+support BLKGETSIZE64.
+
+Fix the I18N build which was broken in e2fsprogs 1.36 because the
+build system had been switched to treat the .gmo files as shipped
+files (for backwards compatibility with systems that have older GNU
+I18N tools installed), but the gen_tarball.in script was still
+removing the .gmo files from the official source distribution.
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bugs ##296769, #299341)
+
+Programmer's notes:
+-------------------
+
+Added new functions to the e2p library which convert between a string
+and os_type: e2p_os2string() and e2p_string2os(), and used them to
+make the generated binaries more compact.
+
+Fixed a compile-time error on Darwin systems.
+
+Cleaned up the lib/ext2fs Makefile slightly.
+
diff --git a/doc/RelNotes/v1.38.txt b/doc/RelNotes/v1.38.txt
new file mode 100644
index 0000000..d8ab030
--- /dev/null
+++ b/doc/RelNotes/v1.38.txt
@@ -0,0 +1,138 @@
+E2fsprogs 1.38 (June 30, 2005)
+==============================
+
+Fix blkid's test programs (built with "make check") compile correctly
+even without "configure --enable-blkid-debug".
+
+Fix ia64 core dump bug caused by e2fsprogs running afoul of C99 strict
+type aliasing rules on newer gcc compilers.  (Addresses Red Hat
+Bugzilla ##161183.)
+
+Fix com_err library to make it more compatible with recent changes
+made to the com_err library in MIT Kerberos V5 version 1.4.
+(Addresses Sourceforge Bug #1150146)
+
+General cleanup of messages printed by e2fsprogs programs for grammar,
+consistency, and to make life easier for translators.  Fixed a few
+strings containing English that had not been marked as needing
+translations.  Removed strings that do not need to be translated, to
+make life easier for translators.
+
+Mke2fs and badblocks will take advantage of a feature in Linux 2.6 to
+test to see if a device appears to be in use instead of just relying
+on /proc/mounts and /etc/mtab.  (Addresses Debian Bug #308594).
+
+Fix portability problem in the filefrag program affecting platforms
+where the size of an integer is smaller than the size of a long.
+(Addresses Debian Bug #309655)
+
+Mke2fs will now use a larger journal by default for filesystems
+greater than 4GB.  (128 MB instead of 32MB).
+
+Mke2fs will refuse to create filesystems greater than 2**31-1 blocks,
+unless forced.  This is to avoid signed vs. unsigned kernel bugs in
+block numbers that still need to be fixed.
+
+The blkid program has a new option which will more efficiently search
+for device when it is known (or expected) that only one matching
+device will be found in the system, such as when doing a lookup by
+UUID.
+
+Debian's e2fsprogs-specific initrd fragment will avoid including
+unnecessary libraries into the initrd ramdisk by unsetting LD_PRELOAD
+and LD_LIBRARY_PATH, and filtering out libraries found in
+/etc/ld.so.preload.  (Addresses Debian Bug: #304003)
+
+Fixed a potential portability issue in the blkid programs for
+architectures where the char type is unsigned.  (Addresses Sourceforge
+Bug: #1180585)
+
+Fix a bug in filefrag so that it doesn't falsely count an extra
+discontinuity when the first block found is an indirect block.
+(Addresses Debian Bug #307607).
+
+Fix blkid's recognition of cramfs filesystems, and enhance it to be
+able to handle cramfs labels.
+
+Fix debugfs's stat command to not core dump when a filesystem is not
+open.
+
+Fix e2fsck's handling of error conditions caused by the resize inode
+claiming blocks that are also used by other inodes, a filesystem
+corruption which was commonly caused by a bug in Fedora Core 3's
+resize2fs program.
+
+Fixed bug in filefrag which caused it to fail on non-ext2/3
+filesystems.  (Addresses Debian Bug: #303509)
+
+If the superblock last mount time indicates that the system clock may
+not be accurate, then e2fsck will omit checking inodes' deletion time
+field for indications of a potential corrupted orphaned inode list.
+(Previously e2fsck only omitted these LOW_DTIME checks when the
+superblock's last write time looked insane.)
+
+Fixed a IA64 core dump bug in the e2p library which affected dumpe2fs.
+(Addresses Debian bug #302200)
+
+Make the blkid library more paranoid about being run from setgid
+programs, and to use __secure_getenv() from libc if it is available.
+
+Fixed spelling mistakes, typos, and otherwise clarified man pages.
+(Addresses Debian Bugs: #304591, #304592, #304594, #304597, #304593
+and Sourceforge Bug: #1189803)
+
+Updated and fixed translations.
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.
+
+Programmer's notes:
+-------------------
+
+Ext2fs_set_bit(), ext2fs_clear_bit(), and ext2fs_test_bit( have been
+changed to take an unsigned int for the bit number.  Negative bit
+numbers were never allowed (and didn't make any sense), so this should
+be a safe change.  This is needed to allow safe use of block numbers
+greater than or equal to 2**31.
+
+The compile_et program will avoid recreating generated foo_err.c and
+foo_err.h files if no changes are necessary.  The compile_et program
+will also atomically replace these files to avoid a potential parallel
+build race problem on SMP systems.  (Addresses Sourceforge Bug:
+#1157933)
+
+Added a new function to the blkid library, blkid_probe_all_new(),
+which only probes newly added disk devices, and change
+blkid_find_dev_with_tag() to use this function so that when a
+requested tag is not found, devices that were previously not checked
+are searched before searching all devices in the system.
+
+Added new functions to the blkid library, blkid_dev_set_search() and
+blkid_dev_has_tag().
+
+E2fsck's problem strings can now use @m and @n as abbreviations for
+"multiply-claimed" and "invalid", respectively.
+
+The e2fsprog.pot file now has an explanation of how the @-expansion
+and %-expansion works, and strings in e2fsck/problem.c which contain @
+characters now have comments in e2fsprogs.pot with the @-expansion to
+make life easier for translators.
+
+Fixed missing return values in the ext2fs library which could cause it
+to return random garbage in certain error conditions.
+
+Allow the current time to be overridden via the E2FSCK_TIME environment
+variable for use in regression tests.
+
+The test script driver program now exits with a non-zero status if
+there any of its test that it ran failed.
+
+Fixed problems with parabuilds on SMP systems.  (Addresses Sourceforge
+Bug: #1157933)
+
+Fixed "make check" so that it compiles correctly even when e2fsprogs'
+header files have not be installed in the system include directories.
+(Addresses Sourceforge Bug: #1180572)
+
+Fixed gcc -Wall nits.
+
diff --git a/doc/RelNotes/v1.39.txt b/doc/RelNotes/v1.39.txt
new file mode 100644
index 0000000..f7c4e9d
--- /dev/null
+++ b/doc/RelNotes/v1.39.txt
@@ -0,0 +1,248 @@
+E2fsprogs 1.39 (May 29, 2006) 
+=============================
+
+Fix 32-bit cleanliness in e2fsprogs so that we can support filesystems
+between 2**31 and 2**32 blocks.
+
+Change mke2fs to use /etc/mke2fs.conf as a configuration file to
+configure the filesystem features, blocksize, and inode_ratio for
+different filesystem types.
+
+Mke2fs will now create filesystems hash trees and on-line resizing
+enabled by default, based on the new /etc/mke2fs.conf file.
+
+The e2fsprogs tools (resize2fs, e2fsck, mke2fs) will open the
+filesystem device node in exclusive mode to prevent accidents by
+system administrators.  In the case of resize2fs and mke2fs, it will
+only use exclusive mode if the filesystem is not mounted.
+
+Fixed a bug in mke2fs which caused it to to fail when creating the
+resize inode for large filesystems.  (Addresses Debian Bug #346580)
+
+When allocating space for the RAID filesystems with the stride
+parameter, mke2fs will now place each portion of the group's inode
+table right up after the superblock (if present) in order to minimize
+fragmentation of the free space.
+
+Speed up mke2fs and e2fsck by writing inode and block bitmaps more
+efficiently by writing the inode and block bitmaps in one pass, thus
+reducing the number of disk seeks required.
+
+Add support for on-line resizing to resize2fs.
+
+Fix blkid library so that logic to determine whether or not a device's
+cached information in /etc/blkid.tab needs to be verified or not
+doesn't get confused by a system clock which is insane (for example,
+if the battery is dead on a Macintosh running PPC Linux.  (Addresses
+Red Hat Bug: #182188)
+
+The blkid library will now store the UUID of the external journal used
+by ext3 filesystems, so that in the future, the userspace mount binary
+can use this to find the location of the external journal and pass
+this information to the kernel.
+
+E2fsck will now consult a configuration file, /etc/e2fsck.conf to
+control how various options should be handled.  See the e2fsck.conf
+man page for more details.   (Addresses Debian Bug: #150295)
+
+E2fsck now prints an explanatory message when delaying a filesystem
+check when the system is running on battery.  (Addresses Debian Bug:
+#350306)
+
+E2fsck will detect if the superblock's last mount field or last write
+field is in the future, and offer to fix if so.  (Addresses Debian Bug
+#327580) These problems will be fixed automatically in preen mode
+since Debian's boot sequence bogusly doesn't set the time correctly
+until potentially very late in the bootup process, and this can cause
+false positives which will cause users' systems to fail to boot.
+(Addresses Debian Bugs #343662 and #343645)
+
+E2fsck now checks to see if the superblock hint for the location of
+the external journal is incorrect, and if so, offer to update it.
+(Addresses Debian Bug: #355644)
+
+Fix e2fsck from segfaulting on disconnected inodes that contain one or
+more extended attributes.  (Addresses Debian Bug: #316736, #318463)
+
+E2fsck will stop and print a warning if the user tries running a
+read/write badblocks test on a read-only mounted root filesystem.
+
+Fix a memory leak in e2fsck's error paths.  (Thanks to Michael
+C. Thompson for pointing these out; they were originally found using
+Coverity.)
+
+When resizing a file containing a filesystem, resize2fs will expand or
+truncate a file as necessary.  (Addresses Debian Bug: #271607)
+
+Resize2fs will now automatically determine the RAID stride parameter that
+had been used to create the filesystem, and use that for newly created
+block groups.   The RAID stride parameter may also be manually specified
+on the command line using the new -S option to resize2fs.
+
+Fix mke2fs so that it correctly creates external journals on
+big-endian machines (such as a S/390).  
+
+Fix a bug in the e2p library which could cause dumpe2fs to (rarely)
+fail to print out the journal or hash seed UUID.  (Thanks to Guillaume
+Chambraud for pointing this out.)
+
+Dumpe2fs will now print the size of the journal (if present).
+
+Fix debugfs's set_inode_field command so it can properly set the frag,
+fsize, uid_high, gid_high, and author fields in the inode instead of
+silently failing, and so that setting the i_size actually sets i_size
+correctly.
+
+Add a new debugfs command, set_current_time, which sets fs->now so
+that regression test suites can repeatedly modify the filesystem's
+last_write fields.
+
+Fix a bug in debugfs's icheck which would incorrectly report the owner
+of an extended attribute block.
+
+Fix the debugfs commands htree_dump, dx_hash, and list_dir so they print a
+print a usage message when an illegal option character is given.
+
+Fix debugfs's dump_unsued command on filesystems with a 64k blocksize
+so it won't core dump.  (Addresses SourceForge bug #1424311)
+
+Fix mklost+found so that it creates a full-sized directory on
+filesystems with larger block sizes.
+
+Fix a file descriptor leak in blkid library.
+
+Fix a display bug in "badblocks -sv" so that the done message properly
+clears the block number at the end of the test.  (Addresses Debian Bug
+#322231)
+
+Allow fractional percentages to the -m option in mke2fs and tune2fs
+(Addresses Debian Bug: #80205)
+
+Use fstat/fstat64 in getsize.c if the the target is a regular file,
+instead of attempting to do a binary search.  Fix some fd leaks in
+error cases.
+
+Add support for device mapper library to the blkid library to ensure
+that the "best" (i.e., leaf) device is probed by the blkid library.
+
+Fix the blkid library so that it notices when an ext2 filesystem is
+upgraded to ext3.
+
+Improve the blkid's library VFAT/FAT detection; it now understands
+labels stored in the root directory, and is more paranoid about
+checking the FAT superblock values.
+
+Fixed a fd leak in the uuid library which was causing problems for the
+LVM tools.  (Addresses Debian Bug: #345832)
+
+Add support for the reiser4 and software suspend partitions to the
+blkid library.  Also add support for extract the label from iso9660
+filesystems.
+
+Fix a compile_et bug which miscount the number of error messages if
+continuations are used in the .et file.
+
+Add extra sanity checks to protect users from unusual circumstances
+where /etc/mtab may not be sane, by checking to see if the device is
+reported busy (works on Linux 2.6) kernels.  (Addresses Debian Bug
+#319002)
+
+Updated French, Dutch, Polish, and Swedish translations.  (Addresses Debian
+Bug: #343149, #341911, #300871, #316604, #316782, #330789)
+
+Fix use-after-free bug in e2fsck when finishing up the use of the
+e2fsck context structure.
+
+Fixed spelling mistakes, typos, and otherwise clarified man pages and
+documentation.  (Addresses Debian Bugs: #329859, #322188, #316811,
+#312515, #351268, #357951, #347295, #316040, #368392, #368393, #368394,
+#368179)
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bugs #317862, #320389, #290429, #310950,
+#310428, #330737, #330736, #329074, #356293, #360046, #366017, #364516,
+#362544, #362970)
+
+
+Programmer's notes:
+-------------------
+
+Update config.guess and config.sub to latest version (2006-02-23) from
+FSF.
+
+Fix asm_types.h type conflicts on AMD 64 platforms.  (Addresses Debian
+Bugs: #360661, #360317)
+
+Fixed the Makefile so that they work correctly on newer versions of
+GNU make (i.e., 3.81).
+
+Add valgrind support to the regression test suites, and eliminate
+false positives from valgrind.
+
+Add a regression test suite for the blkid library.
+
+Fix a fencepost error in resize2fs caught by valgrind.  
+
+Fix compiler warnings about missing memcpy prototypes.
+
+We no longer have the sparc assembly code in the header file any more,
+so we shouldn't set _EXT2_HAVE_HAS_BITOPS_ for the sparc.  This would
+break compiles on the sparc architectures when using gcc.
+
+In the libext2fs library, add the new field fs->now which if non-zero
+is used instead of the system time when setting various filesystem
+fields (last modified time, last write time, etc.)
+
+Fix gcc 4.01 complaints by adding a missing #include <string.h> to
+ext2fs.h which is needed since the inline functions use memcpy().
+(Addresses Sourceforge Bug #1251062)
+
+Use BUILD_CFLAGS and BUILD_LDFLAGS instead of CFLAGS and LDFLAGS in
+the build system when building files in the util directory which are
+needed during the build process.  This avoids potential problems when
+cross-compiling and some of the options specified in CFLAGS or LDFLAGS
+are not recognized as valid by the host compiler.  (Addresses
+Sourceforge Bug #1261547)
+
+Clean up the blkid library by making the superblock and generic i/o
+functions to be more generic.  Clean up interface to the probe
+function, and fix memory leak.  Finally, remove an unneeded reference
+to probe.h in the lib/blkid/resolve.c
+
+Add an ext2fs_read_bb_FILE regression test to confirm proper detection
+of invalid block #'s.
+
+The x86 asm constraints for ext2fs_{set/clear}_bit have been fixed to
+indicate that the the function read/writes the memory location.
+
+Fix various gcc -Wall complaints.
+
+Add a dependency to make sure that the subdirectories are created
+before creating all of the object files, in order to address parallel
+build problem in the library Makefiles.  (Addresses Sourceforge Bug:
+#1261553)
+
+Add $(LDFLAGS) to the command line argument when generating an ELF or
+Solaris shared library, to allow cross-compile and other builds that
+might need to specify -L paths to needed libraries.  (Addresses
+Sourceforge Bug #1261549)
+
+Add a new feature, EXT2_FEATURE_COMPAT_LAZY_BG, which is initially
+intended for testing purposes.  It allows an ext2/ext3 developer to
+create very large filesystems using sparse files where most of the
+block groups are not initialized and so do not require much disk
+space.  Eventually it could be used as a way of speeding up mke2fs and
+e2fsck for large filesystem, but that would be best done by adding an
+RO_COMPAT extension to the filesystem to allow the inode table to be
+lazily initialized on a per-block basis, instead of being entirely
+initialized or entirely unused on a per-blockgroup basis.
+
+Fix backwards compatibility so e2fsprogs will better compile on Linux
+2.0.35 systems.
+
+Make test scripts more robust against locale-related environment variables
+
+Fix type warning problem with sizeof() in ext2fs_open2().
+
+Fix type warning problem with time_t in debugfs.
+
diff --git a/doc/RelNotes/v1.40.txt b/doc/RelNotes/v1.40.txt
new file mode 100644
index 0000000..08608d2
--- /dev/null
+++ b/doc/RelNotes/v1.40.txt
@@ -0,0 +1,1043 @@
+E2fsprogs 1.40.11 (June 17, 2008)
+=================================
+
+Mke2fs, tune2fs, and resize2fs now use floating point to calculate the
+percentage of reserved blocks.  (Addresses Debian Bug: #452639)
+
+Updated Spanish and Catalan translations.
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bugs: #483962, #483023)
+
+Add detection for ZFS volumes to the libblkid library.
+
+Fixed spelling mistakes, typos, and otherwise clarified man pages.
+(Addresses Debian Bug: #486463)
+
+Programmer's notes:
+-------------------
+
+Fix marginal C code in probe_lvm2() function to the blkid library more
+portable for older compilers.
+
+Fix build problems on MacOS X.  (Addresses Sourceforge Bug: #1972473)
+
+Fix ext2fs_swap{16,32,64} functions so they can be used by external
+applications on big-endian machines.  (Addresses Debian Bug: #484879)
+    
+
+E2fsprogs 1.40.10 (May 21, 2008)
+================================
+
+When deciding whether or not to revalidate a blkid cache entry, if the
+device's mtime is newer than the last time the cached entry was
+validated, force a revalidation.
+
+Fix a potential data corruption bug in e2fsck in the journal replay.
+The chances of this is happening is extremely remote, especially the
+default data=ordered or data=writeback modes.  However, if a block
+which has been journalled starts with the first four bytes 0xc03b3998,
+when e2fsck replays the journal, those four bytes will be replaced
+with zero's.  Fortunately, it is highly, highly unlikely for e2fsck
+metadata to begin with those fatal 4 byte sequence, and unless
+data=ordered mode is in use, data blocks are never journalled.
+
+Updated German, Dutch, Swedish, and Vietnamese translations.
+
+Programmer's notes:
+-------------------
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.
+
+Remove default sizes of types when cross compiling, since autoconf
+2.50 can figure this out automatically now.
+
+
+E2fsprogs 1.40.9 (April 27, 2008)
+=================================
+
+SuSE's security team audited uuidd and came up with a few minor
+issues.  None of them are serious given that uuidd runs setuid as a
+unprivileged user which has no special access other than libuuid
+directory, but it's good to get them fixed.
+
+One additional fix in ext2fs_swap_inode_full() needed for resize2fs to
+work correctly with in-inode extended attributes.
+
+Updated German, Czech, Dutch, French, Polish, Swedish, and Vietnamese
+translations.
+
+Debugfs will avoid using a pager if the standard output is not a tty.
+
+Fix debugfs and tune2fs to correctly handle daylight savings time when
+parsing a time string.
+
+Fixed spelling mistakes, typos, and otherwise clarified man pages.
+
+Fix fsck completion bars when multiple filesystems were being checked
+in parallel.  (Addresses Debian Bug: #432865, Addresses Launchpad Bug:
+#203323, Addresses Sourceforge Bug: #1926023)
+
+Fix fsck so that progress information is sent back correctly when
+multiple filesystems are being check and the output of fsck is being
+redirected to a file descriptor.  Also, include the device name (w/o
+spaces) in the progress information sent back via a file descriptor.
+(Addresses Launchpad Bug: #203323, Addresses Sourceforge Bug:
+#1926023)
+
+Teach fsck to treat "ext4" and "ext4dev" as ext* filesystems.
+
+If logsave receives a SIGTERM or SIGINT signal, it will now pass that
+signal to its child process.
+
+Fix mke2fs's creation of are resize inode when there is a non-standard
+s_first_data_block setting.
+
+Fix bug in blkid when run by an unprivileged user; most devices were
+not reported correctly.  9Addresses Launchpad Bug: #220275)
+
+Mke2fs will not allow the logically incorrect combination of
+resize_inode and meta_bg, which had previously caused mke2fs to create
+a corrupt filesystem.
+
+Fix fsck in German locales so that a 'j' means yes.
+(Addresses Sourceforge Bug: #1947683)
+
+
+Programmer's notes:
+-------------------
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.
+
+Update valgrind options in test_script to work with valgrind 3.2.3
+
+Update texinfo.tex to a much newer version from the FSF.
+
+Remove bashism for configure script and from the lib/ss Makefile.
+Addresses Sourceforge Bug: 1921969
+
+Fix some silently broken tests: m_no_opt, m_meta_bg, and m_raid_opt.
+
+Fix build system so that if texinfo is not installed, it won't print a
+(harmless) error message.
+
+
+E2fsprogs 1.40.8 (March 13, 2008)
+=================================
+
+Fixed e2image -I so it works on image files which are larger than 2GB.
+
+Fixed e2fsck's handling of directory inodes with a corrupt size field.  If
+the size is larger than the number of blocks found in the inode, don't
+try to allocate extra empty blocks at the end of the directory to make
+up the difference; there's no point to doing that.  In addition, if
+the size is not a multiple of a blocksize, always fix it.
+
+E2fsck handled a pass 2 "should never happen error" by not giving
+enough information and then core dumping.  Unfortunately, it was all
+too easy to trigger the "should never happen" situation if a
+directory's inode size was not correct.  This has been fixed, but
+e2fsck has also been taught how to handle this situation more
+gracefully, by simply removing the inode hash tree information, so
+that it can be rebuilt again after e2fsck's pass 3.  (Addresses
+Launchpad Bug: #129395)
+
+Resize2fs had a bug resizing large inodes with extended attributes
+that was fixed in 1.40.6; unfortunately, it turned out it wasn't fixed
+completely on big-endian systems such as PowerPC.  The bug should be
+completely fixed now.  Yay for regression test suites.  (Addresses Red
+Hat Bugzilla: #434893)
+    
+Updated German, Czech, Dutch, Polish, Swedish, and Vietnamese
+translations.  Many thanks to Philipp Thomas from Novell for stepping
+up to become the new German translation maintainer!  (Addresses Debian
+Bugs: #302512, #370247, #401092, #412882).
+
+When e2fsck is clearing a corrupt inode's HTREE directory information,
+make it clear that it is just clearing the HTREE information, not the
+entire inode.
+
+Fixed spelling mistakes, typos, and otherwise clarified man pages.  
+
+Programmer's notes
+------------------
+
+Add new functions, ext2fs_dblist_get_last() and
+ext2fs_dblist_drop_last(), which allows the caller to examine the last
+directory block entry added to the list, and to drop if it necessary.
+
+Fixed a portability problem in libblkid with DJGPP.
+
+Fix an obvious typo in an "internal error" message in e2fsck.  Thanks
+to Philipp Thomas for pointing this out.
+
+If the info files are not built, change "make install" so it doesn't
+fail with an error code.
+
+
+E2fsprogs 1.40.7 (February 28, 2008)
+====================================
+
+Remove support for clearing the SPARSE_SUPER feature from tune2fs, and
+depreciate the -s option, since it can result in filesystems which
+e2fsck can't fix easily.  There are very good reasons for wanting to
+disable sparse_super; users who wants to turn off sparse_super can use
+debugfs.  (Addresses Sourceforge Bug: #1840286)
+    
+Add missing options to mke2fs's usage message.  (Addresses Sourceforge
+Bug: #1751393)
+    
+Fix bug in resize2fs when large (greater than 128 byte) inodes are
+moved when a filesystem is shrunk; it was only moving the first 128
+bytes, so extended attributes were not getting moved.  (Addresses Red
+Hat Bugzilla: #434893)
+
+E2fsck now prints an explicit message when the bad block inode is
+updated, to avoid confusion about why the filesystem was modified.
+(Addresses Sourceforge Bug: #756460)
+    
+Allow mke2fs and tune2fs manipulate the large_file feature.
+Previously we just let the kernel and e2fsck do this automatically,
+but e2fsck will no longer automatically clear the large_file feature.
+It still isn't really necessary to worry about this feature flag
+explicitly, but some users seem to care.  (Addresses Red Hat Bugzilla:
+#258381)
+    
+Suppress message about an old-style fstab if the fstab file is empty.
+(Addresses Debian Bug: #468176)
+    
+Fix (really minor) bug in debugfs's find_free_block so it avoids
+reporting a free block more than once if there are too few free blocks
+in the filesystem.  (Addresses Sourceforge Bug: #1096315)
+    
+Change e2fsck to no longer clear the LARGE_FILES feature flag
+automatically, when there are no more > 2GB files in the filesystem.
+It's been almost a decade since there have been kernels that don't
+support this flag, and e2fsck clears it quietly without telling the
+user why the filesystem has been changed.
+    
+Fix bug which could cause libblkid to seg fault if a device mapper
+volume disappears while it is being probed.  (Addresses RedHat
+Bugzilla: #433857)
+    
+Enhance e2fsck's reporting of unsupported filesystem feature flags.
+(Addresses Sourceforge Feature Request: #1175808)
+    
+Fix option syntax in dumpe2fs for explicit superblock and blocksize
+parameters.  What was currently documented in the man page has been
+broken for some time, due to getopt() implementation changes.  The
+option syntax has been changed to one which is can be more portable
+supported and which is consistent with the format for extended options
+in mke2fs and tune2fs.  (Addresses Sourceforge Bug: #1830994)
+    
+Add support to tune2fs to clear the resize_inode feature.  This
+requires an fsck afterwards.  (Addresses Red Hat Bugzilla: #167816)
+
+Teach blkid to detect LVM2 physical volumes.  (Addresses Red Hat
+Bugzilla: #409321)
+
+Add support for setting RAID stride and stripe-width via mke2fs and
+tune2fs.  Teach dumpe2fs to print the RAID parameters.
+
+Add support for setting new superblock fields to debugfs's
+set_super_value.
+
+Add support for printing "mostly-printable" extended attributes in
+Debugfs.
+
+Add support for the -M option to fsck, which causes it to ignore
+mounted filesystem.
+
+Fix uuidd so that it creates the pid file with the correct pid number.
+(Addresses Sourceforge Bug: #1893244)
+
+Fix various gcc -Wall warnings.
+
+Update Czech, Dutch, Polish, Swedish, and Vietnamese translations
+
+Fixed spelling mistakes, typos, and otherwise clarified man pages.  
+(Addresses Sourceforge Patch: #1399325)
+
+
+Programmer's notes:
+-------------------
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bug: #466929)
+
+Add new flag EXT2_FLAG_NONFREE_ON_ERROR ext2fs_open2() which returns a
+partially filled-in filesystem object on an error, so that e2fsck can
+print more intelligent error messages.
+    
+Add a new function e2p_edit_feature2() which allows the caller to
+specify which feature flags are OK to set or clear, and which returns
+more specific information about feature flags which are not allowed to
+be set/cleared.
+    
+Set the C locale in the test_script driver since it uses [A-Za-z].
+(Addresses Sourceforge Bug: #1890526)
+
+Use fcntl locking instead of lockf in libuuid since Cygwin doesn't
+support lockf().
+
+Change configure.in to avoid using the 'dc' command unless it is
+absolutely needed. (i.e., when using parsing a WIP-style version
+number)  (Addresses Sourceforge Bug: #1893024)
+
+Add portability checks to support compilation under DJGPP.
+
+Update to the latest samba tdb code before the LGPLv3 change, which
+fixes a realloc() leak on failure.
+
+Fix memory leak in ext2fs_alloc_block().
+
+Fix makefile dependency issues for various install targets.
+(Addresses-Sourceforge-Patches: #1903484, #1903466, #1903456)
+    
+Improve descriptions for the r_move_itable and r_resize_inode tests.
+
+
+E2fsprogs 1.40.6 (February 9, 2008)
+===================================
+
+Add support for returning labels for UDF filesystems in the blkid
+library.
+
+Fix bug in the blkid library where cached filesystems was not being
+flushed when opening USB devices returned the error ENOMEDIUM.
+(Addresses Debian Bug: #463787)
+
+Added logic to the blkid library to automatically choose whether a
+filesystem should be mounted as ext4 or ext4dev, as appropriate.
+
+Allow tune2fs to set and clear the test_fs flag on ext4 filesystems.
+
+Fix a bug in e2fsck which caused it to core dump if e2fsprogs had been
+configured with --enable-jbd-debug.
+
+Document the BLKID_FILE environment variable in the libblkid man page
+
+Programmer's Notes:
+-------------------
+
+Update e2fsprogs translation template and Vietnamese and Czech translations
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bugs: #436058)
+
+Don't try to create $DESTDIR/etc/init.d as part of make install as we
+don't install the init.d script (and it's not the recommended way to
+start uuidd anyway).  (Addresses Sourceforge Bug: #1885085)
+
+Use thread local storage to fix a theoretical race condition if two
+threads try to format an unknown error code at the same time in the
+com_err library.
+
+
+E2fsprogs 1.40.5 (January 27, 2008)
+===================================
+
+Fix a potential overflow big in e2image if the device name is too
+long.
+
+Mke2fs will now create new filesystems with 256 byte inodes and the
+ext_attr feature flag by default.  This allows for much better future
+compatibility with ext4 and speeds up extended attributes even on ext3
+filesystems.
+
+Teach e2fsck to ignore certain "safe" filesystem features which are
+set automatically by the kernel.  Having the kernel set features
+automagically behind the user's back is a bad idea, and we should try
+to break the kernel of this habit, especially for the newer ext4
+feature flags.  But for now, we will try to avoid needless full checks
+which can annoy users who are doing fresh installs.
+
+Add support in tune2fs and mke2fs for making a filesystem as being "ok
+to be used with test kernel code".  This will be needed for using test
+filesystems with the latest ext4 kernel code.
+
+Change e2fsck -fD so that it sorts non-htree directories by inode
+numbers instead of by name, since that optimizes performances much
+more significantly.  (Addresses-Sourceforge-Feature-Request: #532439)
+
+If e2image fills the disk, fix it so it exits right away instead of
+spewing large numbers of error messages.
+(Addresses-Sourceforge-Feature-Request: #606508)
+
+If ftruncate64() is not available for resize2fs, let it use ftrucate()
+instead, but have it check to see if the size would get truncated, and
+skip calling ftruncate in that case.
+
+Add support for detecting HFS+ filesystems in the blkid library.
+
+Add support in the blkid library for ext4/ext4dev filesystems.
+
+Fix a bug in blkid where it could die on a floating point exception
+when presented with a corrupt reiserfs image.
+
+Fix blkid's handling of ntfs UUID's so that leading zeros are printed
+such that UUID string is a fixed length.
+
+Add sample python bindings for the uuid library to the contrib
+directory.  (Addresses-Sourceforge-Patches: #778817)
+
+Fix debugfs's 'lsdel' command so it uses ext2fs_block_iterate2 so it
+will work with large files.  (Addresses Sourceforge Feature Request:
+#1257500 and Sourceforge Support Request: #1253511)
+    
+Allow the debugfs 'undel' command to undelete an inode without linking
+it to a specific destination directory, since this might require
+allocating blocks that could overwrite some yet-to-be-recovered
+deleted files.  (Addresses-Sourceforge-Feature-Request: #967141)
+
+Update Swedish translation from the Translation Project.
+
+Programmer's Notes:
+-------------------
+
+Fix configure handling of --sbindir (which should rarely be used, but
+someone did complain, so let's fix it).  (Addresses Sourceforge Bug:
+#498381)
+
+Updated e2fsprogs.spec file to include a new uuidd package
+
+Use pkg-config to determine where to find the devmapper library so we
+can find out where it is located on different distributions.
+
+Fix Makefile race so that "make -j3 distclean" works correctly
+
+Fix portability problems on non-Linux/non-Hurd/non-Masix systems,
+especially on MacOS X systems.  (Addresses Sourceforge Bugs: #1861633,
+#1819034, #1863819)
+
+Fixed spelling mistakes, typos, and otherwise clarified man pages.
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bugs: #459403, #459475, #459614)
+
+Remove the --enable-dynamic-static configure option, and build e2fsck
+dynamically by default.  If the user wants e2fsck.static, he/she will
+need to build it via "make -C e2fsck e2fsck.static"
+
+Fix various build warnings due to missing prototypes.
+(Addresses Sourceforge Patch: #1861663, #1861659)
+
+
+E2fsprogs 1.40.4 (December 31, 2007)
+====================================
+
+Improve time-based UUID generation.  A new daemon uuidd, is started
+automatically by libuuid if necessary.  This daemon is setuid to allow
+updates to /var/lib/libuuid, so the clock sequence number can be
+stored and so if the clock is set backwards, it can be detected.
+(Addresses Sourceforge Bug: #1529672, Addresses Red Hat Bugzilla:
+#233471)
+
+Filter out the NEEDS_RECOVERY feature flag when writing out the backup
+superblocks.  This avoids e2fsck from concluding that a full
+filesystem check is required before backing up the superblock due to
+changes in the feature flags.  (Addresses Debian Bug: #454926)
+
+Fix fsck to only treat the '#' character as a comment at the beginning
+of the line in /etc/fstab.  Otherwise fstabs for the fuse filesystem
+will cause fsck to issue an bogus warning message.
+(Addresses Gentoo bug: #195405, Addresses Sourceforge bug: #1826147)
+
+Format control characters and characters with the high eighth bit set
+when printing the contents of the blkid cache, to prevent filesystems
+with garbage labels from sending escape sequences to the user's screen
+that might, for example place it in graphics mode.  (Addresses Ubuntu
+Bug: #78087)
+
+Fix sign-extension problem on 64-bit systems in in the com_err
+library.  (Addresses Sourceforge Bug: #1809658)
+
+Avoid division by zero error when probing an invalid FAT filesystem in
+the blkid library.  (Addresses Sourceforge Bug: #1831627)
+
+Update Dutch, Polish, and Vietnamese translations from the Translation
+Project.  Remove the Rwandan translation upon advice of the
+Translation Project.
+
+Programmer's Notes:
+-------------------
+
+Fix the libss "make check" regression test so that it works if the
+current directory is not in the user's path or if the libss shared
+library is not installed.  (Addresses Sourceforge Bug: #1848974)
+
+Fixed spelling mistakes, typos, and otherwise clarified man pages.
+(Addresses Debian Bugs: #444883, #441872)
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bugs: #437720, #451172, #458017)
+
+Fix build failure on non-Linux/non-Hurd/non-Masix systems.
+(Addresses Sourceforge Bug: #1859778)
+
+Fix Hurd portability issues.  (Addresses Debian Bug: #437720)
+
+
+E2fsprogs 1.40.3 (December 5, 2007)
+===================================
+
+Fix a potential security vulnerability where an untrusted filesystem
+can be corrupted in such a way that a program using libext2fs will
+allocate a buffer which is far too small.  This can lead to either a
+crash or potentially a heap-based buffer overflow crash.  No known
+exploits exist, but main concern is where an untrusted user who
+possesses privileged access in a guest Xen environment could corrupt a
+filesystem which is then accessed by the pygrub program, running as
+root in the dom0 host environment, thus allowing the untrusted user to
+gain privileged access in the host OS.  Thanks to the McAfee AVERT
+Research group for reporting this issue.  (Addresses CVE-2007-5497.)
+
+Fix heuristics in blkid which could cause a disk without partitions to
+be incorrectly skipped when a loopback device is present.  (Addresses
+Red Hat Bugzilla #400321.)
+
+Fix e2image so that in raw mode it does not create an image file which
+is one byte too large.
+
+Change mke2fs's usage message so it recommends the preferred -E option
+instead of the deprecated -R option.
+
+Enhance the blkid library so it will recognize squashfs filesystems.
+(Addresses Red Hat Bugzilla #305151.)
+
+Enhance e2fsck so it will force the backup superblocks to be backed up
+if the filesystem is consistent and key constants have been changed
+(i.e., by an on-line resize) or by e2fsck in the course of its
+operations.
+
+Enhance blkid's detection of FAT filesystems; so that USB disks with
+only a single bootable partition will not get missed.
+
+E2fsck will no longer mark a filesystem as invalid if it has time
+errors (i.e., if superblock mount time or last write time is in the
+future) and the user refuses to fix the problem.
+
+The Ubuntu init scripts don't properly set the system time correctly
+from hardware clock if the hardware clock is configured to tick local
+time instead of GMT time.  Work around this as best as we can by
+providing an option, buggy_init_scripts, in /etc/e2fsck.conf which can
+be set on Ubuntu systems.  (Addresses Debian Bug #441093, and Ubuntu
+Bug #131201.)
+
+Fix fsck to ignore /etc/fstab entries for bind mounts.  (Addresses Red
+Hat Bugzilla #151533.)
+
+Fix e2fsck so that if the superblock is corrupt, but still looks
+vaguely like an ext2/3/4 superblock, that it automatically tries to
+fall back to the backup superblock, instead of failing with a hard
+error.
+
+Make the e2fsprogs program more robust so that they will not crash
+when opening a corrupt filesystem where s_inode_size is zero.
+
+Change e2fsck so it uses sscanf() instead of atoi() so it non-numeric
+arguments are detected as such and the parse error is reported to the
+user.   (Addresses Debian Bug #435381.)
+
+Change e2fsck so it will not complain if a file has blocks reallocated
+up to the next multiple of a system's page size.
+
+Fix bug in ext2fs_check_desc() which will cause e2fsck to complain
+about (valid) filesystems where the inode table extends to the last
+block of the block group.  (Addresses Red Hat Bugzilla #214765.)
+
+Fix a bug in ext2fs_initialize() which causes mke2fs to fail while
+allocating inode tables for some relatively rare odd disk sizes.
+(Addresses Red Hat Bugzilla #241767.)
+
+Add Catalan translation and update Dutch and Swedish translations
+from the Translation Project.
+
+Fix big-endian byte-swapping bug in ext2fs_swap_inode_full().  We
+still had an issue when trying to figure out whether we need to
+byte-swap fast symlinks that contained extended attributes.
+
+Fixed spelling mistakes, typos, and otherwise clarified man pages.
+(Addresses SourceForge Bug #1821333.)
+
+
+Programmer's Notes:
+-------------------
+
+Fix mke2fs tests to avoid needing any significant ^M (CR) characters
+
+Add "make check" to the RPM spec file
+
+Fix "make install" and 'make uninstall" in misc/Makefile.in so that it
+works correctly when the prefix is not the root directory.
+
+Fix the resize2fs tests, r_move_itable and r_resize_inode, so they
+clean up after themselves by deleting the test.img temporary file
+after completing the test.
+
+Fixed a corner case bug ext2fs_unlink() when trying to delete the
+first directory entry in a directory block and the last directory
+entry in the previous directory block is not in use.  Fortunately
+ext2fs_unlink() is only used by debugfs and e2fsck, and in e2fsck in
+places where it is extremely unlikely to run into this corner case.
+
+Fix missing dependency which would cause parallel builds to fail.
+(Addresses Sourceforge Bug #1842331.)
+
+Fix a build error on newer gcc caused by lib/ext2fs/ismounted.c
+calling open(O_CREATE) with a missing mode parameter.
+
+Fix the test_ss.c in lib/ss so it can be used as an example
+application program for the library as well as a regression test
+suite.
+
+Fix ext2fs_dblist_dir_iterate() so that error codes and abort codes
+are properly passed back up through the call stack.
+
+E2fsprogs 1.40.2 (July 12, 2007)
+================================
+
+A recent change to e2fsck_add_dir_info() to use tdb files to check
+filesystems with a very large number of filesystems had a typo which
+caused us to resize the wrong data structure.  This would cause a
+array overrun leading to malloc pointer corruptions and segfaults.
+Since we normally can very accurately predict how big the the dirinfo
+array needs to be, this bug only got triggered on very badly corrupted
+filesystems.
+
+Fix a bug in e2fsck which caused it to incorrectly salvage
+directories when the last entry's rec_len is bogusly too big.  This
+resulted in a nonsense filesystem corruption to be reported, and
+required a second run of e2fsck to fully fix up the directory.
+
+Update tune2fs man page to include more discussion of reserved blocks
+(Addresses Launchpad bug #47817)
+
+Update Turkish, Polish, Dutch, and Vietnamese PO files from the
+Translation Project
+    
+
+E2fsprogs 1.40.1 (July 7, 2007)
+===============================
+
+Fix bug which could cause libblkid to loop forever.  When revalidating
+a partition where there is obsolete information in /etc/blkid.tab, we
+end up freeing a the type tag without clearing dev->bid_type, causing
+blkid_verify() to loop forever.  (Addresses Debian Bug: #432052)
+    
+The Turkish translation has a bug in it where it has the translation
+of "E@e '%Dn' in %p (%i)" to "E@E".  This causes @E to be expanded at
+@E, recursively, forever, until the stack fills up and e2fsck core
+dumps.  We fix this by making e2fsck stop @-expansions after a
+recursive depth of 10, which is far more than we need.
+(Addresses Sourceforge Bug: #1646081)
+    
+Compile the default mke2fs.conf into mke2fs program.  People are
+getting surprised by mke2fs creating filesystems with different
+defaults than earlier versions of mke2fs if mke2fs.conf is not
+present.  So we now create a built in version of mke2fs.conf file
+which is used by mke2fs if the /etc/mke2fs.conf is not present.
+(Addresses SourceforgeBug: #1745818)
+
+Improve the config/parse_types.sh helper script.  Fix a potential
+security problem if e2fsprogs is built as root (as Gentoo does!).  In
+addition fix the script and how it is called from the configure script
+so that it does the right thing when cross-compiling.  (Fixes Gentoo
+bug: #146903)
+    
+Update Vietnamese, French, and Dutch PO files from the Translation
+Project.  Also created a new e2fsprogs.pot file for translator.
+    
+Fix bogus strip permission errors when building under Debian.  When
+building the e2fsprogs dpkg's, the dh_strip command emits a large
+number of error messages caused by the permissions not being right.
+So run dh_fixperms before running dh_strip.
+
+Programmer's Notes:
+-------------------
+
+Add new function: profile_set_default().  This function sets the value
+of the pseudo file "<default>".  If the file "<default>" had
+previously been passed to profile_init(), then def_string parameter
+will be parsed and used as the profile information for the "<default>"
+file.
+    
+Fix mk_cmds's error reporting so that it is unambiguous that it is the
+mk_cmds script which is generating the error.  (Obviates Gentoo patch:
+e2fsprogs-1.32-mk_cmds-cosmetic.patch)
+    
+Fix the test suite to use LC_ALL instead of LANG.  LC_ALL is the "high
+priority" environment variable that overrides all others, where as
+LANG is the lowest priority environment variable.  If LC_ALL is set, it
+doesn't matter whether LANG, LANGUAGE, LC_COLLATE, LC_MESSAGES, and
+the all the rest are set.  This will assure that the locale when
+running the test suites is the "C" locale.  (Obviates Gentoo patch:
+e2fsprogs-1.38-tests-locale.patch)
+    
+
+E2fsprogs 1.40 (June 29, 2007)
+==============================
+
+Fix divide by zero error in blkid's NTFS probing logic.
+
+Add new blkid -g option which causes the blkid cache to be garbage
+collected.
+
+Fix a bug in libblkid which could cause the internal field bid_type to
+become corrupted.  Fortunately bid_type isn't used much, and bid_label
+and bid_uuid is only used by debugging code, so the impact of this bug
+was very minor.
+
+Mke2fs will now store the RAID stride value when a filesystem is
+created with a requested RAID stride, and then use it automatically in
+resize2fs.
+
+Mke2fs has a sanity check added to make sure (inode_size * num_inodes)
+isn't too big.  In some cases Lustre users have tried specifying an
+inode size of 4096 bytes, while keeping an inode ratio of one inode
+per 4096 bytes.  
+
+Improve sanity check in e2fsck's algorithm for finding a backup
+superblock, so that it won't accidentally find a superblock that was
+located in the journal, and then later reject it as being not a valid
+backup superblock.
+
+Fix e2fsck get_size logic so that it will work with the Linux floppy
+driver.  The Linux floppy driver is a bit different from the other
+block device drivers, in that if the device has been opened with
+O_EXCL, it disallows another open(), even if the second open() does
+not have the O_EXCL flag.  (Addresses Debian Bug: #410569)
+
+Fix error checking of badblock's last-block and start-block arguments.
+(Addresses Debian Bug: #416477)
+
+Fix e2fsck so that it doesn't overwrite the backup superblocks when
+recovering a journal until the master superblock has been confirmed as
+being sane.
+
+Change the blkid library to be much more paranoid about concluding
+that a partition contains an NTFS filesystem, and fetch the UUID and
+LABEL information from NTFS filesystems.  (Addresses Launchpad Bug:
+#110138)
+
+Factor out the code which sets the default journal size and move it
+into libext2fs.
+
+Enhance e2fsck so it will recreate the ext3 journal if the original
+journal inode was cleared to due it being corrupt after finishing the
+filesystem check.
+
+Fix e2fsck so that it updates the journal inode if it is corrupted and
+the backup journal information from the superblock was successfully
+used to recover the filesystem.
+
+Fix e2fsck so that it checks all of the blocks in the journal inode
+for validity.  The original code only checked the direct blocks to
+make sure the journal inode was sane.  Unfortunately, if some or all
+of the indirect or doubly indirect blocks were corrupted, this would
+not be caught.
+
+Add support in blkid to detect LUKS encrypted partitions.
+
+Add extra sanity checks for extended attributes in the case where the
+size is zero but the offset is very large.
+
+Fix byte-swapping issues for large inodes in ext2fs_read_inode_full()
+and ext2fs_get_next_inode_full().
+
+Clarify the copyright licenses used by the various libraries in
+the top-level COPYING  file (Red Hat Bugzilla: 166058)
+
+Make mke2fs's defaults when /etc/mke2fs.conf doesn't exist more sane.
+
+Fix mke2fs and debugfs to support large (> 16 bit) uid's and gid's.
+
+Remove check in e2fsck which requires EA's in inodes to be sorted;
+they don't need to be sorted, and e2fsck was previously wrongly
+clearing unsorted EA's stored in the inode structure.
+
+Allow mke2fs or tune2fs to create a substantially larger journal (up
+to 10,240,000 blocks).
+
+Fix MD superblock detection, and make sure the correct UUID is
+reported from the MD superblock.
+
+Fix a signed vs. unsigned bug in debugfs.
+
+Enhance debugfs's date parser so that it accepts integer values.
+
+Fix e2fsck's pass1c accounting so it doesn't terminate too early if a
+file with multiply claimed blocks is hard linked. or not at all if the
+root directory contains shared blocks
+
+Enhance debugfs so it can modify the block group descriptors using the
+command set_block_group_descriptor.
+
+Improve e2fsck's reporting of I/O errors so it's clearer what it was
+trying to do when an error happens
+
+Fix a bug in in how e2fsprogs byte swaps inodes containing fast
+symlinks that have extended attributes.  (Addresses Red Hat Bugzilla:
+#232663 and LTC Bugzilla: #27634)
+
+Fix potential file descriptor leak in ext2fs_get_device_size() in an
+error case.
+
+Add libreadline.so.5 support to libss.
+
+Improve badblocks -n/-w exclusive usage message.
+
+Fix dump_unused segfault in debugfs when a filesystem is not open
+
+Fix memory leak in blkid library.  (Addresses Debian Bug: #413661)
+
+Allow the debugfs lcd command to work w/o a filesystem being open.
+(Addresses LTC Bugzilla #27513)
+
+Fix e2fsck to clear i_size for special devices with a bogus i_blocks
+field on the first pass.
+
+Fix e2fsck to set the file type of the '..' entry when connecting
+a directory to lost+found.  (Addresses Lustre Bug: #11645)
+
+Enhance e2fsck to recover directories whose modes field were corrupted
+to look like special files.  This is probably only useful in
+artificial test cases, but it will be useful if we ever do the "inodes
+in directory" idea for ext4.
+
+Allow debugfs to dump (and rdump) > 2GB files.  (Addresses Debian Bug:
+#412614)
+
+Fix resize2fs parsing of size parameter (in sector units).  This was
+actually a bug in libe2p's parse_num_blocks() function.  When handling
+the 's' suffix, it was ignoring the blocksize information passed in
+from the caller and always interpreting the number in terms of a 1k
+blocksize.  (Addresses Debian Bug: #408298)
+
+There was a floating point precision error which could cause e2fsck to
+loop forever on really big filesystems with a large inode count.
+(Addresses Debian Bug: #411838)
+
+Fix memory leak in ext2fs_write_new_inode()
+
+Add support for using a scratch files directory to reduce e2fsck's
+memory utilization on really big filesystems.  This uses the TDB
+library.  See the [scratch_files] section of the e2fsck.conf man page
+for more details.
+
+Fixed type-punning bug which caused dumpe2fs to crash on the Arm
+platform (Addresses Debian Bug: #397044)
+
+Add explanatory message to badblocks that -n and -w are mutually exclusive
+(Addresses Debian Bug: #371869)
+
+Allow debugfs and dumpe2fs to support fs features under development.
+
+Add support for the new flag EXT2_FLAG_SOFTSUPP_FEATURES flag to
+ext2fs_open() , which allows application to open filesystems with features
+which are currently only partially supported by e2fsprogs.
+
+Allow unix_io to support offsets greater than 2G (Addresses
+SourceForge Bug: #1547922)
+
+Fixed overflow and signed/unsigned problems caused by the number of
+blocks or inodes exceeding 2**31 or being close to 2**32-1.
+
+Add support for unsigned directory hash calculations with hints in the
+superblock to fix cross-architectural portability for htree
+directories with filenames where the high 8th bit is set.  (Addresses
+Debian: #389772)
+
+Fix resize2fs so that it gives user-intelligible error messages if the
+filesystem or the kernel does not support on-line resizing.
+(Addresses Debian Bug: #380548)
+
+Require mke2fs -F -F for really dangerous operations, since -F is
+needed for less dangerous operations such as creating filesystems
+images in regular files, or creating filesystems on whole block
+devices.  These relatively innocuous usages should NOT be confused
+with running mke2fs on an apparently-mounted or in-use filesystem.
+
+Allow the default inode size to be specified into the mke2fs.conf
+file.
+
+Make the smallest default journal size is big enough so that on-line
+resizing should always work.
+
+Fix silly spelling error in e2fsck.  (Addresses SourceForge bug:
+#1531372)
+
+Fix debugfs coredump when lsdel is run without an open filesystem
+(Addresses Debian Bug: #378335)
+
+Fix debugfs display bug us that bytes that have the high bit set are
+displayed as "ec" instead of "ffffffec".
+
+Add support in lsattr so it will display the EXT4_EXTENTS_FL flag.
+
+Device mapper scanning wasn't working in the blkid library because the
+pathnames had an extra "/dev" when they were being probed.
+
+Add GFS/GFS2 support to the blkid library.
+
+Fix blkid support of empty FAT filesystem labels.
+
+Avoid recursing forever (or for a long time) when the blkid library
+searches for a device and there are symlinks to directories in /dev.
+
+Avoid unaligned halfword access in blkid when accessing FAT
+superblocks, as this will cause Sparc/Solaris systems to throw a
+SIGBUS error.
+
+The latest devmapper libraries requires pthreads, add -lpthreads to
+the static link libraries for e2fsck.static if devmapper is enabled.
+(Addresses Debian bug: #388718)
+
+Improve the (non-installed, for experts only) findsuper program by
+printing the uuid and label from the superblocks, as well as the
+starting and ending offsets of the filesystem given the information in
+the superblock.  Omit by default printing superblocks that are likely
+found in located in an ext3 journal unless an explicit -j option is
+given.
+
+Updated Spanish, French and Dutch translations and added Catalan
+translation.  (Addresses Debian bug: #411562)
+
+Use FreeBSD's DIOCGMEDIASIZE and DIOCGDINFO ioctls if available when
+determining a partition's size, since binary searching to determine
+the device doesn't work on FreeBSD.
+
+Documentation about UUID's is available in enough places, and it's
+awkward to deal with debian-legal's insanities.  So I'm caving in the
+"more-lunatic-than-RMS" wing of Debian by removing RFC-4122 so we
+don't have do the dfsg tarball.  Also remove the rule that only tried
+to install RFC-4122 on Ubuntu, since Ubuntu seems to want to fetch
+e2fsprogs exclusively from Debian.  (Addresses Debian Bug: #407107)
+
+Fix the info-dir line so that the menu name does not contain a .info
+prefix.  First of all, it's ugly, secondly, it causes the install-info
+command to fail to remove the com_err info file from the
+/usr/share/info/dir file when the comerr-dev package is removed and
+purged.  (Addresses Debian Bug: #401711)
+
+Fixed spelling mistakes, typos, and otherwise clarified man pages.
+(Addresses Debian Bug: #369761, #373004, #379695)
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bugs #389554, #390664, #413208, #419605,
+#408352, #415560, #399155)
+
+
+Programmer's notes:
+-------------------
+
+E2fsck now supports the %It expansion when printing a problem report.
+It will print the type of the inode in the problem context.
+
+Fix misc/Makefile.in so that it builds even if e2fsck hasn't been built yet
+(Addresses Sourceforge Bug: #1565561)
+
+Remove unused variables and other lint/gcc -Wall cleanups
+
+Add check to ext2fs_get_device_size() so it will return EFBIG for for
+filesystems contained in regular files where the filesystem image size
+is returned by stat64().
+
+Set local environment variables to C so mk_cmds and compile_et always
+work.  (Addresses SourceForge Bug: #1532177)
+
+Added the 64-bit byte swapping function ext2fs_swab64().
+
+Added two new helper functions to prevent 2**31/2**32-1 overflow
+problems: ext2fs_div_ceil() and e2p_percent().
+
+Create new ext2fs library inline functions ext2fs_group_first_block()
+and ext2fs_group_last_block() in order to calculate the starting and
+ending blocks in a block group.
+
+Create the generated files read-only to remind developers not to edit them.
+
+Add support for autoconf 2.60 (with backwards compatibility for older
+versions of autoconf).
+
+Added an "make rpm" target to top-level Makefile
+
+Added various FreeBSD portability fixes.
+
+Exclude mercurial files from the RPM build tree to speed up copy/build.
+
+Use root_sysconfdir to define the locations of mke2fs.conf and
+e2fsck.conf instead of using a hard-coded /etc pathname.
+
+Prevent e2fsck.h and ext2_ext_attr.h from getting included multiple times.
+
+Fixed "make clean" in blkid's Makefile.in file from removing tst_*.c files.
+
+If diff -u is supported, use it to report test failures.
+
+Updates/improvements to RPM spec file
+
+Add on-disk format definitions for the following new features:
+EXT4_FEATURE_RO_COMPAT_HUGE_FILE, EXT4_FEATURE_RO_COMPAT_GDT_CSUM,
+EXT4_FEATURE_RO_COMPAT_DIR_NLINK, EXT4_FEATURE_INCOMPAT_64BIT,
+EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE
+
+Add a new make target "checked-failed" in the tests directory which
+reruns any failed tests
+
+Update draft-leach-uuids-guids-01.txt with rfc4122.txt
+
+Fix miscellaneous bugs reported by Coverity: Dead code, potential nul
+pointer dereferences, memory leaks, etc.  None were security-critical
+problems.
+
+Fix up usage and decrement error messages in the test_icount program
+
+Add debugging code to the com_err library; if the environment variable
+COMERR_DEBUG is set to 1, print out debugging messages as error tables
+are added and removed from the com_err library.  If the
+COMERR_DEBUG_FILE environment variable is set (and the process is not
+setuid) the debugging messages may be redirected to a file.
+
+Change all of the e2fsprogs programs to use the newer add_error_table()
+and remove_error_table() interfaces instead of the much older
+initialize_*_error_table() function.
+
+Add TDB support into the ext2fs library.  This allows us to have a
+guaranteed library we can count on always being present so we can
+store data in an on-disk database.
+
+Add support for using TDB to store the icount data, so we don't run out
+of memory when checking really large filesystems.
+
+Change the regression test suite so that it skips empty test directories.
+
+Define the l_i_iversion field in ext2_inode.  The l_i_version field is
+now defined from the old l_i_reserved1 field in the ext2 inode.  This
+field will be used to store high 32 bits of the 64-bit inode version
+number.
+
+Add Makefile production rule for e2fsprogs.spec in case it gets
+deleted.
+
+Add new function profile_get_uint() to allow for a clean way to fetch
+unsigned integers from the context.
+
+Add test to make sure the ext2 superblock structure is 1024 bytes.
+
+Fix typo in name of f_dup4 regression test
+
+Add new function blkid_gc_cache() which performs a garbage collection
+pass on the /etc/blkid.tab file.
+
+The ext2fs_open() function now sets EXT2_FLAG_MASTER_SB_ONLY.  In
+general, only e2fsck (after the filesystem is clean), tune2fs, and
+resize2fs should change the backup superblocks by default.  Most
+callers of ext2fs_open() should not be touching any superblock fields
+which require the backups to be touched.
+
+Add new function to libext2fs, ext2fs_default_journal_size(), which
+returns the default journal size.
+
diff --git a/doc/RelNotes/v1.41.txt b/doc/RelNotes/v1.41.txt
new file mode 100644
index 0000000..e36e35d
--- /dev/null
+++ b/doc/RelNotes/v1.41.txt
@@ -0,0 +1,1594 @@
+E2fsprogs 1.41.14 (December 22, 2010)
+=====================================
+
+Fix spurious complaint in mke2fs where it would complain if the file
+system type "default" is not defined in mke2fs.conf.
+
+The resize2fs program will no longer clear the resize_inode feature
+when the number reserved group descriptor blocks reaches zero.  This
+allows for subsequent shrinks of the file system to work cleanly for
+flex_bg file systems.
+
+The resize2fs program now handles devices which are exactly 16T;
+previously it would give an error saying that the file system was too
+big.
+
+E2fsck (and the libext2fs library) will not use the extended rec_len
+encoding for file systems whose block size is less than 64k, for
+consistency with the kernel.
+
+Programming notes
+-----------------
+
+E2fsprogs 1.41.13 would not compile on big-endian systems.  This has
+been fixed.  (Addresses Sourceforge Bug: #3138115)
+
+The ext2fs_block_iterator2() function passed an incorrect ref_offset
+to its callback function in the case of sparse files.  (Addresses
+Sourceforge Bug: #3081087)
+    
+Fix some type-punning warnings generated by newer versions of gcc.
+
+
+E2fsprogs 1.41.13 (December 13, 2010)
+=====================================
+
+E2fsck now supports the extended option "-E journal_only", which
+causes it to only do a journal replay.  This is useful for scripts
+that want to first replay the journal and then check to see if it
+contains errors.
+
+E2fsck will now support UUID= and LABEL= specifiers for the -j option
+(which specifies where to find the external journal).  (Addresses
+Debian Bug #559315)
+
+E2fsck now has support for the problems/<problem code>/force_no
+configuration option in e2fsck.conf, which forces a problem to not be
+fixed.
+
+Dumpe2fs will now avoid printing large negative offsets for the bitmap
+blocks and instead print a message which is a bit more helpful for
+flex_bg file systems.
+
+Mke2fs will now check the file system type (specified with the -t
+option) to make sure it is defined in the mke2fs.conf file; if it is
+not, it will print an error and abort.  If the usage type (specified
+with the -T option) is not defined in mke2fs.conf, mke2fs will print a
+warning but will continue.  (Addresses Debian Bug #594609)
+
+Clarified error message from resize2fs clarifying that on-line
+shrinking is not supported at all.  (Addresses Debian Bug #599786)
+    
+Fix an e2fsck bug that could cause a PROGRAMMING BUG error to be
+displayed.  (Addresses Debian Bug #555456)
+
+E2fsck will open the external journal in exclusive mode, to prevent
+the journal from getting truncated while it is in use due to a user
+accidentally trying to run e2fsck on a snapshotted file system volume.
+(Addresses Debian Bug #587531)
+
+Fix a bug in e2fsck so it has the correct test for the EOFBLOCKS_FL
+flag.
+
+The tune2fs program can now set the uninit_bg feature without
+requiring an fsck.
+
+The tune2fs, dumpe2fs, and debugfs programs now support the new ext4
+default mount options settings which were added in 2.6.35.
+
+The e2fsck and dumpe2fs programs now support the new ext4 superblock
+fields which track where and when the first and most recent file
+system errors occurred.  These fields are displayed by dumpe2fs and
+cleared by e2fsck.  These new superblock fields were added in 2.6.36.
+
+Debugfs now uses a more concise format for listing extents in its
+stat command.  This format also includes the interior extent tree
+blocks, which previously was missing from stat's output for
+extent-based files.
+
+Debugfs has a new option, -D, which will request Direct I/O access of
+the file system.
+
+Mke2fs will skip initializing the inode table if a device supports
+discard and the discard operation will result in zero'ed blocks.
+
+Badblocks will now correctly backspace over UTF-8 characters when
+displaying its progress bar.  (Addresses Gentoo Bug #309909; Addresses
+Debian Bugs #583782 and #587834)
+
+E2freefrag will now display the total number of free extents.
+
+Resize2fs -P no longer requires a freshly checked filesystem before
+printing the minimum resize size.
+
+Fixed a floating point precision error in a binary tree search routine
+that can lead to seg fault in e2fsck and resize2fs.
+
+Fixed a bug in e2fsck where if both the original and backup superblock
+are invalid in some way, e2fsck will fail going back to the original
+superblock because it didn't close the backup superblock first, and
+the exclusive open prevented the file system from being reopened.
+
+Fixed a big in e2freefrag which caused getopt parsing to fail on
+architectures with unsigned chars.  (Addresses Gentoo Bug: #299386)
+
+Clarified an mke2fs error message so a missed common in an -E option
+(i.e., mke2fs -t ext4 -E stride=128 stripe-width=512 /dev/sda1")
+results in a more understandable explanation to the user.
+
+Mke2fs now displays the correct valid inode ratio range when
+complaining about an invalid inode ratio specified by the user.
+
+Mke2fs now understands the extended option "discard" and "nodiscard",
+and the older option -K is deprecated.  The default of whether
+discards are enabled by default can be controlled by the mke2fs.conf
+file.
+
+Mke2fs's handling of logical and physical sector sizes has been
+improved to reflect the fact that there will be some SSD's with 8k and
+16k physical sectors arriving soon.  Mke2fs will no longer force block
+size to be the physical sector size, since there will be devices where
+the physical sector size is larger than the system's page size, and
+hence larger than the maximal supported block size.  In addition, if
+the minimal and optimal io size are not exported by the device, and
+the physical sector size is larger than the block size, the physical
+sector size will be used to set the Raid I/O optimization hints in the
+superblock.
+
+E2fsck will now display a better, more specific error message when the
+user enters a typo'ed device name, instead of blathering on about
+alternate superblocks.
+
+Fixed various Debian Packaging Issues
+
+Updated/clarified man pages (Addresses Debian Bugs: #580236, #594004,
+#589345, #591083; Addresses Launchpad Bug: #505719)
+
+Update the Chinese, Chzech, Dutch, French, Germany, Indonesian,
+Polish, Swedish, and Vietnamese translations.
+
+
+Programmer's Notes
+------------------
+
+Fix a dependency definition for the static and profiled blkid
+libraries which could cause compile failures in some configurations.
+(Addresses Debian Bug: #604629)
+    
+Add support for Direct I/O in the Unix I/O access layer.
+
+Fixed a memory leak in the Unix I/O layer when changing block sizes.
+
+Fixed minor memory leaks in mke2fs.
+
+Added a new function to the ext2fs library, ext2fs_get_memalign().
+
+The tst_super_size test program will check to make sure the superblock
+fields are correctly aligned and will print them out so they can be
+manually checked for correctness.
+
+Fixed some makefile dependencies for test programs in lib/ext2fs.
+
+Reserved the feature flags and superblock fields needed for the Next3
+snapshot feature.
+
+Reserved the feature flags for EXT4_FEATURE_INCOMPAT_DIRDATA and
+EXT4_INCOMPAT_EA_INODE.
+
+
+E2fsprogs 1.41.12 (May 17, 2010)
+================================
+
+Mke2fs now gives a correct error message if the external journal
+device is not found.  (Addresses Red Hat Bug #572935)
+
+Resize2fs -P will now refuse to print a minimum size if the file
+system is not clean.  Previously it would go ahead and print a minimum
+size anyway, which might not be correct, leading to user confusion.
+
+E2fsck now tests for extents that begin at physical block 0 and
+rejects them as invalid.  (Addresses Google Bug: #2573806)
+    
+Fixed a bug in e2fsck which could cause it to crash when trying to
+remove an invalid extent and the block bitmaps hadn't yet been loaded.
+(Addresses SourceForge Bug: #2971800)
+    
+E2fsck now will completely skip time-based checks if the system clock
+looks insane or the option broken_system_clock is set in
+/etc/e2fsck.conf.
+
+E2fsck would previously report an i_blocks corruption for a 4T file
+created using posix_fallocate; this bug has been fixed.
+
+E2fsck will now correctly mark a sparse journal as invalid and will
+delete and recreate the journal to address the problem.
+
+E2fsck would previously incorrectly ask the user whether she would
+like to abort the file system check after finding a problem --- and
+then abort regardless of the user's answer.  This is annoying, and
+has been fixed.
+
+E2fsck can now continue even if it fails to recreate the resize
+inode; previously it would just abort the file system check
+altogether.
+
+E2fsck could potentially remove directory entries for inodes found in
+the unused region of the inode table; this would generally happen on
+ext4 file systems that do not use journalling.  This bug has been fixed
+by not clearing these directory entries once it has been established
+that bg_unused_inodes may not be trustworthy; once pass #2 has been
+completed, e2fsck will restart the file system check from the
+beginning, and then it will be safe to delete any directory entries
+pointing to inodes that appear to be deleted.  (Addresses Google Bug:
+#2642165)
+    
+E2fsck will not try to set the block group checksums if the user
+cancels the fsck with a control-C.  It's a bad idea to set the
+checksums if e2fsck hasn't been completed, and it often results an the
+error message, "Inode bitmap not loaded while setting block group
+checksum info".  (Addresses Launchpad Bug: #582035)
+
+The mke2fs program now queries the kernel for the physical as well as
+the logical sector size, and will not allow a blocksize below the
+logical, and will strongly encourage a blocksize at least as big as
+the physical blocksize.  This is needed for 4k sector drives that
+emulate 512 byte sector sizes.
+
+Mke2fs will now allow a flex_bg size of 1.  This is unusual, and
+rarely needed, but it is a legal value.
+
+E2fsck will check for cases where the EOFBLOCKS_FL is set when it is
+not needed, and offer to clear it; this is a sign of a kernel bug, but
+more importantly, some released kernels may crash when this situation
+is encountered on ext4 file systems.  (Addresses Google Bug: #2604224)
+    
+E2fsck will use the EOFBLOCKS_FL flag exclusively to check whether
+i_size is correct.  (Kernels starting with 2.6.34 will set
+EOFBLOCKS_FL.)
+
+The com_err library will now only output ^M (a CR character) when the
+tty is in raw mode.
+
+Update the Czech, Chinese, Dutch, French, Germany, Indonesian, Polish,
+and Vietnamese translations.
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bugs: #571247, #563487)
+
+
+Programmer's Notes
+------------------
+
+The regression test suite now uses its own mke2fs.conf file, so that
+downstream distributions want change the mke2fs.conf file which is
+distributed in the RPM or dpkg file, without worrying about screwing
+up the regression test results.
+
+Always build namei.o so that building with configure --disable-debugfs
+works correctly.  Long-term, if we care about reduced e2fsprogs
+builds, we need a more general solution for deciding what .o files are
+needed for a particular build.  Given that install floppies are going
+(gone?) the way the dodo bird, we probably don't care, though.
+(Addresses Sourceforge Bug: #2911433)
+
+Add configure options --enable-symlink-build and
+--enable-symlink-install, which allow e2fsprogs be built using
+symlinks instead of hard links, and to be installed using symlinks
+instead of hard links, respectively.  It is useful when the file
+system where the build is taking place, or the file system where
+e2fsprogs is installed, can't handle hard links for some reason.
+(Addresses Sourceforge Bug: #1436294)
+
+Fixed compile warning in mke2fs.c.
+
+    
+E2fsprogs 1.41.11 (March 14, 2010)
+==================================
+
+E2fsck will no longer give a fatal error and abort if the physical
+device has been resized beyond 2**32 blocks.  (Addresses Launchpad
+Bug: #521648)
+
+Debugfs has a bug fixed so that "logdump -b <blk>" now properly shows
+the allocation status of the block <blk>.  (Addresses Debian Bug:
+#564084)
+    
+E2fsck now prints a much more emphatic and hopefully scary message
+when a file system is detected as mounted while doing a read/write
+check of the filesystem.  Hopefully this will dissuade users from
+thinking, "surely that message doesn't apply to *me*" :-(
+
+E2fsck -n will now always open the file system read-only.  We now
+disallow certain combination of options which previously were manual
+exceptions; this is bad because it causes users to think they are
+smarter than they really are.  So "-n -c", "-n -l", "-n -L", and "-n
+-D" are no longer supported.  (Addresses Launchpad Bug: #537483)
+    
+In e2fsprogs 1.41.10, mke2fs would ask for confirmation to proceed if
+it detected a badly aligned partition.  Unfortunately, this broke some
+distribution installation scripts, so it now just prints the warning
+message and proceeds.  (Addresses Red Hat Bug: #569021. Addresses
+Launchpad Bug: #530071)
+    
+Mke2fs would take a long time to create very large journal files for
+ext4.  This was caused by a bug in ext2fs_block_iterate2(), which is
+now fixed.
+
+E2fsck now understands the EOFBLOCKS_FL flag which will be used in
+2.6.34 kernels to make e2fsck not complain about blocks deliberately
+fallocated() beyond an inode's i_size.
+
+E2fsprogs 1.41.10 introduced a regression (in commit b71e018) where
+e2fsck -fD can corrupt non-indexed directories when are exists one or
+more file names which alphabetically sort before ".".  This can happen
+with ext2 filesystems or for small directories (take less than a lock)
+which contain filenames that begin with a space or some other
+punctuation mark.  (Addresses Debian Bug: #573923, Addresses Launchpad
+Bug: #525114)
+
+
+Programmer's Notes
+------------------
+
+Add new test, f_rehash_dir, which checks to make sure e2fsck -D works
+correctly.
+
+The libcom_err function now has support for Heimdal's com_right_r
+function().  (Addresses Sourceforge Bug: #2963865, Addresses Debian
+Bug: #558910)
+
+
+E2fsprogs 1.41.10 (February 7, 2010)
+====================================
+
+Fix resize2fs bug which causes it to access invalid memory.
+
+Add libss support for libreadline.so.6.
+    
+Fix e2fsck's check for extent-mapped directory with an incorrect file
+type.
+
+Add new e2fsck.conf configuration option, default/broken_system_clock
+to support systems with broken CMOS hardware clocks.  Also, since too
+many distributions seem to have broken virtualization scripts now,
+e2fsck will by default accept dates which are off by up to 24 hours by
+default.  (Addresses Debian Bugs: #559776, #557636)
+
+Fix a bug where mke2fs may not use the best placement of the inode
+table when there is only room for a single block group in the last
+flex_bg.
+
+E2fsck is now smarter when it needs to allocate blocks in the course
+of fixing file system problems.  This reduces the number of spurious
+differences found in pass #5.
+
+E2fsck will no longer rehash directories which fit in a single
+directory block.
+
+E2fsck now correctly handles holes in extent-mapped directories (i.e.,
+sparse directories which use extents).
+
+Fix big-endian problems with ext2fs_bmap() and ext2fs_bmap2().
+
+Fix a bug in filefrag where on platforms which can allow file systems
+with 8k blocks, that it doesn't core dump when it sees a file system
+with 8k block sizes.  (Thanks to Mikulas Patocka for pointing this
+out.)
+
+E2fsck will correctly fix directories that are have an inaccurate
+i_size as well as other problems in a single pass, instead of
+requiring two e2fsck runs before the file system is fully fixed.
+
+Fix e2fsck so it will correctly find and detect duplicate directory
+entries for non-indexed directories.  ( Addresses Sourceforge Bug:
+#2862551)
+    
+Mke2fs will use BLKDISCARD to pre-discard all blocks on an SSD or
+thinly-provisioned storage device.  This can be disabled using the -K
+option.
+
+Enhance libext2fs so it works around bug in Linux version 2.6.19
+and earlier where the /proc/swaps file was missing the header on
+the first line.
+
+Fix bug in Linux version 2.6.19 and earlier where the /proc/swaps file
+was missing the header on the first line.
+
+Fix some big-endian bugs in e2fsck and libext2fs.
+
+Fix resize2fs so it works correctly on file systems with external
+journals instead of failing early with the error "Illegal inode
+number".
+
+Fix libss so that it does not seg fault when using a readline library
+which does not supply a readline_shutdown() function.
+
+Updated dumpe2fs's usage message so it correctly gives the right
+arguments summary for "-o superblock=<num>" and "-o blocksize=<num>".
+(Addresses Launchpad Bug: #448099)
+   
+Teach libext2fs to ignore the high 32 bits of the i_blocks field
+when huge_file file system feature is set, but the inode does not
+have the HUGE_FILE_FL flag set.
+
+Fix e2fsck's handling of 64-bit i_blocks fields.
+
+E2fsck will now print "Illegal indirect block", "Illegal
+double-indirect block", etc., instead of "Illegal block #-1" or
+"Illegal block #-2", etc.  This makes it easier for users to
+understand what has gone wrong.  (Addresses SourceForge Bug: #2871782)
+
+Mke2fs now will obtain get device topology information from blkid and
+use it to populate the superblock stride and stripe sizes.  It will
+also warn if the block device is misaligned
+
+Fix file descriptor leaks in fsck and debugfs.  (Addresses Novell Bug:
+##524526)
+
+Fix the libext2fs library code to round up the bitmap size to a 4-byte
+boundary, to prevent spurious seg faults caused by the x86
+architecture.  This doesn't affect Linux systems, but was a major
+problem on a number of *BSD systems.  (Addresses Sourceforge Bug:
+#2328708)
+
+Fix resize2fs's minimum size required for a file system so it doesn't
+fail when "resize2fs -M" is run.  (Addresses RedHat Bugzilla: #519131)
+    
+Dumpe2fs now prints summary information about the contents of the
+journal.
+    
+Avoid printing scary error messages when e2fsck starts running
+problems on low-memory systems, as it tends to panic and mislead the
+user.  (Addresses Debian Bug: #509529)
+
+Fix blkid's modules.dep parser so it handles compressed (.ko.gz)
+modules files.  (Address Red Hat Bug: #518572)
+    
+Fix tune2fs so it can add a journal when an extent-enabled file system
+is mounted.  (Addresses Launchpad bug: #416648)
+
+Update Czech, Indonesian, Polish and Vietnamese translations (from the
+Translation Project).
+    
+Update/clarify man pages.  (Addresses Sourceforge Bug: #2822186)
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bugs: #540111)
+
+Programmer's Notes
+------------------
+
+The configure script supports the --with-cc, --with-ccopts, and
+--with-ldopts options.  Instead, the more standard use of CC=,
+CCFLAGS=, and LDFLAGS= in the configure command line is used instead.
+Also, --with-ld, which never worked, was also removed.
+(Addresses Sourceforge Bug: #2843248)
+
+The in-tree header files are only used if the in-tree uuid or blkid
+libraries are used.  Otherwise, use the system-provided uuid or blkid
+header files if using the system-provided libraries.
+
+Fix some build failures caused by --disable-* configure options.
+
+Work around a bug in autoconf 2.64.
+
+
+E2fsprogs 1.41.9 (August 22, 2009)
+==================================
+
+Fix a bug in e2fsck routines for reallocating an inode table which
+could cause it to loop forever on an ext4 filesystem with the FLEX_BG
+filesystem feature with a relatively rare (and specific) filesystem
+corruption.  This fix causes e2fsck to try to find space for a new
+portion of the inode table in the containing flex_bg, and if that
+fails, the new portion of the inode table will be allocated in any
+free space available in the filesystem.
+
+Make e2fsck less annoying by only asking for permission to relocate a
+block group's inode table once, instead of for every overlapping
+block.  Similarly, only ask once to recompute the block group
+checksums, instead of once for each corrupted block group's checksum.
+
+Fix filefrag to avoid print the extent header if the FIEMAP ioctl is
+not present, and it needs to fall back to using the FIBMAP ioctl.
+
+Fix filefrag to correctly print the number of extents for zero-length
+files.  (Addresses Debian Bug: #540376)
+
+Filefrag now has a -B option which forces the use of the FIBMAP ioctl
+to more easily debug the FIBMAP code.
+
+Fixed filefrag for non-extent based files.
+
+Add a new program, e2freefrag, which displays information about the
+free space fragmentation in an ext2/3/4 filesystem.
+
+Fix inode resizing via tune2fs -I so that it works correctly in the
+face of non-empty bad blocks inodes, and if the filesystem was
+formatted using the "mke2fs -E stride=N" option for RAID arrays.
+
+Fix regression in ext2fs_extent_set_bmap() caused e2fsck -fD to fail
+and corrupt large directories if the directory needs to shrink by more
+than one block.  (Addresses Debian Bug: #537510)
+    
+Fix e2fsck's buggy_init_scritps=1 so that the if the last write and/or
+last mount times are in the future, they are corrected even if
+buggy_init_scripts is set.  This is needed because otherwise resize2fs
+will refuse to resize the filesystem, even after running "e2fsck -f".
+(Addresses Launchpad bug: #373409)
+
+E2fsck will now print much fuller information when the last mount time
+or last written time is in the future, since most people can't seem to
+believe their distribution has buggy init scripts, or they have a
+failed CMOS/RTS clock battery.
+
+Enhance dumpe2fs to dump the extent information via the 'stat'
+command, and more detailed extent information via the new command
+'dump_extents'.
+    
+Update French, Polish, Czech, and Swedish translations from the
+Translation Project.
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.
+
+Programmer's Notes
+------------------
+
+Fixed miscellaneous gcc -Wall warnings.
+
+Fixed memory leak in error path in ext2fs_block_iterate2()
+
+Fixed non-Linux build of the intl directory by adding support for the
+E/Q/V macros.
+
+The bitmap read/write functions now treat uninitialized bitmaps as
+unallocated; this fixes a number of problems in all e2fsprogs for ext4
+filesystems when there is a need to allocate new blocks or inodes, and
+there aren't any free blocks or inodes in the already-used block
+groups.
+
+Improve ext2fs_extent_set_bmap() to avoid creating new extents which
+get inserted into the extent tree when they are not needed.
+    
+
+E2fsprogs 1.41.8 (July 11, 2009)
+================================
+
+Fix resize2fs's online resizing, fixing a regression which in
+e2fpsrogs 1.41.7.   (Addresses Debian Bug: #535452)
+
+Fix potential filesystem corruptions caused by using resize2fs to
+shrinking ext4 filesystems with extents enabled.  (Addresses Red Hat
+Bug: #510379)
+
+Optimize uuid_generate() to avoid running uuidd if it is not setuid or
+setgid and the currently running program doesn't have write access to
+the uuidd work directory.
+
+Add safety checks (for non-Linux systems) so that uuidd isn't run with
+file descriptors 0, 1, and 2 closed; and if they are closed, uuidd
+will be careful not to close the file descriptor for its unix domain
+socket when it detaches itself from the controlling tty.  Also add
+safety checks so that if the unix domain socket between the uuid
+library and uuidd program is closed for any reason, both the library
+and the uuidd will return an appropriate error code instead of looping
+in an infinite loop.
+
+The e2croncheck script, which creates an LVM snapshot and then checks
+the ext3/4 filesystem via the LVM snapshot, has been added to the
+contrib directory.
+
+Fix the filefrag program for files that have more than 144 extents.
+
+Update French, Polish, Czech, Indonesian, and Swedish translations from
+the Translation Project.
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bug #535530)
+
+Update/clarify man pages.
+
+Programmer's Notes
+------------------
+
+Fix compilation problem when configured with --disable-uuid.
+
+Don't build uuidgen if configured with --disable-uuid.
+
+Add the new library function ext2fs_test_inode_bitmap_range(), and
+optimized ext2fs_test_block_bitmap_range(), which will be needed for
+future optimizations for e2fsck.
+
+Fix makefile dependencies for libcom_err so that the Makefiles work
+well on non-GNU make program.  (Addresses Sourceforge Patches: #2813809)
+
+Enhance the build system so that the full set of commands executed by
+the Makefiles are displayed, instead of the Linux kernel summary
+output, if the build was configured with --enable-verbose-makecmds, or
+if GNU make is in use and the V variable is non-null, i.e., via "make
+V=1".
+
+
+E2fsprogs 1.41.7 (June 29, 2009)
+================================
+
+Fix a bug in libext2fs which can cause e2fsck and resize2fs to write
+uninitialized data into the portion of the inode beyond the first 128
+bytes when operating on inodes mapped via extents; potentially
+corrupting filesystems.
+
+Fix memory leaks in e2fsprogs, including a very large memory leak
+which can cause e2fsck to run out of memory when checking very large
+filesystems using extents.
+
+The logsave program will now filter out the ^A and ^B characters when
+writing to the console.
+
+Harden ext2fs_validate_entry() so that lsdel will not read beyond the
+end of the block even if the directory block is corrupted.
+
+Fix debugfs from core dumping if the logdump command fails to open the
+output file.
+
+Enhance badblocks to print the currently tested block number when
+interrupted with ^C.
+
+Fix lsattr to exit with a non-zero status when it encounters errors.
+(Addresses RedHat Bugzilla #489841)
+
+Fix e2fsprogs to use the same encoding for rec_len in 64k (and larger)
+filesystems as the kernel when encoding rec_len >= 64k.  For 64k
+filesystems (currently all that is supported by e2fsprogs, this is
+only a minor corner case).
+
+Resize2fs will now update the journal backup fields in the superblock
+if the journal is moved; this avoids an unnecessary full fsck after
+resizing the filesystem.  (Addresses RedHat Bugzilla: #505339)
+    
+Fix libext2fs to properly initialize i_extra_size when creating the
+journal and resize inodes.
+
+Change badblocks to allow block sizes larger than 4k.
+
+Fix the filefrag program so it correctly checks for errors from the
+fiemap ioctl.
+
+Update Chinese and Czech translation from the Translation Project.
+
+Clean up various man pages.  (Addresses Debian Bug #531385 and #523063)
+
+
+Programmer's Notes
+------------------
+
+Add --disable-libuuid option to configure which uses an in-system
+installed version of libuuid; the private version is enabled by
+default.
+
+Add --valgrind-leakcheck option to the test_script program which runs
+valgrind with the appropriate options to find memory leaks.
+
+
+E2fsprogs 1.41.6 (May 30, 2009)
+===============================
+
+Fix a critical regression in e2fsck introduced version 1.41.5 which
+can undo updates to the block group descriptors after a journal replay.
+
+If e2fsck receives an I/O error while replaying the journal, prompt
+the user whether they want to ignore the error or not; if e2fsck is
+run in preen mode, force fsck to abort the preen pass.
+
+Fix a bug which would cause e2fsck to core dump if the filesystem
+contains a corrupt extent header, and the user declines to clear the
+inode.  (Addresses Sourceforge Bug: #2791794)
+    
+Fix e2fsck to restart only once in the case of multiple block groups
+which inodes in use that are in the uninitialized part of the block
+group's inode table.
+
+To reduce user confusion, if the /etc/mtab file is missing
+ext2fs_check_mount_point and ext2fs_check_if_mounted will return a
+new, explicit error code to indicate this case.  This will cause
+e2fsck to give a clearer error message when the user is using buggy
+rescue CD's that don't properly set up /etc/mtab.  (Addresses Debian
+Bug: #527859)
+    
+Fix e2fsck so that if the primary group descriptors are corrupted, but
+the backup superblock is entirely invalid, to go back to using (and
+fixing) the primary group descriptors instead of completely giving up
+on the filesystem.  (Addresses Debian Bug: #516820)
+    
+Change e2fsck to not abort a preen pass if an inode is found to have
+i_file_acl_hi non-zero.  Ext3 filesystems don't care, and newer
+kernels (post 2.6.29) will ignore this field.  So let's fix it
+automatically during the preen pass instead of forcing the user to fix
+this up manually.  (Addresses Debian Bug: #526524)
+    
+Add resource tracking for e2fsck passes 1b through 1d.
+
+Speed up e2fsck by eliminating unnecessary journal checks if the
+filesystem is already mounted and doesn't need recovery (since the
+kernel would have run the journal when the filesystem was mounted.)
+Also speed up e2fsck by avoiding unnecessary block group descriptor
+updates in ext2fs_close().
+
+Add support to chattr to migrate inodes from using direct/indirect
+blocks to extents.
+
+Avoid corrupting the filesystem if there is an attempt to shrink a
+filesystem using resize2fs smaller than possible by making
+ext2fs_set_bmap() more careful not to delete the old block until the
+new block can be inserted.  In addition, fix a bug in how the minimum
+size of the filesystem (plus a safety margin) is calculated, and
+modify resize2fs to refuse to shrink the filesystem below that minimum
+size without the force flag.
+
+Teach blkid to try to figure out DM device names using take advantage
+of information in sysfs when running on kernels (2.6.29 and later)
+which provide this information in /sys/block/dm-<N>/dm/name; this is
+much faster than scanning for the device number in /dev/mapper.
+
+Fix blkid to prefer /dev/mapper/<name> device names instead of the
+private /dev/dm-X names.
+
+Add an -a option to debugfs's close_filesys command which writes any
+changes to the superblock or block group descriptors to all of the
+backup superblock locations.
+    
+Add support to the filefrag program to use the FIEMAP ioctl.
+
+Update Chinese translation from the Translation Project.
+
+Clean up various man pages.  (Addresses Red Hat Bugzilla: #502971 and
+Launchpad Bug: #381854)
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.  (Addresses Debian Bug #506064)
+
+
+Programmer's Notes
+------------------
+
+Add test code to make sure e2fsck's problem.c doesn't have two problem
+codes assigned to duplicate values.
+
+Avoid using a hard-coded path for /bin/rm in block's test_probe.in.
+(Addresses Sourceforge Bug: #2780205)
+
+Clean up e2fsck by removing #ifdef RESOURCE_TRACK by adding an empty
+function declaration for init_resource_track() and
+print_resource_track() when RESOURCE_TRACK is not defined.
+
+The test code which is used to build the tst_csum program has been
+moved from from tst_csum.c into csum.c under an #ifdef DEBUG to to
+avoid compile problems caused by not having a prototype for
+ext2fs_group_desc_csum().  (Addresses Sourceforge Bug #2484331)
+
+Update the config.guess and config.sub file to the latest from the
+FSF, to allow e2fsprogs to build on the avr32 platform.  (Addresses
+Debian Bug: #528330)
+
+Add a new function, ext2fs_extent_open2(), which behaves like
+pext2fs_extent_open(), but uses the user-supplied inode structure
+when opening an extent instead of reading the inode from disk.
+
+
+E2fsprogs 1.41.5 (April 23, 2009)
+=================================
+
+Fix a number of filesystem corruption bugs in resize2fs when growing
+or shrinking ext4 filesystems off-line (i.e., when the ext4 filesystem
+is not mounted).
+
+Debugfs can now set i_file_acl_high via the set_inodes_field command,
+and print a 64-bit file acl.  This is useful for debugging filesystem
+corruptions where the high bits of i_file_acl_high are set.  E2fsck
+will detect and fix non-zero i_file_acl_high on 32-bit filesystems
+since some Linux kernel versions pay attention to this field even when
+they shouldn't.
+
+Speed up e2fsck when checking clean filesystems by avoiding
+unnecessary block reads, and coalescing the block group descriptor
+blocks so they are read using a single read operation.
+
+The libuuid library will now close all file descriptors before running
+uuidd.  This avoids problems when the calling program has open sockets
+which then never get closed because uuidd is a long-running helper
+daemon.  (Addresses Launchpad bug: #305057)
+
+In order to avoid unnecessary full filesystem checks by e2fsck after
+an on-line resize, e2fsck will ignore the NEEDS_RECOVERY flag set on
+the backup superblocks.  (Addresses Red Hat Bugzilla: #471925)
+
+Mke2fs will avoid trying to create the journal when run in
+superblock-only mode (mke2fs -S), since the left-over journal in the
+inode table will cause mke2fs to fail.
+
+Fix a bug in libext2fs functions that check to see if a particular
+device or filesystem image is mounted, which would cause these
+functions to report that a file identical to the (relative) pathname
+used by a pseudo-filesystem was mounted when in fact it was not.
+
+Update Czech translation from the Translation Project.
+
+Add Chinese (simplified) translation from the Translation Project.
+
+Fix support for external journals (which was broken in e2fsprogs
+1.41.4).
+
+Fix a regression in debugfs where the "stat" command when no
+filesystem was open would cause debugfs to crash with a segmentation
+violation.
+
+Starting in the 2.6.29 linux kernel, the ext4 filesystem driver can be
+used to support filesystems without a journal.  Update the blkid
+library so it understands this.
+
+The blkid library will remove an entry from the blkid cache
+representing the entire disk if partitions are found, since presumably
+the device previously had no partition table, but has now transitioned
+to using a partition table.
+
+Add a check to mke2fs and tune2fs that the argument to the -m option
+(which specifies the reserved ratio) must be greater than zero.
+(Addresses Debian Bug: #517015)
+
+Add support for tracking the number kilobytes written to the
+filesystem via the superblock field s_kbytes_written.  It will be
+updated by the kernel as well as by e2fsprogs programs which write to
+the filesystem.  This is useful for tracking the wear to filesystems
+on Solid State Drives.
+
+Fix compatibility issue in the libext2fs info file and makeinfo
+version 4.12.  (Addresses Red Hat Bugzilla: #481620)
+
+Update/clarify man pages.  (Addresses Debian Bug: #515693, #365619)
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details. (Addresses Debian Bug: #506279)
+
+Programmer's Notes
+------------------
+
+Fix Hurd compilation problem in e2fsck and tune2fs (Addresses Debian
+Bug: #521602)
+
+Fix various gcc compilation warnings and other programming cleanups.
+(Addresses Red Hat Bugzilla: #486997)
+
+Add support for building the blkid command statically.
+
+Add support for disabling the built-in blkid library in favor of a
+system-installed blkid implementation via the configure option
+--disable-libblkid.
+
+
+E2fsprogs 1.41.4 (January 27, 2009)
+===================================
+
+Fixed a bug which could sometimes cause blkid to return an exit value
+of zero for a non-existent device (Addresses Debian Bug: #502541)
+
+Blkid will now recognize ext3 filesystems that have the test_fs flag
+set as ext3 filesystems.
+
+The blkid library will now recognize btrfs filesystems and swap
+devices currently used by user-level software suspend.
+
+Tune2fs now updates the block group checksums when changing the UUID
+to avoid causing e2fsck to complain vociferously at the next reboot.
+
+Tune2fs's inode size resizing algorithms have been fixed so it is not
+vastly inefficient for moderate-to-large filesystems, due to some
+O(n**2) and O(n*m) algorithms that didn't scale well at all.
+
+Fix tune2fs's inode resizing algorithm so it will not corrupt
+filesystems laid out for RAID filesystems; in addition, tune2fs will
+refuse to change the inode size for filesystems that have the flex_bg
+feature enabled.  (This is a limitation in the current implementation
+of tune2fs -I.)
+
+E2fsprogs 1.41 broke debugfs's logdump command for normal ext3/4
+filesystems with 32-bit block numbers, when the headers for 64-bit
+block numbers was added.  This regression has been fixed.
+
+Debugfs's ncheck command has been fixed to avoid printing garbage
+characters at the end of file names.
+
+Fix resize2fs for ext4 filesystems.  Some blocks that that need moving
+when shrinking filesystems with uninit_bg feature would not be moved.
+In addition, blocks and inode table blocks were not being correctly
+freed when shrinking filesystems with the flex_bg feable, which caused
+resize2fs -M to fail.  Finally, when blocks are moved, make sure the
+uninitialized flag in extents is preserved.
+
+Fix bug which caused dumpe2fs to abort with an error if run on a
+filesystem that contained an external journal.
+
+Some distributions used "mke3fs" as an alias for "mkfs.ext3"; check
+for this in argv[0] to provide better legacy support for these
+distributions.  This is a practice that should NOT be continued,
+however.
+
+Mke2fs now has a new option -U, which allows the user to specify the
+UUID that should be used for the new filesystem.
+
+Mke2fs will treat devices that are exactly 16TB as if they were 16TB
+minus one block.  This allows users who have read that ext3 supports
+up to 16TB filesystems and who create a 16TB LVM to not get confused,
+since the true limit is really 16TB minus one block.
+
+E2fsck will no longer abort an fsck run if block group has an errant
+INODE_UNINIT flag.
+
+E2fsck now distinguishes between fragmented directories and fragmented
+files in verbose mode statistics and in the fragcheck report.
+
+Fix a bug in e2fsck which caused it double count non-contiguous
+extent-based inodes.
+
+E2fsck will leave some slack space when repacking directories to allow
+room for a few directory entries to be added without causing leaf
+nodes to be split right away.
+
+Fix a bug which caused e2fsck to crash when it comes across a
+corrupted interior node in an extent tree with the error message:
+"Error1: Corrupt extent header on inode XXXXXX"
+
+E2fsck problem descriptions involving the journal are no longer
+referred to as "ext3" problems, since ext4 filesystems also have
+journals.
+
+Fix a long-standing bug in e2fsck which would cause it to crash when
+replying journals for filesystems with block sizes greater than 8k.
+
+Update Catalan translation from the Translation Project.
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details. (Addresses Debian Bugs: #503057, #502323, #511207)
+
+Programmer's Notes
+------------------
+
+Fix build of e2fsck.profiled, and add support for building profiled
+binaries in the misc directory if configured with --enable-profile.
+
+The ext2fs_open() function now performs more sanity checks on the
+superblock to avoid potential divide by zero errors by other parts of
+library.
+
+The ext2fs_read_inode_full() function now has a safety check to avoid
+a segmentation fault on corrupted filesystems.
+
+The ext2fs_new_inode() function now has a sanity check so that if the
+s_first_inode field in the superblock is insane, it will return
+EXT2_ET_INODE_ALLOC_FAIL instead of returning an invalid inode number.
+
+To avoid segmentation faults, ext2fs_block_alloc_stats() and
+ext2fs_inode_alloc_stats() now validates the passed inode or block
+number to avoid overrunning an array boundary.
+
+Various signed/unsigned errors for variables containing block numbers
+have been fixed.
+
+Accommodations for gcc's stupidity in not realizing that constant
+strings that do not contain a '%' character are safe to use in format
+strings have been made so that distributions that want to compile
+e2fsprogs with -Werror=format-security have an easier time doing so.
+
+Added a new 64-bit getsize interface, ext2fs_get_device_size2().
+
+Added the utility make-sparse.c to the contrib directory.
+
+The ext2fs_block_iterate2() function now reflects errors from
+ext2fs_extent_set_bmap() to the caller, if the callback tries to
+change a block on an extent-based file, and ext2fs_extent_set_bmap()
+fails for some reason (for example, there isn't enough disk space to
+split a node and expand the extent tree.
+
+The ext2fs_block_iterate2() function will preserve the uninit flag in
+extents when the callback function modifies a block in an extent-based
+file.
+
+E2fsck will now flag filesystems that have an insane s_first_ino field
+in their superblock, and attempt to use a backup superblock to repair
+the filesystem.
+
+
+E2fsprogs 1.41.3 (October 12, 2008)
+===================================
+
+E2fsck has been fixed so it prints the correct inode number for
+uinit_bg related problems.
+
+E2fsck will now offer to clear the test_fs flag if the ext4 filesystem
+is available on linux.  This can be disabled via a configuration
+option in /etc/e2fsck.conf.
+
+Fix a file descriptor leak in libblkid when checking to see if an ext4
+or ext4dev module exists.
+
+Fix a bug in e2fsck where in preen mode, if there are disk I/O errors
+while trying to close a filesystem can lead to infinite loops.
+(Addresses Red Hat Bugzilla #465679)
+    
+Fix a bug in resize2fs where passing in a bogus new size of 0 blocks
+will cause resize2fs to drop into an infinite loop.  (Addresses Red
+Hat Bugzilla: #465984)
+    
+Add a check in the Unix I/O functions in libext2fs so that when a
+device is opened read/write, return an error if the device is
+read-only using the BLKROGET ioctl.
+
+Fix debugfs's ncheck command so that it prints all of the names of
+hardlinks in the same directory.
+
+Fix a bug in libblkid so it correctly detects whether the ext4 and
+ext4dev filesystems are available, so that the ext4dev->ext4
+fallback code works correctly.
+
+Programmer's Notes
+------------------
+
+Fix a parallel build problem by making sure util/subst is built before
+trying to build the lib/et directory.  (Addresses Sourceforge Bug:
+#2143281)
+
+Updated "make depend" information for crc16.o
+    
+
+E2fsprogs 1.41.2 (October 2, 2008)
+==================================
+
+Fix e2fsck's automatic blocksize detection.  This fixes a regression
+from e2fsprogs 1.40.7 which caused e2fsck to fail if the user
+specifies a block number using the -b option if the blocksize option
+isn't also specified using -B.  Unfortunately, users very commonly
+invoke e2fsck using "e2fsck -b 32768 /dev/hdXXX" to use the backup
+superblock; in fact e2fsck will often suggest this kind of command
+line.  Oops.
+
+Enhance the debugfs's "ncheck" command so it will print all of the
+pathnames for the specified inodes.  (Previously, in some cases ncheck
+might not print a pathname for an inode at all if some of the other
+inodes had multiple hard links.)
+
+Enhance debugfs's "hash" command so the hash seed can be specified via
+a command-line option.  In addition, allow the hash algorithm to be
+specified by name instead of just by number.
+
+Fix e2fsck so that we don't accidentally print the translation file's
+header when asking the user a custom question so there is no prompt
+defined for a particular problem record.  For example, the question
+"Run journal anyway" will get the PO header tacked on because e2fsck
+erroneously passed the null string to _().  (Addresses Launchpad Bug:
+#246892)
+
+Enhance badblocks so that it can test a normal file which is greater
+than 2GB.
+
+Enhance the badblocks command so that it displays the time and
+percentage complete when in verbose mode.  (Addresses Debian Bug:
+#429739)
+
+Fix a potential memory leak in a error handling path in debugfs's
+ncheck function.
+
+Fix a potential memory corruption problem if a memory allocation fails
+in resize2fs.
+
+Fix the usage message for debugfs's logdump command to be consistent
+with its man manpage.
+
+Update Polish, French, Vietnamese, Dutch, Indonesian, German, Czech,
+and Swedish translations from the Translation Project.
+
+Add documentation for the file I/O functions to the libext2fs.texinfo
+file.  (Addresses Debian Bug: #484877)
+    
+Update and clarified various man pages.  (Addresses Launchpad Bug
+#275272; Addresses Debian Bugs: #498100, #498101, #498102, #498103)
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details. (Addresses Debian Bug: #497619)
+
+Programmer's Notes
+------------------
+
+Fix a potential file descriptor leak in libcom_err by setting the
+close-on-exec flag for a fd used for debugging.  (Addresses Red Hat
+Bugzilla #464689)
+
+Fix a potential race in libcom_err by using sem_post/sem_init.  SuSE
+has been carrying a patch for a long time to prevent a largely
+theoretical race condition if a multi-threaded application adds and
+removes error tables in multiple threads.  Unfortunately SuSE's
+approach breaks compatibility by forcing applications to link and
+compile with the -pthread option; using pthread mutexes has
+historically been problematic.  We fix this by using sem_post/sem_init
+instead.
+
+Fix e2fsprogs-libs build failure due to 'subs' target.  (Addresses
+Sourceforge Bug: #2087502)
+
+Avoid linking e2initrd_helper, debugfs, blkid, and fsck with unneeded
+libraries when using ELF shared libraries.
+
+Fix ELF shared library when building on systems that don't already
+have the e2fsprogs shared libraries already installed.  (Addresses
+Sourceforge Bug: #2088537)
+
+Fix the pkg-config files so they work correctly when linking with
+static libraries and fix the include directory so programs don't have
+to use #include <ext2fs/ext2fs.h>, but can use #include <ext2fs.h>
+instead.  (Addresses Sourceforge Bug: #2089537)
+    
+Make sure ext2fs_swab64() is compiled for all platforms, and not just
+for x86.  (Addresses Debian Bug: #497515)
+    
+Remove the unused ext2fs_find_{first,ext}_bit_set() functions for all
+non-x86 platforms.  (They had been removed for x86 earlier.)
+
+Fix diet libc compilation support, which had bitrotted due to lack of
+TLC.  Fixing this improves general portability.
+
+When installing the link library when using ELF shared libraries,
+avoid using absolute pathnames if the link library and the shared
+library are installed in the same directory.  (Addresses Sourceforge
+Bug: #1782913)
+
+Fix gen-tarball so it will work even if the top-level directory has
+been renamed to something other than "e2fsprogs".  Also make
+gen-tarball print the size of the resulting tar.gz file.
+
+
+E2fsprogs 1.41.1 (September 1, 2008)
+====================================
+
+Many people are forgetting to update their mke2fs.conf file, and this
+causes ext3, ext4, and ext4dev filesystems won't get created with the
+proper features enabled.  We address this in two ways.  First, mke2fs
+will issue a warning if there is not definition for an ext3, ext4, or
+ext4dev filesystem and the user is trying to create such a filesystem
+type.  Secondly, when installing from a source build, "make install"
+will provide basic configuration file handling for /etc/mke2fs.conf.
+If it exists, and does not mention ext4dev, it will be moved aside to
+/etc/mke2fs.conf.e2fpsrogs-old and the new /etc/mke2fs.conf file will
+be installed.  If the existing /etc/mke2fs.conf file does mention
+ext4dev, then "make install" will install official mke2fs.conf file as
+/etc/mke2fs.conf.e2fsprogs-new and issue a message to the user that
+they should look to see if any changes need to be merged.
+
+The mke2fs program will now create the journal in the middle of the
+filesystem, since this minimizes seek times on average for fsync-heavy
+workloads.  In addition, mke2fs will now create journals using extents
+for filesystems that support them.  This results in a more efficient
+encoding for the journal since it eliminates the need for using
+indirect blocks.
+
+The mke2fs program will avoid allocating an extra block to the
+journal.  (Addresses Sourceforge Bug: #1483791)
+
+Mke2fs will correctly enforce the prohibition against features
+(specifically read-only features) in revision 0 filesystems.  (Thanks
+to Benno Schulenberg for noticing this problem.)
+
+Mke2fs previously would occasionally create some slightly non-optimally
+placed inode tables; this bug has been fixed.
+
+The mke2fs and tune2fs programs now print the correct usage message
+describing the maximum journal size.  (Addresses Debian Bug: #491620)
+
+Add support for setting the default hash algorithm used in b-tree
+directories in tune2fs (from a command-line option) or mke2fs (via
+mke2fs.conf).  In addition, change the default hash algorithm to
+half_md4, since it is faster and better.
+
+The blkid library will now recognize MacOS hfsx filesystems, and
+correctly extract the label and uuid for hfs, hfsx, and hfsplus
+filesystems.  (Addresses Sourceforge Feature Requests: #2060292)
+
+The blkid library has improved detection of JFS and HPFS filesystems.
+(Addresses Launchpad Bug: #255255)
+
+The blkid library is now much more efficiently handling devicemapper
+devices, mainly by no longer using the devicemapper library.  This can
+speed up access for systems with a large number of device mapper
+devices.
+
+Blkid had a number of cache validation bugs in libblkid that have been
+fixed.   (Addresses Debian Bug: #493216)
+
+Resize2fs will now properly close out the "updating inode references"
+progress bar so there is a newline printed before printing the final
+"resize is successful" message.
+
+Resize2fs will now correctly handle filesystems with extents and/o
+uninitialized block groups correctly when file/directory blocks need
+to relocated (i.e., when shrinking a filesystem or if the resize_inode
+is not present).  To support this, the ext2fs library now supports
+initializing inode and block bitmaps that are not yet initialized when
+allocating them using ext2fs_new_block() and ext2fs_new_inode().  In
+addition, e2fs_block_iterate2() can now support changing the location
+of interior nodes of an extent tree, and ext2fs_extent_set_bmap() has
+been optimized to avoid creating unnecessary new extents when updating
+the location of blocks in the extent tree.  This will also help out
+e2fsck's recovery of obscurely corrupted filesystems with extents,
+when blocks are claimed by multiple inodes.
+
+Add support for on-line resizing ext4 filesystem with the flex_bg
+filesystem feature.  The method for doing so is not optimal, but to do
+a better job will require kernel support.
+
+E2fsprogs 1.41.0 introduced a bug in libext2fs which caused e2image and
+debugfs programs to not be able to read e2image files; the signed
+vs. unsigned bug in the code which read bitmaps from the e2image has
+been fixed.   (Addresses Debian Bug: #495830)
+
+Resize2fs is now correctly managing the directory in-use counts when
+shrinking filesystems and directory inodes needed to be moved from one
+block group to another.  This bug has been around since e2fsprogs
+1.26, and is largely harmless, but does cause a filesystem corruption
+which will be flagged by e2fsck after the filesystem has been shrunk.
+ 
+E2fsck will no longer issue spurious complaints about the inode size
+caused by very large extent-based files, and by blocks reallocated
+using fallocate() with the FALLOC_FL_KEEP_SIZE option.  (Addresses
+Kernel Bugzilla: #11341)
+
+Mke2fs will now set the creation timestamp on the lost+found directory
+and the root directory.  (More generally, all new inodes created using
+the ext2fs library will correctly set the creation timestamp.)
+
+E2fsck now correctly calculates ind/dind/tind statistics in the
+presence of extent-based files.  In addition, "e2fsck -v" will report
+statistics of the depth of extent trees in the filesystem.  E2fsck can
+also give an inode fragmentation report using "e2fsck -E fragcheck"
+which can be useful when debugging the kernel block allocation
+routines.
+
+Fix support for empty directory blocks in ext4 filesystems with 64k
+blocksize filesystems.
+
+E2fsck will now print the depth of corrupt htree directories.
+
+Debugfs's htree command now correctly understands extent-based
+directories.  It will also print out the minor hash as well as the
+major hash.
+
+Debugfs has a new command which will print the supported features of
+e2fsprogs, to enable scripts to know whether the installed version of
+e2fsprogs can support a specific feature.
+
+Debugfs will now write files using extents for filesystems that
+support them.
+
+The error message printed by "tune2fs -I" if the inode size was too
+small was rather confusing, so it has been improved.  Also, we won't
+try to create an undo log until we know that command-line-specified
+parameters such as "tune2fs -I <inode size>" are valid.
+
+Given some filesystems found "in the wild" that had non-zero block
+group checksums even though the uninit_bg/gdt_sum feature was not
+enabled, e2fsck would issue spurious error messages.  Teach
+ext2fs_group_desc_csum_verify() to ignore the block group checksum
+entirely if the feature flag is not set.  (Addresses Debian Bug:
+#490637)
+
+The blkid program will now print out a user-friendly listing of all of
+the block devices in the system and what they contain when given the
+-L option.  (Addresses Debian Bug: #490527)
+
+The filefrag program now has a more accurate calculation for the
+number of ideal extents.  (Addresses Debian Bug: #458306)
+
+The test I/O manager is now enabled by default, but its overhead is
+only incurred when it would be enabled via the TEST_IO_FLAGS or
+TEST_IO_BLOCK environment variables.
+
+Typographical errors in various program strings and usage messages
+have been fixed; most of these were pointed out by the e2fsprogs
+message catalog translators.  (Thanks, translators!)
+
+Update and clarified various man pages, as well as some typographical
+errors in the libext2fs texinfo file.
+
+Fixed various Debian packaging issues --- see debian/changelog for
+details.
+
+Add Indonesian and update French, Polish, Dutch, German, Swedish,
+Czech, and Vietnamese Translations.  (Addresses Debian Bugs: #313697,
+#401092)
+
+Programmer's Notes
+------------------
+
+Fix portability problem with the badblocks group; for systems that
+don't have nanosleep(), try using usleep() instead.
+
+The "make check" target in the e2fsck directory now sets
+LD_LIBRARY_PATH before running the various e2fsck internal library
+regression tests.
+
+The crc32 regression test in the e2fsck library is now portable to
+greater variety of environments, including big-endian systems and
+when cross-building e2fsprogs for embedded systems.  (Addresses
+Sourceforge Bug: #2019287)
+
+The ext2fs_extent_set_bmap() had some bugs when setting the first
+block in a file, or when replacing a single block extent.  Those cases
+fortunately were came up relatively rarely when e2fsck was checking
+files, but caused some problems when resize2fs was shrinking
+extent-based files.
+
+Fix a potential core-dumping bug in libe2p's iterate_on_dir()
+function.
+
+Various ext2fs library functions --- ext2fs_block_iterate2(),
+ext2fs_initialize() and ext2fs_extent_open() --- now correctly free
+allocated memory to avoid memory leaks in all of their error return
+paths.
+
+Ext2ed was failing to build because masix support had been removed in
+the rest of e2fsprogs, so ext2ed no longer has masix support, either.
+
+The configure script now respects the LDFLAGS environment variable if
+it is set when configure is called.  (Addresses Sourceforge Feature
+Request: #1937287)
+
+Libuuid is now more portable to the Windows platform.  (Addresses
+Sourceforge Feature Request: #1937287)
+
+The configure script now uses AC_MSG_{RESULT,WARN,ERROR} instead of
+bare echo commands so that configure flags such as --quiet work
+correctly.  (Addresses Sourceforge Patches: #2058794)
+
+A few uses of sprintf have been removed from the ext2fs library to
+make life easier for bootloaders with a limited libc environment.
+(Addresses Sourceforge Bug: #2049120)
+
+The ext2fs_read_inode() checks the validity of the inode number passed
+to it earlier, to avoid doing some needless work when it would fail
+anyway.
+
+The ext2fs_open() checks the validity of the blocksize parameter
+passed to it earlier, to avoid doing some needless work when it would
+fail anyway.
+
+Disable a very annoying automatic "%.sh -> %" GNU make rule in the
+top-level Makefile.  That automatic rule is used to better support
+SCCS, but it caused problems for a particular niche distribution which
+likes to use configure.sh files to store the configure options used to
+build a package.  Unfortunately GNU make will use the configure.sh to
+replace the configure script, resulting in a self-inflicted fork bomb
+leading to an out-of-memory crash.
+
+To support old GNU C compilers don't use C99/C++ comments, but only
+K&R style comments, and don't try to use __builtin_expect if __GNUC__
+is less than 3.  (__builtin_expect is only supported for gcc versions
+2.96 and up, and it's tricky to check for gcc 2.95 vs gcc 2.96; since
+this is an optimization, we only try to use __builtin_expect for gcc 3
+and up.)
+
+In e2fsck's crc routines, make sure we use WORDS_BIGENDIAN instead of
+__LITTLE_ENDIAN, which are only defined by glibc's header files and
+hence isn't portable.
+
+For the convenience for some distributions that need a static tune2fs,
+the Makefile for misc/ now has a tune2fs.static target.
+
+The ext2fs_block_iterate2() function now supports BLOCK_FLAG_APPEND
+for extent-based files
+
+The ext2fs_bmap() function now supports BMAP_ALLOC for extent-based
+files.
+
+All source files no longer have any trailing white space.
+
+The io_channel_read_blk64() and io_channel_write_blk64() functions are
+now functions instead of C preprocessor macros to provide better
+forward compatibility.
+
+The e2fpsrogs translation template now expands the @x abbreviation.
+
+Various namespace leakages in libblkid, libe2p, and libext2fs have
+been fixed.
+
+Fix a parallel build problem in e2fsprogs.