Use fmt -w WIDTH option instead of -WIDTH
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Thu, 20 Oct 2016 14:03:18 +0000 (23:03 +0900)
committerJens Axboe <axboe@fb.com>
Thu, 20 Oct 2016 14:10:10 +0000 (08:10 -0600)
Most systems support -WIDTH option which is an abbreviated form
of -w WIDTH or --width=WIDTH option, but some OS don't support
-WIDTH format.

As far as I've checked (on actual systems or online manpages),
Linux/FreeBSD/DragonFlyBSD/OpenBSD/Solaris/AIX/Cygwin support
-WIDTH format, but NetBSD doesn't support this (see below).
IRIX and HPUX may not support either according to online manpages.

-w WIDTH format is basically supported by all systems that have
fmt command, so this is probably better in terms of portability.

--
    CC crc/crc64.o
fmt: unknown option -- 1
Usage: fmt [-Cr] [-g <goal>] [-m|w <max>] [<files>..]
         fmt [-Cr] [<goal>] [<max>] [<files>]
    CC crc/md5.o
fmt: unknown option -- 1
Usage: fmt [-Cr] [-g <goal>] [-m|w <max>] [<files>..]
         fmt [-Cr] [<goal>] [<max>] [<files>]
...

Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Makefile

index 6b5548a83574f504e83f332792b09356b33e3b7a..b3a12ddf2d655e3136d4a5dcdaf600f256ae0be9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -315,7 +315,7 @@ override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
        @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d
        @mv -f $*.d $*.d.tmp
        @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
-       @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
+       @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
                sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
        @rm -f $*.d.tmp
 
@@ -354,7 +354,7 @@ init.o: init.c FIO-VERSION-FILE
        @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d
        @mv -f $*.d $*.d.tmp
        @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
-       @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
+       @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
                sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
        @rm -f $*.d.tmp