Imported Upstream version 4.2 upstream upstream/4.2
authorTizenOpenSource <tizenopensrc@samsung.com>
Mon, 26 Dec 2022 08:25:57 +0000 (17:25 +0900)
committerTizenOpenSource <tizenopensrc@samsung.com>
Mon, 26 Dec 2022 08:25:57 +0000 (17:25 +0900)
137 files changed:
.gitignore [deleted file]
.travis.yml [deleted file]
ChangeLog
Makefile.am
Makefile.in [new file with mode: 0644]
NEWS
README
README.md [deleted file]
aclocal.m4 [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
bin/Nindent [deleted file]
compile [new file with mode: 0755]
config.guess [new file with mode: 0755]
config.rpath [new file with mode: 0755]
config.sub [new file with mode: 0755]
configure [new file with mode: 0755]
configure.ac
depcomp [new file with mode: 0755]
install-sh [new file with mode: 0755]
manpages/Makefile.in [new file with mode: 0644]
manpages/de/fatlabel.de.8 [deleted file]
manpages/de/fsck.fat.de.8 [deleted file]
manpages/de/mkfs.fat.de.8 [deleted file]
manpages/fatlabel.8.in
manpages/fsck.fat.8.in
manpages/mkfs.fat.8.in
manpages/po/de/fatlabel.8.po [deleted file]
manpages/po/de/fsck.fat.8.po [deleted file]
manpages/po/de/mkfs.fat.8.po [deleted file]
manpages/po4a.cfg [deleted file]
manpages/pot/fatlabel.8.pot [deleted file]
manpages/pot/fsck.fat.8.pot [deleted file]
manpages/pot/mkfs.fat.8.pot [deleted file]
missing [new file with mode: 0755]
src/Makefile.am
src/Makefile.in [new file with mode: 0644]
src/blkdev/blkdev.c
src/blkdev/blkdev.h
src/boot.c
src/boot.h
src/charconv.c
src/charconv.h
src/check.c
src/check.h
src/common.c
src/common.h
src/device_info.c
src/device_info.h
src/fat.c
src/fat.h
src/fatlabel.c
src/file.c
src/fsck.fat.c
src/fsck.fat.h
src/io.c
src/io.h
src/lfn.c
src/mkfs.fat.c
src/testdevinfo.c
test-driver [new file with mode: 0755]
tests/Makefile.am
tests/Makefile.in [new file with mode: 0644]
tests/check-bad_names.fsck
tests/check-bad_names.xxd [new file with mode: 0644]
tests/check-chain_to_free_cluster.xxd [new file with mode: 0644]
tests/check-chain_to_other_file.xxd [new file with mode: 0644]
tests/check-chain_too_long.xxd [new file with mode: 0644]
tests/check-circular_chain.xxd [new file with mode: 0644]
tests/check-dot_entries.xxd [new file with mode: 0644]
tests/check-duplicate_names.xxd [new file with mode: 0644]
tests/check-fat12_first_cluster.args [new file with mode: 0644]
tests/check-fat12_first_cluster.fsck [new file with mode: 0644]
tests/check-fat12_first_cluster.xxd [new file with mode: 0644]
tests/check-fat16_dos_cln_shut.fsck [new file with mode: 0644]
tests/check-fat16_dos_cln_shut.xxd [new file with mode: 0644]
tests/check-fat16_first_cluster.args [new file with mode: 0644]
tests/check-fat16_first_cluster.fsck [new file with mode: 0644]
tests/check-fat16_first_cluster.xxd [new file with mode: 0644]
tests/check-fat32_dos_cln_shut.fsck [new file with mode: 0644]
tests/check-fat32_dos_cln_shut.xxd [new file with mode: 0644]
tests/check-fat32_first_cluster.args [new file with mode: 0644]
tests/check-fat32_first_cluster.fsck [new file with mode: 0644]
tests/check-fat32_first_cluster.xxd [new file with mode: 0644]
tests/check-huge.fsck [new file with mode: 0644]
tests/check-label-different.fsck [new file with mode: 0644]
tests/check-label-different.xxd [new file with mode: 0644]
tests/check-label-only-boot.fsck [new file with mode: 0644]
tests/check-label-only-boot.xxd [new file with mode: 0644]
tests/check-label-only-root.fsck [new file with mode: 0644]
tests/check-label-only-root.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_dosfslabel_empty.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_dosfslabel_empty.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_dosfslabel_label2.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_dosfslabel_label2.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_mlabel_NO_NAME.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_mlabel_erase.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_mlabel_erase.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_xp_erase.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_xp_erase.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_xp_label2.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_label1_xp_label2.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_none.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_none.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_none_dosfslabel_label1.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_none_dosfslabel_label1.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_none_xp_label1.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_none_xp_label1.xxd [new file with mode: 0644]
tests/label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label [new file with mode: 0644]
tests/label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd [new file with mode: 0644]
tests/label-fat32_xp_label1.label [new file with mode: 0644]
tests/label-fat32_xp_label1.xxd [new file with mode: 0644]
tests/label-fat32_xp_none.label [new file with mode: 0644]
tests/label-fat32_xp_none.xxd [new file with mode: 0644]
tests/label-fat32_xp_none_dosfslabel_label1.label [new file with mode: 0644]
tests/label-fat32_xp_none_dosfslabel_label1.xxd [new file with mode: 0644]
tests/label-fat32_xp_none_mlabel_label1.label [new file with mode: 0644]
tests/label-fat32_xp_none_mlabel_label1.xxd [new file with mode: 0644]
tests/mkfs-fat32_2_res_sects.mkfs [new file with mode: 0644]
tests/mkfs-fat32_2_res_sects.xxd [new file with mode: 0644]
tests/mkfs-fat32_4K.mkfs [new file with mode: 0644]
tests/mkfs-fat32_4K.xxd [new file with mode: 0644]
tests/referenceFAT16.xxd
tests/referenceFAT32.xxd
tests/referenceFAT32mbr.mkfs [new file with mode: 0644]
tests/referenceFAT32mbr.xxd [new file with mode: 0644]
tests/test-fsck
tests/test-label [new file with mode: 0755]
tests/test-mkfs

diff --git a/.gitignore b/.gitignore
deleted file mode 100644 (file)
index 11a3c89..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-*.o
-src/fatlabel
-src/fsck.fat
-src/mkfs.fat
-src/testdevinfo
-tests/*.log
-tests/*.trs
-
-tags
-TAGS
-*~
-.*.sw[a-p]
-*.orig
-*.rej
-*.DS_Store
-
-aclocal.m4
-autom4te.cache
-config.guess
-config.log
-config.status
-config.sub
-configure
-compile
-depcomp
-install-sh
-missing
-test-driver
-.deps
-.dirstamp
-
-Makefile
-Makefile.in
-src/version.h
-manpages/fatlabel.8
-manpages/mkfs.fat.8
-manpages/fsck.fat.8
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index efe27fd..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-language: c
-
-before_script: autoreconf -i
-script: ./configure && make all check
index 9e0665a..f445722 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+commit eb9111e
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 31 13:26:03 2021 +0100
+
+    Add missing files into distribution tarball
+
+commit 52518ae
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 31 03:03:39 2021 +0100
+
+    mkfs.fat: Read geom_start from sysfs
+    
+    HDIO_GETGEO which provides start member is not supported for loop block
+    devices. Also start member is only unsigned long so it cannot be used for
+    bigger disks. So instead read geom_start from sysfs and store it into long
+    long type to prevent overflow.
+
+commit ed2062b
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Fri Jan 29 16:40:56 2021 +0100
+
+    Autogenerate release date in manpages
+
+commit fca589b
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Fri Jan 29 16:40:20 2021 +0100
+
+    Update (C) and maintainers
+
+commit c251412
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Fri Jan 29 16:33:41 2021 +0100
+
+    Add TODO comments for checking integer overflow
+
+commit 73003cd
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jan 19 13:28:45 2019 +0100
+
+    Replace uint64_t type by unsigned long long type
+
+commit c56ef3d
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jan 19 13:22:05 2019 +0100
+
+    Remove useless casting to uint64_t or long long in check_file()
+    
+    Value of clusters * fs->cluster_size is file size and it always fits into
+    32bit value. So use just unsigned int type for it.
+
+commit 2e597d6
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jan 19 13:20:16 2019 +0100
+
+    Check that file size is not larger than maximal possible size
+
+commit 53d04ff
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jan 19 13:15:25 2019 +0100
+
+    Change fat_size type from off_t to unsigned int
+    
+    Value in fat_size is result of multiplication of two 16bit unsigned values,
+    therefore it fits into unsigned int.
+
+commit 2f6d8cf
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Fri Jan 29 02:10:58 2021 +0100
+
+    testsuite: Add reference images of fsck result tests
+    
+    This ensures that fsck does not change its behavior and repair filesystems
+    in the same way. Repaired reference images were generated by dosfstools 4.1
+    to ensure that they are still same.
+
+commit 5265c64
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Fri Jan 29 02:10:22 2021 +0100
+
+    testsuite: Add fsck tests for fat labels
+
+commit 2260f80
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 3 23:22:42 2021 +0100
+
+    fsck.fat: Check and fix label
+    
+    Checks the volume label from the root directory entry that is valid and
+    matches the label stored in boot sector.
+    
+    Add new command line option -U which consider lowercase volume label as
+    invalid and allows only uppercase labels. By default lowercase volume
+    labels are allowed.
+
+commit 77c3de9
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Tue Jan 14 00:58:21 2020 +0100
+
+    Simplify usage of validate_volume_label() function
+    
+    Use new function dos_string_to_wchar_string() for converting label from DOS
+    OEM code page to wchar_t* string. Therefore caller does not have to supply
+    label in both DOS OEM encoding and locale independent wchar_t* string.
+
+commit f89b42d
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Aug 19 18:54:07 2018 +0200
+
+    Update warning message about lowercase labels
+    
+    They are working fine on MS-DOS and Windows systems.
+
+commit 5bbae89
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Aug 15 16:35:48 2018 +0200
+
+    charconv: Add functions for converting DOS strings to locale independent wchar_t strings
+    
+    Use iconv library for it. And as a fallback use internal cp850_table.
+
+commit 3a3c1d3
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Thu Jan 28 10:39:36 2021 +0100
+
+    testsuite: Update mkfs-fat32_2_res_sects.xxd test as it is now not aligned due to -a
+
+commit 289fa53
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jan 27 02:03:39 2021 +0100
+
+    manpages: End every sentence by a newline
+
+commit 61390f3
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jan 27 02:01:48 2021 +0100
+
+    mkfs.fat: Do not align number of sectors when -a was specified
+
+commit 7deb97d
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jan 27 02:00:33 2021 +0100
+
+    mkfs.fat: Document that -r and -R specify minimal number (and not exact)
+
+commit 4e06c33
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jan 27 01:58:38 2021 +0100
+
+    fsck: Move check_dirty_bits() from boot.c to check.c
+
+commit 738ee98
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 17 16:15:41 2021 +0100
+
+    fatlabel: Print warnings on stderr
+    
+    Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803391
+
+commit e62e52c
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 17 19:45:26 2021 +0100
+
+    fatlabel: Do not call parts of fsck repair procedure
+    
+    This change adds a new parameter for read_fat() function to indicate a mode
+    in which filesystem is doing to be used: Read-only, Read-write or Repair.
+    
+    fsck.fat uses Repair mode and fatlabel either Read-only or Read-write
+    (which depends on fatlabel operation).
+    
+    fatlabel cannot repair broken FAT filesystem like fsck.fat. So when trying
+    to modify FAT label on currupted FAT filesystem rather throw an fatal error
+    indicating that running fsck.fat is needed.
+    
+    When fatlabel was called to just read existing FAT label, first FAT table
+    is corrupted and second FAT table is clean then use second FAT table.
+    
+    This change also ensures that fatlabel does not print fsck/repair messages
+    on stdout, which should be used only for printing FAT label.
+
+commit b8c8531
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 17 22:47:18 2021 +0100
+
+    testsuite: Add tests for DOS Clean Shutdown bit
+
+commit 82c2111
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 17 20:20:39 2021 +0100
+
+    testsuite: Add fsck tests with broken first FAT cluster
+    
+    Extend also test-fsck script to read additional arguments from .args file.
+
+commit 82e9730
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 17 19:34:10 2021 +0100
+
+    fsck.fat: Add code for fixing first FAT cluster
+    
+    This patch tries to fix infamous fsck.fat error:
+    
+        Both FATs appear to be corrupt. Giving up.
+    
+    It just fill again FAT media type and sets other bits to one as it is
+    required by FAT specification. Similar thing is doing also Windows chkdsk
+    tool.
+    
+    In the most cases corrupted first FAT cluster is fatal error which
+    indicates totally corrupted filesystem impossible to repair. So fixing
+    first FAT cluster is not done by fsck.fat automatically and needs to be
+    enabled by a new -F option, which forces usage of specified FAT table
+    (either clean or corrupted).
+
+commit e579a7d
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Nov 17 01:12:52 2018 +0100
+
+    mkfs.fat: Allow to specify disk geometry via new -g option
+
+commit 9443732
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Fri Jan 8 11:49:27 2021 +0100
+
+    testsuite: Add mkfs test for 600MB large 4K disk
+
+commit 3300839
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Oct 14 16:19:51 2018 +0200
+
+    mkfs.fat: Do not show verbose messages not relevant to selected FAT size
+
+commit 43f0c4e
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Fri Aug 17 14:26:30 2018 +0200
+
+    mkfs.fat: Fix text of verbose messages
+
+commit c01f78b
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Tue Aug 14 15:48:50 2018 +0200
+
+    mkfs.fat: Fix limits for number of clusters
+    
+    According to Microsoft FAT specification (fatgen103.doc) disk with at least
+    4085 clusters and less then 65525 clusters is FAT16.
+    
+    But Microsoft Windows FAT driver fastfat.sys detects disk with less then
+    4087 clusters as FAT12. Linux FAT drivers msdos.ko and vfat.ko detect disk
+    with 4085 clusters (or more) as FAT16, therefore for compatibility reasons
+    with both systems disallow formatting disks to 4085 or 4086 clusters.
+    
+    So after this change mkfs.fat disallow to create a FAT16 which would be
+    misinterpreted as FAT12. Next run of cluster detection algorithm would
+    choose higher cluster size which decrease number of clusters.
+    
+    According to specification, FAT32 is detected by at least 65525 clusters,
+    but Microsoft Windows FAT driver fastfat.sys, Linux FAT drivers msdos.ko
+    and vfat.ko detect disk as FAT32 when Sectors Per FAT (fat_length) is set
+    to zero.
+
+commit 404ead8
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Aug 11 20:34:08 2018 +0200
+
+    mkfs.fat: Fix calculation of FAT32 cluster size on non 512 bytes sector disks
+    
+    Previous FAT32 calculation worked correctly only for disks with 512 byte
+    sectors. New calculation formula is generalized variant of previous one,
+    but to be sector size independent.
+
+commit e6d2fc7
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Aug 15 15:11:30 2018 +0200
+
+    mkfs.fat: Fix printing number of sectors
+    
+    It is unsigned 32bit number therefore use %u format.
+
+commit b29eb5b
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Aug 15 15:15:06 2018 +0200
+
+    mkfs.fat: Align total number of sectors to be multiple of sectors per track
+    
+    This requirement is needed by DOS systems and also by Linux mtools project.
+    Without proper alignment, mtools applications refuse to work on such
+    filesystem.
+
+commit 8c81232
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 10 22:29:48 2021 +0100
+
+    testsuite: Add referenceFAT32mbr test data to dist_check_DATA
+
+commit 468aad7
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 10 22:16:49 2021 +0100
+
+    manpages: Escape dot in fsck.fat manpage at the beginning of the line
+
+commit 9069ba0
+Author: felix <felix.von.s@posteo.de>
+Date:   Mon Apr 2 22:43:46 2018 +0200
+
+    fsck.fat: properly check for valid "." and ".." entries
+    
+    This change makes fsck.fat check whether "." and ".." entries exist in
+    all non-root directories as the two very first. If those entries are
+    occupied by some other file, fsck.fat will offer to move them to some
+    later slot. "." and ".." entries found in any other slots are treated
+    as ordinary bad-shortname entries. The test case for this situation has
+    been enabled and verified to perform as expected.
+    
+    The function drop_file() was also modified so that it does not mark
+    dropped file clusters as free. This was necessary because otherwise
+    dropping too-late "." and ".." entries would delete their containing
+    directory. If deleted entries' clusters are truly no longer used, they
+    shall be picked up by a later reclamation stage.
+    
+    Additionally, subdirs() and check_file() were modified not to check
+    unused directory entries.
+    
+    Additionally-fixed-by: Dave Odell <dmo2118@gmail.com>
+
+commit 512141a
+Author: C. Masloch <pushbx@ulukai.org>
+Date:   Sat Oct 24 13:53:08 2020 +0200
+
+    fsck.fat: preserve info sector reserved fields
+    
+    This allows the FSIBOOT stage of lDOS boot32.asm to remain
+    in the FSINFO sector even when the info entries are reset.
+    
+    I reviewed several sources to determine whether we are in the right to
+    assume that the reserved 480 bytes used by FSIBOOT should be preserved
+    by drivers updating the FSINFO entry fields.
+    
+    Quoting the document "Microsoft Extensible Firmware Initiative - FAT32
+    File System Specification - FAT: General Overview of On-Disk Format -
+    Version 1.03, December 6, 2000" on these bytes:
+    
+    > [Name] FSI_Reserved1
+    >
+    > [Offset (byte)] 4
+    >
+    > [Size (bytes)] 480
+    >
+    > [Description] This field is currently reserved for future expansion.
+    > FAT32 format code should always initialize all bytes of this field
+    > to 0. Bytes in this field must currently never be used.
+    
+    This specifically states that "FAT32 format code" should zero-initialise
+    this space. It does not specify that a driver should or should not reset
+    this space.
+    
+    The FreeDOS kernel uses a struct [1] that does not include the space
+    used by FSIBOOT. Its driver's implementation [2] does preserve the
+    FSIBOOT area. I have verified this in dosemu2; if the FreeDOS kernel
+    updates the FSINFO sector it preserves this area.
+    
+    The Linux kernel uses a struct with a "reserved1" member [3] which is
+    commented as being "Nothing as far as I can tell". If I am reading the
+    source correctly, its driver [4] also preserves this area when updating
+    the FSINFO entries.
+    
+    Testing on MS-DOS version 7.10 (as bundled with MS Windows 98 SE) I
+    determined that it also preserves the area when updating the FSINFO entries.
+    
+    The free software RxDOS/lDOS boot loader for FAT32 that I wrote uses
+    this reserved area to store its FSIBOOT stage, essentially an extension
+    to the primary boot sector loader. To avoid clashing with Microsoft
+    loaders which may use some of the reserved sectors, the large reserved
+    area in the FSINFO sector was selected to hold this stage (if sector
+    size is <= 512 bytes). If valid, the area starts with a signature [5]
+    the first four bytes of which form the letters "FSIB"; the subsequent
+    four bytes specify a protocol version. For example, the current
+    (non-experimental) version is "FSIBOOT3" [6].
+    
+    If there is no FSINFO sector or the FSIBOOT signature does not match the
+    one expected, then the 'I' error code letter ("i"nvalid FS"I"BOOT) is
+    displayed and the loading is aborted [7]. Prior to this patch, if the
+    FSINFO entries were invalid (any of the three FSINFO signatures don't
+    match) and then fsck.fat was used and instructed to correct this, it
+    would reset the space used by FSIBOOT, rendering the image unbootable
+    if the lDOS boot32 loader had been installed into the image.
+    
+    I previously posted a similar patch for mtools to the info-mtools
+    mailing list [8]. I was approached to check whether dosfstools behaved
+    as expected. I determined that this patch is needed to fix the corner
+    case of invalid FSINFO entries with FSIBOOT installed into the sector.
+    I also patched the lDOS instsect application [9] so it insures that the
+    FSINFO entries are valid while installing FSIBOOT. With either that
+    patch to instsect or this patch to dosfstools, FSIBOOT will always be
+    preserved when running fsck.fat on a file system.
+    
+    [1]:
+    https://github.com/FDOS/kernel/blob/6e42bb6d7c6dd304f738cf0d7a2db719598f1b9e/hdr/device.h#L325
+    [2]:
+    https://github.com/FDOS/kernel/blob/6e42bb6d7c6dd304f738cf0d7a2db719598f1b9e/kernel/fattab.c#L116
+    [3]:
+    https://github.com/torvalds/linux/blob/7cf726a59435301046250c42131554d9ccc566b8/include/uapi/linux/msdos_fs.h#L163
+    [4]:
+    https://github.com/torvalds/linux/blob/7cf726a59435301046250c42131554d9ccc566b8/fs/fat/misc.c#L60
+    [5]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l1164
+    [6]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l27
+    [7]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l775
+    [8]: https://lists.gnu.org/archive/html/info-mtools/2020-10/msg00000.html
+    [9]: https://hg.ulukai.org/ecm/instsect/rev/eee5dfaa52f6
+
+commit 201665c
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Feb 16 12:33:32 2020 +0100
+
+    mkfs.fat: Update --help for -h (hidden sectors)
+
+commit 25da96e
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Feb 16 12:22:04 2020 +0100
+
+    mkfs.fat: Relax -D option (BIOS drive number)
+    
+    Allow to specify also second hard disk (0x81) or second floppy device
+    (0x01) as -D option = BIOS drive number.
+
+commit bce0940
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Feb 17 18:59:54 2019 +0100
+
+    manpages: Update mkfs.fat manpage about FAT32 backup boot sector
+
+commit da36707
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Feb 17 11:48:32 2019 +0100
+
+    mkfs.fat: Write FAT32 backup info sector after FAT32 backup boot sector
+    
+    Write it only in the case when location does not conflict with real/primary
+    FAT32 info sector and reserved area is big enough.
+
+commit 5b61d9f
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Feb 17 11:01:15 2019 +0100
+
+    testsuite: Run fsck test step always even if mkfs test step fails
+    
+    fsck test step can show more details about badly created image by mkfs.
+
+commit 53bfa1f
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Feb 17 10:56:06 2019 +0100
+
+    testsuite: Add test for mkfs.fat with two FAT32 sectors in reserved area
+
+commit 3cca83a
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Feb 17 10:36:33 2019 +0100
+
+    mkfs.fat: Fix setting location of FAT32 backup boot sector
+    
+    For FAT32 if there are only two sectors in reserved area, first must be
+    boot sector and second must be FAT32 fs info sector. And there would not be
+    FAT32 backup boot sector as it is optional. FAT32 info sector is for FAT32
+    media mandatory.
+    
+    When backup_boot variable is set to zero it means that no FAT32 backup boot
+    sector is written. Check that FAT32 backup boot sector differs from FAT32
+    info sector is already there.
+    
+    Also allow user to specify zero for -b option which disable creating of
+    FAT32 backup boot sector.
+
+commit c5e35e7
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Feb 17 10:34:24 2019 +0100
+
+    mkfs.fat: Put FAT32 info sector number into variable
+    
+    Also check that it is not same as backup boot sector value.
+
+commit d276ddb
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Feb 17 10:32:08 2019 +0100
+
+    mkfs.fat: Rename info_sector buffer variable to info_sector_buffer
+    
+    Also call free() unconditionally as it does nothing for NULL argument.
+
+commit 5e936c9
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Nov 24 19:45:39 2018 +0100
+
+    mkfs.fat: Remove dependency on systemd/udev
+    
+    There is no need that mkfs.fat depends on systemd. It uses it only for
+    reading additional information about block device.
+    
+    This patch replace systemd/udev dependency code by reading those additional
+    information about block device directly from sysfs.
+    
+    So no functionality of mkfs.fat is lost or removed.
+
+commit 18a05e7
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jan 5 00:58:41 2020 +0100
+
+    manpages: Fix '. SF' file names
+
+commit 7e6d7d3
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Nov 24 18:18:53 2018 +0100
+
+    manpages: Fix switching to previous font style
+    
+    In troff manpage language previous font style is selected by "\fP"
+    sequence, not by "\fR". "\fR" selects roman font style.
+
+commit ffa5dfa
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Nov 18 21:14:24 2018 +0100
+
+    manpages: Fix formatting of bullets
+    
+    In troff manpage language bullet is written as "\(bu".
+
+commit bc65dd6
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Nov 18 21:10:29 2018 +0100
+
+    manpages: Fix formatting of emphases
+    
+    To emphasize use italic font style instead of putting word into two
+    apostrophes. Ascii apostrophe in troff manpage language means "right single
+    quotation mark", therefore putting word into two apostrophes is fully
+    wrong.
+    
+    Also arguments and file names should be formatted in italic.
+
+commit 0273989
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Nov 18 21:01:55 2018 +0100
+
+    manpages: Fix formatting of hyphens, en and em dashes
+    
+    In troff manpage language ascii minus is written as "\-", mathematical
+    minus as "\(mi", hyphen as "-", en-dash as "\(en" and em-dash as "\(em".
+
+commit c85c863
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Oct 21 12:58:19 2018 +0200
+
+    manpages: Clarify unit of BLOCK-COUNT
+    
+    BLOCK-COUNT is always in KiB unit independently of the disk sector size,
+    FAT sector size or FAT cluster size.
+
+commit 69fcfe5
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Aug 19 16:35:22 2018 +0200
+
+    fsck.fat: Check for DOS Clean Shutdown bit
+    
+    DOS Clean Shutdown bit in first reserved FAT entry is cleared when DOS or
+    Windows FAT driver mounts a volume and set is back when doing unmount.
+    Therefore set this bit when clearing FAT dirty bit in boot sector.
+
+commit 68e8e54
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jan 4 14:53:28 2020 +0100
+
+    mkfs.fat: Calculate CHS geometry according to SD Card Part 2 File System Specification
+    
+    Use this CHS calculation when disk geometry is not available. This change
+    replaces hardcoded 64/32 value by formula based on total number of sectors.
+    
+    For SD cards with more then 256MB capacity is CHS calculation according to
+    SD Card Part 2 File System Specification same as CHS calculation for hard
+    disks via LBA-Assist Translation.
+
+commit 5199d68
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Aug 19 09:57:41 2018 +0200
+
+    mkfs.fat: Add a new option --mbr which fills MBR table with one partition
+    
+    It is needed only for non-removable disks used on Microsoft Windows systems
+    and only when formatting whole unpartitioned disk.
+    
+    Also some removable USB flash disks accessed via USB Mass Storage declares
+    themselves as non-removable and Microsoft Windows systems do not recognize
+    them without MBR partition table and MBR disk signature.
+    
+    Because MBR sector and first FAT sector are very similar (starts with
+    boot code, ends with boot sign 0xAA55) they can live together at one
+    sector. Moreover location of the MBR partition table overlaps only with the
+    end of FAT boot code where is just place for the error message, it is
+    possible to fill (fake) MBR partition table with one partition which refers
+    to whole disk itself (starts at sector 0 and spans whole disk).
+    
+    Similar thing is doing mformat (FAT12/16/32 formatting tool) from mtools
+    project or mkudffs (UDF formatting tool) from udftools project.
+
+commit 9f856b7
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon Jan 27 22:12:38 2020 +0100
+
+    charconv: Do not use %lc format modifier for wide char which cannot be converted to multibyte string
+
+commit 032ec02
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Tue Jan 14 00:27:31 2020 +0100
+
+    charconv: Fix usage of iconv() for state-dependent encodings
+    
+    After first main iconv() call set conversion state to the initial state and
+    store corresponding shift sequence to output buffer via second iconv() call.
+
+commit 4428d7d
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon Jan 13 23:15:22 2020 +0100
+
+    charconv: Fix checks for overlong input strings
+
+commit 2779d70
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jan 8 01:03:24 2020 +0100
+
+    charconv: Use ICONV_CONST macro to fix compile warnings with GNU libiconv
+    
+    Macro ICONV_CONST is defined by autoconf and expands either to "const" or
+    nothing based on what API provides iconv() implementation, either according
+    to SUSv2 or POSIX.1-2001/POSIX.1-2008.
+
+commit 565d7a2
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jan 8 01:02:16 2020 +0100
+
+    charconv: Fix check for return value of iconv
+    
+    iconv() returns (unsigned) size_t type, so its return value is always
+    different from (signed) negative -1. To compare with -1 it first needs to
+    be casted to size_t type.
+
+commit e9b42f5
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jan 8 00:44:27 2020 +0100
+
+    charconv: Increase buffer size for output strings in current locale
+    
+    MSDOS_NAME * 4 does not have to be enough size as iconv in translit mode
+    can return also 5 bytes per one wide character.
+
+commit 1403c53
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jan 8 00:42:35 2020 +0100
+
+    charconv: Fix buffer overflows by specifying output buffer size
+
+commit 917846b
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Tue Jan 7 00:54:15 2020 +0100
+
+    charconv: Fix put_char() function
+    
+    Ensure that this function always print characters according to current
+    locale. So do not treat characters above 0xA0 as printable when
+    dos_char_to_printable() cannot process them.
+
+commit 6dc68a8
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Tue Jan 7 00:52:43 2020 +0100
+
+    charconv: Fix comment for init_conversion() function
+
+commit 2d6c37d
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Tue Jan 7 00:52:25 2020 +0100
+
+    charconv: For internal CP850 conversion add translit table
+    
+    This CP850 translit table was created by iconv ASCII//TRANSLIT as a 7bit ASCII fallback.
+
+commit 3ccfe29
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Tue Jan 7 00:50:09 2020 +0100
+
+    charconv: As a fallback try to use also non-translit iconv conversion
+
+commit 1b72fdf
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon Jan 6 18:30:28 2020 +0100
+
+    charconv: Use const for input strings
+
+commit 102aa76
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon Jan 6 18:29:30 2020 +0100
+
+    charconv: Rename third argument of local_string_to_dos_string()
+    
+    Correct name is out_size as it is size of output buffer and not length of string.
+
+commit 49cc12a
+Author: Lennart Poettering <lennart@poettering.net>
+Date:   Mon Aug 3 12:17:12 2020 +0200
+
+    mkfs: fsync() the block device before exiting
+    
+    Let's make sure to sync the block device, before exiting. Otherwise, if
+    we operate on a loop device and people issue "losetup -d" right after
+    this command finishes our in-flight writes might never hit the disk.
+    
+    (This took 4h of my life for me to figure out. The mkfs for all other
+    file systems I tested appear to synchronize when done, hence fat should
+    do too.)
+
+commit cc75143
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon Jan 27 22:22:35 2020 +0100
+
+    mkfs.fat: Mark struct fat32_fsinfo as packed
+
+commit f8f455b
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon Jan 27 22:25:20 2020 +0100
+
+    fatlabel: Update documentation about DOS codepage
+
+commit 3ce32fa
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jan 4 15:27:59 2020 +0100
+
+    mkfs.fat: Clarify licensing of the dummy boot sector
+    
+    Original author H. Peter Anvin allowed to put mkfs.fat boot sector code
+    into the public domain.
+
+commit 8dc8976
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Fri Feb 14 00:00:27 2020 +0100
+
+    manpages: Update documentation about hidden sectors
+    
+    Fixes #29
+
+commit 17be357
+Author: David Gumberg <davidzgumberg@gmail.com>
+Date:   Sun Oct 13 18:21:57 2019 -0600
+
+    Get cross-platform libc6 generically
+
+commit 5e2529e
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon Oct 14 12:21:36 2019 +0200
+
+    travis: use if ... fi construction
+    
+    As single test command has side effect in return value for Travis.
+
+commit 20092b8
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon Oct 14 12:14:07 2019 +0200
+
+    travis: Check for fatlabel test errors only for non-static builds
+    
+    Static builds have broken iconv support which is detected at configure time
+    as usable. This leads to usage of internal CP850 conversion table as
+    fallback solution which throws runtime non-fatal error.
+
+commit a4a0d62
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon Oct 14 09:48:43 2019 +0200
+
+    tests: Check for stderr errors from fatlabel tests
+
+commit 84a8d1c
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jun 23 12:01:48 2019 +0200
+
+    charconv: Update Travis configuration
+    
+    Use autogen.sh instead of non-working autoreconf and test also
+    static linked versions and configurations without iconv.
+
+commit b657ede
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Jun 23 10:47:44 2019 +0200
+
+    charconv: Add autogen.sh script
+    
+    AM_ICONV macro depends on gettext installation. Unfortunately autoreconf is
+    not able to install config.rpath file so do it manually in autogen.sh.
+    
+    See reported bug:
+    https://lists.gnu.org/archive/html/bug-gettext/2011-10/msg00012.html
+
+commit 0dec6a7
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jun 22 22:14:31 2019 +0200
+
+    charconv: Fix sources for testdevinfo target
+    
+    testdevinfo does not use any of charconv functions, nor any of mkfs
+    functions. So do not link charconv/mkfs into testdevinfo.
+    
+    This fixes linking problems when iconv functions are not present in
+    standard libraries.
+
+commit 664192e
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jun 22 01:23:54 2019 +0200
+
+    charconv: Check return value of all set_dos_codepage() calls
+
+commit 6d49a1f
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jun 22 01:16:44 2019 +0200
+
+    charconv: Check presence of iconv
+    
+    Use autoconf AM_ICONV macro for it. AM_ICONV should handle both cases when
+    iconv_open is available in external libiconv library or as part of libc
+    library.
+    
+    To force compilation of dosfstools without iconv support there is a new
+    configure option --without-iconv.
+
+commit fa9761f
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jun 22 01:14:37 2019 +0200
+
+    charconv: Fix return value from iconv_init_codepage function
+
+commit d74c592
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jun 22 01:12:46 2019 +0200
+
+    charconv: Add fallback to internal CP850 table
+    
+    Static linked version of glibc does not contain iconv with CP850 support.
+    As CP850 is default code page for all dosfstools programs add own internal
+    implementation which will be always supported. It would be used only in
+    case iconv_open() fails.
+
+commit 91978a2
+Author: Michael Forney <mforney@mforney.org>
+Date:   Fri Jun 7 08:48:13 2019 -0700
+
+    Use static inline function instead of statement expression
+
+commit e06e759
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jun 5 09:25:52 2019 +0200
+
+    Fix Travis CI configuration for powerpc and arm
+
+commit fc55b63
+Author: Noé Rubinstein <nrubinstein@aldebaran.com>
+Date:   Mon Aug 31 15:19:57 2015 +0200
+
+    mkfs: document --offset in the man page
+
+commit f473459
+Author: Noé Rubinstein <nrubinstein@aldebaran.com>
+Date:   Thu Jul 2 15:49:06 2015 +0200
+
+    Allow specifying an offset in the device file in mkfs
+
+commit 93b4288
+Author: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
+Date:   Sun Feb 24 20:55:15 2019 +0100
+
+    Fix out of boundary read in fsck.fat/fatlabel
+    
+    Faulty filesystems are able to trigger integer overflows in read_boot which eventually lead to insufficient allocation of memory for the FAT and therefore out of boundary reads.
+
+commit af3e50d
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Aug 12 12:15:45 2018 +0200
+
+    device_info: Fix parsing partition number
+    
+    Ensures that it is always valid number which does not overflow or
+    underflow.
+
+commit 086e13c
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Aug 12 12:15:21 2018 +0200
+
+    mkfs.fat: Fix parsing of block number
+    
+    Block number must not be negative. It is 32bit so use long long type and
+    strtoll() function to ensure that converted positive 32bit value would fit
+    into type.
+
+commit a2b97c9
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Aug 12 12:13:35 2018 +0200
+
+    mkfs.fat: Fix validation of numeric command line arguments
+    
+    Ensures that argument is always valid number which does not overflow or
+    underflow.
+
+commit 07e63ac
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Aug 12 11:56:32 2018 +0200
+
+    mkfs.fat: Fix validation of volume ID
+    
+    Use same logic as in fatlabel.
+
+commit 425a415
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Aug 11 22:49:37 2018 +0200
+
+    fatlabel: Fix validation of volume ID
+    
+    Standard C function strtoull() does not signal underflow, therefore it
+    cannot be used for conversion of arbitrary string to integer with detection
+    of failure.
+    
+    Instead use function strtoll() and detect underflow (negative value)
+    manually.
+    
+    Note that strto* functions skips and ignores leading whitespace characters,
+    so detects them manually via standard C function isspace().
+
+commit da07aa4
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Jan 19 09:48:25 2019 +0100
+
+    Update Travis configuration
+    
+    * Use both gcc and clang compilers
+    * Compile with -fwrapv and -fsanitize=address
+    * Compile in both 32 and 64 modes for x86 systems
+    * Cross compile for little endian arm and big endian powerpc
+    * Run cross compiled binaries in qemu
+
+commit a6ec69d
+Author: Tobias Stoeckmann <tobias@stoeckmann.org>
+Date:   Mon Jan 14 22:47:40 2019 +0100
+
+    Renamed len to out_size.
+    
+    As pointed out by pali it makes sense to rename len to out_size
+    to make explicitly sure by proper naming that this is the actually
+    available memory size at "out", not the length of a string.
+    
+    Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
+
+commit 6080fe2
+Author: Tobias Stoeckmann <tobias@stoeckmann.org>
+Date:   Mon Jan 14 19:36:11 2019 +0100
+
+    Fixed off-by-one in local_string_to_dos_string.
+    
+    The function local_string_to_dos_string is vulnerable to an off-by-one
+    buffer overflow. In fact, it is triggered in default usage and becomes
+    visible when compiled with ASAN:
+    
+    $ CFLAGS="-fsanitize=address" ./configure
+    $ dd if=/dev/zero of=example.iso bs=1024 seek=64 count=1
+    $ ./src/mkfs.fat example.iso
+    mkfs.fat 4.1+git (2017-01-24)
+    =================================================================
+    ==3857==ERROR: AddressSanitizer: stack-buffer-overflow on address ...
+    
+    The problem is that the argument "len" to local_string_to_dos_string
+    stores the length of the output buffer. Yet it can also be used as an
+    index to store '\0':
+    
+    If the whole "out" buffer has been written to, bytes_out is 0 and
+    the assignment in out[len-bytes_out] therefore leads to an off-by-one.
+    
+    Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
+
+commit 332fc29
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Nov 18 20:47:29 2018 +0100
+
+    Fix memory leaks in read_fat() function
+    
+    Function read_fat() allocates memory to the user supplied buffer. Therefore
+    that function needs complement function for releasing allocated memory and
+    user needs to call if after finish its work.
+    
+    This patch fixes memory leaks in fsck.fat and fatlabel tools.
+    
+    Fixes #13
+
+commit 4cfd643
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sat Sep 29 10:08:12 2018 +0200
+
+    mkfs.fat: Fix endianity for hidden_sectors
+    
+    Global variable hidden_sectors is in host byte order.
+
+commit a874650
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Tue Aug 14 21:13:52 2018 +0200
+
+    mkfs.fat: Add some workaround for Year 2038 Bug
+    
+    Check return values of time(), gmtime() and localtime() function which may
+    fail. Fallback to date/time 1.1.1980 00:00:00 when those functions fail.
+    
+    For generating volume id, add fallback code based on rand() function.
+
+commit 607fbed
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Tue Aug 14 20:57:27 2018 +0200
+
+    fsck.fat: Fix Year 2038 Bug
+    
+    Do not use time_t type and strftime() function which are affected by the
+    Year 2038 Bug. Instead parse date/time directly from DOS format which
+    avoids conversion from DOS to UNIX + conversion from UNIX to string.
+
+commit fb0cc0d
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Tue Aug 14 12:58:58 2018 +0200
+
+    Fix gcc sprintf() length warnings
+    
+    There are two sprintf() calls that receive warnings from current
+    versions of gcc for possibly overrunning the temporary buffers they're
+    writing into.
+    
+    The first one in src/check.c is theoretically safe since strftime()
+    shouldn't generate such a long string. Reduce the maximum length of the
+    strftime() string to fix this warning. Also detect strftime() errors
+    and overwrite the buffer with a message in that case.
+    
+    The second one in src/boot.c should not be possible and is a limitation
+    of gcc's detection. It assumes that %02x could write up to 8
+    characters, even though the arguments are pointers to uint8_t which
+    can't be more than two characters. Placate gcc by lengthening the
+    temporary buffer by 12 bytes.
+
+commit ca54953
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon May 7 09:27:16 2018 +0200
+
+    mkfs.fat: Add support for --codepage option for label and validate it
+
+commit 40da1b2
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Mon May 7 09:26:42 2018 +0200
+
+    fatlabel: Implement proper checks when setting new label
+    
+    According to Microsoft FAT specification "fatgen103.doc" there are
+    following restrictions for FAT label stored in root directory:
+    
+    * DIR_Name[0] may not equal 0x20.
+    
+    * Lower case characters are not allowed in DIR_Name (what these characters
+      are is country specific).
+    
+    * The following characters are not legal in any bytes of DIR_Name:
+    
+      - Values less than 0x20 except for the special case of 0x05 in
+        DIR_Name[0]
+    
+      - 0x22, 0x2A, 0x2B, 0x2C, 0x2E, 0x2F, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
+        0x5B, 0x5C, 0x5D, and 0x7C
+    
+    And another Microsoft "FAT32 Spec (SDA Contribution).pdf" describe:
+    
+    * DIR_Name[0] cannot equal 0x20 (in other words, names cannot start with a
+      space character).
+
+commit 4f953bb
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Mon Jun 11 14:21:17 2018 +0200
+
+    Remove long file name when changing short file name
+    
+    In the current state, long file names are poorly supported and in case
+    the file got automatically or manually renamed in auto_rename() or
+    rename_file(), only the short file name would be manipulated.
+    
+    Only the checksum would be fixed to have the LFN stay valid. This would
+    cause issues such as the rename being hidden by the unchanged LFN or
+    duplicate LFNs remaining if they were the cause for a rename.
+    
+    Change so that existing LFNs are removed for files being renamed.
+
+commit b356cf0
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Mon Jun 11 14:17:03 2018 +0200
+
+    Print error message when auto_rename() is called on FAT32 root directory
+    
+    Use the same error message as rename_file() uses for the same reason
+    when called on the FAT32 root directory pseudo file rather than silently
+    ignoring.
+
+commit 8c4122e
+Author: felix <felix.von.s@posteo.de>
+Date:   Mon Jun 11 04:35:35 2018 +0200
+
+    Fix allowing changes in SFNs reporting bogus error on FAT32 root directory
+    
+    The code to permit spaces in short filenames introduced in commit
+    4d01db7c6 caused the root directory pseudo file to be checked for a bad
+    name. Since the name for that file is not set (zeroed out), bad_name()
+    would report an error. Attempting to fix it would do nothing as the
+    rename functions check for and ignore the root directory.
+    
+    Fix by checking for the root directory in bad_name().
+
+commit 96e6efd
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Jun 10 03:09:14 2018 +0200
+
+    fsck: Fix -S option not being recognized
+    
+    The call to getopt_long() did not include the -S option, so that it was
+    not recognized even though its handling was implemented.
+
+commit 4d01db7
+Author: felix <felix.von.s@posteo.de>
+Date:   Mon Apr 2 10:20:10 2018 +0200
+
+    fsck.fat: Allow spaces in the middle of SFNs
+    
+    Also, introduce an -S option (mostly) restoring previous behaviour.
+
+commit c74ca0c
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Mar 7 18:00:15 2018 +0100
+
+    manpages: Add section DOS CODEPAGES to fatlabel
+    
+    Table was extracted from the National Language Support (NLS) API Reference:
+    https://www.microsoft.com/resources/msdn/goglobal/default.mspx?OS=Windows+7
+    
+    And filtered by codepages supported by GNU libiconv.
+
+commit b665a93
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Mar 7 17:59:50 2018 +0100
+
+    fatlabel: Add support for --codepage option
+    
+    FAT label in both boot sector and root directory is stored according to
+    current OEM code page. Microsoft Windows system treat FAT label really in
+    this way. In most cases OEM code page is just 8bit extension of the
+    printable ASCII, therefore for ASCII-only labels there is no change.
+    
+    By default OEM code page 850 is used which contains most of the characters
+    that are also available in ISO-8859-1. Same default which is used by
+    fsck.fat and mlabel (from mtools project).
+
+commit 76c0362
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Mar 7 17:58:05 2018 +0100
+
+    fsck.fat: Change default DOS codepage to 850
+    
+    The reason for change is that 850 is more common on Windowes and used by
+    more regions as 437. Also it contains most of the characters that are also
+    available in ISO-8859-1. And 850 is also default DOS code page used by
+    mtools, which is used on Linux.
+
+commit 18ed349
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Mar 7 17:57:23 2018 +0100
+
+    Initialize iconv "from codepage" with //TRANSLIT
+    
+    This would allow to show characters from DOS codepage on systems which
+    current locale does not support it via transliteration.
+    
+    For example byte E8 in DOS CP437 (e with a grave accent) does not have
+    representation in Linux locale Latin2. But it can be shown after
+    transliteration as simple character "e".
+
+commit 08d743c
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Mar 7 17:57:13 2018 +0100
+
+    Initialize only LC_CTYPE locale
+    
+    LC_ALL is not needed as locale is used just for CODESET. LC_CTYPE is enough
+    for using nl_langinfo(CODESET).
+
+commit 2112913
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Sun Apr 8 11:37:29 2018 +0200
+
+    Add tests for FAT32 labels
+    
+    These FAT32 images were generated for FAT label test suite in October 2017.
+    Now fatlabel reports same FAT32 label as MS-DOS 6, 7 and Windows 98, XP, 10.
+    
+    For more information about test result see email:
+    https://www.spinics.net/lists/kernel/msg2640891.html
+
+commit bfeedfc
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Thu Nov 9 21:25:05 2017 +0100
+
+    mkfs.fat: Correctly process 0xe5 as first character of directory entry
+    
+    Same as commit 51da71aa9edc36fabf83323282f14e7ee71aa07b but for mkfs.fat.
+
+commit 1b866f4
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Thu Nov 9 21:25:01 2017 +0100
+
+    fsck.fat: Handle 0xe5 as first character of directory entry
+    
+    Same as commit 51da71aa9edc36fabf83323282f14e7ee71aa07b but for fsck.fat.
+
+commit 5b702a7
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Thu Nov 30 00:07:39 2017 +0100
+
+    manpages: Add section COMPATIBILITY and BUGS to fatlabel
+
+commit 900edb6
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Thu Nov 30 00:07:22 2017 +0100
+
+    fatlabel: Optimize size of the binary
+    
+    Move implementation of the alloc_rootdir_entry() function from the check.c
+    to boot.c and do not link unneeded objects files into fatlabel binary.
+    
+    This would decrease size of the fatlabel binary nearly by half. With -g -O2
+    size before was about 194131 bytes and after just 104497 bytes.
+
+commit 0901aa8
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Thu Nov 30 00:07:05 2017 +0100
+
+    fatlabel: Clear ATTR_VOLUME from directory entry when removing label
+    
+    Older versions of fatlabel ignored FAT entries with deletion mark 0xE5 and
+    tried to read labels also from those entries. This fix clear ATTR_VOLUME so
+    older versions would not try to read label from deleted entry.
+
+commit cb8e674
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Thu Nov 30 00:06:51 2017 +0100
+
+    fatlabel: Print label without padding spaces
+    
+    Every entry in FAT directory is padded with spaces, which are not part of
+    entry name. Therefore show also label from root FAT directory without those
+    padding spaces.
+
+commit d822d5b
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Thu Nov 30 00:06:36 2017 +0100
+
+    fatlabel: Show only label stored in root directory
+    
+    MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP and also Windows 10
+    ignores label stored in boot sector. When label in boot sector is non-empty
+    and label in root directory is missing then they treat situation as there
+    is no label for particular disk. So when labels in boot sector and root
+    directory are out of sync, fatlabel shown different label as those MS-DOS
+    and Windows systems. To make behavior between DOS, Windows and Linux
+    consistent, ignores label in boot sector also in fatlabel.
+
+commit c598354
+Author: Ashe David Sterkehus <ashe.goulding@gmail.com>
+Date:   Wed Nov 22 00:20:40 2017 +0900
+
+    mkfs: Check volume label given with -n is no longer than 11 characters
+    
+    Fixes #70
+
+commit 87a8f29
+Author: Will Newton <willn@resin.io>
+Date:   Thu Aug 31 10:42:13 2017 +0100
+
+    src/check.c: Fix up mtools created bad dir entries
+    
+    mtools writes uninitialized data to the case field of some
+    directory entries. Running fsck.fat on these filesystems
+    will cause the directory to get deleted which can lead to
+    data loss. Detect this situation and clear the flag instead.
+    
+    mtools patch to fix the original issue:
+    
+    https://lists.gnu.org/archive/html/info-mtools/2014-08/msg00000.html
+    
+    Signed-off-by: Will Newton <willn@resin.io>
+
+commit fe3ada3
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 15 16:26:01 2017 +0200
+
+    manpages: Remove formatting from NAME sections where it doesn't belong
+    
+    The .SH NAME sections are supposed to contain just "name \- description"
+    with no bolding on the name.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 0d2d2b2
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 15:17:13 2017 +0200
+
+    manpages: Clarify rules for volume labels as implemented
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 86fa0d8
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 15:16:12 2017 +0200
+
+    manpages: Make SEE ALSO sections conform to conventions
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 5cdad55
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 03:57:59 2017 +0200
+
+    Harmonize unknown command line option handling
+    
+    Now all binaries will show help and not try to print something like
+    "unknown option '?'" because '?' is the value getopt_long() returns when
+    it encounters an unknown option. At this point, getopt_long() has
+    already printed the problem to stderr so we don't have to.
+    
+    The default action on getopt_long() return values (neither known option
+    nor '?') is to report an internal error with the unexpected value.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 34fd8eb
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 03:04:00 2017 +0200
+
+    fatlabel: Add new -r, --reset option
+    
+    This new option removes the label or generates a new serial number if in
+    volume ID mode.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit e4e346f
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 02:43:03 2017 +0200
+
+    fatlabel: Don't access element of argv array that may not exist
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 17dea47
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 02:27:31 2017 +0200
+
+    Move generation of serial number into new function generate_volume_id()
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 07f0238
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 02:17:41 2017 +0200
+
+    Add remove_label() function
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit ce7e7f9
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 01:42:55 2017 +0200
+
+    fatlabel: Refuse empty strings as labels
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 51da71a
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 01:28:32 2017 +0200
+
+    Handle 0xe5 as first character of volume label
+    
+    Directory entries are not allowed to have 0xe5 as the first character as
+    that is the marker for deleted entries. Instead, these have to be
+    converted to 0x05 on writing and the other way on reading.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 3a1aac1
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 01:11:05 2017 +0200
+
+    Remove leftover handling of split directory entry name
+    
+    The name field in DIR_ENT used to be split into name and ext. Reading
+    the volume label from a DIR_ENT used to require merging the contents of
+    both fields and that handling was still there as reading parts of the
+    same name field and merging them. Simply read in one go instead.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 04aca69
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 00:54:12 2017 +0200
+
+    Terminate volume label search at end of directory
+    
+    In find_volume_de() there is no point in scanning the directory entries
+    after the first end of directory marker (name starts with a zero byte).
+    Simply return 0 if end of directory is encountered.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 747c8f9
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Oct 1 00:46:05 2017 +0200
+
+    Avoid returning deleted directory entries as labels
+    
+    In find_volume_de(), only the attributes were tested to decide whether a
+    directory entry was a volume label. This could lead to deleted entries
+    being returned. Check the name for deleted or unallocated marker to
+    prevent this.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 0a733d8
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jul 5 20:44:00 2017 +0200
+
+    fatlabel: Fix erasing label
+    
+    Empty label needs to be stored as "NO NAME    ". Like in mkfs treat label
+    which starts with character 0xE5 as empty.
+
+commit e1397b9
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Wed Jul 5 20:37:17 2017 +0200
+
+    mkfs: Handle -n "" correctly
+    
+    When user specify empty argument for -n, then it is empty label and needs
+    to be transformed to NO_NAME. Also treat -n argument which starts with
+    character 0xE5 as empty because label is stored also in root FAT directory
+    and such entry is marked as deleted.
+    
+    Fixes #54
+
+commit 2afb699
+Author: Pali Rohár <pali.rohar@gmail.com>
+Date:   Thu Sep 28 10:13:56 2017 +0200
+
+    fatlabel: Fix parsing volume ID
+    
+    * Do not allow specifying empty argument as volume ID
+    * Check for errno (as general error) after more specific errors
+    
+    Fixes #64
+
+commit 7ddcf9b
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Mon Sep 25 01:21:23 2017 +0200
+
+    fatlabel: Implement volume ID mode
+    
+    When given the new -i or --volume-id option, fatlabel will display or
+    change the volume ID (serial number) instead of the volume label. The ID
+    is displayed as an 8 digit hexadecimal number, when changing it must
+    also be given as a hexadecimal number that fits within 32 bits.
+    
+    Fixes #52
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 20a3e0f
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Mon Sep 25 00:36:33 2017 +0200
+
+    Add write_serial() function
+    
+    write_serial() works like write_boot_label() but sets the volume ID
+    instead of the volume label in the boot sector.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit d7c9ffa
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Mon Sep 25 00:07:17 2017 +0200
+
+    Make fs_open() path argument const char*
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 06c2d11
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sun Sep 24 22:32:16 2017 +0200
+
+    Read volume ID in read_boot()
+    
+    The DOS_FS struct gets a new 32 bit field "serial" and read_boot() will
+    now read the volume ID into this field.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit e501243
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Thu Sep 21 15:20:33 2017 +0200
+
+    fatlabel: Expand help message by description and options
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 944ffe4
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Thu Sep 21 15:15:54 2017 +0200
+
+    fatlabel: Change option parsing to getopt_long()
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 33dd224
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Sat Aug 5 20:02:04 2017 -0400
+
+    Warn that -r is useless with FAT32 filesystems
+    
+    The option -r specifies the root directory size that neither is nor can
+    be fixed on FAT32. If generating a FAT32 filesystem and this option is
+    specified, warn the user that it has no effect.
+    
+    Fixes #43
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit ed9facf
+Author: Jakub Wilk <jwilk@jwilk.net>
+Date:   Tue Jul 11 01:01:20 2017 +0200
+
+    Fix signed integer overflow in FSTART
+    
+    uint16_t was promoted to int, and then left shift could overflow it.
+    Add explicit cast to uint32_t to avoid undefined behavior.
+    
+    Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 995d814
+Author: Emanuel Czirai <xftroxgpx@gmail.com>
+Date:   Fri May 5 22:43:54 2017 +0200
+
+    add missing \n
+    
+    To fix this:
+    ```
+    Starting check/repair pass.
+    FATs differ but appear to be intact.1) Use first FAT
+    2) Use second FAT
+    [12?q]?
+    ```
+
+commit 9d822ba
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Thu Jun 29 20:56:03 2017 +0200
+
+    mkfs: List all options with short descriptions in --help message
+    
+    Make the help message more informative by giving a short description,
+    simplifying the usage line and giving a short description of every
+    option. The usage line now also shows the actual executable name instead
+    of a hardwired 'mkfs.fat'.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 32b3bce
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Wed Jun 28 15:17:33 2017 +0200
+
+    mkfs, fsck: Add --variant=TYPE command line option
+    
+    TYPE can be 'standard' or 'atari' (case insensitive) to select the
+    desired mode rather than having to toggle with -A.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 6fc9004
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Tue May 30 21:26:44 2017 +0200
+
+    manpages: Rework the intro of the mkfs man page
+    
+    Acknowledge that image files can be used in place of device files.
+    Remove mentions of "under Linux" since it has been portable for a while.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit bbbd077
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Fri Apr 21 20:47:32 2017 +0200
+
+    manpages, configure.ac: Correct description of Atari format selection
+    
+    The -A option doesn't turn on (or turn off) Atari format selection, it
+    toggles it with every occurrence. Change wording in the man pages to
+    reflect that.
+    
+    Also mention that automatic selection can happen only on 68k Atari Linux
+    in the man pages and the --enable-atari-check option help in
+    configure.ac.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 9fa180c
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Thu Apr 6 20:47:11 2017 +0200
+
+    Disable legacy check for 68k Atari by default
+    
+    The code that checked for Atari hardware when compiled for the 68k
+    architecture is now disabled by default. A new configure option
+    --enable-atari-check allows enabling it again.
+    
+    In addition to the the new configure option and the symbol __mc68000__
+    it also depends on __linux__, since its implementation checks Linux
+    specific /proc files.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit d0c8900
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Wed Apr 5 20:40:33 2017 +0200
+
+    Move all three check_atari() and atari_format definitions to common.c
+    
+    Now that mkfs is also using common.c, all three identical check_atari()
+    definitions from mkfs, fsck and fatlabel can be combined in a single
+    location in common.c
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit a753734
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Wed Apr 5 20:29:20 2017 +0200
+
+    mkfs: Link with common.c and use its die() implementation
+    
+    Now common.c is linked into mkfs and its die() implementation is used
+    instead of the local implementation. That implementation consisting of a
+    die() macro and fatal_error() function has been removed.
+    
+    To reproduce current messages exactly, there is now a program_name
+    variable in common.c. If it is not NULL, die() will prepend its contents
+    to the message it prints.
+    
+    The previous implementation implicitly passed device_name to the
+    printf() so that die() invocations only needed to put "%s" where they
+    wanted the device name to appear in the string. These invocations now
+    have explicit device_name arguments.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit b0d524d
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Tue Apr 4 20:42:02 2017 +0200
+
+    fsck.fat.h: Remove extern declarations of interactive and write_immed
+    
+    These two declarations were forgotten when the variables moved to
+    common.c.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 2af848f
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Mon Apr 3 20:53:14 2017 +0200
+
+    fsck: Switch to getopt_long() option parser and add --help option
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit c0c3141
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Mon Apr 3 20:45:20 2017 +0200
+
+    fsck: Pass the exit value to use to usage()
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 112bdc6
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Mon Apr 3 20:41:31 2017 +0200
+
+    fsck: Clean up usage() message a little
+    
+    Bring the usage() help message more in line with common conventions.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 4d2273a
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Fri Mar 31 14:41:42 2017 +0200
+
+    mkfs.fat.c: Change misleading comment about FAT32 selection
+    
+    There was an apparently very old comment in setup_tables() about FAT32
+    not yet being chosen automatically. If a specific FAT size is not
+    requested from the command line, establish_params() will previously have
+    set size_fat to 32 when the filesystem size is at least 512 MiB.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 8585962
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Fri Mar 24 20:40:12 2017 +0100
+
+    fsck: Add quit choice to interactive prompts
+    
+    All prompts now get an additional 'q' choice to explicitly quit fsck.
+    Selecting 'q' will print a message detailing the situation and ask for
+    confirmation.
+    
+    Since the message describing the situation depends on whether fsck is in
+    immediate-write mode, the variable selecting that is moved to common.c
+    to make it accessible to the get_choice() function.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit c366076
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Thu Feb 23 21:00:59 2017 +0100
+
+    fsck: Make prompts asking for writing changes at end more verbose and clear
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 141b009
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Wed Feb 22 20:07:25 2017 +0100
+
+    fsck: Don't ask whether to perform changes in immediate write mode
+    
+    When all changes have already been written directly, it is useless to
+    ask whether to commit the changes and probably confusing to the user.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit b2cfd70
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Tue Feb 21 21:36:04 2017 +0100
+
+    Remove get_key()
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 0c1c5fc
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Tue Feb 21 21:24:14 2017 +0100
+
+    Overhaul interactive prompts
+    
+    All uses of get_key() are converted to get_choice() and fsck now
+    disables canonical terminal mode to directly get key presses. It is no
+    longer required to press enter after typing the choice and it is no
+    longer possible to enter whole strings where only a character is
+    expected. The reaction to invalid input should be consistent now (i.e.
+    always repeat the prompt).
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 91b20bd
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Tue Feb 21 21:14:43 2017 +0100
+
+    Add get_choice() function
+    
+    The get_choice() function is intended to supersede get_key(). It takes
+    pairs of return values and strings for every choice and a
+    non-interactive default choice, does the prompting and reading of user
+    input (if interactive) and returns the value for the selected choice.
+    
+    Since it needs to know if it runs in interactive mode, the "interactive"
+    variable has been moved to common.c and removed from fsck.fat.c and
+    fatlabel.c.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit fd92fab
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Tue Feb 21 14:15:12 2017 +0100
+
+    Add get_line() function to read user input in canonical mode
+    
+    The function will first save the terminal state and enable canonical and
+    echo mode, display a prompt, call fgets(), then restore previous
+    terminal mode. This allows it to work correctly regardless of the
+    current terminal mode.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 0155c9c
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Mon Feb 20 14:09:43 2017 +0100
+
+    Add asprintf() wrapper
+    
+    Make xasprintf() a wrapper that calls asprintf() and terminates if an
+    error occurs like the alloc() function does for malloc(). The
+    availability of the non-standard asprintf() call is checked in
+    configure.ac and xasprintf() uses a local implementation if it isn't.
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 09769e6
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Fri Feb 10 14:06:40 2017 +0100
+
+    Fix printf format specifier for printing label
+    
+    Fix a mistake introduced in the last commit where a field width instead
+    of precision was given for rendering a fixed length string (without null
+    termination).
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 08cf67b
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Thu Jan 26 21:31:03 2017 +0100
+
+    Turn label in struct DOS_FS into char array from pointer
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 32eff6f
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Thu Jan 26 21:27:19 2017 +0100
+
+    Append +git to version number
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
+commit 820c2f9 (tag: v4.1)
+Author: Andreas Bombe <aeb@debian.org>
+Date:   Tue Jan 24 13:10:23 2017 +0100
+
+    Releasing version 4.1
+    
+    Signed-off-by: Andreas Bombe <aeb@debian.org>
+
 commit cad2c17
 Author: Andreas Bombe <aeb@debian.org>
 Date:   Mon Jan 23 03:10:56 2017 +0100
index 338705a..0ad3041 100644 (file)
@@ -7,4 +7,7 @@ dist_doc_DATA = doc/ANNOUNCE.mkdosfs \
                doc/README.dosfsck \
                doc/README.dosfstools-2.x \
                doc/README.mkdosfs \
-               doc/TODO.dosfstools-2.x
+               doc/TODO.dosfstools-2.x \
+               COPYING ChangeLog NEWS README
+
+EXTRA_DIST = autogen.sh
diff --git a/Makefile.in b/Makefile.in
new file mode 100644 (file)
index 0000000..2679373
--- /dev/null
@@ -0,0 +1,832 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in 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.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+       $(am__configure_deps) $(dist_doc_DATA) $(am__DIST_COMMON)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+       ctags-recursive dvi-recursive html-recursive info-recursive \
+       install-data-recursive install-dvi-recursive \
+       install-exec-recursive install-html-recursive \
+       install-info-recursive install-pdf-recursive \
+       install-ps-recursive install-recursive installcheck-recursive \
+       installdirs-recursive pdf-recursive ps-recursive \
+       tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(docdir)"
+DATA = $(dist_doc_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+       cscope distdir distdir-am dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in COPYING ChangeLog NEWS README \
+       compile config.guess config.rpath config.sub install-sh \
+       missing
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECKATARI = @CHECKATARI@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RELEASE_DATE = @RELEASE_DATE@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XXD_FOUND = @XXD_FOUND@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = src manpages tests
+dist_doc_DATA = doc/ANNOUNCE.mkdosfs \
+               doc/ChangeLog.dosfsck \
+               doc/ChangeLog.dosfstools-2.x \
+               doc/ChangeLog.mkdosfs \
+               doc/README.dosfsck \
+               doc/README.dosfstools-2.x \
+               doc/README.mkdosfs \
+               doc/TODO.dosfstools-2.x \
+               COPYING ChangeLog NEWS README
+
+EXTRA_DIST = autogen.sh
+all: all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+       @:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           echo ' $(SHELL) ./config.status'; \
+           $(SHELL) ./config.status;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+install-dist_docDATA: $(dist_doc_DATA)
+       @$(NORMAL_INSTALL)
+       @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
+       done
+
+uninstall-dist_docDATA:
+       @$(NORMAL_UNINSTALL)
+       @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+       @fail=; \
+       if $(am__make_keepgoing); then \
+         failcom='fail=yes'; \
+       else \
+         failcom='exit 1'; \
+       fi; \
+       dot_seen=no; \
+       target=`echo $@ | sed s/-recursive//`; \
+       case "$@" in \
+         distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+         *) list='$(SUBDIRS)' ;; \
+       esac; \
+       for subdir in $$list; do \
+         echo "Making $$target in $$subdir"; \
+         if test "$$subdir" = "."; then \
+           dot_seen=yes; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+       test ! -s cscope.files \
+         || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+       -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+       -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       $(am__remove_distdir)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+       @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           $(am__make_dryrun) \
+             || test -d "$(distdir)/$$subdir" \
+             || $(MKDIR_P) "$(distdir)/$$subdir" \
+             || exit 1; \
+           dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+           $(am__relativize); \
+           new_distdir=$$reldir; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -o \
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+       || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+       tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
+       $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+       $(am__post_remove_distdir)
+
+dist-lzip: distdir
+       tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+       $(am__post_remove_distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+       $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+       @echo WARNING: "Support for distribution archives compressed with" \
+                      "legacy program 'compress' is deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+       $(am__post_remove_distdir)
+
+dist-shar: distdir
+       @echo WARNING: "Support for shar distribution archives is" \
+                      "deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+       shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
+       $(am__post_remove_distdir)
+
+dist-zip: distdir
+       -rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
+       $(am__post_remove_distdir)
+
+dist dist-all:
+       $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+       $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+       case '$(DIST_ARCHIVES)' in \
+       *.tar.gz*) \
+         eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lz*) \
+         lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
+       *.zip*) \
+         unzip $(distdir).zip ;;\
+       esac
+       chmod -R a-w $(distdir)
+       chmod u+w $(distdir)
+       mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+       chmod a-w $(distdir)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__cd) $(distdir)/_build/sub \
+         && ../../configure \
+           $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+           $(DISTCHECK_CONFIGURE_FLAGS) \
+           --srcdir=../.. --prefix="$$dc_install_base" \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+         && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+               distuninstallcheck \
+         && chmod -R a-w "$$dc_install_base" \
+         && ({ \
+              (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+                   distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+             } || { rm -rf "$$dc_destdir"; exit 1; }) \
+         && rm -rf "$$dc_destdir" \
+         && $(MAKE) $(AM_MAKEFLAGS) dist \
+         && rm -rf $(DIST_ARCHIVES) \
+         && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(am__post_remove_distdir)
+       @(echo "$(distdir) archives ready for distribution: "; \
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+       @test -n '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: trying to run $@ with an empty' \
+              '$$(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       $(am__cd) '$(distuninstallcheck_dir)' || { \
+         echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+         exit 1; \
+       }; \
+       test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+          || { echo "ERROR: files left after uninstall:" ; \
+               if test -n "$(DESTDIR)"; then \
+                 echo "  (check DESTDIR support)"; \
+               fi ; \
+               $(distuninstallcheck_listfiles) ; \
+               exit 1; } >&2
+distcleancheck: distclean
+       @if test '$(srcdir)' = . ; then \
+         echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+         exit 1 ; \
+       fi
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+         || { echo "ERROR: files left in build directory after distclean:" ; \
+              $(distcleancheck_listfiles) ; \
+              exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(docdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-dist_docDATA
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf $(top_srcdir)/autom4te.cache
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-dist_docDATA
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+       am--refresh check check-am clean clean-cscope clean-generic \
+       cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+       dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
+       distcheck distclean distclean-generic distclean-tags \
+       distcleancheck distdir distuninstallcheck dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dist_docDATA install-dvi \
+       install-dvi-am install-exec install-exec-am install-html \
+       install-html-am install-info install-info-am install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
+       tags-am uninstall uninstall-am uninstall-dist_docDATA
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
index a8664d6..6858ee2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,160 @@
+dosfstools 4.2 - released 2021-01-31
+====================================
+
+fatlabel now accepts two new options. When given the -i or --volume-id option,
+fatlabel changes to an alternate mode where it displays or changes the volume
+serial number instead of the volume label. With the -r or --reset option, it
+will remove the label or (in the alternate mode) generate a new volume serial
+number.
+
+The user prompting for interactive fsck has been overhauled. Now it will
+directly react to a pressed key without the user having to additionally press
+enter. The changed prompting is also consistently repeating the prompt when
+invalid input is given.
+
+The legacy check whether it is running on Atari hardware when compiled for 68k
+in order to automatically switch to Atari mode is now disabled by default. It
+can be compiled in with the new configure switch --enable-atari-check.
+
+Both mkfs and fsck now have a new option --variant=TYPE where TYPE can be
+'standard' or 'atari' to explicitly select one of those variants rather than
+having to toggle between them with -A.
+
+fsck, mkfs and fatlabel were fixed to process volume label correctly. Previously
+there were many issues during processing labels. Fixes issues are: leading byte
+0xE5 of root label needs to be handled in special way, label cannot contain some
+special characters, label itself is stored according to the current DOS codepage
+which may be specified by a new --codepage option. fatlabel now reads volume
+label only from the root directory to be compatible with existing systems like
+MS-DOS 5.00, MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP, Windows 7, 8, 10
+and also with the Linux mlabel from mtools project. fsck was extended to fix
+incorrect volume labels and ensure that volume label from the root directory is
+same as the volume label stored in boot sector. Old versions of dosfslabel read
+label only from the boot sector. So with all these changes fsck now ensures
+compatibility with both MS-DOS/Windows and old Linux/dosfslabel world.
+
+fsck now allows spaces in the middle of SFNs. Previous behavior (when spaces
+are disallowed) can be achieved by a new option -S.
+
+Both mkfs and fsck now have fixed Year 2038 Bug. mkfs may still set filesystem
+timestamp to 1980-01-01 00:00:00 (beginning of the FAT era) in case operating
+system has Year 2038 Bug and cannot provide current time in time_t variable.
+
+Some memory leaks were fixed in fatlabel and fsck to make valgrind happy.
+
+Processing of command line arguments in all tools were fixed to ensure that
+invalid options are not accepted anymore and proper error message is thrown
+instead of trying to continue with uninitialized or undefined value.
+
+In fsck and fatlabel were fixed issues that faulty filesystems were able to
+trigger integer overflows during reading them.
+
+mkfs now has a new option --offset for specifying offset at which filesystem
+would start. This is useful when formatting FAT filesystem on disk image with
+MBR table without need to use loopback kernel driver with partx to access only
+specific partition.
+
+All tools now can be compiled without iconv library and in this case they
+support only CP850 codepage which is integrated into tools. This internal
+CP850 codepage can be used also when tools were compiled with iconv library
+which do not support CP850 (e.g. iconv from GNU libc without installed gconv
+shared libraries).
+
+Manual pages were updated to clarify some ambiguous options and descriptions.
+fatlabel has a new section with details about volume label and codepage issues.
+
+mkfs now has a new option --mbr which fills (fake) MBR table with one partition
+which spans whole disk device. This (fake) MBR table is needed only for
+non-removable disks used on Microsoft Windows systems and only when formatting
+whole unpartitioned disk.
+
+mkfs now calculates CHS geometry according to the SD Card Part 2 File System
+Specification. For SD cards with more than 256MB capacity is this new CHS
+calculation same as CHS calculation defined for hard disks via LBA-Assist
+Translation. So CHS geometry calculation in mkfs is now compatible with both
+SD Card specification and also LBA-Assist Translation. Moreover mkfs now has
+also a new option -g for specifying CHS geometry manually if it is needed for
+compatibility with some SD card readers. CHS geometry is part of FAT boot
+sector which mkfs.fat must fill.
+
+fsck now checks for DOS Clean Shutdown bit and marks filesystem as clean after
+successful run. This is for compatibility with Microsft Windows 98 and also with
+Windows NT-based variants.
+
+Dependency on systemd/udev was completely removed from mkfs tool. But there is
+no lost or removed functionality. Existing systemd/udev code was rewritten to
+directly access sysfs and new implementation has less lines of code as previous
+implementation which used systemd/udev libraries.
+
+mkfs was fixed to setup FAT32 backup boot sector correctly.
+
+mkfs's -D option (BIOS drive number) was relaxed to support also higher level
+hard disk and floppy devices (second, third, ...).
+
+fsck now preserve reserved fields in info sector. They are used by other systems
+(e.g. FSIBOOT stage of lDOS boot32.asm), hence why are reserved.
+
+fsck was extended to check and fix that first two entires in directory
+structures are . and ..
+
+mkfs now aligns total number of sectors to be multiple of the value of sectors
+per track which is stored in FAT boot sector. This requirement is needed by DOS
+systems and also by Linux FAT tools from mtools project. Alignment can be turned
+off by -a option.
+
+mkfs is now able to calculate FAT32 cluster size also for disks which have
+sector size different than 512 bytes. Note that this calculation is not optimal.
+It is just first step which ensures that mkfs does not fail during formatting
+Native 4K disks.
+
+mkfs cluster calculation was fixed to correctly handle differences between
+FAT12 and FAT16 variants. mkfs now explicitly disallow to create FAT filesystem
+with 4085 or 4086 clusters because Windows fastfat.sys detects such filesystem
+as FAT12 but Linux msdos.ko/vfat.ko detects it as FAT16. mkfs now avoids this
+situation to happen by fully automatic increasing or decreasing cluster size.
+
+fsck now has a new option -F which can be used to specify FAT table used for
+reading whole FAT filesystem. It can be useful in situation when user wants
+to do recovery and filesystem repairing from second FAT table independently
+of what fsck thinks that is the best.
+
+fsck was extended to try fixing first FAT cluster but only when -F option is
+specified. Previously when first FAT cluster was broken, fsck just printed
+error: "Both FATs appear to be corrupt. Giving up." and failed.
+
+fatlabel was fixed to not call parts of fsck procedure and to not print
+warning or log messages on stdout as it conflicts with expected label
+output on stdout.
+
+A test suite was heavily extended and now it also checks that fsck repairs
+broken filesystem into the expected state.
+
+List of fixed issues:
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803391
+https://github.com/dosfstools/dosfstools/issues/13
+https://github.com/dosfstools/dosfstools/issues/18
+https://github.com/dosfstools/dosfstools/issues/22
+https://github.com/dosfstools/dosfstools/issues/29
+https://github.com/dosfstools/dosfstools/issues/32
+https://github.com/dosfstools/dosfstools/issues/38
+https://github.com/dosfstools/dosfstools/issues/39
+https://github.com/dosfstools/dosfstools/issues/43
+https://github.com/dosfstools/dosfstools/issues/45
+https://github.com/dosfstools/dosfstools/issues/52
+https://github.com/dosfstools/dosfstools/issues/53
+https://github.com/dosfstools/dosfstools/issues/54
+https://github.com/dosfstools/dosfstools/issues/64
+https://github.com/dosfstools/dosfstools/issues/66
+https://github.com/dosfstools/dosfstools/issues/69
+https://github.com/dosfstools/dosfstools/issues/70
+https://github.com/dosfstools/dosfstools/issues/74
+https://github.com/dosfstools/dosfstools/issues/88
+https://github.com/dosfstools/dosfstools/issues/99
+https://github.com/dosfstools/dosfstools/issues/111
+https://github.com/dosfstools/dosfstools/issues/139
+https://github.com/dosfstools/dosfstools/issues/151
+
+
 dosfstools 4.1 - released 2017-01-24
 ====================================
 
diff --git a/README b/README
index 8ce3d88..4cbfcb0 100644 (file)
--- a/README
+++ b/README
@@ -5,10 +5,6 @@ under the GNU GPL version 3 or later. See the file COPYING for details.
 
 ### Build Requirements
 
-dosfstools recommends libudev. It is used in mkfs.fat to collect additional
-information about the device to format in order to refuse potentially unsafe
-operations without additional confirmation.
-
 The test suite requires the tool xxd (available as part of the vim
 distribution).
 
@@ -49,5 +45,5 @@ repository, you will find that you can not run "./configure" straight away
 because it, like other autogenerated files for the build system, is not included
 in the repository.
 
-First, autoconf and automake have to be installed.  Then you can run
-"autoreconf -i" to generate all the required files.
+First, autoconf, automake and gettext have to be installed.  Then you can run
+"./autogen.sh" to generate all the required files.
diff --git a/README.md b/README.md
deleted file mode 100644 (file)
index 384752e..0000000
--- a/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-dosfstools consists of the programs mkfs.fat, fsck.fat and fatlabel to create,
-check and label file systems of the FAT family.  The dosfstools are licensed
-under the GNU GPL version 3 or later. See the file `COPYING` for details.
-
-
-### Build Requirements
-
-dosfstools recommends libudev. It is used in mkfs.fat to collect additional
-information about the device to format in order to refuse potentially unsafe
-operations without additional confirmation.
-
-The test suite requires the tool `xxd` (available as part of the `vim`
-distribution).
-
-
-### Installing
-
-dosfstools are built using an autoconf/automake system, so the standard method
-applies:
-
-```
-./configure
-make
-make install
-```
-
-You need to have superuser privileges in order to install into the standard
-system wide locations.
-
-The `./configure` script has an option `--enable-compat-symlinks` that will
-configure the build to symlink older names of the tools to the current ones on
-installation. These are `dosfsck`, `fsck.msdos` and `fsck.vfat` for `fsck.fat`,
-`mkdosfs`, `mkfs.msdos` and `mkfs.vfat` for `mkfs.fat` and `dosfslabel` for
-`fatlabel`.
-
-
-### Running the test suite
-
-The test suite can be run with `make check` after configuring. Note that if
-`xxd` isn't available, all tests will be skipped and nothing actually tested.
-
-During the tests temporary files of multiple GB in size will be created, but the
-actual data content is not more than a few MB. The operating system and the
-filesystem the tests are executed on should support sparse files, otherwise the
-tests will be resource intensive.
-
-
-### Building from the VCS repository
-
-If you are working directly from a git clone of the official dosfstools
-repository, you will find that you can not run `./configure` straight away
-because it, like other autogenerated files for the build system, is not included
-in the repository.
-
-First, autoconf and automake have to be installed.  Then you can run `autoreconf
--i` to generate all the required files.
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644 (file)
index 0000000..1749ca0
--- /dev/null
@@ -0,0 +1,2530 @@
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+
+# 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($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# iconv.m4 serial 19 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2007-2014, 2016 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_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+
+  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+  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.
+  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+  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_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], [
+    am_cv_func_iconv="no, consider installing GNU libiconv"
+    am_cv_lib_iconv=no
+    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_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_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.  */
+  if (/* Try standardized names.  */
+      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
+      /* Try IRIX, OSF/1 names.  */
+      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
+      /* Try AIX names.  */
+      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
+      /* Try HP-UX names.  */
+      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+    result |= 16;
+  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])
+    AC_MSG_RESULT([$LIBICONV])
+  else
+    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+    dnl either.
+    CPPFLAGS="$am_save_CPPFLAGS"
+    LIBICONV=
+    LTLIBICONV=
+  fi
+  AC_SUBST([LIBICONV])
+  AC_SUBST([LTLIBICONV])
+])
+
+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_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+#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="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([
+         $am_cv_proto_iconv])
+    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
+      ])
+  fi
+])
+
+# lib-ld.m4 serial 6
+dnl Copyright (C) 1996-2003, 2009-2016 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/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
+dnl collision with libtool.m4.
+
+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 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=no
+  ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-2.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[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
+  # 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 $CC])
+  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.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname 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
+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
+  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"
+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])
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
+])
+
+# lib-link.m4 serial 26 (gettext-0.18.2)
+dnl Copyright (C) 2001-2016 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.54])
+
+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])
+  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
+  popdef([NAME])
+  popdef([Name])
+])
+
+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. 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])
+  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.
+  AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed lib[]Name and not disabled its use
+  dnl via --without-lib[]Name-prefix, he wants to use it.
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+    ac_save_LIBS="$LIBS"
+    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 lib][$1 library.])
+    AC_MSG_CHECKING([how to link with lib[]$1])
+    AC_MSG_RESULT([$LIB[]NAME])
+  else
+    HAVE_LIB[]NAME=no
+    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+    dnl $INC[]NAME either.
+    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)
+  AC_SUBST([LIB]NAME[_PREFIX])
+  popdef([NAME])
+  popdef([Name])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+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 Tell automake >= 1.10 to complain if config.rpath is missing.
+  m4_ifdef([AC_REQUIRE_AUX_FILE], [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], [
+    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
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
+  ])
+  wl="$acl_cv_wl"
+  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],
+    [  --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],
+[
+  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 Autoconf >= 2.61 supports dots in --with options.
+  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_ARG_WITH(P_A_C_K[-prefix],
+[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
+  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+        if test "$acl_libdirstem2" != "$acl_libdirstem" \
+           && ! test -d "$withval/$acl_libdirstem"; then
+          additional_libdir="$withval/$acl_libdirstem2"
+        fi
+      fi
+    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=
+  names_next_round='$1 $2'
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        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____|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+          else
+            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+            dnl that this library doesn't exist. So just drop it.
+            :
+          fi
+        else
+          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+          dnl and the already constructed $LIBNAME/$LTLIBNAME.
+          found_dir=
+          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
+            dir="$additional_libdir"
+            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"; 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"; 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"; 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"; 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
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIB[]NAME; do
+              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  dnl First look for a shared library.
+                  if test -n "$acl_shlibext"; then
+                    if test -f "$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"; 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"; 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"; 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
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+            dnl Found the library.
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+              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/$acl_libdirstem" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+                dnl No hardcoding is needed.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+              else
+                dnl Use an explicit option to hardcode DIR into the resulting
+                dnl binary.
+                dnl Potentially add DIR to ltrpathdirs.
+                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                dnl The hardcoding into $LIBNAME is system dependent.
+                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 "$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"
+                    dnl Potentially add DIR to rpathdirs.
+                    dnl The rpathdirs will be appended to $LIBNAME at the end.
+                    haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                    dnl Rely on "-L$found_dir".
+                    dnl But don't add it if it's already contained in the LDFLAGS
+                    dnl or the already constructed $LIBNAME
+                    haveit=
+                    for x in $LDFLAGS $LIB[]NAME; do
+                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+                    fi
+                    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 $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.
+                      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:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                dnl Linking with a static library.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+              else
+                dnl We shouldn't come here, but anyway it's good to have a
+                dnl fallback.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+              fi
+            fi
+            dnl Assume the include files are nearby.
+            additional_includedir=
+            case "$found_dir" in
+              */$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"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+              dnl Potentially add $additional_includedir to $INCNAME.
+              dnl But don't add it
+              dnl   1. if it's the standard /usr/include,
+              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
+              dnl   3. if it's already present in $CPPFLAGS or the already
+              dnl      constructed $INCNAME,
+              dnl   4. if it doesn't exist as a directory.
+              if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INC[]NAME; do
+                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                      dnl Really add $additional_includedir to $INCNAME.
+                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+            dnl Look for dependencies.
+            if test -n "$found_la"; then
+              dnl Read the .la file. It defines the variables
+              dnl dlname, library_names, old_library, dependency_libs, current,
+              dnl age, revision, installed, dlopen, dlpreopen, libdir.
+              save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+              dnl We use only dependency_libs.
+              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.
+                    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/$acl_libdirstem" \
+                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        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
+                            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"
+                          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
+                            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"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                      dnl Potentially add DIR to rpathdirs.
+                      dnl The rpathdirs will be appended to $LIBNAME at the end.
+                      haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                      dnl Potentially add DIR to ltrpathdirs.
+                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                      haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                    dnl Handle this in the next round.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                    dnl Handle this in the next round. Throw away the .la's
+                    dnl directory; it is already contained in a preceding -L
+                    dnl option.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                    dnl Most likely an immediate library name.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+            dnl Didn't find the library; assume it is in the system directories
+            dnl known to the linker and runtime loader. (All the system
+            dnl directories known to the linker should also be known to the
+            dnl runtime loader, otherwise the system is severely misconfigured.)
+            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; 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:+$acl_hardcode_libdir_separator}$found_dir"
+      done
+      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
+      acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+    else
+      dnl The -rpath options are cumulative.
+      for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+    dnl When using libtool, the option that works for both libraries and
+    dnl executables is -R. The -R options are cumulative.
+    for found_dir in $ltrpathdirs; do
+      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+    done
+  fi
+  popdef([P_A_C_K])
+  popdef([PACKLIBS])
+  popdef([PACKUP])
+  popdef([PACK])
+  popdef([NAME])
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+  for element in [$2]; do
+    haveit=
+    for x in $[$1]; do
+      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      [$1]="${[$1]}${[$1]:+ }$element"
+    fi
+  done
+])
+
+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"; 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"; 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 7 (gettext-0.18)
+dnl Copyright (C) 2001-2005, 2008-2016 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
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+  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
+  AC_LIB_WITH_FINAL_PREFIX([
+    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],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+      fi
+    fi
+])
+  if test $use_additional = yes; then
+    dnl Potentially add $additional_includedir to $CPPFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/include,
+    dnl   2. if it's already present in $CPPFLAGS,
+    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_includedir" != "X/usr/include"; then
+      haveit=
+      for x in $CPPFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-I$additional_includedir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_includedir" = "X/usr/local/include"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_includedir"; then
+            dnl Really add $additional_includedir to $CPPFLAGS.
+            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+          fi
+        fi
+      fi
+    fi
+    dnl Potentially add $additional_libdir to $LDFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/lib,
+    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/$acl_libdirstem"; then
+      haveit=
+      for x in $LDFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-L$additional_libdir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux*) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_libdir"; then
+            dnl Really add $additional_libdir to $LDFLAGS.
+            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+          fi
+        fi
+      fi
+    fi
+  fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+  dnl Unfortunately, prefix and exec_prefix get only finally determined
+  dnl at the end of configure.
+  if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  $1
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_PREPARE_MULTILIB creates
+dnl - a variable acl_libdirstem, containing the basename of the libdir, either
+dnl   "lib" or "lib64" or "lib/64",
+dnl - a variable acl_libdirstem2, as a secondary possible value for
+dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
+dnl   "lib/amd64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+  dnl There is no formal standard regarding lib and lib64.
+  dnl On 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. We determine
+  dnl the compiler's default mode by looking at the compiler's library search
+  dnl path. If at least one of its elements ends in /lib64 or points to a
+  dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
+  dnl Otherwise we use the default, 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])
+  acl_libdirstem=lib
+  acl_libdirstem2=
+  case "$host_os" in
+    solaris*)
+      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
+      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.
+      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
+        [AC_EGREP_CPP([sixtyfour bits], [
+#ifdef _LP64
+sixtyfour bits
+#endif
+           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
+        ])
+      if test $gl_cv_solaris_64bit = yes; then
+        acl_libdirstem=lib/64
+        case "$host_cpu" in
+          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
+          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+        esac
+      fi
+      ;;
+    *)
+      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+      if test -n "$searchpath"; then
+        acl_save_IFS="${IFS=   }"; IFS=":"
+        for searchdir in $searchpath; do
+          if test -d "$searchdir"; then
+            case "$searchdir" in
+              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+              */../ | */.. )
+                # Better ignore directories of this form. They are misleading.
+                ;;
+              *) searchdir=`cd "$searchdir" && pwd`
+                 case "$searchdir" in
+                   */lib64 ) acl_libdirstem=lib64 ;;
+                 esac ;;
+            esac
+          fi
+        done
+        IFS="$acl_save_IFS"
+      fi
+      ;;
+  esac
+  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+])
+
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.16'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.16.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.16.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  AS_CASE([$CONFIG_FILES],
+          [*\'*], [eval set x "$CONFIG_FILES"],
+          [*], [set x $CONFIG_FILES])
+  shift
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
+  do
+    # Strip MF so we end up with the name of the file.
+    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`AS_DIRNAME(["$am_mf"])`
+    am_filepart=`AS_BASENAME(["$am_mf"])`
+    AM_RUN_LOG([cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles]) || am_rc=$?
+  done
+  if test $am_rc -ne 0; then
+    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  Try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).])
+  fi
+  AS_UNSET([am_dirpart])
+  AS_UNSET([am_filepart])
+  AS_UNSET([am_mf])
+  AS_UNSET([am_rc])
+  rm -f conftest-deps.mk
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+#
+# 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 macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+             [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+             [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                 [_AM_DEPENDENCIES([CC])],
+                 [m4_define([AC_PROG_CC],
+                            m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                 [_AM_DEPENDENCIES([CXX])],
+                 [m4_define([AC_PROG_CXX],
+                            m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_AM_DEPENDENCIES([OBJC])],
+                 [m4_define([AC_PROG_OBJC],
+                            m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+                 [_AM_DEPENDENCIES([OBJCXX])],
+                 [m4_define([AC_PROG_OBJCXX],
+                            m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.                 -*- Autoconf -*-
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
+am__doit:
+       @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+      ['0:this is the am__doit target'],
+      [AS_CASE([$s],
+          [BSD], [am__include='.include' am__quote='"'],
+          [am__include='include' am__quote=''])])
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$[*]" = "X"; then
+       # -L didn't work.
+       set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
+       && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+       # If neither matched, then we have a broken ls.  This can happen
+       # if, for instance, CONFIG_SHELL is bash and it inherits a
+       # broken ls alias from the environment.  This has actually
+       # happened.  Such a system could not be considered "sane".
+       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment])
+     fi
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
+#
+# 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.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
+
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  for _am_tool in $_am_tools; do
+    case $_am_tool in
+    gnutar)
+      for _am_tar in tar gnutar gtar; do
+        AM_RUN_LOG([$_am_tar --version]) && break
+      done
+      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+      am__untar="$_am_tar -xf -"
+      ;;
+    plaintar)
+      # Must skip GNU tar: if it does not support --format= it doesn't create
+      # ustar tarball either.
+      (tar --version) >/dev/null 2>&1 && continue
+      am__tar='tar chf - "$$tardir"'
+      am__tar_='tar chf - "$tardir"'
+      am__untar='tar xf -'
+      ;;
+    pax)
+      am__tar='pax -L -x $1 -w "$$tardir"'
+      am__tar_='pax -L -x $1 -w "$tardir"'
+      am__untar='pax -r'
+      ;;
+    cpio)
+      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+      am__untar='cpio -i -H $1 -d'
+      ;;
+    none)
+      am__tar=false
+      am__tar_=false
+      am__untar=false
+      ;;
+    esac
+
+    # If the value was cached, stop now.  We just wanted to have am__tar
+    # and am__untar set.
+    test -n "${am_cv_prog_tar_$1}" && break
+
+    # tar/untar a dummy directory, and stop if the command works.
+    rm -rf conftest.dir
+    mkdir conftest.dir
+    echo GrepMe > conftest.dir/file
+    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+    rm -rf conftest.dir
+    if test -s conftest.tar; then
+      AM_RUN_LOG([$am__untar <conftest.tar])
+      AM_RUN_LOG([cat conftest.dir/file])
+      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+    fi
+  done
+  rm -rf conftest.dir
+
+  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..53567dd
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# Install config.rpath which is needed for AM_ICONV macro
+for dir in "$GETTEXT_DIR" /usr/share/gettext /usr/local/share/gettext; do
+  if test -f "$dir/config.rpath"; then
+    test -f config.rpath || echo "autogen.sh: installing './config.rpath'"
+    cp -f "$dir/config.rpath" .
+    break
+  fi
+done
+
+aclocal --force
+autoconf --force
+automake --add-missing --copy --force-missing
diff --git a/bin/Nindent b/bin/Nindent
deleted file mode 100755 (executable)
index cf8ecfd..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-PARAM="-npro -kr -i4 -ts8 -sob -l80 -ss -ncs -cp1"
-RES=`indent --version`
-V1=`echo $RES | cut -d' ' -f3 | cut -d'.' -f1`
-V2=`echo $RES | cut -d' ' -f3 | cut -d'.' -f2`
-V3=`echo $RES | cut -d' ' -f3 | cut -d'.' -f3`
-if [ $V1 -gt 2 ]; then
-  PARAM="$PARAM -il0"
-elif [ $V1 -eq 2 ]; then
-  if [ $V2 -gt 2 ]; then
-    PARAM="$PARAM -il0";
-  elif [ $V2 -eq 2 ]; then
-    if [ $V3 -ge 10 ]; then
-      PARAM="$PARAM -il0"
-    fi
-  fi
-fi
-exec indent $PARAM "$@"
diff --git a/compile b/compile
new file mode 100755 (executable)
index 0000000..99e5052
--- /dev/null
+++ b/compile
@@ -0,0 +1,348 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.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, 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 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 maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""       $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+       # lazily determine how to convert abs files
+       case `uname -s` in
+         MINGW*)
+           file_conv=mingw
+           ;;
+         CYGWIN*)
+           file_conv=cygwin
+           ;;
+         *)
+           file_conv=wine
+           ;;
+       esac
+      fi
+      case $file_conv/,$2, in
+       *,$file_conv,*)
+         ;;
+       mingw/*)
+         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+         ;;
+       cygwin/*)
+         file=`cygpath -m "$file" || echo "$file"`
+         ;;
+       wine/*)
+         file=`winepath -w "$file" || echo "$file"`
+         ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+       -o)
+         # configure might choose to run compile as 'compile cc -o foo foo.c'.
+         eat=1
+         case $2 in
+           *.o | *.[oO][bB][jJ])
+             func_file_conv "$2"
+             set x "$@" -Fo"$file"
+             shift
+             ;;
+           *)
+             func_file_conv "$2"
+             set x "$@" -Fe"$file"
+             shift
+             ;;
+         esac
+         ;;
+       -I)
+         eat=1
+         func_file_conv "$2" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -I*)
+         func_file_conv "${1#-I}" mingw
+         set x "$@" -I"$file"
+         shift
+         ;;
+       -l)
+         eat=1
+         func_cl_dashl "$2"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -l*)
+         func_cl_dashl "${1#-l}"
+         set x "$@" "$lib"
+         shift
+         ;;
+       -L)
+         eat=1
+         func_cl_dashL "$2"
+         ;;
+       -L*)
+         func_cl_dashL "${1#-L}"
+         ;;
+       -static)
+         shared=false
+         ;;
+       -Wl,*)
+         arg=${1#-Wl,}
+         save_ifs="$IFS"; IFS=','
+         for flag in $arg; do
+           IFS="$save_ifs"
+           linker_opts="$linker_opts $flag"
+         done
+         IFS="$save_ifs"
+         ;;
+       -Xlinker)
+         eat=1
+         linker_opts="$linker_opts $2"
+         ;;
+       -*)
+         set x "$@" "$1"
+         shift
+         ;;
+       *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+         func_file_conv "$1"
+         set x "$@" -Tp"$file"
+         shift
+         ;;
+       *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+         func_file_conv "$1" mingw
+         set x "$@" "$file"
+         shift
+         ;;
+       *)
+         set x "$@" "$1"
+         shift
+         ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+  icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+       # configure might choose to run compile as 'compile cc -o foo foo.c'.
+       # So we strip '-o arg' only if arg is an object.
+       eat=1
+       case $2 in
+         *.o | *.obj)
+           ofile=$2
+           ;;
+         *)
+           set x "$@" -o "$2"
+           shift
+           ;;
+       esac
+       ;;
+      *.c)
+       cfile=$1
+       set x "$@" "$1"
+       shift
+       ;;
+      *)
+       set x "$@" "$1"
+       shift
+       ;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.guess b/config.guess
new file mode 100755 (executable)
index 0000000..f50dcdb
--- /dev/null
@@ -0,0 +1,1480 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
+
+timestamp='2018-02-24'
+
+# 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
+# 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 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 Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+#
+# You can get the latest version of this script from:
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+#
+# Please send patches to <config-patches@gnu.org>.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+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
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2018 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."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  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
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# 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= ;'
+
+# 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
+       PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+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"
+       #include <features.h>
+       #if defined(__UCLIBC__)
+       LIBC=uclibc
+       #elif defined(__dietlibc__)
+       LIBC=dietlibc
+       #else
+       LIBC=gnu
+       #endif
+       EOF
+       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
+    *:NetBSD:*:*)
+       # NetBSD (nbsd) targets should (where applicable) match one or
+       # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+       # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+       # switched to ELF, *-*-netbsd* would select the old
+       # object file format.  This provides both forward
+       # compatibility and a consistent mechanism for selecting the
+       # object file format.
+       #
+       # 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=`(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 ;;
+           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) and ABI.
+       case "$UNAME_MACHINE_ARCH" in
+           earm*)
+               os=netbsdelf
+               ;;
+           arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+               eval "$set_cc_for_build"
+               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+                       | grep -q __ELF__
+               then
+                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+                   # Return netbsd for either.  FIX?
+                   os=netbsd
+               else
+                   os=netbsdelf
+               fi
+               ;;
+           *)
+               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
+           Debian*)
+               release='-gnu'
+               ;;
+           *)
+               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}${abi}"
+       exit ;;
+    *:Bitrig:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+       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"
+       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"
+       exit ;;
+    *:SolidBSD:*:*)
+       echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+       exit ;;
+    macppc:MirBSD:*:*)
+       echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
+       exit ;;
+    *:MirBSD:*:*)
+       echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
+       exit ;;
+    *:Sortix:*:*)
+       echo "$UNAME_MACHINE"-unknown-sortix
+       exit ;;
+    *:Redox:*:*)
+       echo "$UNAME_MACHINE"-unknown-redox
+       exit ;;
+    mips:OSF1:*.*)
+        echo mips-dec-osf1
+        exit ;;
+    alpha:OSF1:*:*)
+       case $UNAME_RELEASE in
+       *4.0)
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+               ;;
+       *5.*)
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               ;;
+       esac
+       # According to Compaq, /usr/sbin/psrinfo has been available on
+       # OSF/1 and Tru64 systems produced since 1995.  I hope that
+       # covers most systems running today.  This code pipes the CPU
+       # types through head -n 1, so we only detect the type of CPU 0.
+       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 ;;
+           "EV4.5 (21064)")
+               UNAME_MACHINE=alpha ;;
+           "LCA4 (21066/21068)")
+               UNAME_MACHINE=alpha ;;
+           "EV5 (21164)")
+               UNAME_MACHINE=alphaev5 ;;
+           "EV5.6 (21164A)")
+               UNAME_MACHINE=alphaev56 ;;
+           "EV5.6 (21164PC)")
+               UNAME_MACHINE=alphapca56 ;;
+           "EV5.7 (21164PC)")
+               UNAME_MACHINE=alphapca57 ;;
+           "EV6 (21264)")
+               UNAME_MACHINE=alphaev6 ;;
+           "EV6.7 (21264A)")
+               UNAME_MACHINE=alphaev67 ;;
+           "EV6.8CB (21264C)")
+               UNAME_MACHINE=alphaev68 ;;
+           "EV6.8AL (21264B)")
+               UNAME_MACHINE=alphaev68 ;;
+           "EV6.8CX (21264D)")
+               UNAME_MACHINE=alphaev68 ;;
+           "EV6.9A (21264/EV69A)")
+               UNAME_MACHINE=alphaev69 ;;
+           "EV7 (21364)")
+               UNAME_MACHINE=alphaev7 ;;
+           "EV7.9 (21364A)")
+               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`"
+       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+       exitcode=$?
+       trap '' 0
+       exit $exitcode ;;
+    Amiga*:UNIX_System_V:4.0:*)
+       echo m68k-unknown-sysv4
+       exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+       echo "$UNAME_MACHINE"-unknown-amigaos
+       exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+       echo "$UNAME_MACHINE"-unknown-morphos
+       exit ;;
+    *:OS/390:*:*)
+       echo i370-ibm-openedition
+       exit ;;
+    *:z/VM:*:*)
+       echo s390-ibm-zvmoe
+       exit ;;
+    *:OS400:*:*)
+       echo powerpc-ibm-os400
+       exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+       echo arm-acorn-riscix"$UNAME_RELEASE"
+       exit ;;
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
+       echo arm-unknown-riscos
+       exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+       echo hppa1.1-hitachi-hiuxmpp
+       exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+       # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+       if test "`(/bin/universe) 2>/dev/null`" = att ; then
+               echo pyramid-pyramid-sysv3
+       else
+               echo pyramid-pyramid-bsd
+       fi
+       exit ;;
+    NILE*:*:*:dcosx)
+       echo pyramid-pyramid-svr4
+       exit ;;
+    DRS?6000:unix:4.0:6*)
+       echo sparc-icl-nx6
+       exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+       case `/usr/bin/uname -p` in
+           sparc) echo sparc-icl-nx7; exit ;;
+       esac ;;
+    s390x:SunOS:*:*)
+       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/[^.]*//'`"
+       exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+       echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+       exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+       echo i386-pc-auroraux"$UNAME_RELEASE"
+       exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+       eval "$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 (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+               (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_64BIT_ARCH >/dev/null
+           then
+               SUN_ARCH=x86_64
+           fi
+       fi
+       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/[^.]*//'`"
+       exit ;;
+    sun4*:SunOS:*:*)
+       case "`/usr/bin/arch -k`" in
+           Series*|S4*)
+               UNAME_RELEASE=`uname -v`
+               ;;
+       esac
+       # Japanese Language versions have a version number like `4.1.3-JL'.
+       echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
+       exit ;;
+    sun3*:SunOS:*:*)
+       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
+       case "`/bin/arch`" in
+           sun3)
+               echo m68k-sun-sunos"$UNAME_RELEASE"
+               ;;
+           sun4)
+               echo sparc-sun-sunos"$UNAME_RELEASE"
+               ;;
+       esac
+       exit ;;
+    aushp:SunOS:*:*)
+       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
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # 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"
+       exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+       echo m68k-atari-mint"$UNAME_RELEASE"
+       exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+       echo m68k-atari-mint"$UNAME_RELEASE"
+       exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+       echo m68k-milan-mint"$UNAME_RELEASE"
+       exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+       echo m68k-hades-mint"$UNAME_RELEASE"
+       exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+       echo m68k-unknown-mint"$UNAME_RELEASE"
+       exit ;;
+    m68k:machten:*:*)
+       echo m68k-apple-machten"$UNAME_RELEASE"
+       exit ;;
+    powerpc:machten:*:*)
+       echo powerpc-apple-machten"$UNAME_RELEASE"
+       exit ;;
+    RISC*:Mach:*:*)
+       echo mips-dec-mach_bsd4.3
+       exit ;;
+    RISC*:ULTRIX:*:*)
+       echo mips-dec-ultrix"$UNAME_RELEASE"
+       exit ;;
+    VAX*:ULTRIX*:*:*)
+       echo vax-dec-ultrix"$UNAME_RELEASE"
+       exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+       echo clipper-intergraph-clix"$UNAME_RELEASE"
+       exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+       eval "$set_cc_for_build"
+       sed 's/^        //' << EOF > "$dummy.c"
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
+       #if defined (host_mips) && defined (MIPSEB)
+       #if defined (SYSTYPE_SYSV)
+         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);
+       #endif
+       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+         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"` &&
+           { echo "$SYSTEM_NAME"; exit; }
+       echo mips-mips-riscos"$UNAME_RELEASE"
+       exit ;;
+    Motorola:PowerMAX_OS:*:*)
+       echo powerpc-motorola-powermax
+       exit ;;
+    Motorola:*:4.3:PL8-*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+       echo powerpc-harris-powerunix
+       exit ;;
+    m88k:CX/UX:7*:*)
+       echo m88k-harris-cxux7
+       exit ;;
+    m88k:*:4*:R4*)
+       echo m88k-motorola-sysv4
+       exit ;;
+    m88k:*:3*:R3*)
+       echo m88k-motorola-sysv3
+       exit ;;
+    AViiON:dgux:*:*)
+       # DG/UX returns AViiON for all architectures
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
+       if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
+       then
+           if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+              [ "$TARGET_BINARY_INTERFACE"x = x ]
+           then
+               echo m88k-dg-dgux"$UNAME_RELEASE"
+           else
+               echo m88k-dg-dguxbcs"$UNAME_RELEASE"
+           fi
+       else
+           echo i586-dg-dgux"$UNAME_RELEASE"
+       fi
+       exit ;;
+    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
+       echo m88k-dolphin-sysv3
+       exit ;;
+    M88*:*:R3*:*)
+       # Delta 88k system running SVR3
+       echo m88k-motorola-sysv3
+       exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+       echo m88k-tektronix-sysv3
+       exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+       echo m68k-tektronix-bsd
+       exit ;;
+    *:IRIX*:*:*)
+       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
+       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+       echo i386-ibm-aix
+       exit ;;
+    ia64:AIX:*:*)
+       if [ -x /usr/bin/oslevel ] ; then
+               IBM_REV=`/usr/bin/oslevel`
+       else
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
+       fi
+       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"
+               #include <sys/systemcfg.h>
+
+               main()
+                       {
+                       if (!__power_pc())
+                               exit(1);
+                       puts("powerpc-ibm-aix3.2.5");
+                       exit(0);
+                       }
+EOF
+               if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
+               then
+                       echo "$SYSTEM_NAME"
+               else
+                       echo rs6000-ibm-aix3.2.5
+               fi
+       elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+               echo rs6000-ibm-aix3.2.4
+       else
+               echo rs6000-ibm-aix3.2
+       fi
+       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
+               IBM_ARCH=rs6000
+       else
+               IBM_ARCH=powerpc
+       fi
+       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"
+       fi
+       echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
+       exit ;;
+    *:AIX:*:*)
+       echo rs6000-ibm-aix
+       exit ;;
+    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
+       exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+       echo rs6000-bull-bosx
+       exit ;;
+    DPX/2?00:B.O.S.:*:*)
+       echo m68k-bull-sysv3
+       exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+       echo m68k-hp-bsd
+       exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+       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 ;;
+           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
+                     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
+                       esac ;;
+                   esac
+               fi
+               if [ "$HP_ARCH" = "" ]; then
+                   eval "$set_cc_for_build"
+                   sed 's/^            //' << EOF > "$dummy.c"
+
+               #define _HPUX_SOURCE
+               #include <stdlib.h>
+               #include <unistd.h>
+
+               int main ()
+               {
+               #if defined(_SC_KERNEL_BITS)
+                   long bits = sysconf(_SC_KERNEL_BITS);
+               #endif
+                   long cpu  = sysconf (_SC_CPU_VERSION);
+
+                   switch (cpu)
+                       {
+                       case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+                       case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+                       case CPU_PA_RISC2_0:
+               #if defined(_SC_KERNEL_BITS)
+                           switch (bits)
+                               {
+                               case 64: puts ("hppa2.0w"); break;
+                               case 32: puts ("hppa2.0n"); break;
+                               default: puts ("hppa2.0"); break;
+                               } break;
+               #else  /* !defined(_SC_KERNEL_BITS) */
+                           puts ("hppa2.0"); break;
+               #endif
+                       default: puts ("hppa1.0"); break;
+                       }
+                   exit (0);
+               }
+EOF
+                   (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 ]
+       then
+           eval "$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
+           # generating 64-bit code.  GNU and HP use different nomenclature:
+           #
+           # $ CC_FOR_BUILD=cc ./config.guess
+           # => hppa2.0w-hp-hpux11.23
+           # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+           # => hppa64-hp-hpux11.23
+
+           if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
+               grep -q __LP64__
+           then
+               HP_ARCH=hppa2.0w
+           else
+               HP_ARCH=hppa64
+           fi
+       fi
+       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"
+       exit ;;
+    3050*:HI-UX:*:*)
+       eval "$set_cc_for_build"
+       sed 's/^        //' << EOF > "$dummy.c"
+       #include <unistd.h>
+       int
+       main ()
+       {
+         long cpu = sysconf (_SC_CPU_VERSION);
+         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+            results, however.  */
+         if (CPU_IS_PA_RISC (cpu))
+           {
+             switch (cpu)
+               {
+                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+                 default: puts ("hppa-hitachi-hiuxwe2"); break;
+               }
+           }
+         else if (CPU_IS_HP_MC68K (cpu))
+           puts ("m68k-hitachi-hiuxwe2");
+         else puts ("unknown-hitachi-hiuxwe2");
+         exit (0);
+       }
+EOF
+       $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:*:*)
+       echo hppa1.1-hp-bsd
+       exit ;;
+    9000/8??:4.3bsd:*:*)
+       echo hppa1.0-hp-bsd
+       exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+       echo hppa1.0-hp-mpeix
+       exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
+       echo hppa1.1-hp-osf
+       exit ;;
+    hp8??:OSF1:*:*)
+       echo hppa1.0-hp-osf
+       exit ;;
+    i*86:OSF1:*:*)
+       if [ -x /usr/sbin/sysversion ] ; then
+           echo "$UNAME_MACHINE"-unknown-osf1mk
+       else
+           echo "$UNAME_MACHINE"-unknown-osf1
+       fi
+       exit ;;
+    parisc*:Lites*:*:*)
+       echo hppa1.1-hp-lites
+       exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+       echo c1-convex-bsd
+       exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+       exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+       echo c34-convex-bsd
+       exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+       echo c38-convex-bsd
+       exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+       echo c4-convex-bsd
+       exit ;;
+    CRAY*Y-MP:*:*:*)
+       echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*[A-Z]90:*:*:*)
+       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/'
+       exit ;;
+    CRAY*T3E:*:*:*)
+       echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*SV1:*:*:*)
+       echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    *:UNICOS/mp:*:*)
+       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/ /_/'`
+       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/ /_/'`
+       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"
+       exit ;;
+    sparc*:BSD/OS:*:*)
+       echo sparc-unknown-bsdi"$UNAME_RELEASE"
+       exit ;;
+    *:BSD/OS:*:*)
+       echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+       exit ;;
+    *:FreeBSD:*:*)
+       UNAME_PROCESSOR=`/usr/bin/uname -p`
+       case "$UNAME_PROCESSOR" in
+           amd64)
+               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
+       exit ;;
+    *:MINGW64*:*)
+       echo "$UNAME_MACHINE"-pc-mingw64
+       exit ;;
+    *:MINGW*:*)
+       echo "$UNAME_MACHINE"-pc-mingw32
+       exit ;;
+    *:MSYS*:*)
+       echo "$UNAME_MACHINE"-pc-msys
+       exit ;;
+    i*:PW*:*)
+       echo "$UNAME_MACHINE"-pc-pw32
+       exit ;;
+    *:Interix*:*)
+       case "$UNAME_MACHINE" in
+           x86)
+               echo i586-pc-interix"$UNAME_RELEASE"
+               exit ;;
+           authenticamd | genuineintel | EM64T)
+               echo x86_64-unknown-interix"$UNAME_RELEASE"
+               exit ;;
+           IA64)
+               echo ia64-unknown-interix"$UNAME_RELEASE"
+               exit ;;
+       esac ;;
+    i*:UWIN*:*)
+       echo "$UNAME_MACHINE"-pc-uwin
+       exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+       echo x86_64-unknown-cygwin
+       exit ;;
+    prep*:SunOS:5.*:*)
+       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,/.*$,,'`"
+       exit ;;
+    *:GNU/*:*:*)
+       # other systems with GNU libc and userland
+       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
+       exit ;;
+    aarch64:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    aarch64_be:Linux:*:*)
+       UNAME_MACHINE=aarch64_be
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    alpha:Linux:*:*)
+       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+         EV5)   UNAME_MACHINE=alphaev5 ;;
+         EV56)  UNAME_MACHINE=alphaev56 ;;
+         PCA56) UNAME_MACHINE=alphapca56 ;;
+         PCA57) UNAME_MACHINE=alphapca56 ;;
+         EV6)   UNAME_MACHINE=alphaev6 ;;
+         EV67)  UNAME_MACHINE=alphaev67 ;;
+         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"
+       exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    arm*:Linux:*:*)
+       eval "$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"
+       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
+           else
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
+           fi
+       fi
+       exit ;;
+    avr32*:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    cris:Linux:*:*)
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+       exit ;;
+    crisv32:Linux:*:*)
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+       exit ;;
+    e2k:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    frv:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    hexagon:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    i*86:Linux:*:*)
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
+       exit ;;
+    ia64:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    k1om:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    m32r*:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    m68*:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
+       eval "$set_cc_for_build"
+       sed 's/^        //' << EOF > "$dummy.c"
+       #undef CPU
+       #undef ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       CPU=${UNAME_MACHINE}
+       #else
+       CPU=
+       #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; }
+       ;;
+    mips64el:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    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"
+       exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+       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" ;;
+       esac
+       exit ;;
+    ppc64:Linux:*:*)
+       echo powerpc64-unknown-linux-"$LIBC"
+       exit ;;
+    ppc:Linux:*:*)
+       echo powerpc-unknown-linux-"$LIBC"
+       exit ;;
+    ppc64le:Linux:*:*)
+       echo powerpc64le-unknown-linux-"$LIBC"
+       exit ;;
+    ppcle:Linux:*:*)
+       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"
+       exit ;;
+    sh64*:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    sh*:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    tile*:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    vax:Linux:*:*)
+       echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
+       exit ;;
+    x86_64:Linux:*:*)
+       if objdump -f /bin/sh | grep -q elf32-x86-64; then
+           echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
+       else
+           echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
+       fi
+       exit ;;
+    xtensa*:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    i*86:DYNIX/ptx:4*:*)
+       # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+       # earlier versions are messed up and put the nodename in both
+       # sysname and nodename.
+       echo i386-sequent-sysv4
+       exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+       # Unixware is an offshoot of SVR4, but it has its own version
+       # number series starting with 2...
+       # 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"
+       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
+       exit ;;
+    i*86:XTS-300:*:STOP)
+       echo "$UNAME_MACHINE"-unknown-stop
+       exit ;;
+    i*86:atheos:*:*)
+       echo "$UNAME_MACHINE"-unknown-atheos
+       exit ;;
+    i*86: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"
+       exit ;;
+    i*86:*DOS:*:*)
+       echo "$UNAME_MACHINE"-pc-msdosdjgpp
+       exit ;;
+    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"
+       else
+               echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
+       fi
+       exit ;;
+    i*86:*:5:[678]*)
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       case `/bin/uname -X | grep "^Machine"` in
+           *486*)           UNAME_MACHINE=i486 ;;
+           *Pentium)        UNAME_MACHINE=i586 ;;
+           *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+       esac
+       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"
+       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
+               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+                       && UNAME_MACHINE=i586
+               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
+       else
+               echo "$UNAME_MACHINE"-pc-sysv32
+       fi
+       exit ;;
+    pc:*:*:*)
+       # Left here for compatibility:
+       # 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 configure will decide that
+       # this is a cross-build.
+       echo i586-pc-msdosdjgpp
+       exit ;;
+    Intel:Mach:3*:*)
+       echo i386-pc-mach3
+       exit ;;
+    paragon:*:*:*)
+       echo i860-intel-osf1
+       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
+       else # Add other i860-SVR4 vendors below as they are discovered.
+         echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
+       fi
+       exit ;;
+    mini*:CTIX:SYS*5:*)
+       # "miniframe"
+       echo m68010-convergent-sysv
+       exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+       echo m68k-convergent-sysv
+       exit ;;
+    M680?0:D-NIX:5.3:*)
+       echo m68k-diab-dnix
+       exit ;;
+    M68*:*:R3V[5678]*:*)
+       test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+       OS_REL=''
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+         && { 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; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+           && { 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; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+       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"
+       exit ;;
+    rs6000:LynxOS:2.*:*)
+       echo rs6000-unknown-lynxos"$UNAME_RELEASE"
+       exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+       echo powerpc-unknown-lynxos"$UNAME_RELEASE"
+       exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+       echo mips-dde-sysv"$UNAME_RELEASE"
+       exit ;;
+    RM*:ReliantUNIX-*:*:*)
+       echo mips-sni-sysv4
+       exit ;;
+    RM*:SINIX-*:*:*)
+       echo mips-sni-sysv4
+       exit ;;
+    *:SINIX-*:*:*)
+       if uname -p 2>/dev/null >/dev/null ; then
+               UNAME_MACHINE=`(uname -p) 2>/dev/null`
+               echo "$UNAME_MACHINE"-sni-sysv4
+       else
+               echo ns32k-sni-sysv
+       fi
+       exit ;;
+    PENTIUM:*:4.0*:*)  # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                       # says <Richard.M.Bartel@ccMail.Census.GOV>
+       echo i586-unisys-sysv4
+       exit ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # How about differentiating between stratus architectures? -djm
+       echo hppa1.1-stratus-sysv4
+       exit ;;
+    *:*:*:FTX*)
+       # From seanf@swdc.stratus.com.
+       echo i860-stratus-sysv4
+       exit ;;
+    i*86:VOS:*:*)
+       # From Paul.Green@stratus.com.
+       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"
+       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"
+       else
+               echo mips-unknown-sysv"$UNAME_RELEASE"
+       fi
+       exit ;;
+    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
+       echo powerpc-be-beos
+       exit ;;
+    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
+       echo powerpc-apple-beos
+       exit ;;
+    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
+       echo i586-pc-beos
+       exit ;;
+    BePC:Haiku:*:*)    # Haiku running on Intel PC compatible.
+       echo i586-pc-haiku
+       exit ;;
+    x86_64:Haiku:*:*)
+       echo x86_64-unknown-haiku
+       exit ;;
+    SX-4:SUPER-UX:*:*)
+       echo sx4-nec-superux"$UNAME_RELEASE"
+       exit ;;
+    SX-5:SUPER-UX:*:*)
+       echo sx5-nec-superux"$UNAME_RELEASE"
+       exit ;;
+    SX-6:SUPER-UX:*:*)
+       echo sx6-nec-superux"$UNAME_RELEASE"
+       exit ;;
+    SX-7:SUPER-UX:*:*)
+       echo sx7-nec-superux"$UNAME_RELEASE"
+       exit ;;
+    SX-8:SUPER-UX:*:*)
+       echo sx8-nec-superux"$UNAME_RELEASE"
+       exit ;;
+    SX-8R:SUPER-UX:*:*)
+       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"
+       exit ;;
+    *:Rhapsody:*:*)
+       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
+       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
+               # 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
+           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
+       fi
+       echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
+       exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+       UNAME_PROCESSOR=`uname -p`
+       if test "$UNAME_PROCESSOR" = x86; then
+               UNAME_PROCESSOR=i386
+               UNAME_MACHINE=pc
+       fi
+       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"
+       exit ;;
+    NSE-*:NONSTOP_KERNEL:*:*)
+       echo nse-tandem-nsk"$UNAME_RELEASE"
+       exit ;;
+    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
+       exit ;;
+    BS2000:POSIX*:*:*)
+       echo bs2000-siemens-sysv
+       exit ;;
+    DS/*:UNIX_System_V:*:*)
+       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
+           UNAME_MACHINE=i386
+       else
+           UNAME_MACHINE="$cputype"
+       fi
+       echo "$UNAME_MACHINE"-unknown-plan9
+       exit ;;
+    *:TOPS-10:*:*)
+       echo pdp10-unknown-tops10
+       exit ;;
+    *:TENEX:*:*)
+       echo pdp10-unknown-tenex
+       exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+       echo pdp10-dec-tops20
+       exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+       echo pdp10-xkl-tops20
+       exit ;;
+    *:TOPS-20:*:*)
+       echo pdp10-unknown-tops20
+       exit ;;
+    *:ITS:*:*)
+       echo pdp10-unknown-its
+       exit ;;
+    SEI:*:*:SEIUX)
+       echo mips-sei-seiux"$UNAME_RELEASE"
+       exit ;;
+    *:DragonFly:*:*)
+       echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
+       exit ;;
+    *:*VMS:*:*)
+       UNAME_MACHINE=`(uname -p) 2>/dev/null`
+       case "$UNAME_MACHINE" in
+           A*) echo alpha-dec-vms ; exit ;;
+           I*) echo ia64-dec-vms ; exit ;;
+           V*) echo vax-dec-vms ; exit ;;
+       esac ;;
+    *:XENIX:*:SysV)
+       echo i386-pc-xenix
+       exit ;;
+    i*86:skyos:*:*)
+       echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
+       exit ;;
+    i*86:rdos:*:*)
+       echo "$UNAME_MACHINE"-pc-rdos
+       exit ;;
+    i*86:AROS:*:*)
+       echo "$UNAME_MACHINE"-pc-aros
+       exit ;;
+    x86_64:VMkernel:*:*)
+       echo "$UNAME_MACHINE"-unknown-esx
+       exit ;;
+    amd64:Isilon\ OneFS:*:*)
+       echo x86_64-unknown-onefs
+       exit ;;
+esac
+
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+    mips:Linux | mips64:Linux)
+       # If we got here on MIPS GNU/Linux, output extra information.
+       cat >&2 <<EOF
+
+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
+
+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:
+
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+and
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+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
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/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"
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-functions 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.rpath b/config.rpath
new file mode 100755 (executable)
index 0000000..98183ff
--- /dev/null
@@ -0,0 +1,684 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+#   Copyright 1996-2016 Free Software Foundation, Inc.
+#   Taken from GNU libtool, 2001
+#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+#   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
+# or
+#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# 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
+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
+    aix*)
+      wl='-Wl,'
+      ;;
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      ;;
+    hpux9* | hpux10* | hpux11*)
+      wl='-Wl,'
+      ;;
+    irix5* | irix6* | nonstopux*)
+      wl='-Wl,'
+      ;;
+    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*)
+      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*)
+      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* | 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++.
+    if test "$GCC" != yes; then
+      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
+    ;;
+esac
+
+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
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+        ld_shlibs=no
+      fi
+      ;;
+    amigaos*)
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
+      ;;
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    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'
+      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 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+  esac
+  if test "$ld_shlibs" = no; then
+    hardcode_libdir_flag_spec=
+  fi
+else
+  case "$host_os" in
+    aix3*)
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes; then
+        # Neither direct hardcoding nor static linking is supported with a
+        # broken collect2.
+        hardcode_direct=unsupported
+      fi
+      ;;
+    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.
+        aix_use_runtimelinking=no
+      else
+        aix_use_runtimelinking=no
+        # 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].*|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
+      hardcode_libdir_separator=':'
+      if test "$GCC" = yes; then
+        case $host_os in aix4.[012]|aix4.[012].*)
+          collect2name=`${CC} -print-prog-name=collect2`
+          if test -f "$collect2name" && \
+            strings "$collect2name" | grep resolve_lib_name >/dev/null
+          then
+            # We have reworked collect2
+            :
+          else
+            # We have old collect2
+            hardcode_direct=unsupported
+            hardcode_minus_L=yes
+            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:'"$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}-blibpath:$libdir:'"$aix_libpath"
+        fi
+      fi
+      ;;
+    amigaos*)
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
+      ;;
+    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
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      libext=lib
+      ;;
+    darwin* | rhapsody*)
+      hardcode_direct=no
+      if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    dgux*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    freebsd2.[01]*)
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    freebsd* | dragonfly*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    hpux9*)
+      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
+      ;;
+    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=:
+      ;;
+    netbsd*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    newsos6)
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    *nto* | *qnx*)
+      ;;
+    openbsd*)
+      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
+        ld_shlibs=no
+      fi
+      ;;
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      ;;
+    osf3*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    osf4* | osf5*)
+      if test "$GCC" = yes; then
+        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+        # Both cc and cxx compiler support -rpath directly
+        hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+    solaris*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      ;;
+    sunos4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    sysv4)
+      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*)
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+        ld_shlibs=yes
+      fi
+      ;;
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      ;;
+    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
+      ;;
+  esac
+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'
+case "$host_os" in
+  aix3*)
+    library_names_spec='$libname.a'
+    ;;
+  aix[4-9]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  amigaos*)
+    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*)
+    shrext=.dylib
+    library_names_spec='$libname$shrext'
+    ;;
+  dgux*)
+    library_names_spec='$libname$shrext'
+    ;;
+  freebsd[23].*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  freebsd* | dragonfly*)
+    library_names_spec='$libname$shrext'
+    ;;
+  gnu*)
+    library_names_spec='$libname$shrext'
+    ;;
+  haiku*)
+    library_names_spec='$libname$shrext'
+    ;;
+  hpux9* | hpux10* | hpux11*)
+    case $host_cpu in
+      ia64*)
+        shrext=.so
+        ;;
+      hppa*64*)
+        shrext=.sl
+        ;;
+      *)
+        shrext=.sl
+        ;;
+    esac
+    library_names_spec='$libname$shrext'
+    ;;
+  interix[3-9]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  irix5* | irix6* | nonstopux*)
+    library_names_spec='$libname$shrext'
+    case "$host_os" in
+      irix5* | nonstopux*)
+        libsuff= shlibsuff=
+        ;;
+      *)
+        case $LD in
+          *-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
+    ;;
+  linux*oldld* | linux*aout* | linux*coff*)
+    ;;
+  linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  knetbsd*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  netbsd*)
+    library_names_spec='$libname$shrext'
+    ;;
+  newsos6)
+    library_names_spec='$libname$shrext'
+    ;;
+  *nto* | *qnx*)
+    library_names_spec='$libname$shrext'
+    ;;
+  openbsd*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  os2*)
+    libname_spec='$name'
+    shrext=.dll
+    library_names_spec='$libname.a'
+    ;;
+  osf3* | osf4* | osf5*)
+    library_names_spec='$libname$shrext'
+    ;;
+  rdos*)
+    ;;
+  solaris*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sunos4*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  sysv4 | sysv4.3*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sysv4*MP*)
+    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"`
+
+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"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# 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"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/config.sub b/config.sub
new file mode 100755 (executable)
index 0000000..1d8e98b
--- /dev/null
@@ -0,0 +1,1801 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
+
+timestamp='2018-02-22'
+
+# 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
+# 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 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 Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# 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.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# 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
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
+
+Canonicalize a configuration name.
+
+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
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2018 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."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo "$1"
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    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* | netbsd*-eabi* | \
+  kopensolaris*-gnu* | cloudabi*-eabi* | \
+  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
+
+### 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.
+               ;;
+       -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
+               ;;
+       -bluegene*)
+               os=-cnk
+               ;;
+       -sim | -cisco | -oki | -wec | -winbond)
+               os=
+               basic_machine=$1
+               ;;
+       -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/'`
+               ;;
+       -psos*)
+               os=-psos
+               ;;
+       -mint | -mint[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+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 \
+       | ba \
+       | be32 | be64 \
+       | bfin \
+       | c4x | c8051 | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | e2k | epiphany \
+       | fido | fr30 | frv | ft32 \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | hexagon \
+       | i370 | i860 | i960 | ia16 | 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 \
+       | mipsisa32r6 | mipsisa32r6el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64r6 | mipsisa64r6el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipsr5900 | mipsr5900el \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nds32 | nds32le | nds32be \
+       | nios | nios2 | nios2eb | nios2el \
+       | ns16k | ns32k \
+       | open8 | or1k | or1knd | or32 \
+       | pdp10 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle \
+       | pru \
+       | pyramid \
+       | riscv32 | riscv64 \
+       | rl78 | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]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 \
+       | visium \
+       | wasm32 \
+       | x86 | xc16x | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       leon|leon[3-9])
+               basic_machine=sparc-$basic_machine
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
+               ;;
+       ms1)
+               basic_machine=mt-unknown
+               ;;
+
+       strongarm | thumb | xscale)
+               basic_machine=arm-unknown
+               ;;
+       xgate)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       xscaleeb)
+               basic_machine=armeb-unknown
+               ;;
+
+       xscaleel)
+               basic_machine=armel-unknown
+               ;;
+
+       # 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
+               ;;
+       # 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-* \
+       | ba-* \
+       | be32-* | be64-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
+       | c8051-* | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | e2k-* | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | hexagon-* \
+       | i*86-* | i860-* | i960-* | ia16-* | 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-* \
+       | mipsisa32r6-* | mipsisa32r6el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64r6-* | mipsisa64r6el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipsr5900-* | mipsr5900el-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nds32-* | nds32le-* | nds32be-* \
+       | nios-* | nios2-* | nios2eb-* | nios2el-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | open8-* \
+       | or1k*-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+       | pru-* \
+       | pyramid-* \
+       | riscv32-* | riscv64-* \
+       | 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-* \
+       | visium-* \
+       | wasm32-* \
+       | 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-pc
+               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
+               ;;
+       asmjs)
+               basic_machine=asmjs-unknown
+               ;;
+       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*)
+               basic_machine=m68k-bull
+               os=-sysv3
+               ;;
+       e500v[12])
+               basic_machine=powerpc-unknown
+               os=$os"spe"
+               ;;
+       e500v[12]-*)
+               basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+               os=$os"spe"
+               ;;
+       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
+               ;;
+       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
+               ;;
+       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
+               ;;
+       leon-*|leon[3-9]-*)
+               basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       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
+               ;;
+       moxiebox)
+               basic_machine=moxie-unknown
+               os=-moxiebox
+               ;;
+       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
+               ;;
+       nsv-tandem)
+               basic_machine=nsv-tandem
+               ;;
+       nsx-tandem)
+               basic_machine=nsx-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
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+               ;;
+       pentium | p5 | k5 | k6 | nexgen | viac3)
+               basic_machine=i586-pc
+               ;;
+       pentiumpro | p6 | 6x86 | athlon | athlon_*)
+               basic_machine=i686-pc
+               ;;
+       pentiumii | pentium2 | pentiumiii | pentium3)
+               basic_machine=i686-pc
+               ;;
+       pentium4)
+               basic_machine=i786-pc
+               ;;
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+               ;;
+       pentiumpro-* | p6-* | 6x86-* | athlon-*)
+               basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+               ;;
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+               ;;
+       pentium4-*)
+               basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+               ;;
+       pn)
+               basic_machine=pn-gould
+               ;;
+       power)  basic_machine=power-ibm
+               ;;
+       ppc | ppcbe)    basic_machine=powerpc-unknown
+               ;;
+       ppc-* | ppcbe-*)
+               basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+               ;;
+       ppcle | powerpclittle)
+               basic_machine=powerpcle-unknown
+               ;;
+       ppcle-* | powerpclittle-*)
+               basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+               ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+               ;;
+       ppc64le | powerpc64little)
+               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
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       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
+               ;;
+       x64)
+               basic_machine=x86_64-pc
+               ;;
+       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
+               ;;
+       none)
+               basic_machine=none-none
+               os=-none
+               ;;
+
+# 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
+               ;;
+       op50n)
+               basic_machine=hppa1.1-oki
+               ;;
+       op60c)
+               basic_machine=hppa1.1-oki
+               ;;
+       romp)
+               basic_machine=romp-ibm
+               ;;
+       mmix)
+               basic_machine=mmix-knuth
+               ;;
+       rs6000)
+               basic_machine=rs6000-ibm
+               ;;
+       vax)
+               basic_machine=vax-dec
+               ;;
+       pdp11)
+               basic_machine=pdp11-dec
+               ;;
+       we32k)
+               basic_machine=we32k-att
+               ;;
+       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       cydra)
+               basic_machine=cydra-cydrome
+               ;;
+       orion)
+               basic_machine=orion-highlevel
+               ;;
+       orion105)
+               basic_machine=clipper-highlevel
+               ;;
+       mac | mpw | mac-mpw)
+               basic_machine=m68k-apple
+               ;;
+       pmac | pmac-mpw)
+               basic_machine=powerpc-apple
+               ;;
+       *-unknown)
+               # Make sure to match an already-canonicalized machine name.
+               ;;
+       *)
+               echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+       *-digital*)
+               basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
+               ;;
+       *-commodore*)
+               basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
+               ;;
+       *)
+               ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+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
+               ;;
+       -solaris1 | -solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+               ;;
+       -solaris)
+               os=-solaris2
+               ;;
+       -unixware*)
+               os=-sysv4.2uw
+               ;;
+       -gnu/linux*)
+               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+               ;;
+       # es1800 is here to avoid being matched by es* (a different OS)
+       -es1800*)
+               os=-ose
+               ;;
+       # 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* | -cloudabi* | -sortix* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
+             | -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* | -glidix* \
+             | -cygwin* | -msys* | -pe* | -psos* | -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*)
+       # Remember, each alternative MUST END IN *, to match a version number.
+               ;;
+       -qnx*)
+               case $basic_machine in
+                   x86-* | i*86-*)
+                       ;;
+                   *)
+                       os=-nto$os
+                       ;;
+               esac
+               ;;
+       -nto-qnx*)
+               ;;
+       -nto*)
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+               ;;
+       -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*)
+               os=`echo $os | sed -e 's|linux|linux-gnu|'`
+               ;;
+       -sunos5*)
+               os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
+               ;;
+       -sunos6*)
+               os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
+               ;;
+       -opened*)
+               os=-openedition
+               ;;
+       -os400*)
+               os=-os400
+               ;;
+       -wince*)
+               os=-wince
+               ;;
+       -utek*)
+               os=-bsd
+               ;;
+       -dynix*)
+               os=-bsd
+               ;;
+       -acis*)
+               os=-aos
+               ;;
+       -atheos*)
+               os=-atheos
+               ;;
+       -syllable*)
+               os=-syllable
+               ;;
+       -386bsd)
+               os=-bsd
+               ;;
+       -ctix* | -uts*)
+               os=-sysv
+               ;;
+       -nova*)
+               os=-rtmk-nova
+               ;;
+       -ns2)
+               os=-nextstep2
+               ;;
+       -nsk*)
+               os=-nsk
+               ;;
+       # Preserve the version number of sinix5.
+       -sinix5.*)
+               os=`echo $os | sed -e 's|sinix|sysv|'`
+               ;;
+       -sinix*)
+               os=-sysv4
+               ;;
+       -tpf*)
+               os=-tpf
+               ;;
+       -triton*)
+               os=-sysv3
+               ;;
+       -oss*)
+               os=-sysv3
+               ;;
+       -svr4*)
+               os=-sysv4
+               ;;
+       -svr3)
+               os=-sysv3
+               ;;
+       -sysvr4)
+               os=-sysv4
+               ;;
+       # This must come after -sysvr4.
+       -sysv*)
+               ;;
+       -ose*)
+               os=-ose
+               ;;
+       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+               os=-mint
+               ;;
+       -zvmoe)
+               os=-zvmoe
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -pikeos*)
+               # Until real need of OS specific support for
+               # particular features comes up, bare metal
+               # configurations are quite functional.
+               case $basic_machine in
+                   arm*)
+                       os=-eabi
+                       ;;
+                   *)
+                       os=-elf
+                       ;;
+               esac
+               ;;
+       -nacl*)
+               ;;
+       -ios)
+               ;;
+       -none)
+               ;;
+       *)
+               # Get rid of the `-' at the beginning of $os.
+               os=`echo $os | sed 's/[^-]*-//'`
+               echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+       score-*)
+               os=-elf
+               ;;
+       spu-*)
+               os=-elf
+               ;;
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-rebel)
+               os=-linux
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+       c4x-* | tic4x-*)
+               os=-coff
+               ;;
+       c8051-*)
+               os=-elf
+               ;;
+       hexagon-*)
+               os=-elf
+               ;;
+       tic54x-*)
+               os=-coff
+               ;;
+       tic55x-*)
+               os=-coff
+               ;;
+       tic6x-*)
+               os=-coff
+               ;;
+       # This must come before the *-dec entry.
+       pdp10-*)
+               os=-tops20
+               ;;
+       pdp11-*)
+               os=-none
+               ;;
+       *-dec | vax-*)
+               os=-ultrix4.2
+               ;;
+       m68*-apollo)
+               os=-domain
+               ;;
+       i386-sun)
+               os=-sunos4.0.2
+               ;;
+       m68000-sun)
+               os=-sunos3
+               ;;
+       m68*-cisco)
+               os=-aout
+               ;;
+       mep-*)
+               os=-elf
+               ;;
+       mips*-cisco)
+               os=-elf
+               ;;
+       mips*-*)
+               os=-elf
+               ;;
+       or32-*)
+               os=-coff
+               ;;
+       *-tti)  # must be before sparc entry or we get the wrong os.
+               os=-sysv3
+               ;;
+       sparc-* | *-sun)
+               os=-sunos4.1.1
+               ;;
+       pru-*)
+               os=-elf
+               ;;
+       *-be)
+               os=-beos
+               ;;
+       *-ibm)
+               os=-aix
+               ;;
+       *-knuth)
+               os=-mmixware
+               ;;
+       *-wec)
+               os=-proelf
+               ;;
+       *-winbond)
+               os=-proelf
+               ;;
+       *-oki)
+               os=-proelf
+               ;;
+       *-hp)
+               os=-hpux
+               ;;
+       *-hitachi)
+               os=-hiux
+               ;;
+       i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+               os=-sysv
+               ;;
+       *-cbm)
+               os=-amigaos
+               ;;
+       *-dg)
+               os=-dgux
+               ;;
+       *-dolphin)
+               os=-sysv3
+               ;;
+       m68k-ccur)
+               os=-rtu
+               ;;
+       m88k-omron*)
+               os=-luna
+               ;;
+       *-next)
+               os=-nextstep
+               ;;
+       *-sequent)
+               os=-ptx
+               ;;
+       *-crds)
+               os=-unos
+               ;;
+       *-ns)
+               os=-genix
+               ;;
+       i370-*)
+               os=-mvs
+               ;;
+       *-gould)
+               os=-sysv
+               ;;
+       *-highlevel)
+               os=-bsd
+               ;;
+       *-encore)
+               os=-bsd
+               ;;
+       *-sgi)
+               os=-irix
+               ;;
+       *-siemens)
+               os=-sysv4
+               ;;
+       *-masscomp)
+               os=-rtu
+               ;;
+       f30[01]-fujitsu | f700-fujitsu)
+               os=-uxpv
+               ;;
+       *-rom68k)
+               os=-coff
+               ;;
+       *-*bug)
+               os=-coff
+               ;;
+       *-apple)
+               os=-macos
+               ;;
+       *-atari*)
+               os=-mint
+               ;;
+       *)
+               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 $os in
+                       -riscix*)
+                               vendor=acorn
+                               ;;
+                       -sunos*)
+                               vendor=sun
+                               ;;
+                       -cnk*|-aix*)
+                               vendor=ibm
+                               ;;
+                       -beos*)
+                               vendor=be
+                               ;;
+                       -hpux*)
+                               vendor=hp
+                               ;;
+                       -mpeix*)
+                               vendor=hp
+                               ;;
+                       -hiux*)
+                               vendor=hitachi
+                               ;;
+                       -unos*)
+                               vendor=crds
+                               ;;
+                       -dgux*)
+                               vendor=dg
+                               ;;
+                       -luna*)
+                               vendor=omron
+                               ;;
+                       -genix*)
+                               vendor=ns
+                               ;;
+                       -mvs* | -opened*)
+                               vendor=ibm
+                               ;;
+                       -os400*)
+                               vendor=ibm
+                               ;;
+                       -ptx*)
+                               vendor=sequent
+                               ;;
+                       -tpf*)
+                               vendor=ibm
+                               ;;
+                       -vxsim* | -vxworks* | -windiss*)
+                               vendor=wrs
+                               ;;
+                       -aux*)
+                               vendor=apple
+                               ;;
+                       -hms*)
+                               vendor=hitachi
+                               ;;
+                       -mpw* | -macos*)
+                               vendor=apple
+                               ;;
+                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                               vendor=atari
+                               ;;
+                       -vos*)
+                               vendor=stratus
+                               ;;
+               esac
+               basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
+               ;;
+esac
+
+echo "$basic_machine$os"
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-functions 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure b/configure
new file mode 100755 (executable)
index 0000000..884f5a9
--- /dev/null
+++ b/configure
@@ -0,0 +1,7863 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for dosfstools 4.2.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## 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
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="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_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# 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_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
+
+# 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_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
+
+
+# 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
+
+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
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+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
+
+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_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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='dosfstools'
+PACKAGE_TARNAME='dosfstools'
+PACKAGE_VERSION='4.2'
+PACKAGE_STRING='dosfstools 4.2'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+AUTOMAKE_TEST_COMPAT_FALSE
+AUTOMAKE_TEST_COMPAT_TRUE
+XXD_FOUND
+LTLIBICONV
+LIBICONV
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+LN_S
+EGREP
+GREP
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+CHECKATARI
+COMPAT_SYMLINKS_FALSE
+COMPAT_SYMLINKS_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+RELEASE_DATE
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+runstatedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL
+am__quote'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_compat_symlinks
+enable_atari_check
+enable_dependency_tracking
+enable_largefile
+with_iconv
+with_gnu_ld
+enable_rpath
+with_libiconv_prefix
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -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=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+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 runstatedir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures dosfstools 4.2 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/dosfstools]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of dosfstools 4.2:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --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-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-compat-symlinks
+                          install symlinks for legacy names of the tools
+  --enable-atari-check    enable legacy check to let tools switch to Atari
+                          mode when they detect they are running on 68k Atari
+                          hardware (Linux only)
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
+  --disable-largefile     omit support for large files
+  --disable-rpath         do not hardcode runtime library paths
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --without-iconv         build without iconv 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
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    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
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+dosfstools configure 4.2
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # 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
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_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_header_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  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
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* 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 $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext 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_func
+
+# 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.
+
+It was created by dosfstools $as_me 4.2, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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
+
+
+RELEASE_DATE=2021-01-31
+
+am__api_version='1.16'
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+       # -L didn't work.
+       set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+       && test "$*" != "X conftest.file $srcdir/configure"; then
+
+       # If neither matched, then we have a broken ls.  This can happen
+       # if, for instance, CONFIG_SHELL is bash and it inherits a
+       # broken ls alias from the environment.  This has actually
+       # happened.  Such a system could not be considered "sane".
+       as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; 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_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip"
+    $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
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; 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_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip"
+    $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_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  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
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $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
+  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; }
+
+for ac_prog in gawk mawk nawk awk
+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_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # 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_AWK="$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
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $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
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+       @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='dosfstools'
+ VERSION='4.2'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+
+
+# Check whether --enable-compat-symlinks was given.
+if test "${enable_compat_symlinks+set}" = set; then :
+  enableval=$enable_compat_symlinks; case "${enableval}" in
+       yes) symlinks=true ;;
+       no)  symlinks=false ;;
+       *)   as_fn_error $? "bad value ${enableval} for --enable-compat-symlinks" "$LINENO" 5 ;;
+       esac
+else
+  symlinks=false
+fi
+
+ if test x$symlinks = xtrue; then
+  COMPAT_SYMLINKS_TRUE=
+  COMPAT_SYMLINKS_FALSE='#'
+else
+  COMPAT_SYMLINKS_TRUE='#'
+  COMPAT_SYMLINKS_FALSE=
+fi
+
+
+# Check whether --enable-atari-check was given.
+if test "${enable_atari_check+set}" = set; then :
+  enableval=$enable_atari_check; case "${enableval}" in
+       yes) CHECKATARI=1
+
+            $as_echo "#define CONF_CHECK_ATARI 1" >>confdefs.h
+ ;;
+       no)  CHECKATARI=0
+ ;;
+       *)   as_fn_error $? "bad value ${enableval} for --enable-atari-check" "$LINENO" 5 ;;
+       esac
+else
+  CHECKATARI=0
+
+fi
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
+am__doit:
+       @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+  case $?:`cat confinc.out 2>/dev/null` in #(
+  '0:this is the am__doit target') :
+    case $s in #(
+  BSD) :
+    am__include='.include' am__quote='"' ;; #(
+  *) :
+    am__include='include' am__quote='' ;;
+esac ;; #(
+  *) :
+     ;;
+esac
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+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
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; 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_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$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_CC="${ac_tool_prefix}gcc"
+    $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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; 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_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_CC="gcc"
+    $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_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  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
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; 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_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$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_CC="${ac_tool_prefix}cc"
+    $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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; 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_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+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
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $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
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$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_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$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_CC="$ac_tool_prefix$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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+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_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_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
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  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
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $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 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+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 compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    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 run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $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 compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=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
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+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
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; 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 $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+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
+
+
+{ $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; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_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$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_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 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "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_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_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
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_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$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_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 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "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_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_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
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=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
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# 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
+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
+
+done
+
+
+
+  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
+  MINIX=
+fi
+
+
+  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.  */
+
+#         define __EXTENSIONS__ 1
+          $ac_includes_default
+int
+main ()
+{
+
+  ;
+  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
+
+
+
+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
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; 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_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$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_CC="${ac_tool_prefix}gcc"
+    $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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; 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_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_CC="gcc"
+    $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_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  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
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; 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_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$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_CC="${ac_tool_prefix}cc"
+    $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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; 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_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+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
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $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
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$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_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$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_CC="$ac_tool_prefix$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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+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_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_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_ac_ct_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
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  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
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=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
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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
+
+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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+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
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+{ $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
+if test "$LN_S" = "ln -s"; 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, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+  enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+        # IRIX 6.2 and later do not support large files by default,
+        # so use the C compiler's -n32 option if that helps.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+        if ac_fn_c_try_compile "$LINENO"; then :
+  break
+fi
+rm -f core conftest.err conftest.$ac_objext
+        CC="$CC -n32"
+        if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+        break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  fi
+
+
+fi
+
+
+for ac_header in \
+                 err.h \
+                 linux/fd.h \
+                 linux/hdreg.h \
+                 linux/version.h \
+                 linux/loop.h \
+                 sys/disk.h \
+                 sys/disklabel.h \
+                 sys/ioccom.h \
+                 sys/mkdev.h \
+                 sys/queue.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_header in endian.h sys/endian.h libkern/OSByteOrder.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 vasprintf
+do :
+  ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
+if test "x$ac_cv_func_vasprintf" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_VASPRINTF 1
+_ACEOF
+
+fi
+done
+
+
+ac_fn_c_check_decl "$LINENO" "getmntent" "ac_cv_have_decl_getmntent" "#include <mntent.h>
+"
+if test "x$ac_cv_have_decl_getmntent" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETMNTENT $ac_have_decl
+_ACEOF
+
+ac_fn_c_check_decl "$LINENO" "getmntinfo" "ac_cv_have_decl_getmntinfo" "#include <sys/mount.h>
+"
+if test "x$ac_cv_have_decl_getmntinfo" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETMNTINFO $ac_have_decl
+_ACEOF
+
+
+# optional iconv support
+
+# Check whether --with-iconv was given.
+if test "${with_iconv+set}" = set; then :
+  withval=$with_iconv;
+fi
+
+if test "x$with_iconv" != "xno"; then
+       # 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
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+      if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  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
+else
+  with_gnu_ld=no
+fi
+
+# 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
+
+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 $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&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.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname 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
+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; }
+else
+  { $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 :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  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"
+else
+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$acl_cv_path_LD"
+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; }
+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 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=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
+$as_echo "$acl_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$acl_cv_prog_gnu_ld
+
+
+
+
+                                                { $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 :
+  $as_echo_n "(cached) " >&6
+else
+
+    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
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
+$as_echo "$acl_cv_rpath" >&6; }
+  wl="$acl_cv_wl"
+  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; :
+else
+  enable_rpath=yes
+fi
+
+
+
+
+  acl_libdirstem=lib
+  acl_libdirstem2=
+  case "$host_os" in
+    solaris*)
+                                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
+$as_echo_n "checking for 64-bit host... " >&6; }
+if ${gl_cv_solaris_64bit+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef _LP64
+sixtyfour bits
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "sixtyfour bits" >/dev/null 2>&1; then :
+  gl_cv_solaris_64bit=yes
+else
+  gl_cv_solaris_64bit=no
+fi
+rm -f conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
+$as_echo "$gl_cv_solaris_64bit" >&6; }
+      if test $gl_cv_solaris_64bit = yes; then
+        acl_libdirstem=lib/64
+        case "$host_cpu" in
+          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
+          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+        esac
+      fi
+      ;;
+    *)
+      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+      if test -n "$searchpath"; then
+        acl_save_IFS="${IFS=   }"; IFS=":"
+        for searchdir in $searchpath; do
+          if test -d "$searchdir"; then
+            case "$searchdir" in
+              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+              */../ | */.. )
+                # Better ignore directories of this form. They are misleading.
+                ;;
+              *) searchdir=`cd "$searchdir" && pwd`
+                 case "$searchdir" in
+                   */lib64 ) acl_libdirstem=lib64 ;;
+                 esac ;;
+            esac
+          fi
+        done
+        IFS="$acl_save_IFS"
+      fi
+      ;;
+  esac
+  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+
+
+
+
+
+
+
+
+
+
+
+
+    use_additional=yes
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+
+# Check whether --with-libiconv-prefix was given.
+if test "${with_libiconv_prefix+set}" = set; then :
+  withval=$with_libiconv_prefix;
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+        if test "$acl_libdirstem2" != "$acl_libdirstem" \
+           && ! test -d "$withval/$acl_libdirstem"; then
+          additional_libdir="$withval/$acl_libdirstem2"
+        fi
+      fi
+    fi
+
+fi
+
+      LIBICONV=
+  LTLIBICONV=
+  INCICONV=
+  LIBICONV_PREFIX=
+      HAVE_LIBICONV=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='iconv '
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
+          else
+                                    :
+          fi
+        else
+                              found_dir=
+          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
+            dir="$additional_libdir"
+                                    if test -n "$acl_shlibext"; then
+              if test -f "$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"; 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"; 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"; 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
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIBICONV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                                    if test -n "$acl_shlibext"; then
+                    if test -f "$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"; 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"; 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"; 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
+                break
+              fi
+            done
+          fi
+          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/$acl_libdirstem" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+                                LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+              else
+                                                                                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                                if test "$acl_hardcode_direct" = yes; then
+                                                      LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+                else
+                  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
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                                                                                haveit=
+                    for x in $LDFLAGS $LIBICONV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
+                    fi
+                    if test "$acl_hardcode_minus_L" != no; then
+                                                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
+                    else
+                                                                                                                                                                                LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                                LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a"
+              else
+                                                LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name"
+              fi
+            fi
+                        additional_includedir=
+            case "$found_dir" in
+              */$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"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INCICONV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                                            INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+                        if test -n "$found_la"; then
+                                                        save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+                            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/$acl_libdirstem" \
+                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIBICONV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIBICONV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                                                                  haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                                                                  haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                                        LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
+                    LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+                                                            LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+            LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
+                        alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+      done
+            acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      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=\"$acl_hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+            for found_dir in $ltrpathdirs; do
+      LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
+    done
+  fi
+
+
+
+
+
+
+
+
+
+
+
+
+          am_save_CPPFLAGS="$CPPFLAGS"
+
+  for element in $INCICONV; do
+    haveit=
+    for x in $CPPFLAGS; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+    fi
+  done
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
+$as_echo_n "checking for iconv... " >&6; }
+if ${am_cv_func_iconv+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    am_cv_func_iconv="no, consider installing GNU libiconv"
+    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);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    if test "$am_cv_func_iconv" != yes; then
+      am_save_LIBS="$LIBS"
+      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);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  am_cv_lib_iconv=yes
+        am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+      LIBS="$am_save_LIBS"
+    fi
+
+fi
+{ $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.  */
+  if (/* Try standardized names.  */
+      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
+      /* Try IRIX, OSF/1 names.  */
+      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
+      /* Try AIX names.  */
+      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
+      /* Try HP-UX names.  */
+      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+    result |= 16;
+  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
+
+  fi
+  if test "$am_cv_lib_iconv" = yes; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
+$as_echo_n "checking how to link with libiconv... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
+$as_echo "$LIBICONV" >&6; }
+  else
+            CPPFLAGS="$am_save_CPPFLAGS"
+    LIBICONV=
+    LTLIBICONV=
+  fi
+
+
+
+  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(_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
+
+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:
+         $am_cv_proto_iconv" >&5
+$as_echo "
+         $am_cv_proto_iconv" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define ICONV_CONST $am_cv_proto_iconv_arg1
+_ACEOF
+
+
+  fi
+
+fi
+
+# xxd (distributed with vim) is used in the testsuite
+# Extract the first word of "xxd", so it can be a program name with args.
+set dummy xxd; 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_XXD_FOUND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$XXD_FOUND"; then
+  ac_cv_prog_XXD_FOUND="$XXD_FOUND" # 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_XXD_FOUND="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
+
+fi
+fi
+XXD_FOUND=$ac_cv_prog_XXD_FOUND
+if test -n "$XXD_FOUND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XXD_FOUND" >&5
+$as_echo "$XXD_FOUND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# check if automake is 1.11 or 1.12 for using a workaround for the parallel test harness
+# (we check for a minimum version of 1.11 above, so these are the only two values to check)
+ if test $am__api_version = 1.11 -o $am__api_version = 1.12; then
+  AUTOMAKE_TEST_COMPAT_TRUE=
+  AUTOMAKE_TEST_COMPAT_FALSE='#'
+else
+  AUTOMAKE_TEST_COMPAT_TRUE='#'
+  AUTOMAKE_TEST_COMPAT_FALSE=
+fi
+
+
+ac_config_files="$ac_config_files Makefile src/Makefile src/version.h manpages/Makefile manpages/mkfs.fat.8 manpages/fsck.fat.8 manpages/fatlabel.8 tests/Makefile"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
+t clear
+:clear
+s/^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\)/-D\1=\2/g
+t quote
+s/^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)/-D\1=\2/g
+t quote
+b any
+:quote
+s/[     `~#$^&*(){}\\|;'\''"<>?]/\\&/g
+s/\[/\\&/g
+s/\]/\\&/g
+s/\$/$$/g
+H
+:any
+${
+       g
+       s/^\n//
+       s/\n/ /g
+       p
+}
+'
+DEFS=`sed -n "$ac_script" confdefs.h`
+
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${COMPAT_SYMLINKS_TRUE}" && test -z "${COMPAT_SYMLINKS_FALSE}"; then
+  as_fn_error $? "conditional \"COMPAT_SYMLINKS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AUTOMAKE_TEST_COMPAT_TRUE}" && test -z "${AUTOMAKE_TEST_COMPAT_FALSE}"; then
+  as_fn_error $? "conditional \"AUTOMAKE_TEST_COMPAT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# 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-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## 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. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# 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 dosfstools $as_me 4.2, 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`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+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
+
+Configuration files:
+$config_files
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+dosfstools config.status 4.2
+configured by $0, 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='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# 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;;
+  --he | --h |  --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
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+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
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "src/version.h") CONFIG_FILES="$CONFIG_FILES src/version.h" ;;
+    "manpages/Makefile") CONFIG_FILES="$CONFIG_FILES manpages/Makefile" ;;
+    "manpages/mkfs.fat.8") CONFIG_FILES="$CONFIG_FILES manpages/mkfs.fat.8" ;;
+    "manpages/fsck.fat.8") CONFIG_FILES="$CONFIG_FILES manpages/fsck.fat.8" ;;
+    "manpages/fatlabel.8") CONFIG_FILES="$CONFIG_FILES manpages/fatlabel.8" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+
+  *) 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_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
+
+
+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" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  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
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+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
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+
+eval set X "  :F $CONFIG_FILES      :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
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# 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;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+: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" | $AWK -f "$ac_tmp/subs.awk" \
+  >$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
+ ;;
+
+
+  :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
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  case $CONFIG_FILES in #(
+  *\'*) :
+    eval set x "$CONFIG_FILES" ;; #(
+  *) :
+    set x $CONFIG_FILES ;; #(
+  *) :
+     ;;
+esac
+  shift
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
+  do
+    # Strip MF so we end up with the name of the file.
+    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$am_mf" : 'X\(//\)[^/]' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+    am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+    { echo "$as_me:$LINENO: cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles" >&5
+   (cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } || am_rc=$?
+  done
+  if test $am_rc -ne 0; 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 $? "Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  Try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+  { am_dirpart=; unset am_dirpart;}
+  { am_filepart=; unset am_filepart;}
+  { am_mf=; unset am_mf;}
+  { am_rc=; unset am_rc;}
+  rm -f conftest-deps.mk
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
index 8cd9ada..efb8fb5 100644 (file)
@@ -14,8 +14,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([dosfstools], [4.1])
-AC_SUBST([RELEASE_DATE], [2017-01-24])
+AC_INIT([dosfstools], [4.2])
+AC_SUBST([RELEASE_DATE], [2021-01-31])
 AM_INIT_AUTOMAKE([1.11 foreign subdir-objects parallel-tests])
 
 AC_ARG_ENABLE([compat-symlinks],
@@ -29,6 +29,20 @@ AC_ARG_ENABLE([compat-symlinks],
        [symlinks=false])
 AM_CONDITIONAL([COMPAT_SYMLINKS], [test x$symlinks = xtrue])
 
+AC_ARG_ENABLE([atari-check],
+       [AS_HELP_STRING([--enable-atari-check],
+                     [enable legacy check to let tools switch to Atari mode
+                      when they detect they are running on 68k Atari
+                      hardware (Linux only)])],
+       [case "${enableval}" in
+       yes) AC_SUBST(CHECKATARI, [1])
+            AC_DEFINE(CONF_CHECK_ATARI) ;;
+       no)  AC_SUBST(CHECKATARI, [0]) ;;
+       *)   AC_MSG_ERROR([bad value ${enableval} for --enable-atari-check]) ;;
+       esac],
+       [AC_SUBST(CHECKATARI, [0])])
+
+AC_USE_SYSTEM_EXTENSIONS
 
 AC_PROG_CC
 AC_PROG_LN_S
@@ -40,6 +54,7 @@ AC_CHECK_HEADERS([\
                  linux/fd.h \
                  linux/hdreg.h \
                  linux/version.h \
+                 linux/loop.h \
                  sys/disk.h \
                  sys/disklabel.h \
                  sys/ioccom.h \
@@ -49,18 +64,17 @@ AC_CHECK_HEADERS([\
 
 AC_CHECK_HEADERS([endian.h sys/endian.h libkern/OSByteOrder.h])
 
+AC_CHECK_FUNCS([vasprintf])
+
 AC_CHECK_DECLS([getmntent], [], [], [[#include <mntent.h>]])
 AC_CHECK_DECLS([getmntinfo], [], [], [[#include <sys/mount.h>]])
 
-AC_ARG_WITH([udev], AS_HELP_STRING([--without-udev], [build without libudev support]))
-if test "x$with_udev" != "xno"; then
-  PKG_CHECK_MODULES([UDEV], [libudev],
-                 [AC_DEFINE([HAVE_UDEV], [1])],
-                 [true])
+# optional iconv support
+AC_ARG_WITH([iconv], AS_HELP_STRING([--without-iconv], [build without iconv support]))
+if test "x$with_iconv" != "xno"; then
+       AM_ICONV
 fi
 
-AC_SEARCH_LIBS(iconv_open, iconv)
-
 # xxd (distributed with vim) is used in the testsuite
 AC_CHECK_PROG([XXD_FOUND], [xxd], [yes])
 
diff --git a/depcomp b/depcomp
new file mode 100755 (executable)
index 0000000..65cbf70
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+
+# 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, 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 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.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by 'PROGRAMS ARGS'.
+  object      Object file output by 'PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputting dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
+# A tabulation character.
+tab='  '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+  # This is just like dashmstdout with a different argument.
+  dashmflag=-xM
+  depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The second -e expression handles DOS-style file names with drive
+  # letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'.  On the theory
+## that the space means something, we add a space to the output as
+## well.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like '#:fec' to the end of the
+    # dependency line.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts '$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  set_dir_from "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using '\' :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
+
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
+
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  set_dir_from  "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
+    sed -ne '2,${
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+  # The Tru64 compiler uses -MD to generate dependencies as a side
+  # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+  # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+  # dependencies in 'foo.d' instead, so we check for that too.
+  # Subdirectories are respected.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool generates 2 separate objects for the 2 libraries.  These
+    # two compilations output dependencies in $dir.libs/$base.o.d and
+    # in $dir$base.o.d.  We have to check for both files, because
+    # one of the two compilations can be disabled.  We should prefer
+    # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+    # automatically cleaned when .libs/ is deleted, while ignoring
+    # the former would cause a distcleancheck panic.
+    tmpdepfile1=$dir$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
+
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for ':'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+  "$@" $dashmflag |
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E \
+    | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+             -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+    | sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+        set fnord "$@"
+        shift
+        shift
+        ;;
+    *)
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/install-sh b/install-sh
new file mode 100755 (executable)
index 0000000..8175c64
--- /dev/null
@@ -0,0 +1,518 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2018-03-11.20; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab='  '
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
+
+    -o) chowncmd="$chownprog $2"
+        shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t)
+        is_target_a_directory=always
+        dst_arg=$2
+        # Protect names problematic for 'test' and other utilities.
+        case $dst_arg in
+          -* | [=\(\)!]) dst_arg=./$dst_arg;;
+        esac
+        shift;;
+
+    -T) is_target_a_directory=never;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --) shift
+        break;;
+
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call 'install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names problematic for 'test' and other utilities.
+  case $src in
+    -* | [=\(\)!]) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+    dst=$dst_arg
+
+    # If destination is a directory, append the input filename.
+    if test -d "$dst"; then
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
+      fi
+      dstdir=$dst
+      dstbase=`basename "$src"`
+      case $dst in
+       */) dst=$dst$dstbase;;
+       *)  dst=$dst/$dstbase;;
+      esac
+      dstdir_status=0
+    else
+      dstdir=`dirname "$dst"`
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  case $dstdir in
+    */) dstdirslash=$dstdir;;
+    *)  dstdirslash=$dstdir/;;
+  esac
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+            ;;
+          *)
+            # Note that $RANDOM variable is not portable (e.g. dash);  Use it
+            # here however when possible just to lower collision chance.
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            # Because "mkdir -p" follows existing symlinks and we likely work
+            # directly in world-writeable /tmp, make sure that the '$tmpdir'
+            # directory is successfully created first before we actually test
+            # 'mkdir -p' feature.
+            if (umask $mkdir_umask &&
+                $mkdirprog $mkdir_mode "$tmpdir" &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+            then
+              if test -z "$dir_arg" || {
+                   # Check for POSIX incompatibilities with -m.
+                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                   # other-writable bit of parent directory when it shouldn't.
+                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                   test_tmpdir="$tmpdir/a"
+                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      set -f
+      set fnord $dstdir
+      shift
+      set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=${dstdirslash}_inst.$$_
+    rmtmp=${dstdirslash}_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       set +f &&
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/manpages/Makefile.in b/manpages/Makefile.in
new file mode 100644 (file)
index 0000000..306cd06
--- /dev/null
@@ -0,0 +1,539 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in 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.
+
+@SET_MAKE@
+
+# dosfstools manpages/Makefile.am
+# Copyright (C) 2015  Andreas Bombe <aeb@debian.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 <http://www.gnu.org/licenses/>.
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = manpages
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES = mkfs.fat.8 fsck.fat.8 fatlabel.8
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+man8dir = $(mandir)/man8
+am__installdirs = "$(DESTDIR)$(man8dir)"
+NROFF = nroff
+MANS = $(man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/fatlabel.8.in \
+       $(srcdir)/fsck.fat.8.in $(srcdir)/mkfs.fat.8.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECKATARI = @CHECKATARI@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RELEASE_DATE = @RELEASE_DATE@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XXD_FOUND = @XXD_FOUND@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+man_MANS = fsck.fat.8 mkfs.fat.8 fatlabel.8
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign manpages/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign manpages/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+mkfs.fat.8: $(top_builddir)/config.status $(srcdir)/mkfs.fat.8.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+fsck.fat.8: $(top_builddir)/config.status $(srcdir)/fsck.fat.8.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+fatlabel.8: $(top_builddir)/config.status $(srcdir)/fatlabel.8.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-man8: $(man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(man_MANS)'; \
+       test -n "$(man8dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
+       { for i in $$list1; do echo "$$i"; done;  \
+       if test -n "$$list2"; then \
+         for i in $$list2; do echo "$$i"; done \
+           | sed -n '/\.8[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man8:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man8dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.8[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(MANS)
+installdirs:
+       for dir in "$(DESTDIR)$(man8dir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+@COMPAT_SYMLINKS_FALSE@install-data-hook:
+@COMPAT_SYMLINKS_FALSE@uninstall-hook:
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-data-hook
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man8
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
+uninstall-man: uninstall-man8
+
+.MAKE: install-am install-data-am install-strip uninstall-am
+
+.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
+       ctags-am distclean distclean-generic distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-data-hook install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-man8 \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
+       uninstall-am uninstall-hook uninstall-man uninstall-man8
+
+.PRECIOUS: Makefile
+
+
+@COMPAT_SYMLINKS_TRUE@install-data-hook:
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fatlabel.8 dosfslabel.8
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fsck.fat.8 dosfsck.8
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fsck.fat.8 fsck.msdos.8
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f fsck.fat.8 fsck.vfat.8
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f mkfs.fat.8 mkdosfs.8
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f mkfs.fat.8 mkfs.msdos.8
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(mandir)/man8 && $(LN_S) -f mkfs.fat.8 mkfs.vfat.8
+
+@COMPAT_SYMLINKS_TRUE@uninstall-hook:
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/dosfslabel.8
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/dosfsck.8
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/fsck.msdos.8
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/fsck.vfat.8
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/mkdosfs.8
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/mkfs.msdos.8
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(mandir)/man8/mkfs.vfat.8
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/manpages/de/fatlabel.de.8 b/manpages/de/fatlabel.de.8
deleted file mode 100644 (file)
index 53f5515..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-.\" fatlabel.8 - manpage for fatlabel
-.\"
-.\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.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 <http://www.gnu.org/licenses/>.
-.\"
-.\" The complete text of the GNU General Public License
-.\" can be found in /usr/share/common-licenses/GPL-3 file.
-.\"
-.\"
-.\"*******************************************************************
-.\"
-.\" This file was generated with po4a. Translate the source file.
-.\"
-.\"*******************************************************************
-.TH FATLABEL 8 2015\-05\-16 3.0.28 dosfstools
-.SH NAME
-.\" ----------------------------------------------------------------------------
-\fBfatlabel\fP \- set or get MS\-DOS filesystem label
-.SH SYNOPSIS
-.\" ----------------------------------------------------------------------------
-\fBfatlabel\fP \fIDEVICE\fP [\fILABEL\fP]
-.SH DESCRIPTION
-\fBfatlabel\fP set or gets a MS\-DOS filesystem label from a given device.
-.PP
-.\" ----------------------------------------------------------------------------
-If \fILABEL\fP is omitted, then the label name of the specified device is
-written on the standard output.  A label can't be longer than 11 bytes.
-.SH OPTIONS
-.IP "\fB\-h\fP, \fB\-\-help\fP" 4
-Displays a help message.
-.IP "\fB\-V\fP, \fB\-\-version\fP" 4
-.\" ----------------------------------------------------------------------------
-Shows version.
-.SH "SEE ALSO"
-\fBfsck.fat\fP(8)
-.br
-.\" ----------------------------------------------------------------------------
-\fBmkfs.fat\fP(8)
-.SH HOMEPAGE
-.\" ----------------------------------------------------------------------------
-The home for the \fBdosfstools\fP project is its
-.UR https://github.com/dosfstools/dosfstools
-GitHub project page
-.UE .
-.SH AUTHORS
-\fBdosfstools\fP were written by
-.MT werner.almesberger@\:lrc.di.epfl.ch
-Werner Almesberger
-.ME ,
-.MT Roman.Hodek@\:informatik.\:uni-erlangen.de
-Roman Hodek
-.ME ,
-and others.  The current maintainer is
-.MT aeb@\:debian.org
-Andreas Bombe
-.ME .
diff --git a/manpages/de/fsck.fat.de.8 b/manpages/de/fsck.fat.de.8
deleted file mode 100644 (file)
index 869b806..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-.\" fsck.fat.8 - manpage for fsck.fat
-.\"
-.\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.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 <http://www.gnu.org/licenses/>.
-.\"
-.\" The complete text of the GNU General Public License
-.\" can be found in /usr/share/common-licenses/GPL-3 file.
-.\"
-.\"
-.\"*******************************************************************
-.\"
-.\" This file was generated with po4a. Translate the source file.
-.\"
-.\"*******************************************************************
-.TH FSCK.FAT 8 2015\-05\-16 3.0.28 dosfstools
-.SH NAME
-.\" ----------------------------------------------------------------------------
-\fBfsck.fat\fP \- check and repair MS\-DOS filesystems
-.SH SYNOPSIS
-.\" ----------------------------------------------------------------------------
-\fBfsck.fat\fP [\fIOPTIONS\fP] \fIDEVICE\fP
-.SH DESCRIPTION
-\fBfsck.fat\fP verifies the consistency of MS\-DOS filesystems and optionally
-tries to repair them.
-.PP
-The following filesystem problems can be corrected (in this order):
-.IP * 4
-FAT contains invalid cluster numbers.  Cluster is changed to EOF.
-.IP * 4
-File's cluster chain contains a loop.  The loop is broken.
-.IP * 4
-Bad clusters (read errors).  The clusters are marked bad and they are
-removed from files owning them.  This check is optional.
-.IP * 4
-Directories with a large number of bad entries (probably corrupt).  The
-directory can be deleted.
-.IP * 4
-Files . and .. are non\-directories.  They can be deleted or renamed.
-.IP * 4
-Directories . and .. in root directory.  They are deleted.
-.IP * 4
-Bad filenames.  They can be renamed.
-.IP * 4
-Duplicate directory entries.  They can be deleted or renamed.
-.IP * 4
-Directories with non\-zero size field.  Size is set to zero.
-.IP * 4
-Directory . does not point to parent directory.  The start pointer is
-adjusted.
-.IP * 4
-Directory .. does not point to parent of parent directory.  The start
-pointer is adjusted.
-.IP * 4
-Start cluster number of a file is invalid.  The file is truncated.
-.IP * 4
-File contains bad or free clusters.  The file is truncated.
-.IP * 4
-File's cluster chain is longer than indicated by the size fields.  The file
-is truncated.
-.IP * 4
-Two or more files share the same cluster(s).  All but one of the files are
-truncated.  If the file being truncated is a directory file that has already
-been read, the filesystem check is restarted after truncation.
-.IP * 4
-File's cluster chain is shorter than indicated by the size fields.  The file
-is truncated.
-.IP * 4
-Clusters are marked as used but are not owned by a file.  They are marked as
-free.
-.PP
-Additionally, the following problems are detected, but not repaired:
-.IP * 4
-Invalid parameters in boot sector
-.IP * 4
-Absence of . and .. entries in non\-root directories
-.PP
-.\" ----------------------------------------------------------------------------
-When \fBfsck.fat\fP checks a filesystem, it accumulates all changes in memory
-and performs them only after all checks are complete.  This can be disabled
-with the \fB\-w\fP option.
-.SH OPTIONS
-.IP \fB\-a\fP 4
-Automatically repair the filesystem.  No user intervention is necessary.
-Whenever there is more than one method to solve a problem, the least
-destructive approach is used.
-.IP \fB\-A\fP 4
-Use Atari variation of the MS\-DOS filesystem.  This is default if
-\fBfsck.fat\fP is run on an Atari, then this option turns off Atari format.
-There are some minor differences in Atari format: Some boot sector fields
-are interpreted slightly different, and the special FAT entries for
-end\-of\-file and bad cluster can be different.  Under MS\-DOS 0xfff8 is used
-for EOF and Atari employs 0xffff by default, but both systems recognize all
-values from 0xfff8...0xffff as end\-of\-file.  MS\-DOS uses only 0xfff7 for bad
-clusters, where on Atari values 0xfff0...0xfff7 are for this purpose (but
-the standard value is still 0xfff7).
-.IP \fB\-b\fP 4
-Make read\-only boot sector check.
-.IP "\fB\-d\fP \fIPATH\fP" 4
-Delete the specified file.  If more than one file with that name exist, the
-first one is deleted.  This option can be given more than once.
-.IP \fB\-f\fP 4
-Salvage unused cluster chains to files.  By default, unused clusters are
-added to the free disk space except in auto mode (\fB\-a\fP).
-.IP \fB\-l\fP 4
-List path names of files being processed.
-.IP \fB\-n\fP 4
-No\-operation mode: non\-interactively check for errors, but don't write
-anything to the filesystem.
-.IP \fB\-p\fP 4
-Same as \fB\-a\fP, for compatibility with other *fsck.
-.IP \fB\-r\fP 4
-Interactively repair the filesystem.  The user is asked for advice whenever
-there is more than one approach to fix an inconsistency.  This is the
-default mode and the option is only retained for backwards compatibility.
-.IP \fB\-t\fP 4
-Mark unreadable clusters as bad.
-.IP "\fB\-u\fP \fIPATH\fP" 4
-Try to undelete the specified file.  \fBfsck.fat\fP tries to allocate a chain
-of contiguous unallocated clusters beginning with the start cluster of the
-undeleted file.  This option can be given more than once.
-.IP \fB\-v\fP 4
-Verbose mode.  Generates slightly more output.
-.IP \fB\-V\fP 4
-Perform a verification pass.  The filesystem check is repeated after the
-first run.  The second pass should never report any fixable errors.  It may
-take considerably longer than the first pass, because the first pass may
-have generated long list of modifications that have to be scanned for each
-disk read.
-.IP \fB\-w\fP 4
-Write changes to disk immediately.
-.IP \fB\-y\fP 4
-.\" ----------------------------------------------------------------------------
-Same as \fB\-a\fP (automatically repair filesystem) for compatibility with other
-fsck tools.
-.SH "EXIT STATUS"
-.IP 0 4
-No recoverable errors have been detected.
-.IP 1 4
-Recoverable errors have been detected or \fBfsck.fat\fP has discovered an
-internal inconsistency.
-.IP 2 4
-.\" ----------------------------------------------------------------------------
-Usage error.  \fBfsck.fat\fP did not access the filesystem.
-.SH FILES
-.IP "fsck0000.rec, fsck0001.rec, ..." 4
-.\" ----------------------------------------------------------------------------
-When recovering from a corrupted filesystem, \fBfsck.fat\fP dumps recovered
-data into files named 'fsckNNNN.rec' in the top level directory of the
-filesystem.
-.SH BUGS
-.\" ----------------------------------------------------------------------------
-Does not create . and .. files where necessary.  Does not remove entirely
-empty directories.  Should give more diagnostic messages.  Undeleting files
-should use a more sophisticated algorithm.
-.SH "SEE ALSO"
-\fBfatlabel\fP(8)
-.br
-.\" ----------------------------------------------------------------------------
-\fBmkfs.fat\fP(8)
-.SH HOMEPAGE
-.\" ----------------------------------------------------------------------------
-The home for the \fBdosfstools\fP project is its
-.UR https://github.com/dosfstools/dosfstools
-GitHub project page
-.UE .
-.SH AUTHORS
-\fBdosfstools\fP were written by
-.MT werner.almesberger@\:lrc.di.epfl.ch
-Werner Almesberger
-.ME ,
-.MT Roman.Hodek@\:informatik.\:uni-erlangen.de
-Roman Hodek
-.ME ,
-and others.  The current maintainer is
-.MT aeb@\:debian.org
-Andreas Bombe
-.ME .
diff --git a/manpages/de/mkfs.fat.de.8 b/manpages/de/mkfs.fat.de.8
deleted file mode 100644 (file)
index a1b51d4..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-.\" mkfs.fat.8 - manpage for fs.fatck
-.\"
-.\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.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 <http://www.gnu.org/licenses/>.
-.\"
-.\" The complete text of the GNU General Public License
-.\" can be found in /usr/share/common-licenses/GPL-3 file.
-.\"
-.\"
-.\"*******************************************************************
-.\"
-.\" This file was generated with po4a. Translate the source file.
-.\"
-.\"*******************************************************************
-.TH MKFS.FAT 8 2015\-05\-16 3.0.28 dosfstools
-.SH NAME
-.\" ----------------------------------------------------------------------------
-\fBmkfs.fat\fP \- create an MS\-DOS filesystem under Linux
-.SH SYNOPSIS
-.\" ----------------------------------------------------------------------------
-\fBmkfs.fat\fP [\fIOPTIONS\fP] \fIDEVICE\fP [\fIBLOCK\-COUNT\fP]
-.SH DESCRIPTION
-.\" ----------------------------------------------------------------------------
-\fBmkfs.fat\fP is used to create an MS\-DOS filesystem under Linux on a device
-(usually a disk partition).  \fIDEVICE\fP is the special file corresponding to
-the device (e.g. /dev/sdXX).  \fIBLOCK\-COUNT\fP is the number of blocks on the
-device.  If omitted, \fBmkfs.fat\fP automatically determines the filesystem
-size.
-.SH OPTIONS
-.IP \fB\-a\fP 4
-Normally, for any filesystem except very small ones, \fBmkfs.fat\fP will align
-all the data structures to cluster size, to make sure that as long as the
-partition is properly aligned, so will all the data structures in the
-filesystem.  This option disables alignment; this may provide a handful of
-additional clusters of storage at the expense of a significant performance
-degradation on RAIDs, flash media or large\-sector hard disks.
-.IP "\fB \-A\fP" 4
-Use Atari variation of the MS\-DOS filesystem.  This is default if
-\fBmkfs.fat\fP is run on an Atari, then this option turns off Atari format.
-There are some differences when using Atari format: If not directed
-otherwise by the user, \fBmkfs.fat\fP will always use 2 sectors per cluster,
-since GEMDOS doesn't like other values very much.  It will also obey the
-maximum number of sectors GEMDOS can handle.  Larger filesystems are managed
-by raising the logical sector size.  Under Atari format, an Atari\-compatible
-serial number for the filesystem is generated, and a 12 bit FAT is used only
-for filesystems that have one of the usual floppy sizes (720k, 1.2M, 1.44M,
-2.88M), a 16 bit FAT otherwise.  This can be overridden with the \fB\-F\fP
-option.  Some PC\-specific boot sector fields aren't written, and a boot
-message (option \fB\-m\fP) is ignored.
-.IP "\fB\-b\fP \fISECTOR\-OF\-BACKUP\fP" 4
-Selects the location of the backup boot sector for FAT32.  Default depends
-on number of reserved sectors, but usually is sector 6.  The backup must be
-within the range of reserved sectors.
-.IP \fB\-c\fP 4
-Check the device for bad blocks before creating the filesystem.
-.IP \fB\-C\fP 4
-Create the file given as \fIDEVICE\fP on the command line, and write the
-to\-be\-created filesystem to it.  This can be used to create the new
-filesystem in a file instead of on a real device, and to avoid using \fBdd\fP
-in advance to create a file of appropriate size.  With this option, the
-\fIBLOCK\-COUNT\fP must be given, because otherwise the intended size of the
-filesystem wouldn't be known.  The file created is a sparse file, which
-actually only contains the meta\-data areas (boot sector, FATs, and root
-directory).  The data portions won't be stored on the disk, but the file
-nevertheless will have the correct size.  The resulting file can be copied
-later to a floppy disk or other device, or mounted through a loop device.
-.IP "\fB\-D\fP \fIDRIVE\-NUMBER\fP" 4
-Specify the BIOS drive number to be stored in the FAT boot sector.  This
-value is usually 0x80 for hard disks and 0x00 for floppy devices or
-partitions to be used for floppy emulation.
-.IP "\fB\-f\fP \fINUMBER\-OF\-FATS\fP" 4
-Specify the number of file allocation tables in the filesystem.  The default
-is 2.
-.IP "\fB\-F\fP \fIFAT\-SIZE\fP" 4
-Specifies the type of file allocation tables used (12, 16 or 32 bit).  If
-nothing is specified, \fBmkfs.fat\fP will automatically select between 12, 16
-and 32 bit, whatever fits better for the filesystem size.
-.IP "\fB\-h\fP \fINUMBER\-OF\-HIDDEN\-SECTORS\fP" 4
-Select the number of hidden sectors in the volume.  Apparently some digital
-cameras get indigestion if you feed them a CF card without such hidden
-sectors, this option allows you to satisfy them.
-.IP "\fB\-i\fP \fIVOLUME\-ID\fP" 4
-Sets the volume ID of the newly created filesystem; \fIVOLUME\-ID\fP is a 32\-bit
-hexadecimal number (for example, 2e24ec82).  The default is a number which
-depends on the filesystem creation time.
-.IP \fB\-I\fP 4
-It is typical for fixed disk devices to be partitioned so, by default, you
-are not permitted to create a filesystem across the entire device.
-\fBmkfs.fat\fP will complain and tell you that it refuses to work.  This is
-different when using MO disks.  One doesn't always need partitions on MO
-disks.  The filesystem can go directly to the whole disk.  Under other OSes
-this is known as the 'superfloppy' format.  This switch will force
-\fBmkfs.fat\fP to work properly.
-.IP "\fB\-l\fP \fIFILENAME\fP" 4
-Read the bad blocks list from \fIFILENAME\fP.
-.IP "\fB\-m\fP \fIMESSAGE\-FILE\fP" 4
-Sets the message the user receives on attempts to boot this filesystem
-without having properly installed an operating system.  The message file
-must not exceed 418 bytes once line feeds have been converted to carriage
-return\-line feed combinations, and tabs have been expanded.  If the filename
-is a hyphen (\-), the text is taken from standard input.
-.IP "\fB\-M\fP \fIFAT\-MEDIA\-TYPE\fP" 4
-Specify the media type to be stored in the FAT boot sector.  This value is
-usually 0xF8 for hard disks and is 0xF0 or a value from 0xF9 to 0xFF for
-floppies or partitions to be used for floppy emulation.
-.IP "\fB\-n\fP \fIVOLUME\-NAME\fP" 4
-Sets the volume name (label) of the filesystem.  The volume name can be up
-to 11 characters long.  The default is no label.
-.IP "\fB\-r\fP \fIROOT\-DIR\-ENTRIES\fP" 4
-Select the number of entries available in the root directory.  The default
-is 112 or 224 for floppies and 512 for hard disks.
-.IP "\fB\-R\fP \fINUMBER\-OF\-RESERVED\-SECTORS\fP" 4
-Select the number of reserved sectors.  With FAT32 format at least 2
-reserved sectors are needed, the default is 32.  Otherwise the default is 1
-(only the boot sector).
-.IP "\fB\-s\fP \fISECTORS\-PER\-CLUSTER\fP" 4
-Specify the number of disk sectors per cluster.  Must be a power of 2,
-i.e. 1, 2, 4, 8, ... 128.
-.IP "\fB\-S\fP \fILOGICAL\-SECTOR\-SIZE\fP" 4
-Specify the number of bytes per logical sector.  Must be a power of 2 and
-greater than or equal to 512, i.e. 512, 1024, 2048, 4096, 8192, 16384, or
-32768.
-.IP \fB\-v\fP 4
-Verbose execution.
-.IP \fB\-\-invariant\fP 4
-Use constants for normally randomly generated or time based data such as
-volume ID and creation time.  Multiple runs of \fBmkfs.fat\fP on the same
-device create identical results with this option.  Its main purpose is
-testing \fBmkfs.fat\fP.
-.IP \fB\-\-help\fP 4
-.\" ----------------------------------------------------------------------------
-Display option summary and exit.
-.SH BUGS
-.\" ----------------------------------------------------------------------------
-\fBmkfs.fat\fP can not create boot\-able filesystems.  This isn't as easy as you
-might think at first glance for various reasons and has been discussed a lot
-already.  \fBmkfs.fat\fP simply will not support it ;)
-.SH "SEE ALSO"
-\fBfatlabel\fP(8)
-.br
-.\" ----------------------------------------------------------------------------
-\fBfsck.fat\fP(8)
-.SH HOMEPAGE
-.\" ----------------------------------------------------------------------------
-The home for the \fBdosfstools\fP project is its
-.UR https://github.com/dosfstools/dosfstools
-GitHub project page
-.UE .
-.SH AUTHORS
-\fBdosfstools\fP were written by
-.MT werner.almesberger@\:lrc.di.epfl.ch
-Werner Almesberger
-.ME ,
-.MT Roman.Hodek@\:informatik.\:uni-erlangen.de
-Roman Hodek
-.ME ,
-and others.  The current maintainer is
-.MT aeb@\:debian.org
-Andreas Bombe
-.ME .
index bf5ebbd..5b7cc5d 100644 (file)
@@ -1,6 +1,8 @@
 .\" fatlabel.8 - manpage for fatlabel
 .\"
 .\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.org>
+.\" Copyright (C) 2017 Andreas Bombe <aeb@debian.org>
+.\" Copyright (C) 2017-2021 Pali Rohár <pali.rohar@gmail.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
 .\" can be found in /usr/share/common-licenses/GPL-3 file.
 .\"
 .\"
-.TH FATLABEL 8 2015\-04\-16 "dosfstools @PACKAGE_VERSION@"
+.TH FATLABEL 8 @RELEASE_DATE@ "dosfstools @PACKAGE_VERSION@"
 .SH NAME
-\fBfatlabel\fR \- set or get MS\-DOS filesystem label
+fatlabel \- set or get MS-DOS filesystem label or volume ID
 .\" ----------------------------------------------------------------------------
 .SH SYNOPSIS
-\fBfatlabel\fR \fIDEVICE\fR [\fILABEL\fR]
+\fBfatlabel\fP [\fIOPTIONS\fP] \fIDEVICE\fP [\fINEW\fP]
 .\" ----------------------------------------------------------------------------
 .SH DESCRIPTION
-\fBfatlabel\fR set or gets a MS\-DOS filesystem label from a given device.
+\fBfatlabel\fP will display or change the volume label or volume ID on the
+MS-DOS filesystem located on \fIDEVICE\fP.
+By default it works in label mode.
+It can be switched to volume ID mode with the option \fB\-i\fP or
+\fB\-\-volume\-id\fP.
 .PP
-If \fILABEL\fR is omitted, then the label name of the specified device is
-written on the standard output.
-A label can't be longer than 11 bytes.
+If \fINEW\fP is omitted, then the existing label or volume ID is written to the
+standard output.
+A label can't be longer than 11 bytes and should be in all upper case for best
+compatibility.
+An empty string or a label consisting only of white space is not allowed.
+A volume ID must be given as a hexadecimal number (no leading "0x" or
+similar) and must fit into 32 bits.
 .\" ----------------------------------------------------------------------------
 .SH OPTIONS
-.IP "\fB\-h\fR, \fB\-\-help\fR" 4
-Displays a help message.
-.IP "\fB\-V\fR, \fB\-\-version\fR" 4
-Shows version.
+.IP "\fB\-i\fP, \fB\-\-volume\-id\fP" 4
+Switch to volume ID mode.
+.IP "\fB\-r\fP, \fB\-\-reset\fP" 4
+Remove label in label mode or generate new ID in volume ID mode.
+.IP "\fB-c\fP \fIPAGE\fP, \fB\-\-codepage\fP=\fIPAGE\fP" 4
+Use DOS codepage \fIPAGE\fP to encode/decode label.
+By default codepage 850 is used.
+.IP "\fB\-h\fP, \fB\-\-help\fP" 4
+Display a help message and terminate.
+.IP "\fB\-V\fP, \fB\-\-version\fP" 4
+Show version number and terminate.
+.\" ----------------------------------------------------------------------------
+.SH COMPATIBILITY and BUGS
+For historic reasons FAT label is stored in two different locations: in the boot
+sector and as a special volume label entry in the root directory.
+MS-DOS 5.00, MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP and also
+Windows 10 read FAT label only from the root directory.
+Absence of the volume label in the root directory is interpreted as empty or
+none label, even if boot sector contains some valid label.
+
+When Windows XP or Windows 10 system changes a FAT label it stores it only in
+the root directory \(em letting boot sector unchanged.
+Which leads to problems when a label is removed on Windows.
+Old label is still stored in the boot sector but is removed from the root
+directory.
+
+\fBdosfslabel\fP prior to the version 3.0.7 operated only with FAT labels stored
+in the boot sector, completely ignoring a volume label in the root directory.
+
+\fBdosfslabel\fP in versions 3.0.7\(en3.0.15 reads FAT labels from the root
+directory and in case of absence, it fallbacks to a label stored in the boot
+sector.
+Change operation resulted in updating a label in the boot sector and
+\fIsometimes\fP also in the root directory due to the bug.
+That bug was fixed in \fBdosfslabel\fP version 3.0.16 and since this version
+\fBdosfslabel\fP updates label in both location.
+
+Since version 4.2, \fBfatlabel\fP reads a FAT label only from the root directory
+(like MS-DOS and Windows systems), but changes a FAT label in both locations.
+In version 4.2 was fixed handling of empty labels and labels which starts with a
+byte 0xE5.
+Also in this version was added support for non-ASCII labels according to the
+specified DOS codepage and were added checks if a new label is valid.
+
+It is strongly suggested to not use \fBdosfslabel\fP prior to version 3.0.16.
+.\" ----------------------------------------------------------------------------
+.SH DOS CODEPAGES
+MS-DOS and Windows systems use DOS (OEM) codepage for encoding and decoding FAT
+label.
+In Windows systems DOS codepage is global for all running applications and
+cannot be configured explicitly.
+It is set implicitly by option \fILanguage for non-Unicode programs\fP available
+in \fIRegional and Language Options\fP via \fIControl Panel\fP.
+Default DOS codepage for fatlabel is 850.
+See following mapping table between DOS codepage and Language for non-Unicode
+programs:
+.TS
+tab(:);
+c lx.
+\fBCodepage\fP:\fBLanguage\fP
+437:T{
+English (India), English (Malaysia), English (Republic of the Philippines),
+English (Singapore), English (South Africa), English (United States),
+English (Zimbabwe), Filipino, Hausa, Igbo, Inuktitut, Kinyarwanda, Kiswahili,
+Yoruba
+T}
+720:Arabic, Dari, Persian, Urdu, Uyghur
+737:Greek
+775:Estonian, Latvian, Lithuanian
+850:T{
+Afrikaans, Alsatian, Basque, Breton, Catalan, Corsican, Danish, Dutch,
+English (Australia), English (Belize), English (Canada), English (Caribbean),
+English (Ireland), English (Jamaica), English (New Zealand),
+English (Trinidad and Tobago), English (United Kingdom), Faroese, Finnish,
+French, Frisian, Galician, German, Greenlandic, Icelandic, Indonesian, Irish,
+isiXhosa, isiZulu, Italian, K'iche, Lower Sorbian, Luxembourgish, Malay,
+Mapudungun, Mohawk, Norwegian, Occitan, Portuguese, Quechua, Romansh, Sami,
+Scottish Gaelic, Sesotho sa Leboa, Setswana, Spanish, Swedish, Tamazight,
+Upper Sorbian, Welsh, Wolof
+T}
+852:T{
+Albanian, Bosnian (Latin), Croatian, Czech, Hungarian, Polish, Romanian,
+Serbian (Latin), Slovak, Slovenian, Turkmen
+T}
+855:Bosnian (Cyrillic), Serbian (Cyrillic)
+857:Azeri (Latin), Turkish, Uzbek (Latin)
+862:Hebrew
+866:T{
+Azeri (Cyrillic), Bashkir, Belarusian, Bulgarian, Kyrgyz, Macedonian, Mongolian,
+Russian, Tajik, Tatar, Ukrainian, Uzbek (Cyrillic), Yakut
+T}
+874:Thai
+932:Japanese
+936:Chinese (Simplified)
+949:Korean
+950:Chinese (Traditional)
+1258:Vietnamese
+.TE
 .\" ----------------------------------------------------------------------------
 .SH SEE ALSO
-\fBfsck.fat\fR(8)
-.br
-\fBmkfs.fat\fR(8)
+.BR fsck.fat (8),
+.BR mkfs.fat (8)
 .\" ----------------------------------------------------------------------------
 .SH HOMEPAGE
-The home for the \fBdosfstools\fR project is its
+The home for the \fBdosfstools\fP project is its
 .UR https://github.com/dosfstools/dosfstools
 GitHub project page
 .UE .
 .\" ----------------------------------------------------------------------------
 .SH AUTHORS
-\fBdosfstools\fR were written by
+\fBdosfstools\fP were written by
 .MT werner.almesberger@\:lrc.di.epfl.ch
 Werner Almesberger
 .ME ,
@@ -59,7 +162,11 @@ Werner Almesberger
 Roman Hodek
 .ME ,
 and others.
-The current maintainer is
+Current maintainers are
 .MT aeb@\:debian.org
 Andreas Bombe
+.ME
+and
+.MT pali.rohar@\:gmail.com
+Pali Rohár
 .ME .
index 06057a8..3814b40 100644 (file)
@@ -1,6 +1,7 @@
 .\" fsck.fat.8 - manpage for fsck.fat
 .\"
 .\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.org>
+.\" Copyright (C) 2018-2021 Pali Rohár <pali.rohar@gmail.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
 .\" can be found in /usr/share/common-licenses/GPL-3 file.
 .\"
 .\"
-.TH FSCK.FAT 8 2015\-04\-16 "dosfstools @PACKAGE_VERSION@"
+.TH FSCK.FAT 8 @RELEASE_DATE@ "dosfstools @PACKAGE_VERSION@"
 .SH NAME
-\fBfsck.fat\fR \- check and repair MS\-DOS filesystems
+fsck.fat \- check and repair MS-DOS FAT filesystems
 .\" ----------------------------------------------------------------------------
 .SH SYNOPSIS
-\fBfsck.fat\fR [\fIOPTIONS\fR] \fIDEVICE\fR
+\fBfsck.fat\fP [\fIOPTIONS\fP] \fIDEVICE\fP
 .\" ----------------------------------------------------------------------------
 .SH DESCRIPTION
-\fBfsck.fat\fR verifies the consistency of MS\-DOS filesystems and optionally
+\fBfsck.fat\fP verifies the consistency of MS-DOS filesystems and optionally
 tries to repair them.
 .PP
 The following filesystem problems can be corrected (in this order):
-.IP "*" 4
+.IP "\(bu" 4
 FAT contains invalid cluster numbers.
 Cluster is changed to EOF.
-.IP "*" 4
+.IP "\(bu" 4
 File's cluster chain contains a loop.
 The loop is broken.
-.IP "*" 4
+.IP "\(bu" 4
 Bad clusters (read errors).
 The clusters are marked bad and they are removed from files owning them.
 This check is optional.
-.IP "*" 4
+.IP "\(bu" 4
 Directories with a large number of bad entries (probably corrupt).
 The directory can be deleted.
-.IP "*" 4
-Files . and .. are non\-directories.
+.IP "\(bu" 4
+Files . and .. are non-directories.
 They can be deleted or renamed.
-.IP "*" 4
+.IP "\(bu" 4
 Directories . and .. in root directory.
 They are deleted.
-.IP "*" 4
+.IP "\(bu" 4
 Bad filenames.
 They can be renamed.
-.IP "*" 4
+.IP "\(bu" 4
 Duplicate directory entries.
 They can be deleted or renamed.
-.IP "*" 4
-Directories with non\-zero size field.
+.IP "\(bu" 4
+Directories with non-zero size field.
 Size is set to zero.
-.IP "*" 4
+.IP "\(bu" 4
 Directory . does not point to parent directory.
 The start pointer is adjusted.
-.IP "*" 4
+.IP "\(bu" 4
 Directory .. does not point to parent of parent directory.
 The start pointer is adjusted.
-.IP "*" 4
+.IP "\(bu" 4
+\&. and .. are not the two first entries in a non-root directory.
+The entries are created, moving occupied slots if necessary.
+.IP "\(bu" 4
 Start cluster number of a file is invalid.
 The file is truncated.
-.IP "*" 4
+.IP "\(bu" 4
 File contains bad or free clusters.
 The file is truncated.
-.IP "*" 4
+.IP "\(bu" 4
 File's cluster chain is longer than indicated by the size fields.
 The file is truncated.
-.IP "*" 4
+.IP "\(bu" 4
 Two or more files share the same cluster(s).
 All but one of the files are truncated.
 If the file being truncated is a directory file that has already been read, the
 filesystem check is restarted after truncation.
-.IP "*" 4
+.IP "\(bu" 4
 File's cluster chain is shorter than indicated by the size fields.
 The file is truncated.
-.IP "*" 4
+.IP "\(bu" 4
+Volume label in root directory or label in boot sector is invalid.
+Invalid labels are removed.
+.IP "\(bu" 4
+Volume label in root directory and label in boot sector are different.
+Volume label from root directory is copied to boot sector.
+.IP "\(bu" 4
 Clusters are marked as used but are not owned by a file.
 They are marked as free.
 .PP
 Additionally, the following problems are detected, but not repaired:
-.IP "*" 4
+.IP "\(bu" 4
 Invalid parameters in boot sector
-.IP "*" 4
-Absence of . and .. entries in non\-root directories
 .PP
-When \fBfsck.fat\fR checks a filesystem, it accumulates all changes in memory
+When \fBfsck.fat\fP checks a filesystem, it accumulates all changes in memory
 and performs them only after all checks are complete.
-This can be disabled with the \fB\-w\fR option.
+This can be disabled with the \fB\-w\fP option.
+.PP
+Two different variants of the FAT filesystem are supported.
+Standard is the FAT12, FAT16 and FAT32 filesystems as defined by Microsoft and
+widely used on hard disks and removable media like USB sticks and SD cards.
+The other is the legacy Atari variant used on Atari ST.
+.PP
+There are some minor differences in Atari format:
+Some boot sector fields are interpreted slightly different, and the special FAT
+entries for end-of-file and bad cluster can be different.
+Under MS-DOS 0xfff8 is used for EOF and Atari employs 0xffff by default, but
+both systems recognize all values from 0xfff8\(en0xffff as end-of-file.
+MS-DOS uses only 0xfff7 for bad clusters, where on Atari values 0xfff0\(en0xfff7
+are for this purpose (but the standard value is still 0xfff7).
 .\" ----------------------------------------------------------------------------
 .SH OPTIONS
-.IP "\fB\-a\fR" 4
+.IP "\fB\-a\fP" 4
 Automatically repair the filesystem.
 No user intervention is necessary.
 Whenever there is more than one method to solve a problem, the least
 destructive approach is used.
-.IP "\fB\-A\fR" 4
-Use Atari variation of the MS\-DOS filesystem.
-This is default if \fBfsck.fat\fR is run on an Atari, then this option turns
-off Atari format.
-There are some minor differences in Atari format:
-Some boot sector fields are interpreted slightly different, and the special FAT
-entries for end\-of\-file and bad cluster can be different.
-Under MS\-DOS 0xfff8 is used for EOF and Atari employs 0xffff by default, but
-both systems recognize all values from 0xfff8...0xffff as end\-of\-file.
-MS\-DOS uses only 0xfff7 for bad clusters, where on Atari values 0xfff0...0xfff7
-are for this purpose (but the standard value is still 0xfff7).
-.IP "\fB-b\fR" 4
+.IP "\fB\-A\fP" 4
+Select using the Atari variation of the FAT filesystem if that isn't active
+already, otherwise select standard FAT filesystem.
+This is selected by default if \fBmkfs.fat\fP is run on 68k Atari Linux.
+.IP "\fB-b\fP" 4
 Make read-only boot sector check.
-.IP "\fB-c\fR \fIPAGE\fR" 4
-Use DOS codepage \fIPAGE\fR to decode short file names.
-By default codepage 437 is used.
-.IP "\fB\-d\fR \fIPATH\fR" 4
+.IP "\fB-c\fP \fIPAGE\fP" 4
+Use DOS codepage \fIPAGE\fP to decode short file names.
+By default codepage 850 is used.
+.IP "\fB\-d\fP \fIPATH\fP" 4
 Delete the specified file.
 If more than one file with that name exist, the first one is deleted.
 This option can be given more than once.
-.IP "\fB\-f\fR" 4
+.IP "\fB\-f\fP" 4
 Salvage unused cluster chains to files.
 By default, unused clusters are added to the free disk space except in auto mode
-(\fB\-a\fR).
-.IP "\fB\-l\fR" 4
+(\fB\-a\fP).
+.IP "\fB\-F\fP \fINUM\fP" 4
+Specify FAT table \fINUM\fP for filesystem access.
+By default value \fI0\fP is assumed and then the first uncorrupted FAT table is
+chosen.
+Uncorrupted means that FAT table has valid first cluster.
+If default value \fI0\fP is used and all FAT tables are corrupted then
+\fBfsck.fat\fP gives up and does not try to repair FAT filesystem.
+If non-zero \fINUM\fP value is specified then \fBfsck.fat\fP uses FAT table
+\fINUM\fP for repairing FAT filesystem.
+If FAT table \fINUM\fP has corrupted first cluster then \fBfsck.fat\fP will
+repair it.
+In any case, if FAT filesystem has more FAT tables then repaired content of
+chosen FAT table is copied to other FAT tables.
+To repair corrupted first cluster it is required to call \fBfsck.fat\fP with
+non-zero \fINUM\fP value.
+.IP "\fB\-l\fP" 4
 List path names of files being processed.
-.IP "\fB\-n\fR" 4
-No\-operation mode: non\-interactively check for errors, but don't write
+.IP "\fB\-n\fP" 4
+No-operation mode: non-interactively check for errors, but don't write
 anything to the filesystem.
-.IP "\fB\-p\fR" 4
-Same as \fB\-a\fR, for compatibility with other *fsck.
-.IP "\fB\-r\fR" 4
+.IP "\fB\-p\fP" 4
+Same as \fB\-a\fP, for compatibility with other *fsck.
+.IP "\fB\-r\fP" 4
 Interactively repair the filesystem.
 The user is asked for advice whenever there is more than one approach to fix an
 inconsistency.
 This is the default mode and the option is only retained for backwards
 compatibility.
-.IP "\fB\-t\fR" 4
+.IP "\fB\-S\fP" 4
+Consider short (8.3) file names with spaces in the middle to be invalid, like
+previous versions of this program did.
+While such file names are not forbidden by the FAT specification, and were never
+treated as errors by Microsoft file system checking tools, many DOS programs are
+unable to handle files with such names.
+Using this option can make them accessible to these programs.
+.IP "" 4
+Short file names which \fIstart\fP with a space are considered invalid
+regardless of this option's setting.
+.IP "" 4
+Previous versions of this program exceptionally treated \fIEA DATA. SF\fP and
+\fIWP ROOT. SF\fP as valid short names; using this option does not preserve
+that exception.
+.IP "\fB\-t\fP" 4
 Mark unreadable clusters as bad.
-.IP "\fB\-u\fR \fIPATH\fR" 4
+.IP "\fB\-u\fP \fIPATH\fP" 4
 Try to undelete the specified file.
-\fBfsck.fat\fR tries to allocate a chain of contiguous unallocated clusters
+\fBfsck.fat\fP tries to allocate a chain of contiguous unallocated clusters
 beginning with the start cluster of the undeleted file.
 This option can be given more than once.
-.IP "\fB\-v\fR" 4
+.IP "\fB\-U\fP" 4
+Consider lowercase volume and boot label as invalid and allow only uppercase
+characters.
+Such labels are forbidden by the FAT specification, but they are widely used
+by Linux tools.
+Moreover MS-DOS and Windows systems do not have problems to read them.
+Therefore volume and boot labels with lowercase characters are by default
+permitted.
+.IP "\fB\-v\fP" 4
 Verbose mode.
 Generates slightly more output.
-.IP "\fB\-V\fR" 4
+.IP "\fB\-V\fP" 4
 Perform a verification pass.
 The filesystem check is repeated after the first run.
 The second pass should never report any fixable errors.
 It may take considerably longer than the first pass, because the first pass may
 have generated long list of modifications that have to be scanned for each disk
 read.
-.IP "\fB\-w\fR" 4
+.IP "\fB\-\-variant\fP \fITYPE\fP" 4
+Create a filesystem of variant \fITYPE\fP.
+Acceptable values are \fIstandard\fP and \fIatari\fP (in any combination of
+upper/lower case).
+See above under DESCRIPTION for the differences.
+.IP "\fB\-w\fP" 4
 Write changes to disk immediately.
-.IP "\fB\-y\fR" 4
-Same as \fB\-a\fR (automatically repair filesystem) for compatibility with other
+.IP "\fB\-y\fP" 4
+Same as \fB\-a\fP (automatically repair filesystem) for compatibility with other
 fsck tools.
+.IP "\fB\-\-help\fP" 4
+Display help message describing usage and options then exit.
 .\" ----------------------------------------------------------------------------
 .SH "EXIT STATUS"
 .IP "0" 4
 No recoverable errors have been detected.
 .IP "1" 4
-Recoverable errors have been detected or \fBfsck.fat\fR has discovered an
+Recoverable errors have been detected or \fBfsck.fat\fP has discovered an
 internal inconsistency.
 .IP "2" 4
 Usage error.
-\fBfsck.fat\fR did not access the filesystem.
+\fBfsck.fat\fP did not access the filesystem.
 .\" ----------------------------------------------------------------------------
 .SH FILES
-.IP "fsck0000.rec, fsck0001.rec, ..." 4
-When recovering from a corrupted filesystem, \fBfsck.fat\fR dumps recovered data
-into files named 'fsckNNNN.rec' in the top level directory of the filesystem.
+.IP "\fIfsck0000.rec\fP, \fIfsck0001.rec\fP, ..." 4
+When recovering from a corrupted filesystem, \fBfsck.fat\fP dumps recovered data
+into files named \fIfsckNNNN.rec\fP in the top level directory of the filesystem.
 .\" ----------------------------------------------------------------------------
 .SH BUGS
-Does not create . and .. files where necessary.
+.IP "\(bu" 4
 Does not remove entirely empty directories.
+.IP "\(bu" 4
 Should give more diagnostic messages.
+.IP "\(bu" 4
 Undeleting files should use a more sophisticated algorithm.
 .\" ----------------------------------------------------------------------------
 .SH SEE ALSO
-\fBfatlabel\fR(8)
-.br
-\fBmkfs.fat\fR(8)
+.BR fatlabel (8),
+.BR mkfs.fat (8)
 .\" ----------------------------------------------------------------------------
 .SH HOMEPAGE
-The home for the \fBdosfstools\fR project is its
+The home for the \fBdosfstools\fP project is its
 .UR https://github.com/dosfstools/dosfstools
 GitHub project page
 .UE .
 .\" ----------------------------------------------------------------------------
 .SH AUTHORS
-\fBdosfstools\fR were written by
+\fBdosfstools\fP were written by
 .MT werner.almesberger@\:lrc.di.epfl.ch
 Werner Almesberger
 .ME ,
@@ -203,7 +262,11 @@ Werner Almesberger
 Roman Hodek
 .ME ,
 and others.
-The current maintainer is
+Current maintainers are
 .MT aeb@\:debian.org
 Andreas Bombe
+.ME
+and
+.MT pali.rohar@\:gmail.com
+Pali Rohár
 .ME .
index 2d19daf..5e2526b 100644 (file)
@@ -2,6 +2,7 @@
 .\"
 .\" Copyright (C) 2006-2014 Daniel Baumann <daniel@debian.org>
 .\" Copyright (C) 2016 Andreas Bombe <aeb@debian.org>
+.\" Copyright (C) 2018-2021 Pali Rohár <pali.rohar@gmail.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
 .\" can be found in /usr/share/common-licenses/GPL-3 file.
 .\"
 .\"
-.TH MKFS.FAT 8 2016\-01\-25 "dosfstools @PACKAGE_VERSION@"
+.TH MKFS.FAT 8 @RELEASE_DATE@ "dosfstools @PACKAGE_VERSION@"
 .SH NAME
-\fBmkfs.fat\fR \- create an MS-DOS filesystem under Linux
+mkfs.fat \- create an MS-DOS FAT filesystem
 .\" ----------------------------------------------------------------------------
 .SH SYNOPSIS
-\fBmkfs.fat\fR [\fIOPTIONS\fR] \fIDEVICE\fR [\fIBLOCK-COUNT\fR]
+\fBmkfs.fat\fP [\fIOPTIONS\fP] \fIDEVICE\fP [\fIBLOCK-COUNT\fP]
 .\" ----------------------------------------------------------------------------
 .SH DESCRIPTION
-\fBmkfs.fat\fR is used to create an MS-DOS filesystem under Linux on a device
-(usually a disk partition).
-\fIDEVICE\fR is the special file corresponding to the device (e.g. /dev/sdXX).
-\fIBLOCK-COUNT\fR is the number of blocks on the device.
-If omitted, \fBmkfs.fat\fR automatically determines the filesystem size.
+\fBmkfs.fat\fP is used to create a FAT filesystem on a device or in an image
+file.
+\fIDEVICE\fP is the special file corresponding to the device (e.g. /dev/sdXX) or
+the image file (which does not need to exist when the option \fB-C\fP is given).
+\fIBLOCK-COUNT\fP is the number of blocks on the device and size of one block is
+always 1024 bytes, independently of the sector size or the cluster size.
+Therefore \fIBLOCK-COUNT\fP specifies size of filesystem in KiB unit and not in
+the number of sectors (like for all other \fBmkfs.fat\fP options).
+If omitted, \fBmkfs.fat\fP automatically chooses a filesystem size to fill the
+available space.
+.PP
+Two different variants of the FAT filesystem are supported.
+Standard is the FAT12, FAT16 and FAT32 filesystems as defined by Microsoft and
+widely used on hard disks and removable media like USB sticks and SD cards.
+The other is the legacy Atari variant used on Atari ST.
+.PP
+In Atari mode, if not directed otherwise by the user, \fBmkfs.fat\fP will
+always use 2 sectors per cluster, since GEMDOS doesn't like other values very
+much.
+It will also obey the maximum number of sectors GEMDOS can handle.
+Larger filesystems are managed by raising the logical sector size.
+An Atari-compatible serial number for the filesystem is generated, and a 12 bit
+FAT is used only for filesystems that have one of the usual floppy sizes (720k,
+1.2M, 1.44M, 2.88M), a 16 bit FAT otherwise.
+This can be overridden with the \fB\-F\fP option.
+Some PC-specific boot sector fields aren't written, and a boot message (option
+\fB\-m\fP) is ignored.
 .\" ----------------------------------------------------------------------------
 .SH OPTIONS
-.IP "\fB\-a\fR" 4
-Normally, for any filesystem except very small ones, \fBmkfs.fat\fR will align
+.IP "\fB\-a\fP" 4
+Normally, for any filesystem except very small ones, \fBmkfs.fat\fP will align
 all the data structures to cluster size, to make sure that as long as the
 partition is properly aligned, so will all the data structures in the
 filesystem.
 This option disables alignment; this may provide a handful of additional
 clusters of storage at the expense of a significant performance degradation on
 RAIDs, flash media or large-sector hard disks.
-.IP "\fB \-A\fR" 4
-Use Atari variation of the MS-DOS filesystem.
-This is default if \fBmkfs.fat\fR is run on an Atari, then this option turns off
-Atari format.
-There are some differences when using Atari format:
-If not directed otherwise by the user, \fBmkfs.fat\fR will always use 2 sectors
-per cluster, since GEMDOS doesn't like other values very much.
-It will also obey the maximum number of sectors GEMDOS can handle.
-Larger filesystems are managed by raising the logical sector size.
-Under Atari format, an Atari-compatible serial number for the filesystem is
-generated, and a 12 bit FAT is used only for filesystems that have one of the
-usual floppy sizes (720k, 1.2M, 1.44M, 2.88M), a 16 bit FAT otherwise.
-This can be overridden with the \fB\-F\fR option.
-Some PC-specific boot sector fields aren't written, and a boot message (option
-\fB\-m\fR) is ignored.
-.IP "\fB\-b\fR \fISECTOR-OF-BACKUP\fR" 4
+.IP "\fB\-A\fP" 4
+Select using the Atari variation of the FAT filesystem if that isn't active
+already, otherwise select standard FAT filesystem.
+This is selected by default if \fBmkfs.fat\fP is run on 68k Atari Linux.
+.IP "\fB\-b\fP \fISECTOR-OF-BACKUP\fP" 4
 Selects the location of the backup boot sector for FAT32.
 Default depends on number of reserved sectors, but usually is sector 6.
+If there is a free space available after the backup boot sector then backup of
+the FAT32 info sector is put after the backup boot sector, usually at sector 7.
 The backup must be within the range of reserved sectors.
+Value 0 completely disables creating of backup boot and info FAT32 sectors.
 .IP "\fB\-c" 4
 Check the device for bad blocks before creating the filesystem.
-.IP "\fB\-C\fR" 4
-Create the file given as \fIDEVICE\fR on the command line, and write the
+.IP "\fB\-C\fP" 4
+Create the file given as \fIDEVICE\fP on the command line, and write the
 to-be-created filesystem to it.
 This can be used to create the new filesystem in a file instead of on a real
-device, and to avoid using \fBdd\fR in advance to create a file of appropriate
+device, and to avoid using \fBdd\fP in advance to create a file of appropriate
 size.
-With this option, the \fIBLOCK-COUNT\fR must be given, because otherwise the
+With this option, the \fIBLOCK-COUNT\fP must be given, because otherwise the
 intended size of the filesystem wouldn't be known.
 The file created is a sparse file, which actually only contains the meta-data
 areas (boot sector, FATs, and root directory).
@@ -78,96 +93,150 @@ The data portions won't be stored on the disk, but the file nevertheless will
 have the correct size.
 The resulting file can be copied later to a floppy disk or other device, or
 mounted through a loop device.
-.IP "\fB\-D\fR \fIDRIVE-NUMBER\fR" 4
+.IP "\fB\-D\fP \fIDRIVE-NUMBER\fP" 4
 Specify the BIOS drive number to be stored in the FAT boot sector.
-This value is usually 0x80 for hard disks and 0x00 for floppy devices or
-partitions to be used for floppy emulation.
-.IP "\fB\-f\fR \fINUMBER-OF-FATS\fR" 4
+For hard disks and removable medias it is usually 0x80\(en0xFF (0x80 is first
+hard disk C:, 0x81 is second hard disk D:, ...), for floppy devices or
+partitions to be used for floppy emulation it is 0x00\(en0x7F (0x00 is first
+floppy A:, 0x01 is second floppy B:).
+.IP "\fB\-f\fP \fINUMBER-OF-FATS\fP" 4
 Specify the number of file allocation tables in the filesystem.
 The default is 2.
-.IP "\fB\-F\fR \fIFAT-SIZE\fR" 4
+.IP "\fB\-F\fP \fIFAT-SIZE\fP" 4
 Specifies the type of file allocation tables used (12, 16 or 32 bit).
-If nothing is specified, \fBmkfs.fat\fR will automatically select between 12, 16
+If nothing is specified, \fBmkfs.fat\fP will automatically select between 12, 16
 and 32 bit, whatever fits better for the filesystem size.
-.IP "\fB\-h\fR \fINUMBER-OF-HIDDEN-SECTORS\fR" 4
-Select the number of hidden sectors in the volume.
-Apparently some digital cameras get indigestion if you feed them a CF card
-without such hidden sectors, this option allows you to satisfy them.
-.IP "\fB\-i\fR \fIVOLUME-ID\fR" 4
-Sets the volume ID of the newly created filesystem; \fIVOLUME-ID\fR is a 32-bit
+.IP "\fB\-g\fP \fIHEADS\fP/\fISECTORS-PER-TRACK\fP" 4
+Specify \fIHEADS\fP and \fISECTORS-PER-TRACK\fP numbers which represents
+disk geometry of \fIDEVICE\fP.
+Both numbers are stored into the FAT boot sector.
+Number \fISECTORS-PER-TRACK\fP is used also for aligning the total count of FAT
+sectors.
+By default disk geometry is read from \fIDEVICE\fP itself.
+If it is not available then \fILBA-Assist Translation\fP and translation table
+from the \fISD Card Part 2 File System Specification\fP based on total number
+of disk sectors is used.
+.IP "\fB\-h\fP \fINUMBER-OF-HIDDEN-SECTORS\fP" 4
+Specify the number of so-called \fIhidden sectors\fP, as stored in the FAT boot
+sector: this number represents the beginning sector of the partition containing
+the file system.
+Normally this is an offset (in sectors) relative to the start of the disk,
+although for MBR logical volumes contained in an extended partition of type 0x05
+(a non-LBA extended partition), a quirk in the MS-DOS implementation of FAT
+requires it to be relative to the partition's immediate containing Extended Boot
+Record.
+Boot code and other software handling FAT volumes may also rely on this field
+being set up correctly; most modern FAT implementations will ignore it.
+By default, if the \fIDEVICE\fP is a partition block device, \fBmkfs.fat\fP uses
+the partition offset relative to disk start.
+Otherwise, \fBmkfs.fat\fP assumes zero.
+Use this option to override this behaviour.
+.IP "\fB\-i\fP \fIVOLUME-ID\fP" 4
+Sets the volume ID of the newly created filesystem; \fIVOLUME-ID\fP is a 32-bit
 hexadecimal number (for example, 2e24ec82).
 The default is a number which depends on the filesystem creation time.
-.IP "\fB\-I\fR" 4
-It is typical for fixed disk devices to be partitioned so, by default, you are
-not permitted to create a filesystem across the entire device.
-\fBmkfs.fat\fR will complain and tell you that it refuses to work.
+.IP "\fB\-I\fP" 4
+Ignore and disable safety checks.
+By default \fBmkfs.fat\fP refuses to create a filesystem on a device with
+partitions or virtual mapping.
+\fBmkfs.fat\fP will complain and tell you that it refuses to work.
 This is different when using MO disks.
 One doesn't always need partitions on MO disks.
 The filesystem can go directly to the whole disk.
-Under other OSes this is known as the 'superfloppy' format.
-This switch will force \fBmkfs.fat\fR to work properly.
-.IP "\fB\-l\fR \fIFILENAME\fR" 4
-Read the bad blocks list from \fIFILENAME\fR.
-.IP "\fB\-m\fR \fIMESSAGE-FILE\fR" 4
+Under other OSes this is known as the \fIsuperfloppy\fP format.
+This switch will force \fBmkfs.fat\fP to work properly.
+.IP "\fB\-l\fP \fIFILENAME\fP" 4
+Read the bad blocks list from \fIFILENAME\fP.
+.IP "\fB\-m\fP \fIMESSAGE-FILE\fP" 4
 Sets the message the user receives on attempts to boot this filesystem without
 having properly installed an operating system.
 The message file must not exceed 418 bytes once line feeds have been converted
 to carriage return-line feed combinations, and tabs have been expanded.
 If the filename is a hyphen (-), the text is taken from standard input.
-.IP "\fB\-M\fR \fIFAT-MEDIA-TYPE\fR" 4
+.IP "\fB\-M\fP \fIFAT-MEDIA-TYPE\fP" 4
 Specify the media type to be stored in the FAT boot sector.
 This value is usually 0xF8 for hard disks and is 0xF0 or a value from 0xF9 to
 0xFF for floppies or partitions to be used for floppy emulation.
-.IP "\fB\-n\fR \fIVOLUME-NAME\fR" 4
+.IP "\fB\-\-mbr\fP[=\fIy\fP|\fIyes\fP|\fIn\fP|\fIno\fP|\fIa\fP|\fIauto\fP]" 4
+Fill (fake) MBR table with disk signature one partition which starts at sector
+0 (includes MBR itself) and spans whole disk device.
+It is needed only for non-removable disks used on Microsoft Windows systems and
+only when formatting whole unpartitioned disk.
+Location of the disk signature and partition table overlaps with the end of the
+first FAT sector (boot code location), therefore there is no additional space
+usage.
+Default is \fIauto\fP mode in which \fBmkfs.fat\fP put MBR table only for
+non-removable disks when formatting whole unpartitioned disk.
+.IP "\fB\-n\fP \fIVOLUME-NAME\fP" 4
 Sets the volume name (label) of the filesystem.
 The volume name can be up to 11 characters long.
+Supplying an empty string, a string consisting only of white space or the
+string "NO NAME" as \fIVOLUME-NAME\fP has the same effect as not giving the
+\fB\-n\fP option.
 The default is no label.
-.IP "\fB\-r\fR \fIROOT-DIR-ENTRIES\fR" 4
-Select the number of entries available in the root directory.
+.IP "\fB\-\-codepage\fP=\fIPAGE\fP" 4
+Use DOS codepage \fIPAGE\fP to encode label.
+By default codepage 850 is used.
+.IP "\fB\-r\fP \fIROOT-DIR-ENTRIES\fP" 4
+Select the minimal number of entries available in the root directory.
 The default is 112 or 224 for floppies and 512 for hard disks.
-.IP "\fB\-R\fR \fINUMBER-OF-RESERVED-SECTORS\fR" 4
-Select the number of reserved sectors.
+Note that this is minimal number and it may be increased by \fBmkfs.fat\fP
+due to alignment of structures.
+See also \fBmkfs.fat\fP option \fB\-a\fP.
+.IP "\fB\-R\fP \fINUMBER-OF-RESERVED-SECTORS\fP" 4
+Select the minimal number of reserved sectors.
 With FAT32 format at least 2 reserved sectors are needed, the default is 32.
 Otherwise the default is 1 (only the boot sector).
-.IP "\fB\-s\fR \fISECTORS-PER-CLUSTER\fR" 4
+Note that this is minimal number and it may be increased by \fBmkfs.fat\fP
+due to alignment of structures.
+See also \fBmkfs.fat\fP option \fB\-a\fP.
+.IP "\fB\-s\fP \fISECTORS-PER-CLUSTER\fP" 4
 Specify the number of disk sectors per cluster.
 Must be a power of 2, i.e. 1, 2, 4, 8, ... 128.
-.IP "\fB\-S\fR \fILOGICAL-SECTOR-SIZE\fR" 4
+.IP "\fB\-S\fP \fILOGICAL-SECTOR-SIZE\fP" 4
 Specify the number of bytes per logical sector.
 Must be a power of 2 and greater than or equal to 512, i.e. 512, 1024, 2048,
 4096, 8192, 16384, or 32768.
 Values larger than 4096 are not conforming to the FAT file system specification
 and may not work everywhere.
-.IP "\fB\-v\fR" 4
+.IP "\fB\-v\fP" 4
 Verbose execution.
-.IP "\fB\-\-invariant\fR" 4
+.IP "\fB\-\-offset\fP \fISECTOR\fP" 4
+Write the filesystem at a specific sector into the device file.
+This is useful for creating a filesystem in a partitioned disk image without
+having to set up a loop device.
+.IP "\fB\-\-variant\fP \fITYPE\fP" 4
+Create a filesystem of variant \fITYPE\fP.
+Acceptable values are \fIstandard\fP and \fIatari\fP (in any combination of
+upper/lower case).
+See above under DESCRIPTION for the differences.
+.IP "\fB\-\-help\fP" 4
+Display option summary and exit.
+.IP "\fB\-\-invariant\fP" 4
 Use constants for normally randomly generated or time based data such as
 volume ID and creation time.
-Multiple runs of \fBmkfs.fat\fR on the same device create identical results
+Multiple runs of \fBmkfs.fat\fP on the same device create identical results
 with this option.
-Its main purpose is testing \fBmkfs.fat\fR.
-.IP "\fB\-\-help\fR" 4
-Display option summary and exit.
+Its main purpose is testing \fBmkfs.fat\fP.
 .\" ----------------------------------------------------------------------------
 .SH BUGS
-\fBmkfs.fat\fR can not create boot-able filesystems.
+\fBmkfs.fat\fP can not create boot-able filesystems.
 This isn't as easy as you might think at first glance for various reasons and
 has been discussed a lot already.
-\fBmkfs.fat\fR simply will not support it ;)
+\fBmkfs.fat\fP simply will not support it ;)
 .\" ----------------------------------------------------------------------------
 .SH SEE ALSO
-\fBfatlabel\fR(8)
-.br
-\fBfsck.fat\fR(8)
+.BR fatlabel (8),
+.BR fsck.fat (8)
 .\" ----------------------------------------------------------------------------
 .SH HOMEPAGE
-The home for the \fBdosfstools\fR project is its
+The home for the \fBdosfstools\fP project is its
 .UR https://github.com/dosfstools/dosfstools
 GitHub project page
 .UE .
 .\" ----------------------------------------------------------------------------
 .SH AUTHORS
-\fBdosfstools\fR were written by
+\fBdosfstools\fP were written by
 .MT werner.almesberger@\:lrc.di.epfl.ch
 Werner Almesberger
 .ME ,
@@ -175,7 +244,11 @@ Werner Almesberger
 Roman Hodek
 .ME ,
 and others.
-The current maintainer is
+Current maintainers are
 .MT aeb@\:debian.org
 Andreas Bombe
+.ME
+and
+.MT pali.rohar@\:gmail.com
+Pali Rohár
 .ME .
diff --git a/manpages/po/de/fatlabel.8.po b/manpages/po/de/fatlabel.8.po
deleted file mode 100644 (file)
index a2b6da2..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-# German translations for dosfstools package
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: dosfstools VERSION\n"
-"POT-Creation-Date: 2015-05-16 00:40+0200\n"
-"PO-Revision-Date: 2013-06-06 09:34+0300\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
-"Language: de\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ASCII\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. type: TH
-#: en/fatlabel.8:22
-#, no-wrap
-msgid "FATLABEL"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "2015-05-16"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "3.0.28"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "dosfstools"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:23 en/fsck.fat.8:23 en/mkfs.fat.8:23
-#, no-wrap
-msgid "NAME"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:26
-msgid "B<fatlabel> - set or get MS-DOS filesystem label"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:26 en/fsck.fat.8:26 en/mkfs.fat.8:26
-#, no-wrap
-msgid "SYNOPSIS"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:29
-msgid "B<fatlabel> I<DEVICE> [I<LABEL>]"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:29 en/fsck.fat.8:29 en/mkfs.fat.8:29
-#, no-wrap
-msgid "DESCRIPTION"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:31
-msgid "B<fatlabel> set or gets a MS-DOS filesystem label from a given device."
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:36
-msgid ""
-"If I<LABEL> is omitted, then the label name of the specified device is "
-"written on the standard output.  A label can't be longer than 11 bytes."
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:36 en/fsck.fat.8:99 en/mkfs.fat.8:36
-#, no-wrap
-msgid "OPTIONS"
-msgstr ""
-
-#. type: IP
-#: en/fatlabel.8:37
-#, no-wrap
-msgid "B<-h>, B<--help>"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:39
-msgid "Displays a help message."
-msgstr ""
-
-#. type: IP
-#: en/fatlabel.8:39
-#, no-wrap
-msgid "B<-V>, B<--version>"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:42
-msgid "Shows version."
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:42 en/fsck.fat.8:183 en/mkfs.fat.8:155
-#, no-wrap
-msgid "SEE ALSO"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:44 en/mkfs.fat.8:160
-msgid "B<fsck.fat>(8)"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:47 en/fsck.fat.8:188
-msgid "B<mkfs.fat>(8)"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:47 en/fsck.fat.8:188 en/mkfs.fat.8:160
-#, no-wrap
-msgid "HOMEPAGE"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-msgid ""
-"The home for the B<dosfstools> project is its E<.UR https://github.com/"
-"dosfstools/dosfstools> GitHub project page E<.UE .>"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-#, no-wrap
-msgid "AUTHORS"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:55 en/fsck.fat.8:196 en/mkfs.fat.8:168
-msgid "B<dosfstools> were written by"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:57 en/fsck.fat.8:198 en/mkfs.fat.8:170
-msgid "Werner Almesberger"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:60 en/fsck.fat.8:201 en/mkfs.fat.8:173
-msgid "Roman Hodek"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:63 en/fsck.fat.8:204 en/mkfs.fat.8:176
-msgid "and others.  The current maintainer is"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:65 en/fsck.fat.8:206 en/mkfs.fat.8:178
-msgid "Andreas Bombe"
-msgstr ""
diff --git a/manpages/po/de/fsck.fat.8.po b/manpages/po/de/fsck.fat.8.po
deleted file mode 100644 (file)
index 1487e9f..0000000
+++ /dev/null
@@ -1,559 +0,0 @@
-# German translations for dosfstools package
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: dosfstools VERSION\n"
-"POT-Creation-Date: 2015-05-16 00:40+0200\n"
-"PO-Revision-Date: 2013-06-06 09:34+0300\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
-"Language: de\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ASCII\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "2015-05-16"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "3.0.28"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "dosfstools"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:23 en/fsck.fat.8:23 en/mkfs.fat.8:23
-#, no-wrap
-msgid "NAME"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:26 en/fsck.fat.8:26 en/mkfs.fat.8:26
-#, no-wrap
-msgid "SYNOPSIS"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:29 en/fsck.fat.8:29 en/mkfs.fat.8:29
-#, no-wrap
-msgid "DESCRIPTION"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:36 en/fsck.fat.8:99 en/mkfs.fat.8:36
-#, no-wrap
-msgid "OPTIONS"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:42 en/fsck.fat.8:183 en/mkfs.fat.8:155
-#, no-wrap
-msgid "SEE ALSO"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:47 en/fsck.fat.8:188
-msgid "B<mkfs.fat>(8)"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:47 en/fsck.fat.8:188 en/mkfs.fat.8:160
-#, no-wrap
-msgid "HOMEPAGE"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-msgid ""
-"The home for the B<dosfstools> project is its E<.UR https://github.com/"
-"dosfstools/dosfstools> GitHub project page E<.UE .>"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-#, no-wrap
-msgid "AUTHORS"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:55 en/fsck.fat.8:196 en/mkfs.fat.8:168
-msgid "B<dosfstools> were written by"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:57 en/fsck.fat.8:198 en/mkfs.fat.8:170
-msgid "Werner Almesberger"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:60 en/fsck.fat.8:201 en/mkfs.fat.8:173
-msgid "Roman Hodek"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:63 en/fsck.fat.8:204 en/mkfs.fat.8:176
-msgid "and others.  The current maintainer is"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:65 en/fsck.fat.8:206 en/mkfs.fat.8:178
-msgid "Andreas Bombe"
-msgstr ""
-
-#. type: TH
-#: en/fsck.fat.8:22
-#, no-wrap
-msgid "FSCK.FAT"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:26
-msgid "B<fsck.fat> - check and repair MS-DOS filesystems"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:29
-msgid "B<fsck.fat> [I<OPTIONS>] I<DEVICE>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:32
-msgid ""
-"B<fsck.fat> verifies the consistency of MS-DOS filesystems and optionally "
-"tries to repair them."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:34
-msgid "The following filesystem problems can be corrected (in this order):"
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:34 en/fsck.fat.8:37 en/fsck.fat.8:40 en/fsck.fat.8:44
-#: en/fsck.fat.8:47 en/fsck.fat.8:50 en/fsck.fat.8:53 en/fsck.fat.8:56
-#: en/fsck.fat.8:59 en/fsck.fat.8:62 en/fsck.fat.8:65 en/fsck.fat.8:68
-#: en/fsck.fat.8:71 en/fsck.fat.8:74 en/fsck.fat.8:77 en/fsck.fat.8:82
-#: en/fsck.fat.8:85 en/fsck.fat.8:90 en/fsck.fat.8:92
-#, no-wrap
-msgid "*"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:37
-msgid "FAT contains invalid cluster numbers.  Cluster is changed to EOF."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:40
-msgid "File's cluster chain contains a loop.  The loop is broken."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:44
-msgid ""
-"Bad clusters (read errors).  The clusters are marked bad and they are "
-"removed from files owning them.  This check is optional."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:47
-msgid ""
-"Directories with a large number of bad entries (probably corrupt).  The "
-"directory can be deleted."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:50
-msgid "Files . and .. are non-directories.  They can be deleted or renamed."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:53
-msgid "Directories . and .. in root directory.  They are deleted."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:56
-msgid "Bad filenames.  They can be renamed."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:59
-msgid "Duplicate directory entries.  They can be deleted or renamed."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:62
-msgid "Directories with non-zero size field.  Size is set to zero."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:65
-msgid ""
-"Directory . does not point to parent directory.  The start pointer is "
-"adjusted."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:68
-msgid ""
-"Directory .. does not point to parent of parent directory.  The start "
-"pointer is adjusted."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:71
-msgid "Start cluster number of a file is invalid.  The file is truncated."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:74
-msgid "File contains bad or free clusters.  The file is truncated."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:77
-msgid ""
-"File's cluster chain is longer than indicated by the size fields.  The file "
-"is truncated."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:82
-msgid ""
-"Two or more files share the same cluster(s).  All but one of the files are "
-"truncated.  If the file being truncated is a directory file that has already "
-"been read, the filesystem check is restarted after truncation."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:85
-msgid ""
-"File's cluster chain is shorter than indicated by the size fields.  The file "
-"is truncated."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:88
-msgid ""
-"Clusters are marked as used but are not owned by a file.  They are marked as "
-"free."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:90
-msgid "Additionally, the following problems are detected, but not repaired:"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:92
-msgid "Invalid parameters in boot sector"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:94
-msgid "Absence of . and .. entries in non-root directories"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:99
-msgid ""
-"When B<fsck.fat> checks a filesystem, it accumulates all changes in memory "
-"and performs them only after all checks are complete.  This can be disabled "
-"with the B<-w> option."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:100 en/mkfs.fat.8:37
-#, no-wrap
-msgid "B<-a>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:105
-msgid ""
-"Automatically repair the filesystem.  No user intervention is necessary.  "
-"Whenever there is more than one method to solve a problem, the least "
-"destructive approach is used."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:105
-#, no-wrap
-msgid "B<-A>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:116
-msgid ""
-"Use Atari variation of the MS-DOS filesystem.  This is default if B<fsck."
-"fat> is run on an Atari, then this option turns off Atari format.  There are "
-"some minor differences in Atari format: Some boot sector fields are "
-"interpreted slightly different, and the special FAT entries for end-of-file "
-"and bad cluster can be different.  Under MS-DOS 0xfff8 is used for EOF and "
-"Atari employs 0xffff by default, but both systems recognize all values from "
-"0xfff8...0xffff as end-of-file.  MS-DOS uses only 0xfff7 for bad clusters, "
-"where on Atari values 0xfff0...0xfff7 are for this purpose (but the standard "
-"value is still 0xfff7)."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:116
-#, no-wrap
-msgid "B<-b>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:118
-msgid "Make read-only boot sector check."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:118
-#, no-wrap
-msgid "B<-d> I<PATH>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:122
-msgid ""
-"Delete the specified file.  If more than one file with that name exist, the "
-"first one is deleted.  This option can be given more than once."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:122
-#, no-wrap
-msgid "B<-f>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:126
-msgid ""
-"Salvage unused cluster chains to files.  By default, unused clusters are "
-"added to the free disk space except in auto mode (B<-a>)."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:126
-#, no-wrap
-msgid "B<-l>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:128
-msgid "List path names of files being processed."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:128
-#, no-wrap
-msgid "B<-n>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:131
-msgid ""
-"No-operation mode: non-interactively check for errors, but don't write "
-"anything to the filesystem."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:131
-#, no-wrap
-msgid "B<-p>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:133
-msgid "Same as B<-a>, for compatibility with other *fsck."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:133
-#, no-wrap
-msgid "B<-r>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:139
-msgid ""
-"Interactively repair the filesystem.  The user is asked for advice whenever "
-"there is more than one approach to fix an inconsistency.  This is the "
-"default mode and the option is only retained for backwards compatibility."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:139
-#, no-wrap
-msgid "B<-t>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:141
-msgid "Mark unreadable clusters as bad."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:141
-#, no-wrap
-msgid "B<-u> I<PATH>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:146
-msgid ""
-"Try to undelete the specified file.  B<fsck.fat> tries to allocate a chain "
-"of contiguous unallocated clusters beginning with the start cluster of the "
-"undeleted file.  This option can be given more than once."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:146 en/mkfs.fat.8:138
-#, no-wrap
-msgid "B<-v>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:149
-msgid "Verbose mode.  Generates slightly more output."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:149
-#, no-wrap
-msgid "B<-V>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:156
-msgid ""
-"Perform a verification pass.  The filesystem check is repeated after the "
-"first run.  The second pass should never report any fixable errors.  It may "
-"take considerably longer than the first pass, because the first pass may "
-"have generated long list of modifications that have to be scanned for each "
-"disk read."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:156
-#, no-wrap
-msgid "B<-w>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:158
-msgid "Write changes to disk immediately."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:158
-#, no-wrap
-msgid "B<-y>"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:162
-msgid ""
-"Same as B<-a> (automatically repair filesystem) for compatibility with other "
-"fsck tools."
-msgstr ""
-
-#. type: SH
-#: en/fsck.fat.8:162
-#, no-wrap
-msgid "EXIT STATUS"
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:163
-#, no-wrap
-msgid "0"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:165
-msgid "No recoverable errors have been detected."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:165
-#, no-wrap
-msgid "1"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:168
-msgid ""
-"Recoverable errors have been detected or B<fsck.fat> has discovered an "
-"internal inconsistency."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:168
-#, no-wrap
-msgid "2"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:172
-msgid "Usage error.  B<fsck.fat> did not access the filesystem."
-msgstr ""
-
-#. type: SH
-#: en/fsck.fat.8:172
-#, no-wrap
-msgid "FILES"
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:173
-#, no-wrap
-msgid "fsck0000.rec, fsck0001.rec, ..."
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:177
-msgid ""
-"When recovering from a corrupted filesystem, B<fsck.fat> dumps recovered "
-"data into files named 'fsckNNNN.rec' in the top level directory of the "
-"filesystem."
-msgstr ""
-
-#. type: SH
-#: en/fsck.fat.8:177 en/mkfs.fat.8:149
-#, no-wrap
-msgid "BUGS"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:183
-msgid ""
-"Does not create . and .. files where necessary.  Does not remove entirely "
-"empty directories.  Should give more diagnostic messages.  Undeleting files "
-"should use a more sophisticated algorithm."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:185 en/mkfs.fat.8:157
-msgid "B<fatlabel>(8)"
-msgstr ""
diff --git a/manpages/po/de/mkfs.fat.8.po b/manpages/po/de/mkfs.fat.8.po
deleted file mode 100644 (file)
index 3344f71..0000000
+++ /dev/null
@@ -1,481 +0,0 @@
-# German translations for dosfstools package
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: dosfstools VERSION\n"
-"POT-Creation-Date: 2015-05-16 00:40+0200\n"
-"PO-Revision-Date: 2013-06-06 09:34+0300\n"
-"Last-Translator: Automatically generated\n"
-"Language-Team: none\n"
-"Language: de\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=ASCII\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "2015-05-16"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "3.0.28"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "dosfstools"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:23 en/fsck.fat.8:23 en/mkfs.fat.8:23
-#, no-wrap
-msgid "NAME"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:26 en/fsck.fat.8:26 en/mkfs.fat.8:26
-#, no-wrap
-msgid "SYNOPSIS"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:29 en/fsck.fat.8:29 en/mkfs.fat.8:29
-#, no-wrap
-msgid "DESCRIPTION"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:36 en/fsck.fat.8:99 en/mkfs.fat.8:36
-#, no-wrap
-msgid "OPTIONS"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:42 en/fsck.fat.8:183 en/mkfs.fat.8:155
-#, no-wrap
-msgid "SEE ALSO"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:44 en/mkfs.fat.8:160
-msgid "B<fsck.fat>(8)"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:47 en/fsck.fat.8:188 en/mkfs.fat.8:160
-#, no-wrap
-msgid "HOMEPAGE"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-msgid ""
-"The home for the B<dosfstools> project is its E<.UR https://github.com/"
-"dosfstools/dosfstools> GitHub project page E<.UE .>"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-#, no-wrap
-msgid "AUTHORS"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:55 en/fsck.fat.8:196 en/mkfs.fat.8:168
-msgid "B<dosfstools> were written by"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:57 en/fsck.fat.8:198 en/mkfs.fat.8:170
-msgid "Werner Almesberger"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:60 en/fsck.fat.8:201 en/mkfs.fat.8:173
-msgid "Roman Hodek"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:63 en/fsck.fat.8:204 en/mkfs.fat.8:176
-msgid "and others.  The current maintainer is"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:65 en/fsck.fat.8:206 en/mkfs.fat.8:178
-msgid "Andreas Bombe"
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:100 en/mkfs.fat.8:37
-#, no-wrap
-msgid "B<-a>"
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:146 en/mkfs.fat.8:138
-#, no-wrap
-msgid "B<-v>"
-msgstr ""
-
-#. type: SH
-#: en/fsck.fat.8:177 en/mkfs.fat.8:149
-#, no-wrap
-msgid "BUGS"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:185 en/mkfs.fat.8:157
-msgid "B<fatlabel>(8)"
-msgstr ""
-
-#. type: TH
-#: en/mkfs.fat.8:22
-#, no-wrap
-msgid "MKFS.FAT"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/mkfs.fat.8:26
-msgid "B<mkfs.fat> - create an MS-DOS filesystem under Linux"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/mkfs.fat.8:29
-msgid "B<mkfs.fat> [I<OPTIONS>] I<DEVICE> [I<BLOCK-COUNT>]"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/mkfs.fat.8:36
-msgid ""
-"B<mkfs.fat> is used to create an MS-DOS filesystem under Linux on a device "
-"(usually a disk partition).  I<DEVICE> is the special file corresponding to "
-"the device (e.g. /dev/sdXX).  I<BLOCK-COUNT> is the number of blocks on the "
-"device.  If omitted, B<mkfs.fat> automatically determines the filesystem "
-"size."
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:45
-msgid ""
-"Normally, for any filesystem except very small ones, B<mkfs.fat> will align "
-"all the data structures to cluster size, to make sure that as long as the "
-"partition is properly aligned, so will all the data structures in the "
-"filesystem.  This option disables alignment; this may provide a handful of "
-"additional clusters of storage at the expense of a significant performance "
-"degradation on RAIDs, flash media or large-sector hard disks."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:45
-#, no-wrap
-msgid "B< -A>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:60
-msgid ""
-"Use Atari variation of the MS-DOS filesystem.  This is default if B<mkfs."
-"fat> is run on an Atari, then this option turns off Atari format.  There are "
-"some differences when using Atari format: If not directed otherwise by the "
-"user, B<mkfs.fat> will always use 2 sectors per cluster, since GEMDOS "
-"doesn't like other values very much.  It will also obey the maximum number "
-"of sectors GEMDOS can handle.  Larger filesystems are managed by raising the "
-"logical sector size.  Under Atari format, an Atari-compatible serial number "
-"for the filesystem is generated, and a 12 bit FAT is used only for "
-"filesystems that have one of the usual floppy sizes (720k, 1.2M, 1.44M, "
-"2.88M), a 16 bit FAT otherwise.  This can be overridden with the B<-F> "
-"option.  Some PC-specific boot sector fields aren't written, and a boot "
-"message (option B<-m>) is ignored."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:60
-#, no-wrap
-msgid "B<-b> I<SECTOR-OF-BACKUP>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:64
-msgid ""
-"Selects the location of the backup boot sector for FAT32.  Default depends "
-"on number of reserved sectors, but usually is sector 6.  The backup must be "
-"within the range of reserved sectors."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:64
-#, no-wrap
-msgid "B<-c>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:66
-msgid "Check the device for bad blocks before creating the filesystem."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:66
-#, no-wrap
-msgid "B<-C>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:80
-msgid ""
-"Create the file given as I<DEVICE> on the command line, and write the to-be-"
-"created filesystem to it.  This can be used to create the new filesystem in "
-"a file instead of on a real device, and to avoid using B<dd> in advance to "
-"create a file of appropriate size.  With this option, the I<BLOCK-COUNT> "
-"must be given, because otherwise the intended size of the filesystem "
-"wouldn't be known.  The file created is a sparse file, which actually only "
-"contains the meta-data areas (boot sector, FATs, and root directory).  The "
-"data portions won't be stored on the disk, but the file nevertheless will "
-"have the correct size.  The resulting file can be copied later to a floppy "
-"disk or other device, or mounted through a loop device."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:80
-#, no-wrap
-msgid "B<-D> I<DRIVE-NUMBER>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:84
-msgid ""
-"Specify the BIOS drive number to be stored in the FAT boot sector.  This "
-"value is usually 0x80 for hard disks and 0x00 for floppy devices or "
-"partitions to be used for floppy emulation."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:84
-#, no-wrap
-msgid "B<-f> I<NUMBER-OF-FATS>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:87
-msgid ""
-"Specify the number of file allocation tables in the filesystem.  The default "
-"is 2."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:87
-#, no-wrap
-msgid "B<-F> I<FAT-SIZE>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:91
-msgid ""
-"Specifies the type of file allocation tables used (12, 16 or 32 bit).  If "
-"nothing is specified, B<mkfs.fat> will automatically select between 12, 16 "
-"and 32 bit, whatever fits better for the filesystem size."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:91
-#, no-wrap
-msgid "B<-h> I<NUMBER-OF-HIDDEN-SECTORS>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:95
-msgid ""
-"Select the number of hidden sectors in the volume.  Apparently some digital "
-"cameras get indigestion if you feed them a CF card without such hidden "
-"sectors, this option allows you to satisfy them."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:95
-#, no-wrap
-msgid "B<-i> I<VOLUME-ID>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:99
-msgid ""
-"Sets the volume ID of the newly created filesystem; I<VOLUME-ID> is a 32-bit "
-"hexadecimal number (for example, 2e24ec82).  The default is a number which "
-"depends on the filesystem creation time."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:99
-#, no-wrap
-msgid "B<-I>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:108
-msgid ""
-"It is typical for fixed disk devices to be partitioned so, by default, you "
-"are not permitted to create a filesystem across the entire device.  B<mkfs."
-"fat> will complain and tell you that it refuses to work.  This is different "
-"when using MO disks.  One doesn't always need partitions on MO disks.  The "
-"filesystem can go directly to the whole disk.  Under other OSes this is "
-"known as the 'superfloppy' format.  This switch will force B<mkfs.fat> to "
-"work properly."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:108
-#, no-wrap
-msgid "B<-l> I<FILENAME>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:110
-msgid "Read the bad blocks list from I<FILENAME>."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:110
-#, no-wrap
-msgid "B<-m> I<MESSAGE-FILE>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:116
-msgid ""
-"Sets the message the user receives on attempts to boot this filesystem "
-"without having properly installed an operating system.  The message file "
-"must not exceed 418 bytes once line feeds have been converted to carriage "
-"return-line feed combinations, and tabs have been expanded.  If the filename "
-"is a hyphen (-), the text is taken from standard input."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:116
-#, no-wrap
-msgid "B<-M> I<FAT-MEDIA-TYPE>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:120
-msgid ""
-"Specify the media type to be stored in the FAT boot sector.  This value is "
-"usually 0xF8 for hard disks and is 0xF0 or a value from 0xF9 to 0xFF for "
-"floppies or partitions to be used for floppy emulation."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:120
-#, no-wrap
-msgid "B<-n> I<VOLUME-NAME>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:124
-msgid ""
-"Sets the volume name (label) of the filesystem.  The volume name can be up "
-"to 11 characters long.  The default is no label."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:124
-#, no-wrap
-msgid "B<-r> I<ROOT-DIR-ENTRIES>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:127
-msgid ""
-"Select the number of entries available in the root directory.  The default "
-"is 112 or 224 for floppies and 512 for hard disks."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:127
-#, no-wrap
-msgid "B<-R> I<NUMBER-OF-RESERVED-SECTORS>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:131
-msgid ""
-"Select the number of reserved sectors.  With FAT32 format at least 2 "
-"reserved sectors are needed, the default is 32.  Otherwise the default is 1 "
-"(only the boot sector)."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:131
-#, no-wrap
-msgid "B<-s> I<SECTORS-PER-CLUSTER>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:134
-msgid ""
-"Specify the number of disk sectors per cluster.  Must be a power of 2, i.e. "
-"1, 2, 4, 8, ... 128."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:134
-#, no-wrap
-msgid "B<-S> I<LOGICAL-SECTOR-SIZE>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:138
-msgid ""
-"Specify the number of bytes per logical sector.  Must be a power of 2 and "
-"greater than or equal to 512, i.e. 512, 1024, 2048, 4096, 8192, 16384, or "
-"32768."
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:140
-msgid "Verbose execution."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:140
-#, no-wrap
-msgid "B<--invariant>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:146
-msgid ""
-"Use constants for normally randomly generated or time based data such as "
-"volume ID and creation time.  Multiple runs of B<mkfs.fat> on the same "
-"device create identical results with this option.  Its main purpose is "
-"testing B<mkfs.fat>."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:146
-#, no-wrap
-msgid "B<--help>"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/mkfs.fat.8:149
-msgid "Display option summary and exit."
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/mkfs.fat.8:155
-msgid ""
-"B<mkfs.fat> can not create boot-able filesystems.  This isn't as easy as you "
-"might think at first glance for various reasons and has been discussed a lot "
-"already.  B<mkfs.fat> simply will not support it ;)"
-msgstr ""
diff --git a/manpages/po4a.cfg b/manpages/po4a.cfg
deleted file mode 100644 (file)
index 5d16f63..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-[po4a_langs] de
-[po4a_paths] pot/$master.pot $lang:po/$lang/$master.po
-[type: man] en/fatlabel.8 $lang:$lang/fatlabel.$lang.8
-[type: man] en/fsck.fat.8 $lang:$lang/fsck.fat.$lang.8
-[type: man] en/mkfs.fat.8 $lang:$lang/mkfs.fat.$lang.8
diff --git a/manpages/pot/fatlabel.8.pot b/manpages/pot/fatlabel.8.pot
deleted file mode 100644 (file)
index 2eafa05..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-# SOME DESCRIPTIVE TITLE
-# Copyright (C) YEAR Free Software Foundation, Inc.
-# This file is distributed under the same license as the dosfstools package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: dosfstools VERSION\n"
-"POT-Creation-Date: 2015-05-16 00:40+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. type: TH
-#: en/fatlabel.8:22
-#, no-wrap
-msgid "FATLABEL"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "2015-05-16"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "3.0.28"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "dosfstools"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:23 en/fsck.fat.8:23 en/mkfs.fat.8:23
-#, no-wrap
-msgid "NAME"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:26
-msgid "B<fatlabel> - set or get MS-DOS filesystem label"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:26 en/fsck.fat.8:26 en/mkfs.fat.8:26
-#, no-wrap
-msgid "SYNOPSIS"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:29
-msgid "B<fatlabel> I<DEVICE> [I<LABEL>]"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:29 en/fsck.fat.8:29 en/mkfs.fat.8:29
-#, no-wrap
-msgid "DESCRIPTION"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:31
-msgid "B<fatlabel> set or gets a MS-DOS filesystem label from a given device."
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:36
-msgid ""
-"If I<LABEL> is omitted, then the label name of the specified device is "
-"written on the standard output.  A label can't be longer than 11 bytes."
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:36 en/fsck.fat.8:99 en/mkfs.fat.8:36
-#, no-wrap
-msgid "OPTIONS"
-msgstr ""
-
-#. type: IP
-#: en/fatlabel.8:37
-#, no-wrap
-msgid "B<-h>, B<--help>"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:39
-msgid "Displays a help message."
-msgstr ""
-
-#. type: IP
-#: en/fatlabel.8:39
-#, no-wrap
-msgid "B<-V>, B<--version>"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:42
-msgid "Shows version."
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:42 en/fsck.fat.8:183 en/mkfs.fat.8:155
-#, no-wrap
-msgid "SEE ALSO"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:44 en/mkfs.fat.8:160
-msgid "B<fsck.fat>(8)"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:47 en/fsck.fat.8:188
-msgid "B<mkfs.fat>(8)"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:47 en/fsck.fat.8:188 en/mkfs.fat.8:160
-#, no-wrap
-msgid "HOMEPAGE"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-msgid ""
-"The home for the B<dosfstools> project is its E<.UR https://github.com/"
-"dosfstools/dosfstools> GitHub project page E<.UE .>"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-#, no-wrap
-msgid "AUTHORS"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:55 en/fsck.fat.8:196 en/mkfs.fat.8:168
-msgid "B<dosfstools> were written by"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:57 en/fsck.fat.8:198 en/mkfs.fat.8:170
-msgid "Werner Almesberger"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:60 en/fsck.fat.8:201 en/mkfs.fat.8:173
-msgid "Roman Hodek"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:63 en/fsck.fat.8:204 en/mkfs.fat.8:176
-msgid "and others.  The current maintainer is"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:65 en/fsck.fat.8:206 en/mkfs.fat.8:178
-msgid "Andreas Bombe"
-msgstr ""
diff --git a/manpages/pot/fsck.fat.8.pot b/manpages/pot/fsck.fat.8.pot
deleted file mode 100644 (file)
index 65ef52a..0000000
+++ /dev/null
@@ -1,562 +0,0 @@
-# SOME DESCRIPTIVE TITLE
-# Copyright (C) YEAR Free Software Foundation, Inc.
-# This file is distributed under the same license as the dosfstools package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: dosfstools VERSION\n"
-"POT-Creation-Date: 2015-05-16 00:40+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "2015-05-16"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "3.0.28"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "dosfstools"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:23 en/fsck.fat.8:23 en/mkfs.fat.8:23
-#, no-wrap
-msgid "NAME"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:26 en/fsck.fat.8:26 en/mkfs.fat.8:26
-#, no-wrap
-msgid "SYNOPSIS"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:29 en/fsck.fat.8:29 en/mkfs.fat.8:29
-#, no-wrap
-msgid "DESCRIPTION"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:36 en/fsck.fat.8:99 en/mkfs.fat.8:36
-#, no-wrap
-msgid "OPTIONS"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:42 en/fsck.fat.8:183 en/mkfs.fat.8:155
-#, no-wrap
-msgid "SEE ALSO"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:47 en/fsck.fat.8:188
-msgid "B<mkfs.fat>(8)"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:47 en/fsck.fat.8:188 en/mkfs.fat.8:160
-#, no-wrap
-msgid "HOMEPAGE"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-msgid ""
-"The home for the B<dosfstools> project is its E<.UR https://github.com/"
-"dosfstools/dosfstools> GitHub project page E<.UE .>"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-#, no-wrap
-msgid "AUTHORS"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:55 en/fsck.fat.8:196 en/mkfs.fat.8:168
-msgid "B<dosfstools> were written by"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:57 en/fsck.fat.8:198 en/mkfs.fat.8:170
-msgid "Werner Almesberger"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:60 en/fsck.fat.8:201 en/mkfs.fat.8:173
-msgid "Roman Hodek"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:63 en/fsck.fat.8:204 en/mkfs.fat.8:176
-msgid "and others.  The current maintainer is"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:65 en/fsck.fat.8:206 en/mkfs.fat.8:178
-msgid "Andreas Bombe"
-msgstr ""
-
-#. type: TH
-#: en/fsck.fat.8:22
-#, no-wrap
-msgid "FSCK.FAT"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:26
-msgid "B<fsck.fat> - check and repair MS-DOS filesystems"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:29
-msgid "B<fsck.fat> [I<OPTIONS>] I<DEVICE>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:32
-msgid ""
-"B<fsck.fat> verifies the consistency of MS-DOS filesystems and optionally "
-"tries to repair them."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:34
-msgid "The following filesystem problems can be corrected (in this order):"
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:34 en/fsck.fat.8:37 en/fsck.fat.8:40 en/fsck.fat.8:44
-#: en/fsck.fat.8:47 en/fsck.fat.8:50 en/fsck.fat.8:53 en/fsck.fat.8:56
-#: en/fsck.fat.8:59 en/fsck.fat.8:62 en/fsck.fat.8:65 en/fsck.fat.8:68
-#: en/fsck.fat.8:71 en/fsck.fat.8:74 en/fsck.fat.8:77 en/fsck.fat.8:82
-#: en/fsck.fat.8:85 en/fsck.fat.8:90 en/fsck.fat.8:92
-#, no-wrap
-msgid "*"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:37
-msgid "FAT contains invalid cluster numbers.  Cluster is changed to EOF."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:40
-msgid "File's cluster chain contains a loop.  The loop is broken."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:44
-msgid ""
-"Bad clusters (read errors).  The clusters are marked bad and they are "
-"removed from files owning them.  This check is optional."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:47
-msgid ""
-"Directories with a large number of bad entries (probably corrupt).  The "
-"directory can be deleted."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:50
-msgid "Files . and .. are non-directories.  They can be deleted or renamed."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:53
-msgid "Directories . and .. in root directory.  They are deleted."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:56
-msgid "Bad filenames.  They can be renamed."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:59
-msgid "Duplicate directory entries.  They can be deleted or renamed."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:62
-msgid "Directories with non-zero size field.  Size is set to zero."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:65
-msgid ""
-"Directory . does not point to parent directory.  The start pointer is "
-"adjusted."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:68
-msgid ""
-"Directory .. does not point to parent of parent directory.  The start "
-"pointer is adjusted."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:71
-msgid "Start cluster number of a file is invalid.  The file is truncated."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:74
-msgid "File contains bad or free clusters.  The file is truncated."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:77
-msgid ""
-"File's cluster chain is longer than indicated by the size fields.  The file "
-"is truncated."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:82
-msgid ""
-"Two or more files share the same cluster(s).  All but one of the files are "
-"truncated.  If the file being truncated is a directory file that has already "
-"been read, the filesystem check is restarted after truncation."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:85
-msgid ""
-"File's cluster chain is shorter than indicated by the size fields.  The file "
-"is truncated."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:88
-msgid ""
-"Clusters are marked as used but are not owned by a file.  They are marked as "
-"free."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:90
-msgid "Additionally, the following problems are detected, but not repaired:"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:92
-msgid "Invalid parameters in boot sector"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:94
-msgid "Absence of . and .. entries in non-root directories"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:99
-msgid ""
-"When B<fsck.fat> checks a filesystem, it accumulates all changes in memory "
-"and performs them only after all checks are complete.  This can be disabled "
-"with the B<-w> option."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:100 en/mkfs.fat.8:37
-#, no-wrap
-msgid "B<-a>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:105
-msgid ""
-"Automatically repair the filesystem.  No user intervention is necessary.  "
-"Whenever there is more than one method to solve a problem, the least "
-"destructive approach is used."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:105
-#, no-wrap
-msgid "B<-A>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:116
-msgid ""
-"Use Atari variation of the MS-DOS filesystem.  This is default if B<fsck."
-"fat> is run on an Atari, then this option turns off Atari format.  There are "
-"some minor differences in Atari format: Some boot sector fields are "
-"interpreted slightly different, and the special FAT entries for end-of-file "
-"and bad cluster can be different.  Under MS-DOS 0xfff8 is used for EOF and "
-"Atari employs 0xffff by default, but both systems recognize all values from "
-"0xfff8...0xffff as end-of-file.  MS-DOS uses only 0xfff7 for bad clusters, "
-"where on Atari values 0xfff0...0xfff7 are for this purpose (but the standard "
-"value is still 0xfff7)."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:116
-#, no-wrap
-msgid "B<-b>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:118
-msgid "Make read-only boot sector check."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:118
-#, no-wrap
-msgid "B<-d> I<PATH>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:122
-msgid ""
-"Delete the specified file.  If more than one file with that name exist, the "
-"first one is deleted.  This option can be given more than once."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:122
-#, no-wrap
-msgid "B<-f>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:126
-msgid ""
-"Salvage unused cluster chains to files.  By default, unused clusters are "
-"added to the free disk space except in auto mode (B<-a>)."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:126
-#, no-wrap
-msgid "B<-l>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:128
-msgid "List path names of files being processed."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:128
-#, no-wrap
-msgid "B<-n>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:131
-msgid ""
-"No-operation mode: non-interactively check for errors, but don't write "
-"anything to the filesystem."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:131
-#, no-wrap
-msgid "B<-p>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:133
-msgid "Same as B<-a>, for compatibility with other *fsck."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:133
-#, no-wrap
-msgid "B<-r>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:139
-msgid ""
-"Interactively repair the filesystem.  The user is asked for advice whenever "
-"there is more than one approach to fix an inconsistency.  This is the "
-"default mode and the option is only retained for backwards compatibility."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:139
-#, no-wrap
-msgid "B<-t>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:141
-msgid "Mark unreadable clusters as bad."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:141
-#, no-wrap
-msgid "B<-u> I<PATH>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:146
-msgid ""
-"Try to undelete the specified file.  B<fsck.fat> tries to allocate a chain "
-"of contiguous unallocated clusters beginning with the start cluster of the "
-"undeleted file.  This option can be given more than once."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:146 en/mkfs.fat.8:138
-#, no-wrap
-msgid "B<-v>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:149
-msgid "Verbose mode.  Generates slightly more output."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:149
-#, no-wrap
-msgid "B<-V>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:156
-msgid ""
-"Perform a verification pass.  The filesystem check is repeated after the "
-"first run.  The second pass should never report any fixable errors.  It may "
-"take considerably longer than the first pass, because the first pass may "
-"have generated long list of modifications that have to be scanned for each "
-"disk read."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:156
-#, no-wrap
-msgid "B<-w>"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:158
-msgid "Write changes to disk immediately."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:158
-#, no-wrap
-msgid "B<-y>"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:162
-msgid ""
-"Same as B<-a> (automatically repair filesystem) for compatibility with other "
-"fsck tools."
-msgstr ""
-
-#. type: SH
-#: en/fsck.fat.8:162
-#, no-wrap
-msgid "EXIT STATUS"
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:163
-#, no-wrap
-msgid "0"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:165
-msgid "No recoverable errors have been detected."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:165
-#, no-wrap
-msgid "1"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:168
-msgid ""
-"Recoverable errors have been detected or B<fsck.fat> has discovered an "
-"internal inconsistency."
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:168
-#, no-wrap
-msgid "2"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:172
-msgid "Usage error.  B<fsck.fat> did not access the filesystem."
-msgstr ""
-
-#. type: SH
-#: en/fsck.fat.8:172
-#, no-wrap
-msgid "FILES"
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:173
-#, no-wrap
-msgid "fsck0000.rec, fsck0001.rec, ..."
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:177
-msgid ""
-"When recovering from a corrupted filesystem, B<fsck.fat> dumps recovered "
-"data into files named 'fsckNNNN.rec' in the top level directory of the "
-"filesystem."
-msgstr ""
-
-#. type: SH
-#: en/fsck.fat.8:177 en/mkfs.fat.8:149
-#, no-wrap
-msgid "BUGS"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fsck.fat.8:183
-msgid ""
-"Does not create . and .. files where necessary.  Does not remove entirely "
-"empty directories.  Should give more diagnostic messages.  Undeleting files "
-"should use a more sophisticated algorithm."
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:185 en/mkfs.fat.8:157
-msgid "B<fatlabel>(8)"
-msgstr ""
diff --git a/manpages/pot/mkfs.fat.8.pot b/manpages/pot/mkfs.fat.8.pot
deleted file mode 100644 (file)
index c9d5bba..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-# SOME DESCRIPTIVE TITLE
-# Copyright (C) YEAR Free Software Foundation, Inc.
-# This file is distributed under the same license as the dosfstools package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: dosfstools VERSION\n"
-"POT-Creation-Date: 2015-05-16 00:40+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "2015-05-16"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "3.0.28"
-msgstr ""
-
-#. type: TH
-#: en/fatlabel.8:22 en/fsck.fat.8:22 en/mkfs.fat.8:22
-#, no-wrap
-msgid "dosfstools"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:23 en/fsck.fat.8:23 en/mkfs.fat.8:23
-#, no-wrap
-msgid "NAME"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:26 en/fsck.fat.8:26 en/mkfs.fat.8:26
-#, no-wrap
-msgid "SYNOPSIS"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:29 en/fsck.fat.8:29 en/mkfs.fat.8:29
-#, no-wrap
-msgid "DESCRIPTION"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:36 en/fsck.fat.8:99 en/mkfs.fat.8:36
-#, no-wrap
-msgid "OPTIONS"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:42 en/fsck.fat.8:183 en/mkfs.fat.8:155
-#, no-wrap
-msgid "SEE ALSO"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:44 en/mkfs.fat.8:160
-msgid "B<fsck.fat>(8)"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:47 en/fsck.fat.8:188 en/mkfs.fat.8:160
-#, no-wrap
-msgid "HOMEPAGE"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-msgid ""
-"The home for the B<dosfstools> project is its E<.UR https://github.com/"
-"dosfstools/dosfstools> GitHub project page E<.UE .>"
-msgstr ""
-
-#. type: SH
-#: en/fatlabel.8:53 en/fsck.fat.8:194 en/mkfs.fat.8:166
-#, no-wrap
-msgid "AUTHORS"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:55 en/fsck.fat.8:196 en/mkfs.fat.8:168
-msgid "B<dosfstools> were written by"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:57 en/fsck.fat.8:198 en/mkfs.fat.8:170
-msgid "Werner Almesberger"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:60 en/fsck.fat.8:201 en/mkfs.fat.8:173
-msgid "Roman Hodek"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:63 en/fsck.fat.8:204 en/mkfs.fat.8:176
-msgid "and others.  The current maintainer is"
-msgstr ""
-
-#. type: Plain text
-#: en/fatlabel.8:65 en/fsck.fat.8:206 en/mkfs.fat.8:178
-msgid "Andreas Bombe"
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:100 en/mkfs.fat.8:37
-#, no-wrap
-msgid "B<-a>"
-msgstr ""
-
-#. type: IP
-#: en/fsck.fat.8:146 en/mkfs.fat.8:138
-#, no-wrap
-msgid "B<-v>"
-msgstr ""
-
-#. type: SH
-#: en/fsck.fat.8:177 en/mkfs.fat.8:149
-#, no-wrap
-msgid "BUGS"
-msgstr ""
-
-#. type: Plain text
-#: en/fsck.fat.8:185 en/mkfs.fat.8:157
-msgid "B<fatlabel>(8)"
-msgstr ""
-
-#. type: TH
-#: en/mkfs.fat.8:22
-#, no-wrap
-msgid "MKFS.FAT"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/mkfs.fat.8:26
-msgid "B<mkfs.fat> - create an MS-DOS filesystem under Linux"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/mkfs.fat.8:29
-msgid "B<mkfs.fat> [I<OPTIONS>] I<DEVICE> [I<BLOCK-COUNT>]"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/mkfs.fat.8:36
-msgid ""
-"B<mkfs.fat> is used to create an MS-DOS filesystem under Linux on a device "
-"(usually a disk partition).  I<DEVICE> is the special file corresponding to "
-"the device (e.g. /dev/sdXX).  I<BLOCK-COUNT> is the number of blocks on the "
-"device.  If omitted, B<mkfs.fat> automatically determines the filesystem "
-"size."
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:45
-msgid ""
-"Normally, for any filesystem except very small ones, B<mkfs.fat> will align "
-"all the data structures to cluster size, to make sure that as long as the "
-"partition is properly aligned, so will all the data structures in the "
-"filesystem.  This option disables alignment; this may provide a handful of "
-"additional clusters of storage at the expense of a significant performance "
-"degradation on RAIDs, flash media or large-sector hard disks."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:45
-#, no-wrap
-msgid "B< -A>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:60
-msgid ""
-"Use Atari variation of the MS-DOS filesystem.  This is default if B<mkfs."
-"fat> is run on an Atari, then this option turns off Atari format.  There are "
-"some differences when using Atari format: If not directed otherwise by the "
-"user, B<mkfs.fat> will always use 2 sectors per cluster, since GEMDOS "
-"doesn't like other values very much.  It will also obey the maximum number "
-"of sectors GEMDOS can handle.  Larger filesystems are managed by raising the "
-"logical sector size.  Under Atari format, an Atari-compatible serial number "
-"for the filesystem is generated, and a 12 bit FAT is used only for "
-"filesystems that have one of the usual floppy sizes (720k, 1.2M, 1.44M, "
-"2.88M), a 16 bit FAT otherwise.  This can be overridden with the B<-F> "
-"option.  Some PC-specific boot sector fields aren't written, and a boot "
-"message (option B<-m>) is ignored."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:60
-#, no-wrap
-msgid "B<-b> I<SECTOR-OF-BACKUP>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:64
-msgid ""
-"Selects the location of the backup boot sector for FAT32.  Default depends "
-"on number of reserved sectors, but usually is sector 6.  The backup must be "
-"within the range of reserved sectors."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:64
-#, no-wrap
-msgid "B<-c>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:66
-msgid "Check the device for bad blocks before creating the filesystem."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:66
-#, no-wrap
-msgid "B<-C>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:80
-msgid ""
-"Create the file given as I<DEVICE> on the command line, and write the to-be-"
-"created filesystem to it.  This can be used to create the new filesystem in "
-"a file instead of on a real device, and to avoid using B<dd> in advance to "
-"create a file of appropriate size.  With this option, the I<BLOCK-COUNT> "
-"must be given, because otherwise the intended size of the filesystem "
-"wouldn't be known.  The file created is a sparse file, which actually only "
-"contains the meta-data areas (boot sector, FATs, and root directory).  The "
-"data portions won't be stored on the disk, but the file nevertheless will "
-"have the correct size.  The resulting file can be copied later to a floppy "
-"disk or other device, or mounted through a loop device."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:80
-#, no-wrap
-msgid "B<-D> I<DRIVE-NUMBER>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:84
-msgid ""
-"Specify the BIOS drive number to be stored in the FAT boot sector.  This "
-"value is usually 0x80 for hard disks and 0x00 for floppy devices or "
-"partitions to be used for floppy emulation."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:84
-#, no-wrap
-msgid "B<-f> I<NUMBER-OF-FATS>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:87
-msgid ""
-"Specify the number of file allocation tables in the filesystem.  The default "
-"is 2."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:87
-#, no-wrap
-msgid "B<-F> I<FAT-SIZE>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:91
-msgid ""
-"Specifies the type of file allocation tables used (12, 16 or 32 bit).  If "
-"nothing is specified, B<mkfs.fat> will automatically select between 12, 16 "
-"and 32 bit, whatever fits better for the filesystem size."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:91
-#, no-wrap
-msgid "B<-h> I<NUMBER-OF-HIDDEN-SECTORS>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:95
-msgid ""
-"Select the number of hidden sectors in the volume.  Apparently some digital "
-"cameras get indigestion if you feed them a CF card without such hidden "
-"sectors, this option allows you to satisfy them."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:95
-#, no-wrap
-msgid "B<-i> I<VOLUME-ID>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:99
-msgid ""
-"Sets the volume ID of the newly created filesystem; I<VOLUME-ID> is a 32-bit "
-"hexadecimal number (for example, 2e24ec82).  The default is a number which "
-"depends on the filesystem creation time."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:99
-#, no-wrap
-msgid "B<-I>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:108
-msgid ""
-"It is typical for fixed disk devices to be partitioned so, by default, you "
-"are not permitted to create a filesystem across the entire device.  B<mkfs."
-"fat> will complain and tell you that it refuses to work.  This is different "
-"when using MO disks.  One doesn't always need partitions on MO disks.  The "
-"filesystem can go directly to the whole disk.  Under other OSes this is "
-"known as the 'superfloppy' format.  This switch will force B<mkfs.fat> to "
-"work properly."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:108
-#, no-wrap
-msgid "B<-l> I<FILENAME>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:110
-msgid "Read the bad blocks list from I<FILENAME>."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:110
-#, no-wrap
-msgid "B<-m> I<MESSAGE-FILE>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:116
-msgid ""
-"Sets the message the user receives on attempts to boot this filesystem "
-"without having properly installed an operating system.  The message file "
-"must not exceed 418 bytes once line feeds have been converted to carriage "
-"return-line feed combinations, and tabs have been expanded.  If the filename "
-"is a hyphen (-), the text is taken from standard input."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:116
-#, no-wrap
-msgid "B<-M> I<FAT-MEDIA-TYPE>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:120
-msgid ""
-"Specify the media type to be stored in the FAT boot sector.  This value is "
-"usually 0xF8 for hard disks and is 0xF0 or a value from 0xF9 to 0xFF for "
-"floppies or partitions to be used for floppy emulation."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:120
-#, no-wrap
-msgid "B<-n> I<VOLUME-NAME>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:124
-msgid ""
-"Sets the volume name (label) of the filesystem.  The volume name can be up "
-"to 11 characters long.  The default is no label."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:124
-#, no-wrap
-msgid "B<-r> I<ROOT-DIR-ENTRIES>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:127
-msgid ""
-"Select the number of entries available in the root directory.  The default "
-"is 112 or 224 for floppies and 512 for hard disks."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:127
-#, no-wrap
-msgid "B<-R> I<NUMBER-OF-RESERVED-SECTORS>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:131
-msgid ""
-"Select the number of reserved sectors.  With FAT32 format at least 2 "
-"reserved sectors are needed, the default is 32.  Otherwise the default is 1 "
-"(only the boot sector)."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:131
-#, no-wrap
-msgid "B<-s> I<SECTORS-PER-CLUSTER>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:134
-msgid ""
-"Specify the number of disk sectors per cluster.  Must be a power of 2, i.e. "
-"1, 2, 4, 8, ... 128."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:134
-#, no-wrap
-msgid "B<-S> I<LOGICAL-SECTOR-SIZE>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:138
-msgid ""
-"Specify the number of bytes per logical sector.  Must be a power of 2 and "
-"greater than or equal to 512, i.e. 512, 1024, 2048, 4096, 8192, 16384, or "
-"32768."
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:140
-msgid "Verbose execution."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:140
-#, no-wrap
-msgid "B<--invariant>"
-msgstr ""
-
-#. type: Plain text
-#: en/mkfs.fat.8:146
-msgid ""
-"Use constants for normally randomly generated or time based data such as "
-"volume ID and creation time.  Multiple runs of B<mkfs.fat> on the same "
-"device create identical results with this option.  Its main purpose is "
-"testing B<mkfs.fat>."
-msgstr ""
-
-#. type: IP
-#: en/mkfs.fat.8:146
-#, no-wrap
-msgid "B<--help>"
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/mkfs.fat.8:149
-msgid "Display option summary and exit."
-msgstr ""
-
-#.  ----------------------------------------------------------------------------
-#. type: Plain text
-#: en/mkfs.fat.8:155
-msgid ""
-"B<mkfs.fat> can not create boot-able filesystems.  This isn't as easy as you "
-"might think at first glance for various reasons and has been discussed a lot "
-"already.  B<mkfs.fat> simply will not support it ;)"
-msgstr ""
diff --git a/missing b/missing
new file mode 100755 (executable)
index 0000000..625aeb1
--- /dev/null
+++ b/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 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, 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 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.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try '$0 --help' for more information"
+  exit 1
+fi
+
+case $1 in
+
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
+
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+
+Supported PROGRAM values:
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: unknown '$1' option"
+    echo 1>&2 "Try '$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
+
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'autom4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
+    ;;
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
index a15e6e7..a389046 100644 (file)
@@ -19,27 +19,33 @@ AM_CFLAGS = -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers \
 
 sbin_PROGRAMS = fsck.fat mkfs.fat fatlabel
 noinst_PROGRAMS = testdevinfo
+EXTRA_DIST = blkdev/README
 
-fscklabel_common_sources = boot.c boot.h check.c check.h common.c common.h \
-                          fat.c fat.h file.c file.h io.c io.h lfn.c lfn.h \
-                          charconv.c charconv.h msdos_fs.h \
+charconv_common_sources = charconv.c charconv.h
+charconv_common_ldadd = $(LIBICONV)
+fscklabel_common_sources = boot.c boot.h common.c common.h \
+                          fat.c fat.h io.c io.h msdos_fs.h \
+                          $(charconv_common_sources) \
                           fsck.fat.h endian_compat.h
-fsck_fat_SOURCES = fsck.fat.c $(fscklabel_common_sources)
+fsck_fat_SOURCES = check.c check.h file.c file.h fsck.fat.c \
+                  lfn.c lfn.h \
+                  $(fscklabel_common_sources)
+fsck_fat_LDADD = $(charconv_common_ldadd)
 fatlabel_SOURCES = fatlabel.c $(fscklabel_common_sources)
+fatlabel_LDADD = $(charconv_common_ldadd)
 
-mkfs_common_sources = device_info.c device_info.h \
-                     blkdev/blkdev.c blkdev/blkdev.h \
-                     endian_compat.h \
-                     blkdev/linux_version.c blkdev/linux_version.h
-mkfs_fat_SOURCES  = mkfs.fat.c msdos_fs.h $(mkfs_common_sources)
+devinfo_common_sources = device_info.c device_info.h \
+                        blkdev/blkdev.c blkdev/blkdev.h \
+                        blkdev/linux_version.c blkdev/linux_version.h
+mkfs_fat_SOURCES  = mkfs.fat.c msdos_fs.h common.c common.h endian_compat.h \
+                   $(charconv_common_sources) $(devinfo_common_sources)
 mkfs_fat_CPPFLAGS = -I$(srcdir)/blkdev
-mkfs_fat_CFLAGS   = $(AM_CFLAGS) $(UDEV_CFLAGS)
-mkfs_fat_LDADD    = $(UDEV_LIBS)
+mkfs_fat_CFLAGS   = $(AM_CFLAGS)
+mkfs_fat_LDADD    = $(charconv_common_ldadd)
 
-testdevinfo_SOURCES  = testdevinfo.c $(mkfs_common_sources)
+testdevinfo_SOURCES  = testdevinfo.c $(devinfo_common_sources)
 testdevinfo_CPPFLAGS = -I$(srcdir)/blkdev
-testdevinfo_CFLAGS   = $(AM_CFLAGS) $(UDEV_CFLAGS)
-testdevinfo_LDADD    = $(UDEV_LIBS)
+testdevinfo_CFLAGS   = $(AM_CFLAGS)
 
 
 if COMPAT_SYMLINKS
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644 (file)
index 0000000..c429ac0
--- /dev/null
@@ -0,0 +1,939 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in 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.
+
+@SET_MAKE@
+
+# dosfstools src/Makefile.am
+# Copyright (C) 2015  Andreas Bombe <aeb@debian.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 <http://www.gnu.org/licenses/>.
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+sbin_PROGRAMS = fsck.fat$(EXEEXT) mkfs.fat$(EXEEXT) fatlabel$(EXEEXT)
+noinst_PROGRAMS = testdevinfo$(EXEEXT)
+subdir = src
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES = version.h
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(sbindir)"
+PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
+am__objects_1 = charconv.$(OBJEXT)
+am__objects_2 = boot.$(OBJEXT) common.$(OBJEXT) fat.$(OBJEXT) \
+       io.$(OBJEXT) $(am__objects_1)
+am_fatlabel_OBJECTS = fatlabel.$(OBJEXT) $(am__objects_2)
+fatlabel_OBJECTS = $(am_fatlabel_OBJECTS)
+am__DEPENDENCIES_1 =
+am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
+fatlabel_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_fsck_fat_OBJECTS = check.$(OBJEXT) file.$(OBJEXT) \
+       fsck.fat.$(OBJEXT) lfn.$(OBJEXT) $(am__objects_2)
+fsck_fat_OBJECTS = $(am_fsck_fat_OBJECTS)
+fsck_fat_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am__objects_3 = mkfs_fat-charconv.$(OBJEXT)
+am__dirstamp = $(am__leading_dot)dirstamp
+am__objects_4 = mkfs_fat-device_info.$(OBJEXT) \
+       blkdev/mkfs_fat-blkdev.$(OBJEXT) \
+       blkdev/mkfs_fat-linux_version.$(OBJEXT)
+am_mkfs_fat_OBJECTS = mkfs_fat-mkfs.fat.$(OBJEXT) \
+       mkfs_fat-common.$(OBJEXT) $(am__objects_3) $(am__objects_4)
+mkfs_fat_OBJECTS = $(am_mkfs_fat_OBJECTS)
+mkfs_fat_DEPENDENCIES = $(am__DEPENDENCIES_2)
+mkfs_fat_LINK = $(CCLD) $(mkfs_fat_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
+am__objects_5 = testdevinfo-device_info.$(OBJEXT) \
+       blkdev/testdevinfo-blkdev.$(OBJEXT) \
+       blkdev/testdevinfo-linux_version.$(OBJEXT)
+am_testdevinfo_OBJECTS = testdevinfo-testdevinfo.$(OBJEXT) \
+       $(am__objects_5)
+testdevinfo_OBJECTS = $(am_testdevinfo_OBJECTS)
+testdevinfo_LDADD = $(LDADD)
+testdevinfo_LINK = $(CCLD) $(testdevinfo_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/boot.Po ./$(DEPDIR)/charconv.Po \
+       ./$(DEPDIR)/check.Po ./$(DEPDIR)/common.Po ./$(DEPDIR)/fat.Po \
+       ./$(DEPDIR)/fatlabel.Po ./$(DEPDIR)/file.Po \
+       ./$(DEPDIR)/fsck.fat.Po ./$(DEPDIR)/io.Po ./$(DEPDIR)/lfn.Po \
+       ./$(DEPDIR)/mkfs_fat-charconv.Po \
+       ./$(DEPDIR)/mkfs_fat-common.Po \
+       ./$(DEPDIR)/mkfs_fat-device_info.Po \
+       ./$(DEPDIR)/mkfs_fat-mkfs.fat.Po \
+       ./$(DEPDIR)/testdevinfo-device_info.Po \
+       ./$(DEPDIR)/testdevinfo-testdevinfo.Po \
+       blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po \
+       blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po \
+       blkdev/$(DEPDIR)/testdevinfo-blkdev.Po \
+       blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
+am__mv = mv -f
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(fatlabel_SOURCES) $(fsck_fat_SOURCES) $(mkfs_fat_SOURCES) \
+       $(testdevinfo_SOURCES)
+DIST_SOURCES = $(fatlabel_SOURCES) $(fsck_fat_SOURCES) \
+       $(mkfs_fat_SOURCES) $(testdevinfo_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/version.h.in \
+       $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECKATARI = @CHECKATARI@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RELEASE_DATE = @RELEASE_DATE@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XXD_FOUND = @XXD_FOUND@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CFLAGS = -Wall -Wextra -Wno-sign-compare -Wno-missing-field-initializers \
+           -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings
+
+EXTRA_DIST = blkdev/README
+charconv_common_sources = charconv.c charconv.h
+charconv_common_ldadd = $(LIBICONV)
+fscklabel_common_sources = boot.c boot.h common.c common.h \
+                          fat.c fat.h io.c io.h msdos_fs.h \
+                          $(charconv_common_sources) \
+                          fsck.fat.h endian_compat.h
+
+fsck_fat_SOURCES = check.c check.h file.c file.h fsck.fat.c \
+                  lfn.c lfn.h \
+                  $(fscklabel_common_sources)
+
+fsck_fat_LDADD = $(charconv_common_ldadd)
+fatlabel_SOURCES = fatlabel.c $(fscklabel_common_sources)
+fatlabel_LDADD = $(charconv_common_ldadd)
+devinfo_common_sources = device_info.c device_info.h \
+                        blkdev/blkdev.c blkdev/blkdev.h \
+                        blkdev/linux_version.c blkdev/linux_version.h
+
+mkfs_fat_SOURCES = mkfs.fat.c msdos_fs.h common.c common.h endian_compat.h \
+                   $(charconv_common_sources) $(devinfo_common_sources)
+
+mkfs_fat_CPPFLAGS = -I$(srcdir)/blkdev
+mkfs_fat_CFLAGS = $(AM_CFLAGS)
+mkfs_fat_LDADD = $(charconv_common_ldadd)
+testdevinfo_SOURCES = testdevinfo.c $(devinfo_common_sources)
+testdevinfo_CPPFLAGS = -I$(srcdir)/blkdev
+testdevinfo_CFLAGS = $(AM_CFLAGS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign src/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+version.h: $(top_builddir)/config.status $(srcdir)/version.h.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+clean-noinstPROGRAMS:
+       -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
+       fi; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p \
+         ; then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' \
+           -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+             echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+             $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-sbinPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+       -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
+
+fatlabel$(EXEEXT): $(fatlabel_OBJECTS) $(fatlabel_DEPENDENCIES) $(EXTRA_fatlabel_DEPENDENCIES) 
+       @rm -f fatlabel$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(fatlabel_OBJECTS) $(fatlabel_LDADD) $(LIBS)
+
+fsck.fat$(EXEEXT): $(fsck_fat_OBJECTS) $(fsck_fat_DEPENDENCIES) $(EXTRA_fsck_fat_DEPENDENCIES) 
+       @rm -f fsck.fat$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(fsck_fat_OBJECTS) $(fsck_fat_LDADD) $(LIBS)
+blkdev/$(am__dirstamp):
+       @$(MKDIR_P) blkdev
+       @: > blkdev/$(am__dirstamp)
+blkdev/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) blkdev/$(DEPDIR)
+       @: > blkdev/$(DEPDIR)/$(am__dirstamp)
+blkdev/mkfs_fat-blkdev.$(OBJEXT): blkdev/$(am__dirstamp) \
+       blkdev/$(DEPDIR)/$(am__dirstamp)
+blkdev/mkfs_fat-linux_version.$(OBJEXT): blkdev/$(am__dirstamp) \
+       blkdev/$(DEPDIR)/$(am__dirstamp)
+
+mkfs.fat$(EXEEXT): $(mkfs_fat_OBJECTS) $(mkfs_fat_DEPENDENCIES) $(EXTRA_mkfs_fat_DEPENDENCIES) 
+       @rm -f mkfs.fat$(EXEEXT)
+       $(AM_V_CCLD)$(mkfs_fat_LINK) $(mkfs_fat_OBJECTS) $(mkfs_fat_LDADD) $(LIBS)
+blkdev/testdevinfo-blkdev.$(OBJEXT): blkdev/$(am__dirstamp) \
+       blkdev/$(DEPDIR)/$(am__dirstamp)
+blkdev/testdevinfo-linux_version.$(OBJEXT): blkdev/$(am__dirstamp) \
+       blkdev/$(DEPDIR)/$(am__dirstamp)
+
+testdevinfo$(EXEEXT): $(testdevinfo_OBJECTS) $(testdevinfo_DEPENDENCIES) $(EXTRA_testdevinfo_DEPENDENCIES) 
+       @rm -f testdevinfo$(EXEEXT)
+       $(AM_V_CCLD)$(testdevinfo_LINK) $(testdevinfo_OBJECTS) $(testdevinfo_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+       -rm -f blkdev/*.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/boot.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/charconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fatlabel.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsck.fat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lfn.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-charconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-common.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-device_info.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkfs_fat-mkfs.fat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdevinfo-device_info.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdevinfo-testdevinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/testdevinfo-blkdev.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@blkdev/$(DEPDIR)/testdevinfo-linux_version.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+mkfs_fat-mkfs.fat.o: mkfs.fat.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-mkfs.fat.o -MD -MP -MF $(DEPDIR)/mkfs_fat-mkfs.fat.Tpo -c -o mkfs_fat-mkfs.fat.o `test -f 'mkfs.fat.c' || echo '$(srcdir)/'`mkfs.fat.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-mkfs.fat.Tpo $(DEPDIR)/mkfs_fat-mkfs.fat.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mkfs.fat.c' object='mkfs_fat-mkfs.fat.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-mkfs.fat.o `test -f 'mkfs.fat.c' || echo '$(srcdir)/'`mkfs.fat.c
+
+mkfs_fat-mkfs.fat.obj: mkfs.fat.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-mkfs.fat.obj -MD -MP -MF $(DEPDIR)/mkfs_fat-mkfs.fat.Tpo -c -o mkfs_fat-mkfs.fat.obj `if test -f 'mkfs.fat.c'; then $(CYGPATH_W) 'mkfs.fat.c'; else $(CYGPATH_W) '$(srcdir)/mkfs.fat.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-mkfs.fat.Tpo $(DEPDIR)/mkfs_fat-mkfs.fat.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='mkfs.fat.c' object='mkfs_fat-mkfs.fat.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-mkfs.fat.obj `if test -f 'mkfs.fat.c'; then $(CYGPATH_W) 'mkfs.fat.c'; else $(CYGPATH_W) '$(srcdir)/mkfs.fat.c'; fi`
+
+mkfs_fat-common.o: common.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-common.o -MD -MP -MF $(DEPDIR)/mkfs_fat-common.Tpo -c -o mkfs_fat-common.o `test -f 'common.c' || echo '$(srcdir)/'`common.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-common.Tpo $(DEPDIR)/mkfs_fat-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='common.c' object='mkfs_fat-common.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-common.o `test -f 'common.c' || echo '$(srcdir)/'`common.c
+
+mkfs_fat-common.obj: common.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-common.obj -MD -MP -MF $(DEPDIR)/mkfs_fat-common.Tpo -c -o mkfs_fat-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-common.Tpo $(DEPDIR)/mkfs_fat-common.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='common.c' object='mkfs_fat-common.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi`
+
+mkfs_fat-charconv.o: charconv.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-charconv.o -MD -MP -MF $(DEPDIR)/mkfs_fat-charconv.Tpo -c -o mkfs_fat-charconv.o `test -f 'charconv.c' || echo '$(srcdir)/'`charconv.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-charconv.Tpo $(DEPDIR)/mkfs_fat-charconv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='charconv.c' object='mkfs_fat-charconv.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-charconv.o `test -f 'charconv.c' || echo '$(srcdir)/'`charconv.c
+
+mkfs_fat-charconv.obj: charconv.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-charconv.obj -MD -MP -MF $(DEPDIR)/mkfs_fat-charconv.Tpo -c -o mkfs_fat-charconv.obj `if test -f 'charconv.c'; then $(CYGPATH_W) 'charconv.c'; else $(CYGPATH_W) '$(srcdir)/charconv.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-charconv.Tpo $(DEPDIR)/mkfs_fat-charconv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='charconv.c' object='mkfs_fat-charconv.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-charconv.obj `if test -f 'charconv.c'; then $(CYGPATH_W) 'charconv.c'; else $(CYGPATH_W) '$(srcdir)/charconv.c'; fi`
+
+mkfs_fat-device_info.o: device_info.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-device_info.o -MD -MP -MF $(DEPDIR)/mkfs_fat-device_info.Tpo -c -o mkfs_fat-device_info.o `test -f 'device_info.c' || echo '$(srcdir)/'`device_info.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-device_info.Tpo $(DEPDIR)/mkfs_fat-device_info.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='device_info.c' object='mkfs_fat-device_info.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-device_info.o `test -f 'device_info.c' || echo '$(srcdir)/'`device_info.c
+
+mkfs_fat-device_info.obj: device_info.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT mkfs_fat-device_info.obj -MD -MP -MF $(DEPDIR)/mkfs_fat-device_info.Tpo -c -o mkfs_fat-device_info.obj `if test -f 'device_info.c'; then $(CYGPATH_W) 'device_info.c'; else $(CYGPATH_W) '$(srcdir)/device_info.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/mkfs_fat-device_info.Tpo $(DEPDIR)/mkfs_fat-device_info.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='device_info.c' object='mkfs_fat-device_info.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o mkfs_fat-device_info.obj `if test -f 'device_info.c'; then $(CYGPATH_W) 'device_info.c'; else $(CYGPATH_W) '$(srcdir)/device_info.c'; fi`
+
+blkdev/mkfs_fat-blkdev.o: blkdev/blkdev.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT blkdev/mkfs_fat-blkdev.o -MD -MP -MF blkdev/$(DEPDIR)/mkfs_fat-blkdev.Tpo -c -o blkdev/mkfs_fat-blkdev.o `test -f 'blkdev/blkdev.c' || echo '$(srcdir)/'`blkdev/blkdev.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/mkfs_fat-blkdev.Tpo blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='blkdev/blkdev.c' object='blkdev/mkfs_fat-blkdev.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o blkdev/mkfs_fat-blkdev.o `test -f 'blkdev/blkdev.c' || echo '$(srcdir)/'`blkdev/blkdev.c
+
+blkdev/mkfs_fat-blkdev.obj: blkdev/blkdev.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT blkdev/mkfs_fat-blkdev.obj -MD -MP -MF blkdev/$(DEPDIR)/mkfs_fat-blkdev.Tpo -c -o blkdev/mkfs_fat-blkdev.obj `if test -f 'blkdev/blkdev.c'; then $(CYGPATH_W) 'blkdev/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/blkdev.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/mkfs_fat-blkdev.Tpo blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='blkdev/blkdev.c' object='blkdev/mkfs_fat-blkdev.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o blkdev/mkfs_fat-blkdev.obj `if test -f 'blkdev/blkdev.c'; then $(CYGPATH_W) 'blkdev/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/blkdev.c'; fi`
+
+blkdev/mkfs_fat-linux_version.o: blkdev/linux_version.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT blkdev/mkfs_fat-linux_version.o -MD -MP -MF blkdev/$(DEPDIR)/mkfs_fat-linux_version.Tpo -c -o blkdev/mkfs_fat-linux_version.o `test -f 'blkdev/linux_version.c' || echo '$(srcdir)/'`blkdev/linux_version.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/mkfs_fat-linux_version.Tpo blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='blkdev/linux_version.c' object='blkdev/mkfs_fat-linux_version.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o blkdev/mkfs_fat-linux_version.o `test -f 'blkdev/linux_version.c' || echo '$(srcdir)/'`blkdev/linux_version.c
+
+blkdev/mkfs_fat-linux_version.obj: blkdev/linux_version.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -MT blkdev/mkfs_fat-linux_version.obj -MD -MP -MF blkdev/$(DEPDIR)/mkfs_fat-linux_version.Tpo -c -o blkdev/mkfs_fat-linux_version.obj `if test -f 'blkdev/linux_version.c'; then $(CYGPATH_W) 'blkdev/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/linux_version.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/mkfs_fat-linux_version.Tpo blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='blkdev/linux_version.c' object='blkdev/mkfs_fat-linux_version.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mkfs_fat_CPPFLAGS) $(CPPFLAGS) $(mkfs_fat_CFLAGS) $(CFLAGS) -c -o blkdev/mkfs_fat-linux_version.obj `if test -f 'blkdev/linux_version.c'; then $(CYGPATH_W) 'blkdev/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/linux_version.c'; fi`
+
+testdevinfo-testdevinfo.o: testdevinfo.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT testdevinfo-testdevinfo.o -MD -MP -MF $(DEPDIR)/testdevinfo-testdevinfo.Tpo -c -o testdevinfo-testdevinfo.o `test -f 'testdevinfo.c' || echo '$(srcdir)/'`testdevinfo.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/testdevinfo-testdevinfo.Tpo $(DEPDIR)/testdevinfo-testdevinfo.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='testdevinfo.c' object='testdevinfo-testdevinfo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o testdevinfo-testdevinfo.o `test -f 'testdevinfo.c' || echo '$(srcdir)/'`testdevinfo.c
+
+testdevinfo-testdevinfo.obj: testdevinfo.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT testdevinfo-testdevinfo.obj -MD -MP -MF $(DEPDIR)/testdevinfo-testdevinfo.Tpo -c -o testdevinfo-testdevinfo.obj `if test -f 'testdevinfo.c'; then $(CYGPATH_W) 'testdevinfo.c'; else $(CYGPATH_W) '$(srcdir)/testdevinfo.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/testdevinfo-testdevinfo.Tpo $(DEPDIR)/testdevinfo-testdevinfo.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='testdevinfo.c' object='testdevinfo-testdevinfo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o testdevinfo-testdevinfo.obj `if test -f 'testdevinfo.c'; then $(CYGPATH_W) 'testdevinfo.c'; else $(CYGPATH_W) '$(srcdir)/testdevinfo.c'; fi`
+
+testdevinfo-device_info.o: device_info.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT testdevinfo-device_info.o -MD -MP -MF $(DEPDIR)/testdevinfo-device_info.Tpo -c -o testdevinfo-device_info.o `test -f 'device_info.c' || echo '$(srcdir)/'`device_info.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/testdevinfo-device_info.Tpo $(DEPDIR)/testdevinfo-device_info.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='device_info.c' object='testdevinfo-device_info.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o testdevinfo-device_info.o `test -f 'device_info.c' || echo '$(srcdir)/'`device_info.c
+
+testdevinfo-device_info.obj: device_info.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT testdevinfo-device_info.obj -MD -MP -MF $(DEPDIR)/testdevinfo-device_info.Tpo -c -o testdevinfo-device_info.obj `if test -f 'device_info.c'; then $(CYGPATH_W) 'device_info.c'; else $(CYGPATH_W) '$(srcdir)/device_info.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/testdevinfo-device_info.Tpo $(DEPDIR)/testdevinfo-device_info.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='device_info.c' object='testdevinfo-device_info.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o testdevinfo-device_info.obj `if test -f 'device_info.c'; then $(CYGPATH_W) 'device_info.c'; else $(CYGPATH_W) '$(srcdir)/device_info.c'; fi`
+
+blkdev/testdevinfo-blkdev.o: blkdev/blkdev.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT blkdev/testdevinfo-blkdev.o -MD -MP -MF blkdev/$(DEPDIR)/testdevinfo-blkdev.Tpo -c -o blkdev/testdevinfo-blkdev.o `test -f 'blkdev/blkdev.c' || echo '$(srcdir)/'`blkdev/blkdev.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/testdevinfo-blkdev.Tpo blkdev/$(DEPDIR)/testdevinfo-blkdev.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='blkdev/blkdev.c' object='blkdev/testdevinfo-blkdev.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o blkdev/testdevinfo-blkdev.o `test -f 'blkdev/blkdev.c' || echo '$(srcdir)/'`blkdev/blkdev.c
+
+blkdev/testdevinfo-blkdev.obj: blkdev/blkdev.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT blkdev/testdevinfo-blkdev.obj -MD -MP -MF blkdev/$(DEPDIR)/testdevinfo-blkdev.Tpo -c -o blkdev/testdevinfo-blkdev.obj `if test -f 'blkdev/blkdev.c'; then $(CYGPATH_W) 'blkdev/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/blkdev.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/testdevinfo-blkdev.Tpo blkdev/$(DEPDIR)/testdevinfo-blkdev.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='blkdev/blkdev.c' object='blkdev/testdevinfo-blkdev.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o blkdev/testdevinfo-blkdev.obj `if test -f 'blkdev/blkdev.c'; then $(CYGPATH_W) 'blkdev/blkdev.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/blkdev.c'; fi`
+
+blkdev/testdevinfo-linux_version.o: blkdev/linux_version.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT blkdev/testdevinfo-linux_version.o -MD -MP -MF blkdev/$(DEPDIR)/testdevinfo-linux_version.Tpo -c -o blkdev/testdevinfo-linux_version.o `test -f 'blkdev/linux_version.c' || echo '$(srcdir)/'`blkdev/linux_version.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/testdevinfo-linux_version.Tpo blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='blkdev/linux_version.c' object='blkdev/testdevinfo-linux_version.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o blkdev/testdevinfo-linux_version.o `test -f 'blkdev/linux_version.c' || echo '$(srcdir)/'`blkdev/linux_version.c
+
+blkdev/testdevinfo-linux_version.obj: blkdev/linux_version.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -MT blkdev/testdevinfo-linux_version.obj -MD -MP -MF blkdev/$(DEPDIR)/testdevinfo-linux_version.Tpo -c -o blkdev/testdevinfo-linux_version.obj `if test -f 'blkdev/linux_version.c'; then $(CYGPATH_W) 'blkdev/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/linux_version.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) blkdev/$(DEPDIR)/testdevinfo-linux_version.Tpo blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='blkdev/linux_version.c' object='blkdev/testdevinfo-linux_version.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(testdevinfo_CPPFLAGS) $(CPPFLAGS) $(testdevinfo_CFLAGS) $(CFLAGS) -c -o blkdev/testdevinfo-linux_version.obj `if test -f 'blkdev/linux_version.c'; then $(CYGPATH_W) 'blkdev/linux_version.c'; else $(CYGPATH_W) '$(srcdir)/blkdev/linux_version.c'; fi`
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       $(am__define_uniq_tagged_files); \
+       test -z "$(CTAGS_ARGS)$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && $(am__cd) $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+       list='$(am__tagged_files)'; \
+       case "$(srcdir)" in \
+         [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+         *) sdir=$(subdir)/$(srcdir) ;; \
+       esac; \
+       for i in $$list; do \
+         if test -f "$$i"; then \
+           echo "$(subdir)/$$i"; \
+         else \
+           echo "$$sdir/$$i"; \
+         fi; \
+       done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+       for dir in "$(DESTDIR)$(sbindir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+       -rm -f blkdev/$(DEPDIR)/$(am__dirstamp)
+       -rm -f blkdev/$(am__dirstamp)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+@COMPAT_SYMLINKS_FALSE@install-exec-hook:
+@COMPAT_SYMLINKS_FALSE@uninstall-hook:
+clean: clean-am
+
+clean-am: clean-generic clean-noinstPROGRAMS clean-sbinPROGRAMS \
+       mostlyclean-am
+
+distclean: distclean-am
+               -rm -f ./$(DEPDIR)/boot.Po
+       -rm -f ./$(DEPDIR)/charconv.Po
+       -rm -f ./$(DEPDIR)/check.Po
+       -rm -f ./$(DEPDIR)/common.Po
+       -rm -f ./$(DEPDIR)/fat.Po
+       -rm -f ./$(DEPDIR)/fatlabel.Po
+       -rm -f ./$(DEPDIR)/file.Po
+       -rm -f ./$(DEPDIR)/fsck.fat.Po
+       -rm -f ./$(DEPDIR)/io.Po
+       -rm -f ./$(DEPDIR)/lfn.Po
+       -rm -f ./$(DEPDIR)/mkfs_fat-charconv.Po
+       -rm -f ./$(DEPDIR)/mkfs_fat-common.Po
+       -rm -f ./$(DEPDIR)/mkfs_fat-device_info.Po
+       -rm -f ./$(DEPDIR)/mkfs_fat-mkfs.fat.Po
+       -rm -f ./$(DEPDIR)/testdevinfo-device_info.Po
+       -rm -f ./$(DEPDIR)/testdevinfo-testdevinfo.Po
+       -rm -f blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po
+       -rm -f blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po
+       -rm -f blkdev/$(DEPDIR)/testdevinfo-blkdev.Po
+       -rm -f blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-sbinPROGRAMS
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+               -rm -f ./$(DEPDIR)/boot.Po
+       -rm -f ./$(DEPDIR)/charconv.Po
+       -rm -f ./$(DEPDIR)/check.Po
+       -rm -f ./$(DEPDIR)/common.Po
+       -rm -f ./$(DEPDIR)/fat.Po
+       -rm -f ./$(DEPDIR)/fatlabel.Po
+       -rm -f ./$(DEPDIR)/file.Po
+       -rm -f ./$(DEPDIR)/fsck.fat.Po
+       -rm -f ./$(DEPDIR)/io.Po
+       -rm -f ./$(DEPDIR)/lfn.Po
+       -rm -f ./$(DEPDIR)/mkfs_fat-charconv.Po
+       -rm -f ./$(DEPDIR)/mkfs_fat-common.Po
+       -rm -f ./$(DEPDIR)/mkfs_fat-device_info.Po
+       -rm -f ./$(DEPDIR)/mkfs_fat-mkfs.fat.Po
+       -rm -f ./$(DEPDIR)/testdevinfo-device_info.Po
+       -rm -f ./$(DEPDIR)/testdevinfo-testdevinfo.Po
+       -rm -f blkdev/$(DEPDIR)/mkfs_fat-blkdev.Po
+       -rm -f blkdev/$(DEPDIR)/mkfs_fat-linux_version.Po
+       -rm -f blkdev/$(DEPDIR)/testdevinfo-blkdev.Po
+       -rm -f blkdev/$(DEPDIR)/testdevinfo-linux_version.Po
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-sbinPROGRAMS
+       @$(NORMAL_INSTALL)
+       $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
+.MAKE: install-am install-exec-am install-strip uninstall-am
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+       clean-generic clean-noinstPROGRAMS clean-sbinPROGRAMS \
+       cscopelist-am ctags ctags-am distclean distclean-compile \
+       distclean-generic distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-exec-hook install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
+       install-strip installcheck installcheck-am installdirs \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+       tags tags-am uninstall uninstall-am uninstall-hook \
+       uninstall-sbinPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+@COMPAT_SYMLINKS_TRUE@install-exec-hook:
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f fatlabel dosfslabel
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat dosfsck
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat fsck.msdos
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f fsck.fat fsck.vfat
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkdosfs
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkfs.msdos
+@COMPAT_SYMLINKS_TRUE@ cd $(DESTDIR)$(sbindir) && $(LN_S) -f mkfs.fat mkfs.vfat
+
+@COMPAT_SYMLINKS_TRUE@uninstall-hook:
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/dosfslabel
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/dosfsck
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/fsck.msdos
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/fsck.vfat
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/mkdosfs
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/mkfs.msdos
+@COMPAT_SYMLINKS_TRUE@ $(RM) $(DESTDIR)$(sbindir)/mkfs.vfat
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
index ae9c8d1..d97a4b3 100644 (file)
@@ -7,8 +7,11 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
+#include <sys/sysmacros.h>
 #include <unistd.h>
 #include <stdint.h>
+#include <stdio.h>
+#include <limits.h>
 
 #ifdef HAVE_LINUX_HDREG_H
 #include <linux/hdreg.h>
@@ -317,17 +320,37 @@ int blkdev_get_geometry(int fd, unsigned int *h, unsigned int *s)
 /*
  * Get start offset of partition
  */
-int blkdev_get_start(int fd, unsigned int *s)
+int blkdev_get_start(int fd, dev_t rdev, unsigned long long *s)
 {
+#ifdef __linux__
+       {
+               char path[PATH_MAX];
+               FILE *file;
+               int ret;
+
+               snprintf(path, sizeof(path), "/sys/dev/block/%d:%d/start", major(rdev), minor(rdev));
+               file = fopen(path, "r");
+               if (file) {
+                       ret = fscanf(file, "%llu", s);
+                       fclose(file);
+                       if (ret == 1)
+                               return 0;
+               }
+       }
+#endif
+
 #ifdef HDIO_GETGEO
+       {
        struct hd_geometry geometry;
 
        if (ioctl(fd, HDIO_GETGEO, &geometry) == 0) {
                *s = geometry.start;
                return 0;
        }
+       }
 #endif
 
+       (void)rdev; /* prevent unused parameter warning */
        (void)fd; /* prevent unused parameter warning */
        *s = 0;
        return -1;
index b9179ad..b3d42fc 100644 (file)
@@ -122,7 +122,7 @@ int blkdev_is_cdrom(int fd);
 int blkdev_get_geometry(int fd, unsigned int *h, unsigned int *s);
 
 /* get partition devices start offset */
-int blkdev_get_start(int fd, unsigned int *s);
+int blkdev_get_start(int fd, dev_t rdev, unsigned long long *s);
 
 /* SCSI device types.  Copied almost as-is from kernel header.
  * http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/scsi/scsi.h */
index 58b4286..4de450d 100644 (file)
@@ -3,7 +3,8 @@
    Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
    Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
    Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
-   Copyright (C) 2015 Andreas Bombe <aeb@debian.org>
+   Copyright (C) 2015-2017 Andreas Bombe <aeb@debian.org>
+   Copyright (C) 2018-2021 Pali Rohár <pali.rohar@gmail.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
@@ -25,6 +26,7 @@
 /* FAT32, VFAT, Atari format support, and various fixes additions May 1998
  * by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
 
+#include <limits.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <string.h>
@@ -38,6 +40,7 @@
 #include "io.h"
 #include "boot.h"
 #include "check.h"
+#include "charconv.h"
 
 #define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0)
     /* don't divide by zero */
 #define FAT12_THRESHOLD  4085
 #define FAT16_THRESHOLD 65525
 
+off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name)
+{
+    static int curr_num = 0;
+    off_t offset;
+
+    if (fs->root_cluster) {
+       DIR_ENT d2;
+       int i = 0, got = 0;
+       uint32_t clu_num, prev = 0;
+       off_t offset2;
+
+       clu_num = fs->root_cluster;
+       offset = cluster_start(fs, clu_num);
+       while (clu_num > 0 && clu_num != -1) {
+           fs_read(offset, sizeof(DIR_ENT), &d2);
+           if (IS_FREE(d2.name) && d2.attr != VFAT_LN_ATTR) {
+               got = 1;
+               break;
+           }
+           i += sizeof(DIR_ENT);
+           offset += sizeof(DIR_ENT);
+           if ((i % fs->cluster_size) == 0) {
+               prev = clu_num;
+               if ((clu_num = next_cluster(fs, clu_num)) == 0 || clu_num == -1)
+                   break;
+               offset = cluster_start(fs, clu_num);
+           }
+       }
+       if (!got) {
+           /* no free slot, need to extend root dir: alloc next free cluster
+            * after previous one */
+           if (!prev)
+               die("Root directory has no cluster allocated!");
+           for (clu_num = prev + 1; clu_num != prev; clu_num++) {
+               FAT_ENTRY entry;
+
+               if (clu_num >= fs->data_clusters + 2)
+                   clu_num = 2;
+               get_fat(&entry, fs->fat, clu_num, fs);
+               if (!entry.value)
+                   break;
+           }
+           if (clu_num == prev)
+               die("Root directory full and no free cluster");
+           set_fat(fs, prev, clu_num);
+           set_fat(fs, clu_num, -1);
+           set_owner(fs, clu_num, get_owner(fs, fs->root_cluster));
+           /* clear new cluster */
+           memset(&d2, 0, sizeof(d2));
+           offset = cluster_start(fs, clu_num);
+           for (i = 0; i < fs->cluster_size; i += sizeof(DIR_ENT))
+               fs_write(offset + i, sizeof(d2), &d2);
+       }
+       memset(de, 0, sizeof(DIR_ENT));
+       if (gen_name) {
+           while (1) {
+               char expanded[12];
+               sprintf(expanded, pattern, curr_num);
+               memcpy(de->name, expanded, MSDOS_NAME);
+               clu_num = fs->root_cluster;
+               i = 0;
+               offset2 = cluster_start(fs, clu_num);
+               while (clu_num > 0 && clu_num != -1) {
+                   fs_read(offset2, sizeof(DIR_ENT), &d2);
+                   if (offset2 != offset &&
+                       !strncmp((const char *)d2.name, (const char *)de->name,
+                                MSDOS_NAME))
+                       break;
+                   i += sizeof(DIR_ENT);
+                   offset2 += sizeof(DIR_ENT);
+                   if ((i % fs->cluster_size) == 0) {
+                       if ((clu_num = next_cluster(fs, clu_num)) == 0 ||
+                           clu_num == -1)
+                           break;
+                       offset2 = cluster_start(fs, clu_num);
+                   }
+               }
+               if (clu_num == 0 || clu_num == -1)
+                   break;
+               if (++curr_num >= 10000)
+                   die("Unable to create unique name");
+           }
+       } else {
+           memcpy(de->name, pattern, MSDOS_NAME);
+       }
+    } else {
+       DIR_ENT *root;
+       int next_free = 0, scan;
+
+       root = alloc(fs->root_entries * sizeof(DIR_ENT));
+       fs_read(fs->root_start, fs->root_entries * sizeof(DIR_ENT), root);
+
+       while (next_free < fs->root_entries)
+           if (IS_FREE(root[next_free].name) &&
+               root[next_free].attr != VFAT_LN_ATTR)
+               break;
+           else
+               next_free++;
+       if (next_free == fs->root_entries)
+           die("Root directory is full.");
+       offset = fs->root_start + next_free * sizeof(DIR_ENT);
+       memset(de, 0, sizeof(DIR_ENT));
+       if (gen_name) {
+           while (1) {
+               char expanded[12];
+               sprintf(expanded, pattern, curr_num);
+               memcpy(de->name, expanded, MSDOS_NAME);
+               for (scan = 0; scan < fs->root_entries; scan++)
+                   if (scan != next_free &&
+                       !strncmp((const char *)root[scan].name,
+                                (const char *)de->name, MSDOS_NAME))
+                       break;
+               if (scan == fs->root_entries)
+                   break;
+               if (++curr_num >= 10000)
+                   die("Unable to create unique name");
+           }
+       } else {
+           memcpy(de->name, pattern, MSDOS_NAME);
+       }
+       free(root);
+    }
+    ++n_files;
+    return offset;
+}
+
 static struct {
     uint8_t media;
     const char *descr;
@@ -103,8 +232,8 @@ static void dump_boot(DOS_FS * fs, struct boot_sector *b, unsigned lss)
           (unsigned long long)fs->fat_start,
           (unsigned long long)fs->fat_start / lss);
     printf("%10d FATs, %d bit entries\n", b->fats, fs->fat_bits);
-    printf("%10lld bytes per FAT (= %llu sectors)\n", (long long)fs->fat_size,
-          (long long)fs->fat_size / lss);
+    printf("%10u bytes per FAT (= %u sectors)\n", fs->fat_size,
+          fs->fat_size / lss);
     if (!fs->root_cluster) {
        printf("Root directory starts at byte %llu (sector %llu)\n",
               (unsigned long long)fs->root_start,
@@ -140,11 +269,10 @@ static void check_backup_boot(DOS_FS * fs, struct boot_sector *b, unsigned int l
            printf("And there is no space for creating one!\n");
            return;
        }
-       if (interactive)
-           printf("1) Create one\n2) Do without a backup\n");
-       else
-           printf("  Auto-creating backup boot block.\n");
-       if (!interactive || get_key("12", "?") == '1') {
+       if (get_choice(1, "  Auto-creating backup boot block.",
+                      2,
+                      1, "Create one",
+                      2, "Do without a backup") == 1) {
            unsigned int bbs;
            /* The usual place for the backup boot sector is sector 6. Choose
             * that or the last reserved sector. */
@@ -171,7 +299,7 @@ static void check_backup_boot(DOS_FS * fs, struct boot_sector *b, unsigned int l
        /* there are any differences */
        uint8_t *p, *q;
        int i, pos, first = 1;
-       char buf[20];
+       char buf[32];
 
        printf("There are differences between boot sector and its backup.\n");
        printf("This is mostly harmless. Differences: (offset:original/backup)\n  ");
@@ -190,16 +318,15 @@ static void check_backup_boot(DOS_FS * fs, struct boot_sector *b, unsigned int l
        }
        printf("\n");
 
-       if (interactive)
-           printf("1) Copy original to backup\n"
-                  "2) Copy backup to original\n" "3) No action\n");
-       else
-           printf("  Not automatically fixing this.\n");
-       switch (interactive ? get_key("123", "?") : '3') {
-       case '1':
+       switch (get_choice(3, "  Not automatically fixing this.",
+                          3,
+                          1, "Copy original to backup",
+                          2, "Copy backup to original",
+                          3, "No action")) {
+       case 1:
            fs_write(fs->backupboot_start, sizeof(*b), b);
            break;
-       case '2':
+       case 2:
            fs_write(0, sizeof(b2), &b2);
            break;
        default:
@@ -208,9 +335,8 @@ static void check_backup_boot(DOS_FS * fs, struct boot_sector *b, unsigned int l
     }
 }
 
-static void init_fsinfo(struct info_sector *i)
+static void init_fsinfo_except_reserved(struct info_sector *i)
 {
-    memset(i, 0, sizeof (struct info_sector));
     i->magic = htole32(0x41615252);
     i->signature = htole32(0x61417272);
     i->free_clusters = htole32(-1);
@@ -224,11 +350,10 @@ static void read_fsinfo(DOS_FS * fs, struct boot_sector *b, unsigned int lss)
 
     if (!b->info_sector) {
        printf("No FSINFO sector\n");
-       if (interactive)
-           printf("1) Create one\n2) Do without FSINFO\n");
-       else
-           printf("  Not automatically creating it.\n");
-       if (interactive && get_key("12", "?") == '1') {
+       if (get_choice(2, "  Not automatically creating it.",
+                      2,
+                      1, "Create one",
+                      2, "Do without FSINFO") == 1) {
            /* search for a free reserved sector (not boot sector and not
             * backup boot sector) */
            uint32_t s;
@@ -236,7 +361,8 @@ static void read_fsinfo(DOS_FS * fs, struct boot_sector *b, unsigned int lss)
                if (s != le16toh(b->backup_boot))
                    break;
            if (s > 0 && s < le16toh(b->reserved)) {
-               init_fsinfo(&i);
+               memset(&i, 0, sizeof (struct info_sector));
+               init_fsinfo_except_reserved(&i);
                fs_write((off_t)s * lss, sizeof(i), &i);
                b->info_sector = htole16(s);
                fs_write(offsetof(struct boot_sector, info_sector),
@@ -272,12 +398,11 @@ static void read_fsinfo(DOS_FS * fs, struct boot_sector *b, unsigned int lss)
            printf("  Offset %llu: 0x%08x != expected 0x%08x\n",
                   (unsigned long long)offsetof(struct info_sector, boot_sign),
                   le32toh(i.boot_sign), 0xaa550000);
-       if (interactive)
-           printf("1) Correct\n2) Don't correct (FSINFO invalid then)\n");
-       else
-           printf("  Auto-correcting it.\n");
-       if (!interactive || get_key("12", "?") == '1') {
-           init_fsinfo(&i);
+       if (get_choice(1, "  Auto-correcting it.",
+                      2,
+                      1, "Correct",
+                      2, "Don't correct (FSINFO invalid then)") == 1) {
+           init_fsinfo_except_reserved(&i);
            fs_write(fs->fsinfo_start, sizeof(i), &i);
        } else
            fs->fsinfo_start = 0;
@@ -287,52 +412,15 @@ static void read_fsinfo(DOS_FS * fs, struct boot_sector *b, unsigned int lss)
        fs->free_clusters = le32toh(i.free_clusters);
 }
 
-static char print_fat_dirty_state(void)
-{
-    printf("Dirty bit is set. Fs was not properly unmounted and"
-          " some data may be corrupt.\n");
-
-    if (interactive) {
-       printf("1) Remove dirty bit\n" "2) No action\n");
-       return get_key("12", "?");
-    } else
-       printf(" Automatically removing dirty bit.\n");
-    return '1';
-}
-
-static void check_fat_state_bit(DOS_FS * fs, void *b)
-{
-    if (fs->fat_bits == 32) {
-       struct boot_sector *b32 = b;
-
-       if (b32->reserved3 & FAT_STATE_DIRTY) {
-           printf("0x41: ");
-           if (print_fat_dirty_state() == '1') {
-               b32->reserved3 &= ~FAT_STATE_DIRTY;
-               fs_write(0, sizeof(*b32), b32);
-           }
-       }
-    } else {
-       struct boot_sector_16 *b16 = b;
-
-       if (b16->reserved2 & FAT_STATE_DIRTY) {
-           printf("0x25: ");
-           if (print_fat_dirty_state() == '1') {
-               b16->reserved2 &= ~FAT_STATE_DIRTY;
-               fs_write(0, sizeof(*b16), b16);
-           }
-       }
-    }
-}
-
 void read_boot(DOS_FS * fs)
 {
     struct boot_sector b;
     unsigned total_sectors;
     unsigned int logical_sector_size, sectors;
-    off_t fat_length;
+    long long fat_length;
     unsigned total_fat_entries;
     off_t data_size;
+    long long position;
 
     fs_read(0, sizeof(b), &b);
     logical_sector_size = GET_UNALIGNED_W(b.sector_size);
@@ -343,7 +431,7 @@ void read_boot(DOS_FS * fs)
     /* if the platform needs special handling of unaligned multibyte accesses */
     /* but such handling isn't being provided. See GET_UNALIGNED_W() above. */
     if (logical_sector_size & (SECTOR_SIZE - 1))
-       die("Logical sector size (%d bytes) is not a multiple of the physical "
+       die("Logical sector size (%u bytes) is not a multiple of the physical "
            "sector size.", logical_sector_size);
 
     fs->cluster_size = b.cluster_size * logical_sector_size;
@@ -357,8 +445,11 @@ void read_boot(DOS_FS * fs)
     if (verbose)
        printf("Checking we can access the last sector of the filesystem\n");
     /* Can't access last odd sector anyway, so round down */
-    fs_test((off_t)((total_sectors & ~1) - 1) * logical_sector_size,
-           logical_sector_size);
+    position = (long long)((total_sectors & ~1) - 1) * logical_sector_size;
+    if (position > OFF_MAX)
+       die("Filesystem is too large.");
+    if (!fs_test(position, logical_sector_size))
+       die("Failed to read sector %u.", (total_sectors & ~1) - 1);
 
     fat_length = le16toh(b.fat_length) ?
        le16toh(b.fat_length) : le32toh(b.fat32_length);
@@ -366,14 +457,22 @@ void read_boot(DOS_FS * fs)
        die("FAT size is zero.");
 
     fs->fat_start = (off_t)le16toh(b.reserved) * logical_sector_size;
-    fs->root_start = ((off_t)le16toh(b.reserved) + b.fats * fat_length) *
+    position = (le16toh(b.reserved) + b.fats * fat_length) *
        logical_sector_size;
+    if (position > OFF_MAX)
+       die("Filesystem is too large.");
+    fs->root_start = position;
     fs->root_entries = GET_UNALIGNED_W(b.dir_entries);
-    fs->data_start = fs->root_start + ROUND_TO_MULTIPLE(fs->root_entries <<
-                                                       MSDOS_DIR_BITS,
-                                                       logical_sector_size);
-
-    data_size = (off_t)total_sectors * logical_sector_size - fs->data_start;
+    position = (long long)fs->root_start +
+                         ROUND_TO_MULTIPLE(fs->root_entries << MSDOS_DIR_BITS,
+                                           logical_sector_size);
+    if (position > OFF_MAX)
+       die("Filesystem is too large.");
+    fs->data_start = position;
+    position = (long long)total_sectors * logical_sector_size - fs->data_start;
+    if (position > OFF_MAX)
+       die("Filesystem is too large.");
+    data_size = position;
     if (data_size < fs->cluster_size)
        die("Filesystem has no space for any data clusters");
 
@@ -390,23 +489,22 @@ void read_boot(DOS_FS * fs)
             * (root_entries != 0), we handle the root dir the old way. Give a
             * warning, but convertig to a root dir in a cluster chain seems
             * to complex for now... */
-           printf("Warning: FAT32 root dir not in cluster chain! "
+           fprintf(stderr, "Warning: FAT32 root dir not in cluster chain! "
                   "Compatibility mode...\n");
        else if (!fs->root_cluster && !fs->root_entries)
            die("No root directory!");
        else if (fs->root_cluster && fs->root_entries)
-           printf("Warning: FAT32 root dir is in a cluster chain, but "
+           fprintf(stderr, "Warning: FAT32 root dir is in a cluster chain, but "
                   "a separate root dir\n"
                   "  area is defined. Cannot fix this easily.\n");
        if (fs->data_clusters < FAT16_THRESHOLD)
-           printf("Warning: Filesystem is FAT32 according to fat_length "
+           fprintf(stderr, "Warning: Filesystem is FAT32 according to fat_length "
                   "and fat32_length fields,\n"
                   "  but has only %lu clusters, less than the required "
                   "minimum of %d.\n"
                   "  This may lead to problems on some systems.\n",
                   (unsigned long)fs->data_clusters, FAT16_THRESHOLD);
 
-       check_fat_state_bit(fs, &b);
        fs->backupboot_start = le16toh(b.backup_boot) * logical_sector_size;
        check_backup_boot(fs, &b, logical_sector_size);
 
@@ -418,7 +516,6 @@ void read_boot(DOS_FS * fs)
        if (fs->data_clusters >= FAT16_THRESHOLD)
            die("Too many clusters (%lu) for FAT16 filesystem.",
                    (unsigned long)fs->data_clusters);
-       check_fat_state_bit(fs, &b);
     } else {
        /* On Atari, things are more difficult: GEMDOS always uses 12bit FATs
         * on floppies, and always 16 bit on harddisks. */
@@ -433,23 +530,29 @@ void read_boot(DOS_FS * fs)
     }
     /* On FAT32, the high 4 bits of a FAT entry are reserved */
     fs->eff_fat_bits = (fs->fat_bits == 32) ? 28 : fs->fat_bits;
-    fs->fat_size = fat_length * logical_sector_size;
+    position = fat_length * logical_sector_size;
+    if (position > OFF_MAX)
+       die("Filesystem is too large.");
+    fs->fat_size = position;
 
-    fs->label = calloc(12, sizeof(uint8_t));
+    fs->label[0] = 0;
     if (fs->fat_bits == 12 || fs->fat_bits == 16) {
        struct boot_sector_16 *b16 = (struct boot_sector_16 *)&b;
-       if (b16->extended_sig == 0x29)
+       if (b16->extended_sig == 0x29) {
            memmove(fs->label, b16->label, 11);
-       else
-           fs->label = NULL;
+           fs->serial = b16->serial;
+       }
     } else if (fs->fat_bits == 32) {
-       if (b.extended_sig == 0x29)
+       if (b.extended_sig == 0x29) {
            memmove(fs->label, &b.label, 11);
-       else
-           fs->label = NULL;
+           fs->serial = b.serial;
+       }
     }
 
-    total_fat_entries = (uint64_t)fs->fat_size * 8 / fs->fat_bits;
+    position = (long long)fs->fat_size * 8 / fs->fat_bits;
+    if (position > UINT_MAX)
+       die("FAT has space for too many entries (%lld).", (long long)position);
+    total_fat_entries = position;
     if (fs->data_clusters > total_fat_entries - 2)
        die("Filesystem has %u clusters but only space for %u FAT entries.",
            fs->data_clusters, total_fat_entries - 2);
@@ -470,7 +573,8 @@ void read_boot(DOS_FS * fs)
        dump_boot(fs, &b, logical_sector_size);
 }
 
-static void write_boot_label(DOS_FS * fs, char *label)
+static void write_boot_label_or_serial(int label_mode, DOS_FS * fs,
+       const char *label, uint32_t serial)
 {
     if (fs->fat_bits == 12 || fs->fat_bits == 16) {
        struct boot_sector_16 b16;
@@ -479,10 +583,16 @@ static void write_boot_label(DOS_FS * fs, char *label)
        if (b16.extended_sig != 0x29) {
            b16.extended_sig = 0x29;
            b16.serial = 0;
+           memmove(b16.label, "NO NAME    ", 11);
            memmove(b16.fs_type, fs->fat_bits == 12 ? "FAT12   " : "FAT16   ",
                    8);
        }
-       memmove(b16.label, label, 11);
+
+       if (label_mode)
+           memmove(b16.label, label, 11);
+       else
+           b16.serial = serial;
+
        fs_write(0, sizeof(b16), &b16);
     } else if (fs->fat_bits == 32) {
        struct boot_sector b;
@@ -491,15 +601,31 @@ static void write_boot_label(DOS_FS * fs, char *label)
        if (b.extended_sig != 0x29) {
            b.extended_sig = 0x29;
            b.serial = 0;
+           memmove(b.label, "NO NAME    ", 11);
            memmove(b.fs_type, "FAT32   ", 8);
        }
-       memmove(b.label, label, 11);
+
+       if (label_mode)
+           memmove(b.label, label, 11);
+       else
+           b.serial = serial;
+
        fs_write(0, sizeof(b), &b);
        if (fs->backupboot_start)
            fs_write(fs->backupboot_start, sizeof(b), &b);
     }
 }
 
+void write_boot_label(DOS_FS * fs, const char *label)
+{
+    write_boot_label_or_serial(1, fs, label, 0);
+}
+
+void write_serial(DOS_FS * fs, uint32_t serial)
+{
+    write_boot_label_or_serial(0, fs, NULL, serial);
+}
+
 off_t find_volume_de(DOS_FS * fs, DIR_ENT * de)
 {
     uint32_t cluster;
@@ -513,7 +639,13 @@ off_t find_volume_de(DOS_FS * fs, DIR_ENT * de)
            offset = cluster_start(fs, cluster);
            for (i = 0; i * sizeof(DIR_ENT) < fs->cluster_size; i++) {
                fs_read(offset, sizeof(DIR_ENT), de);
-               if (de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME)
+
+               /* no point in scanning after end of directory marker */
+               if (!de->name[0])
+                   return 0;
+
+               if (!IS_FREE(de->name) &&
+                   de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME)
                    return offset;
                offset += sizeof(DIR_ENT);
            }
@@ -522,7 +654,13 @@ off_t find_volume_de(DOS_FS * fs, DIR_ENT * de)
        for (i = 0; i < fs->root_entries; i++) {
            offset = fs->root_start + i * sizeof(DIR_ENT);
            fs_read(offset, sizeof(DIR_ENT), de);
-           if (de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME)
+
+           /* no point in scanning after end of directory marker */
+           if (!de->name[0])
+               return 0;
+
+           if (!IS_FREE(de->name) &&
+               de->attr != VFAT_LN_ATTR && de->attr & ATTR_VOLUME)
                return offset;
        }
     }
@@ -530,10 +668,10 @@ off_t find_volume_de(DOS_FS * fs, DIR_ENT * de)
     return 0;
 }
 
-static void write_volume_label(DOS_FS * fs, char *label)
+void write_volume_label(DOS_FS * fs, char *label)
 {
-    time_t now = time(NULL);
-    struct tm *mtime = localtime(&now);
+    time_t now;
+    struct tm *mtime;
     off_t offset;
     int created;
     DIR_ENT de;
@@ -544,13 +682,25 @@ static void write_volume_label(DOS_FS * fs, char *label)
        created = 1;
        offset = alloc_rootdir_entry(fs, &de, label, 0);
     }
+
     memcpy(de.name, label, 11);
-    de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
-                                      (mtime->tm_min << 5) +
-                                      (mtime->tm_hour << 11)));
-    de.date = htole16((unsigned short)(mtime->tm_mday +
-                                      ((mtime->tm_mon + 1) << 5) +
-                                      ((mtime->tm_year - 80) << 9)));
+    if (de.name[0] == 0xe5)
+       de.name[0] = 0x05;
+
+    now = time(NULL);
+    mtime = (now != (time_t)-1) ? localtime(&now) : NULL;
+    if (mtime && mtime->tm_year >= 80 && mtime->tm_year <= 207) {
+       de.time = htole16((unsigned short)((mtime->tm_sec >> 1) +
+                                          (mtime->tm_min << 5) +
+                                          (mtime->tm_hour << 11)));
+       de.date = htole16((unsigned short)(mtime->tm_mday +
+                                        ((mtime->tm_mon + 1) << 5) +
+                                        ((mtime->tm_year - 80) << 9)));
+    } else {
+       /* fallback to 1.1.1980 00:00:00 */
+       de.time = htole16(0);
+       de.date = htole16(1 + (1 << 5));
+    }
     if (created) {
        de.attr = ATTR_VOLUME;
        de.ctime_ms = 0;
@@ -575,3 +725,43 @@ void write_label(DOS_FS * fs, char *label)
     write_boot_label(fs, label);
     write_volume_label(fs, label);
 }
+
+void remove_label(DOS_FS *fs)
+{
+    off_t offset;
+    DIR_ENT de;
+
+    write_boot_label(fs, "NO NAME    ");
+
+    offset = find_volume_de(fs, &de);
+    if (offset) {
+       /* mark entry as deleted */
+       de.name[0] = 0xe5;
+       /* remove ATTR_VOLUME for compatibility with older fatlabel version
+        * which ignores above deletion mark for entries with ATTR_VOLUME */
+       de.attr = 0;
+       fs_write(offset, sizeof(DIR_ENT), &de);
+    }
+}
+
+const char *pretty_label(const char *label)
+{
+    static char buffer[256];
+    char *p;
+    int i;
+    int last;
+
+    for (last = 10; last >= 0; last--) {
+        if (label[last] != ' ')
+            break;
+    }
+
+    p = buffer;
+    for (i = 0; i <= last && label[i] && p < buffer + sizeof(buffer) - 1; ++i) {
+        if (!dos_char_to_printable(&p, label[i], buffer + sizeof(buffer) - 1 - p))
+            *p++ = '_';
+    }
+    *p = 0;
+
+    return buffer;
+}
index dd9404f..4d36ff7 100644 (file)
@@ -2,6 +2,7 @@
 
    Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
    Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
+   Copyright (C) 2017 Andreas Bombe <aeb@debian.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
 #ifndef _BOOT_H
 #define _BOOT_H
 
+#include <stdint.h>
+
 void read_boot(DOS_FS * fs);
 void write_label(DOS_FS * fs, char *label);
+void write_boot_label(DOS_FS * fs, const char *label);
+void write_volume_label(DOS_FS * fs, char *label);
+void remove_label(DOS_FS *fs);
+void write_serial(DOS_FS * fs, uint32_t serial);
 off_t find_volume_de(DOS_FS * fs, DIR_ENT * de);
+const char *pretty_label(const char *label);
 
 /* Reads the boot sector from the currently open device and initializes *FS */
 
+
+off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name);
+
+/* Allocate a free slot in the root directory for a new file. If gen_name is
+   true, the file name is constructed after 'pattern', which must include a %d
+   type format for printf and expand to exactly 11 characters. The name
+   actually used is written into the 'de' structure, the rest of *de is cleared.
+   The offset returned is to where in the filesystem the entry belongs. */
+
 #endif
index e869e41..4b206b5 100644 (file)
+/* charconv.c
+
+   Copyright (C) 2010 Alexander Korolkov <alexander.korolkov@gmail.com>
+   Copyright (C) 2018-2020 Pali Rohár <pali.rohar@gmail.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 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/>.
+
+   The complete text of the GNU General Public License
+   can be found in /usr/share/common-licenses/GPL-3 file.
+*/
+
 #include "charconv.h"
-#include <iconv.h>
 #include <langinfo.h>
 #include <locale.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <wchar.h>
+
+#ifdef HAVE_ICONV
+#include <iconv.h>
+#endif
+
+/* CP850 table for 0x80-0xFF range from:
+ * http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP850.TXT
+ */
+static const wchar_t cp850_table[128] = {
+    0x00c7, 0x00fc, 0x00e9, 0x00e2, 0x00e4, 0x00e0, 0x00e5, 0x00e7,
+    0x00ea, 0x00eb, 0x00e8, 0x00ef, 0x00ee, 0x00ec, 0x00c4, 0x00c5,
+    0x00c9, 0x00e6, 0x00c6, 0x00f4, 0x00f6, 0x00f2, 0x00fb, 0x00f9,
+    0x00ff, 0x00d6, 0x00dc, 0x00f8, 0x00a3, 0x00d8, 0x00d7, 0x0192,
+    0x00e1, 0x00ed, 0x00f3, 0x00fa, 0x00f1, 0x00d1, 0x00aa, 0x00ba,
+    0x00bf, 0x00ae, 0x00ac, 0x00bd, 0x00bc, 0x00a1, 0x00ab, 0x00bb,
+    0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00c1, 0x00c2, 0x00c0,
+    0x00a9, 0x2563, 0x2551, 0x2557, 0x255d, 0x00a2, 0x00a5, 0x2510,
+    0x2514, 0x2534, 0x252c, 0x251c, 0x2500, 0x253c, 0x00e3, 0x00c3,
+    0x255a, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x00a4,
+    0x00f0, 0x00d0, 0x00ca, 0x00cb, 0x00c8, 0x0131, 0x00cd, 0x00ce,
+    0x00cf, 0x2518, 0x250c, 0x2588, 0x2584, 0x00a6, 0x00cc, 0x2580,
+    0x00d3, 0x00df, 0x00d4, 0x00d2, 0x00f5, 0x00d5, 0x00b5, 0x00fe,
+    0x00de, 0x00da, 0x00db, 0x00d9, 0x00fd, 0x00dd, 0x00af, 0x00b4,
+    0x00ad, 0x00b1, 0x2017, 0x00be, 0x00b6, 0x00a7, 0x00f7, 0x00b8,
+    0x00b0, 0x00a8, 0x00b7, 0x00b9, 0x00b3, 0x00b2, 0x25a0, 0x00a0,
+};
+
+/* CP850 translit table to 7bit ASCII for 0x80-0xFF range */
+static const char *const cp850_translit_table[128] = {
+    "C",   "u",   "e",  "a",     "a",     "a", "a",   "c",
+    "e",   "e",   "e",  "i",     "i",     "i", "A",   "A",
+    "E",   "ae",  "AE", "o",     "o",     "o", "u",   "u",
+    "y",   "O",   "U",  "o",     "GBP",   "O", "x",   "f",
+    "a",   "i",   "o",  "u",     "n",     "N", "a",   "o",
+    "?",   "(R)", "!",  " 1/2 ", " 1/4 ", "!", "<<",  ">>",
+    "?",   "?",   "?",  "|",     "+",     "A", "A",   "A",
+    "(C)", "?",   "?",  "?",     "?",     "c", "JPY", "+",
+    "+",   "+",   "+",  "+",     "-",     "+", "a",   "A",
+    "?",   "?",   "?",  "?",     "?",     "?", "?",   "?",
+    "d",   "D",   "E",  "E",     "E",     "i", "I",   "I",
+    "I",   "+",   "+",  "?",     "?",     "|", "I",   "?",
+    "O",   "ss",  "O",  "O",     "o",     "O", "u",   "th",
+    "TH",  "U",   "U",  "U",     "y",     "Y", "?",   "'",
+    "-",   "+-",  "?",  " 3/4 ", "?",     "?", "/",   ",",
+    "?",   "?",   ".",  "1",     "3",     "2", "?",   " ",
+};
+
+static int wchar_string_to_cp850_string(char *out, const wchar_t *in, unsigned int out_size)
+{
+    unsigned i, j;
+    for (i = 0; i < out_size-1 && in[i]; ++i) {
+        if (in[i] > 0 && in[i] < 0x80) {
+            out[i] = in[i];
+            continue;
+        }
+        for (j = 0; j < 0x80; ++j) {
+            if (in[i] == cp850_table[j]) {
+                out[i] = (0x80 | j);
+                break;
+            }
+        }
+        if (j == 0x80) {
+            fprintf(stderr, "Cannot convert input character 0x%04x to 'CP850': %s\n", (unsigned int)in[i], strerror(EILSEQ));
+            return 0;
+        }
+    }
+    if (in[i]) {
+        fprintf(stderr, "Cannot convert input string to 'CP850': String is too long\n");
+        return 0;
+    }
+    out[i] = 0;
+    return 1;
+}
+
+static int cp850_string_to_wchar_string(wchar_t *out, const char *in, unsigned int out_size)
+{
+    unsigned i;
+    for (i = 0; i < out_size-1 && i < 11 && in[i]; ++i) {
+        out[i] = (in[i] & 0x80) ? cp850_table[in[i] & 0x7F] : in[i];
+    }
+    if (i < 11 && in[i]) {
+        fprintf(stderr, "Cannot convert input string to 'CP850': String is too long\n");
+        return 0;
+    }
+    out[i] = L'\0';
+    return 1;
+}
+
+static int cp850_char_to_printable(char **p, unsigned char c, unsigned int out_size)
+{
+    size_t ret;
+    wchar_t wcs[2];
+    wcs[0] = (c & 0x80) ? cp850_table[c & 0x7F] : c;
+    wcs[1] = 0;
+    ret = wcstombs(*p, wcs, out_size);
+    if (ret == 0)
+        return 0;
+    if (ret != (size_t)-1)
+        *p += ret;
+    else if (!(c & 0x80))
+        *(*p++) = c;
+    else {
+        ret = strlen(cp850_translit_table[c & 0x7F]);
+        if (ret > out_size)
+            return 0;
+        memcpy(*p, cp850_translit_table[c & 0x7F], ret);
+        *p += ret;
+    }
+    return 1;
+}
+
+static int local_string_to_cp850_string(char *out, const char *in, unsigned int out_size)
+{
+    int ret;
+    wchar_t *wcs;
+    if (strlen(in) >= out_size) {
+        fprintf(stderr, "Cannot convert input string '%s' to 'CP850': String is too long\n", in);
+        return 0;
+    }
+    wcs = calloc(out_size, sizeof(wchar_t));
+    if (!wcs) {
+        fprintf(stderr, "Cannot convert input string '%s' to 'CP850': %s\n", in, strerror(ENOMEM));
+        return 0;
+    }
+    if (mbstowcs(wcs, in, out_size) == (size_t)-1) {
+        fprintf(stderr, "Cannot convert input string '%s' to 'CP850': %s\n", in, strerror(errno));
+        free(wcs);
+        return 0;
+    }
+    ret = wchar_string_to_cp850_string(out, wcs, out_size);
+    free(wcs);
+    return ret;
+}
 
-static iconv_t iconv_init_codepage(int codepage)
+#ifdef HAVE_ICONV
+
+static int iconv_init_codepage(int codepage, const char *local, iconv_t *to_local, iconv_t *from_local)
 {
-    iconv_t result;
-    char codepage_name[16];
+    char codepage_name[32];
+    snprintf(codepage_name, sizeof(codepage_name), "CP%d//TRANSLIT", codepage);
+    *to_local = iconv_open(local, codepage_name);
+    if (*to_local == (iconv_t) - 1) {
+        snprintf(codepage_name, sizeof(codepage_name), "CP%d", codepage);
+        *to_local = iconv_open(local, codepage_name);
+    }
+    if (*to_local == (iconv_t) - 1)
+        fprintf(stderr, "Cannot initialize conversion from codepage %d to %s: %s\n", codepage, local, strerror(errno));
     snprintf(codepage_name, sizeof(codepage_name), "CP%d", codepage);
-    result = iconv_open(nl_langinfo(CODESET), codepage_name);
-    if (result == (iconv_t) - 1)
-       perror(codepage_name);
-    return result;
+    *from_local = iconv_open(codepage_name, local);
+    if (*from_local == (iconv_t) - 1)
+        fprintf(stderr, "Cannot initialize conversion from %s to codepage %d: %s\n", local, codepage, strerror(errno));
+    return (*to_local != (iconv_t)-1 && *from_local != (iconv_t)-1) ? 1 : 0;
 }
 
 static iconv_t dos_to_local;
+static iconv_t local_to_dos;
+static iconv_t dos_to_wchar;
+static iconv_t wchar_to_dos;
+static int used_codepage;
+static int internal_cp850;
 
 /*
  * Initialize conversion from codepage.
  * codepage = -1 means default codepage.
- * Returns 0 on success, non-zero on failure
+ * Returns non-zero on success, 0 on failure
  */
 static int init_conversion(int codepage)
 {
@@ -29,15 +201,18 @@ static int init_conversion(int codepage)
        initialized = 1;
        if (codepage < 0)
            codepage = DEFAULT_DOS_CODEPAGE;
-       setlocale(LC_ALL, "");  /* initialize locale */
-       dos_to_local = iconv_init_codepage(codepage);
-       if (dos_to_local == (iconv_t) - 1 && codepage != DEFAULT_DOS_CODEPAGE) {
-           printf("Trying to set fallback DOS codepage %d\n",
-                  DEFAULT_DOS_CODEPAGE);
-           dos_to_local = iconv_init_codepage(DEFAULT_DOS_CODEPAGE);
-           if (dos_to_local == (iconv_t) - 1)
-               initialized = 0;        /* no conversion available */
+       setlocale(LC_CTYPE, "");        /* initialize locale for CODESET */
+       if (!iconv_init_codepage(codepage, nl_langinfo(CODESET), &dos_to_local, &local_to_dos))
+           initialized = 0;
+       if (initialized && !iconv_init_codepage(codepage, "WCHAR_T", &dos_to_wchar, &wchar_to_dos))
+           initialized = 0;
+       if (!initialized && codepage == 850) {
+           fprintf(stderr, "Using internal CP850 conversion table\n");
+           internal_cp850 = 1; /* use internal CP850 conversion table */
+           initialized = 1;
        }
+       if (initialized)
+           used_codepage = codepage;
     }
     return initialized;
 }
@@ -47,13 +222,152 @@ int set_dos_codepage(int codepage)
     return init_conversion(codepage);
 }
 
-int dos_char_to_printable(char **p, unsigned char c)
+int dos_char_to_printable(char **p, unsigned char c, unsigned int out_size)
 {
     char in[1] = { c };
-    char *pin = in;
+    ICONV_CONST char *pin = in;
     size_t bytes_in = 1;
-    size_t bytes_out = 4;
+    size_t bytes_out = out_size;
     if (!init_conversion(-1))
        return 0;
-    return iconv(dos_to_local, &pin, &bytes_in, p, &bytes_out) != -1;
+    if (internal_cp850)
+        return cp850_char_to_printable(p, c, out_size);
+    return iconv(dos_to_local, &pin, &bytes_in, p, &bytes_out) != (size_t)-1;
 }
+
+int local_string_to_dos_string(char *out, char *in, unsigned int out_size)
+{
+    ICONV_CONST char *pin = in;
+    char *pout = out;
+    size_t bytes_in = strlen(in);
+    size_t bytes_out = out_size-1;
+    size_t ret;
+    if (!init_conversion(-1))
+        return 0;
+    if (internal_cp850)
+        return local_string_to_cp850_string(out, in, out_size);
+    ret = iconv(local_to_dos, &pin, &bytes_in, &pout, &bytes_out);
+    if (ret == (size_t)-1) {
+        if (errno == E2BIG)
+            fprintf(stderr, "Cannot convert input string '%s' to 'CP%d': String is too long\n",
+                    in, used_codepage);
+        else
+            fprintf(stderr, "Cannot convert input sequence '\\x%.02hhX' from codeset '%s' to 'CP%d': %s\n",
+                    *pin, nl_langinfo(CODESET), used_codepage, strerror(errno));
+        iconv(local_to_dos, NULL, NULL, &pout, &bytes_out);
+        return 0;
+    } else {
+        ret = iconv(local_to_dos, NULL, NULL, &pout, &bytes_out);
+        if (ret == (size_t)-1) {
+            fprintf(stderr, "Cannot convert input string '%s' to 'CP%d': String is too long\n",
+                    in, used_codepage);
+            return 0;
+        }
+    }
+    out[out_size-1-bytes_out] = 0;
+    return 1;
+}
+
+int dos_string_to_wchar_string(wchar_t *out, char *in, unsigned int out_size)
+{
+    ICONV_CONST char *pin = in;
+    char *pout = (char *)out;
+    size_t bytes_in = strnlen(in, 11);
+    size_t bytes_out = out_size-sizeof(wchar_t);
+    size_t ret;
+    if (!init_conversion(-1))
+        return 0;
+    if (internal_cp850)
+        return cp850_string_to_wchar_string(out, in, out_size);
+    ret = iconv(dos_to_wchar, &pin, &bytes_in, &pout, &bytes_out);
+    if (ret == (size_t)-1) {
+        if (errno == E2BIG)
+            fprintf(stderr, "Cannot convert input string from 'CP%d': String is too long\n",
+                    used_codepage);
+        else
+            fprintf(stderr, "Cannot convert input sequence '\\x%.02hhX' from 'CP%d': %s\n",
+                    *pin, used_codepage, strerror(errno));
+        iconv(dos_to_wchar, NULL, NULL, &pout, &bytes_out);
+        return 0;
+    } else {
+        ret = iconv(dos_to_wchar, NULL, NULL, &pout, &bytes_out);
+        if (ret == (size_t)-1) {
+            fprintf(stderr, "Cannot convert input string from 'CP%d': String is too long\n",
+                    used_codepage);
+            return 0;
+        }
+    }
+    out[(out_size-sizeof(wchar_t)-bytes_out)/sizeof(wchar_t)] = L'\0';
+    return 1;
+}
+
+int wchar_string_to_dos_string(char *out, wchar_t *in, unsigned int out_size)
+{
+    ICONV_CONST char *pin = (char *)in;
+    char *pout = out;
+    size_t bytes_in = wcslen(in)*sizeof(wchar_t);
+    size_t bytes_out = out_size-1;
+    size_t ret;
+    if (!init_conversion(-1))
+        return 0;
+    if (internal_cp850)
+        return wchar_string_to_cp850_string(out, in, out_size);
+    ret = iconv(wchar_to_dos, &pin, &bytes_in, &pout, &bytes_out);
+    if (ret == (size_t)-1) {
+        if (errno == E2BIG)
+            fprintf(stderr, "Cannot convert input string '%ls' to 'CP%d': String is too long\n",
+                    in, used_codepage);
+        else
+            fprintf(stderr, "Cannot convert input character '%lc' to 'CP%d': %s\n",
+                    (wint_t)*(wchar_t *)pin, used_codepage, strerror(errno));
+        iconv(wchar_to_dos, NULL, NULL, &pout, &bytes_out);
+        return 0;
+    } else {
+        ret = iconv(wchar_to_dos, NULL, NULL, &pout, &bytes_out);
+        if (ret == (size_t)-1) {
+            fprintf(stderr, "Cannot convert input string '%ls' to 'CP%d': String is too long\n",
+                    in, used_codepage);
+            return 0;
+        }
+    }
+    out[out_size-1-bytes_out] = 0;
+    return 1;
+}
+
+#else
+
+int set_dos_codepage(int codepage)
+{
+    static int initialized = -1;
+    if (initialized < 0) {
+        setlocale(LC_CTYPE, ""); /* initialize locale for wide character functions */
+        if (codepage < 0)
+            codepage = DEFAULT_DOS_CODEPAGE;
+        initialized = (codepage == 850) ? 1 : 0;
+        if (!initialized)
+            fprintf(stderr, "Cannot initialize unsupported codepage %d, only codepage 850 is supported\n", codepage);
+    }
+    return initialized;
+}
+
+int dos_char_to_printable(char **p, unsigned char c, unsigned int out_size)
+{
+    return cp850_char_to_printable(p, c, out_size);
+}
+
+int local_string_to_dos_string(char *out, char *in, unsigned int out_size)
+{
+    return local_string_to_cp850_string(out, in, out_size);
+}
+
+int dos_string_to_wchar_string(wchar_t *out, char *in, unsigned int out_size)
+{
+    return cp850_string_to_wchar_string(out, in, out_size);
+}
+
+int wchar_string_to_dos_string(char *out, wchar_t *in, unsigned int out_size)
+{
+    return wchar_string_to_cp850_string(out, in, out_size);
+}
+
+#endif
index 3ac3e56..b46d025 100644 (file)
@@ -1,9 +1,36 @@
+/* charconv.h
+
+   Copyright (C) 2010 Alexander Korolkov <alexander.korolkov@gmail.com>
+   Copyright (C) 2018-2020 Pali Rohár <pali.rohar@gmail.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 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/>.
+
+   The complete text of the GNU General Public License
+   can be found in /usr/share/common-licenses/GPL-3 file.
+*/
+
 #ifndef _CHARCONV_H
 #define _CHARCONV_H
 
-#define DEFAULT_DOS_CODEPAGE 437
+#include <stddef.h>
+
+#define DEFAULT_DOS_CODEPAGE 850
 
 int set_dos_codepage(int codepage);
-int dos_char_to_printable(char **p, unsigned char c);
+int dos_char_to_printable(char **p, unsigned char c, unsigned int out_size);
+int local_string_to_dos_string(char *out, char *in, unsigned int out_size);
+int dos_string_to_wchar_string(wchar_t *out, char *in, unsigned int out_size);
+int wchar_string_to_dos_string(char *out, wchar_t *in, unsigned int out_size);
 
 #endif
index 417eb55..1097d57 100644 (file)
@@ -4,6 +4,7 @@
    Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
    Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
    Copyright (C) 2015 Andreas Bombe <aeb@debian.org>
+   Copyright (C) 2017-2021 Pali Rohár <pali.rohar@gmail.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
@@ -29,6 +30,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#include <errno.h>
+#include <ctype.h>
+#include <wctype.h>
 
 #include "common.h"
 #include "fsck.fat.h"
@@ -37,6 +41,8 @@
 #include "file.h"
 #include "lfn.h"
 #include "check.h"
+#include "boot.h"
+#include "charconv.h"
 
 
 /* the longest path on the filesystem that can be handled by path_name() */
@@ -47,7 +53,7 @@ static DOS_FILE *root;
 /* get start field of a dir entry */
 #define FSTART(p,fs) \
   ((uint32_t)le16toh(p->dir_ent.start) | \
-   (fs->fat_bits == 32 ? le16toh(p->dir_ent.starthi) << 16 : 0))
+   (fs->fat_bits == 32 ? (uint32_t)le16toh(p->dir_ent.starthi) << 16 : 0))
 
 #define MODIFY(p,i,v)                                  \
   do {                                                 \
@@ -79,132 +85,6 @@ static DOS_FILE *root;
     }                                                                  \
   } while(0)
 
-off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name)
-{
-    static int curr_num = 0;
-    off_t offset;
-
-    if (fs->root_cluster) {
-       DIR_ENT d2;
-       int i = 0, got = 0;
-       uint32_t clu_num, prev = 0;
-       off_t offset2;
-
-       clu_num = fs->root_cluster;
-       offset = cluster_start(fs, clu_num);
-       while (clu_num > 0 && clu_num != -1) {
-           fs_read(offset, sizeof(DIR_ENT), &d2);
-           if (IS_FREE(d2.name) && d2.attr != VFAT_LN_ATTR) {
-               got = 1;
-               break;
-           }
-           i += sizeof(DIR_ENT);
-           offset += sizeof(DIR_ENT);
-           if ((i % fs->cluster_size) == 0) {
-               prev = clu_num;
-               if ((clu_num = next_cluster(fs, clu_num)) == 0 || clu_num == -1)
-                   break;
-               offset = cluster_start(fs, clu_num);
-           }
-       }
-       if (!got) {
-           /* no free slot, need to extend root dir: alloc next free cluster
-            * after previous one */
-           if (!prev)
-               die("Root directory has no cluster allocated!");
-           for (clu_num = prev + 1; clu_num != prev; clu_num++) {
-               FAT_ENTRY entry;
-
-               if (clu_num >= fs->data_clusters + 2)
-                   clu_num = 2;
-               get_fat(&entry, fs->fat, clu_num, fs);
-               if (!entry.value)
-                   break;
-           }
-           if (clu_num == prev)
-               die("Root directory full and no free cluster");
-           set_fat(fs, prev, clu_num);
-           set_fat(fs, clu_num, -1);
-           set_owner(fs, clu_num, get_owner(fs, fs->root_cluster));
-           /* clear new cluster */
-           memset(&d2, 0, sizeof(d2));
-           offset = cluster_start(fs, clu_num);
-           for (i = 0; i < fs->cluster_size; i += sizeof(DIR_ENT))
-               fs_write(offset + i, sizeof(d2), &d2);
-       }
-       memset(de, 0, sizeof(DIR_ENT));
-       if (gen_name) {
-           while (1) {
-               char expanded[12];
-               sprintf(expanded, pattern, curr_num);
-               memcpy(de->name, expanded, MSDOS_NAME);
-               clu_num = fs->root_cluster;
-               i = 0;
-               offset2 = cluster_start(fs, clu_num);
-               while (clu_num > 0 && clu_num != -1) {
-                   fs_read(offset2, sizeof(DIR_ENT), &d2);
-                   if (offset2 != offset &&
-                       !strncmp((const char *)d2.name, (const char *)de->name,
-                                MSDOS_NAME))
-                       break;
-                   i += sizeof(DIR_ENT);
-                   offset2 += sizeof(DIR_ENT);
-                   if ((i % fs->cluster_size) == 0) {
-                       if ((clu_num = next_cluster(fs, clu_num)) == 0 ||
-                           clu_num == -1)
-                           break;
-                       offset2 = cluster_start(fs, clu_num);
-                   }
-               }
-               if (clu_num == 0 || clu_num == -1)
-                   break;
-               if (++curr_num >= 10000)
-                   die("Unable to create unique name");
-           }
-       } else {
-           memcpy(de->name, pattern, MSDOS_NAME);
-       }
-    } else {
-       DIR_ENT *root;
-       int next_free = 0, scan;
-
-       root = alloc(fs->root_entries * sizeof(DIR_ENT));
-       fs_read(fs->root_start, fs->root_entries * sizeof(DIR_ENT), root);
-
-       while (next_free < fs->root_entries)
-           if (IS_FREE(root[next_free].name) &&
-               root[next_free].attr != VFAT_LN_ATTR)
-               break;
-           else
-               next_free++;
-       if (next_free == fs->root_entries)
-           die("Root directory is full.");
-       offset = fs->root_start + next_free * sizeof(DIR_ENT);
-       memset(de, 0, sizeof(DIR_ENT));
-       if (gen_name) {
-           while (1) {
-               char expanded[12];
-               sprintf(expanded, pattern, curr_num);
-               memcpy(de->name, expanded, MSDOS_NAME);
-               for (scan = 0; scan < fs->root_entries; scan++)
-                   if (scan != next_free &&
-                       !strncmp((const char *)root[scan].name,
-                                (const char *)de->name, MSDOS_NAME))
-                       break;
-               if (scan == fs->root_entries)
-                   break;
-               if (++curr_num >= 10000)
-                   die("Unable to create unique name");
-           }
-       } else {
-           memcpy(de->name, pattern, MSDOS_NAME);
-       }
-       free(root);
-    }
-    ++n_files;
-    return offset;
-}
-
 /**
  * Construct a full path (starting with '/') for the specified dentry,
  * relative to the partition. All components are "long" names where possible.
@@ -234,57 +114,43 @@ static char *path_name(DOS_FILE * file)
     return path;
 }
 
-static const int day_n[] =
-    {   0,  31,  59,  90, 120, 151, 181, 212, 243, 273, 304, 334, 0, 0, 0, 0 };
-/*    Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec              */
-
-/* Convert a MS-DOS time/date pair to a UNIX date (seconds since 1 1 70). */
-
-static time_t date_dos2unix(unsigned short time, unsigned short date)
-{
-    int month, year;
-    time_t secs;
-
-    month = ((date >> 5) & 15) - 1;
-    if (month < 0) {
-       /* make sure that nothing bad happens if the month bits were zero */
-       month = 0;
-    }
-    year = date >> 9;
-    secs =
-       (time & 31) * 2 + 60 * ((time >> 5) & 63) + (time >> 11) * 3600 +
-       86400 * ((date & 31) - 1 + day_n[month] + (year / 4) + year * 365 -
-                ((year & 3) == 0 && month < 2 ? 1 : 0) + 3653);
-    /* days since 1.1.70 plus 80's leap day */
-    return secs;
-}
+static const char *month_str[] =
+    { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
 
 static char *file_stat(DOS_FILE * file)
 {
     static char temp[100];
-    struct tm *tm;
-    char tmp[100];
-    time_t date;
-
-    date =
-       date_dos2unix(le16toh(file->dir_ent.time), le16toh(file->dir_ent.date));
-    tm = localtime(&date);
-    strftime(tmp, 99, "%H:%M:%S %b %d %Y", tm);
-    sprintf(temp, "  Size %u bytes, date %s", le32toh(file->dir_ent.size), tmp);
+    unsigned int hours, minutes, secs, day, month, year;
+    unsigned short time, date;
+
+    time = le16toh(file->dir_ent.time);
+    date = le16toh(file->dir_ent.date);
+    year = 1980 + (date >> 9);
+    month = ((date >> 5) & 15);
+    if (month < 1) month = 1;
+    else if (month > 12) month = 12;
+    day = (date & 31);
+    if (day < 1) day = 1;
+    hours = (time >> 11);
+    if (hours > 23) hours = 23;
+    minutes = ((time >> 5) & 63);
+    if (minutes > 59) minutes = 59;
+    secs = (time & 31) * 2;
+    if (secs > 59) secs = 59;
+    sprintf(temp, "  Size %u bytes, date %02u:%02u:%02u %s %02u %4u",
+        le32toh(file->dir_ent.size), hours, minutes, secs, month_str[month-1], day, year);
     return temp;
 }
 
 static int bad_name(DOS_FILE * file)
 {
     int i, spc, suspicious = 0;
-    const char *bad_chars = atari_format ? "*?\\/:" : "*?<>|\"\\/:";
+    const char *bad_chars = atari_format ? "*?\\/:" : "*?<>|\"\\/:.";
     const unsigned char *name = file->dir_ent.name;
     const unsigned char *ext = name + 8;
 
-    /* Do not complain about (and auto-correct) the extended attribute files
-     * of OS/2. */
-    if (strncmp((const char *)name, "EA DATA  SF", 11) == 0 ||
-       strncmp((const char *)name, "WP ROOT  SF", 11) == 0)
+    /* do not check synthetic FAT32 root entry */
+    if (!file->offset)
        return 0;
 
     /* check if we have neither a long filename nor a short name */
@@ -298,7 +164,7 @@ static int bad_name(DOS_FILE * file)
        return 0;
 
     for (i = 0; i < MSDOS_NAME; i++) {
-       if (name[i] < ' ' || name[i] == 0x7f)
+       if ((name[i] < ' ' && !(i == 0 && name[0] == 0x05)) || name[i] == 0x7f)
            return 1;
        if (name[i] > 0x7f)
            ++suspicious;
@@ -306,24 +172,29 @@ static int bad_name(DOS_FILE * file)
            return 1;
     }
 
-    spc = 0;
-    for (i = 0; i < 8; i++) {
-       if (name[i] == ' ')
-           spc = 1;
-       else if (spc)
-           /* non-space after a space not allowed, space terminates the name
-            * part */
-           return 1;
-    }
+    if (name[0] == ' ')
+       return 1;
 
-    spc = 0;
-    for (i = 0; i < 3; i++) {
-       if (ext[i] == ' ')
-           spc = 1;
-       else if (spc)
-           /* non-space after a space not allowed, space terminates the ext
-            * part */
-           return 1;
+    if (no_spaces_in_sfns) {
+       spc = 0;
+       for (i = 0; i < 8; i++) {
+           if (name[i] == ' ')
+               spc = 1;
+           else if (spc)
+               /* non-space after a space not allowed, space terminates the name
+                * part */
+               return 1;
+       }
+
+       spc = 0;
+       for (i = 0; i < 3; i++) {
+           if (ext[i] == ' ')
+               spc = 1;
+           else if (spc)
+               /* non-space after a space not allowed, space terminates the ext
+                * part */
+               return 1;
+       }
     }
 
     /* Under GEMDOS, chars >= 128 are never allowed. */
@@ -355,14 +226,11 @@ static void lfn_remove(off_t from, off_t to)
 
 static void drop_file(DOS_FS * fs, DOS_FILE * file)
 {
-    uint32_t cluster;
+    (void) fs;
 
     MODIFY(file, name[0], DELETED_FLAG);
     if (file->lfn)
        lfn_remove(file->lfn_offset, file->offset);
-    for (cluster = FSTART(file, fs); cluster > 0 && cluster <
-        fs->data_clusters + 2; cluster = next_cluster(fs, cluster))
-       set_owner(fs, cluster, NULL);
     --n_files;
 }
 
@@ -389,8 +257,10 @@ static void auto_rename(DOS_FILE * file)
     DOS_FILE *first, *walk;
     uint32_t number;
 
-    if (!file->offset)
+    if (!file->offset) {
+       printf("Cannot rename FAT32 root dir\n");
        return;                 /* cannot rename FAT32 root dir */
+    }
     first = file->parent ? file->parent->first : root;
     number = 0;
     while (1) {
@@ -414,9 +284,10 @@ static void auto_rename(DOS_FILE * file)
            } else {
                fs_write(file->offset, MSDOS_NAME, file->dir_ent.name);
            }
-           if (file->lfn)
-               lfn_fix_checksum(file->lfn_offset, file->offset,
-                                (const char *)file->dir_ent.name);
+           if (file->lfn) {
+               lfn_remove(file->lfn_offset, file->offset);
+               file->lfn = NULL;
+           }
            return;
        }
        number++;
@@ -437,9 +308,7 @@ static void rename_file(DOS_FILE * file)
        return;                 /* cannot rename FAT32 root dir */
     }
     while (1) {
-       printf("New name: ");
-       fflush(stdout);
-       if (fgets((char *)name, 45, stdin)) {
+       if (get_line("New name", (char *)name, 45)) {
            if ((here = (unsigned char *)strchr((const char *)name, '\n')))
                *here = 0;
            for (walk = (unsigned char *)strrchr((const char *)name, 0);
@@ -457,51 +326,124 @@ static void rename_file(DOS_FILE * file)
                } else {
                    fs_write(file->offset, MSDOS_NAME, file->dir_ent.name);
                }
-               if (file->lfn)
-                   lfn_fix_checksum(file->lfn_offset, file->offset,
-                                    (const char *)file->dir_ent.name);
+               if (file->lfn) {
+                   lfn_remove(file->lfn_offset, file->offset);
+                   file->lfn = NULL;
+               }
                return;
            }
        }
     }
 }
 
-static int handle_dot(DOS_FS * fs, DOS_FILE * file, int dots)
+static uint32_t scan_free_entry(DOS_FS * fs, DOS_FILE * this)
 {
-    const char *name;
-
-    name =
-       strncmp((const char *)file->dir_ent.name, MSDOS_DOT,
-               MSDOS_NAME) ? ".." : ".";
-    if (!(file->dir_ent.attr & ATTR_DIR)) {
-       printf("%s\n  Is a non-directory.\n", path_name(file));
-       if (interactive)
-           printf("1) Drop it\n2) Auto-rename\n3) Rename\n"
-                  "4) Convert to directory\n");
-       else
-           printf("  Auto-renaming it.\n");
-       switch (interactive ? get_key("1234", "?") : '2') {
-       case '1':
-           drop_file(fs, file);
-           return 1;
-       case '2':
-           auto_rename(file);
-           printf("  Renamed to %s\n", file_name(file->dir_ent.name));
-           return 0;
-       case '3':
-           rename_file(file);
-           return 0;
-       case '4':
-           MODIFY(file, size, htole32(0));
-           MODIFY(file, attr, file->dir_ent.attr | ATTR_DIR);
-           break;
+    uint32_t clu_num, offset;
+    int i;
+    DIR_ENT de;
+
+    i = 2 * sizeof(DIR_ENT); /* Skip '.' and '..' slots */
+    clu_num = FSTART(this, fs);
+    while (clu_num > 0 && clu_num != -1) {
+       offset = cluster_start(fs, clu_num) + (i % fs->cluster_size);
+       fs_read(offset, sizeof(DIR_ENT), &de);
+       if (IS_FREE(de.name))
+           return offset;
+       i += sizeof(DIR_ENT);
+       if (!(i % fs->cluster_size))
+           if ((clu_num = next_cluster(fs, clu_num)) == 0 || clu_num == -1)
+               break;
+    }
+
+    return 0;
+}
+
+static int handle_dot(DOS_FS * fs, DOS_FILE * file, int dotdot)
+{
+    const char *name, *ent;
+    uint32_t new_offset, start;
+
+    if (dotdot) {
+       name = "..";
+       ent = MSDOS_DOTDOT;
+       if (!file->parent->parent) {
+           start = 0;
+       } else {
+           start = FSTART(file->parent->parent, fs);
+           if (start == fs->root_cluster)
+               start = 0;
        }
+    } else {
+       name = ".";
+       ent = MSDOS_DOT;
+       start = FSTART(file->parent, fs);
     }
-    if (!dots) {
-       printf("Root contains directory \"%s\". Dropping it.\n", name);
-       drop_file(fs, file);
-       return 1;
+
+    if (!(file->dir_ent.attr & ATTR_DIR) || (FSTART(file, fs) != start) ||
+       strncmp((const char *)(file->dir_ent.name), ent, MSDOS_NAME)) {
+
+       if (IS_FREE(file->dir_ent.name)) {
+           printf("%s\n  Expected a valid '%s' entry in the %s slot, found free entry.\n",
+               path_name(file->parent), name, dotdot ? "second" : "first");
+           switch (get_choice(1, "  Creating.",
+                              2,
+                              1, "Create entry",
+                              2, "Drop parent")) {
+           case 1:
+               goto conjure;
+           case 2:
+               drop_file(fs, file->parent);
+               return 1;
+           }
+       }
+
+       if (!strncmp((const char *)(file->dir_ent.name), ent, MSDOS_NAME)) {
+           printf("%s\n  Invalid '%s' entry in the %s slot. Fixing.\n",
+               path_name(file->parent), name, dotdot ? "second" : "first");
+           MODIFY_START(file, start, fs);
+           MODIFY(file, attr, ATTR_DIR);
+       } else {
+           printf("%s\n  Expected a valid '%s' entry in this slot.\n",
+                  path_name(file), name);
+           switch (get_choice(3, "  Moving entry down.",
+                              3,
+                              1, "Drop entry",
+                              2, "Drop parent",
+                              3, "Move entry down")) {
+           case 1:
+               drop_file(fs, file);
+               goto conjure;
+           case 2:
+               drop_file(fs, file->parent);
+               return 1;
+           case 3:
+               new_offset = scan_free_entry(fs, file->parent);
+               if (!new_offset) {
+                   printf("No free entry found.\n");
+                   return 0;
+               }
+
+               fs_write(new_offset, sizeof(file->dir_ent), &file->dir_ent);
+               goto conjure;
+           }
+       }
     }
+    if (file->dir_ent.lcase & FAT_NO_83NAME) {
+       /* Some versions of mtools write these directory entries with random data in
+          this field. */
+       printf("%s\n  Is a dot with no 8.3 name flag set, clearing.\n", path_name(file));
+       file->dir_ent.lcase &= ~FAT_NO_83NAME;
+       MODIFY(file, lcase, file->dir_ent.lcase);
+    }
+
+    return 0;
+
+conjure:
+    memset(&file->dir_ent, 0, sizeof(DIR_ENT));
+    memcpy(file->dir_ent.name, ent, MSDOS_NAME);
+    fs_write(file->offset, sizeof(file->dir_ent), &file->dir_ent);
+    MODIFY_START(file, start, fs);
+    MODIFY(file, attr, ATTR_DIR);
     return 0;
 }
 
@@ -509,7 +451,10 @@ static int check_file(DOS_FS * fs, DOS_FILE * file)
 {
     DOS_FILE *owner;
     int restart;
-    uint32_t expect, curr, this, clusters, prev, walk, clusters2;
+    uint32_t parent, grandp, curr, this, clusters, prev, walk, clusters2;
+
+    if (IS_FREE(file->dir_ent.name))
+       return 0;
 
     if (file->dir_ent.attr & ATTR_DIR) {
        if (le32toh(file->dir_ent.size)) {
@@ -517,37 +462,33 @@ static int check_file(DOS_FS * fs, DOS_FILE * file)
                   path_name(file));
            MODIFY(file, size, htole32(0));
        }
-       if (file->parent
-           && !strncmp((const char *)file->dir_ent.name, MSDOS_DOT,
-                       MSDOS_NAME)) {
-           expect = FSTART(file->parent, fs);
-           if (FSTART(file, fs) != expect) {
-               printf("%s\n  Start (%lu) does not point to parent (%lu)\n",
-                      path_name(file), (unsigned long)FSTART(file, fs), (long)expect);
-               MODIFY_START(file, expect, fs);
-           }
-           return 0;
-       }
-       if (file->parent
-           && !strncmp((const char *)file->dir_ent.name, MSDOS_DOTDOT,
-                       MSDOS_NAME)) {
-           expect =
-               file->parent->parent ? FSTART(file->parent->parent, fs) : 0;
-           if (fs->root_cluster && expect == fs->root_cluster)
-               expect = 0;
-           if (FSTART(file, fs) != expect) {
-               printf("%s\n  Start (%lu) does not point to .. (%lu)\n",
-                      path_name(file), (unsigned long)FSTART(file, fs), (unsigned long)expect);
-               MODIFY_START(file, expect, fs);
-           }
-           return 0;
-       }
        if (FSTART(file, fs) == 0) {
            printf("%s\n Start does point to root directory. Deleting dir. \n",
                   path_name(file));
            MODIFY(file, name[0], DELETED_FLAG);
            return 0;
        }
+       if (file->parent) {
+           parent = FSTART(file->parent, fs);
+           grandp = file->parent->parent ? FSTART(file->parent->parent, fs) : 0;
+           if (fs->root_cluster && grandp == fs->root_cluster)
+               grandp = 0;
+
+           if (FSTART(file, fs) == parent) {
+               printf("%s\n Start does point to containing directory. Deleting entry.\n",
+                      path_name(file));
+               MODIFY(file, name[0], DELETED_FLAG);
+               MODIFY_START(file, 0, fs);
+               return 0;
+           }
+           if (FSTART(file, fs) == grandp) {
+               printf("%s\n Start does point to containing directory's parent. Deleting entry.\n",
+                      path_name(file));
+               MODIFY(file, name[0], DELETED_FLAG);
+               MODIFY_START(file, 0, fs);
+               return 0;
+           }
+       }
     }
     if (FSTART(file, fs) == 1) {
        printf("%s\n  Bad start cluster 1. Truncating file.\n",
@@ -585,12 +526,12 @@ static int check_file(DOS_FS * fs, DOS_FILE * file)
            break;
        }
        if (!(file->dir_ent.attr & ATTR_DIR) && le32toh(file->dir_ent.size) <=
-           (uint64_t)clusters * fs->cluster_size) {
+           clusters * fs->cluster_size) {
            printf
-               ("%s\n  File size is %u bytes, cluster chain length is > %llu "
+               ("%s\n  File size is %u bytes, cluster chain length is > %u "
                 "bytes.\n  Truncating file to %u bytes.\n", path_name(file),
                 le32toh(file->dir_ent.size),
-                (unsigned long long)clusters * fs->cluster_size,
+                (unsigned)clusters * fs->cluster_size,
                 le32toh(file->dir_ent.size));
            truncate_file(fs, file, clusters);
            break;
@@ -604,31 +545,49 @@ static int check_file(DOS_FS * fs, DOS_FILE * file)
                 next_cluster(fs, walk))
                if (walk == curr)
                    break;
-               else
+               else {
+                   if ((unsigned long long)clusters2 * fs->cluster_size >= UINT32_MAX)
+                       die("Internal error: File size is larger than 2^32-1");
                    clusters2++;
+               }
            restart = file->dir_ent.attr & ATTR_DIR;
            if (!owner->offset) {
-               printf("  Truncating second to %llu bytes because first "
+               printf("  Truncating second to %u bytes because first "
                       "is FAT32 root dir.\n",
-                      (unsigned long long)clusters * fs->cluster_size);
+                      (unsigned)clusters * fs->cluster_size);
                do_trunc = 2;
            } else if (!file->offset) {
-               printf("  Truncating first to %llu bytes because second "
+               printf("  Truncating first to %u bytes because second "
                       "is FAT32 root dir.\n",
-                      (unsigned long long)clusters2 * fs->cluster_size);
+                      (unsigned)clusters2 * fs->cluster_size);
                do_trunc = 1;
-           } else if (interactive)
-               printf("1) Truncate first to %llu bytes%s\n"
-                      "2) Truncate second to %llu bytes\n",
-                      (unsigned long long)clusters2 * fs->cluster_size,
-                      restart ? " and restart" : "",
-                      (unsigned long long)clusters * fs->cluster_size);
-           else
-               printf("  Truncating second to %llu bytes.\n",
-                      (unsigned long long)clusters * fs->cluster_size);
-           if (do_trunc != 2
-               && (do_trunc == 1
-                   || (interactive && get_key("12", "?") == '1'))) {
+           } else {
+               char *trunc_first_string;
+               char *trunc_second_string;
+               char *noninteractive_string;
+
+               xasprintf(&trunc_first_string,
+                        "Truncate first to %u bytes%s",
+                        (unsigned)clusters2 * fs->cluster_size,
+                        restart ? " and restart" : "");
+               xasprintf(&trunc_second_string,
+                         "Truncate second to %u bytes",
+                         (unsigned)clusters * fs->cluster_size);
+               xasprintf(&noninteractive_string,
+                         "  Truncating second to %u bytes.",
+                         (unsigned)clusters * fs->cluster_size);
+
+               do_trunc = get_choice(2, noninteractive_string,
+                                     2,
+                                     1, trunc_first_string,
+                                     2, trunc_second_string);
+
+               free(trunc_first_string);
+               free(trunc_second_string);
+               free(noninteractive_string);
+           }
+
+           if (do_trunc == 1) {
                prev = 0;
                clusters = 0;
                for (this = FSTART(owner, fs); this > 0 && this != -1; this =
@@ -638,9 +597,7 @@ static int check_file(DOS_FS * fs, DOS_FILE * file)
                            set_fat(fs, prev, -1);
                        else
                            MODIFY_START(owner, 0, fs);
-                       MODIFY(owner, size,
-                              htole32((uint64_t)clusters *
-                                      fs->cluster_size));
+                       MODIFY(owner, size, htole32(clusters * fs->cluster_size));
                        if (restart)
                            return 1;
                        while (this > 0 && this != -1) {
@@ -650,6 +607,8 @@ static int check_file(DOS_FS * fs, DOS_FILE * file)
                        this = curr;
                        break;
                    }
+                   if ((unsigned long long)clusters * fs->cluster_size >= UINT32_MAX)
+                       die("Internal error: File size is larger than 2^32-1");
                    clusters++;
                    prev = this;
                }
@@ -665,19 +624,21 @@ static int check_file(DOS_FS * fs, DOS_FILE * file)
            }
        }
        set_owner(fs, curr, file);
+       if ((unsigned long long)clusters * fs->cluster_size >= UINT32_MAX)
+           die("Internal error: File size is larger than 2^32-1");
        clusters++;
        prev = curr;
     }
     if (!(file->dir_ent.attr & ATTR_DIR) && le32toh(file->dir_ent.size) >
-       (uint64_t)clusters * fs->cluster_size) {
+       clusters * fs->cluster_size) {
        printf
-           ("%s\n  File size is %u bytes, cluster chain length is %llu bytes."
-            "\n  Truncating file to %llu bytes.\n", path_name(file),
+           ("%s\n  File size is %u bytes, cluster chain length is %u bytes."
+            "\n  Truncating file to %u bytes.\n", path_name(file),
             le32toh(file->dir_ent.size),
-            (unsigned long long)clusters * fs->cluster_size,
-            (unsigned long long)clusters * fs->cluster_size);
+            (unsigned)clusters * fs->cluster_size,
+            (unsigned)clusters * fs->cluster_size);
        MODIFY(file, size,
-              htole32((uint64_t)clusters * fs->cluster_size));
+              htole32(clusters * fs->cluster_size));
     }
     return 0;
 }
@@ -695,7 +656,7 @@ static int check_files(DOS_FS * fs, DOS_FILE * start)
 static int check_dir(DOS_FS * fs, DOS_FILE ** root, int dots)
 {
     DOS_FILE *parent, **walk, **scan;
-    int dot, dotdot, skip, redo;
+    int skip, redo;
     int good, bad;
 
     if (!*root)
@@ -712,55 +673,42 @@ static int check_dir(DOS_FS * fs, DOS_FILE ** root, int dots)
               path_name(parent), bad, good + bad);
        if (!dots)
            printf("  Not dropping root directory.\n");
-       else if (!interactive)
-           printf("  Not dropping it in auto-mode.\n");
-       else if (get_key("yn", "Drop directory ? (y/n)") == 'y') {
+       else if (get_choice(2, "  Not dropping it in auto-mode.",
+                           2,
+                           1, "Drop directory",
+                           2, "Keep directory") == 1) {
            truncate_file(fs, parent, 0);
            MODIFY(parent, name[0], DELETED_FLAG);
            /* buglet: deleted directory stays in the list. */
            return 1;
        }
     }
-    dot = dotdot = redo = 0;
+    redo = 0;
     walk = root;
     while (*walk) {
-       if (!strncmp
-           ((const char *)((*walk)->dir_ent.name), MSDOS_DOT, MSDOS_NAME)
-           || !strncmp((const char *)((*walk)->dir_ent.name), MSDOS_DOTDOT,
-                       MSDOS_NAME)) {
-           if (handle_dot(fs, *walk, dots)) {
-               *walk = (*walk)->next;
-               continue;
-           }
-           if (!strncmp
-               ((const char *)((*walk)->dir_ent.name), MSDOS_DOT, MSDOS_NAME))
-               dot++;
-           else
-               dotdot++;
-       }
        if (!((*walk)->dir_ent.attr & ATTR_VOLUME) && bad_name(*walk)) {
            puts(path_name(*walk));
            printf("  Bad short file name (%s).\n",
                   file_name((*walk)->dir_ent.name));
-           if (interactive)
-               printf("1) Drop file\n2) Rename file\n3) Auto-rename\n"
-                      "4) Keep it\n");
-           else
-               printf("  Auto-renaming it.\n");
-           switch (interactive ? get_key("1234", "?") : '3') {
-           case '1':
+           switch (get_choice(3, "  Auto-renaming it.",
+                              4,
+                              1, "Drop file",
+                              2, "Rename file",
+                              3, "Auto-rename",
+                              4, "Keep it")) {
+           case 1:
                drop_file(fs, *walk);
                walk = &(*walk)->next;
                continue;
-           case '2':
+           case 2:
                rename_file(*walk);
                redo = 1;
                break;
-           case '3':
+           case 3:
                auto_rename(*walk);
                printf("  Renamed to %s\n", file_name((*walk)->dir_ent.name));
                break;
-           case '4':
+           case 4:
                break;
            }
        }
@@ -775,39 +723,39 @@ static int check_dir(DOS_FS * fs, DOS_FILE ** root, int dots)
                    printf("%s\n  Duplicate directory entry.\n  First  %s\n",
                           path_name(*walk), file_stat(*walk));
                    printf("  Second %s\n", file_stat(*scan));
-                   if (interactive)
-                       printf
-                           ("1) Drop first\n2) Drop second\n3) Rename first\n"
-                            "4) Rename second\n5) Auto-rename first\n"
-                            "6) Auto-rename second\n");
-                   else
-                       printf("  Auto-renaming second.\n");
-                   switch (interactive ? get_key("123456", "?") : '6') {
-                   case '1':
+                   switch (get_choice(6, "  Auto-renaming second.",
+                                      6,
+                                      1, "Drop first",
+                                      2, "Drop second",
+                                      3, "Rename first",
+                                      4, "Rename second",
+                                      5, "Auto-rename first",
+                                      6, "Auto-rename second")) {
+                   case 1:
                        drop_file(fs, *walk);
                        *walk = (*walk)->next;
                        skip = 1;
                        break;
-                   case '2':
+                   case 2:
                        drop_file(fs, *scan);
                        *scan = (*scan)->next;
                        continue;
-                   case '3':
+                   case 3:
                        rename_file(*walk);
                        printf("  Renamed to %s\n", path_name(*walk));
                        redo = 1;
                        break;
-                   case '4':
+                   case 4:
                        rename_file(*scan);
                        printf("  Renamed to %s\n", path_name(*walk));
                        redo = 1;
                        break;
-                   case '5':
+                   case 5:
                        auto_rename(*walk);
                        printf("  Renamed to %s\n",
                               file_name((*walk)->dir_ent.name));
                        break;
-                   case '6':
+                   case 6:
                        auto_rename(*scan);
                        printf("  Renamed to %s\n",
                               file_name((*scan)->dir_ent.name));
@@ -823,15 +771,9 @@ static int check_dir(DOS_FS * fs, DOS_FILE ** root, int dots)
            walk = &(*walk)->next;
        else {
            walk = root;
-           dot = dotdot = redo = 0;
+           redo = 0;
        }
     }
-    if (dots && !dot)
-       printf("%s\n  \".\" is missing. Can't fix this yet.\n",
-              path_name(parent));
-    if (dots && !dotdot)
-       printf("%s\n  \"..\" is missing. Can't fix this yet.\n",
-              path_name(parent));
     return 0;
 }
 
@@ -1003,10 +945,8 @@ static void add_file(DOS_FS * fs, DOS_FILE *** chain, DOS_FILE * parent,
            printf(" (%s)", file_name(new->dir_ent.name));      /* (8.3) */
        printf("\n");
     }
-    /* Don't include root directory, '.', or '..' in the total file count */
-    if (offset &&
-       strncmp((const char *)de.name, MSDOS_DOT, MSDOS_NAME) != 0 &&
-       strncmp((const char *)de.name, MSDOS_DOTDOT, MSDOS_NAME) != 0)
+    /* Don't include root directory in the total file count */
+    if (offset)
        ++n_files;
     test_file(fs, new, test);  /* Bad cluster check */
 }
@@ -1023,6 +963,27 @@ static int scan_dir(DOS_FS * fs, DOS_FILE * this, FDSC ** cp)
     i = 0;
     clu_num = FSTART(this, fs);
     new_dir();
+    if (clu_num != 0 && clu_num != -1 && this->offset) {
+       DOS_FILE file;
+
+       file.lfn = NULL;
+       file.lfn_offset = 0;
+       file.next = NULL;
+       file.parent = this;
+       file.first = NULL;
+
+       file.offset = cluster_start(fs, clu_num) + (i % fs->cluster_size);
+       fs_read(file.offset, sizeof(DIR_ENT), &file.dir_ent);
+       if (handle_dot(fs, &file, 0))
+           return 1;
+       i += sizeof(DIR_ENT);
+
+       file.offset = cluster_start(fs, clu_num) + (i % fs->cluster_size);
+       fs_read(file.offset, sizeof(DIR_ENT), &file.dir_ent);
+       if (handle_dot(fs, &file, 1))
+           return 1;
+       i += sizeof(DIR_ENT);
+    }
     while (clu_num > 0 && clu_num != -1) {
        add_file(fs, &chain, this,
                 cluster_start(fs, clu_num) + (i % fs->cluster_size), cp);
@@ -1054,12 +1015,9 @@ static int subdirs(DOS_FS * fs, DOS_FILE * parent, FDSC ** cp)
     DOS_FILE *walk;
 
     for (walk = parent ? parent->first : root; walk; walk = walk->next)
-       if (walk->dir_ent.attr & ATTR_DIR)
-           if (strncmp((const char *)walk->dir_ent.name, MSDOS_DOT, MSDOS_NAME)
-               && strncmp((const char *)walk->dir_ent.name, MSDOS_DOTDOT,
-                          MSDOS_NAME))
-               if (scan_dir(fs, walk, file_cd(cp, (char *)walk->dir_ent.name)))
-                   return 1;
+       if (!IS_FREE(walk->dir_ent.name) && (walk->dir_ent.attr & ATTR_DIR))
+           if (scan_dir(fs, walk, file_cd(cp, (char *)walk->dir_ent.name)))
+               return 1;
     return 0;
 }
 
@@ -1092,3 +1050,293 @@ int scan_root(DOS_FS * fs)
        return 1;
     return subdirs(fs, NULL, &fp_root);
 }
+
+static char print_fat_dirty_state(void)
+{
+    printf("Dirty bit is set. Fs was not properly unmounted and"
+          " some data may be corrupt.\n");
+
+    return get_choice(1, " Automatically removing dirty bit.",
+                     2,
+                     1, "Remove dirty bit",
+                     2, "No action");
+}
+
+void check_dirty_bits(DOS_FS * fs)
+{
+    if (fs->fat_bits == 32) {
+       struct boot_sector b32;
+       FAT_ENTRY fat32_flags;
+
+       get_fat(&fat32_flags, fs->fat, 1, fs);
+       fs_read(0, sizeof(b32), &b32);
+
+       if ((b32.boot_flags & FAT_STATE_DIRTY) || !(fat32_flags.value & FAT32_FLAG_CLEAN_SHUTDOWN)) {
+           if (print_fat_dirty_state() == 1) {
+               if (b32.boot_flags & FAT_STATE_DIRTY) {
+                   b32.boot_flags &= ~FAT_STATE_DIRTY;
+                   fs_write(0, sizeof(b32), &b32);
+               }
+               if (!(fat32_flags.value & FAT32_FLAG_CLEAN_SHUTDOWN)) {
+                   uint32_t *new_flags_ptr = (uint32_t *)(fs->fat + 4);
+                   *new_flags_ptr = htole32(fat32_flags.value | FAT32_FLAG_CLEAN_SHUTDOWN | (fat32_flags.reserved << 28));
+                   fs_write(fs->fat_start + 4, 4, new_flags_ptr);
+                   if (fs->nfats > 1)
+                       fs_write(fs->fat_start + 4 + fs->fat_size, 4, new_flags_ptr);
+               }
+           }
+       }
+    } else {
+       struct boot_sector_16 b16;
+       FAT_ENTRY fat16_flags;
+       int fat16_is_dirty = 0;
+
+       fs_read(0, sizeof(b16), &b16);
+
+       if (fs->fat_bits == 16) {
+           get_fat(&fat16_flags, fs->fat, 1, fs);
+           fat16_is_dirty = !(fat16_flags.value & FAT16_FLAG_CLEAN_SHUTDOWN);
+       }
+
+       if ((b16.boot_flags & FAT_STATE_DIRTY) || fat16_is_dirty) {
+           if (print_fat_dirty_state() == 1) {
+               if (b16.boot_flags & FAT_STATE_DIRTY) {
+                   b16.boot_flags &= ~FAT_STATE_DIRTY;
+                   fs_write(0, sizeof(b16), &b16);
+               }
+               if (fat16_is_dirty) {
+                   uint16_t *new_flags_ptr = (uint16_t *)(fs->fat + 2);
+                   *new_flags_ptr = htole16(fat16_flags.value | FAT16_FLAG_CLEAN_SHUTDOWN);
+                   fs_write(fs->fat_start + 2, 2, new_flags_ptr);
+                   if (fs->nfats > 1)
+                       fs_write(fs->fat_start + 2 + fs->fat_size, 2, new_flags_ptr);
+               }
+           }
+       }
+    }
+}
+
+static void get_new_label(char doslabel[12])
+{
+    char newlabel[256];
+    size_t len;
+    char *p;
+    int ret;
+    int i;
+
+    while (1) {
+        if (get_line("New label", newlabel, sizeof(newlabel))) {
+            if ((p = strchr(newlabel, '\n')))
+                *p = 0;
+
+            len = mbstowcs(NULL, newlabel, 0);
+            if (len != (size_t)-1 && len > 11) {
+                printf("Label can be no longer than 11 characters\n");
+                continue;
+            }
+
+            if (!local_string_to_dos_string(doslabel, newlabel, 12)) {
+                printf("Error when processing label\n");
+                continue;
+            }
+
+            for (i = strlen(doslabel); i < 11; ++i)
+                doslabel[i] = ' ';
+            doslabel[11] = 0;
+
+            ret = validate_volume_label(doslabel);
+            if ((ret && only_uppercase_label) || (ret & ~0x1)) {
+                printf("New label is invalid\n");
+                continue;
+            } else if (ret & 0x1) {
+                printf("Warning: lowercase labels might not work properly on some systems\n");
+            }
+
+            break;
+        }
+    }
+}
+
+static int check_boot_label(DOS_FS *fs)
+{
+    char doslabel[12];
+    wchar_t wlabel[12];
+    int ret;
+    int i;
+
+    ret = validate_volume_label(fs->label);
+    if (ret & ~0x1) {
+        printf("Label '%s' stored in boot sector is not valid.\n", pretty_label(fs->label));
+        switch (get_choice(1, "  Auto-removing label from boot sector.",
+                           2,
+                           1, "Remove invalid label from boot sector",
+                           2, "Enter new label")) {
+        case 1:
+            write_boot_label(fs, "NO NAME    ");
+            memcpy(fs->label, "NO NAME    ", 11);
+            return 1;
+        case 2:
+            get_new_label(doslabel);
+            write_boot_label(fs, doslabel);
+            memcpy(fs->label, doslabel, 11);
+            return 1;
+        }
+    } else if ((ret & 0x1) && only_uppercase_label) {
+        printf("Label '%s' stored in boot sector contains lowercase characters.\n", pretty_label(fs->label));
+        switch (get_choice(1, "  Auto-changing lowercase characters to uppercase",
+                           3,
+                           1, "Change lowercase characters to uppercase",
+                           2, "Remove invalid label",
+                           2, "Set new label")) {
+        case 1:
+            if (!dos_string_to_wchar_string(wlabel, fs->label, sizeof(wlabel)))
+                die("Cannot change lowercase characters to uppercase.");
+            for (i = 0; i < 11; ++i)
+                wlabel[i] = towupper(wlabel[i]);
+            if (!wchar_string_to_dos_string(doslabel, wlabel, sizeof(doslabel)))
+                die("Cannot change lowercase characters to uppercase.");
+            write_boot_label(fs, doslabel);
+            memcpy(fs->label, doslabel, 11);
+            return 1;
+        case 2:
+            write_boot_label(fs, "NO NAME    ");
+            memcpy(fs->label, "NO NAME    ", 11);
+            return 1;
+        case 3:
+            get_new_label(doslabel);
+            write_boot_label(fs, doslabel);
+            memcpy(fs->label, doslabel, 11);
+            return 1;
+        }
+    }
+
+    return 0;
+}
+
+void check_label(DOS_FS *fs)
+{
+    DIR_ENT de;
+    off_t offset;
+    char buffer[256];
+    char doslabel[12];
+    wchar_t wlabel[12];
+    int ret;
+    int i;
+
+    offset = find_volume_de(fs, &de);
+
+    if (offset == 0 && memcmp(fs->label, "NO NAME    ", 11) != 0)
+        check_boot_label(fs);
+
+    if (offset == 0 && memcmp(fs->label, "NO NAME    ", 11) != 0) {
+        printf("Label in boot sector is '%s', but there is no volume label in root directory.\n", pretty_label(fs->label));
+        switch (get_choice(1, "  Auto-removing label from boot sector.",
+                           2,
+                           1, "Remove label from boot sector",
+                           2, "Copy label from boot sector to root directory")) {
+        case 1:
+            write_boot_label(fs, "NO NAME    ");
+            memcpy(fs->label, "NO NAME    ", 11);
+            break;
+        case 2:
+            write_volume_label(fs, fs->label);
+            offset = find_volume_de(fs, &de);
+            break;
+        }
+    }
+
+    if (offset != 0) {
+        memcpy(doslabel, de.name, 11);
+        if (doslabel[0] == 0x05)
+            doslabel[0] = 0xe5;
+        ret = validate_volume_label(doslabel);
+        if (ret & ~0x1) {
+            printf("Volume label '%s' stored in root directory is not valid.\n", pretty_label(doslabel));
+            switch (get_choice(1, "  Auto-removing label.",
+                               2,
+                               1, "Remove invalid label",
+                               2, "Set new label")) {
+            case 1:
+                remove_label(fs);
+                memcpy(fs->label, "NO NAME    ", 11);
+                offset = 0;
+                break;
+            case 2:
+                get_new_label(doslabel);
+                write_label(fs, doslabel);
+                memcpy(fs->label, doslabel, 11);
+                break;
+            }
+        } else if ((ret & 0x1) && only_uppercase_label) {
+            printf("Volume label '%s' stored in root directory contains lowercase characters.\n", pretty_label(doslabel));
+            switch (get_choice(1, "  Auto-changing lowercase characters to uppercase",
+                               3,
+                               1, "Change lowercase characters to uppercase",
+                               2, "Remove invalid label",
+                               2, "Set new label")) {
+            case 1:
+                if (!dos_string_to_wchar_string(wlabel, doslabel, sizeof(wlabel)))
+                    die("Cannot change lowercase characters to uppercase.");
+                for (i = 0; i < 11; ++i)
+                    wlabel[i] = towupper(wlabel[i]);
+                if (!wchar_string_to_dos_string(doslabel, wlabel, sizeof(doslabel)))
+                    die("Cannot change lowercase characters to uppercase.");
+                write_label(fs, doslabel);
+                memcpy(fs->label, doslabel, 11);
+                break;
+            case 2:
+                remove_label(fs);
+                memcpy(fs->label, "NO NAME    ", 11);
+                offset = 0;
+                break;
+            case 3:
+                get_new_label(doslabel);
+                write_label(fs, doslabel);
+                memcpy(fs->label, doslabel, 11);
+                break;
+            }
+        }
+    }
+
+again:
+
+    if (offset != 0 && memcmp(fs->label, "NO NAME    ", 11) == 0 && memcmp(doslabel, "NO NAME    ", 11) != 0) {
+        printf("There is no label in boot sector, but there is volume label '%s' stored in root directory\n", pretty_label(doslabel));
+        switch (get_choice(1, "  Auto-copying volume label from root directory to boot sector.",
+                           2,
+                           1, "Copy volume label from root directory to boot sector",
+                           2, "Remove volume label from root directory")) {
+        case 1:
+            write_boot_label(fs, doslabel);
+            memcpy(fs->label, doslabel, 11);
+            break;
+        case 2:
+            remove_label(fs);
+            offset = 0;
+            break;
+        }
+    }
+
+    if (offset != 0 && memcmp(fs->label, "NO NAME    ", 11) != 0 && memcmp(fs->label, doslabel, 11) != 0) {
+        strncpy(buffer, pretty_label(doslabel), sizeof(buffer)-1);
+        buffer[sizeof(buffer)-1] = 0;
+        printf("Volume label '%s' stored in root directory and label '%s' stored in boot sector and different.\n", buffer, pretty_label(fs->label));
+        switch (get_choice(1, "  Auto-copying volume label from root directory to boot sector.",
+                           2,
+                           1, "Copy volume label from root directory to boot sector",
+                           2, "Copy label from boot sector to root directory")) {
+        case 1:
+            write_boot_label(fs, doslabel);
+            memcpy(fs->label, doslabel, 11);
+            break;
+        case 2:
+            ret = check_boot_label(fs);
+            if (ret)
+                goto again;
+            write_volume_label(fs, fs->label);
+            offset = find_volume_de(fs, &de);
+            /* NOTE: doslabel is not updated */
+            break;
+        }
+    }
+}
index 4dfa03a..0bc2020 100644 (file)
 #ifndef _CHECK_H
 #define _CHECK_H
 
-off_t alloc_rootdir_entry(DOS_FS * fs, DIR_ENT * de, const char *pattern, int gen_name);
-
-/* Allocate a free slot in the root directory for a new file. If gen_name is
-   true, the file name is constructed after 'pattern', which must include a %d
-   type format for printf and expand to exactly 11 characters. The name
-   actually used is written into the 'de' structure, the rest of *de is cleared.
-   The offset returned is to where in the filesystem the entry belongs. */
+void check_dirty_bits(DOS_FS * fs);
 
 int scan_root(DOS_FS * fs);
 
@@ -37,4 +31,10 @@ int scan_root(DOS_FS * fs);
    for all the details. Returns a non-zero integer if the filesystem has to
    be checked again. */
 
+
+void check_label(DOS_FS * fs);
+
+/* Checks the volume label from the root directory entry that is valid and
+ * matches the label stored in boot sector. */
+
 #endif
index 9d11193..6a2e396 100644 (file)
@@ -3,6 +3,7 @@
    Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
    Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
    Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
+   Copyright (C) 2018 Pali Rohár <pali.rohar@gmail.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
 #include <string.h>
 #include <stdarg.h>
 #include <errno.h>
+#include <wctype.h>
+#include <termios.h>
+#include <sys/time.h>
+#include <unistd.h>
 
 #include "common.h"
+#include "charconv.h"
+
+
+int interactive;
+int write_immed;
+int atari_format;
+const char *program_name;
+
 
 typedef struct _link {
     void *data;
@@ -41,6 +54,9 @@ void die(const char *msg, ...)
 {
     va_list args;
 
+    if (program_name)
+       fprintf(stderr, "%s: ", program_name);
+
     va_start(args, msg);
     vfprintf(stderr, msg, args);
     va_end(args);
@@ -52,6 +68,9 @@ void pdie(const char *msg, ...)
 {
     va_list args;
 
+    if (program_name)
+       fprintf(stderr, "%s: ", program_name);
+
     va_start(args, msg);
     vfprintf(stderr, msg, args);
     va_end(args);
@@ -96,24 +115,254 @@ int min(int a, int b)
     return a < b ? a : b;
 }
 
-char get_key(const char *valid, const char *prompt)
+
+#ifndef HAVE_VASPRINTF
+static int vasprintf(char **strp, const char *fmt, va_list va)
+{
+    int length;
+    va_list vacopy;
+
+    va_copy(vacopy, va);
+
+    length = vsnprintf(NULL, 0, fmt, vacopy);
+    if (length < 0)
+       return length;
+
+    *strp = malloc(length + 1);
+    if (!*strp) {
+       errno = ENOMEM;
+       return -1;
+    }
+
+    return vsnprintf(*strp, length + 1, fmt, va);
+}
+#endif
+
+int xasprintf(char **strp, const char *fmt, ...)
+{
+    va_list va;
+    int retval;
+
+    va_start(va, fmt);
+    retval = vasprintf(strp, fmt, va);
+    va_end(va);
+
+    if (retval < 0)
+       pdie("asprintf");
+
+    return retval;
+}
+
+
+int get_choice(int noninteractive_result, const char *noninteractive_msg,
+              int choices, ...)
 {
-    int ch, okay;
+    int choice_values[9];
+    const char *choice_strings[9];
+    int choice;
+    int quit_choice;
+    int print_choices, print_full_choices;
+    va_list va;
+    int i;
+    static int inhibit_quit_choice;
+
+    if (!interactive) {
+       printf("%s\n", noninteractive_msg);
+       return noninteractive_result;
+    }
 
+    if (choices < 2 || choices > 9)
+       die("internal error: invalid number %u of choices in get_choice()",
+           choices);
+
+    va_start(va, choices);
+    for (i = 0; i < choices; i++) {
+       choice_values[i] = va_arg(va, int);
+       choice_strings[i] = va_arg(va, const char *);
+    }
+    va_end(va);
+
+    print_choices = 1;
+    print_full_choices = 0;
     while (1) {
-       if (prompt)
-           printf("%s ", prompt);
+       if (print_choices) {
+           print_choices = 0;
+           for (i = 0; i < choices; i++)
+               printf("%d) %s\n", i + 1, choice_strings[i]);
+
+           if (print_full_choices) {
+               printf("?) List all choices\n");
+               printf("q) Quit fsck\n");
+           }
+       }
+
+       printf("[%.*s?%s]? ", choices, "123456789", inhibit_quit_choice ? "" : "q");
        fflush(stdout);
-       while (ch = getchar(), ch == ' ' || ch == '\t') ;
-       if (ch == EOF)
-           exit(1);
-       if (!strchr(valid, okay = ch))
-           okay = 0;
-       while (ch = getchar(), ch != '\n' && ch != EOF) ;
-       if (ch == EOF)
+
+       do {
+           choice = getchar();
+       } while (choice == '\n');  /* filter out enter presses */
+
+       if (choice == EOF)
            exit(1);
-       if (okay)
-           return okay;
-       printf("Invalid input.\n");
+
+       printf("%c\n", choice);
+
+       if (choice > '0' && choice <= '0' + choices)
+           break;
+
+       if (choice == '?') {
+           print_choices = 1;
+           print_full_choices = 1;
+       }
+
+       if (!inhibit_quit_choice && (choice == 'q' || choice == 'Q')) {
+           if (!write_immed)
+               printf("No changes have been written to the filesystem yet. If you choose\n"
+                      "to quit, it will be left in the same state it was in before you\n"
+                      "started this program.\n");
+           else
+               printf("fsck is running in immediate write mode. All changes so far have\n"
+                      "already been written and can not be undone now. If you choose to\n"
+                      "quit now, these changes will stay in place.\n");
+
+           inhibit_quit_choice = 1;
+           quit_choice = get_choice(1, "This is never non-interactive.",
+                                    2,
+                                    1, "Quit now",
+                                    2, "Continue");
+           inhibit_quit_choice = 0;
+
+           if (quit_choice == 1)
+               exit(0);
+       }
+    }
+
+    return choice_values[choice - '1'];
+}
+
+
+char *get_line(const char *prompt, char *dest, size_t length)
+{
+    struct termios tio, tio_orig;
+    int tio_fail;
+    char *retval;
+
+    tio_fail = tcgetattr(0, &tio_orig);
+    if (!tio_fail) {
+       tio = tio_orig;
+       tio.c_lflag |= ICANON | ECHO;
+       tcsetattr(0, TCSAFLUSH, &tio);
+    }
+
+    printf("%s: ", prompt);
+    fflush(stdout);
+
+    retval = fgets(dest, length, stdin);
+
+    if (!tio_fail)
+       tcsetattr(0, TCSAFLUSH, &tio_orig);
+    return retval;
+}
+
+
+/*
+ * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant
+ * of MS-DOS filesystem by default.
+ */
+void check_atari(void)
+{
+#if defined(__mc68000__) && defined(__linux__) && defined(CONF_CHECK_ATARI)
+    FILE *f;
+    char line[128], *p;
+
+    if (!(f = fopen("/proc/hardware", "r"))) {
+       perror("/proc/hardware");
+       return;
+    }
+
+    while (fgets(line, sizeof(line), f)) {
+       if (strncmp(line, "Model:", 6) == 0) {
+           p = line + 6;
+           p += strspn(p, " \t");
+           if (strncmp(p, "Atari ", 6) == 0)
+               atari_format = 1;
+           break;
+       }
+    }
+    fclose(f);
+#endif
+}
+
+
+uint32_t generate_volume_id(void)
+{
+    struct timeval now;
+
+    if (gettimeofday(&now, NULL) != 0 || now.tv_sec == (time_t)-1 || now.tv_sec < 0) {
+        srand(getpid());
+        /* rand() returns int from [0,RAND_MAX], therefore only 31 bits */
+        return (((uint32_t)(rand() & 0xFFFF)) << 16) | ((uint32_t)(rand() & 0xFFFF));
+    }
+
+    /* volume ID = current time, fudged for more uniqueness */
+    return ((uint32_t)now.tv_sec << 20) | (uint32_t)now.tv_usec;
+}
+
+/*
+ * Validate volume label
+ *
+ * @param[in]   doslabel   Label stored according to current DOS codepage
+ *
+ * @return   bitmask of errors
+ *           0x01 - lowercase character
+ *           0x02 - character below 0x20
+ *           0x04 - character in disallowed set
+ *           0x08 - empty or space-only label
+ *           0x10 - space at beginning
+ */
+int validate_volume_label(char *doslabel)
+{
+    int i;
+    int ret = 0;
+    wchar_t wlabel[12];
+
+    if (dos_string_to_wchar_string(wlabel, doslabel, sizeof(wlabel))) {
+        for (i = 0; wlabel[i]; i++) {
+            /* FAT specification: Lower case characters are not allowed in DIR_Name
+                                  (what these characters are is country specific)
+               Original label is stored in DOS OEM code page, so islower() function
+               cannot be used. Therefore convert original label to locale independent
+               wchar_t* and then use iswlower() function for it.
+            */
+            if (iswlower(wlabel[i])) {
+                ret |= 0x01;
+                break;
+            }
+        }
     }
+
+    /* According to FAT specification those bytes (after conversion to DOS OEM
+       code page) are not allowed.
+     */
+    for (i = 0; i < 11; i++) {
+        if (doslabel[i] < 0x20)
+            ret |= 0x02;
+        if (doslabel[i] == 0x22 ||
+            (doslabel[i] >= 0x2A && doslabel[i] <= 0x2C) ||
+            doslabel[i] == 0x2E ||
+            doslabel[i] == 0x2F ||
+            (doslabel[i] >= 0x3A && doslabel[i] <= 0x3F) ||
+            (doslabel[i] >= 0x5B && doslabel[i] <= 0x5D) ||
+            doslabel[i] == 0x7C)
+            ret |= 0x04;
+    }
+
+    if (memcmp(doslabel, "           ", 11) == 0)
+        ret |= 0x08;
+
+    if (doslabel[0] == ' ')
+        ret |= 0x10;
+
+    return ret;
 }
index e2c398c..9a68531 100644 (file)
 #ifndef _COMMON_H
 #define _COMMON_H
 
+#include <sys/types.h>
+
+#include <limits.h>
+#include <stdint.h>
+
+#ifndef OFF_MAX
+       #define OFF_MAX (off_t)((1ULL << (sizeof(off_t) * CHAR_BIT - 1)) - 1)
+#endif
+
+extern int interactive;
+extern int write_immed;
+extern int atari_format;       /* Use Atari variation of MS-DOS FS format */
+
+/* program_name used for printing messages; no name will be printed when it is
+ * left as NULL */
+extern const char *program_name;
+
 void die(const char *msg, ...)
     __attribute((noreturn, format(printf, 1, 2)));
 
@@ -50,9 +67,51 @@ int min(int a, int b);
 
 /* Returns the smaller integer value of a and b. */
 
-char get_key(const char *valid, const char *prompt);
+int xasprintf(char **strp, const char *fmt, ...)
+    __attribute((format(printf, 2, 3)));
+
+/* Runs asprintf() and terminates the program if it fails. */
+
+int get_choice(int noninteractive_result, const char *noninteractive_msg,
+              int choices, ...);
+
+/*
+ * Display a numbered list of choices and accept user input to select one. If
+ * interactive is false, it will instead print noninteractive_msg and return
+ * noninteractive_result. The number of options must be given in choices and
+ * must be more than one and less then ten.
+ *
+ * The variable arguments are choices times <int val, const char *desc>, where
+ * val is the value that is returned when the user selects this option and desc
+ * is the string describing this option.
+ */
+
+char *get_line(const char *prompt, char *dest, size_t length);
+
+/*
+ * Display prompt and read a line, placing it in dest with at most length-1
+ * characters plus a null byte. This behaves like printing a prompt and fgets()
+ * afterwards with the addition of temporarily enabling canonical input mode
+ * with echo if needed.
+ */
+
+void check_atari(void);
+
+/*
+ * ++roman: On m68k Linux, check if this is an Atari; if yes, turn on Atari
+ * variant of MS-DOS filesystem by default.
+ */
+
+uint32_t generate_volume_id(void);
+
+/*
+ * Generate a 32 bit volume ID
+ */
+
+int validate_volume_label(char *doslabel);
 
-/* Displays PROMPT and waits for user input. Only characters in VALID are
-   accepted. Terminates the program on EOF. Returns the character. */
+/*
+ * Validate volume label
+ */
 
 #endif
index cd57388..21c438f 100644 (file)
@@ -1,6 +1,7 @@
 /* device_info.c - Collect device information for mkfs.fat
 
    Copyright (C) 2015 Andreas Bombe <aeb@debian.org>
+   Copyright (C) 2018 Pali Rohár <pali.rohar@gmail.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
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
+#include <sys/sysmacros.h>
 
-#ifdef HAVE_UDEV
-#include <libudev.h>
+#ifdef HAVE_LINUX_LOOP_H
+#include <linux/loop.h>
 #endif
 
 #if HAVE_DECL_GETMNTENT
@@ -44,6 +46,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <errno.h>
 
 #include "blkdev.h"
 #include "device_info.h"
@@ -56,6 +59,7 @@ static const struct device_info device_info_clueless = {
     .geom_heads   = -1,
     .geom_sectors = -1,
     .geom_start   = -1,
+    .geom_size    = -1,
     .sector_size  = -1,
     .size         = -1,
 };
@@ -73,9 +77,10 @@ static void get_block_device_size(struct device_info *info, int fd)
 }
 
 
-static void get_block_geometry(struct device_info *info, int fd)
+static void get_block_geometry(struct device_info *info, int fd, dev_t rdev)
 {
-    unsigned int heads, sectors, start;
+    unsigned int heads, sectors;
+    unsigned long long start;
 
     if (!blkdev_get_geometry(fd, &heads, &sectors)
            && heads && sectors) {
@@ -83,7 +88,7 @@ static void get_block_geometry(struct device_info *info, int fd)
        info->geom_sectors = sectors;
     }
 
-    if (!blkdev_get_start(fd, &start))
+    if (!blkdev_get_start(fd, rdev, &start))
        info->geom_start = start;
 }
 
@@ -97,169 +102,179 @@ static void get_sector_size(struct device_info *info, int fd)
 }
 
 
-static int udev_fill_info(struct device_info *info, struct stat *stat);
-
-#ifdef HAVE_UDEV
-static int udev_fill_info(struct device_info *info, struct stat *stat)
+#ifdef __linux__
+static void get_block_linux_info(struct device_info *info, int devfd, dev_t rdev)
 {
-    struct udev *ctx;
-    struct udev_device *dev, *parent;
-    struct udev_enumerate *uenum;
-    const char *attr;
-    char holders_path[PATH_MAX + 1];
-    DIR *holders_dir;
-    struct dirent *dir_entry;
-    unsigned long number;
-    char *endptr;
-
-    if (device_info_verbose >= 3)
-       printf("udev_fill_info()\n");
-
-    ctx = udev_new();
-    if (!ctx) {
-       if (device_info_verbose)
-           printf("no udev library context\n");
-       return -1;
-    }
+    struct stat st;
+    char path[PATH_MAX];
+    int fd;
+    int blockfd;
+    FILE *file;
+    DIR *dir;
+    struct dirent *d;
+    int maj;
+    int min;
+    long long start;
+    int removable;
+
+#ifdef HAVE_LINUX_LOOP_H
+    struct loop_info64 lo;
+#endif
 
-    dev = udev_device_new_from_devnum(ctx, 'b', stat->st_rdev);
-    if (!dev) {
-       if (device_info_verbose)
-           printf("no udev context\n");
-       udev_unref(ctx);
-       return -1;
+    maj = major(rdev);
+    min = minor(rdev);
+
+    snprintf(path, sizeof(path), "/sys/dev/block/%d:%d", maj, min);
+    blockfd = open(path, O_RDONLY | O_DIRECTORY);
+    if (blockfd < 0)
+        return;
+
+    /* Check if device is partition */
+    fd = openat(blockfd, "partition", O_RDONLY);
+    if (fd >= 0) {
+        file = fdopen(fd, "r");
+        if (file) {
+            if (fscanf(file, "%d", &info->partition) != 1 || info->partition == 0)
+                info->partition = -1;
+            fclose(file);
+        } else {
+            close(fd);
+        }
+        /* Read total number of sectors of the disk */
+        fd = openat(blockfd, "../size", O_RDONLY);
+        if (fd >= 0) {
+            file = fdopen(fd, "r");
+            if (file) {
+                if (fscanf(file, "%lld", &info->geom_size) != 1 || info->geom_size == 0)
+                    info->geom_size = -1;
+                fclose(file);
+            } else {
+                close(fd);
+            }
+        }
+    } else if (errno == ENOENT && info->geom_start <= 0) {
+        info->partition = 0;
+        if (info->size > 0 && info->sector_size > 0)
+            info->geom_size = info->size / info->sector_size;
     }
 
-    /*
-     * first, look for for dependent devices (partitions or virtual mappings on
-     * this device)
-     */
-    if (device_info_verbose >= 3)
-       printf("looking for dependent devices\n");
-
-    uenum = udev_enumerate_new(ctx);
-    if (uenum) {
-       struct udev_list_entry *entry;
-       if (udev_enumerate_add_match_parent(uenum, dev) >= 0 &&
-               udev_enumerate_scan_devices(uenum) >= 0) {
-           entry = udev_enumerate_get_list_entry(uenum);
-           if (entry) {
-               /*
-                * the list of children includes the parent device, so make
-                * sure that has_children is -1 to end up with the correct
-                * count
-                */
-               info->has_children = -1;
-
-               while (entry) {
-                   if (device_info_verbose >= 2)
-                       printf("child-or-self: %s\n", udev_list_entry_get_name(entry));
-                   entry = udev_list_entry_get_next(entry);
-                   info->has_children++;
-               }
-           } else
-               info->has_children = 0;
-       }
-       udev_enumerate_unref(uenum);
+    /* Check if device has partition subdevice and therefore has children */
+    fd = dup(blockfd);
+    if (fd >= 0) {
+        dir = fdopendir(fd);
+        if (dir) {
+            info->has_children = 0;
+            errno = 0;
+            while ((d = readdir(dir))) {
+                if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
+                    continue;
+                if (d->d_type != DT_DIR && d->d_type != DT_UNKNOWN)
+                    continue;
+                snprintf(path, sizeof(path), "%s/partition", d->d_name);
+                if (fstatat(blockfd, path, &st, 0) == 0) {
+                    if (S_ISREG(st.st_mode)) {
+                        start = -1;
+                        snprintf(path, sizeof(path), "%s/start", d->d_name);
+                        fd = openat(blockfd, path, O_RDONLY);
+                        if (fd >= 0) {
+                            file = fdopen(fd, "r");
+                            if (file) {
+                                if (fscanf(file, "%lld", &start) != 1)
+                                    start = -1;
+                                fclose(file);
+                            } else {
+                                close(fd);
+                            }
+                        }
+                        /* If subdevice starts at zero offset then it is whole device, so it is not a child */
+                        if (start != 0) {
+                            info->has_children = 1;
+                            break;
+                        }
+                    }
+                } else if (errno != ENOENT) {
+                    info->has_children = -1;
+                }
+                errno = 0;
+            }
+            if (errno != 0 && info->has_children == 0)
+                info->has_children = -1;
+            closedir(dir);
+        } else {
+            close(fd);
+        }
     }
 
-    /* see if the holders directory in sysfs exists and has entries */
-    if (device_info_verbose >= 2)
-       printf("syspath: %s\n", udev_device_get_syspath(dev));
-    if (info->has_children < 1 || device_info_verbose >= 3) {
-       snprintf(holders_path, PATH_MAX, "%s/holders",
-               udev_device_get_syspath(dev));
-       holders_path[PATH_MAX] = 0;
-
-       if (info->has_children < 0)
-           info->has_children = 0;
-
-       holders_dir = opendir(holders_path);
-       if (holders_dir) {
-           dir_entry = readdir(holders_dir);
-           while (dir_entry) {
-               if (dir_entry->d_reclen && dir_entry->d_name[0] != '.') {
-                   if (device_info_verbose >= 2)
-                       printf("holder: %s\n", dir_entry->d_name);
-
-                   info->has_children++;
-
-                   /* look up and print every holder when very verbose */
-                   if (device_info_verbose < 3)
-                       break;
-               }
-               dir_entry = readdir(holders_dir);
-           }
-
-           closedir(holders_dir);
-       }
+    /* Check if device has holders and therefore has children */
+    if (info->has_children <= 0) {
+        fd = openat(blockfd, "holders", O_RDONLY | O_DIRECTORY);
+        if (fd >= 0) {
+            dir = fdopendir(fd);
+            if (dir) {
+                while ((d = readdir(dir))) {
+                    if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
+                        continue;
+                    info->has_children = 1;
+                    break;
+                }
+                closedir(dir);
+            } else {
+                close(fd);
+            }
+        }
     }
 
-    /*
-     * block devices on real hardware have either other block devices
-     * (in the case of partitions) or the actual hardware as parent
-     */
-    parent = udev_device_get_parent(dev);
-
-    if (!parent) {
-       if (device_info_verbose >= 3)
-           printf("no parent found, therefore virtual device\n");
-       info->type = TYPE_VIRTUAL;
-       info->partition = 0;
-       udev_device_unref(dev);
-       return 0;
+    /* Check if device is slave of another device and therefore is virtual */
+    fd = openat(blockfd, "slaves", O_RDONLY | O_DIRECTORY);
+    if (fd >= 0) {
+        dir = fdopendir(fd);
+        if (dir) {
+            while ((d = readdir(dir))) {
+                if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0)
+                    continue;
+                info->type = TYPE_VIRTUAL;
+                break;
+            }
+            closedir(dir);
+        } else {
+            close(fd);
+        }
     }
 
-    attr = udev_device_get_sysattr_value(dev, "removable");
-    if (device_info_verbose >= 3) {
-       if (attr)
-           printf("attribute \"removable\" is \"%s\"\n", attr);
-       else
-           printf("attribute \"removable\" not found\n");
-    }
-    if (attr && !strcmp(attr, "1"))
-       info->type = TYPE_REMOVABLE;
-    else
-       info->type = TYPE_FIXED;
-
-    attr = udev_device_get_sysattr_value(dev, "partition");
-    if (attr) {
-       if (device_info_verbose >= 3)
-           printf("attribute \"partition\" is \"%s\"\n", attr);
-
-       number = strtoul(attr, &endptr, 10);
-       if (!*endptr)
-           info->partition = number;
-    } else {
-       printf("attribute \"partition\" not found\n");
-       if (info->type != TYPE_VIRTUAL && parent) {
-           /* partitions have other block devices as parent */
-           attr = udev_device_get_subsystem(parent);
-           if (attr) {
-               if (device_info_verbose >= 3)
-                   printf("parent subsystem is \"%s\"\n", attr);
-
-               if (!strcmp(attr, "block"))
-                   /* we don't know the partition number, use 1 */
-                   info->partition = 1;
-               else
-                   info->partition = 0;
-           }
-       }
+#ifdef HAVE_LINUX_LOOP_H
+    /* Check if device is loop and detect if is based from regular file or is virtual */
+    if (info->type == TYPE_UNKNOWN && info->partition == 0 && ioctl(devfd, LOOP_GET_STATUS64, &lo) == 0) {
+        if (lo.lo_offset == 0 && lo.lo_sizelimit == 0 && lo.lo_encrypt_type == LO_CRYPT_NONE &&
+            stat((char *)lo.lo_file_name, &st) == 0 && S_ISREG(st.st_mode) &&
+            st.st_dev == lo.lo_device && st.st_ino == lo.lo_inode && st.st_size == info->size)
+            info->type = TYPE_FILE;
+        else
+            info->type = TYPE_VIRTUAL;
     }
+#endif
 
-    udev_device_unref(dev);
-    udev_unref(ctx);
-    return 0;
-}
-#else  /* HAVE_UDEV */
-static int udev_fill_info(struct device_info *info, struct stat *stat)
-{
-    /* prevent "unused parameter" warning */
-    (void)stat;
-    (void)info;
+    /* Device is neither loop nor virtual, so is either removable or fixed */
+    if (info->type == TYPE_UNKNOWN) {
+        removable = 0;
+        fd = openat(blockfd, "removable", O_RDONLY);
+        if (fd >= 0) {
+            file = fdopen(fd, "r");
+            if (file) {
+                if (fscanf(file, "%d", &removable) != 1)
+                    removable = 0;
+                fclose(file);
+            } else {
+                close(fd);
+            }
+        }
+
+        if (removable)
+            info->type = TYPE_REMOVABLE;
+        else
+            info->type = TYPE_FIXED;
+    }
 
-    return -1;
+    close(blockfd);
 }
 #endif
 
@@ -292,11 +307,12 @@ int get_device_info(int fd, struct device_info *info)
     }
 
     get_block_device_size(info, fd);
-    get_block_geometry(info, fd);
+    get_block_geometry(info, fd, stat.st_rdev);
     get_sector_size(info, fd);
 
-    /* use udev information if available */
-    udev_fill_info(info, &stat);
+#ifdef __linux__
+    get_block_linux_info(info, fd, stat.st_rdev);
+#endif
 
     return 0;
 }
index 3f4195a..da36e7e 100644 (file)
@@ -34,7 +34,8 @@ struct device_info {
      */
     int geom_heads;
     int geom_sectors;
-    long geom_start;
+    long long geom_start;
+    long long geom_size;
 
     /*
      * detected sector size or -1 if unknown
index d994e8e..d9d5aaf 100644 (file)
--- a/src/fat.c
+++ b/src/fat.c
@@ -3,6 +3,7 @@
    Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
    Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
    Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
+   Copyright (C) 2021 Pali Rohár <pali.rohar@gmail.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
@@ -32,6 +33,7 @@
 #include "common.h"
 #include "fsck.fat.h"
 #include "io.h"
+#include "boot.h"
 #include "check.h"
 #include "fat.h"
 
@@ -75,6 +77,31 @@ void get_fat(FAT_ENTRY * entry, void *fat, uint32_t cluster, DOS_FS * fs)
     }
 }
 
+void release_fat(DOS_FS * fs)
+{
+    if (fs->fat)
+       free(fs->fat);
+    if (fs->cluster_owner)
+       free(fs->cluster_owner);
+    fs->fat = NULL;
+    fs->cluster_owner = NULL;
+}
+
+static void fix_first_cluster(DOS_FS * fs, void * first_cluster)
+{
+    struct boot_sector b;
+
+    fs_read(0, sizeof(b), &b);
+
+    printf("Fixing first cluster in FAT.\n");
+    if (fs->fat_bits == 12)
+        *(uint16_t *)first_cluster = htole16((le16toh(*(uint16_t *)first_cluster) & 0xf000) | FAT_EXTD(fs) | b.media);
+    else if (fs->fat_bits == 16)
+        *(uint16_t *)first_cluster = htole16(FAT_EXTD(fs) | b.media);
+    else
+        *(uint32_t *)first_cluster = htole32(FAT_EXTD(fs) | b.media);
+}
+
 /**
  * Build a bookkeeping structure from the partition's FAT table.
  * If the partition has multiple FATs and they don't agree, try to pick a winner,
@@ -82,22 +109,24 @@ void get_fat(FAT_ENTRY * entry, void *fat, uint32_t cluster, DOS_FS * fs)
  * One error that is fixed here is a cluster that links to something out of range.
  *
  * @param[inout]    fs      Information about the filesystem
+ * @param[in]       mode    0 - read-only, 1 - read-write (no repair), 2 - repair
  */
-void read_fat(DOS_FS * fs)
+void read_fat(DOS_FS * fs, int mode)
 {
     int eff_size, alloc_size;
     uint32_t i;
     void *first, *second = NULL;
-    int first_ok, second_ok;
+    int first_ok, second_ok = 0;
+    FAT_ENTRY first_media, second_media;
     uint32_t total_num_clusters;
 
+    if (fat_table > fs->nfats)
+        die("Requested FAT table %ld does not exist.", fat_table);
+    if (fat_table > 2)
+        die("Reading FAT table greather than 2 is implemented yet.");
+
     /* Clean up from previous pass */
-    if (fs->fat)
-       free(fs->fat);
-    if (fs->cluster_owner)
-       free(fs->cluster_owner);
-    fs->fat = NULL;
-    fs->cluster_owner = NULL;
+    release_fat(fs);
 
     total_num_clusters = fs->data_clusters + 2;
     eff_size = (total_num_clusters * fs->fat_bits + 7) / 8ULL;
@@ -111,45 +140,80 @@ void read_fat(DOS_FS * fs)
 
     first = alloc(alloc_size);
     fs_read(fs->fat_start, eff_size, first);
+    get_fat(&first_media, first, 0, fs);
+    first_ok = (first_media.value & FAT_EXTD(fs)) == FAT_EXTD(fs);
     if (fs->nfats > 1) {
        second = alloc(alloc_size);
        fs_read(fs->fat_start + fs->fat_size, eff_size, second);
-    }
-    if (second && memcmp(first, second, eff_size) != 0) {
-       FAT_ENTRY first_media, second_media;
-       get_fat(&first_media, first, 0, fs);
        get_fat(&second_media, second, 0, fs);
-       first_ok = (first_media.value & FAT_EXTD(fs)) == FAT_EXTD(fs);
        second_ok = (second_media.value & FAT_EXTD(fs)) == FAT_EXTD(fs);
+    }
+    if (mode != 0 && fat_table == 0) {
+        if (!first_ok && second && !second_ok)
+            die("Both FATs appear to be corrupt. Giving up. Run fsck.fat with non-zero -F option.");
+        if (!first_ok && !second)
+            die("First FAT appears to be corrupt and second FAT does not exist. Giving up. Run fsck.fat with -F 1 option.");
+    }
+    if (mode == 0 && !first_ok && second && second_ok) {
+        /* In read-only mode if first FAT is corrupted and second is OK then use second FAT */
+        void *first_backup = first;
+        first = second;
+        second = first_backup;
+    }
+    if (mode != 0 && fat_table == 0 && second && memcmp(first, second, eff_size) != 0) {
+       if (mode != 2)
+           die("FATs differ, please run fsck.fat");
        if (first_ok && !second_ok) {
            printf("FATs differ - using first FAT.\n");
            fs_write(fs->fat_start + fs->fat_size, eff_size, first);
-       }
-       if (!first_ok && second_ok) {
+       } else if (!first_ok && second_ok) {
            printf("FATs differ - using second FAT.\n");
            fs_write(fs->fat_start, eff_size, second);
            memcpy(first, second, eff_size);
-       }
-       if (first_ok && second_ok) {
-           if (interactive) {
-               printf("FATs differ but appear to be intact. Use which FAT ?\n"
-                      "1) Use first FAT\n2) Use second FAT\n");
-               if (get_key("12", "?") == '1') {
-                   fs_write(fs->fat_start + fs->fat_size, eff_size, first);
-               } else {
-                   fs_write(fs->fat_start, eff_size, second);
-                   memcpy(first, second, eff_size);
+       } else {
+           if (first_ok && second_ok)
+               printf("FATs differ but appear to be intact.\n");
+           else
+               printf("FATs differ and both appear to be corrupt.\n");
+           if (get_choice(1, "  Using first FAT.",
+                          2,
+                          1, "Use first FAT",
+                          2, "Use second FAT") == 1) {
+               if (!first_ok) {
+                   fix_first_cluster(fs, first);
+                   fs_write(fs->fat_start, (fs->fat_bits + 7) / 8, first);
                }
-           } else {
-               printf("FATs differ but appear to be intact. Using first "
-                      "FAT.\n");
                fs_write(fs->fat_start + fs->fat_size, eff_size, first);
+           } else {
+               if (!second_ok) {
+                   fix_first_cluster(fs, second);
+                   fs_write(fs->fat_start + fs->fat_size, (fs->fat_bits + 7) / 8, second);
+               }
+               fs_write(fs->fat_start, eff_size, second);
+               memcpy(first, second, eff_size);
            }
        }
-       if (!first_ok && !second_ok) {
-           printf("Both FATs appear to be corrupt. Giving up.\n");
-           exit(1);
-       }
+    }
+    if (mode != 0 && fat_table != 0) {
+        if (fat_table == 1) {
+            printf("Using first FAT.\n");
+            if (!first_ok) {
+                fix_first_cluster(fs, first);
+                fs_write(fs->fat_start, (fs->fat_bits + 7) / 8, first);
+            }
+            if (second && memcmp(first, second, eff_size) != 0)
+                fs_write(fs->fat_start + fs->fat_size, eff_size, first);
+        } else if (fat_table == 2) {
+            printf("Using second FAT.\n");
+            if (!second_ok) {
+                fix_first_cluster(fs, second);
+                fs_write(fs->fat_start + fs->fat_size, (fs->fat_bits + 7) / 8, second);
+            }
+            if (memcmp(first, second, eff_size) != 0) {
+                fs_write(fs->fat_start, eff_size, second);
+                memcpy(first, second, eff_size);
+            }
+        }
     }
     if (second) {
        free(second);
@@ -159,17 +223,27 @@ void read_fat(DOS_FS * fs)
     fs->cluster_owner = alloc(total_num_clusters * sizeof(DOS_FILE *));
     memset(fs->cluster_owner, 0, (total_num_clusters * sizeof(DOS_FILE *)));
 
+    if (mode == 0)
+        return;
+
     /* Truncate any cluster chains that link to something out of range */
     for (i = 2; i < fs->data_clusters + 2; i++) {
        FAT_ENTRY curEntry;
        get_fat(&curEntry, fs->fat, i, fs);
        if (curEntry.value == 1) {
+           if (mode != 2)
+               die("Cluster %ld out of range (1), please run fsck.fat",
+                   (long)(i - 2));
            printf("Cluster %ld out of range (1). Setting to EOF.\n",
                   (long)(i - 2));
            set_fat(fs, i, -1);
        }
        if (curEntry.value >= fs->data_clusters + 2 &&
            (curEntry.value < FAT_MIN_BAD(fs))) {
+           if (mode != 2)
+               die("Cluster %ld out of range (%ld > %ld), please run fsck.fat",
+                   (long)(i - 2), (long)curEntry.value,
+                   (long)(fs->data_clusters + 2 - 1));
            printf("Cluster %ld out of range (%ld > %ld). Setting to EOF.\n",
                   (long)(i - 2), (long)curEntry.value,
                   (long)(fs->data_clusters + 2 - 1));
@@ -293,7 +367,8 @@ uint32_t next_cluster(DOS_FS * fs, uint32_t cluster)
 
 off_t cluster_start(DOS_FS * fs, uint32_t cluster)
 {
-    return fs->data_start + ((off_t)cluster - 2) * (uint64_t)fs->cluster_size;
+    /* TODO: check overflow */
+    return fs->data_start + ((off_t)cluster - 2) * (unsigned long long)fs->cluster_size;
 }
 
 /**
@@ -546,21 +621,19 @@ uint32_t update_free(DOS_FS * fs)
        if (free != fs->free_clusters) {
            printf("Free cluster summary wrong (%ld vs. really %ld)\n",
                   (long)fs->free_clusters, (long)free);
-           if (interactive)
-               printf("1) Correct\n2) Don't correct\n");
-           else
-               printf("  Auto-correcting.\n");
-           if (!interactive || get_key("12", "?") == '1')
+           if (get_choice(1, "  Auto-correcting.",
+                          2,
+                          1, "Correct",
+                          2, "Don't correct") == 1)
                do_set = 1;
        }
     } else {
        printf("Free cluster summary uninitialized (should be %ld)\n", (long)free);
        if (rw) {
-           if (interactive)
-               printf("1) Set it\n2) Leave it uninitialized\n");
-           else
-               printf("  Auto-setting.\n");
-           if (!interactive || get_key("12", "?") == '1')
+           if (get_choice(1, "  Auto-setting.",
+                          2,
+                          1, "Set it",
+                          2, "Leave it uninitialized") == 1)
                do_set = 1;
        }
     }
index 5c77634..bcba9c5 100644 (file)
--- a/src/fat.h
+++ b/src/fat.h
 #ifndef _FAT_H
 #define _FAT_H
 
-void read_fat(DOS_FS * fs);
+void read_fat(DOS_FS * fs, int mode);
 
 /* Loads the FAT of the filesystem described by FS. Initializes the FAT,
    replaces broken FATs and rejects invalid cluster entries. */
 
+void release_fat(DOS_FS * fs);
+
+/* Release the FAT of the filesystem described by FS and free allocated memory.
+   Call it after finish work with FAT. */
+
 void get_fat(FAT_ENTRY * entry, void *fat, uint32_t cluster, DOS_FS * fs);
 
 /* Retrieve the FAT entry (next chained cluster) for CLUSTER. */
index 9268ddb..ddb8020 100644 (file)
@@ -4,7 +4,8 @@
    Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
    Copyright (C) 2007 Red Hat, Inc.
    Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
-   Copyright (C) 2015 Andreas Bombe <aeb@debian.org>
+   Copyright (C) 2015-2017 Andreas Bombe <aeb@debian.org>
+   Copyright (C) 2017-2018 Pali Rohár <pali.rohar@gmail.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
 
 #include "version.h"
 
+#include <stdbool.h>
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdlib.h>
+#include <limits.h>
 #include <unistd.h>
 #include <getopt.h>
 #include <ctype.h>
 #include "fat.h"
 #include "file.h"
 #include "check.h"
+#include "charconv.h"
 
-int interactive = 0, rw = 0, list = 0, test = 0, verbose = 0, write_immed = 0;
-int atari_format = 0;
+int rw = 0, list = 0, test = 0, verbose = 0, no_spaces_in_sfns = 0;
+long fat_table = 0;
 unsigned n_files = 0;
 void *mem_queue = NULL;
 
-static void usage(int error)
+
+static void handle_label(bool change, bool reset, const char *device, char *newlabel)
 {
-    FILE *f = error ? stderr : stdout;
-    int status = error ? 1 : 0;
+    DOS_FS fs = { 0 };
+    off_t offset;
+    DIR_ENT de;
 
-    fprintf(f, "usage: fatlabel device [label]\n");
-    exit(status);
-}
+    char label[12] = { 0 };
+    size_t len;
+    int ret;
+    int i;
 
-/*
- * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant
- * of MS-DOS filesystem by default.
- */
-static void check_atari(void)
-{
-#ifdef __mc68000__
-    FILE *f;
-    char line[128], *p;
+    if (change) {
+       len = mbstowcs(NULL, newlabel, 0);
+       if (len != (size_t)-1 && len > 11) {
+           fprintf(stderr,
+                   "fatlabel: labels can be no longer than 11 characters\n");
+           exit(1);
+       }
 
-    if (!(f = fopen("/proc/hardware", "r"))) {
-       perror("/proc/hardware");
-       return;
+       if (!local_string_to_dos_string(label, newlabel, 12)) {
+           fprintf(stderr,
+                   "fatlabel: error when processing label\n");
+           exit(1);
+       }
+
+       for (i = strlen(label); i < 11; ++i)
+           label[i] = ' ';
+       label[11] = 0;
+
+       ret = validate_volume_label(label);
+       if (ret & 0x1) {
+           fprintf(stderr,
+                   "fatlabel: warning - lowercase labels might not work properly on some systems\n");
+       }
+       if (ret & 0x2) {
+           fprintf(stderr,
+                   "fatlabel: labels with characters below 0x20 are not allowed\n");
+           exit(1);
+       }
+       if (ret & 0x4) {
+           fprintf(stderr,
+                   "fatlabel: labels with characters *?.,;:/\\|+=<>[]\" are not allowed\n");
+           exit(1);
+       }
+       if (ret & 0x08) {
+           fprintf(stderr,
+                   "fatlabel: labels can't be empty or white space only\n");
+           exit(1);
+       }
+       if (ret & 0x10) {
+           fprintf(stderr,
+                   "fatlabel: labels can't start with a space character\n");
+           exit(1);
+       }
     }
 
-    while (fgets(line, sizeof(line), f)) {
-       if (strncmp(line, "Model:", 6) == 0) {
-           p = line + 6;
-           p += strspn(p, " \t");
-           if (strncmp(p, "Atari ", 6) == 0)
-               atari_format = 1;
-           break;
+    fs_open(device, rw);
+    read_boot(&fs);
+
+    if (!change && !reset) {
+       if (fs.fat_bits == 32)
+           read_fat(&fs, 0);
+
+       offset = find_volume_de(&fs, &de);
+       if (offset != 0) {
+           if (de.name[0] == 0x05)
+               de.name[0] = 0xe5;
+           printf("%s\n", pretty_label((char *)de.name));
        }
+
+       if (fs.fat_bits == 32)
+           release_fat(&fs);
+
+       exit(0);
     }
-    fclose(f);
-#endif
+
+    if (fs.fat_bits == 32)
+       read_fat(&fs, 1);
+
+    if (!reset)
+       write_label(&fs, label);
+    else
+       remove_label(&fs);
+
+    if (fs.fat_bits == 32)
+       release_fat(&fs);
 }
 
-int main(int argc, char *argv[])
+
+static void handle_volid(bool change, bool reset, const char *device, const char *newserial)
 {
     DOS_FS fs = { 0 };
-    rw = 0;
-
-    int i;
+    char *tmp;
+    long long conversion;
+    uint32_t serial = 0;
 
-    char *device = NULL;
-    char label[12] = { 0 };
+    if (change) {
+       errno = 0;
+       conversion = strtoll(newserial, &tmp, 16);
 
-    off_t offset;
-    DIR_ENT de;
+       if (!*newserial || isspace(*newserial) || *tmp || conversion < 0) {
+           fprintf(stderr, "fatlabel: volume ID must be a hexadecimal number\n");
+           exit(1);
+       }
+       if (conversion > UINT32_MAX) {
+           fprintf(stderr, "fatlabel: given volume ID does not fit in 32 bit\n");
+           exit(1);
+       }
+       if (errno) {
+           fprintf(stderr, "fatlabel: parsing volume ID failed (%s)\n", strerror(errno));
+           exit(1);
+       }
 
-    check_atari();
+       serial = conversion;
+    }
 
-    if (argc < 2 || argc > 3)
-       usage(1);
+    if (reset)
+       serial = generate_volume_id();
 
-    if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))
-       usage(0);
-    else if (!strcmp(argv[1], "-V") || !strcmp(argv[1], "--version")) {
-       printf("fatlabel " VERSION " (" VERSION_DATE ")\n");
+    fs_open(device, rw);
+    read_boot(&fs);
+    if (!change && !reset) {
+       printf("%08x\n", fs.serial);
        exit(0);
     }
 
-    device = argv[1];
-    if (argc == 3) {
-       strncpy(label, argv[2], 11);
-       if (strlen(argv[2]) > 11) {
-           fprintf(stderr,
-                   "fatlabel: labels can be no longer than 11 characters\n");
-           exit(1);
-       }
-       for (i = 0; label[i] && i < 11; i++)
-           /* don't know if here should be more strict !uppercase(label[i]) */
-           if (islower(label[i])) {
-               fprintf(stderr,
-                       "fatlabel: warning - lowercase labels might not work properly with DOS or Windows\n");
+    write_serial(&fs, serial);
+}
+
+
+static void usage(int error, int usage_only)
+{
+    FILE *f = error ? stderr : stdout;
+    int status = error ? 1 : 0;
+
+    fprintf(f, "Usage: fatlabel [OPTIONS] DEVICE [NEW]\n");
+    if (usage_only)
+       exit(status);
+
+    fprintf(f, "Change the FAT filesystem label or serial on DEVICE to NEW or display the\n");
+    fprintf(f, "existing label or serial if NEW is not given.\n");
+    fprintf(f, "\n");
+    fprintf(f, "Options:\n");
+    fprintf(f, "  -i, --volume-id     Work on serial number instead of label\n");
+    fprintf(f, "  -r, --reset         Remove label or generate new serial number\n");
+    fprintf(f, "  -c N, --codepage=N  use DOS codepage N to encode/decode label (default: %d)\n", DEFAULT_DOS_CODEPAGE);
+    fprintf(f, "  -V, --version       Show version number and terminate\n");
+    fprintf(f, "  -h, --help          Print this message and terminate\n");
+    exit(status);
+}
+
+
+int main(int argc, char *argv[])
+{
+    const struct option long_options[] = {
+       {"volume-id", no_argument, NULL, 'i'},
+       {"reset",     no_argument, NULL, 'r'},
+       {"codepage",  required_argument, NULL, 'c'},
+       {"version",   no_argument, NULL, 'V'},
+       {"help",      no_argument, NULL, 'h'},
+       {0,}
+    };
+    bool change;
+    bool reset = false;
+    bool volid_mode = false;
+    char *device = NULL;
+    char *new = NULL;
+    char *tmp;
+    long codepage;
+    int c;
+
+    check_atari();
+
+    while ((c = getopt_long(argc, argv, "irc:Vh", long_options, NULL)) != -1) {
+       switch (c) {
+           case 'i':
+               volid_mode = 1;
                break;
-           }
-       rw = 1;
+
+           case 'r':
+               reset = true;
+               break;
+
+           case 'c':
+               errno = 0;
+               codepage = strtol(optarg, &tmp, 10);
+               if (!*optarg || isspace(*optarg) || *tmp || errno || codepage < 0 || codepage > INT_MAX) {
+                   fprintf(stderr, "Invalid codepage : %s\n", optarg);
+                   usage(1, 0);
+               }
+               if (!set_dos_codepage(codepage))
+                   usage(1, 0);
+               break;
+
+           case 'V':
+               printf("fatlabel " VERSION " (" VERSION_DATE ")\n");
+               exit(0);
+               break;
+
+           case 'h':
+               usage(0, 0);
+               break;
+
+           case '?':
+               usage(1, 0);
+               exit(1);
+
+           default:
+               fprintf(stderr,
+                       "Internal error: getopt_long() returned unexpected value %d\n", c);
+               exit(2);
+       }
     }
 
-    fs_open(device, rw);
-    read_boot(&fs);
-    if (fs.fat_bits == 32)
-       read_fat(&fs);
-    if (!rw) {
-       offset = find_volume_de(&fs, &de);
-       if (offset == 0)
-           fprintf(stdout, "%s\n", fs.label);
-       else
-           fprintf(stdout, "%.8s%.3s\n", de.name, de.name + 8);
-       exit(0);
+    if (!set_dos_codepage(-1)) /* set default codepage if none was given in command line */
+        exit(1);
+
+    if (optind == argc - 2) {
+       change = true;
+    } else if (optind == argc - 1) {
+       change = false;
+    } else {
+       usage(1, 1);
     }
 
-    write_label(&fs, label);
+    if (change || reset)
+       rw = 1;
+
+    if (change && reset) {
+       fprintf(stderr, "fatlabel: giving new value with --reset not allowed\n");
+       exit(1);
+    }
+
+    device = argv[optind++];
+    if (change)
+       new = argv[optind];
+
+    if (!volid_mode)
+       handle_label(change, reset, device, new);
+    else
+       handle_volid(change, reset, device, new);
+
     fs_close(rw);
     return 0;
 }
index 227a168..7757bb7 100644 (file)
@@ -3,6 +3,7 @@
    Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
    Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
    Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
+   Copyright (C) 2020 Pali Rohár <pali.rohar@gmail.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
 
 FDSC *fp_root = NULL;
 
-static void put_char(char **p, unsigned char c)
+static void put_char(char **p, unsigned char c, unsigned int out_size)
 {
-    if (dos_char_to_printable(p, c))
+    if (dos_char_to_printable(p, c, out_size))
        return;
-    if ((c >= ' ' && c < 0x7f) || c >= 0xa0)
+    if (out_size >= 1 && c >= ' ' && c < 0x7f)
        *(*p)++ = c;
-    else {
+    else if (out_size >= 4) {
        *(*p)++ = '\\';
        *(*p)++ = '0' + (c >> 6);
        *(*p)++ = '0' + ((c >> 3) & 7);
@@ -61,16 +62,22 @@ static void put_char(char **p, unsigned char c)
  */
 char *file_name(unsigned char *fixed)
 {
-    static char path[MSDOS_NAME * 4 + 2];
+    static char path[256];
     char *p;
     int i, j;
 
     p = path;
-    for (i = j = 0; i < 8; i++)
+    i = j = 0;
+    if (fixed[0] == 0x05) {
+        put_char(&p, 0xe5, path + sizeof(path) - 1 - p);
+        ++i;
+        ++j;
+    }
+    for (; i < 8; i++)
        if (fixed[i] != ' ') {
            while (j++ < i)
                *p++ = ' ';
-           put_char(&p, fixed[i]);
+           put_char(&p, fixed[i], path + sizeof(path) - 1 - p);
        }
     if (strncmp((const char *)(fixed + 8), "   ", 3)) {
        *p++ = '.';
@@ -78,7 +85,7 @@ char *file_name(unsigned char *fixed)
            if (fixed[i + 8] != ' ') {
                while (j++ < i)
                    *p++ = ' ';
-               put_char(&p, fixed[i + 8]);
+               put_char(&p, fixed[i + 8], path + sizeof(path) - 1 - p);
            }
     }
     *p = 0;
@@ -126,7 +133,10 @@ int file_cvt(unsigned char *name, unsigned char *fixed)
        if (islower(c))
            c = toupper(c);
        if (size) {
-           *fixed++ = c;
+           if (size == 8 && c == 0xE5)
+               *fixed++ = 0x05;
+           else
+               *fixed++ = c;
            size--;
        }
        name++;
index c244aba..8b02b57 100644 (file)
@@ -3,6 +3,7 @@
    Copyright (C) 1993 Werner Almesberger <werner.almesberger@lrc.di.epfl.ch>
    Copyright (C) 1998 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
    Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
+   Copyright (C) 2018-2021 Pali Rohár <pali.rohar@gmail.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
 #include <stdlib.h>
 #include <string.h>
 #include <stdlib.h>
+#include <errno.h>
+#include <ctype.h>
+#include <limits.h>
 #include <unistd.h>
+#include <termios.h>
 #include <getopt.h>
 
 #include "common.h"
 #include "check.h"
 #include "charconv.h"
 
-int interactive = 0, rw = 0, list = 0, test = 0, verbose = 0, write_immed = 0;
-int atari_format = 0, boot_only = 0;
+int rw = 0, list = 0, test = 0, verbose = 0;
+long fat_table = 0;
+int no_spaces_in_sfns = 0;
+int only_uppercase_label = 0;
+int boot_only = 0;
 unsigned n_files = 0;
 void *mem_queue = NULL;
 
-static void usage(char *name)
-{
-    fprintf(stderr, "usage: %s [-aAbflrtvVwy] [-d path -d ...] "
-           "[-u path -u ...]\n%15sdevice\n", name, "");
-    fprintf(stderr, "  -a       automatically repair the filesystem\n");
-    fprintf(stderr, "  -A       toggle Atari filesystem format\n");
-    fprintf(stderr, "  -b       make read-only boot sector check\n");
-    fprintf(stderr,
-           "  -c N     use DOS codepage N to decode short file names (default: %d)\n",
-           DEFAULT_DOS_CODEPAGE);
-    fprintf(stderr, "  -d path  drop that file\n");
-    fprintf(stderr, "  -f       salvage unused chains to files\n");
-    fprintf(stderr, "  -l       list path names\n");
-    fprintf(stderr,
-           "  -n       no-op, check non-interactively without changing\n");
-    fprintf(stderr, "  -p       same as -a, for compat with other *fsck\n");
-    fprintf(stderr, "  -r       interactively repair the filesystem (default)\n");
-    fprintf(stderr, "  -t       test for bad clusters\n");
-    fprintf(stderr, "  -u path  try to undelete that (non-directory) file\n");
-    fprintf(stderr, "  -v       verbose mode\n");
-    fprintf(stderr, "  -V       perform a verification pass\n");
-    fprintf(stderr, "  -w       write changes to disk immediately\n");
-    fprintf(stderr, "  -y       same as -a, for compat with other *fsck\n");
-    exit(2);
-}
+static struct termios original_termios;
 
-/*
- * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant
- * of MS-DOS filesystem by default.
- */
-static void check_atari(void)
+
+static void restore_termios(void)
 {
-#ifdef __mc68000__
-    FILE *f;
-    char line[128], *p;
+    tcsetattr(0, TCSAFLUSH, &original_termios);
+}
 
-    if (!(f = fopen("/proc/hardware", "r"))) {
-       perror("/proc/hardware");
-       return;
-    }
 
-    while (fgets(line, sizeof(line), f)) {
-       if (strncmp(line, "Model:", 6) == 0) {
-           p = line + 6;
-           p += strspn(p, " \t");
-           if (strncmp(p, "Atari ", 6) == 0)
-               atari_format = 1;
-           break;
-       }
-    }
-    fclose(f);
-#endif
+static void usage(char *name, int exitval)
+{
+    fprintf(stderr, "Usage: %s [OPTIONS] DEVICE\n", name);
+    fprintf(stderr, "Check FAT filesystem on DEVICE for errors.\n");
+    fprintf(stderr, "\n");
+    fprintf(stderr, "Options:\n");
+    fprintf(stderr, "  -a              automatically repair the filesystem\n");
+    fprintf(stderr, "  -A              toggle Atari variant of the FAT filesystem\n");
+    fprintf(stderr, "  -b              make read-only boot sector check\n");
+    fprintf(stderr, "  -c N            use DOS codepage N to decode short file names (default: %d)\n",
+           DEFAULT_DOS_CODEPAGE);
+    fprintf(stderr, "  -d PATH         drop file with name PATH (can be given multiple times)\n");
+    fprintf(stderr, "  -f              salvage unused chains to files\n");
+    fprintf(stderr, "  -F NUM          specify FAT table NUM used for filesystem access\n");
+    fprintf(stderr, "  -l              list path names\n");
+    fprintf(stderr, "  -n              no-op, check non-interactively without changing\n");
+    fprintf(stderr, "  -p              same as -a, for compat with other *fsck\n");
+    fprintf(stderr, "  -r              interactively repair the filesystem (default)\n");
+    fprintf(stderr, "  -S              disallow spaces in the middle of short file names\n");
+    fprintf(stderr, "  -t              test for bad clusters\n");
+    fprintf(stderr, "  -u PATH         try to undelete (non-directory) file that was named PATH (can be\n");
+    fprintf(stderr, "                    given multiple times)\n");
+    fprintf(stderr, "  -U              allow only uppercase characters in volume and boot label\n");
+    fprintf(stderr, "  -v              verbose mode\n");
+    fprintf(stderr, "  -V              perform a verification pass\n");
+    fprintf(stderr, "  --variant=TYPE  handle variant TYPE of the filesystem\n");
+    fprintf(stderr, "  -w              write changes to disk immediately\n");
+    fprintf(stderr, "  -y              same as -a, for compat with other *fsck\n");
+    fprintf(stderr, "  --help          print this message\n");
+    exit(exitval);
 }
 
 int main(int argc, char **argv)
@@ -106,13 +101,31 @@ int main(int argc, char **argv)
     DOS_FS fs;
     int salvage_files, verify, c;
     uint32_t free_clusters = 0;
+    struct termios tio;
+    char *tmp;
+    long codepage;
+
+    enum {OPT_HELP=1000, OPT_VARIANT};
+    const struct option long_options[] = {
+           {"variant", required_argument, NULL, OPT_VARIANT},
+           {"help",    no_argument,       NULL, OPT_HELP},
+           {0,}
+    };
+
+    if (!tcgetattr(0, &original_termios)) {
+       tio = original_termios;
+       tio.c_lflag &= ~(ICANON | ECHO);
+       tcsetattr(0, TCSAFLUSH, &tio);
+       atexit(restore_termios);
+    }
 
     memset(&fs, 0, sizeof(fs));
     salvage_files = verify = 0;
     rw = interactive = 1;
     check_atari();
 
-    while ((c = getopt(argc, argv, "Aac:d:bflnprtu:vVwy")) != -1)
+    while ((c = getopt_long(argc, argv, "Aac:d:bfF:lnprStu:UvVwy",
+                                   long_options, NULL)) != -1)
        switch (c) {
        case 'A':               /* toggle Atari format */
            atari_format = !atari_format;
@@ -130,7 +143,14 @@ int main(int argc, char **argv)
            boot_only = 1;
            break;
        case 'c':
-           set_dos_codepage(atoi(optarg));
+           errno = 0;
+           codepage = strtol(optarg, &tmp, 10);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || codepage < 0 || codepage > INT_MAX) {
+               fprintf(stderr, "Invalid codepage : %s\n", optarg);
+               usage(argv[0], 2);
+           }
+           if (!set_dos_codepage(codepage))
+               usage(argv[0], 2);
            break;
        case 'd':
            file_add(optarg, fdt_drop);
@@ -138,6 +158,14 @@ int main(int argc, char **argv)
        case 'f':
            salvage_files = 1;
            break;
+       case 'F':
+           errno = 0;
+           fat_table = strtol(optarg, &tmp, 10);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || fat_table < 0 || fat_table > 255) {
+               fprintf(stderr, "Invalid FAT table : %s\n", optarg);
+               usage(argv[0], 2);
+           }
+           break;
        case 'l':
            list = 1;
            break;
@@ -149,31 +177,56 @@ int main(int argc, char **argv)
            rw = 1;
            interactive = 1;
            break;
+       case 'S':
+           no_spaces_in_sfns = 1;
+           break;
        case 't':
            test = 1;
            break;
        case 'u':
            file_add(optarg, fdt_undelete);
            break;
+       case 'U':
+           only_uppercase_label = 1;
+           break;
        case 'v':
            verbose = 1;
            break;
        case 'V':
            verify = 1;
            break;
+       case OPT_VARIANT:
+           if (!strcasecmp(optarg, "standard")) {
+                   atari_format = 0;
+           } else if (!strcasecmp(optarg, "atari")) {
+                   atari_format = 1;
+           } else {
+                   fprintf(stderr, "Unknown variant: %s\n", optarg);
+                   usage(argv[0], 2);
+           }
+           break;
        case 'w':
            write_immed = 1;
            break;
+       case OPT_HELP:
+           usage(argv[0], 0);
+           break;
+       case '?':
+           usage(argv[0], 2);
+           break;
        default:
-           usage(argv[0]);
+           fprintf(stderr,
+                   "Internal error: getopt_long() returned unexpected value %d\n", c);
+           exit(3);
        }
-    set_dos_codepage(-1);      /* set default codepage if none was given in command line */
+    if (!set_dos_codepage(-1)) /* set default codepage if none was given in command line */
+        exit(2);
     if ((test || write_immed) && !rw) {
        fprintf(stderr, "-t and -w can not be used in read only mode\n");
        exit(2);
     }
     if (optind != argc - 1)
-       usage(argv[0]);
+       usage(argv[0], 2);
 
     printf("fsck.fat " VERSION " (" VERSION_DATE ")\n");
     fs_open(argv[optind], rw);
@@ -184,35 +237,47 @@ int main(int argc, char **argv)
 
     if (verify)
        printf("Starting check/repair pass.\n");
-    while (read_fat(&fs), scan_root(&fs))
+    while (read_fat(&fs, 2), scan_root(&fs))
        qfree(&mem_queue);
+    check_label(&fs);
     if (test)
        fix_bad(&fs);
     if (salvage_files)
        reclaim_file(&fs);
     else
        reclaim_free(&fs);
+    if (!atari_format)
+       check_dirty_bits(&fs);
     free_clusters = update_free(&fs);
     file_unused();
     qfree(&mem_queue);
     if (verify) {
        n_files = 0;
        printf("Starting verification pass.\n");
-       read_fat(&fs);
+       read_fat(&fs, 2);
        scan_root(&fs);
+       check_label(&fs);
        reclaim_free(&fs);
+       if (!atari_format)
+           check_dirty_bits(&fs);
        qfree(&mem_queue);
     }
+    release_fat(&fs);
 
 exit:
-    if (fs_changed()) {
+    if (!write_immed && fs_changed()) {
        if (rw) {
+           printf("\n*** Filesystem was changed ***\n");
            if (interactive)
-               rw = get_key("yn", "Perform changes ? (y/n)") == 'y';
-           else
-               printf("Performing changes.\n");
+               printf("The changes have not yet been written, you can still choose to leave the\n"
+                      "filesystem unmodified:\n");
+
+           rw = get_choice(1, "Writing changes.",
+                           2,
+                           1, "Write changes",
+                           2, "Leave filesystem unchanged") == 1;
        } else
-           printf("Leaving filesystem unchanged.\n");
+           printf("\nLeaving filesystem unchanged.\n");
     }
 
     if (!boot_only)
index 5e93178..ad2b354 100644 (file)
 #define VFAT_LN_ATTR (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
 
 #define FAT_STATE_DIRTY 0x01
+#define FAT_NEED_SURFACE_TEST 0x02
+
+#define FAT16_FLAG_HARDDISK_ERROR 0x4000
+#define FAT16_FLAG_CLEAN_SHUTDOWN 0x8000
+
+#define FAT32_FLAG_HARDDISK_ERROR 0x4000000
+#define FAT32_FLAG_CLEAN_SHUTDOWN 0x8000000
 
 /* ++roman: Use own definition of boot sector structure -- the kernel headers'
  * name for it is msdos_boot_sector in 2.0 and fat_boot_sector in 2.1 ... */
@@ -69,7 +76,7 @@ struct boot_sector {
     uint8_t reserved2[12];     /* Unused */
 
     uint8_t drive_number;      /* Logical Drive Number */
-    uint8_t reserved3;         /* Unused */
+    uint8_t boot_flags;                /* bit 0: dirty, bit 1: need surface test */
 
     uint8_t extended_sig;      /* Extended Signature (0x29) */
     uint32_t serial;           /* Serial number */
@@ -98,7 +105,7 @@ struct boot_sector_16 {
     uint32_t total_sect;       /* number of sectors (if sectors == 0) */
 
     uint8_t drive_number;      /* Logical Drive Number */
-    uint8_t reserved2;         /* Unused */
+    uint8_t boot_flags;                /* bit 0: dirty, bit 1: need surface test */
 
     uint8_t extended_sig;      /* Extended Signature (0x29) */
     uint32_t serial;           /* Serial number */
@@ -150,7 +157,7 @@ typedef struct {
 typedef struct {
     int nfats;
     off_t fat_start;
-    off_t fat_size;            /* unit is bytes */
+    unsigned int fat_size;     /* unit is bytes */
     unsigned int fat_bits;     /* size of a FAT entry */
     unsigned int eff_fat_bits; /* # of used bits in a FAT entry */
     uint32_t root_cluster;     /* 0 for old-style root dir */
@@ -164,11 +171,13 @@ typedef struct {
     off_t backupboot_start;    /* 0 if not present */
     unsigned char *fat;
     DOS_FILE **cluster_owner;
-    char *label;
+    uint32_t serial;
+    char label[11];
 } DOS_FS;
 
-extern int interactive, rw, list, verbose, test, write_immed;
-extern int atari_format;
+extern int rw, list, verbose, test, no_spaces_in_sfns;
+extern long fat_table;
+extern int only_uppercase_label;
 extern unsigned n_files;
 extern void *mem_queue;
 
index 0b8f7c0..8c0c3b2 100644 (file)
--- a/src/io.c
+++ b/src/io.c
@@ -56,7 +56,7 @@ static CHANGE *changes, *last;
 static int fd, did_change = 0;
 
 
-void fs_open(char *path, int rw)
+void fs_open(const char *path, int rw)
 {
     if ((fd = open(path, rw ? O_RDWR : O_RDONLY)) < 0) {
        perror("open");
index 4ce032f..053c7e3 100644 (file)
--- a/src/io.h
+++ b/src/io.h
@@ -29,7 +29,7 @@
 
 #include <fcntl.h>             /* for off_t */
 
-void fs_open(char *path, int rw);
+void fs_open(const char *path, int rw);
 
 /* Opens the filesystem PATH. If RW is zero, the filesystem is opened
    read-only, otherwise, it is opened read-write. */
index b33e125..d7d3b8d 100644 (file)
--- a/src/lfn.c
+++ b/src/lfn.c
@@ -74,14 +74,6 @@ static unsigned char fat_uni2esc[64] = {
 /* for maxlen param */
 #define UNTIL_0                INT_MAX
 
-/* Convert name part in 'lfn' from unicode to ASCII */
-#define CNV_THIS_PART(lfn)                             \
-    ({                                                 \
-       unsigned char __part_uni[CHARS_PER_LFN*2];              \
-       copy_lfn_part( __part_uni, lfn );               \
-       cnv_unicode( __part_uni, CHARS_PER_LFN, 0 );    \
-    })
-
 /* Convert name parts collected so far (from previous slots) from unicode to
  * ASCII */
 #define CNV_PARTS_SO_FAR()                                     \
@@ -155,6 +147,14 @@ static void copy_lfn_part(unsigned char *dst, LFN_ENT * lfn)
     memcpy(dst + 22, lfn->name11_12, 4);
 }
 
+/* Convert name part in 'lfn' from unicode to ASCII */
+static inline char *cnv_this_part(LFN_ENT *lfn)
+{
+       unsigned char part_uni[CHARS_PER_LFN * 2];
+       copy_lfn_part(part_uni, lfn);
+       return cnv_unicode(part_uni, CHARS_PER_LFN, 0);
+}
+
 static void clear_lfn_slots(int start, int end)
 {
     int i;
@@ -222,7 +222,7 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
             * display the name) */
            printf("A new long file name starts within an old one.\n");
            if (slot == lfn_slot && lfn->alias_checksum == lfn_checksum) {
-               char *part1 = CNV_THIS_PART(lfn);
+               char *part1 = cnv_this_part(lfn);
                char *part2 = CNV_PARTS_SO_FAR();
                printf("  It could be that the LFN start bit is wrong here\n"
                       "  if \"%s\" seems to match \"%s\".\n", part1, part2);
@@ -230,26 +230,22 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
                free(part2);
                can_clear = 1;
            }
-           if (interactive) {
-               printf("1: Delete previous LFN\n2: Leave it as it is.\n");
-               if (can_clear)
-                   printf("3: Clear start bit and concatenate LFNs\n");
-           } else
-               printf("  Not auto-correcting this.\n");
-           if (interactive) {
-               switch (get_key(can_clear ? "123" : "12", "?")) {
-               case '1':
-                   clear_lfn_slots(0, lfn_parts - 1);
-                   lfn_reset();
-                   break;
-               case '2':
-                   break;
-               case '3':
-                   lfn->id &= ~LFN_ID_START;
-                   fs_write(dir_offset + offsetof(LFN_ENT, id),
-                            sizeof(lfn->id), &lfn->id);
-                   break;
-               }
+           switch (get_choice(2, "  Not auto-correcting this.",
+                              can_clear ? 3 : 2,
+                              1, "Delete previous LFN",
+                              2, "Leave it as it is",
+                              3, "Clear start bit and concatenate LFNs")) {
+           case 1:
+               clear_lfn_slots(0, lfn_parts - 1);
+               lfn_reset();
+               break;
+           case 2:
+               break;
+           case 3:
+               lfn->id &= ~LFN_ID_START;
+               fs_write(dir_offset + offsetof(LFN_ENT, id),
+                        sizeof(lfn->id), &lfn->id);
+               break;
            }
        }
        lfn_slot = slot;
@@ -262,28 +258,27 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
        /* Causes: 1) start bit got lost, 2) Previous slot with start bit got
         *         lost */
        /* Fixes: 1) delete LFN, 2) set start bit */
-       char *part = CNV_THIS_PART(lfn);
+       char *part = cnv_this_part(lfn);
        printf("Long filename fragment \"%s\" found outside a LFN "
               "sequence.\n  (Maybe the start bit is missing on the "
               "last fragment)\n", part);
        free(part);
-       if (interactive) {
-           printf("1: Delete fragment\n2: Leave it as it is.\n"
-                  "3: Set start bit\n");
-       } else
-           printf("  Not auto-correcting this.\n");
-       switch (interactive ? get_key("123", "?") : '2') {
-       case '1':
+       switch (get_choice(2, "  Not auto-correcting this.",
+                          3,
+                          1, "Delete fragment",
+                          2, "Leave it as it is",
+                          3, "Set start bit")) {
+       case 1:
            if (!lfn_offsets)
                lfn_offsets = alloc(sizeof(off_t));
            lfn_offsets[0] = dir_offset;
            clear_lfn_slots(0, 0);
            lfn_reset();
            return;
-       case '2':
+       case 2:
            lfn_reset();
            return;
-       case '3':
+       case 3:
            lfn->id |= LFN_ID_START;
            fs_write(dir_offset + offsetof(LFN_ENT, id),
                     sizeof(lfn->id), &lfn->id);
@@ -304,7 +299,7 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
        printf("Unexpected long filename sequence number "
               "(%d vs. expected %d).\n", slot, lfn_slot);
        if (lfn->alias_checksum == lfn_checksum && lfn_slot > 0) {
-           char *part1 = CNV_THIS_PART(lfn);
+           char *part1 = cnv_this_part(lfn);
            char *part2 = CNV_PARTS_SO_FAR();
            printf("  It could be that just the number is wrong\n"
                   "  if \"%s\" seems to match \"%s\".\n", part1, part2);
@@ -312,15 +307,12 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
            free(part2);
            can_fix = 1;
        }
-       if (interactive) {
-           printf
-               ("1: Delete LFN\n2: Leave it as it is (and ignore LFN so far)\n");
-           if (can_fix)
-               printf("3: Correct sequence number\n");
-       } else
-           printf("  Not auto-correcting this.\n");
-       switch (interactive ? get_key(can_fix ? "123" : "12", "?") : '2') {
-       case '1':
+       switch (get_choice(2, "  Not auto-correcting this.",
+                          can_fix ? 3 : 2,
+                          1, "Delete LFN",
+                          2, "Leave it as it is (and ignore LFN so far)",
+                          3, "Correct sequence number")) {
+       case 1:
            if (!lfn_offsets) {
                lfn_offsets = alloc(sizeof(off_t));
                lfn_parts = 0;
@@ -329,10 +321,10 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
            clear_lfn_slots(0, lfn_parts - 1);
            lfn_reset();
            return;
-       case '2':
+       case 2:
            lfn_reset();
            return;
-       case '3':
+       case 3:
            lfn->id = (lfn->id & ~LFN_ID_SLOTMASK) | lfn_slot;
            fs_write(dir_offset + offsetof(LFN_ENT, id),
                     sizeof(lfn->id), &lfn->id);
@@ -347,26 +339,23 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
        printf("Checksum in long filename part wrong "
               "(%02x vs. expected %02x).\n",
               lfn->alias_checksum, lfn_checksum);
-       if (interactive) {
-           printf("1: Delete LFN\n2: Leave it as it is.\n"
-                  "3: Correct checksum\n");
-       } else
-           printf("  Not auto-correcting this.\n");
-       if (interactive) {
-           switch (get_key("123", "?")) {
-           case '1':
-               lfn_offsets[lfn_parts++] = dir_offset;
-               clear_lfn_slots(0, lfn_parts - 1);
-               lfn_reset();
-               return;
-           case '2':
-               break;
-           case '3':
-               lfn->alias_checksum = lfn_checksum;
-               fs_write(dir_offset + offsetof(LFN_ENT, alias_checksum),
-                        sizeof(lfn->alias_checksum), &lfn->alias_checksum);
-               break;
-           }
+       switch (get_choice(2, "  Not auto-correcting this.",
+                          3,
+                          1, "Delete LFN",
+                          2, "Leave it as it is",
+                          3, "Correct checksum")) {
+       case 1:
+           lfn_offsets[lfn_parts++] = dir_offset;
+           clear_lfn_slots(0, lfn_parts - 1);
+           lfn_reset();
+           return;
+       case 2:
+           break;
+       case 3:
+           lfn->alias_checksum = lfn_checksum;
+           fs_write(dir_offset + offsetof(LFN_ENT, alias_checksum),
+                    sizeof(lfn->alias_checksum), &lfn->alias_checksum);
+           break;
        }
     }
 
@@ -382,11 +371,10 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
     if (lfn->reserved != 0) {
        printf("Reserved field in VFAT long filename slot is not 0 "
               "(but 0x%02x).\n", lfn->reserved);
-       if (interactive)
-           printf("1: Fix.\n2: Leave it.\n");
-       else
-           printf("Auto-setting to 0.\n");
-       if (!interactive || get_key("12", "?") == '1') {
+       if (get_choice(1, "Auto-setting to 0.",
+                      2,
+                      1, "Fix",
+                      2, "Leave it") == 1) {
            lfn->reserved = 0;
            fs_write(dir_offset + offsetof(LFN_ENT, reserved),
                     sizeof(lfn->reserved), &lfn->reserved);
@@ -395,11 +383,10 @@ void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
     if (lfn->start != htole16(0)) {
        printf("Start cluster field in VFAT long filename slot is not 0 "
               "(but 0x%04x).\n", lfn->start);
-       if (interactive)
-           printf("1: Fix.\n2: Leave it.\n");
-       else
-           printf("Auto-setting to 0.\n");
-       if (!interactive || get_key("12", "?") == '1') {
+       if (get_choice(1, "Auto-setting to 0.",
+                      2,
+                      1, "Fix",
+                      2, "Leave it") == 1) {
            lfn->start = htole16(0);
            fs_write(dir_offset + offsetof(LFN_ENT, start),
                     sizeof(lfn->start), &lfn->start);
@@ -436,25 +423,33 @@ char *lfn_get(DIR_ENT * de, off_t * lfn_offset)
         * 3) renumber entries and truncate name */
        char *long_name = CNV_PARTS_SO_FAR();
        char *short_name = file_name(de->name);
+       char *fix_num_string;
+       int choice;
+
        printf("Unfinished long file name \"%s\".\n"
               "  (Start may have been overwritten by %s)\n",
               long_name, short_name);
        free(long_name);
-       if (interactive) {
-           printf("1: Delete LFN\n2: Leave it as it is.\n"
-                  "3: Fix numbering (truncates long name and attaches "
-                  "it to short name %s)\n", short_name);
-       } else
-           printf("  Not auto-correcting this.\n");
-       switch (interactive ? get_key("123", "?") : '2') {
-       case '1':
+
+       xasprintf(&fix_num_string,
+                  "Fix numbering (truncates long name and attaches "
+                  "it to short name %s)", short_name);
+       choice = get_choice(2, "  Not auto-correcting this.",
+                           3,
+                           1, "Delete LFN",
+                           2, "Leave it as it is",
+                           3, fix_num_string);
+       free(fix_num_string);
+
+       switch (choice) {
+       case 1:
            clear_lfn_slots(0, lfn_parts - 1);
            lfn_reset();
            return NULL;
-       case '2':
+       case 2:
            lfn_reset();
            return NULL;
-       case '3':
+       case 3:
            for (i = 0; i < lfn_parts; ++i) {
                uint8_t id = (lfn_parts - i) | (i == 0 ? LFN_ID_START : 0);
                fs_write(lfn_offsets[i] + offsetof(LFN_ENT, id),
@@ -474,31 +469,37 @@ char *lfn_get(DIR_ENT * de, off_t * lfn_offset)
        /* Fixes: 1) Fix checksum in LFN entries */
        char *long_name = CNV_PARTS_SO_FAR();
        char *short_name = file_name(de->name);
+       char *fix_check_string;
+       int choice;
+
        printf("Wrong checksum for long file name \"%s\".\n"
               "  (Short name %s may have changed without updating the long name)\n",
               long_name, short_name);
        free(long_name);
-       if (interactive) {
-           printf("1: Delete LFN\n2: Leave it as it is.\n"
-                  "3: Fix checksum (attaches to short name %s)\n", short_name);
-       } else
-           printf("  Not auto-correcting this.\n");
-       if (interactive) {
-           switch (get_key("123", "?")) {
-           case '1':
-               clear_lfn_slots(0, lfn_parts - 1);
-               lfn_reset();
-               return NULL;
-           case '2':
-               lfn_reset();
-               return NULL;
-           case '3':
-               for (i = 0; i < lfn_parts; ++i) {
-                   fs_write(lfn_offsets[i] + offsetof(LFN_ENT, alias_checksum),
-                            sizeof(sum), &sum);
-               }
-               break;
+
+       xasprintf(&fix_check_string,
+                 "Fix checksum (attaches to short name %s)", short_name);
+       choice = get_choice(9, "  Not auto-correcting this.",
+                           3,
+                           1, "Delete LFN",
+                           2, "Leave it as it is",
+                           3, fix_check_string);
+       free(fix_check_string);
+
+       switch (choice) {
+       case 1:
+           clear_lfn_slots(0, lfn_parts - 1);
+           lfn_reset();
+           return NULL;
+       case 2:
+           lfn_reset();
+           return NULL;
+       case 3:
+           for (i = 0; i < lfn_parts; ++i) {
+               fs_write(lfn_offsets[i] + offsetof(LFN_ENT, alias_checksum),
+                        sizeof(sum), &sum);
            }
+           break;
        }
     }
 
@@ -518,11 +519,10 @@ void lfn_check_orphaned(void)
     long_name = CNV_PARTS_SO_FAR();
     printf("Orphaned long file name part \"%s\"\n", long_name);
     free(long_name);
-    if (interactive)
-       printf("1: Delete.\n2: Leave it.\n");
-    else
-       printf("  Auto-deleting.\n");
-    if (!interactive || get_key("12", "?") == '1') {
+    if (get_choice(1, "  Auto-deleting.",
+                  2,
+                  1, "Delete",
+                  2, "Leave it") == 1) {
        clear_lfn_slots(0, lfn_parts - 1);
     }
     lfn_reset();
index a7609b0..91eb5d8 100644 (file)
@@ -7,6 +7,7 @@
    Copyright (C) 1998-2005 Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
    Copyright (C) 2008-2014 Daniel Baumann <mail@daniel-baumann.ch>
    Copyright (C) 2015-2016 Andreas Bombe <aeb@debian.org>
+   Copyright (C) 2018 Pali Rohár <pali.rohar@gmail.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
@@ -52,6 +53,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <limits.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <getopt.h>
 #include "endian_compat.h"
 
+#include "common.h"
 #include "msdos_fs.h"
 #include "device_info.h"
+#include "charconv.h"
 
 
 /* Constant definitions */
 
 /* Macro definitions */
 
-/* Report a failure message and return a failure error code */
-
-#define die( str ) fatal_error( "%s: " str "\n" )
-
 /* Mark a cluster in the FAT as bad */
 
 #define mark_sector_bad( sector ) mark_FAT_sector( sector, FAT_BAD )
@@ -107,14 +107,26 @@ static inline int cdiv(int a, int b)
 
 #define BOOT_SIGN 0xAA55       /* Boot sector magic number */
 
-#define MAX_CLUST_12   ((1 << 12) - 16)
-#define MAX_CLUST_16   ((1 << 16) - 16)
-#define MIN_CLUST_32    65529
+/* According to Microsoft FAT specification (fatgen103.doc) disk with
+ * 4085 clusters (or more) is FAT16, but Microsoft Windows FAT driver
+ * fastfat.sys detects disk with less then 4087 clusters as FAT12.
+ * Linux FAT drivers msdos.ko and vfat.ko detect disk with at least
+ * 4085 clusters as FAT16, therefore for compatibility reasons with
+ * both systems disallow formatting disks to 4085 or 4086 clusters. */
+#define MAX_CLUST_12   4084
+#define MIN_CLUST_16   4087
+
+/* According to Microsoft FAT specification (fatgen103.doc) disk with
+ * 65525 clusters (or more) is FAT32, but Microsoft Windows FAT driver
+ * fastfat.sys, Linux FAT drivers msdos.ko and vfat.ko detect disk as
+ * FAT32 when Sectors Per FAT (fat_length) is set to zero. And not by
+ * number of clusters. Still there is cluster upper limit for FAT16. */
+#define MAX_CLUST_16   65524
+#define MIN_CLUST_32   65525
+
 /* M$ says the high 4 bits of a FAT32 FAT entry are reserved and don't belong
  * to the cluster number. So the max. cluster# is based on 2^28 */
-#define MAX_CLUST_32   ((1 << 28) - 16)
-
-#define FAT12_THRESHOLD        4085
+#define MAX_CLUST_32   268435446
 
 #define OLDGEMDOS_MAX_SECTORS  32765
 #define GEMDOS_MAX_SECTORS     65531
@@ -128,7 +140,7 @@ static inline int cdiv(int a, int b)
 
 struct msdos_volume_info {
     uint8_t drive_number;      /* BIOS drive number */
-    uint8_t RESERVED;          /* Unused */
+    uint8_t boot_flags;                /* bit 0: dirty, bit 1: need surface test */
     uint8_t ext_boot_sign;     /* 0x29 if fields below exist (DOS 3.3+) */
     uint8_t volume_id[4];      /* Volume ID number */
     uint8_t volume_label[11];  /* Volume label */
@@ -180,10 +192,10 @@ struct fat32_fsinfo {
     uint32_t next_cluster;     /* Most recently allocated cluster.
                                 * Unused under Linux. */
     uint32_t reserved2[4];
-};
+} __attribute__ ((packed));
 
 /* The "boot code" we put into the filesystem... it writes a message and
-   tells the user to try again */
+   tells the user to try again. This "boot code" is in the public domain. */
 
 unsigned char dummy_boot_jump[3] = { 0xeb, 0x3c, 0x90 };
 
@@ -214,27 +226,30 @@ char dummy_boot_code[BOOTCODE_SIZE] = "\x0e"      /* push cs */
 
 #define MESSAGE_OFFSET 29      /* Offset of message in above code */
 
+static char initial_volume_name[] = NO_NAME; /* Initial volume name, make sure that is writable */
+
 /* Global variables - the root of all evil :-) - see these and weep! */
 
-static const char *program_name = "mkfs.fat";  /* Name of the program */
 static char *device_name = NULL;       /* Name of the device on which to create the filesystem */
-static int atari_format = 0;   /* Use Atari variation of MS-DOS FS format */
 static int check = FALSE;      /* Default to no readablity checking */
 static int verbose = 0;                /* Default to verbose mode off */
 static long volume_id;         /* Volume ID number */
-static time_t create_time;     /* Creation time */
-static char volume_name[] = NO_NAME;   /* Volume name */
-static uint64_t blocks;        /* Number of blocks in filesystem */
+static time_t create_time = -1;        /* Creation time */
+static char *volume_name = initial_volume_name;        /* Volume name */
+static unsigned long long blocks;      /* Number of blocks in filesystem */
 static unsigned sector_size = 512;     /* Size of a logical sector */
 static int sector_size_set = 0;        /* User selected sector size */
 static int backup_boot = 0;    /* Sector# of backup boot sector */
+static int backup_boot_set = 0;        /* User selected backup boot sector */
+static int info_sector = 0;    /* Sector# of FAT32 info sector */
 static int reserved_sectors = 0;       /* Number of reserved sectors */
 static int badblocks = 0;      /* Number of bad blocks in the filesystem */
 static int nr_fats = 2;                /* Default number of FATs to produce */
 static int size_fat = 0;       /* Size in bits of FAT entries */
 static int size_fat_by_user = 0;       /* 1 if FAT size user selected */
 static int dev = -1;           /* FS block device file handle */
-static int ignore_full_disk = 0;       /* Ignore warning about 'full' disk devices */
+static off_t part_sector = 0; /* partition offset in sector */
+static int ignore_safety_checks = 0;   /* Ignore safety checks */
 static off_t currently_testing = 0;    /* Block currently being tested (if autodetect bad blocks) */
 static struct msdos_boot_sector bs;    /* Boot sector data */
 static int start_data_sector;  /* Sector number for the start of the data area */
@@ -242,14 +257,15 @@ static int start_data_block;      /* Block number for the start of the data area */
 static unsigned char *fat;     /* File allocation table */
 static unsigned alloced_fat_length;    /* # of FAT sectors we can keep in memory */
 static unsigned fat_entries;           /* total entries in FAT table (including reserved) */
-static unsigned char *info_sector;     /* FAT32 info sector */
+static unsigned char *info_sector_buffer;      /* FAT32 info sector */
 static struct msdos_dir_entry *root_dir;       /* Root directory */
 static int size_root_dir;      /* Size of the root directory in bytes */
 static uint32_t num_sectors;           /* Total number of sectors in device */
 static int sectors_per_cluster = 0;    /* Number of sectors per disk cluster */
 static int root_dir_entries = 0;       /* Number of root directory entries */
+static int root_dir_entries_set = 0;   /* User selected root directory size */
 static char *blank_sector;     /* Blank sector - all zeros */
-static int hidden_sectors = 0; /* Number of hidden sectors */
+static unsigned hidden_sectors = 0;    /* Number of hidden sectors */
 static int hidden_sectors_by_user = 0; /* -h option invoked */
 static int drive_number_option = 0;    /* drive number */
 static int drive_number_by_user = 0;   /* drive number option invoked */
@@ -260,10 +276,10 @@ static int orphaned_sectors = 0;  /* Sectors that exist in the last block of file
 static int invariant = 0;              /* Whether to set normally randomized or
                                           current time based values to
                                           constants */
+static int fill_mbr_partition = -1;    /* Whether to fill MBR partition table or not */
 
 /* Function prototype definitions */
 
-static void fatal_error(const char *fmt_string) __attribute__ ((noreturn));
 static void mark_FAT_cluster(int cluster, unsigned int value);
 static void mark_FAT_sector(int sector, unsigned int value);
 static long do_check(char *buffer, int try, off_t current_block);
@@ -277,14 +293,6 @@ static void write_tables(void);
 
 /* The function implementations */
 
-/* Handle the reporting of fatal errors.  Volatile to let gcc know that this doesn't return */
-
-static void fatal_error(const char *fmt_string)
-{
-    fprintf(stderr, fmt_string, program_name, device_name);
-    exit(1);                   /* The error exit code is 1! */
-}
-
 /* Mark the specified cluster as having a particular value */
 
 static void mark_FAT_cluster(int cluster, unsigned int value)
@@ -347,7 +355,7 @@ static long do_check(char *buffer, int try, off_t current_block)
 {
     long got;
 
-    if (lseek(dev, current_block * BLOCK_SIZE, SEEK_SET)       /* Seek to the correct location */
+    if (lseek(dev, part_sector * sector_size + current_block * BLOCK_SIZE, SEEK_SET)   /* Seek to the correct location */
        !=current_block * BLOCK_SIZE)
        die("seek failed during testing for blocks");
 
@@ -399,7 +407,7 @@ static void check_blocks(void)
     try = TEST_BUFFER_BLOCKS;
     while (currently_testing < blocks) {
        if (currently_testing + try > blocks)
-           try = blocks - currently_testing;
+           try = blocks - currently_testing; /* TODO: check overflow */
        got = do_check(blkbuf, try, currently_testing);
        currently_testing += got;
        if (got == try) {
@@ -427,7 +435,7 @@ static void get_list_blocks(char *filename)
 {
     int i;
     FILE *listfile;
-    long blockno;
+    long long blockno;
     char *line = NULL;
     size_t linesize = 0;
     int lineno = 0;
@@ -449,9 +457,9 @@ static void get_list_blocks(char *filename)
        }
 
        errno = 0;
-       blockno = strtol(line, &end, 10);
+       blockno = strtoll(line, &end, 10);
 
-       if (errno) {
+       if (errno || blockno < 0) {
            fprintf(stderr,
                    "While converting bad block number in line %d: %s\n",
                    lineno, strerror(errno));
@@ -476,16 +484,16 @@ static void get_list_blocks(char *filename)
 
        /* Mark all of the sectors in the block as bad */
        for (i = 0; i < SECTORS_PER_BLOCK; i++) {
-           unsigned long sector = blockno * SECTORS_PER_BLOCK + i;
+           unsigned long long sector = blockno * SECTORS_PER_BLOCK + i;
 
            if (sector < start_data_sector) {
-               fprintf(stderr, "Block number %ld is before data area\n",
+               fprintf(stderr, "Block number %lld is before data area\n",
                        blockno);
                die("Error in bad blocks file");
            }
 
            if (sector >= num_sectors) {
-               fprintf(stderr, "Block number %ld is behind end of filesystem\n",
+               fprintf(stderr, "Block number %lld is behind end of filesystem\n",
                        blockno);
                die("Error in bad blocks file");
            }
@@ -506,27 +514,46 @@ static void get_list_blocks(char *filename)
 static void check_mount(char *device_name)
 {
     if (is_device_mounted(device_name))
-       die("%s contains a mounted filesystem.");
+       die("%s contains a mounted filesystem.", device_name);
 }
 
 /* Establish the geometry and media parameters for the device */
 
 static void establish_params(struct device_info *info)
 {
-    unsigned int sec_per_track = 63;
-    unsigned int heads = 255;
+    unsigned int sec_per_track;
+    unsigned int heads;
     unsigned int media = 0xf8;
     unsigned int cluster_size = 4;  /* starting point for FAT12 and FAT16 */
     int def_root_dir_entries = 512;
 
-    if (info->size < 512 * 1024 * 1024) {
-       /*
-        * These values are more or less meaningless, but we can at least
-        * use less extreme values for smaller filesystems where the large
-        * dummy values signifying LBA only access are not needed.
-        */
-       sec_per_track = 32;
-       heads = 64;
+    if (info->geom_heads > 0) {
+        heads = info->geom_heads;
+        sec_per_track = info->geom_sectors;
+    } else {
+        unsigned long long int total_sectors;
+
+        if (info->geom_size > 0)
+            total_sectors = info->geom_size;
+        else if (info->sector_size > 0)
+            total_sectors = info->size / info->sector_size;
+        else
+            total_sectors = info->size / sector_size;
+
+        if (total_sectors <= 524288) {
+            /* For capacity below the 256MB (with 512b sectors) use CHS Recommendation from SD Card Part 2 File System Specification */
+            heads = total_sectors <=  32768 ? 2 :
+                    total_sectors <=  65536 ? 4 :
+                    total_sectors <= 262144 ? 8 : 16;
+            sec_per_track = total_sectors <= 4096 ? 16 : 32;
+        } else {
+            /* Use LBA-Assist Translation for calculating CHS when disk geometry is not available */
+            heads = total_sectors <=  16*63*1024 ? 16 :
+                    total_sectors <=  32*63*1024 ? 32 :
+                    total_sectors <=  64*63*1024 ? 64 :
+                    total_sectors <= 128*63*1024 ? 128 : 255;
+            sec_per_track = 63;
+        }
     }
 
     if (info->type != TYPE_FIXED) {
@@ -588,28 +615,24 @@ static void establish_params(struct device_info *info)
         * fs size <=  16G:   8k clusters
         * fs size <=  32G:  16k clusters
         * fs size >   32G:  32k clusters
-        *
-        * This only works correctly for 512 byte sectors!
         */
-       uint32_t sz_mb = info->size / (1024 * 1024);
-       cluster_size =
-           sz_mb > 32 * 1024 ? 64 : sz_mb > 16 * 1024 ? 32 : sz_mb >
-           8 * 1024 ? 16 : sz_mb > 260 ? 8 : 1;
-    }
-
-    if (info->geom_heads > 0) {
-       heads = info->geom_heads;
-       sec_per_track = info->geom_sectors;
+       unsigned long long int sectors = info->size / sector_size;
+        cluster_size = sectors > 32*1024*1024*2 ? 64 :
+                       sectors > 16*1024*1024*2 ? 32 :
+                       sectors >  8*1024*1024*2 ? 16 :
+                       sectors >     260*1024*2 ? 8 : 1;
     }
 
-    if (!hidden_sectors_by_user && info->geom_start >= 0)
-       hidden_sectors = htole32(info->geom_start);
+    if (!hidden_sectors_by_user && info->geom_start >= 0 && info->geom_start + part_sector <= UINT32_MAX)
+        hidden_sectors = info->geom_start + part_sector;
 
     if (!root_dir_entries)
        root_dir_entries = def_root_dir_entries;
 
-    bs.secs_track = htole16(sec_per_track);
-    bs.heads = htole16(heads);
+    if (!bs.secs_track)
+        bs.secs_track = htole16(sec_per_track);
+    if (!bs.heads)
+        bs.heads = htole16(heads);
     bs.media = media;
     bs.cluster_size = cluster_size;
 }
@@ -634,6 +657,10 @@ static void setup_tables(void)
     struct tm *ctime;
     struct msdos_volume_info *vi =
        (size_fat == 32 ? &bs.fat32.vi : &bs.oldfat.vi);
+    char label[12] = { 0 };
+    size_t len;
+    int ret;
+    int i;
 
     if (atari_format) {
        /* On Atari, the first few bytes of the boot sector are assigned
@@ -660,6 +687,8 @@ static void setup_tables(void)
     if (size_fat == 32) {
        /* Under FAT32, the root dir is in a cluster chain, and this is
         * signalled by bs.dir_entries being 0. */
+       if (root_dir_entries_set)
+           fprintf(stderr, "Warning: root directory entries specified with -r have no effect on FAT32\n");
        root_dir_entries = 0;
     }
 
@@ -674,8 +703,33 @@ static void setup_tables(void)
        vi->volume_id[3] = (unsigned char)(volume_id >> 24);
     }
 
+    len = mbstowcs(NULL, volume_name, 0);
+    if (len != (size_t)-1 && len > 11)
+       die("Label can be no longer than 11 characters");
+
+    if (!local_string_to_dos_string(label, volume_name, 12))
+       die("Error when processing label");
+
+    for (i = strlen(label); i < 11; ++i)
+       label[i] = ' ';
+    label[11] = 0;
+
+    if (memcmp(label, "           ", MSDOS_NAME) == 0)
+       memcpy(label, NO_NAME, MSDOS_NAME);
+
+    ret = validate_volume_label(label);
+    if (ret & 0x1)
+       fprintf(stderr,
+               "mkfs.fat: Warning: lowercase labels might not work properly on some systems\n");
+    if (ret & 0x2)
+       die("Labels with characters below 0x20 are not allowed\n");
+    if (ret & 0x4)
+       die("Labels with characters *?.,;:/\\|+=<>[]\" are not allowed\n");
+    if (ret & 0x10)
+       die("Label can't start with a space character");
+
     if (!atari_format) {
-       memcpy(vi->volume_label, volume_name, 11);
+       memcpy(vi->volume_label, label, 11);
 
        memcpy(bs.boot_jump, dummy_boot_jump, 3);
        /* Patch in the correct offset to the boot code */
@@ -727,12 +781,17 @@ static void setup_tables(void)
            UINT32_MAX) {
        printf("Warning: target too large, space at end will be left unused\n");
        num_sectors = UINT32_MAX;
-       blocks = (uint64_t)UINT32_MAX * sector_size / BLOCK_SIZE;
+       blocks = (unsigned long long)UINT32_MAX * sector_size / BLOCK_SIZE;
     } else {
        num_sectors =
            (long long)(blocks * BLOCK_SIZE / sector_size) + orphaned_sectors;
     }
 
+    if (align_structures) {
+        /* Align number of sectors to be multiple of sectors per track, needed by DOS and mtools */
+        num_sectors = num_sectors / le16toh(bs.secs_track) * le16toh(bs.secs_track);
+    }
+
     if (!atari_format) {
        unsigned fatdata1216;   /* Sectors for FATs + data area (FAT12/16) */
        unsigned fatdata32;     /* Sectors for FATs + data area (FAT32) */
@@ -781,13 +840,13 @@ static void setup_tables(void)
            maxclust12 = (fatlength12 * 2 * sector_size) / 3;
            if (maxclust12 > MAX_CLUST_12)
                maxclust12 = MAX_CLUST_12;
-           if (verbose >= 2)
-               printf("FAT12: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
+           if (verbose >= 2 && (size_fat == 0 || size_fat == 12))
+               printf("Trying FAT12: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
                       clust12, fatlength12, maxclust12, MAX_CLUST_12);
-           if (clust12 > maxclust12 - 2) {
+           if (clust12 > maxclust12) {
                clust12 = 0;
-               if (verbose >= 2)
-                   printf("FAT12: too much clusters\n");
+               if (verbose >= 2 && (size_fat == 0 || size_fat == 12))
+                   printf("Trying FAT12: too much clusters\n");
            }
 
            clust16 = ((long long)fatdata1216 * sector_size + nr_fats * 4) /
@@ -801,20 +860,19 @@ static void setup_tables(void)
            maxclust16 = (fatlength16 * sector_size) / 2;
            if (maxclust16 > MAX_CLUST_16)
                maxclust16 = MAX_CLUST_16;
-           if (verbose >= 2)
-               printf("FAT16: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
-                      clust16, fatlength16, maxclust16, MAX_CLUST_16);
-           if (clust16 > maxclust16 - 2) {
-               if (verbose >= 2)
-                   printf("FAT16: too much clusters\n");
+           if (verbose >= 2 && (size_fat == 0 || size_fat == 16))
+               printf("Trying FAT16: #clu=%u, fatlen=%u, maxclu=%u, limit=%u/%u\n",
+                      clust16, fatlength16, maxclust16, MIN_CLUST_16, MAX_CLUST_16);
+           if (clust16 > maxclust16) {
+               if (verbose >= 2 && (size_fat == 0 || size_fat == 16))
+                   printf("Trying FAT16: too much clusters\n");
                clust16 = 0;
            }
-           /* The < 4078 avoids that the filesystem will be misdetected as having a
+           /* This avoids that the filesystem will be misdetected as having a
             * 12 bit FAT. */
-           if (clust16 < FAT12_THRESHOLD
-               && !(size_fat_by_user && size_fat == 16)) {
-               if (verbose >= 2)
-                   printf("FAT16: would be misdetected as FAT12\n");
+           if (clust16 && clust16 < MIN_CLUST_16) {
+               if (verbose >= 2 && (size_fat == 0 || size_fat == 16))
+                   printf("Trying FAT16: not enough clusters, would be misdetected as FAT12\n");
                clust16 = 0;
            }
 
@@ -829,19 +887,20 @@ static void setup_tables(void)
            maxclust32 = (fatlength32 * sector_size) / 4;
            if (maxclust32 > MAX_CLUST_32)
                maxclust32 = MAX_CLUST_32;
-           if (clust32 && clust32 < MIN_CLUST_32
-               && !(size_fat_by_user && size_fat == 32)) {
+           if (verbose >= 2 && (size_fat == 0 || size_fat == 32))
+               printf("Trying FAT32: #clu=%u, fatlen=%u, maxclu=%u, limit=%u/%u\n",
+                      clust32, fatlength32, maxclust32, MIN_CLUST_32, MAX_CLUST_32);
+           if (clust32 > maxclust32) {
+               if (verbose >= 2 && (size_fat == 0 || size_fat == 32))
+                   printf("Trying FAT32: too much clusters\n");
                clust32 = 0;
-               if (verbose >= 2)
-                   printf("FAT32: not enough clusters (%d)\n", MIN_CLUST_32);
            }
-           if (verbose >= 2)
-               printf("FAT32: #clu=%u, fatlen=%u, maxclu=%u, limit=%u\n",
-                      clust32, fatlength32, maxclust32, MAX_CLUST_32);
-           if (clust32 > maxclust32) {
+           /* When explicitely asked, allow to create FAT32 with less then MIN_CLUST_32 */
+           if (clust32 && clust32 < MIN_CLUST_32
+               && !(size_fat_by_user && size_fat == 32)) {
+               if (verbose >= 2 && (size_fat == 0 || size_fat == 32))
+                   printf("Trying FAT32: not enough clusters\n");
                clust32 = 0;
-               if (verbose >= 2)
-                   printf("FAT32: too much clusters\n");
            }
 
            if ((clust12 && (size_fat == 0 || size_fat == 12)) ||
@@ -853,7 +912,8 @@ static void setup_tables(void)
        } while (bs.cluster_size && bs.cluster_size <= maxclustsize);
 
        /* Use the optimal FAT size if not specified;
-        * FAT32 is (not yet) choosen automatically */
+        * establish_params() will have already set size_fat to 32 if it is not
+        * specified and the filesystem size is over a specific threshold */
        if (!size_fat) {
            size_fat = (clust16 > clust12) ? 16 : 12;
            if (verbose >= 2)
@@ -869,23 +929,6 @@ static void setup_tables(void)
            break;
 
        case 16:
-           if (clust16 < FAT12_THRESHOLD) {
-               if (size_fat_by_user) {
-                   fprintf(stderr, "WARNING: Not enough clusters for a "
-                           "16 bit FAT! The filesystem will be\n"
-                           "misinterpreted as having a 12 bit FAT without "
-                           "mount option \"fat=16\".\n");
-               } else {
-                   fprintf(stderr, "This filesystem has an unfortunate size. "
-                           "A 12 bit FAT cannot provide\n"
-                           "enough clusters, but a 16 bit FAT takes up a little "
-                           "bit more space so that\n"
-                           "the total number of clusters becomes less than the "
-                           "threshold value for\n"
-                           "distinction between 12 and 16 bit FATs.\n");
-                   die("Make the filesystem a bit smaller manually.");
-               }
-           }
            cluster_count = clust16;
            fat_length = fatlength16;
            bs.fat_length = htole16(fatlength16);
@@ -894,8 +937,7 @@ static void setup_tables(void)
 
        case 32:
            if (clust32 < MIN_CLUST_32)
-               fprintf(stderr,
-                       "WARNING: Not enough clusters for a 32 bit FAT!\n");
+               fprintf(stderr, "WARNING: Number of clusters for 32 bit FAT is less then suggested minimum.\n");
            cluster_count = clust32;
            fat_length = fatlength32;
            bs.fat_length = htole16(0);
@@ -1000,6 +1042,100 @@ static void setup_tables(void)
        }
     }
 
+    if (fill_mbr_partition) {
+        uint8_t *partition;
+        uint8_t *disk_sig_ptr;
+        uint32_t disk_sig;
+        uint8_t buf[512];
+        int fd;
+
+        if (verbose)
+            printf("Adding MBR table\n");
+
+        if (size_fat == 32)
+            disk_sig_ptr = bs.fat32.boot_code + BOOTCODE_FAT32_SIZE - 16*4 - 6;
+        else
+            disk_sig_ptr = bs.oldfat.boot_code + BOOTCODE_SIZE - 16*4 - 6;
+
+        if (*(disk_sig_ptr-1)) {
+            printf("Warning: message too long; truncated\n");
+            *(disk_sig_ptr-1) = 0;
+        }
+
+        disk_sig = 0;
+        memset(disk_sig_ptr, 0, 16*4 + 6);
+
+        /* Try to read existing 32 bit disk signature */
+        fd = open(device_name, O_RDONLY);
+        if (fd >= 0) {
+            if (read(fd, buf, sizeof(buf)) == sizeof(buf) && buf[510] == 0x55 && buf[511] == 0xAA)
+                disk_sig = (uint32_t)buf[440] | ((uint32_t)buf[441] << 8) | ((uint32_t)buf[442] << 16) | ((uint32_t)buf[443] << 24);
+            close(fd);
+        }
+
+        /* If is not available then generate random 32 bit disk signature */
+        if (invariant)
+            disk_sig = volume_id;
+        else if (!disk_sig)
+            disk_sig = generate_volume_id();
+
+        disk_sig_ptr[0] = (disk_sig >>  0) & 0xFF;
+        disk_sig_ptr[1] = (disk_sig >>  8) & 0xFF;
+        disk_sig_ptr[2] = (disk_sig >> 16) & 0xFF;
+        disk_sig_ptr[3] = (disk_sig >> 24) & 0xFF;
+
+        partition = disk_sig_ptr + 6;
+
+        /* Active flag */
+        partition[0] = 0x80;
+
+        /* CHS address of the first sector */
+        partition[1] = 0;
+        partition[2] = 1;
+        partition[3] = 0;
+
+        /* Partition type */
+        if (le16toh(bs.heads) > 254 || le16toh(bs.secs_track) > 63) { /* CHS values are out of range for MBR, use LBA */
+            if (size_fat != 32)
+                partition[4] = 0x0E; /* BIG FAT16 (LBA) */
+            else
+                partition[4] = 0x0C; /* FAT32 (LBA) */
+        } else if (size_fat == 12 && num_sectors < 65536)
+            partition[4] = 0x01; /* FAT12 (CHS) */
+        else if (size_fat == 16 && num_sectors < 65536)
+            partition[4] = 0x04; /* FAT16 (CHS) */
+        else if (size_fat != 32 && num_sectors < le16toh(bs.secs_track) * le16toh(bs.heads) * 1024)
+            partition[4] = 0x06; /* BIG FAT16 or FAT12 (CHS) */
+        else if (size_fat != 32)
+            partition[4] = 0x0E; /* BIG FAT16 (LBA) */
+        else
+            partition[4] = 0x0C; /* FAT32 (LBA) */
+
+        /* CHS address of the last sector */
+        if (le16toh(bs.heads) > 254 || le16toh(bs.secs_track) > 63 || num_sectors >= le16toh(bs.secs_track) * le16toh(bs.heads) * 1024) {
+            /* If CHS address is too large use tuple (1023, 254, 63) */
+            partition[5] = 254;
+            partition[6] = 255;
+            partition[7] = 255;
+        } else {
+            partition[5] = (num_sectors / le16toh(bs.secs_track)) % le16toh(bs.heads);
+            partition[6] = ((1 + num_sectors % le16toh(bs.secs_track)) & 63) | (((num_sectors / (le16toh(bs.heads) * le16toh(bs.secs_track))) >> 8) * 64);
+            partition[7] = (num_sectors / (le16toh(bs.heads) * le16toh(bs.secs_track))) & 255;
+        }
+
+        /* LBA of the first sector */
+        partition[ 8] = 0;
+        partition[ 9] = 0;
+        partition[10] = 0;
+        partition[11] = 0;
+
+        /* Number of sectors */
+        partition[12] = (num_sectors >>  0) & 0xFF;
+        partition[13] = (num_sectors >>  8) & 0xFF;
+        partition[14] = (num_sectors >> 16) & 0xFF;
+        partition[15] = (num_sectors >> 24) & 0xFF;
+    }
+
     bs.sector_size[0] = (char)(sector_size & 0x00ff);
     bs.sector_size[1] = (char)((sector_size & 0xff00) >> 8);
 
@@ -1012,13 +1148,19 @@ static void setup_tables(void)
        bs.fat32.version[0] = 0;
        bs.fat32.version[1] = 0;
        bs.fat32.root_cluster = htole32(2);
-       bs.fat32.info_sector = htole16(1);
-       if (!backup_boot)
-           backup_boot = (reserved_sectors >= 7) ? 6 :
-               (reserved_sectors >= 2) ? reserved_sectors - 1 : 0;
-       else {
-           if (backup_boot == 1)
-               die("Backup boot sector must be after sector 1");
+       if (!info_sector)
+           info_sector = 1;
+       bs.fat32.info_sector = htole16(info_sector);
+       if (!backup_boot_set)
+           backup_boot = (reserved_sectors >= 7 && info_sector != 6) ? 6 :
+               (reserved_sectors >= 3 + info_sector &&
+                info_sector != reserved_sectors - 2 &&
+                info_sector != reserved_sectors - 1) ? reserved_sectors - 2 :
+               (reserved_sectors >= 3 && info_sector != reserved_sectors - 1) ?
+               reserved_sectors - 1 : 0;
+       if (backup_boot) {
+           if (backup_boot == info_sector)
+               die("Backup boot sector must not be same as info sector (%d)", info_sector);
            else if (backup_boot >= reserved_sectors)
                die("Backup boot sector must be a reserved sector");
        }
@@ -1053,9 +1195,9 @@ static void setup_tables(void)
 
     if (!cluster_count) {
        if (sectors_per_cluster)        /* If yes, die if we'd spec'd sectors per cluster */
-           die("Too many clusters for filesystem - try more sectors per cluster");
+           die("Not enough or too many clusters for filesystem - try less or more sectors per cluster");
        else
-           die("Attempting to create a too large filesystem");
+           die("Attempting to create a too small or a too large filesystem");
     }
     fat_entries = cluster_count + 2;
 
@@ -1076,8 +1218,8 @@ static void setup_tables(void)
               (le16toh(bs.secs_track) != 1) ? "s" : "");
        printf("hidden sectors 0x%04x;\n",  hidden_sectors);
        printf("logical sector size is %d,\n", sector_size);
-       printf("using 0x%02x media descriptor, with %d sectors;\n",
-              (int)(bs.media), num_sectors);
+       printf("using 0x%02x media descriptor, with %u sectors;\n",
+              (int)(bs.media), (unsigned)num_sectors);
        printf("drive number 0x%02x;\n", (int) (vi->drive_number));
        printf("filesystem has %d %d-bit FAT%s and %d sector%s per cluster.\n",
               (int)(bs.fats), size_fat, (bs.fats != 1) ? "s" : "",
@@ -1099,7 +1241,7 @@ static void setup_tables(void)
        }
        printf("Volume ID is %08lx, ", volume_id &
               (atari_format ? 0x00ffffff : 0xffffffff));
-       if (strcmp(volume_name, NO_NAME))
+       if (memcmp(label, NO_NAME, MSDOS_NAME))
            printf("volume label %s.\n", volume_name);
        else
            printf("no volume label.\n");
@@ -1138,21 +1280,32 @@ static void setup_tables(void)
     }
 
     memset(root_dir, 0, size_root_dir);
-    if (memcmp(volume_name, NO_NAME, MSDOS_NAME)) {
+    if (memcmp(label, NO_NAME, MSDOS_NAME)) {
        struct msdos_dir_entry *de = &root_dir[0];
-       memcpy(de->name, volume_name, MSDOS_NAME);
+       memcpy(de->name, label, MSDOS_NAME);
+       if (de->name[0] == 0xe5)
+           de->name[0] = 0x05;
        de->attr = ATTR_VOLUME;
-       if (!invariant)
+       if (create_time != (time_t)-1) {
+           if (!invariant)
                ctime = localtime(&create_time);
-       else
+           else
                ctime = gmtime(&create_time);
-       de->time = htole16((unsigned short)((ctime->tm_sec >> 1) +
-                                           (ctime->tm_min << 5) +
-                                           (ctime->tm_hour << 11)));
-       de->date =
-           htole16((unsigned short)(ctime->tm_mday +
-                                    ((ctime->tm_mon + 1) << 5) +
-                                    ((ctime->tm_year - 80) << 9)));
+       } else {
+           ctime = NULL;
+       }
+       if (ctime && ctime->tm_year >= 80 && ctime->tm_year <= 207) {
+           de->time = htole16((unsigned short)((ctime->tm_sec >> 1) +
+                                               (ctime->tm_min << 5) +
+                                               (ctime->tm_hour << 11)));
+           de->date = htole16((unsigned short)(ctime->tm_mday +
+                                               ((ctime->tm_mon + 1) << 5) +
+                                               ((ctime->tm_year - 80) << 9)));
+       } else {
+           /* fallback to 1.1.1980 00:00:00 */
+           de->time = htole16(0);
+           de->date = htole16(1 + (1 << 5));
+       }
        de->ctime_cs = 0;
        de->ctime = de->time;
        de->cdate = de->date;
@@ -1166,17 +1319,17 @@ static void setup_tables(void)
        /* For FAT32, create an info sector */
        struct fat32_fsinfo *info;
 
-       if (!(info_sector = malloc(sector_size)))
+       if (!(info_sector_buffer = malloc(sector_size)))
            die("Out of memory");
-       memset(info_sector, 0, sector_size);
+       memset(info_sector_buffer, 0, sector_size);
        /* fsinfo structure is at offset 0x1e0 in info sector by observation */
-       info = (struct fat32_fsinfo *)(info_sector + 0x1e0);
+       info = (struct fat32_fsinfo *)(info_sector_buffer + 0x1e0);
 
        /* Info sector magic */
-       info_sector[0] = 'R';
-       info_sector[1] = 'R';
-       info_sector[2] = 'a';
-       info_sector[3] = 'A';
+       info_sector_buffer[0] = 'R';
+       info_sector_buffer[1] = 'R';
+       info_sector_buffer[2] = 'a';
+       info_sector_buffer[3] = 'A';
 
        /* Magic for fsinfo structure */
        info->signature = htole32(0x61417272);
@@ -1185,7 +1338,7 @@ static void setup_tables(void)
        info->next_cluster = htole32(2);
 
        /* Info sector also must have boot sign */
-       *(uint16_t *) (info_sector + 0x1fe) = htole16(BOOT_SIGN);
+       *(uint16_t *) (info_sector_buffer + 0x1fe) = htole16(BOOT_SIGN);
     }
 
     if (!(blank_sector = malloc(sector_size)))
@@ -1198,7 +1351,7 @@ static void setup_tables(void)
 #define error(str)                             \
   do {                                         \
     free (fat);                                        \
-    if (info_sector) free (info_sector);       \
+    free (info_sector_buffer);                 \
     free (root_dir);                           \
     die (str);                                 \
   } while(0)
@@ -1206,7 +1359,7 @@ static void setup_tables(void)
 #define seekto(pos,errstr)                                             \
   do {                                                                 \
     off_t __pos = (pos);                                               \
-    if (lseek (dev, __pos, SEEK_SET) != __pos)                         \
+    if (lseek (dev, part_sector * sector_size + __pos, SEEK_SET) != part_sector * sector_size + __pos)                         \
        error ("seek to " errstr " failed whilst writing tables");      \
   } while(0)
 
@@ -1235,11 +1388,16 @@ static void write_tables(void)
     /* on FAT32, write the info sector and backup boot sector */
     if (size_fat == 32) {
        seekto(le16toh(bs.fat32.info_sector) * sector_size, "info sector");
-       writebuf(info_sector, 512, "info sector");
+       writebuf(info_sector_buffer, 512, "info sector");
        if (backup_boot != 0) {
            seekto(backup_boot * sector_size, "backup boot sector");
            writebuf((char *)&bs, sizeof(struct msdos_boot_sector),
                     "backup boot sector");
+           if (backup_boot + le16toh(bs.fat32.info_sector) != le16toh(bs.fat32.info_sector) &&
+               backup_boot + le16toh(bs.fat32.info_sector) < reserved_sectors) {
+               seekto((backup_boot + le16toh(bs.fat32.info_sector)) * sector_size, "backup info sector");
+               writebuf(info_sector_buffer, 512, "backup info sector");
+           }
        }
     }
     /* seek to start of FATS and write them all */
@@ -1257,56 +1415,52 @@ static void write_tables(void)
 
     if (blank_sector)
        free(blank_sector);
-    if (info_sector)
-       free(info_sector);
+    free(info_sector_buffer);
     free(root_dir);            /* Free up the root directory space from setup_tables */
     free(fat);                 /* Free up the fat table space reserved during setup_tables */
 }
 
 /* Report the command usage and exit with the given error code */
 
-static void usage(int exitval)
+static void usage(const char *name, int exitval)
 {
-    fprintf(stderr, "\
-Usage: mkfs.fat [-a][-A][-c][-C][-v][-I][-l bad-block-file][-b backup-boot-sector]\n\
-       [-m boot-msg-file][-n volume-name][-i volume-id]\n\
-       [-s sectors-per-cluster][-S logical-sector-size][-f number-of-FATs]\n\
-       [-h hidden-sectors][-F fat-size][-r root-dir-entries][-R reserved-sectors]\n\
-       [-M FAT-media-byte][-D drive_number]\n\
-       [--invariant]\n\
-       [--help]\n\
-       /dev/name [blocks]\n");
+    fprintf(stderr, "Usage: %s [OPTIONS] TARGET [BLOCKS]\n", name);
+    fprintf(stderr, "Create FAT filesystem in TARGET, which can be a block device or file. Use only\n");
+    fprintf(stderr, "up to BLOCKS 1024 byte blocks if specified. With the -C option, file TARGET will be\n");
+    fprintf(stderr, "created with a size of 1024 bytes times BLOCKS, which must be specified.\n");
+    fprintf(stderr, "\n");
+    fprintf(stderr, "Options:\n");
+    fprintf(stderr, "  -a              Disable alignment of data structures\n");
+    fprintf(stderr, "  -A              Toggle Atari variant of the filesystem\n");
+    fprintf(stderr, "  -b SECTOR       Select SECTOR as location of the FAT32 backup boot sector\n");
+    fprintf(stderr, "  -c              Check device for bad blocks before creating the filesystem\n");
+    fprintf(stderr, "  -C              Create file TARGET then create filesystem in it\n");
+    fprintf(stderr, "  -D NUMBER       Write BIOS drive number NUMBER to boot sector\n");
+    fprintf(stderr, "  -f COUNT        Create COUNT file allocation tables\n");
+    fprintf(stderr, "  -F SIZE         Select FAT size SIZE (12, 16 or 32)\n");
+    fprintf(stderr, "  -g GEOM         Select disk geometry: heads/sectors_per_track\n");
+    fprintf(stderr, "  -h NUMBER       Write hidden sectors NUMBER to boot sector\n");
+    fprintf(stderr, "  -i VOLID        Set volume ID to VOLID (a 32 bit hexadecimal number)\n");
+    fprintf(stderr, "  -I              Ignore and disable safety checks\n");
+    fprintf(stderr, "  -l FILENAME     Read bad blocks list from FILENAME\n");
+    fprintf(stderr, "  -m FILENAME     Replace default error message in boot block with contents of FILENAME\n");
+    fprintf(stderr, "  -M TYPE         Set media type in boot sector to TYPE\n");
+    fprintf(stderr, "  --mbr[=y|n|a]   Fill (fake) MBR table with one partition which spans whole disk\n");
+    fprintf(stderr, "  -n LABEL        Set volume name to LABEL (up to 11 characters long)\n");
+    fprintf(stderr, "  --codepage=N    use DOS codepage N to encode label (default: %d)\n", DEFAULT_DOS_CODEPAGE);
+    fprintf(stderr, "  -r COUNT        Make room for at least COUNT entries in the root directory\n");
+    fprintf(stderr, "  -R COUNT        Set minimal number of reserved sectors to COUNT\n");
+    fprintf(stderr, "  -s COUNT        Set number of sectors per cluster to COUNT\n");
+    fprintf(stderr, "  -S SIZE         Select a sector size of SIZE (a power of two, at least 512)\n");
+    fprintf(stderr, "  -v              Verbose execution\n");
+    fprintf(stderr, "  --variant=TYPE  Select variant TYPE of filesystem (standard or Atari)\n");
+    fprintf(stderr, "\n");
+    fprintf(stderr, "  --invariant     Use constants for randomly generated or time based values\n");
+    fprintf(stderr, "  --offset=SECTOR Write the filesystem at a specific sector into the device file.\n");
+    fprintf(stderr, "  --help          Show this help message and exit\n");
     exit(exitval);
 }
 
-/*
- * ++roman: On m68k, check if this is an Atari; if yes, turn on Atari variant
- * of MS-DOS filesystem by default.
- */
-static void check_atari(void)
-{
-#ifdef __mc68000__
-    FILE *f;
-    char line[128], *p;
-
-    if (!(f = fopen("/proc/hardware", "r"))) {
-       perror("/proc/hardware");
-       return;
-    }
-
-    while (fgets(line, sizeof(line), f)) {
-       if (strncmp(line, "Model:", 6) == 0) {
-           p = line + 6;
-           p += strspn(p, " \t");
-           if (strncmp(p, "Atari ", 6) == 0)
-               atari_format = 1;
-           break;
-       }
-    }
-    fclose(f);
-#endif
-}
-
 /* The "main" entry point into the utility - we pick up the options and attempt to process them in some sort of sensible
    way.  In the event that some/all of the options are invalid we need to tell the user so that something can be done! */
 
@@ -1319,17 +1473,23 @@ int main(int argc, char **argv)
     struct device_info devinfo;
     int i = 0, pos, ch;
     int create = 0;
-    uint64_t cblocks = 0;
+    unsigned long long cblocks = 0;
     int blocks_specified = 0;
     struct timeval create_timeval;
+    long long conversion;
 
-    enum {OPT_HELP=1000, OPT_INVARIANT,};
+    enum {OPT_HELP=1000, OPT_INVARIANT, OPT_MBR, OPT_VARIANT, OPT_CODEPAGE, OPT_OFFSET};
     const struct option long_options[] = {
-           {"help", no_argument, NULL, OPT_HELP},
-           {"invariant", no_argument, NULL, OPT_INVARIANT},
+           {"codepage",  required_argument, NULL, OPT_CODEPAGE},
+           {"invariant", no_argument,       NULL, OPT_INVARIANT},
+           {"mbr",       optional_argument, NULL, OPT_MBR},
+           {"variant",   required_argument, NULL, OPT_VARIANT},
+           {"offset",    required_argument, NULL, OPT_OFFSET},
+           {"help",      no_argument,       NULL, OPT_HELP},
            {0,}
     };
 
+    program_name = "mkfs.fat";
     if (argc && *argv) {       /* What's the program name? */
        char *p;
        program_name = *argv;
@@ -1337,14 +1497,14 @@ int main(int argc, char **argv)
            program_name = p + 1;
     }
 
-    gettimeofday(&create_timeval, NULL);
-    create_time = create_timeval.tv_sec;
-    volume_id = (uint32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec);   /* Default volume ID = creation time, fudged for more uniqueness */
+    if (gettimeofday(&create_timeval, NULL) == 0 && create_timeval.tv_sec != (time_t)-1)
+        create_time = create_timeval.tv_sec;
+    volume_id = generate_volume_id();
     check_atari();
 
     printf("mkfs.fat " VERSION " (" VERSION_DATE ")\n");
 
-    while ((c = getopt_long(argc, argv, "aAb:cCf:D:F:Ii:l:m:M:n:r:R:s:S:h:v",
+    while ((c = getopt_long(argc, argv, "aAb:cCf:D:F:g:Ii:l:m:M:n:r:R:s:S:h:v",
                                    long_options, NULL)) != -1)
        /* Scan the command line for options */
        switch (c) {
@@ -1357,11 +1517,14 @@ int main(int argc, char **argv)
            break;
 
        case 'b':               /* b : location of backup boot sector */
-           backup_boot = (int)strtol(optarg, &tmp, 0);
-           if (*tmp || backup_boot < 2 || backup_boot > 0xffff) {
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0 || conversion > 0xffff) {
                printf("Bad location for backup boot sector : %s\n", optarg);
-               usage(1);
+               usage(argv[0], 1);
            }
+           backup_boot = conversion;
+           backup_boot_set = 1;
            break;
 
        case 'c':               /* c : Check FS as we build it */
@@ -1374,50 +1537,86 @@ int main(int argc, char **argv)
            break;
 
        case 'D':               /* D : Choose Drive Number */
-           drive_number_option = (int) strtol (optarg, &tmp, 0);
-           if (*tmp || (drive_number_option != 0 && drive_number_option != 0x80)) {
-               printf ("Drive number must be 0 or 0x80: %s\n", optarg);
-               usage(1);
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0x00 || conversion > 0xFF) {
+               printf ("Bad drive number: %s\n", optarg);
+               usage(argv[0], 1);
            }
+           drive_number_option = conversion;
            drive_number_by_user=1;
            break;
 
        case 'f':               /* f : Choose number of FATs */
-           nr_fats = (int)strtol(optarg, &tmp, 0);
-           if (*tmp || nr_fats < 1 || nr_fats > 4) {
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 1 || conversion > 4) {
                printf("Bad number of FATs : %s\n", optarg);
-               usage(1);
+               usage(argv[0], 1);
            }
+           nr_fats = conversion;
            break;
 
        case 'F':               /* F : Choose FAT size */
-           size_fat = (int)strtol(optarg, &tmp, 0);
-           if (*tmp || (size_fat != 12 && size_fat != 16 && size_fat != 32)) {
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || (conversion != 12 && conversion != 16 && conversion != 32)) {
                printf("Bad FAT type : %s\n", optarg);
-               usage(1);
+               usage(argv[0], 1);
            }
+           size_fat = conversion;
            size_fat_by_user = 1;
            break;
 
+       case 'g':               /* g : geometry: heads and sectors per track */
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || tmp[0] != '/' || !tmp[1] || isspace(tmp[1]) || errno || conversion <= 0 || conversion > UINT16_MAX) {
+               printf("Bad format of geometry : %s\n", optarg);
+               usage(argv[0], 1);
+           }
+           bs.heads = htole16(conversion);
+           conversion = strtol(tmp+1, &tmp, 0);
+           if (*tmp || errno || conversion <= 0 || conversion > UINT16_MAX) {
+               printf("Bad format of geometry : %s\n", optarg);
+               usage(argv[0], 1);
+           }
+           bs.secs_track = htole16(conversion);
+           break;
+
        case 'h':               /* h : number of hidden sectors */
-           hidden_sectors = (int)strtol(optarg, &tmp, 0);
-           if (*tmp || hidden_sectors < 0) {
+           errno = 0;
+           conversion = strtoll(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0 || conversion > UINT32_MAX) {
                printf("Bad number of hidden sectors : %s\n", optarg);
-               usage(1);
+               usage(argv[0], 1);
            }
+           hidden_sectors = conversion;
            hidden_sectors_by_user = 1;
            break;
 
        case 'I':
-           ignore_full_disk = 1;
+           ignore_safety_checks = 1;
            break;
 
        case 'i':               /* i : specify volume ID */
-           volume_id = strtoul(optarg, &tmp, 16);
-           if (*tmp) {
+           errno = 0;
+           conversion = strtoll(optarg, &tmp, 16);
+
+           if (!*optarg || isspace(*optarg) || *tmp || conversion < 0) {
                printf("Volume ID must be a hexadecimal number\n");
-               usage(1);
+               usage(argv[0], 1);
+           }
+           if (conversion > UINT32_MAX) {
+               printf("Volume ID does not fit in 32 bit\n");
+               usage(argv[0], 1);
+           }
+           if (errno) {
+               printf("Parsing volume ID failed (%s)\n", strerror(errno));
+               usage(argv[0], 1);
            }
+
+           volume_id = conversion;
            break;
 
        case 'l':               /* l : Bad block filename */
@@ -1486,67 +1685,77 @@ int main(int argc, char **argv)
            break;
 
        case 'M':               /* M : FAT Media byte */
-           fat_media_byte = (int)strtol(optarg, &tmp, 0);
-           if (*tmp) {
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || *tmp || errno) {
                printf("Bad number for media descriptor : %s\n", optarg);
-               usage(1);
+               usage(argv[0], 1);
            }
-           if (fat_media_byte != 0xf0 && (fat_media_byte < 0xf8 || fat_media_byte > 0xff)) {
+           if (conversion != 0xf0 && (conversion < 0xf8 || conversion > 0xff)) {
                printf("FAT Media byte must either be between 0xF8 and 0xFF or be 0xF0 : %s\n", optarg);
-               usage(1);
+               usage(argv[0], 1);
            }
+           fat_media_byte = conversion;
            break;
 
        case 'n':               /* n : Volume name */
-           sprintf(volume_name, "%-11.11s", optarg);
-           for (i = 0; volume_name[i] && i < 11; i++)
-               /* don't know if here should be more strict !uppercase(label[i]) */
-               if (islower(volume_name[i])) {
-                   fprintf(stderr,
-                           "mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows\n");
-                   break;
-               }
+           volume_name = optarg;
+           break;
 
+       case OPT_CODEPAGE:      /* --codepage : Code page */
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 10);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 0 || conversion > INT_MAX) {
+               fprintf(stderr, "Invalid codepage : %s\n", optarg);
+               usage(argv[0], 1);
+           }
+           if (!set_dos_codepage(conversion))
+               usage(argv[0], 1);
            break;
 
        case 'r':               /* r : Root directory entries */
-           root_dir_entries = (int)strtol(optarg, &tmp, 0);
-           if (*tmp || root_dir_entries < 16 || root_dir_entries > 32768) {
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 16 || conversion > 32768) {
                printf("Bad number of root directory entries : %s\n", optarg);
-               usage(1);
+               usage(argv[0], 1);
            }
+           root_dir_entries = conversion;
+           root_dir_entries_set = 1;
            break;
 
        case 'R':               /* R : number of reserved sectors */
-           reserved_sectors = (int)strtol(optarg, &tmp, 0);
-           if (*tmp || reserved_sectors < 1 || reserved_sectors > 0xffff) {
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || conversion < 1 || conversion > 0xffff) {
                printf("Bad number of reserved sectors : %s\n", optarg);
-               usage(1);
+               usage(argv[0], 1);
            }
+           reserved_sectors = conversion;
            break;
 
        case 's':               /* s : Sectors per cluster */
-           sectors_per_cluster = (int)strtol(optarg, &tmp, 0);
-           if (*tmp || (sectors_per_cluster != 1 && sectors_per_cluster != 2
-                        && sectors_per_cluster != 4 && sectors_per_cluster != 8
-                        && sectors_per_cluster != 16
-                        && sectors_per_cluster != 32
-                        && sectors_per_cluster != 64
-                        && sectors_per_cluster != 128)) {
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || (conversion != 1 && conversion != 2
+               && conversion != 4 && conversion != 8 && conversion != 16
+               && conversion != 32 && conversion != 64 && conversion != 128)) {
                printf("Bad number of sectors per cluster : %s\n", optarg);
-               usage(1);
+               usage(argv[0], 1);
            }
+           sectors_per_cluster = conversion;
            break;
 
        case 'S':               /* S : Sector size */
-           sector_size = (int)strtol(optarg, &tmp, 0);
-           if (*tmp || (sector_size != 512 && sector_size != 1024 &&
-                        sector_size != 2048 && sector_size != 4096 &&
-                        sector_size != 8192 && sector_size != 16384 &&
-                        sector_size != 32768)) {
+           errno = 0;
+           conversion = strtol(optarg, &tmp, 0);
+           if (!*optarg || isspace(*optarg) || *tmp || errno || (conversion != 512 && conversion != 1024 &&
+               conversion != 2048 && conversion != 4096 && conversion != 8192 &&
+               conversion != 16384 && conversion != 32768)) {
                printf("Bad logical sector size : %s\n", optarg);
-               usage(1);
+               usage(argv[0], 1);
            }
+           sector_size = conversion;
            sector_size_set = 1;
            break;
 
@@ -1555,7 +1764,7 @@ int main(int argc, char **argv)
            break;
 
        case OPT_HELP:
-           usage(0);
+           usage(argv[0], 0);
            break;
 
        case OPT_INVARIANT:
@@ -1564,33 +1773,83 @@ int main(int argc, char **argv)
            create_time = 1426325213;
            break;
 
+       case OPT_MBR:
+           if (!optarg || !strcasecmp(optarg, "y") || !strcasecmp(optarg, "yes"))
+               fill_mbr_partition = 1;
+           else if (!strcasecmp(optarg, "n") || !strcasecmp(optarg, "no"))
+               fill_mbr_partition = 0;
+           else if (!strcasecmp(optarg, "a") || !strcasecmp(optarg, "auto"))
+               fill_mbr_partition = -1;
+           else {
+               printf("Unknown option for --mbr: '%s'\n", optarg);
+               usage(argv[0], 1);
+           }
+           break;
+
+       case OPT_VARIANT:
+           if (!strcasecmp(optarg, "standard")) {
+                   atari_format = 0;
+           } else if (!strcasecmp(optarg, "atari")) {
+                   atari_format = 1;
+           } else {
+                   printf("Unknown variant: %s\n", optarg);
+                   usage(argv[0], 1);
+           }
+           break;
+
+    case OPT_OFFSET:
+        errno = 0;
+        conversion = strtoll(optarg, &tmp, 0);
+        if (!*optarg || isspace(*optarg) || *tmp || errno) {
+            printf("Bad number for offset : %s\n", optarg);
+            usage(argv[0], 1);
+        }
+
+        if (conversion < 0 || conversion > OFF_MAX) {
+            printf("FAT offset must be between 0 and %lld: %s\n", (long long) OFF_MAX, optarg);
+            usage(argv[0], 1);
+        }
+
+        part_sector = (off_t) conversion;
+        break;
+
+       case '?':
+           usage(argv[0], 1);
+           exit(1);
+
        default:
-           printf("Unknown option: %c\n", c);
-           usage(1);
+           fprintf(stderr,
+                   "Internal error: getopt_long() returned unexpected value %d\n", c);
+           exit(2);
        }
 
+    if (!set_dos_codepage(-1)) /* set default codepage if none was given in command line */
+        exit(1);
+
     if (optind == argc || !argv[optind]) {
        printf("No device specified.\n");
-       usage(1);
+       usage(argv[0], 1);
     }
 
     device_name = argv[optind++];
 
     if (optind != argc) {
        blocks_specified = 1;
-       blocks = strtoull(argv[optind], &tmp, 0);
+       errno = 0;
+       conversion = strtoll(argv[optind], &tmp, 0);
 
-       if (*tmp) {
+       if (!*argv[optind] || isspace(*argv[optind]) || *tmp || errno || conversion < 0) {
            printf("Bad block count : %s\n", argv[optind]);
-           usage(1);
+           usage(argv[0], 1);
        }
+       blocks = conversion;
 
        optind++;
     }
 
     if (optind != argc) {
        fprintf(stderr, "Excess arguments on command line\n");
-       usage(1);
+       usage(argv[0], 1);
     }
 
     if (create && !blocks_specified)
@@ -1612,20 +1871,20 @@ int main(int argc, char **argv)
        dev = open(device_name, O_EXCL | O_RDWR | O_CREAT, 0666);
        if (dev < 0) {
            if (errno == EEXIST)
-               die("file %s already exists");
+               die("file %s already exists", device_name);
            else
-               die("unable to create %s");
+               die("unable to create %s", device_name);
        }
        /* expand to desired size */
-       if (ftruncate(dev, blocks * BLOCK_SIZE))
-           die("unable to resize %s");
+       if (ftruncate(dev, part_sector * sector_size + blocks * BLOCK_SIZE)) /* TODO: check overflow */
+           die("unable to resize %s", device_name);
     }
 
     if (get_device_info(dev, &devinfo) < 0)
-       die("error collecting information about %s");
+       die("error collecting information about %s", device_name);
 
     if (devinfo.size <= 0)
-       die("unable to discover size of %s");
+       die("unable to discover size of %s", device_name);
 
     if (devinfo.sector_size > 0) {
        if (sector_size_set) {
@@ -1639,6 +1898,10 @@ int main(int argc, char **argv)
            sector_size = devinfo.sector_size;
            sector_size_set = 1;
        }
+
+        if (devinfo.size <= part_sector * sector_size)
+          die("The device %s size %llu is less then the offset %llu",
+              device_name, devinfo.size, (unsigned long long) part_sector * sector_size);
     }
 
     if (sector_size > 4096)
@@ -1646,14 +1909,14 @@ int main(int argc, char **argv)
                "Warning: sector size %d > 4096 is non-standard, filesystem may not be usable\n",
                sector_size);
 
-    cblocks = devinfo.size / BLOCK_SIZE;
-    orphaned_sectors = (devinfo.size % BLOCK_SIZE) / sector_size;
+    cblocks = (devinfo.size - part_sector * sector_size) / BLOCK_SIZE;
+    orphaned_sectors = ((devinfo.size - part_sector * sector_size) % BLOCK_SIZE) / sector_size;
 
     if (blocks_specified) {
        if (blocks != cblocks) {
            fprintf(stderr, "Warning: block count mismatch: ");
            fprintf(stderr, "found %llu but assuming %llu.\n",
-                   (unsigned long long)cblocks, (unsigned long long)blocks);
+                   cblocks, blocks);
        }
     } else {
        blocks = cblocks;
@@ -1662,12 +1925,20 @@ int main(int argc, char **argv)
     /*
      * Ignore any 'full' fixed disk devices, if -I is not given.
      */
-    if (!ignore_full_disk && devinfo.type == TYPE_FIXED &&
-           devinfo.partition == 0)
-       die("Device partition expected, not making filesystem on entire device '%s' (use -I to override)");
+    if (!ignore_safety_checks && devinfo.has_children > 0)
+       die("Partitions or virtual mappings on device '%s', not making filesystem (use -I to override)",
+           device_name);
 
-    if (!ignore_full_disk && devinfo.has_children > 0)
-       die("Partitions or virtual mappings on device '%s', not making filesystem (use -I to override)");
+    /*
+     * On non-removable fixed disk devices we need to create (fake) MBR partition
+     * table so disk would be correctly recognized on MS Windows systems.
+     */
+    if (fill_mbr_partition == -1) {
+        if (devinfo.type == TYPE_FIXED && devinfo.partition == 0)
+            fill_mbr_partition = 1;
+        else
+            fill_mbr_partition = 0;
+    }
 
     establish_params(&devinfo);
     /* Establish the media parameters */
@@ -1681,5 +1952,10 @@ int main(int argc, char **argv)
 
     write_tables();            /* Write the filesystem tables away! */
 
+    /* Let's make sure to sync the block device. Otherwise, if we operate on a loop device and people issue
+     * "losetup -d" right after this command finishes our in-flight writes might never hit the disk */
+    if (fsync(dev) < 0)
+        pdie("unable to synchronize %s", device_name);
+
     exit(0);                   /* Terminate with no errors! */
 }
index 9c555ed..5c3f600 100644 (file)
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
        return 1;
     }
 
-    fd = open(argv[1], O_RDONLY);
+    fd = open(argv[1], O_RDONLY | O_NONBLOCK);
     if (fd < 0) {
        perror("open device");
        return 1;
@@ -42,7 +42,7 @@ int main(int argc, char **argv)
     get_device_info(fd, &info);
     close(fd);
 
-    printf("\nfound information:\n");
+    printf("found information:\n");
 
     printf("device type: ");
     switch (info.type) {
@@ -107,7 +107,13 @@ int main(int argc, char **argv)
     if (info.geom_start < 0)
        printf("unknown\n");
     else
-       printf("%ld\n", info.geom_start);
+       printf("%lld\n", info.geom_start);
+
+    printf("total disk sectors: ");
+    if (info.geom_size < 0)
+       printf("unknown\n");
+    else
+       printf("%lld\n", info.geom_size);
 
     printf("sector size: ");
     if (info.sector_size < 0)
diff --git a/test-driver b/test-driver
new file mode 100755 (executable)
index 0000000..b8521a4
--- /dev/null
@@ -0,0 +1,148 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
+#
+# 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, 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 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 maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+# Make unconditional expansion of undefined variables an error.  This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+  echo "$0: $*" >&2
+  print_usage >&2
+  exit 2
+}
+
+print_usage ()
+{
+  cat <<END
+Usage:
+  test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+              [--expect-failure={yes|no}] [--color-tests={yes|no}]
+              [--enable-hard-errors={yes|no}] [--]
+              TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+test_name= # Used for reporting.
+log_file=  # Where to save the output of the test script.
+trs_file=  # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+  case $1 in
+  --help) print_usage; exit $?;;
+  --version) echo "test-driver $scriptversion"; exit $?;;
+  --test-name) test_name=$2; shift;;
+  --log-file) log_file=$2; shift;;
+  --trs-file) trs_file=$2; shift;;
+  --color-tests) color_tests=$2; shift;;
+  --expect-failure) expect_failure=$2; shift;;
+  --enable-hard-errors) enable_hard_errors=$2; shift;;
+  --) shift; break;;
+  -*) usage_error "invalid option: '$1'";;
+   *) break;;
+  esac
+  shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file"  = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file"  = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+  usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+  usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+  # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+  red='\e[0;31m' # Red.
+  grn='\e[0;32m' # Green.
+  lgn='\e[1;32m' # Light green.
+  blu='\e[1;34m' # Blue.
+  mgn='\e[0;35m' # Magenta.
+  std='\e[m'     # No color.
+else
+  red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+  tweaked_estatus=1
+else
+  tweaked_estatus=$estatus
+fi
+
+case $tweaked_estatus:$expect_failure in
+  0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+  0:*)   col=$grn res=PASS  recheck=no  gcopy=no;;
+  77:*)  col=$blu res=SKIP  recheck=no  gcopy=yes;;
+  99:*)  col=$mgn res=ERROR recheck=yes gcopy=yes;;
+  *:yes) col=$lgn res=XFAIL recheck=no  gcopy=yes;;
+  *:*)   col=$red res=FAIL  recheck=yes gcopy=yes;;
+esac
+
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
index 50017f3..536c708 100644 (file)
@@ -7,31 +7,132 @@ endif
 TESTS = referenceFAT12.mkfs              \
        referenceFAT16.mkfs              \
        referenceFAT32.mkfs              \
+       referenceFAT32mbr.mkfs           \
+       mkfs-fat32_2_res_sects.mkfs      \
+       mkfs-fat32_4K.mkfs               \
        check-bad_names.fsck             \
+       check-fat12_first_cluster.fsck   \
+       check-fat16_first_cluster.fsck   \
+       check-fat32_first_cluster.fsck   \
+       check-fat16_dos_cln_shut.fsck    \
+       check-fat32_dos_cln_shut.fsck    \
        check-chain_to_free_cluster.fsck \
        check-chain_too_long.fsck        \
        check-chain_to_other_file.fsck   \
        check-circular_chain.fsck        \
        check-duplicate_names.fsck       \
-       check-dot_entries.fsck
+       check-dot_entries.fsck           \
+       check-huge.fsck                  \
+       check-label-different.fsck       \
+       check-label-only-boot.fsck       \
+       check-label-only-root.fsck       \
+       label-fat32_mkdosfs_label1_dosfslabel_empty.label          \
+       label-fat32_mkdosfs_label1_dosfslabel_label2.label         \
+       label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label        \
+       label-fat32_mkdosfs_label1_mlabel_erase.label              \
+       label-fat32_mkdosfs_label1_mlabel_NO_NAME.label            \
+       label-fat32_mkdosfs_label1_xp_erase.label                  \
+       label-fat32_mkdosfs_label1_xp_label2.label                 \
+       label-fat32_mkdosfs_label1.label                           \
+       label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
+       label-fat32_mkdosfs_none_dosfslabel_label1.label           \
+       label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label          \
+       label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
+       label-fat32_mkdosfs_none_xp_label1.label                   \
+       label-fat32_mkdosfs_none.label                             \
+       label-fat32_xp_label1.label                                \
+       label-fat32_xp_none_dosfslabel_label1.label                \
+       label-fat32_xp_none_mlabel_label1.label                    \
+       label-fat32_xp_none.label
 
-XFAIL_TESTS = check-dot_entries.fsck
 
-TEST_EXTENSIONS = .mkfs .fsck
+XFAIL_TESTS = check-huge.fsck
+
+TEST_EXTENSIONS = .mkfs .fsck .label
 MKFS_LOG_COMPILER = $(srcdir)/test-mkfs
 FSCK_LOG_COMPILER = $(srcdir)/test-fsck
+LABEL_LOG_COMPILER = $(srcdir)/test-label
 
-dist_check_DATA = test-mkfs test-fsck              \
+dist_check_DATA = test-mkfs test-fsck test-label   \
                  referenceFAT12.mkfs              \
                  referenceFAT12.xxd               \
                  referenceFAT16.mkfs              \
                  referenceFAT16.xxd               \
                  referenceFAT32.mkfs              \
                  referenceFAT32.xxd               \
+                 referenceFAT32mbr.mkfs           \
+                 referenceFAT32mbr.xxd            \
+                 mkfs-fat32_2_res_sects.mkfs      \
+                 mkfs-fat32_2_res_sects.xxd       \
+                 mkfs-fat32_4K.mkfs               \
+                 mkfs-fat32_4K.xxd                \
                  check-bad_names.fsck             \
+                 check-bad_names.xxd              \
+                 check-fat12_first_cluster.fsck   \
+                 check-fat12_first_cluster.args   \
+                 check-fat12_first_cluster.xxd    \
+                 check-fat16_first_cluster.fsck   \
+                 check-fat16_first_cluster.args   \
+                 check-fat16_first_cluster.xxd    \
+                 check-fat32_first_cluster.fsck   \
+                 check-fat32_first_cluster.args   \
+                 check-fat32_first_cluster.xxd    \
+                 check-fat16_dos_cln_shut.fsck    \
+                 check-fat16_dos_cln_shut.xxd     \
+                 check-fat32_dos_cln_shut.fsck    \
+                 check-fat32_dos_cln_shut.xxd     \
                  check-chain_to_free_cluster.fsck \
+                 check-chain_to_free_cluster.xxd  \
                  check-chain_too_long.fsck        \
+                 check-chain_too_long.xxd         \
                  check-chain_to_other_file.fsck   \
+                 check-chain_to_other_file.xxd    \
                  check-circular_chain.fsck        \
+                 check-circular_chain.xxd         \
                  check-duplicate_names.fsck       \
-                 check-dot_entries.fsck
+                 check-duplicate_names.xxd        \
+                 check-dot_entries.fsck           \
+                 check-dot_entries.xxd            \
+                 check-huge.fsck                  \
+                 check-label-different.fsck       \
+                 check-label-different.xxd        \
+                 check-label-only-boot.fsck       \
+                 check-label-only-boot.xxd        \
+                 check-label-only-root.fsck       \
+                 check-label-only-root.xxd        \
+                 label-fat32_mkdosfs_label1_dosfslabel_empty.label          \
+                 label-fat32_mkdosfs_label1_dosfslabel_empty.xxd            \
+                 label-fat32_mkdosfs_label1_dosfslabel_label2.label         \
+                 label-fat32_mkdosfs_label1_dosfslabel_label2.xxd           \
+                 label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label        \
+                 label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd          \
+                 label-fat32_mkdosfs_label1_mlabel_erase.label              \
+                 label-fat32_mkdosfs_label1_mlabel_erase.xxd                \
+                 label-fat32_mkdosfs_label1_mlabel_NO_NAME.label            \
+                 label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd              \
+                 label-fat32_mkdosfs_label1_xp_erase.label                  \
+                 label-fat32_mkdosfs_label1_xp_erase.xxd                    \
+                 label-fat32_mkdosfs_label1_xp_label2.label                 \
+                 label-fat32_mkdosfs_label1_xp_label2.xxd                   \
+                 label-fat32_mkdosfs_label1.label                           \
+                 label-fat32_mkdosfs_label1.xxd                             \
+                 label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
+                 label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd   \
+                 label-fat32_mkdosfs_none_dosfslabel_label1.label           \
+                 label-fat32_mkdosfs_none_dosfslabel_label1.xxd             \
+                 label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label          \
+                 label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd            \
+                 label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
+                 label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd   \
+                 label-fat32_mkdosfs_none_xp_label1.label                   \
+                 label-fat32_mkdosfs_none_xp_label1.xxd                     \
+                 label-fat32_mkdosfs_none.label                             \
+                 label-fat32_mkdosfs_none.xxd                               \
+                 label-fat32_xp_label1.label                                \
+                 label-fat32_xp_label1.xxd                                  \
+                 label-fat32_xp_none_dosfslabel_label1.label                \
+                 label-fat32_xp_none_dosfslabel_label1.xxd                  \
+                 label-fat32_xp_none_mlabel_label1.label                    \
+                 label-fat32_xp_none_mlabel_label1.xxd                      \
+                 label-fat32_xp_none.label                                  \
+                 label-fat32_xp_none.xxd
diff --git a/tests/Makefile.in b/tests/Makefile.in
new file mode 100644 (file)
index 0000000..b4ceb05
--- /dev/null
@@ -0,0 +1,945 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in 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.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \  ]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs  ]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = tests
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(dist_check_DATA) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red='\e[0;31m'; \
+    grn='\e[0;32m'; \
+    lgn='\e[1;32m'; \
+    blu='\e[1;34m'; \
+    mgn='\e[0;35m'; \
+    brg='\e[1m'; \
+    std='\e[m'; \
+  fi; \
+}
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__recheck_rx = ^[    ]*:recheck:[    ]*
+am__global_test_result_rx = ^[         ]*:global-test-result:[         ]*
+am__copy_in_global_log_rx = ^[         ]*:copy-in-global-log:[         ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+          if ((getline line2 < ($$0 ".log")) < 0) \
+           recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+          break; \
+        } \
+    }; \
+  if (recheck) \
+    print $$0; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[       ]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+      printf "\n"; \
+    }; \
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test.  Creates the
+# directory for the log if needed.  Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log.  Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup);                                     \
+$(am__vpath_adj_setup) $(am__vpath_adj)                        \
+$(am__tty_colors);                                     \
+srcdir=$(srcdir); export srcdir;                       \
+case "$@" in                                           \
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;   \
+    *) am__odir=.;;                                    \
+esac;                                                  \
+test "x$$am__odir" = x"." || test -d "$$am__odir"      \
+  || $(MKDIR_P) "$$am__odir" || exit $$?;              \
+if test -f "./$$f"; then dir=./;                       \
+elif test -f "$$f"; then dir=;                         \
+else dir="$(srcdir)/"; fi;                             \
+tst=$$dir$$f; log='$@';                                \
+if test -n '$(DISABLE_HARD_ERRORS)'; then              \
+  am__enable_hard_errors=no;                           \
+else                                                   \
+  am__enable_hard_errors=yes;                          \
+fi;                                                    \
+case " $(XFAIL_TESTS) " in                             \
+  *[\ \        ]$$f[\ \        ]* | *[\ \      ]$$dir$$f[\ \   ]*) \
+    am__expect_failure=yes;;                           \
+  *)                                                   \
+    am__expect_failure=no;;                            \
+esac;                                                  \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed).  The result is saved in the shell variable
+# '$bases'.  This honors runtime overriding of TESTS and TEST_LOGS.  Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+AM_RECURSIVE_TARGETS = check recheck
+TEST_SUITE_LOG = test-suite.log
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+am__test_logs3 = $(am__test_logs2:.mkfs.log=.log)
+MKFS_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+MKFS_LOG_COMPILE = $(MKFS_LOG_COMPILER) $(AM_MKFS_LOG_FLAGS) \
+       $(MKFS_LOG_FLAGS)
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
+am__test_logs4 = $(am__test_logs3:.fsck.log=.log)
+FSCK_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+FSCK_LOG_COMPILE = $(FSCK_LOG_COMPILER) $(AM_FSCK_LOG_FLAGS) \
+       $(FSCK_LOG_FLAGS)
+TEST_LOGS = $(am__test_logs4:.label.log=.log)
+LABEL_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+LABEL_LOG_COMPILE = $(LABEL_LOG_COMPILER) $(AM_LABEL_LOG_FLAGS) \
+       $(LABEL_LOG_FLAGS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECKATARI = @CHECKATARI@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RELEASE_DATE = @RELEASE_DATE@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+XXD_FOUND = @XXD_FOUND@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_TESTS_ENVIRONMENT = XXD_FOUND=@XXD_FOUND@; export XXD_FOUND;
+@AUTOMAKE_TEST_COMPAT_TRUE@TESTS_ENVIRONMENT = $(AM_TESTS_ENVIRONMENT)
+TESTS = referenceFAT12.mkfs              \
+       referenceFAT16.mkfs              \
+       referenceFAT32.mkfs              \
+       referenceFAT32mbr.mkfs           \
+       mkfs-fat32_2_res_sects.mkfs      \
+       mkfs-fat32_4K.mkfs               \
+       check-bad_names.fsck             \
+       check-fat12_first_cluster.fsck   \
+       check-fat16_first_cluster.fsck   \
+       check-fat32_first_cluster.fsck   \
+       check-fat16_dos_cln_shut.fsck    \
+       check-fat32_dos_cln_shut.fsck    \
+       check-chain_to_free_cluster.fsck \
+       check-chain_too_long.fsck        \
+       check-chain_to_other_file.fsck   \
+       check-circular_chain.fsck        \
+       check-duplicate_names.fsck       \
+       check-dot_entries.fsck           \
+       check-huge.fsck                  \
+       check-label-different.fsck       \
+       check-label-only-boot.fsck       \
+       check-label-only-root.fsck       \
+       label-fat32_mkdosfs_label1_dosfslabel_empty.label          \
+       label-fat32_mkdosfs_label1_dosfslabel_label2.label         \
+       label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label        \
+       label-fat32_mkdosfs_label1_mlabel_erase.label              \
+       label-fat32_mkdosfs_label1_mlabel_NO_NAME.label            \
+       label-fat32_mkdosfs_label1_xp_erase.label                  \
+       label-fat32_mkdosfs_label1_xp_label2.label                 \
+       label-fat32_mkdosfs_label1.label                           \
+       label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
+       label-fat32_mkdosfs_none_dosfslabel_label1.label           \
+       label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label          \
+       label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
+       label-fat32_mkdosfs_none_xp_label1.label                   \
+       label-fat32_mkdosfs_none.label                             \
+       label-fat32_xp_label1.label                                \
+       label-fat32_xp_none_dosfslabel_label1.label                \
+       label-fat32_xp_none_mlabel_label1.label                    \
+       label-fat32_xp_none.label
+
+XFAIL_TESTS = check-huge.fsck
+TEST_EXTENSIONS = .mkfs .fsck .label
+MKFS_LOG_COMPILER = $(srcdir)/test-mkfs
+FSCK_LOG_COMPILER = $(srcdir)/test-fsck
+LABEL_LOG_COMPILER = $(srcdir)/test-label
+dist_check_DATA = test-mkfs test-fsck test-label   \
+                 referenceFAT12.mkfs              \
+                 referenceFAT12.xxd               \
+                 referenceFAT16.mkfs              \
+                 referenceFAT16.xxd               \
+                 referenceFAT32.mkfs              \
+                 referenceFAT32.xxd               \
+                 referenceFAT32mbr.mkfs           \
+                 referenceFAT32mbr.xxd            \
+                 mkfs-fat32_2_res_sects.mkfs      \
+                 mkfs-fat32_2_res_sects.xxd       \
+                 mkfs-fat32_4K.mkfs               \
+                 mkfs-fat32_4K.xxd                \
+                 check-bad_names.fsck             \
+                 check-bad_names.xxd              \
+                 check-fat12_first_cluster.fsck   \
+                 check-fat12_first_cluster.args   \
+                 check-fat12_first_cluster.xxd    \
+                 check-fat16_first_cluster.fsck   \
+                 check-fat16_first_cluster.args   \
+                 check-fat16_first_cluster.xxd    \
+                 check-fat32_first_cluster.fsck   \
+                 check-fat32_first_cluster.args   \
+                 check-fat32_first_cluster.xxd    \
+                 check-fat16_dos_cln_shut.fsck    \
+                 check-fat16_dos_cln_shut.xxd     \
+                 check-fat32_dos_cln_shut.fsck    \
+                 check-fat32_dos_cln_shut.xxd     \
+                 check-chain_to_free_cluster.fsck \
+                 check-chain_to_free_cluster.xxd  \
+                 check-chain_too_long.fsck        \
+                 check-chain_too_long.xxd         \
+                 check-chain_to_other_file.fsck   \
+                 check-chain_to_other_file.xxd    \
+                 check-circular_chain.fsck        \
+                 check-circular_chain.xxd         \
+                 check-duplicate_names.fsck       \
+                 check-duplicate_names.xxd        \
+                 check-dot_entries.fsck           \
+                 check-dot_entries.xxd            \
+                 check-huge.fsck                  \
+                 check-label-different.fsck       \
+                 check-label-different.xxd        \
+                 check-label-only-boot.fsck       \
+                 check-label-only-boot.xxd        \
+                 check-label-only-root.fsck       \
+                 check-label-only-root.xxd        \
+                 label-fat32_mkdosfs_label1_dosfslabel_empty.label          \
+                 label-fat32_mkdosfs_label1_dosfslabel_empty.xxd            \
+                 label-fat32_mkdosfs_label1_dosfslabel_label2.label         \
+                 label-fat32_mkdosfs_label1_dosfslabel_label2.xxd           \
+                 label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label        \
+                 label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd          \
+                 label-fat32_mkdosfs_label1_mlabel_erase.label              \
+                 label-fat32_mkdosfs_label1_mlabel_erase.xxd                \
+                 label-fat32_mkdosfs_label1_mlabel_NO_NAME.label            \
+                 label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd              \
+                 label-fat32_mkdosfs_label1_xp_erase.label                  \
+                 label-fat32_mkdosfs_label1_xp_erase.xxd                    \
+                 label-fat32_mkdosfs_label1_xp_label2.label                 \
+                 label-fat32_mkdosfs_label1_xp_label2.xxd                   \
+                 label-fat32_mkdosfs_label1.label                           \
+                 label-fat32_mkdosfs_label1.xxd                             \
+                 label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label \
+                 label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd   \
+                 label-fat32_mkdosfs_none_dosfslabel_label1.label           \
+                 label-fat32_mkdosfs_none_dosfslabel_label1.xxd             \
+                 label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label          \
+                 label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd            \
+                 label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label \
+                 label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd   \
+                 label-fat32_mkdosfs_none_xp_label1.label                   \
+                 label-fat32_mkdosfs_none_xp_label1.xxd                     \
+                 label-fat32_mkdosfs_none.label                             \
+                 label-fat32_mkdosfs_none.xxd                               \
+                 label-fat32_xp_label1.label                                \
+                 label-fat32_xp_label1.xxd                                  \
+                 label-fat32_xp_none_dosfslabel_label1.label                \
+                 label-fat32_xp_none_dosfslabel_label1.xxd                  \
+                 label-fat32_xp_none_mlabel_label1.label                    \
+                 label-fat32_xp_none_mlabel_label1.xxd                      \
+                 label-fat32_xp_none.label                                  \
+                 label-fat32_xp_none.xxd
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .fsck .fsck$(EXEEXT) .label .label$(EXEEXT) .log .mkfs .mkfs$(EXEEXT) .trs
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign tests/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'.  Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+       rm -f $< $@
+       $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+       @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+       @$(am__set_TESTS_bases); \
+       am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+       redo_bases=`for i in $$bases; do \
+                     am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+                   done`; \
+       if test -n "$$redo_bases"; then \
+         redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+         redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+         if $(am__make_dryrun); then :; else \
+           rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+         fi; \
+       fi; \
+       if test -n "$$am__remaking_logs"; then \
+         echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+              "recursion detected" >&2; \
+       elif test -n "$$redo_logs"; then \
+         am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+       fi; \
+       if $(am__make_dryrun); then :; else \
+         st=0;  \
+         errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+         for i in $$redo_bases; do \
+           test -f $$i.trs && test -r $$i.trs \
+             || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+           test -f $$i.log && test -r $$i.log \
+             || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+         done; \
+         test $$st -eq 0 || exit 1; \
+       fi
+       @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+       ws='[   ]'; \
+       results=`for b in $$bases; do echo $$b.trs; done`; \
+       test -n "$$results" || results=/dev/null; \
+       all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+       pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+       fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+       skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+       xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+       xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+       error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+       if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+         success=true; \
+       else \
+         success=false; \
+       fi; \
+       br='==================='; br=$$br$$br$$br$$br; \
+       result_count () \
+       { \
+           if test x"$$1" = x"--maybe-color"; then \
+             maybe_colorize=yes; \
+           elif test x"$$1" = x"--no-color"; then \
+             maybe_colorize=no; \
+           else \
+             echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+           fi; \
+           shift; \
+           desc=$$1 count=$$2; \
+           if test $$maybe_colorize = yes && test $$count -gt 0; then \
+             color_start=$$3 color_end=$$std; \
+           else \
+             color_start= color_end=; \
+           fi; \
+           echo "$${color_start}# $$desc $$count$${color_end}"; \
+       }; \
+       create_testsuite_report () \
+       { \
+         result_count $$1 "TOTAL:" $$all   "$$brg"; \
+         result_count $$1 "PASS: " $$pass  "$$grn"; \
+         result_count $$1 "SKIP: " $$skip  "$$blu"; \
+         result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+         result_count $$1 "FAIL: " $$fail  "$$red"; \
+         result_count $$1 "XPASS:" $$xpass "$$red"; \
+         result_count $$1 "ERROR:" $$error "$$mgn"; \
+       }; \
+       {                                                               \
+         echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |       \
+           $(am__rst_title);                                           \
+         create_testsuite_report --no-color;                           \
+         echo;                                                         \
+         echo ".. contents:: :depth: 2";                               \
+         echo;                                                         \
+         for b in $$bases; do echo $$b; done                           \
+           | $(am__create_global_log);                                 \
+       } >$(TEST_SUITE_LOG).tmp || exit 1;                             \
+       mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);                     \
+       if $$success; then                                              \
+         col="$$grn";                                                  \
+        else                                                           \
+         col="$$red";                                                  \
+         test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);               \
+       fi;                                                             \
+       echo "$${col}$$br$${std}";                                      \
+       echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";   \
+       echo "$${col}$$br$${std}";                                      \
+       create_testsuite_report --maybe-color;                          \
+       echo "$$col$$br$$std";                                          \
+       if $$success; then :; else                                      \
+         echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";         \
+         if test -n "$(PACKAGE_BUGREPORT)"; then                       \
+           echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+         fi;                                                           \
+         echo "$$col$$br$$std";                                        \
+       fi;                                                             \
+       $$success || exit 1
+
+check-TESTS: $(dist_check_DATA)
+       @list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
+       @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+       @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+       @set +e; $(am__set_TESTS_bases); \
+       log_list=`for i in $$bases; do echo $$i.log; done`; \
+       trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+       log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+       exit $$?;
+recheck: all $(dist_check_DATA)
+       @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+       @set +e; $(am__set_TESTS_bases); \
+       bases=`for i in $$bases; do echo $$i; done \
+                | $(am__list_recheck_tests)` || exit 1; \
+       log_list=`for i in $$bases; do echo $$i.log; done`; \
+       log_list=`echo $$log_list`; \
+       $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+               am__force_recheck=am--force-recheck \
+               TEST_LOGS="$$log_list"; \
+       exit $$?
+.mkfs.log:
+       @p='$<'; \
+       $(am__set_b); \
+       $(am__check_pre) $(MKFS_LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_MKFS_LOG_DRIVER_FLAGS) $(MKFS_LOG_DRIVER_FLAGS) -- $(MKFS_LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.mkfs$(EXEEXT).log:
+@am__EXEEXT_TRUE@      @p='$<'; \
+@am__EXEEXT_TRUE@      $(am__set_b); \
+@am__EXEEXT_TRUE@      $(am__check_pre) $(MKFS_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@      --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@      $(am__common_driver_flags) $(AM_MKFS_LOG_DRIVER_FLAGS) $(MKFS_LOG_DRIVER_FLAGS) -- $(MKFS_LOG_COMPILE) \
+@am__EXEEXT_TRUE@      "$$tst" $(AM_TESTS_FD_REDIRECT)
+.fsck.log:
+       @p='$<'; \
+       $(am__set_b); \
+       $(am__check_pre) $(FSCK_LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_FSCK_LOG_DRIVER_FLAGS) $(FSCK_LOG_DRIVER_FLAGS) -- $(FSCK_LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.fsck$(EXEEXT).log:
+@am__EXEEXT_TRUE@      @p='$<'; \
+@am__EXEEXT_TRUE@      $(am__set_b); \
+@am__EXEEXT_TRUE@      $(am__check_pre) $(FSCK_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@      --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@      $(am__common_driver_flags) $(AM_FSCK_LOG_DRIVER_FLAGS) $(FSCK_LOG_DRIVER_FLAGS) -- $(FSCK_LOG_COMPILE) \
+@am__EXEEXT_TRUE@      "$$tst" $(AM_TESTS_FD_REDIRECT)
+.label.log:
+       @p='$<'; \
+       $(am__set_b); \
+       $(am__check_pre) $(LABEL_LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LABEL_LOG_DRIVER_FLAGS) $(LABEL_LOG_DRIVER_FLAGS) -- $(LABEL_LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.label$(EXEEXT).log:
+@am__EXEEXT_TRUE@      @p='$<'; \
+@am__EXEEXT_TRUE@      $(am__set_b); \
+@am__EXEEXT_TRUE@      $(am__check_pre) $(LABEL_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@      --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@      $(am__common_driver_flags) $(AM_LABEL_LOG_DRIVER_FLAGS) $(LABEL_LOG_DRIVER_FLAGS) -- $(LABEL_LOG_COMPILE) \
+@am__EXEEXT_TRUE@      "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+       $(MAKE) $(AM_MAKEFLAGS) $(dist_check_DATA)
+       $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       if test -z '$(STRIP)'; then \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+             install; \
+       else \
+         $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+       fi
+mostlyclean-generic:
+       -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+       -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+       -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+       cscopelist-am ctags-am distclean distclean-generic distdir dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+       pdf-am ps ps-am recheck tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
index 2480f43..96565e0 100644 (file)
@@ -23,9 +23,9 @@
 *
 00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b  TESTFAT16  ...ZK
 00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
-00041020: 4e41 4d20 3120 2020 4249 4e20 0000 cca0  NAM 1   BIN ....
+00041020: 2041 4d45 3120 2020 4249 4e20 0000 cca0   AME1   BIN ....
 00041030: 6249 6249 0000 cca0 6249 0000 0000 0000  bIbI....bI......
-00041040: 4e41 4d45 3220 2020 4220 4e20 0000 cea0  NAME2   B N ....
+00041040: 2020 2020 2020 2020 2020 2020 0000 cea0              ....
 00041050: 6249 6249 0000 cea0 6249 0000 0000 0000  bIbI....bI......
 00041060: 4e41 4d45 3320 2020 4249 4e20 0064 cfa0  NAME3   BIN .d..
 00041070: 6249 6249 0000 cfa0 6249 0000 0000 0000  bIbI....bI......
diff --git a/tests/check-bad_names.xxd b/tests/check-bad_names.xxd
new file mode 100644 (file)
index 0000000..1ceba4e
--- /dev/null
@@ -0,0 +1,36 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800  .<.mkfs.fat.....
+00000010: 0200 0200 00f8 0001 2000 4000 0000 0000  ........ .@.....
+00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446  ......)..4.TESTF
+00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f  AT16  FAT16   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001000: f8ff ffff 0000 0000 0000 0000 0000 0000  ................
+00001010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00021000: f8ff ffff 0000 0000 0000 0000 0000 0000  ................
+00021010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b  TESTFAT16  ...ZK
+00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
+00041020: 4653 434b 3030 3030 3030 3020 0000 cca0  FSCK0000000 ....
+00041030: 6249 6249 0000 cca0 6249 0000 0000 0000  bIbI....bI......
+00041040: 4653 434b 3030 3030 3030 3120 0000 cea0  FSCK0000001 ....
+00041050: 6249 6249 0000 cea0 6249 0000 0000 0000  bIbI....bI......
+00041060: 4e41 4d45 3320 2020 4249 4e20 0064 cfa0  NAME3   BIN .d..
+00041070: 6249 6249 0000 cfa0 6249 0000 0000 0000  bIbI....bI......
+00041080: 4653 434b 3030 3030 3030 3220 0000 09a1  FSCK0000002 ....
+00041090: 6249 6249 0000 09a1 6249 0000 0000 0000  bIbI....bI......
+000410a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-chain_to_free_cluster.xxd b/tests/check-chain_to_free_cluster.xxd
new file mode 100644 (file)
index 0000000..9a50fbb
--- /dev/null
@@ -0,0 +1,33 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800  .<.mkfs.fat.....
+00000010: 0200 0200 00f8 0001 2000 4000 0000 0000  ........ .@.....
+00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446  ......)..4.TESTF
+00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f  AT16  FAT16   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001000: f8ff ffff 0000 f8ff 0000 0000 0000 0000  ................
+00001010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00021000: f8ff ffff 0000 f8ff 0000 0000 0000 0000  ................
+00021010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b  TESTFAT16  ...ZK
+00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
+00041020: 5445 5354 2020 2020 5458 5420 0064 6a1b  TEST    TXT .dj.
+00041030: 2749 2749 0000 6a1b 2749 0300 0500 0000  'I'I..j.'I......
+00041040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00046000: 7465 7374 0a00 0000 0000 0000 0000 0000  test............
+00046010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-chain_to_other_file.xxd b/tests/check-chain_to_other_file.xxd
new file mode 100644 (file)
index 0000000..9315f2f
--- /dev/null
@@ -0,0 +1,106 @@
+00000000: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000020: 0040 1f00 d007 0000 0000 0000 0200 0000  .@..............
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 8000 29cd ab34 1254 4553 5446 4154 3332  ..)..4.TESTFAT32
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 fbe5 0300 0e00 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000c20: 0040 1f00 d007 0000 0000 0000 0200 0000  .@..............
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332  ..)..4.TESTFAT32
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0400 0000  ................
+00004010: 0500 0000 f8ff ff0f ffff ff0f 0800 0000  ................
+00004020: 0d00 0000 0a00 0000 ffff ff0f 0c00 0000  ................
+00004030: f8ff ff0f 0e00 0000 ffff ff0f 0000 0000  ................
+00004040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000fe000: f8ff ff0f ffff ff0f f8ff ff0f 0400 0000  ................
+000fe010: 0500 0000 f8ff ff0f ffff ff0f 0800 0000  ................
+000fe020: 0d00 0000 0a00 0000 ffff ff0f 0c00 0000  ................
+000fe030: f8ff ff0f 0e00 0000 ffff ff0f 0000 0000  ................
+000fe040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+001f8000: 5445 5354 4641 5433 3220 2008 0000 5a4b  TESTFAT32  ...ZK
+001f8010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
+001f8020: 5445 5354 524f 4f54 5458 5420 0064 1076  TESTROOTTXT .d.v
+001f8030: 3149 3149 0000 1076 3149 0300 0030 0000  1I1I...v1I...0..
+001f8040: 5445 5354 3120 2020 5458 5420 0064 1476  TEST1   TXT .d.v
+001f8050: 3149 3149 0000 1476 3149 0700 0040 0000  1I1I...v1I...@..
+001f8060: 5445 5354 3220 2020 5458 5420 0064 1576  TEST2   TXT .d.v
+001f8070: 3149 3149 0000 1576 3149 0b00 0020 0000  1I1I...v1I... ..
+001f8080: 4653 434b 3030 3030 5245 4300 0000 0000  FSCK0000REC.....
+001f8090: 0000 0000 0000 0000 0000 0600 0010 0000  ................
+001f80a0: 4653 434b 3030 3031 5245 4300 0000 0000  FSCK0001REC.....
+001f80b0: 0000 0000 0000 0000 0000 0900 0020 0000  ............. ..
+001f80c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+001f9000: 7465 7374 2063 6c75 7374 6572 2031 0a00  test cluster 1..
+001f9010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+001fa000: 7465 7374 2063 6c75 7374 6572 2032 0a00  test cluster 2..
+001fa010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+001fb000: 7465 7374 2063 6c75 7374 6572 2033 0a00  test cluster 3..
+001fb010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+001fc000: 7465 7374 2063 6c75 7374 6572 2034 0a00  test cluster 4..
+001fc010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+001fd000: 7465 7374 2063 6c75 7374 6572 2031 0a00  test cluster 1..
+001fd010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+001fe000: 7465 7374 2063 6c75 7374 6572 2032 0a00  test cluster 2..
+001fe010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+001ff000: 7465 7374 2063 6c75 7374 6572 2033 0a00  test cluster 3..
+001ff010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00200000: 7465 7374 2063 6c75 7374 6572 2034 0a00  test cluster 4..
+00200010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00201000: 7465 7374 2063 6c75 7374 6572 2031 0a00  test cluster 1..
+00201010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00202000: 7465 7374 2063 6c75 7374 6572 2032 0a00  test cluster 2..
+00202010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00203000: 7465 7374 2063 6c75 7374 6572 2033 0a00  test cluster 3..
+00203010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00204000: 7465 7374 2063 6c75 7374 6572 2034 0a00  test cluster 4..
+00204010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-chain_too_long.xxd b/tests/check-chain_too_long.xxd
new file mode 100644 (file)
index 0000000..11cb812
--- /dev/null
@@ -0,0 +1,36 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800  .<.mkfs.fat.....
+00000010: 0200 0200 00f8 0001 2000 4000 0000 0000  ........ .@.....
+00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446  ......)..4.TESTF
+00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f  AT16  FAT16   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001000: f8ff ffff 0000 f8ff 0000 0000 0000 0000  ................
+00001010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00021000: f8ff ffff 0000 f8ff 0000 0000 0000 0000  ................
+00021010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b  TESTFAT16  ...ZK
+00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
+00041020: 5445 5354 2020 2020 5458 5420 0000 e95a  TEST    TXT ...Z
+00041030: 2749 2749 0000 e95a 2749 0300 0700 0000  'I'I...Z'I......
+00041040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00046000: 7465 7374 2031 0a00 0000 0000 0000 0000  test 1..........
+00046010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00047000: 7465 7374 2032 0a00 0000 0000 0000 0000  test 2..........
+00047010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-circular_chain.xxd b/tests/check-circular_chain.xxd
new file mode 100644 (file)
index 0000000..1423f59
--- /dev/null
@@ -0,0 +1,44 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800  .<.mkfs.fat.....
+00000010: 0200 0200 00f8 0001 2000 4000 0000 0000  ........ .@.....
+00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446  ......)..4.TESTF
+00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f  AT16  FAT16   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001000: f8ff ffff 0000 0400 0500 f8ff ffff 0000  ................
+00001010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00021000: f8ff ffff 0000 0400 0500 f8ff ffff 0000  ................
+00021010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b  TESTFAT16  ...ZK
+00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
+00041020: 5445 5354 3443 4c53 5458 5420 0000 6f8d  TEST4CLSTXT ..o.
+00041030: 2c49 2c49 0000 6f8d 2c49 0300 0030 0000  ,I,I..o.,I...0..
+00041040: 4653 434b 3030 3030 5245 4300 0000 0000  FSCK0000REC.....
+00041050: 0000 0000 0000 0000 0000 0600 0010 0000  ................
+00041060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00046000: 7465 7374 2063 6c75 7374 6572 2031 0a00  test cluster 1..
+00046010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00047000: 7465 7374 2063 6c75 7374 6572 2032 0a00  test cluster 2..
+00047010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00048000: 7465 7374 2063 6c75 7374 6572 2033 0a00  test cluster 3..
+00048010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00049000: 7465 7374 2063 6c75 7374 6572 2034 0a00  test cluster 4..
+00049010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-dot_entries.xxd b/tests/check-dot_entries.xxd
new file mode 100644 (file)
index 0000000..cf619cd
--- /dev/null
@@ -0,0 +1,50 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800  .<.mkfs.fat.....
+00000010: 0200 0200 00f8 0001 2000 4000 0000 0000  ........ .@.....
+00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446  ......)..4.TESTF
+00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f  AT16  FAT16   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001000: f8ff ffff 0000 ffff ffff ffff 0000 0000  ................
+00001010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00021000: f8ff ffff 0000 ffff ffff ffff 0000 0000  ................
+00021010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b  TESTFAT16  ...ZK
+00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
+00041020: 4449 5220 2020 2020 2020 2010 0064 2012  DIR        ..d .
+00041030: 2749 2749 0000 2012 2749 0300 0000 0000  'I'I.. .'I......
+00041040: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00046000: 2e20 2020 2020 2020 2020 2010 0000 0000  .          .....
+00046010: 0000 0000 0000 0000 0000 0300 0000 0000  ................
+00046020: 2e2e 2020 2020 2020 2020 2010 0000 0000  ..         .....
+00046030: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00046040: e553 434b 3030 3030 3030 3010 0000 e611  .SCK0000000.....
+00046050: 2749 2749 0000 e611 2749 0000 0000 0000  'I'I....'I......
+00046060: e553 434b 3030 3030 3030 3110 0000 e611  .SCK0000001.....
+00046070: 2749 2749 0000 e611 2749 0000 0000 0000  'I'I....'I......
+00046080: 5445 5354 3120 2020 5458 5420 0064 2012  TEST1   TXT .d .
+00046090: 2749 2749 0000 2012 2749 0400 0700 0000  'I'I.. .'I......
+000460a0: 5445 5354 3220 2020 5458 5420 0064 2012  TEST2   TXT .d .
+000460b0: 2749 2749 0000 2012 2749 0500 0700 0000  'I'I.. .'I......
+000460c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00047000: 7465 7374 2031 0a00 0000 0000 0000 0000  test 1..........
+00047010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00048000: 7465 7374 2032 0a00 0000 0000 0000 0000  test 2..........
+00048010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-duplicate_names.xxd b/tests/check-duplicate_names.xxd
new file mode 100644 (file)
index 0000000..90f0b8b
--- /dev/null
@@ -0,0 +1,38 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800  .<.mkfs.fat.....
+00000010: 0200 0200 00f8 0001 2000 4000 0000 0000  ........ .@.....
+00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446  ......)..4.TESTF
+00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f  AT16  FAT16   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001000: f8ff ffff 0000 ffff ffff 0000 0000 0000  ................
+00001010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00021000: f8ff ffff 0000 ffff ffff 0000 0000 0000  ................
+00021010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00041000: 5445 5354 4641 5431 3620 2008 0000 5a4b  TESTFAT16  ...ZK
+00041010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
+00041020: 5445 5354 2020 2020 5458 5420 0000 e95a  TEST    TXT ...Z
+00041030: 2749 2749 0000 e95a 2749 0300 0700 0000  'I'I...Z'I......
+00041040: 4653 434b 3030 3030 3030 3020 0000 e95a  FSCK0000000 ...Z
+00041050: 2749 2749 0000 e95a 2749 0400 0700 0000  'I'I...Z'I......
+00041060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00046000: 7465 7374 2031 0a00 0000 0000 0000 0000  test 1..........
+00046010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00047000: 7465 7374 2032 0a00 0000 0000 0000 0000  test 2..........
+00047010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+0f9ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-fat12_first_cluster.args b/tests/check-fat12_first_cluster.args
new file mode 100644 (file)
index 0000000..36537b4
--- /dev/null
@@ -0,0 +1 @@
+-F 1
diff --git a/tests/check-fat12_first_cluster.fsck b/tests/check-fat12_first_cluster.fsck
new file mode 100644 (file)
index 0000000..5095630
--- /dev/null
@@ -0,0 +1,22 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0204 0100  .<.mkfs.fat.....
+00000010: 0200 02a0 07f8 0200 1000 0200 0000 0000  ................
+00000020: 0000 0000 8000 2917 99fd 524e 4f20 4e41  ......)...RNO NA
+00000030: 4d45 2020 2020 4641 5431 3220 2020 0e1f  ME    FAT12   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 00f0 ff00 0000 0000 0000 0000 0000 0000  ................
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000600: 00f0 ff00 0000 0000 0000 0000 0000 0000  ................
+00000610: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000f4230: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-fat12_first_cluster.xxd b/tests/check-fat12_first_cluster.xxd
new file mode 100644 (file)
index 0000000..4c5a04f
--- /dev/null
@@ -0,0 +1,22 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0204 0100  .<.mkfs.fat.....
+00000010: 0200 02a0 07f8 0200 1000 0200 0000 0000  ................
+00000020: 0000 0000 8000 2917 99fd 524e 4f20 4e41  ......)...RNO NA
+00000030: 4d45 2020 2020 4641 5431 3220 2020 0e1f  ME    FAT12   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: f8ff ff00 0000 0000 0000 0000 0000 0000  ................
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000600: f8ff ff00 0000 0000 0000 0000 0000 0000  ................
+00000610: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000f4230: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-fat16_dos_cln_shut.fsck b/tests/check-fat16_dos_cln_shut.fsck
new file mode 100644 (file)
index 0000000..510af5d
--- /dev/null
@@ -0,0 +1,24 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400  .<.mkfs.fat.....
+00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000  ...@L... .......
+00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41  ......)..!TNO NA
+00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f  ME    FAT16   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000800: f8ff ff7f 0000 0000 0000 0000 0000 0000  ................
+00000810: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00003000: f8ff ff7f 0000 0000 0000 0000 0000 0000  ................
+00003010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00989670: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-fat16_dos_cln_shut.xxd b/tests/check-fat16_dos_cln_shut.xxd
new file mode 100644 (file)
index 0000000..f4dda66
--- /dev/null
@@ -0,0 +1,24 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400  .<.mkfs.fat.....
+00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000  ...@L... .......
+00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41  ......)..!TNO NA
+00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f  ME    FAT16   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000800: f8ff ffff 0000 0000 0000 0000 0000 0000  ................
+00000810: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00003000: f8ff ffff 0000 0000 0000 0000 0000 0000  ................
+00003010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00989670: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-fat16_first_cluster.args b/tests/check-fat16_first_cluster.args
new file mode 100644 (file)
index 0000000..36537b4
--- /dev/null
@@ -0,0 +1 @@
+-F 1
diff --git a/tests/check-fat16_first_cluster.fsck b/tests/check-fat16_first_cluster.fsck
new file mode 100644 (file)
index 0000000..b1e597c
--- /dev/null
@@ -0,0 +1,24 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400  .<.mkfs.fat.....
+00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000  ...@L... .......
+00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41  ......)..!TNO NA
+00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f  ME    FAT16   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000800: 0000 ffff 0000 0000 0000 0000 0000 0000  ................
+00000810: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00003000: 0000 ffff 0000 0000 0000 0000 0000 0000  ................
+00003010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00989670: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-fat16_first_cluster.xxd b/tests/check-fat16_first_cluster.xxd
new file mode 100644 (file)
index 0000000..f4dda66
--- /dev/null
@@ -0,0 +1,24 @@
+00000000: eb3c 906d 6b66 732e 6661 7400 0204 0400  .<.mkfs.fat.....
+00000010: 0200 0240 4cf8 1400 2000 0200 0000 0000  ...@L... .......
+00000020: 0000 0000 8000 290f 1821 544e 4f20 4e41  ......)..!TNO NA
+00000030: 4d45 2020 2020 4641 5431 3620 2020 0e1f  ME    FAT16   ..
+00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
+00000050: 5eeb f032 e4cd 16cd 19eb fe54 6869 7320  ^..2.......This 
+00000060: 6973 206e 6f74 2061 2062 6f6f 7461 626c  is not a bootabl
+00000070: 6520 6469 736b 2e20 2050 6c65 6173 6520  e disk.  Please 
+00000080: 696e 7365 7274 2061 2062 6f6f 7461 626c  insert a bootabl
+00000090: 6520 666c 6f70 7079 2061 6e64 0d0a 7072  e floppy and..pr
+000000a0: 6573 7320 616e 7920 6b65 7920 746f 2074  ess any key to t
+000000b0: 7279 2061 6761 696e 202e 2e2e 200d 0a00  ry again ... ...
+000000c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000800: f8ff ffff 0000 0000 0000 0000 0000 0000  ................
+00000810: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00003000: f8ff ffff 0000 0000 0000 0000 0000 0000  ................
+00003010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00989670: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-fat32_dos_cln_shut.fsck b/tests/check-fat32_dos_cln_shut.fsck
new file mode 100644 (file)
index 0000000..7534c85
--- /dev/null
@@ -0,0 +1,55 @@
+00000000: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000010: 0200 0000 00f8 0000 3f00 4000 0000 0000  ........?.@.....
+00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020  ..).JJ.NO NAME  
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 fafd 0300 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000c10: 0200 0000 00f8 0000 3f00 4000 0000 0000  ........?.@.....
+00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020  ..).JJ.NO NAME  
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff07 f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00104000: f8ff ff0f ffff ff07 f8ff ff0f 0000 0000  ................
+00104010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+3ffffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-fat32_dos_cln_shut.xxd b/tests/check-fat32_dos_cln_shut.xxd
new file mode 100644 (file)
index 0000000..e28aa4a
--- /dev/null
@@ -0,0 +1,55 @@
+00000000: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000010: 0200 0000 00f8 0000 3f00 4000 0000 0000  ........?.@.....
+00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020  ..).JJ.NO NAME  
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 fafd 0300 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000c10: 0200 0000 00f8 0000 3f00 4000 0000 0000  ........?.@.....
+00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020  ..).JJ.NO NAME  
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00104000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00104010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+3ffffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-fat32_first_cluster.args b/tests/check-fat32_first_cluster.args
new file mode 100644 (file)
index 0000000..36537b4
--- /dev/null
@@ -0,0 +1 @@
+-F 1
diff --git a/tests/check-fat32_first_cluster.fsck b/tests/check-fat32_first_cluster.fsck
new file mode 100644 (file)
index 0000000..b6af29e
--- /dev/null
@@ -0,0 +1,55 @@
+00000000: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000010: 0200 0000 00f8 0000 3f00 4000 0000 0000  ........?.@.....
+00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020  ..).JJ.NO NAME  
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 fafd 0300 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000c10: 0200 0000 00f8 0000 3f00 4000 0000 0000  ........?.@.....
+00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020  ..).JJ.NO NAME  
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: 0000 0000 ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00104000: 0000 0000 ffff ff0f f8ff ff0f 0000 0000  ................
+00104010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+3ffffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-fat32_first_cluster.xxd b/tests/check-fat32_first_cluster.xxd
new file mode 100644 (file)
index 0000000..e28aa4a
--- /dev/null
@@ -0,0 +1,55 @@
+00000000: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000010: 0200 0000 00f8 0000 3f00 4000 0000 0000  ........?.@.....
+00000020: f8ff 1f00 0008 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020  ..).JJ.NO NAME  
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 fafd 0300 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000c10: 0200 0000 00f8 0000 3f00 4000 0000 0000  ........?.@.....
+00000c20: f8ff 1f00 0008 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 8000 297f 4a4a 964e 4f20 4e41 4d45 2020  ..).JJ.NO NAME  
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 fafd 0300 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00104000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00104010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+3ffffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-huge.fsck b/tests/check-huge.fsck
new file mode 100644 (file)
index 0000000..97d0a45
--- /dev/null
@@ -0,0 +1,47 @@
+00000000: eb58 906d 6b66 732e 6661 7400 0201 2000  .X.mkfs.fat... .
+00000010: 0100 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 2100 000a 0000 0002 0000 0000 0200 0000  !...............
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 8000 2986 8e80 974e 4f20 4e41 4d45 2020  ..)....NO NAME  
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 9b21 0300 0200 0000  ....rrAa.!......
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b66 732e 6661 7400 0201 2000  .X.mkfs.fat... .
+00000c10: 0100 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 2100 000a 0000 0002 0000 0000 0200 0000  !...............
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 8000 2986 8e80 974e 4f20 4e41 4d45 2020  ..)....NO NAME  
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+064ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-label-different.fsck b/tests/check-label-different.fsck
new file mode 100644 (file)
index 0000000..8b56516
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 298c afb8 e66c 6162 656c 3120 2020  ..)....label1   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 298c afb8 e66c 6162 656c 3120 2020  ..)....label1   
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000  LABEL2     .....
+00086010: 0000 0000 0000 37ab 4b4b 0000 0000 0000  ......7.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-label-different.xxd b/tests/check-label-different.xxd
new file mode 100644 (file)
index 0000000..8869970
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 298c afb8 e64c 4142 454c 3220 2020  ..)....LABEL2   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 298c afb8 e64c 4142 454c 3220 2020  ..)....LABEL2   
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000  LABEL2     .....
+00086010: 0000 0000 0000 37ab 4b4b 0000 0000 0000  ......7.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-label-only-boot.fsck b/tests/check-label-only-boot.fsck
new file mode 100644 (file)
index 0000000..3ffe530
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2966 bab4 926c 6162 656c 3120 2020  ..)f...label1   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020  ..)f...label1   
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: e561 6265 6c31 2020 2020 2008 0000 7bb0  .abel1     ...{.
+00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000  KKKK..{.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-label-only-boot.xxd b/tests/check-label-only-boot.xxd
new file mode 100644 (file)
index 0000000..28af747
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020  ..)f...NO NAME  
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020  ..)f...NO NAME  
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: e561 6265 6c31 2020 2020 2008 0000 7bb0  .abel1     ...{.
+00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000  KKKK..{.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-label-only-root.fsck b/tests/check-label-only-root.fsck
new file mode 100644 (file)
index 0000000..662aded
--- /dev/null
@@ -0,0 +1,121 @@
+00000000: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2904 9320 a44e 4f20 4e41 4d45 2020  ..).. .NO NAME  
+00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000600: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2904 9320 a44e 4f20 4e41 4d45 2020  ..).. .NO NAME  
+00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000d80: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000d90: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c  f..F.f.N$f..f.F.
+00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4  f..V.f..f.F.f.F.
+00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc  ....f.F,f.......
+00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802  f=........fPf...
+00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00  f..^...f..f.F...
+00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56  .........8-t...V
+00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72  .p}..^t......;.r
+00001870: e84e 75da 6658 e865 0072 bf83 c404 e955  .Nu.fX.e.r.....U
+00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1  .. ....u..}...f.
+00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff  ....f.....:.f=..
+000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e  ....0.fPf...f..N
+000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180  .f..f.F.........
+000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00  ....fX..........
+000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1  ....r..V@.... f.
+000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66  .....&f..f%....f
+000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633  =.......~f..N.f3
+00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603  .f..f;F.t:f.F.f.
+00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883  F.f..N.f..f..^(.
+00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866  ..t.:^.....Rf..f
+00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100  .F$f..f..ZR.....
+00001940: e89d fb5a 8bda c300 0000 0000 0000 0000  ...Z............
+00001950: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001a00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff ffff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff ffff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000  LABEL1     .....
+00086010: 0000 0000 0000 eab5 4b4b 0000 0000 0000  ........KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/check-label-only-root.xxd b/tests/check-label-only-root.xxd
new file mode 100644 (file)
index 0000000..8adb938
--- /dev/null
@@ -0,0 +1,121 @@
+00000000: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2904 9320 a44c 4142 454c 3120 2020  ..).. .LABEL1   
+00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000600: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2904 9320 a44c 4142 454c 3120 2020  ..).. .LABEL1   
+00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000d80: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000d90: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c  f..F.f.N$f..f.F.
+00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4  f..V.f..f.F.f.F.
+00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc  ....f.F,f.......
+00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802  f=........fPf...
+00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00  f..^...f..f.F...
+00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56  .........8-t...V
+00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72  .p}..^t......;.r
+00001870: e84e 75da 6658 e865 0072 bf83 c404 e955  .Nu.fX.e.r.....U
+00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1  .. ....u..}...f.
+00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff  ....f.....:.f=..
+000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e  ....0.fPf...f..N
+000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180  .f..f.F.........
+000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00  ....fX..........
+000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1  ....r..V@.... f.
+000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66  .....&f..f%....f
+000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633  =.......~f..N.f3
+00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603  .f..f;F.t:f.F.f.
+00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883  F.f..N.f..f..^(.
+00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866  ..t.:^.....Rf..f
+00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100  .F$f..f..ZR.....
+00001940: e89d fb5a 8bda c300 0000 0000 0000 0000  ...Z............
+00001950: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001a00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff ffff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff ffff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000  LABEL1     .....
+00086010: 0000 0000 0000 eab5 4b4b 0000 0000 0000  ........KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_label1.label b/tests/label-fat32_mkdosfs_label1.label
new file mode 100644 (file)
index 0000000..f4ce08e
--- /dev/null
@@ -0,0 +1 @@
+label1
diff --git a/tests/label-fat32_mkdosfs_label1.xxd b/tests/label-fat32_mkdosfs_label1.xxd
new file mode 100644 (file)
index 0000000..6584943
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2966 bab4 926c 6162 656c 3120 2020  ..)f...label1   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020  ..)f...label1   
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 6c61 6265 6c31 2020 2020 2008 0000 7bb0  label1     ...{.
+00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000  KKKK..{.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label b/tests/label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.label
new file mode 100644 (file)
index 0000000..954a891
--- /dev/null
@@ -0,0 +1 @@
+NO NAME
diff --git a/tests/label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd b/tests/label-fat32_mkdosfs_label1_dosfslabel_NO_NAME.xxd
new file mode 100644 (file)
index 0000000..46093b7
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020  ..)f...NO NAME  
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020  ..)f...NO NAME  
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4e4f 204e 414d 4520 2020 2008 0000 7bb0  NO NAME    ...{.
+00086010: 4b4b 4b4b 0000 05b4 4b4b 0000 0000 0000  KKKK....KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_label1_dosfslabel_empty.label b/tests/label-fat32_mkdosfs_label1_dosfslabel_empty.label
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/tests/label-fat32_mkdosfs_label1_dosfslabel_empty.xxd b/tests/label-fat32_mkdosfs_label1_dosfslabel_empty.xxd
new file mode 100644 (file)
index 0000000..24670a2
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2966 bab4 9220 2020 2020 2020 2020  ..)f...         
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2966 bab4 9220 2020 2020 2020 2020  ..)f...         
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 2020 2020 2020 2020 2020 2008 0000 7bb0             ...{.
+00086010: 4b4b 4b4b 0000 65b4 4b4b 0000 0000 0000  KKKK..e.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_label1_dosfslabel_label2.label b/tests/label-fat32_mkdosfs_label1_dosfslabel_label2.label
new file mode 100644 (file)
index 0000000..86c86c8
--- /dev/null
@@ -0,0 +1 @@
+label2
diff --git a/tests/label-fat32_mkdosfs_label1_dosfslabel_label2.xxd b/tests/label-fat32_mkdosfs_label1_dosfslabel_label2.xxd
new file mode 100644 (file)
index 0000000..a2227ed
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2966 bab4 926c 6162 656c 3220 2020  ..)f...label2   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2966 bab4 926c 6162 656c 3220 2020  ..)f...label2   
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 6c61 6265 6c32 2020 2020 2008 0000 7bb0  label2     ...{.
+00086010: 4b4b 4b4b 0000 b6b0 4b4b 0000 0000 0000  KKKK....KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_label1_mlabel_NO_NAME.label b/tests/label-fat32_mkdosfs_label1_mlabel_NO_NAME.label
new file mode 100644 (file)
index 0000000..954a891
--- /dev/null
@@ -0,0 +1 @@
+NO NAME
diff --git a/tests/label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd b/tests/label-fat32_mkdosfs_label1_mlabel_NO_NAME.xxd
new file mode 100644 (file)
index 0000000..e355f3c
--- /dev/null
@@ -0,0 +1,78 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020  ..)f...NO NAME  
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020  ..)f...NO NAME  
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001800: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00001810: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00001820: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00001830: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00001840: 0000 2966 bab4 926c 6162 656c 3120 2020  ..)f...label1   
+00001850: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00001860: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00001870: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00001880: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00001890: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000018a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000018b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000018c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000018d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000018e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001a00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4e4f 204e 414d 4520 2020 2008 0000 91b5  NO NAME    .....
+00086010: 4b4b 4b4b 0000 91b5 4b4b 0000 0000 0000  KKKK....KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_label1_mlabel_erase.label b/tests/label-fat32_mkdosfs_label1_mlabel_erase.label
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/label-fat32_mkdosfs_label1_mlabel_erase.xxd b/tests/label-fat32_mkdosfs_label1_mlabel_erase.xxd
new file mode 100644 (file)
index 0000000..c93be13
--- /dev/null
@@ -0,0 +1,78 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2966 bab4 924e 4f20 4e41 4d45 2020  ..)f...NO NAME  
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2966 bab4 924e 4f20 4e41 4d45 2020  ..)f...NO NAME  
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001800: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00001810: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00001820: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00001830: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00001840: 0000 2966 bab4 926c 6162 656c 3120 2020  ..)f...label1   
+00001850: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00001860: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00001870: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00001880: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00001890: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000018a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000018b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000018c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000018d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000018e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001a00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: e561 6265 6c31 2020 2020 2000 0000 7bb0  .abel1     ...{.
+00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000  KKKK..{.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_label1_xp_erase.label b/tests/label-fat32_mkdosfs_label1_xp_erase.label
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/label-fat32_mkdosfs_label1_xp_erase.xxd b/tests/label-fat32_mkdosfs_label1_xp_erase.xxd
new file mode 100644 (file)
index 0000000..3ffe530
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2966 bab4 926c 6162 656c 3120 2020  ..)f...label1   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020  ..)f...label1   
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: e561 6265 6c31 2020 2020 2008 0000 7bb0  .abel1     ...{.
+00086010: 4b4b 4b4b 0000 7bb0 4b4b 0000 0000 0000  KKKK..{.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_label1_xp_label2.label b/tests/label-fat32_mkdosfs_label1_xp_label2.label
new file mode 100644 (file)
index 0000000..8405499
--- /dev/null
@@ -0,0 +1 @@
+LABEL2
diff --git a/tests/label-fat32_mkdosfs_label1_xp_label2.xxd b/tests/label-fat32_mkdosfs_label1_xp_label2.xxd
new file mode 100644 (file)
index 0000000..1916a19
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2966 bab4 926c 6162 656c 3120 2020  ..)f...label1   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2966 bab4 926c 6162 656c 3120 2020  ..)f...label1   
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000  LABEL2     .....
+00086010: 0000 0000 0000 62b3 4b4b 0000 0000 0000  ......b.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_none.label b/tests/label-fat32_mkdosfs_none.label
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/label-fat32_mkdosfs_none.xxd b/tests/label-fat32_mkdosfs_none.xxd
new file mode 100644 (file)
index 0000000..7835627
--- /dev/null
@@ -0,0 +1,50 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 298c afb8 e620 2020 2020 2020 2020  ..)....         
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 298c afb8 e620 2020 2020 2020 2020  ..)....         
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label b/tests/label-fat32_mkdosfs_none_dosfslabel_NO_NAME.label
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd b/tests/label-fat32_mkdosfs_none_dosfslabel_NO_NAME.xxd
new file mode 100644 (file)
index 0000000..d228cae
--- /dev/null
@@ -0,0 +1,50 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 298c afb8 e64e 4f20 4e41 4d45 2020  ..)....NO NAME  
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 298c afb8 e64e 4f20 4e41 4d45 2020  ..)....NO NAME  
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_none_dosfslabel_label1.label b/tests/label-fat32_mkdosfs_none_dosfslabel_label1.label
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/label-fat32_mkdosfs_none_dosfslabel_label1.xxd b/tests/label-fat32_mkdosfs_none_dosfslabel_label1.xxd
new file mode 100644 (file)
index 0000000..407ecd5
--- /dev/null
@@ -0,0 +1,50 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 298c afb8 e66c 6162 656c 3120 2020  ..)....label1   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 298c afb8 e66c 6162 656c 3120 2020  ..)....label1   
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label b/tests/label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.label
new file mode 100644 (file)
index 0000000..8405499
--- /dev/null
@@ -0,0 +1 @@
+LABEL2
diff --git a/tests/label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd b/tests/label-fat32_mkdosfs_none_dosfslabel_label1_xp_label2.xxd
new file mode 100644 (file)
index 0000000..8b56516
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 298c afb8 e66c 6162 656c 3120 2020  ..)....label1   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 298c afb8 e66c 6162 656c 3120 2020  ..)....label1   
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4c41 4245 4c32 2020 2020 2008 0000 0000  LABEL2     .....
+00086010: 0000 0000 0000 37ab 4b4b 0000 0000 0000  ......7.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_none_xp_label1.label b/tests/label-fat32_mkdosfs_none_xp_label1.label
new file mode 100644 (file)
index 0000000..302d883
--- /dev/null
@@ -0,0 +1 @@
+LABEL1
diff --git a/tests/label-fat32_mkdosfs_none_xp_label1.xxd b/tests/label-fat32_mkdosfs_none_xp_label1.xxd
new file mode 100644 (file)
index 0000000..d97c935
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 298c afb8 e620 2020 2020 2020 2020  ..)....         
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 298c afb8 e620 2020 2020 2020 2020  ..)....         
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000  LABEL1     .....
+00086010: 0000 0000 0000 68aa 4b4b 0000 0000 0000  ......h.KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label b/tests/label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.label
new file mode 100644 (file)
index 0000000..86c86c8
--- /dev/null
@@ -0,0 +1 @@
+label2
diff --git a/tests/label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd b/tests/label-fat32_mkdosfs_none_xp_label1_dosfslabel_label2.xxd
new file mode 100644 (file)
index 0000000..2fdea9c
--- /dev/null
@@ -0,0 +1,54 @@
+00000000: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000010: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 298c afb8 e66c 6162 656c 3220 2020  ..)....label2   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b64 6f73 6673 0000 0201 2000  .X.mkdosfs.... .
+00000c10: 0200 0000 00f8 0000 2000 4000 0000 0000  ........ .@.....
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 298c afb8 e66c 6162 656c 3220 2020  ..)....label2   
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff f8ff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 6c61 6265 6c32 2020 2020 2008 0000 0000  label2     .....
+00086010: 0000 0000 0000 93aa 4b4b 0000 0000 0000  ........KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_xp_label1.label b/tests/label-fat32_xp_label1.label
new file mode 100644 (file)
index 0000000..302d883
--- /dev/null
@@ -0,0 +1 @@
+LABEL1
diff --git a/tests/label-fat32_xp_label1.xxd b/tests/label-fat32_xp_label1.xxd
new file mode 100644 (file)
index 0000000..662aded
--- /dev/null
@@ -0,0 +1,121 @@
+00000000: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2904 9320 a44e 4f20 4e41 4d45 2020  ..).. .NO NAME  
+00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 cf03 0100 0300 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000600: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2904 9320 a44e 4f20 4e41 4d45 2020  ..).. .NO NAME  
+00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000d80: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000d90: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c  f..F.f.N$f..f.F.
+00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4  f..V.f..f.F.f.F.
+00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc  ....f.F,f.......
+00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802  f=........fPf...
+00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00  f..^...f..f.F...
+00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56  .........8-t...V
+00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72  .p}..^t......;.r
+00001870: e84e 75da 6658 e865 0072 bf83 c404 e955  .Nu.fX.e.r.....U
+00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1  .. ....u..}...f.
+00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff  ....f.....:.f=..
+000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e  ....0.fPf...f..N
+000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180  .f..f.F.........
+000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00  ....fX..........
+000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1  ....r..V@.... f.
+000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66  .....&f..f%....f
+000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633  =.......~f..N.f3
+00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603  .f..f;F.t:f.F.f.
+00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883  F.f..N.f..f..^(.
+00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866  ..t.:^.....Rf..f
+00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100  .F$f..f..ZR.....
+00001940: e89d fb5a 8bda c300 0000 0000 0000 0000  ...Z............
+00001950: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001a00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ffff ffff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ffff ffff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4c41 4245 4c31 2020 2020 2008 0000 0000  LABEL1     .....
+00086010: 0000 0000 0000 eab5 4b4b 0000 0000 0000  ........KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_xp_none.label b/tests/label-fat32_xp_none.label
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/label-fat32_xp_none.xxd b/tests/label-fat32_xp_none.xxd
new file mode 100644 (file)
index 0000000..957cd52
--- /dev/null
@@ -0,0 +1,117 @@
+00000000: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2994 dcb6 544e 4f20 4e41 4d45 2020  ..)...TNO NAME  
+00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 ffff ffff 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000600: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2994 dcb6 544e 4f20 4e41 4d45 2020  ..)...TNO NAME  
+00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000d80: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000d90: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c  f..F.f.N$f..f.F.
+00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4  f..V.f..f.F.f.F.
+00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc  ....f.F,f.......
+00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802  f=........fPf...
+00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00  f..^...f..f.F...
+00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56  .........8-t...V
+00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72  .p}..^t......;.r
+00001870: e84e 75da 6658 e865 0072 bf83 c404 e955  .Nu.fX.e.r.....U
+00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1  .. ....u..}...f.
+00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff  ....f.....:.f=..
+000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e  ....0.fPf...f..N
+000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180  .f..f.F.........
+000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00  ....fX..........
+000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1  ....r..V@.... f.
+000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66  .....&f..f%....f
+000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633  =.......~f..N.f3
+00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603  .f..f;F.t:f.F.f.
+00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883  F.f..N.f..f..^(.
+00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866  ..t.:^.....Rf..f
+00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100  .F$f..f..ZR.....
+00001940: e89d fb5a 8bda c300 0000 0000 0000 0000  ...Z............
+00001950: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001a00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_xp_none_dosfslabel_label1.label b/tests/label-fat32_xp_none_dosfslabel_label1.label
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/label-fat32_xp_none_dosfslabel_label1.xxd b/tests/label-fat32_xp_none_dosfslabel_label1.xxd
new file mode 100644 (file)
index 0000000..3825e7c
--- /dev/null
@@ -0,0 +1,117 @@
+00000000: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2994 dcb6 546c 6162 656c 3120 2020  ..)...Tlabel1   
+00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 ffff ffff 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000600: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2994 dcb6 546c 6162 656c 3120 2020  ..)...Tlabel1   
+00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000d80: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000d90: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001800: 660f b646 1066 8b4e 2466 f7e1 6603 461c  f..F.f.N$f..f.F.
+00001810: 660f b756 0e66 03c2 6689 46fc 66c7 46f4  f..V.f..f.F.f.F.
+00001820: ffff ffff 668b 462c 6683 f802 0f82 a6fc  ....f.F,f.......
+00001830: 663d f8ff ff0f 0f83 9cfc 6650 6683 e802  f=........fPf...
+00001840: 660f b65e 0d8b f366 f7e3 6603 46fc bb00  f..^...f..f.F...
+00001850: 828b fbb9 0100 e887 fc38 2d74 1eb1 0b56  .........8-t...V
+00001860: be70 7df3 a65e 741b 03f9 83c7 153b fb72  .p}..^t......;.r
+00001870: e84e 75da 6658 e865 0072 bf83 c404 e955  .Nu.fX.e.r.....U
+00001880: fc00 2083 c404 8b75 098b 7d0f 8bc6 66c1  .. ....u..}...f.
+00001890: e010 8bc7 6683 f802 0f82 3afc 663d f8ff  ....f.....:.f=..
+000018a0: ff0f 0f83 30fc 6650 6683 e802 660f b64e  ....0.fPf...f..N
+000018b0: 0d66 f7e1 6603 46fc bb00 0006 8e06 8180  .f..f.F.........
+000018c0: e81d fc07 6658 c1eb 0401 1e81 80e8 0e00  ....fX..........
+000018d0: 0f83 0200 72d0 8a56 40ea 0000 0020 66c1  ....r..V@.... f.
+000018e0: e002 e811 0026 668b 0166 25ff ffff 0f66  .....&f..f%....f
+000018f0: 3df8 ffff 0fc3 bf00 7e66 0fb7 4e0b 6633  =.......~f..N.f3
+00001900: d266 f7f1 663b 46f4 743a 6689 46f4 6603  .f..f;F.t:f.F.f.
+00001910: 461c 660f b74e 0e66 03c1 660f b75e 2883  F.f..N.f..f..^(.
+00001920: e30f 7416 3a5e 100f 83ab fb52 668b c866  ..t.:^.....Rf..f
+00001930: 8b46 2466 f7e3 6603 c15a 528b dfb9 0100  .F$f..f..ZR.....
+00001940: e89d fb5a 8bda c300 0000 0000 0000 0000  ...Z............
+00001950: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000019f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001a00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/label-fat32_xp_none_mlabel_label1.label b/tests/label-fat32_xp_none_mlabel_label1.label
new file mode 100644 (file)
index 0000000..302d883
--- /dev/null
@@ -0,0 +1 @@
+LABEL1
diff --git a/tests/label-fat32_xp_none_mlabel_label1.xxd b/tests/label-fat32_xp_none_mlabel_label1.xxd
new file mode 100644 (file)
index 0000000..865ff30
--- /dev/null
@@ -0,0 +1,134 @@
+00000000: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000020: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 0000 2994 dcb6 544c 4142 454c 3120 2020  ..)...TLABEL1   
+00000050: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000060: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000070: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000080: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000090: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+000000a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+000000b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+000000c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+000000d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+000000e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+000000f0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000100: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000110: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000120: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000130: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000140: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000150: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000160: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000170: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000190: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+000001a0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+000001b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+000001c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+000001d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+000001e0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+000001f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 ffff ffff 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000005f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000600: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00000c20: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 0000 2994 dcb6 544c 4142 454c 3120 2020  ..)...TLABEL1   
+00000c50: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00000c60: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00000c70: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00000c80: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00000c90: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+00000ca0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+00000cb0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+00000cc0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+00000cd0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+00000ce0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+00000cf0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00000d00: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00000d10: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00000d20: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00000d30: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00000d40: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00000d50: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00000d60: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00000d70: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00000d80: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000d90: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000da0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+00000db0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+00000dc0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+00000dd0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+00000de0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+00000df0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 ffff ffff 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001800: eb58 904d 5344 4f53 352e 3000 0201 2000  .X.MSDOS5.0... .
+00001810: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
+00001820: 0008 0100 0802 0000 0000 0000 0200 0000  ................
+00001830: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00001840: 0000 2994 dcb6 544e 4f20 4e41 4d45 2020  ..)...TNO NAME  
+00001850: 2020 4641 5433 3220 2020 33c9 8ed1 bcf4    FAT32   3.....
+00001860: 7b8e c18e d9bd 007c 884e 028a 5640 b408  {......|.N..V@..
+00001870: cd13 7305 b9ff ff8a f166 0fb6 c640 660f  ..s......f...@f.
+00001880: b6d1 80e2 3ff7 e286 cdc0 ed06 4166 0fb7  ....?.......Af..
+00001890: c966 f7e1 6689 46f8 837e 1600 7538 837e  .f..f.F..~..u8.~
+000018a0: 2a00 7732 668b 461c 6683 c00c bb00 80b9  *.w2f.F.f.......
+000018b0: 0100 e82b 00e9 4803 a0fa 7db4 7d8b f0ac  ...+..H...}.}...
+000018c0: 84c0 7417 3cff 7409 b40e bb07 00cd 10eb  ..t.<.t.........
+000018d0: eea0 fb7d ebe5 a0f9 7deb e098 cd16 cd19  ...}....}.......
+000018e0: 6660 663b 46f8 0f82 4a00 666a 0066 5006  f`f;F...J.fj.fP.
+000018f0: 5366 6810 0001 0080 7e02 000f 8520 00b4  Sfh.....~.... ..
+00001900: 41bb aa55 8a56 40cd 130f 821c 0081 fb55  A..U.V@........U
+00001910: aa0f 8514 00f6 c101 0f84 0d00 fe46 02b4  .............F..
+00001920: 428a 5640 8bf4 cd13 b0f9 6658 6658 6658  B.V@......fXfXfX
+00001930: 6658 eb2a 6633 d266 0fb7 4e18 66f7 f1fe  fX.*f3.f..N.f...
+00001940: c28a ca66 8bd0 66c1 ea10 f776 1a86 d68a  ...f..f....v....
+00001950: 5640 8ae8 c0e4 060a ccb8 0102 cd13 6661  V@............fa
+00001960: 0f82 54ff 81c3 0002 6640 490f 8571 ffc3  ..T.....f@I..q..
+00001970: 4e54 4c44 5220 2020 2020 2000 0000 0000  NTLDR      .....
+00001980: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00001990: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+000019a0: 0000 0000 0000 0000 0000 0000 0d0a 5265  ..............Re
+000019b0: 6d6f 7665 2064 6973 6b73 206f 7220 6f74  move disks or ot
+000019c0: 6865 7220 6d65 6469 612e ff0d 0a44 6973  her media....Dis
+000019d0: 6b20 6572 726f 72ff 0d0a 5072 6573 7320  k error...Press 
+000019e0: 616e 7920 6b65 7920 746f 2072 6573 7461  any key to resta
+000019f0: 7274 0d0a 0000 0000 00ac cbd8 0000 55aa  rt............U.
+00001a00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00001a10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001be0: 0000 0000 7272 4161 ffff ffff 0200 0000  ....rrAa........
+00001bf0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001c00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00045000: f8ff ff0f ffff ff0f ffff ff0f 0000 0000  ................
+00045010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00086000: 4c41 4245 4c31 2020 2020 2008 0000 f3b6  LABEL1     .....
+00086010: 4b4b 4b4b 0000 f3b6 4b4b 0000 0000 0000  KKKK....KK......
+00086020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+020ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/mkfs-fat32_2_res_sects.mkfs b/tests/mkfs-fat32_2_res_sects.mkfs
new file mode 100644 (file)
index 0000000..d9eef7a
--- /dev/null
@@ -0,0 +1,3 @@
+ARGS="-n TESTFAT32 -a -R 2"
+SIZE=1024000
+CMP_LIMIT=10M
diff --git a/tests/mkfs-fat32_2_res_sects.xxd b/tests/mkfs-fat32_2_res_sects.xxd
new file mode 100644 (file)
index 0000000..3abe476
--- /dev/null
@@ -0,0 +1,33 @@
+00000000: eb58 906d 6b66 732e 6661 7400 0208 0200  .X.mkfs.fat.....
+00000010: 0200 0000 00f8 0000 3f00 2000 0000 0000  ........?. .....
+00000020: 0040 1f00 cd07 0000 0000 0000 0200 0000  .@..............
+00000030: 0100 0000 0000 0000 0000 0000 0000 0000  ................
+00000040: 8000 29cd ab34 1254 4553 5446 4154 3332  ..)..4.TESTFAT32
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 0be6 0300 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00000410: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000f9e00: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+000f9e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+001f3800: 5445 5354 4641 5433 3220 2008 0000 5a4b  TESTFAT32  ...ZK
+001f3810: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
+001f3820: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/mkfs-fat32_4K.mkfs b/tests/mkfs-fat32_4K.mkfs
new file mode 100644 (file)
index 0000000..9b937a3
--- /dev/null
@@ -0,0 +1,3 @@
+ARGS="-n TEST4K -S 4096"
+SIZE=614400
+CMP_LIMIT=10M
diff --git a/tests/mkfs-fat32_4K.xxd b/tests/mkfs-fat32_4K.xxd
new file mode 100644 (file)
index 0000000..9f555ff
--- /dev/null
@@ -0,0 +1,63 @@
+00000000: eb58 906d 6b66 732e 6661 7400 1001 2000  .X.mkfs.fat... .
+00000010: 0200 0000 00f8 0000 2000 0800 0000 0000  ........ .......
+00000020: 0058 0200 9600 0000 0000 0000 0200 0000  .X..............
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 8000 29cd ab34 1254 4553 5434 4b20 2020  ..)..4.TEST4K   
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00001000: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00001010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000011e0: 0000 0000 7272 4161 b356 0200 0200 0000  ....rrAa.V......
+000011f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00006000: eb58 906d 6b66 732e 6661 7400 1001 2000  .X.mkfs.fat... .
+00006010: 0200 0000 00f8 0000 2000 0800 0000 0000  ........ .......
+00006020: 0058 0200 9600 0000 0000 0000 0200 0000  .X..............
+00006030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00006040: 8000 29cd ab34 1254 4553 5434 4b20 2020  ..)..4.TEST4K   
+00006050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00006060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00006070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00006080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00006090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000060a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000060b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000060c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000060d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000060e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000061f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00006200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00007000: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00007010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000071e0: 0000 0000 7272 4161 b356 0200 0200 0000  ....rrAa.V......
+000071f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00007200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00020000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00020010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000b6000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+000b6010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+0014c000: 5445 5354 344b 2020 2020 2008 0000 5a4b  TEST4K     ...ZK
+0014c010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
+0014c020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+257ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
index e6156fe..2a44cf6 100644 (file)
@@ -1,5 +1,5 @@
 00000000: eb3c 906d 6b66 732e 6661 7400 0208 0800  .<.mkfs.fat.....
-00000010: 0200 0200 00f8 0001 2000 4000 0000 0000  ........ .@.....
+00000010: 0200 0200 00f8 0001 2000 1000 0000 0000  ........ .......
 00000020: 00d0 0700 8000 29cd ab34 1254 4553 5446  ......)..4.TESTF
 00000030: 4154 3136 2020 4641 5431 3620 2020 0e1f  AT16  FAT16   ..
 00000040: be5b 7cac 22c0 740b 56b4 0ebb 0700 cd10  .[|.".t.V.......
index 5bd88a3..a623f71 100644 (file)
@@ -1,6 +1,6 @@
 00000000: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
-00000010: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
-00000020: 0040 1f00 d007 0000 0000 0000 0200 0000  .@..............
+00000010: 0200 0000 00f8 0000 3f00 2000 0000 0000  ........?. .....
+00000020: c53f 1f00 d007 0000 0000 0000 0200 0000  .?..............
 00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
 00000040: 8000 29cd ab34 1254 4553 5446 4154 3332  ..)..4.TESTFAT32
 00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
 00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
 00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
 *
-000003e0: 0000 0000 7272 4161 07e6 0300 0200 0000  ....rrAa........
+000003e0: 0000 0000 7272 4161 ffe5 0300 0200 0000  ....rrAa........
 000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
 00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
 *
 00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
-00000c10: 0200 0000 00f8 0000 3f00 ff00 0000 0000  ........?.......
-00000c20: 0040 1f00 d007 0000 0000 0000 0200 0000  .@..............
+00000c10: 0200 0000 00f8 0000 3f00 2000 0000 0000  ........?. .....
+00000c20: c53f 1f00 d007 0000 0000 0000 0200 0000  .?..............
 00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
 00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332  ..)..4.TESTFAT32
 00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
 00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
 *
 00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
-00000e00: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 ffe5 0300 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
 *
 00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
 00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
diff --git a/tests/referenceFAT32mbr.mkfs b/tests/referenceFAT32mbr.mkfs
new file mode 100644 (file)
index 0000000..d79ef66
--- /dev/null
@@ -0,0 +1,3 @@
+ARGS="-n TESTFAT32 --mbr"
+SIZE=1024000
+CMP_LIMIT=10M
diff --git a/tests/referenceFAT32mbr.xxd b/tests/referenceFAT32mbr.xxd
new file mode 100644 (file)
index 0000000..93ad354
--- /dev/null
@@ -0,0 +1,67 @@
+00000000: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000010: 0200 0000 00f8 0000 3f00 2000 0000 0000  ........?. .....
+00000020: c53f 1f00 d007 0000 0000 0000 0200 0000  .?..............
+00000030: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000040: 8000 29cd ab34 1254 4553 5446 4154 3332  ..)..4.TESTFAT32
+00000050: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000060: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000070: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000080: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000090: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+000000a0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+000000b0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+000000c0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+000000d0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+000000e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000001b0: 0000 0000 0000 0000 cdab 3412 0000 8000  ..........4.....
+000001c0: 0100 0c1b c1f7 0000 0000 c53f 1f00 0000  ...........?....
+000001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+000001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000200: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000210: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000003e0: 0000 0000 7272 4161 ffe5 0300 0200 0000  ....rrAa........
+000003f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000400: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000c00: eb58 906d 6b66 732e 6661 7400 0208 2000  .X.mkfs.fat... .
+00000c10: 0200 0000 00f8 0000 3f00 2000 0000 0000  ........?. .....
+00000c20: c53f 1f00 d007 0000 0000 0000 0200 0000  .?..............
+00000c30: 0100 0600 0000 0000 0000 0000 0000 0000  ................
+00000c40: 8000 29cd ab34 1254 4553 5446 4154 3332  ..)..4.TESTFAT32
+00000c50: 2020 4641 5433 3220 2020 0e1f be77 7cac    FAT32   ...w|.
+00000c60: 22c0 740b 56b4 0ebb 0700 cd10 5eeb f032  ".t.V.......^..2
+00000c70: e4cd 16cd 19eb fe54 6869 7320 6973 206e  .......This is n
+00000c80: 6f74 2061 2062 6f6f 7461 626c 6520 6469  ot a bootable di
+00000c90: 736b 2e20 2050 6c65 6173 6520 696e 7365  sk.  Please inse
+00000ca0: 7274 2061 2062 6f6f 7461 626c 6520 666c  rt a bootable fl
+00000cb0: 6f70 7079 2061 6e64 0d0a 7072 6573 7320  oppy and..press 
+00000cc0: 616e 7920 6b65 7920 746f 2074 7279 2061  any key to try a
+00000cd0: 6761 696e 202e 2e2e 200d 0a00 0000 0000  gain ... .......
+00000ce0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000db0: 0000 0000 0000 0000 cdab 3412 0000 8000  ..........4.....
+00000dc0: 0100 0c1b c1f7 0000 0000 c53f 1f00 0000  ...........?....
+00000dd0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000de0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000df0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00000e00: 5252 6141 0000 0000 0000 0000 0000 0000  RRaA............
+00000e10: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00000fe0: 0000 0000 7272 4161 ffe5 0300 0200 0000  ....rrAa........
+00000ff0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.
+00001000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+00004000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+00004010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+000fe000: f8ff ff0f ffff ff0f f8ff ff0f 0000 0000  ................
+000fe010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+001f8000: 5445 5354 4641 5433 3220 2008 0000 5a4b  TESTFAT32  ...ZK
+001f8010: 6e46 6e46 0000 5a4b 6e46 0000 0000 0000  nFnF..ZKnF......
+001f8020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+*
+3e7ffff0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
index 50abbd5..df53c31 100755 (executable)
@@ -24,7 +24,7 @@
 
 
 run_fsck () {
-       "../src/fsck.fat" "$@"
+       $RUN "../src/fsck.fat" "$@"
 }
 
 
@@ -41,16 +41,22 @@ if [ "$XXD_FOUND" != "yes" ]; then
 fi
 
 
+if [ -f "$testname.args" ]; then
+       ARGS=$(cat "$testname.args")
+else
+       ARGS=
+fi
+
 echo "Test $testname"
 
 # make sure there aren't files remaining from earlier run
-rm -f "${testname}.img"
+rm -f "${testname}.img" "${testname}.refimg"
 
 xxd -r "${srcdir}/${testname}.fsck" "${testname}.img" || exit 99
 
 
 echo "First fsck run to check and fix error..."
-run_fsck -a "${testname}.img"
+run_fsck -a $ARGS "${testname}.img"
 success=$?
 if [ $success -eq 0 ]; then
        echo "*** Error was not detected by fsck."
@@ -62,9 +68,19 @@ elif [ $success -eq 1 ]; then
 
        if [ $success -ne 0 ]; then
                echo "*** Error was not fixed by fsck."
+       else
+               echo "Comparing..."
+               xxd -r "${srcdir}/${testname}.xxd" "${testname}.refimg" || exit 99
+               cmp "${testname}.img" "${testname}.refimg"
+               success=$?
+
+               if [ $success -eq 2 ]; then
+                       # cmp reported error
+                       exit 99
+               fi
        fi
 fi
 
 
-rm -f "${testname}.img"
+rm -f "${testname}.img" "${testname}.refimg"
 exit $success
diff --git a/tests/test-label b/tests/test-label
new file mode 100755 (executable)
index 0000000..a554089
--- /dev/null
@@ -0,0 +1,63 @@
+#!/bin/sh
+# Copyright (C) 2018  Pali Rohár <pali.rohar@gmail.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 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/>.
+#
+#
+# This script expects a testname.label file as its sole argument. It must
+# be a label of the corresponding hex dump file testname.xxd that can be
+# converted to a file system image with xxd.
+
+
+run_label () {
+       $RUN "../src/fatlabel" "$@"
+}
+
+
+if [ $# -ne 1 ]; then
+       echo "$0 called with wrong number of arguments"
+       exit 99
+fi
+testname=$(basename "$1" .label)
+
+
+if [ "$XXD_FOUND" != "yes" ]; then
+       echo "xxd not available, required by test"
+       exit 77  # report test skipped
+fi
+
+
+echo "Test $testname"
+
+# make sure there aren't files remaining from earlier run
+rm -f "${testname}.img" "${testname}.out"
+
+xxd -r "${srcdir}/${testname}.xxd" "${testname}.img" || exit 99
+run_label "${testname}.img" 1> "${testname}.out" 2> "${testname}.err" || exit 99
+
+
+echo "Comparing..."
+diff "${testname}.out" "${srcdir}/${testname}.label"
+success=$?
+
+
+echo "Error output:"
+cat "${testname}.err"
+if [ "$CHECK_ERRORS" = "1" ] && [ -s "${testname}.err" ]; then
+       success=2
+fi
+
+
+rm -f "${testname}.img" "${testname}.out" "${testname}.err"
+exit $success
index 0bedbec..fd79824 100755 (executable)
 
 
 run_mkfs () {
-       "../src/mkfs.fat" "$@"
+       $RUN "../src/mkfs.fat" "$@"
 }
 
 run_fsck () {
-       "../src/fsck.fat" "$@"
+       $RUN "../src/fsck.fat" "$@"
 }
 
 
@@ -63,11 +63,13 @@ fi
 cmp $limitarg "${testname}.out" "${testname}.refimg"
 success=$?
 
+echo
+echo "Testing fsck..."
+run_fsck -n "${testname}.out"
+success_fsck=$?
+
 if [ $success -eq 0 ]; then
-       echo
-       echo "Testing fsck..."
-       run_fsck -n "${testname}.out"
-       success=$?
+       success=$success_fsck
 fi
 
 rm -f "${testname}.out" "${testname}.refimg"