From 57c203fa603f351578ba486428af9f1e099c7ef1 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Fri, 14 Jan 2022 10:51:38 +0900 Subject: [PATCH] Imported Upstream version 4.0.18 --- NEWS | 12 + charsetConv.c | 30 +- config.c | 31 +- config.guess | 107 ++--- config.h.in | 9 + config.sub | 67 +++- configure | 979 +++++++++++++++++++++++++++++----------------- configure.in | 7 +- debian/changelog | 12 + fat.c | 9 +- file.c | 4 +- file_name.c | 4 +- filter.c | 2 +- floppyd.1 | 2 +- floppyd.c | 6 - floppyd_installtest.1 | 2 +- floppyd_io.c | 8 +- floppyd_io.h | 7 +- fsP.h | 2 +- init.c | 14 +- llong.h | 9 +- mainloop.c | 10 +- mattrib.1 | 2 +- mattrib.c | 8 +- mbadblocks.1 | 2 +- mbadblocks.c | 9 +- mcat.1 | 2 +- mcat.c | 6 +- mcd.1 | 2 +- mcd.c | 4 +- mclasserase.1 | 2 +- mclasserase.c | 4 +- mcopy.1 | 2 +- mcopy.c | 26 +- mdel.1 | 2 +- mdel.c | 2 +- mdeltree.1 | 2 +- mdir.1 | 2 +- mdir.c | 11 +- mdoctorfat.c | 6 +- mdu.1 | 2 +- mdu.c | 4 +- mformat.1 | 10 +- mformat.c | 154 +++++--- minfo.1 | 4 +- minfo.c | 32 +- mkmanifest.1 | 2 +- mlabel.1 | 2 +- mlabel.c | 55 ++- mmd.1 | 2 +- mmd.c | 2 +- mmount.1 | 2 +- mmove.1 | 2 +- mmove.c | 2 +- mpartition.1 | 2 +- mpartition.c | 2 +- mrd.1 | 2 +- mren.1 | 2 +- mshortname.1 | 2 +- mshortname.c | 2 +- mshowfat.1 | 2 +- mshowfat.c | 2 +- mtools.1 | 10 +- mtools.5 | 4 +- mtools.h | 18 +- mtools.info | 158 ++++---- mtools.spec | 14 +- mtools.texi | 12 +- mtools.tmpl.1 | 10 +- mtools.tmpl.5 | 4 +- mtoolstest.1 | 2 +- mtype.1 | 2 +- mzip.1 | 2 +- mzip.c | 2 +- patchlevel.c | 6 +- scsi.c | 26 +- signal.c | 74 ++++ sysincludes.h | 5 +- texinfo.tex | 1044 +++++++++++++++++++++++++++++++++++-------------- unixdir.c | 2 +- version.texi | 6 +- vfat.c | 5 +- 82 files changed, 2032 insertions(+), 1092 deletions(-) diff --git a/NEWS b/NEWS index b642468..5b7b371 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +v4_0_18 + Fix for names of iconv encodings on AIX + Fix mt_size_t on NetBSD + Fixed compilation on Mingw + Fixed doc (especially mformat) + Fix mformat'ing of FAT12 filesystems with huge cluster sizes + Minfo prints image file name in mformat command line if an image + file name was given + Always generate gzip-compressed RPMs, in order to remain + compatible with older distributions + Fixed buffer overflow with drive letter in mclasserase v4_0_17 mbadblocks now takes a list of bad blocks (either as sectors or as clusters) @@ -9,6 +20,7 @@ v4_0_17 Consider every directory entry after an ENDMARK (0x00) to be deleted After writing a new entry at end of a directory, be sure to also add an ENDMARK (0x00) + Deal with possibility of a NULL pointer being returned by localtime during timestamp conversion v4_0_16 diff --git a/charsetConv.c b/charsetConv.c index 2f56caa..0dc1b6d 100644 --- a/charsetConv.c +++ b/charsetConv.c @@ -34,9 +34,9 @@ struct doscp_t { iconv_t to; }; -static char *wcharCp=NULL; +static const char *wcharCp=NULL; -static char* wcharTries[] = { +static const char* wcharTries[] = { "WCHAR_T", "UTF-32BE", "UTF-32LE", "UTF-16BE", "UTF-16LE", @@ -46,17 +46,27 @@ static char* wcharTries[] = { "UCS-4", "UCS-2" }; -static wchar_t *testString = L"ab"; +static const char *asciiTries[] = { + "ASCII", "ASCII-GR", "ISO8859-1" +}; + +static const wchar_t *testString = L"ab"; -static int try(char *testCp) { +static int try(const char *testCp) { size_t res; char *inbuf = (char *)testString; size_t inbufLen = 2*sizeof(wchar_t); char outbuf[3]; char *outbufP = outbuf; size_t outbufLen = 2*sizeof(char); - iconv_t test = iconv_open("ASCII", testCp); - + iconv_t test; + int i; + + for(i=0; i < sizeof(asciiTries) / sizeof(asciiTries[0]); i++) { + test = iconv_open(asciiTries[i], testCp); + if(test != (iconv_t) -1) + break; + } if(test == (iconv_t) -1) goto fail0; res = iconv(test, @@ -75,8 +85,8 @@ static int try(char *testCp) { return 0; } -static const char *getWcharCp() { - int i; +static const char *getWcharCp(void) { + unsigned int i; if(wcharCp != NULL) return wcharCp; for(i=0; i< sizeof(wcharTries) / sizeof(wcharTries[0]); i++) { @@ -164,7 +174,7 @@ static int safe_iconv(iconv_t conv, const wchar_t *wchar, char *dest, size_t len, int *mangled) { int r; - int i; + unsigned int i; size_t in_len=len*sizeof(wchar_t); size_t out_len=len*4; char *dptr = dest; @@ -388,7 +398,7 @@ int native_to_wchar(const char *native, wchar_t *wchar, size_t len, const char *end, int *mangled) { mbstate_t ps; - int i; + unsigned int i; memset(&ps, 0, sizeof(ps)); for(i=0; i no offset */ + devices[cur_dev].name = strdup(img); + devices[cur_dev].offset = 0; + } else { + devices[cur_dev].name = strndup(img, ofsp - img); + devices[cur_dev].offset = str_to_offset(ofsp+2); + } + devices[cur_dev].fat_bits = 0; devices[cur_dev].tracks = 0; devices[cur_dev].heads = 0; devices[cur_dev].sectors = 0; - devices[cur_dev].offset = get_offset(name); if (strchr(devices[cur_dev].name, '|')) { char *pipechar = strchr(devices[cur_dev].name, '|'); *pipechar = 0; @@ -733,7 +728,7 @@ void read_config(void) mtools_fat_compatibility=1; } -void mtoolstest(int argc, char **argv, int type) +void mtoolstest(int argc, char **argv, int type UNUSEDP) { /* testing purposes only */ struct device *dev; diff --git a/config.guess b/config.guess index f32079a..e3a2116 100755 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. -timestamp='2008-01-23' +timestamp='2009-06-10' # 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 @@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -324,6 +324,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 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 ;; @@ -331,7 +334,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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 @@ -640,7 +656,7 @@ EOF # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -796,7 +812,7 @@ EOF x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -806,6 +822,9 @@ EOF [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -866,40 +885,17 @@ EOF m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:*) + mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef mips - #undef mipsel + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel + CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 + CPU=${UNAME_MACHINE} #else CPU= #endif @@ -931,10 +927,13 @@ EOF EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -982,17 +981,6 @@ EOF elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -1058,7 +1046,7 @@ EOF i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1102,8 +1090,11 @@ EOF 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 i386. - echo i386-pc-msdosdjgpp + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 @@ -1141,6 +1132,16 @@ EOF 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 ;; @@ -1153,7 +1154,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1216,6 +1217,9 @@ EOF 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 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1324,6 +1328,9 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/config.h.in b/config.h.in index 3280e58..330dabc 100644 --- a/config.h.in +++ b/config.h.in @@ -18,6 +18,9 @@ /* Define to 1 if you have the `basename' function. */ #undef HAVE_BASENAME +/* Define to 1 if the system has the type `caddr_t'. */ +#undef HAVE_CADDR_T + /* Define to 1 if you have the `fchdir' function. */ #undef HAVE_FCHDIR @@ -159,6 +162,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SGTTY_H +/* Define to 1 if you have the `sigaction' function. */ +#undef HAVE_SIGACTION + /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H @@ -324,6 +330,9 @@ /* Define to 1 if the `setpgrp' function takes no argument. */ #undef SETPGRP_VOID +/* The size of `size_t', as computed by sizeof. */ +#undef SIZEOF_SIZE_T + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS diff --git a/config.sub b/config.sub index 6759825..eb0389a 100755 --- a/config.sub +++ b/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. -timestamp='2008-01-16' +timestamp='2009-06-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -122,6 +122,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -152,6 +153,9 @@ case $os in os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -249,13 +253,16 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64vr | mips64vrel \ + | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ @@ -268,6 +275,7 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ | mt \ | msp430 \ | nios | nios2 \ @@ -277,7 +285,7 @@ case $basic_machine in | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | 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 \ @@ -286,7 +294,7 @@ case $basic_machine in | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -329,14 +337,17 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ + | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ @@ -358,20 +369,20 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | 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-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -439,6 +450,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -455,10 +470,18 @@ case $basic_machine in basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; c90) basic_machine=c90-cray os=-unicos ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -526,6 +549,10 @@ case $basic_machine in basic_machine=m88k-motorola os=-sysv3 ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp @@ -1128,6 +1155,10 @@ case $basic_machine in basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1166,7 +1197,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1236,10 +1267,11 @@ case $os in # 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* | -sunos | -sunos[34]*\ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1248,7 +1280,7 @@ case $os in | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ + | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1388,6 +1420,9 @@ case $os in -zvmoe) os=-zvmoe ;; + -dicos*) + os=-dicos + ;; -none) ;; *) @@ -1585,7 +1620,7 @@ case $basic_machine in -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) diff --git a/configure b/configure index 166b3a0..1810eff 100755 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65. +# Generated by GNU Autoconf 2.68. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -89,6 +89,7 @@ fi 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 @@ -214,11 +215,18 @@ IFS=$as_save_IFS # 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 export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + 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+"$@"} fi if test x$as_have_required = xno; then : @@ -316,7 +324,7 @@ $as_echo X"$as_dir" | 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" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -356,19 +364,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# 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. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + 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: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -530,7 +538,7 @@ test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# 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` @@ -753,8 +761,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -799,7 +808,7 @@ do 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" + 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 @@ -825,7 +834,7 @@ do 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" + 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 @@ -1029,7 +1038,7 @@ do 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" + 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 @@ -1045,7 +1054,7 @@ do 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" + 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 @@ -1075,8 +1084,8 @@ do | --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." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1084,7 +1093,7 @@ Try \`$0 --help' for more information." # 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'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1094,7 +1103,7 @@ Try \`$0 --help' for more information." $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} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1102,13 +1111,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + 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" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1131,7 +1140,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + 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' @@ -1145,8 +1154,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1161,9 +1170,9 @@ 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" + 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" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1202,11 +1211,11 @@ else 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" + 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" + 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 @@ -1246,7 +1255,7 @@ Configuration: --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 + -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 @@ -1398,9 +1407,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.65 +generated by GNU Autoconf 2.68 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1444,7 +1453,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1470,7 +1479,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1481,7 +1490,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1494,10 +1503,10 @@ fi ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1533,7 +1542,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +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; } @@ -1560,7 +1569,7 @@ $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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1569,7 +1578,7 @@ 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel @@ -1610,7 +1619,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1624,7 +1633,7 @@ 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 { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1642,7 +1651,7 @@ 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1687,11 +1696,243 @@ fi # 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + 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_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1755,69 +1996,15 @@ 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_type 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 $as_me, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -1927,11 +2114,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -1965,11 +2150,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -1982,11 +2165,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2000,11 +2181,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2059,7 +2238,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # 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 @@ -2074,7 +2258,11 @@ do { $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" + . "$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 @@ -2150,7 +2338,7 @@ if $ac_cache_corrupted; then $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 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2177,7 +2365,7 @@ if test -n "$ac_tool_prefix"; then 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 test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2217,7 +2405,7 @@ if test -z "$ac_cv_prog_CC"; then 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 test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2270,7 +2458,7 @@ if test -z "$CC"; then 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 test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2310,7 +2498,7 @@ if test -z "$CC"; then 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 test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2369,7 +2557,7 @@ if test -z "$CC"; then 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 test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2413,7 +2601,7 @@ do 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 test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2467,8 +2655,8 @@ 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; } +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 @@ -2582,9 +2770,8 @@ 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_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +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; } @@ -2626,8 +2813,8 @@ 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; } +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 @@ -2684,9 +2871,9 @@ $as_echo "$ac_try_echo"; } >&5 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. +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -2697,7 +2884,7 @@ 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 test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2737,8 +2924,8 @@ 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; } +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 @@ -2748,7 +2935,7 @@ 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 test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2785,7 +2972,7 @@ 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 test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -2863,7 +3050,7 @@ else 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 test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -2971,7 +3158,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -3001,7 +3188,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -3017,11 +3204,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -3060,7 +3247,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -3076,18 +3263,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +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; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -3099,7 +3286,7 @@ 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 test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -3148,7 +3335,7 @@ esac 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 + 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 @@ -3162,7 +3349,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -3214,7 +3401,7 @@ esac 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 + 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 @@ -3230,7 +3417,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } -if test "${ac_cv_prog_gcc_traditional+set}" = set; then : +if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" @@ -3271,16 +3458,22 @@ fi ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + 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 + 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, @@ -3309,7 +3502,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. { $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 test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3401,7 +3594,7 @@ fi set dummy install-info; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_INSTALL_INFO+set}" = set; then : +if ${ac_cv_path_INSTALL_INFO+:} false; then : $as_echo_n "(cached) " >&6 else case $INSTALL_INFO in @@ -3441,7 +3634,7 @@ fi { $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 test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3558,8 +3751,7 @@ 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 " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +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 @@ -3571,7 +3763,7 @@ 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" = x""yes; then : +if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= @@ -3593,7 +3785,7 @@ $as_echo "#define _MINIX 1" >>confdefs.h { $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 test "${ac_cv_safe_to_define___extensions__+set}" = set; then : +if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3632,27 +3824,27 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } # 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_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 test "${ac_cv_build+set}" = set; then : +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 + 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 + 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;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -3670,14 +3862,14 @@ 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 test "${ac_cv_host+set}" = set; then : +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 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -3685,7 +3877,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -3703,14 +3895,14 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then : +if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi @@ -3718,7 +3910,7 @@ fi $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) as_fn_error "invalid value of canonical target" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' @@ -3744,7 +3936,7 @@ test -n "$target_alias" && { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : +if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3824,7 +4016,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then : +if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no @@ -3933,7 +4125,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpwnam in -lsun" >&5 $as_echo_n "checking for getpwnam in -lsun... " >&6; } -if test "${ac_cv_lib_sun_getpwnam+set}" = set; then : +if ${ac_cv_lib_sun_getpwnam+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -3967,7 +4159,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sun_getpwnam" >&5 $as_echo "$ac_cv_lib_sun_getpwnam" >&6; } -if test "x$ac_cv_lib_sun_getpwnam" = x""yes; then : +if test "x$ac_cv_lib_sun_getpwnam" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSUN 1 _ACEOF @@ -3978,7 +4170,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cam_open_device in -lcam" >&5 $as_echo_n "checking for cam_open_device in -lcam... " >&6; } -if test "${ac_cv_lib_cam_cam_open_device+set}" = set; then : +if ${ac_cv_lib_cam_cam_open_device+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -4012,7 +4204,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cam_cam_open_device" >&5 $as_echo "$ac_cv_lib_cam_cam_open_device" >&6; } -if test "x$ac_cv_lib_cam_cam_open_device" = x""yes; then : +if test "x$ac_cv_lib_cam_cam_open_device" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCAM 1 _ACEOF @@ -4024,7 +4216,7 @@ fi { $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 test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4136,7 +4328,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then : +if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4183,8 +4375,7 @@ iconv.h wctype.h wchar.h locale.h linux/fs.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" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +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 @@ -4197,8 +4388,7 @@ for ac_header in termio.h sys/termio.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" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +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 @@ -4211,8 +4401,7 @@ for ac_header in termios.h sys/termios.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" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +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 @@ -4222,10 +4411,53 @@ fi done +ac_fn_c_check_type "$LINENO" "caddr_t" "ac_cv_type_caddr_t" "$ac_includes_default" +if test "x$ac_cv_type_caddr_t" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_CADDR_T 1 +_ACEOF + + +fi + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } +if ${ac_cv_sizeof_size_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_size_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (size_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_size_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t +_ACEOF + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether llseek declared in unistd.h" >&5 $as_echo_n "checking whether llseek declared in unistd.h... " >&6; } -if test "${mtools_cv_have_llseek_prototype+set}" = set; then : +if ${mtools_cv_have_llseek_prototype+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4257,7 +4489,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek64 declared in unistd.h" >&5 $as_echo_n "checking whether lseek64 declared in unistd.h... " >&6; } -if test "${mtools_cv_have_lseek64_prototype+set}" = set; then : +if ${mtools_cv_have_lseek64_prototype+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4294,7 +4526,7 @@ fi for ac_func in htons do : ac_fn_c_check_func "$LINENO" "htons" "ac_cv_func_htons" -if test "x$ac_cv_func_htons" = x""yes; then : +if test "x$ac_cv_func_htons" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_HTONS 1 _ACEOF @@ -4306,7 +4538,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : +if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4386,7 +4618,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then : +if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no @@ -4427,7 +4659,7 @@ _ACEOF esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = x""yes; then : +if test "x$ac_cv_type_size_t" = xyes; then : else @@ -4439,7 +4671,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if test "${ac_cv_header_time+set}" = set; then : +if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4474,7 +4706,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if test "${ac_cv_struct_tm+set}" = set; then : +if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4511,7 +4743,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } -if test "${ac_cv_type_signal+set}" = set; then : +if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4549,12 +4781,12 @@ seteuid setresuid setpgrp \ tcsetattr tcflush basename fchdir media_oldaliases llseek lseek64 \ snprintf stat64 setlocale \ wcsdup wcscasecmp wcsnlen putwc \ -getuserid getgroupid +getuserid getgroupid \ +sigaction do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -4562,46 +4794,6 @@ _ACEOF fi done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 -$as_echo_n "checking whether setpgrp takes no argument... " >&6; } -if test "${ac_cv_func_setpgrp_void+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - as_fn_error "cannot check setpgrp when cross compiling" "$LINENO" 5 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -/* If this system has a BSD-style setpgrp which takes arguments, - setpgrp(1, 1) will fail with ESRCH and return -1, in that case - exit successfully. */ - return setpgrp (1,1) != -1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_setpgrp_void=no -else - ac_cv_func_setpgrp_void=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 -$as_echo "$ac_cv_func_setpgrp_void" >&6; } -if test $ac_cv_func_setpgrp_void = yes; then - -$as_echo "#define SETPGRP_VOID 1" >>confdefs.h - -fi - @@ -4614,7 +4806,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5 $as_echo_n "checking for 64-bit off_t... " >&6; } -if test "${sfs_cv_off_t_64+set}" = set; then : +if ${sfs_cv_off_t_64+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4650,7 +4842,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports loff_t type" >&5 $as_echo_n "checking whether ${CC} supports loff_t type... " >&6; } -if test "${ice_cv_have_loff_t+set}" = set; then : +if ${ice_cv_have_loff_t+:} false; then : $as_echo_n "(cached) " >&6 else @@ -4685,7 +4877,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports offset_t type" >&5 $as_echo_n "checking whether ${CC} supports offset_t type... " >&6; } -if test "${ice_cv_have_offset_t+set}" = set; then : +if ${ice_cv_have_offset_t+:} false; then : $as_echo_n "(cached) " >&6 else @@ -4720,7 +4912,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports long long type" >&5 $as_echo_n "checking whether ${CC} supports long long type... " >&6; } -if test "${ice_cv_have_long_long+set}" = set; then : +if ${ice_cv_have_long_long+:} false; then : $as_echo_n "(cached) " >&6 else @@ -4758,8 +4950,7 @@ for ac_func in utimes utime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -4771,8 +4962,7 @@ for ac_func in tzset gettimeofday do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -4784,7 +4974,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking declaration of sys_errlist" >&5 $as_echo_n "checking declaration of sys_errlist... " >&6; } -if test "${cf_cv_dcl_sys_errlist+set}" = set; then : +if ${cf_cv_dcl_sys_errlist+:} false; then : $as_echo_n "(cached) " >&6 else @@ -4912,8 +5102,8 @@ if test "x$with_x" = xno; then have_x=disabled else case $x_includes,$x_libraries in #( - *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #( - *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. @@ -4930,7 +5120,7 @@ libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done @@ -5016,7 +5206,7 @@ else fi done fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then @@ -5190,7 +5380,7 @@ if ac_fn_c_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } -if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then : +if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5224,14 +5414,14 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then : +if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } -if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then : +if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5265,7 +5455,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then : +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi @@ -5284,14 +5474,14 @@ rm -f core conftest.err conftest.$ac_objext \ # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = x""yes; then : +if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then : +if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5325,14 +5515,14 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then : +if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } -if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then : +if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5366,7 +5556,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } -if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then : +if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi @@ -5381,14 +5571,14 @@ fi # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" -if test "x$ac_cv_func_connect" = x""yes; then : +if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } -if test "${ac_cv_lib_socket_connect+set}" = set; then : +if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5422,7 +5612,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } -if test "x$ac_cv_lib_socket_connect" = x""yes; then : +if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi @@ -5430,14 +5620,14 @@ fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" -if test "x$ac_cv_func_remove" = x""yes; then : +if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } -if test "${ac_cv_lib_posix_remove+set}" = set; then : +if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5471,7 +5661,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } -if test "x$ac_cv_lib_posix_remove" = x""yes; then : +if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi @@ -5479,14 +5669,14 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" -if test "x$ac_cv_func_shmat" = x""yes; then : +if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } -if test "${ac_cv_lib_ipc_shmat+set}" = set; then : +if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5520,7 +5710,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } -if test "x$ac_cv_lib_ipc_shmat" = x""yes; then : +if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi @@ -5538,7 +5728,7 @@ fi # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } -if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then : +if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5572,7 +5762,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } -if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then : +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi @@ -5591,7 +5781,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsocket" >&5 $as_echo_n "checking for main in -lsocket... " >&6; } -if test "${ac_cv_lib_socket_main+set}" = set; then : +if ${ac_cv_lib_socket_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5619,7 +5809,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_main" >&5 $as_echo "$ac_cv_lib_socket_main" >&6; } -if test "x$ac_cv_lib_socket_main" = x""yes; then : +if test "x$ac_cv_lib_socket_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF @@ -5630,7 +5820,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lbsd" >&5 $as_echo_n "checking for main in -lbsd... " >&6; } -if test "${ac_cv_lib_bsd_main+set}" = set; then : +if ${ac_cv_lib_bsd_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5658,7 +5848,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_main" >&5 $as_echo "$ac_cv_lib_bsd_main" >&6; } -if test "x$ac_cv_lib_bsd_main" = x""yes; then : +if test "x$ac_cv_lib_bsd_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBBSD 1 _ACEOF @@ -5671,8 +5861,7 @@ for ac_header in sys/socket.h arpa/inet.h netdb.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" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +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 @@ -5697,6 +5886,46 @@ if test X$use_floppyd = Xyes; then $as_echo "#define USE_FLOPPYD 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setpgrp takes no argument" >&5 +$as_echo_n "checking whether setpgrp takes no argument... " >&6; } +if ${ac_cv_func_setpgrp_void+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + as_fn_error $? "cannot check setpgrp when cross compiling" "$LINENO" 5 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +/* If this system has a BSD-style setpgrp which takes arguments, + setpgrp(1, 1) will fail with ESRCH and return -1, in that case + exit successfully. */ + return setpgrp (1,1) != -1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_setpgrp_void=no +else + ac_cv_func_setpgrp_void=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_setpgrp_void" >&5 +$as_echo "$ac_cv_func_setpgrp_void" >&6; } +if test $ac_cv_func_setpgrp_void = yes; then + +$as_echo "#define SETPGRP_VOID 1" >>confdefs.h + +fi + else FLOPPYD= BINFLOPPYD= @@ -5777,10 +6006,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + 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;} - cat confcache >$cache_file + 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;} @@ -5796,6 +6036,7 @@ DEFS=-DHAVE_CONFIG_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$//' @@ -5811,7 +6052,7 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -5912,6 +6153,7 @@ fi 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 @@ -5957,19 +6199,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# 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. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + 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: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -6165,7 +6407,7 @@ $as_echo X"$as_dir" | 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" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -6219,7 +6461,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -6281,10 +6523,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.65, +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -6300,11 +6542,16 @@ 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 @@ -6326,6 +6573,7 @@ do $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;; @@ -6338,7 +6586,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -6347,7 +6595,7 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -6399,7 +6647,7 @@ do "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -6421,9 +6669,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $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 } @@ -6431,12 +6680,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || 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. @@ -6453,12 +6703,12 @@ if test "x$ac_cr" = x; then fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -6467,18 +6717,18 @@ _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 '$'` + 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 + 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 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -6486,7 +6736,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -6534,7 +6784,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -6566,21 +6816,29 @@ 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 < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +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 $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# 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[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + 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 @@ -6592,7 +6850,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -6604,11 +6862,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -6693,7 +6951,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -6706,7 +6964,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -6725,7 +6983,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) 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 `:'. @@ -6734,7 +6992,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + 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'" @@ -6760,8 +7018,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -6891,23 +7149,24 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +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' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { 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 +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;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) 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 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -6916,21 +7175,21 @@ which seems to be undefined. Please make sure it is defined." >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; @@ -6945,7 +7204,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -6966,7 +7225,7 @@ if test "$no_create" != yes; then 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 $? + $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 diff --git a/configure.in b/configure.in index 643ec2e..b9f74b5 100644 --- a/configure.in +++ b/configure.in @@ -100,6 +100,8 @@ iconv.h wctype.h wchar.h locale.h linux/fs.h) AC_CHECK_HEADERS(termio.h sys/termio.h, [break]) AC_CHECK_HEADERS(termios.h sys/termios.h, [break]) +AC_CHECK_TYPES(caddr_t) +AC_CHECK_SIZEOF(size_t) dnl dnl Check to see if llseek() is declared in unistd.h. On some libc's @@ -155,8 +157,8 @@ seteuid setresuid setpgrp \ tcsetattr tcflush basename fchdir media_oldaliases llseek lseek64 \ snprintf stat64 setlocale \ wcsdup wcscasecmp wcsnlen putwc \ -getuserid getgroupid) -AC_FUNC_SETPGRP +getuserid getgroupid \ +sigaction) dnl dnl Check for 64-bit off_t @@ -375,6 +377,7 @@ if test X$use_floppyd = Xyes; then FLOPPYD="floppyd floppyd_installtest" BINFLOPPYD="\$(DESTDIR)\$(bindir)/floppyd \$(DESTDIR)\$(bindir)/floppyd_installtest" AC_DEFINE([USE_FLOPPYD],1,[Define when you want to include floppyd support]) + AC_FUNC_SETPGRP else FLOPPYD= BINFLOPPYD= diff --git a/debian/changelog b/debian/changelog index 3dfe28d..6a90040 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +mtools (4.0.18) stable; urgency=low + * Fix for names of iconv encodings on AIX + * Fix mt_size_t on NetBSD + * Fixed compilation on Mingw + * Fixed doc (especially mformat) + * Fix mformat'ing of FAT12 filesystems with huge cluster sizes + * Minfo prints image file name in mformat command line if an image + * file name was given + * Always generate gzip-compressed RPMs, in order to remain + * compatible with older distributions + * Fixed buffer overflow with drive letter in mclasserase + -- Alain Knaff Wed, 9 Jan 2013 00:21:20 +0200 mtools (4.0.17) stable; urgency=low * mbadblocks now takes a list of bad blocks (either as sectors diff --git a/fat.c b/fat.c index f6d732e..16e32ab 100644 --- a/fat.c +++ b/fat.c @@ -415,7 +415,6 @@ void fat_write(Fs_t *This) { unsigned int i, j, dups, bit, slot; int ret; - int fat_start; /*fprintf(stderr, "Fat write\n");*/ @@ -429,7 +428,6 @@ void fat_write(Fs_t *This) for(i=0; ifat_start + i*This->fat_len; for(slot=0;jfat_len;slot++) { if(!This->FatMap[slot].dirty) { j += SECT_PER_ENTRY; @@ -707,8 +705,7 @@ static int fat_32_read(Fs_t *This, union bootsector *boot, static int old_fat_read(Fs_t *This, union bootsector *boot, - int config_fat_bits, - size_t tot_sectors, int nodups) + size_t tot_sectors, int nodups) { This->writeAllFats = 1; This->primaryFat = 0; @@ -737,7 +734,7 @@ static int old_fat_read(Fs_t *This, union bootsector *boot, * Read the first sector of the FAT table into memory and initialize * structures. */ -int fat_read(Fs_t *This, union bootsector *boot, int fat_bits, +int fat_read(Fs_t *This, union bootsector *boot, size_t tot_sectors, int nodups) { This->fat_error = 0; @@ -748,7 +745,7 @@ int fat_read(Fs_t *This, union bootsector *boot, int fat_bits, This->lastFatSectorData = 0; if(This->fat_len) - return old_fat_read(This, boot, fat_bits, tot_sectors, nodups); + return old_fat_read(This, boot, tot_sectors, nodups); else return fat_32_read(This, boot, tot_sectors); } diff --git a/file.c b/file.c index bd1c2f0..22ba233 100644 --- a/file.c +++ b/file.c @@ -353,8 +353,8 @@ static int normal_map(File_t *This, off_t where, size_t *len, int mode, } -static int root_map(File_t *This, off_t where, size_t *len, int mode, - mt_off_t *res) +static int root_map(File_t *This, off_t where, size_t *len, int mode UNUSEDP, + mt_off_t *res) { Fs_t *Fs = This->Fs; diff --git a/file_name.c b/file_name.c index ae6239e..963a137 100644 --- a/file_name.c +++ b/file_name.c @@ -98,8 +98,8 @@ static void TranslateToDos(doscp_t *toDos, const char *in, char *out, int count, * Will truncate file and extension names, will substitute * the character '~' for any illegal character(s) in the name. */ -void dos_name(doscp_t *toDos, const char *name, int verbose, int *mangled, - dos_name_t *dn) +void dos_name(doscp_t *toDos, const char *name, int verbose UNUSEDP, + int *mangled, dos_name_t *dn) { char *s, *ext; register int i; diff --git a/filter.c b/filter.c index 6a78217..11d8158 100644 --- a/filter.c +++ b/filter.c @@ -153,7 +153,7 @@ static Class_t FilterClass = { 0 }; -Stream_t *open_filter(Stream_t *Next, int convertCharset) +Stream_t *open_filter(Stream_t *Next, int convertCharset UNUSEDP) { Filter_t *This; diff --git a/floppyd.1 b/floppyd.1 index 69ba693..5c5edfb 100644 --- a/floppyd.1 +++ b/floppyd.1 @@ -1,5 +1,5 @@ '\" t -.TH floppyd 1 "29Jun11" mtools-4.0.17 +.TH floppyd 1 "09Jan13" mtools-4.0.18 .SH Name floppyd - floppy daemon for remote access to floppy drive '\" t diff --git a/floppyd.c b/floppyd.c index 4507795..92ca38c 100644 --- a/floppyd.c +++ b/floppyd.c @@ -824,9 +824,7 @@ int main (int argc, char** argv) gid_t run_gid = 65535; char* username = strdup("nobody"); int sock; - int port_is_supplied = 0; - char *server_hostname=NULL; char **device_name = NULL; const char *floppy0 = "/dev/fd0"; int n_dev; @@ -846,7 +844,6 @@ int main (int argc, char** argv) break; case 's': run_as_server = 1; - port_is_supplied = 1; bind_port = getportnum(optarg); break; @@ -859,7 +856,6 @@ int main (int argc, char** argv) case 'b': run_as_server = 1; bind_ip = getipaddress(optarg); - server_hostname=optarg; break; case 'x': dispName = strdup(optarg); @@ -903,9 +899,7 @@ int main (int argc, char** argv) /* try to find out port that we are connected to */ if(getsockname(0, (struct sockaddr*) &addr, &len) >= 0 && len == sizeof(addr)) { - port_is_supplied = 1; bind_port = ntohs(addr.sin_port); - server_hostname = strdup(inet_ntoa(addr.sin_addr)); } } diff --git a/floppyd_installtest.1 b/floppyd_installtest.1 index 7e71b3d..80dac2c 100644 --- a/floppyd_installtest.1 +++ b/floppyd_installtest.1 @@ -1,5 +1,5 @@ '\" t -.TH floppyd_installtest 1 "29Jun11" mtools-4.0.17 +.TH floppyd_installtest 1 "09Jan13" mtools-4.0.18 .SH Name floppyd_installtest - tests whether floppyd is installed and running '\" t diff --git a/floppyd_io.c b/floppyd_io.c index e670ff7..d8e0fdb 100644 --- a/floppyd_io.c +++ b/floppyd_io.c @@ -398,8 +398,8 @@ static int floppyd_free(Stream_t *Stream) } static int floppyd_geom(Stream_t *Stream, struct device *dev, - struct device *orig_dev, - int media, union bootsector *boot) + struct device *orig_dev UNUSEDP, + int media, union bootsector *boot) { size_t tot_sectors; int sect_per_track; @@ -579,9 +579,9 @@ static int connect_to_server(IPaddr_t ip, short port) static int ConnectToFloppyd(RemoteFile_t *floppyd, const char* name, char *errmsg); -Stream_t *FloppydOpen(struct device *dev, struct device *dev2, +Stream_t *FloppydOpen(struct device *dev, char *name, int mode, char *errmsg, - int mode2, int locked, mt_size_t *maxSize) + mt_size_t *maxSize) { RemoteFile_t *This; diff --git a/floppyd_io.h b/floppyd_io.h index 099f11b..d767ea8 100644 --- a/floppyd_io.h +++ b/floppyd_io.h @@ -24,10 +24,9 @@ #include "stream.h" /*extern int ConnectToFloppyd(const char* name, Class_t** ioclass);*/ -Stream_t *FloppydOpen(struct device *dev, struct device *dev2, - char *name, int mode, char *errmsg, - int mode2, int locked, - mt_size_t *maxSize); +Stream_t *FloppydOpen(struct device *dev, + char *name, int mode, char *errmsg, + mt_size_t *maxSize); #define FLOPPYD_DEFAULT_PORT 5703 diff --git a/fsP.h b/fsP.h index 98f73bb..3fb88e4 100644 --- a/fsP.h +++ b/fsP.h @@ -91,7 +91,7 @@ void fatDeallocate(Fs_t *This, unsigned int pos); void fatAllocate(Fs_t *This, unsigned int pos, unsigned int value); void fatEncode(Fs_t *This, unsigned int pos, unsigned int value); -int fat_read(Fs_t *This, union bootsector *boot, int fat_bits, +int fat_read(Fs_t *This, union bootsector *boot, size_t tot_sectors, int nodups); void fat_write(Fs_t *This); int zero_fat(Fs_t *Fs, int media_descriptor); diff --git a/init.c b/init.c index 5e00109..c9152e0 100644 --- a/init.c +++ b/init.c @@ -142,8 +142,8 @@ Stream_t *find_device(char drive, int mode, struct device *out_dev, if(out_dev->misc_flags & FLOPPYD_FLAG) { Stream = 0; #ifdef USE_FLOPPYD - Stream = FloppydOpen(out_dev, dev, name, mode, - errmsg, 0, 1, maxSize); + Stream = FloppydOpen(out_dev, name, mode, + errmsg, maxSize); #endif } else { @@ -234,7 +234,6 @@ Stream_t *fs_init(char drive, int mode, int *isRop) { int blocksize; int media,i; - int nhs; int disk_size = 0; /* In case we don't happen to set this below */ size_t tot_sectors; char name[EXPAND_BUF]; @@ -298,7 +297,6 @@ Stream_t *fs_init(char drive, int mode, int *isRop) This->sectorShift = 9; This->sectorMask = 511; This->fat_bits = 12; - nhs = 0; } else { struct label_blk_t *labelBlock; /* @@ -306,12 +304,8 @@ Stream_t *fs_init(char drive, int mode, int *isRop) * (which is in clusters) */ tot_sectors = WORD_S(psect); - if(!tot_sectors) { + if(!tot_sectors) tot_sectors = DWORD_S(bigsect); - nhs = DWORD_S(nhs); - } else - nhs = WORD_S(nhs); - This->cluster_size = boot.boot.clsiz; This->fat_start = WORD_S(nrsvsect); @@ -393,7 +387,7 @@ Stream_t *fs_init(char drive, int mode, int *isRop) } /* read the FAT sectors */ - if(fat_read(This, &boot, dev.fat_bits, tot_sectors, dev.use_2m&0x7f)){ + if(fat_read(This, &boot, tot_sectors, dev.use_2m&0x7f)){ This->num_fat = 1; FREE(&This->Next); Free(This->Next); diff --git a/llong.h b/llong.h index 7ae1522..8c01918 100644 --- a/llong.h +++ b/llong.h @@ -24,8 +24,13 @@ #ifdef HAVE_OFF_T_64 /* if off_t is already 64 bits, be happy, and don't worry about the * loff_t and llseek stuff */ -#define MT_OFF_T off_t -#define MT_SIZE_T size_t +# define MT_OFF_T off_t +# if SIZEOF_SIZE_T == 4 +/* Some systems (NetBSD) apparently have 64 bit off_t, but 32 bit size_t ... */ +# define MT_SIZE_T off_t +# else +# define MT_SIZE_T size_t +# endif #endif #ifndef MT_OFF_T diff --git a/mainloop.c b/mainloop.c index 4218edd..f5f8349 100644 --- a/mainloop.c +++ b/mainloop.c @@ -86,15 +86,17 @@ static const char *fix_mcwd(char *ans) } int unix_dir_loop(Stream_t *Stream, MainParam_t *mp); -int unix_loop(Stream_t *Stream, MainParam_t *mp, char *arg, +int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, char *arg, int follow_dir_link); -static int _unix_loop(Stream_t *Dir, MainParam_t *mp, const char *filename) +static int _unix_loop(Stream_t *Dir, MainParam_t *mp, + const char *filename UNUSEDP) { return unix_dir_loop(Dir, mp); } -int unix_loop(Stream_t *Stream, MainParam_t *mp, char *arg, int follow_dir_link) +int unix_loop(UNUSED(Stream_t *Stream), MainParam_t *mp, + char *arg, int follow_dir_link) { int ret; int isdir; @@ -145,7 +147,7 @@ int unix_loop(Stream_t *Stream, MainParam_t *mp, char *arg, int follow_dir_link) #endif if(! (mp->lookupflags & ACCEPT_DIR)) return 0; - mp->File = OpenDir(Stream, arg); + mp->File = OpenDir(arg); } } diff --git a/mattrib.1 b/mattrib.1 index 23c537b..85acb64 100644 --- a/mattrib.1 +++ b/mattrib.1 @@ -1,5 +1,5 @@ '\" t -.TH mattrib 1 "29Jun11" mtools-4.0.17 +.TH mattrib 1 "09Jan13" mtools-4.0.18 .SH Name mattrib - change MSDOS file attribute flags '\" t diff --git a/mattrib.c b/mattrib.c index dd6ca20..89bdc94 100644 --- a/mattrib.c +++ b/mattrib.c @@ -44,7 +44,7 @@ static int attrib_file(direntry_t *entry, MainParam_t *mp) return GOT_ONE; } -static int replay_attrib(direntry_t *entry, MainParam_t *mp) +static int replay_attrib(direntry_t *entry, MainParam_t *mp UNUSEDP) { if ( (IS_ARCHIVE(entry) && IS_DIR(entry)) || (!IS_ARCHIVE(entry) && !IS_DIR(entry)) || @@ -76,7 +76,7 @@ static int replay_attrib(direntry_t *entry, MainParam_t *mp) -static int view_attrib(direntry_t *entry, MainParam_t *mp) +static int view_attrib(direntry_t *entry, MainParam_t *mp UNUSEDP) { printf(" "); if(IS_ARCHIVE(entry)) @@ -160,7 +160,7 @@ static int letterToCode(int letter) } -void mattrib(int argc, char **argv, int type) +void mattrib(int argc, char **argv, int type UNUSEDP) { Arg_t arg; int view; @@ -190,7 +190,7 @@ void mattrib(int argc, char **argv, int type) arg.remove &= ~letterToCode(c); break; case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'p': replay = 1; diff --git a/mbadblocks.1 b/mbadblocks.1 index 39a841c..3e66662 100644 --- a/mbadblocks.1 +++ b/mbadblocks.1 @@ -1,5 +1,5 @@ '\" t -.TH mbadblocks 1 "29Jun11" mtools-4.0.17 +.TH mbadblocks 1 "09Jan13" mtools-4.0.18 .SH Name mbadblocks - tests a floppy disk, and marks the bad blocks in the FAT '\" t diff --git a/mbadblocks.c b/mbadblocks.c index 2d002c3..df5605f 100644 --- a/mbadblocks.c +++ b/mbadblocks.c @@ -72,7 +72,7 @@ static void progress(unsigned int i, unsigned int total) { static int scan(Fs_t *Fs, Stream_t *dev, long cluster, unsigned int badClus, - char *buffer, int write) { + char *buffer, int doWrite) { off_t start; off_t ret; off_t pos; @@ -83,7 +83,7 @@ static int scan(Fs_t *Fs, Stream_t *dev, return 0; start = (cluster - 2) * Fs->cluster_size + Fs->clus_start; pos = sectorsToBytes((Stream_t*)Fs, start); - if(write) { + if(doWrite) { ret = force_write(dev, buffer, pos, in_len); if(ret < in_len ) bad = 1; @@ -109,7 +109,7 @@ static int scan(Fs_t *Fs, Stream_t *dev, return 0; } -void mbadblocks(int argc, char **argv, int type) +void mbadblocks(int argc, char **argv, int type UNUSEDP) { unsigned int i; unsigned int startSector=2; @@ -127,7 +127,7 @@ void mbadblocks(int argc, char **argv, int type) while ((c = getopt(argc, argv, "i:s:cwS:E:")) != EOF) { switch(c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'c': checkListTwice(filename); @@ -176,7 +176,6 @@ void mbadblocks(int argc, char **argv, int type) goto exit_0; } if(writeMode) { - int i; pat_buf=malloc(in_len * N_PATTERN); if(!pat_buf) { printOom(); diff --git a/mcat.1 b/mcat.1 index 244aca2..74a9f02 100644 --- a/mcat.1 +++ b/mcat.1 @@ -1,5 +1,5 @@ '\" t -.TH mcat 1 "29Jun11" mtools-4.0.17 +.TH mcat 1 "09Jan13" mtools-4.0.18 .SH Name mcat - dump raw disk image '\" t diff --git a/mcat.c b/mcat.c index 6ea15ef..8899529 100644 --- a/mcat.c +++ b/mcat.c @@ -52,7 +52,7 @@ static size_t bufLen(size_t blocksize, mt_size_t totalSize, mt_off_t address) return blocksize; } -void mcat(int argc, char **argv, int type) +void mcat(int argc, char **argv, int type UNUSEDP) { struct device *dev; struct device out_dev; @@ -115,8 +115,8 @@ void mcat(int argc, char **argv, int type) #ifdef USE_FLOPPYD if(!Stream) - Stream = FloppydOpen(&out_dev, dev, name, - mode, errmsg, 0, 1, NULL); + Stream = FloppydOpen(&out_dev, name, + mode, errmsg, NULL); #endif diff --git a/mcd.1 b/mcd.1 index 81f45a9..6f7b935 100644 --- a/mcd.1 +++ b/mcd.1 @@ -1,5 +1,5 @@ '\" t -.TH mcd 1 "29Jun11" mtools-4.0.17 +.TH mcd 1 "09Jan13" mtools-4.0.18 .SH Name mcd - change MSDOS directory '\" t diff --git a/mcd.c b/mcd.c index 21f5e44..689fcef 100644 --- a/mcd.c +++ b/mcd.c @@ -24,7 +24,7 @@ #include "mtools.h" -static int mcd_callback(direntry_t *entry, MainParam_t *mp) +static int mcd_callback(direntry_t *entry, MainParam_t *mp UNUSEDP) { FILE *fp; @@ -40,7 +40,7 @@ static int mcd_callback(direntry_t *entry, MainParam_t *mp) } -void mcd(int argc, char **argv, int type) +void mcd(int argc, char **argv, int type UNUSEDP) { struct MainParam_t mp; diff --git a/mclasserase.1 b/mclasserase.1 index d6dc5be..19dc9af 100644 --- a/mclasserase.1 +++ b/mclasserase.1 @@ -1,5 +1,5 @@ '\" t -.TH mclasserase 1 "29Jun11" mtools-4.0.17 +.TH mclasserase 1 "09Jan13" mtools-4.0.18 .SH Name mclasserase - erase memory cards '\" t diff --git a/mclasserase.c b/mclasserase.c index 1cbe023..fb610eb 100644 --- a/mclasserase.c +++ b/mclasserase.c @@ -90,7 +90,7 @@ static void do_mclasserase(char drive,int debug) char cCardType[12]; - char drivel[2]; /* Stores the drive letter */ + char drivel[3]; /* Stores the drive letter */ int i = 0; @@ -276,7 +276,7 @@ static void do_mclasserase(char drive,int debug) * * */ -void mclasserase(int argc, char **argv, int type) +void mclasserase(int argc, char **argv, int type UNUSEDP) { /* declaration of all variables */ int c; diff --git a/mcopy.1 b/mcopy.1 index 227ec47..57347bc 100644 --- a/mcopy.1 +++ b/mcopy.1 @@ -1,5 +1,5 @@ '\" t -.TH mcopy 1 "29Jun11" mtools-4.0.17 +.TH mcopy 1 "09Jan13" mtools-4.0.18 .SH Name mcopy - copy MSDOS files to/from Unix '\" t diff --git a/mcopy.c b/mcopy.c index 0074489..3b4d4cf 100644 --- a/mcopy.c +++ b/mcopy.c @@ -78,16 +78,15 @@ typedef struct Arg_t { int noClobber; } Arg_t; -static int _unix_write(direntry_t *entry, MainParam_t *mp, int needfilter, - const char *unixFile); +static int _unix_write(MainParam_t *mp, int needfilter, const char *unixFile); /* Write the Unix file */ -static int unix_write(direntry_t *entry, MainParam_t *mp, int needfilter) +static int unix_write(MainParam_t *mp, int needfilter) { Arg_t *arg=(Arg_t *) mp->arg; if(arg->type) - return _unix_write(entry, mp, needfilter, "-"); + return _unix_write(mp, needfilter, "-"); else { char *unixFile = mpBuildUnixFilename(mp); int ret; @@ -95,7 +94,7 @@ static int unix_write(direntry_t *entry, MainParam_t *mp, int needfilter) printOom(); return ERROR_ONE; } - ret = _unix_write(entry, mp, needfilter, unixFile); + ret = _unix_write(mp, needfilter, unixFile); free(unixFile); return ret; } @@ -103,8 +102,7 @@ static int unix_write(direntry_t *entry, MainParam_t *mp, int needfilter) /* Write the Unix file */ -static int _unix_write(direntry_t *entry, MainParam_t *mp, int needfilter, - const char *unixFile) +static int _unix_write(MainParam_t *mp, int needfilter, const char *unixFile) { Arg_t *arg=(Arg_t *) mp->arg; time_t mtime; @@ -265,15 +263,15 @@ static int unix_copydir(direntry_t *entry, MainParam_t *mp) } } -static int dos_to_unix(direntry_t *entry, MainParam_t *mp) +static int dos_to_unix(direntry_t *entry UNUSEDP, MainParam_t *mp) { - return unix_write(entry, mp, 1); + return unix_write(mp, 1); } static int unix_to_unix(MainParam_t *mp) { - return unix_write(0, mp, 0); + return unix_write(mp, 0); } @@ -507,8 +505,7 @@ static void usage(int ret) void mcopy(int argc, char **argv, int mtype) { Arg_t arg; - int c, ret, fastquit; - int todir; + int c, fastquit; /* get command line options */ @@ -516,7 +513,6 @@ void mcopy(int argc, char **argv, int mtype) init_clash_handling(& arg.ch); /* get command line options */ - todir = 0; arg.recursive = 0; arg.preserveTime = 0; arg.preserveAttributes = 0; @@ -531,7 +527,7 @@ void mcopy(int argc, char **argv, int mtype) while ((c = getopt(argc, argv, "i:abB/sptTnmvQD:oh")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 's': case '/': @@ -613,7 +609,7 @@ void mcopy(int argc, char **argv, int mtype) target = argv[argc]; } - ret = target_lookup(&arg.mp, target); + target_lookup(&arg.mp, target); if(!arg.mp.targetDir && !arg.mp.unixTarget) { fprintf(stderr,"Bad target %s\n", target); exit(1); diff --git a/mdel.1 b/mdel.1 index 998e305..10fec95 100644 --- a/mdel.1 +++ b/mdel.1 @@ -1,5 +1,5 @@ '\" t -.TH mdel 1 "29Jun11" mtools-4.0.17 +.TH mdel 1 "09Jan13" mtools-4.0.18 .SH Name mdel - delete an MSDOS file '\" t diff --git a/mdel.c b/mdel.c index e59a2cd..0b8a4bb 100644 --- a/mdel.c +++ b/mdel.c @@ -161,7 +161,7 @@ void mdel(int argc, char **argv, int deltype) while ((c = getopt(argc, argv, "i:vh")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'v': arg.verbose = 1; diff --git a/mdeltree.1 b/mdeltree.1 index a3beebd..a436484 100644 --- a/mdeltree.1 +++ b/mdeltree.1 @@ -1,5 +1,5 @@ '\" t -.TH mdeltree 1 "29Jun11" mtools-4.0.17 +.TH mdeltree 1 "09Jan13" mtools-4.0.18 .SH Name mdeltree - recursively delete an MSDOS directory and its contents '\" t diff --git a/mdir.1 b/mdir.1 index fb69504..acdd9dd 100644 --- a/mdir.1 +++ b/mdir.1 @@ -1,5 +1,5 @@ '\" t -.TH mdir 1 "29Jun11" mtools-4.0.17 +.TH mdir 1 "09Jan13" mtools-4.0.18 .SH Name mdir - display an MSDOS directory '\" t diff --git a/mdir.c b/mdir.c index 3573024..549e0e9 100644 --- a/mdir.c +++ b/mdir.c @@ -354,7 +354,7 @@ static int enterDirectory(Stream_t *Dir) return 0; } -static int list_file(direntry_t *entry, MainParam_t *mp) +static int list_file(direntry_t *entry, MainParam_t *mp UNUSEDP) { unsigned long size; int i; @@ -480,7 +480,8 @@ static int list_non_recurs_directory(direntry_t *entry, MainParam_t *mp) } -static int list_recurs_directory(direntry_t *entry, MainParam_t *mp) +static int list_recurs_directory(direntry_t *entry UNUSEDP, + MainParam_t *mp UNUSEDP) { MainParam_t subMp; int ret; @@ -530,11 +531,10 @@ static void usage(int ret) } -void mdir(int argc, char **argv, int type) +void mdir(int argc, char **argv, int type UNUSEDP) { int ret; MainParam_t mp; - int faked; int c; const char *fakedArgv[] = { "." }; @@ -547,7 +547,7 @@ void mdir(int argc, char **argv, int type) while ((c = getopt(argc, argv, "i:waXbfds/h")) != EOF) { switch(c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'w': wide = 1; @@ -583,7 +583,6 @@ void mdir(int argc, char **argv, int type) } /* fake an argument */ - faked = 0; if (optind == argc) { argv = (char **)fakedArgv; argc = 1; diff --git a/mdoctorfat.c b/mdoctorfat.c index 7f5c5f1..668fc19 100644 --- a/mdoctorfat.c +++ b/mdoctorfat.c @@ -60,7 +60,7 @@ static int dos_doctorfat(direntry_t *entry, MainParam_t *mp) return GOT_ONE; } -static int unix_doctorfat(MainParam_t *mp) +static int unix_doctorfat(MainParam_t *mp UNUSEDP) { fprintf(stderr,"File does not reside on a Dos fs\n"); return ERROR_ONE; @@ -76,7 +76,7 @@ static void usage(int ret) exit(ret); } -void mdoctorfat(int argc, char **argv, int mtype) +void mdoctorfat(int argc, char **argv, int mtype UNUSEDP) { Arg_t arg; int c, ret; @@ -100,7 +100,7 @@ void mdoctorfat(int argc, char **argv, int mtype) while ((c = getopt(argc, argv, "i:bo:s:h")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'b': arg.markbad = 1; diff --git a/mdu.1 b/mdu.1 index a2dd806..7ead711 100644 --- a/mdu.1 +++ b/mdu.1 @@ -1,5 +1,5 @@ '\" t -.TH mdu 1 "29Jun11" mtools-4.0.17 +.TH mdu 1 "09Jan13" mtools-4.0.18 .SH Name mdu - display the amount of space occupied by an MSDOS directory '\" t diff --git a/mdu.c b/mdu.c index 87ddeaf..1073271 100644 --- a/mdu.c +++ b/mdu.c @@ -93,7 +93,7 @@ static int dir_mdu(direntry_t *entry, MainParam_t *mp) return ret; } -void mdu(int argc, char **argv, int type) +void mdu(int argc, char **argv, int type UNUSEDP) { Arg_t arg; int c; @@ -106,7 +106,7 @@ void mdu(int argc, char **argv, int type) while ((c = getopt(argc, argv, "i:ash")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'a': arg.all = 1; diff --git a/mformat.1 b/mformat.1 index 3af45ff..fcd47a5 100644 --- a/mformat.1 +++ b/mformat.1 @@ -1,5 +1,5 @@ '\" t -.TH mformat 1 "29Jun11" mtools-4.0.17 +.TH mformat 1 "09Jan13" mtools-4.0.18 .SH Name mformat - add an MSDOS filesystem to a low-level formatted floppy disk '\" t @@ -28,9 +28,7 @@ low-level formatted diskette. Its syntax is: \&\fR\&\f(CWmformat\fR [\fR\&\f(CW-t\fR \fIcylinders\fR|\fR\&\f(CW-T\fR \fItot_sectors\fR] [\fR\&\f(CW-h\fR \fIheads\fR] [\fR\&\f(CW-s\fR \fIsectors\fR] [\fR\&\f(CW-f\fR \fIsize\fR] [\fR\&\f(CW-1\fR] [\fR\&\f(CW-4\fR] [\fR\&\f(CW-8\fR] [\fR\&\f(CW-v\fR \fIvolume_label\fR] - [\fR\&\f(CW-F\fR] [\fR\&\f(CW-S\fR \fIsizecode\fR] [\fR\&\f(CW-X\fR] - [\fR\&\f(CW-2\fR \fIsectors_on_track_0\fR] [\fR\&\f(CW-3\fR] - [\fR\&\f(CW-0\fR \fIrate_on_track_0\fR] [\fR\&\f(CW-A\fR \fIrate_on_other_tracks\fR] + [\fR\&\f(CW-F\fR] [\fR\&\f(CW-S\fR \fIsizecode\fR] [\fR\&\f(CW-M\fR \fIsoftware_sector_size\fR] [\fR\&\f(CW-N\fR \fIserial_number\fR] [\fR\&\f(CW-a\fR] [\fR\&\f(CW-C\fR] [\fR\&\f(CW-H\fR \fIhidden_sectors\fR] [\fR\&\f(CW-I\fR \fIfsVersion\fR] @@ -38,6 +36,10 @@ low-level formatted diskette. Its syntax is: [\fR\&\f(CW-B\fR \fIboot_sector\fR] [\fR\&\f(CW-k\fR] [\fR\&\f(CW-m\fR \fImedia_descriptor\fR] [\fR\&\f(CW-K\fR \fIbackup_boot\fR] + [\fR\&\f(CW-c\fR \fIclusters_per_sector\fR] + [\fR\&\f(CW-d\fR \fIfat_copies\fR] + [\fR\&\f(CW-X\fR] [\fR\&\f(CW-2\fR \fIsectors_on_track_0\fR] [\fR\&\f(CW-3\fR] + [\fR\&\f(CW-0\fR \fIrate_on_track_0\fR] [\fR\&\f(CW-A\fR \fIrate_on_other_tracks\fR] \fIdrive:\fR .fi .ft R diff --git a/mformat.c b/mformat.c index d6aa167..89b27a3 100644 --- a/mformat.c +++ b/mformat.c @@ -103,7 +103,7 @@ static int init_geometry_boot(union bootsector *boot, struct device *dev, boot->bytes[i++] = j; set_word(boot->boot.ext.old.InfpX, i); - + boot->bytes[i++] = 64; boot->bytes[i++] = 3; nb_renum = i++; @@ -130,12 +130,12 @@ static int init_geometry_boot(union bootsector *boot, struct device *dev, boot->bytes[i++] = size2; sector2 -= 1 << (size2 - 2 ); } - + set_word(boot->boot.ext.old.BootP,i); bootOffset = i; - /* checksum */ - for (sum=0, j=64; jbytes[j];/* checksum */ boot->boot.ext.old.CheckSum=-sum; return bootOffset; @@ -155,7 +155,7 @@ static int init_geometry_boot(union bootsector *boot, struct device *dev, } -static int comp_fat_bits(Fs_t *Fs, int estimate, +static int comp_fat_bits(Fs_t *Fs, int estimate, unsigned long tot_sectors, int fat32) { int needed_fat_bits; @@ -194,11 +194,12 @@ static int comp_fat_bits(Fs_t *Fs, int estimate, Fs->num_fat, 1); if(tot_sectors < min_fat16_size) return 12; - else if(tot_sectors >= 2* min_fat16_size) - return 16; /* heuristics */ - } + else if(Fs->cluster_size == 0 && + tot_sectors >= 2* min_fat16_size) + return 16; /* heuristics */ + } - return estimate; + return estimate; } @@ -206,11 +207,11 @@ static int comp_fat_bits(Fs_t *Fs, int estimate, * According to Microsoft "Hardware White Paper", "Microsoft * Extensible Formware Initiative", "FAT32 File System Specification", * Version 1.03, December 6, 2000: - * If (CountofClusters < 4085) { - * // Volume is FAT12 - * } else if (CountofClusters < 65525) { + * If (CountofClusters < 4085) { + * // Volume is FAT12 + * } else if (CountofClusters < 65525) { * // Volume is FAT16 - * } else { + * } else { * //Volume is FAT32 * } * @@ -223,7 +224,7 @@ static int comp_fat_bits(Fs_t *Fs, int estimate, * Not sure what the other Microsoft OS'es do though... */ static void calc_fat_bits2(Fs_t *Fs, unsigned long tot_sectors, int fat_bits, - int may_change_cluster_size, + int may_change_cluster_size, int may_change_root_size) { unsigned long rem_sect; @@ -241,8 +242,8 @@ static void calc_fat_bits2(Fs_t *Fs, unsigned long tot_sectors, int fat_bits, Fs->num_fat, Fs->cluster_size) if(rem_sect >= MY_DISK_SIZE(16, FAT12+2)) - /* big enough for FAT16 - * We take a margin of 2, because NT4 + /* big enough for FAT16 + * We take a margin of 2, because NT4 * misbehaves, and starts considering a disk * as FAT16 only if it is larger than 4086 * sectors, rather than 4084 as it should @@ -255,8 +256,8 @@ static void calc_fat_bits2(Fs_t *Fs, unsigned long tot_sectors, int fat_bits, /* "between two chairs", * augment cluster size, and * settle it */ - if(may_change_cluster_size && - Fs->cluster_size * Fs->sector_size * 2 + if(may_change_cluster_size && + Fs->cluster_size * Fs->sector_size * 2 <= MAX_BYTES_PER_CLUSTER) Fs->cluster_size <<= 1; else if(may_change_root_size) { @@ -289,7 +290,7 @@ static __inline__ void format_root(Fs_t *Fs, char *label, union bootsector *boot int dirlen; init_clash_handling(&ch); - ch.name_converter = label_name; + ch.name_converter = label_name_uc; ch.ignore_entry = -2; buf = safe_malloc(Fs->sector_size); @@ -325,6 +326,7 @@ static __inline__ void format_root(Fs_t *Fs, char *label, union bootsector *boot } +#ifdef USE_XDF static void xdf_calc_fat_size(Fs_t *Fs, unsigned long tot_sectors, int fat_bits) { @@ -351,7 +353,7 @@ static void xdf_calc_fat_size(Fs_t *Fs, unsigned long tot_sectors, fprintf(stderr,"Internal error while calculating Xdf fat size\n"); exit(1); } - +#endif static void calc_fat_size(Fs_t *Fs, unsigned long tot_sectors) { @@ -362,7 +364,7 @@ static void calc_fat_size(Fs_t *Fs, unsigned long tot_sectors) int fat_nybbles; unsigned int slack; int printGrowMsg=1; /* Should we print "growing FAT" messages ?*/ - + #ifdef DEBUG fprintf(stderr, "Fat start=%d\n", Fs->fat_start); fprintf(stderr, "tot_sectors=%lu\n", tot_sectors); @@ -384,7 +386,7 @@ static void calc_fat_size(Fs_t *Fs, unsigned long tot_sectors) if(Fs->fat_bits == 0) { fprintf(stderr, "Weird, fat bits = 0\n"); - exit(1); + exit(1); } @@ -419,7 +421,7 @@ static void calc_fat_size(Fs_t *Fs, unsigned long tot_sectors) Fs->num_clus = FAT16-1; if(Fs->fat_bits == 12 && Fs->num_clus >= FAT12) Fs->num_clus = FAT12-1; - + /* A safety, if above math is correct, this should not be happen...*/ if(Fs->num_clus > (Fs->fat_len * Fs->sector_size * 2 / fat_nybbles - 2)) { @@ -517,7 +519,7 @@ static __inline__ void inst_boot_prg(union bootsector *boot, int offset) static void calc_cluster_size(struct Fs_t *Fs, unsigned long tot_sectors, int fat_bits) - + { unsigned int max_clusters; /* maximal possible number of sectors for * this FAT entry length (12/16/32) */ @@ -527,7 +529,7 @@ static void calc_cluster_size(struct Fs_t *Fs, unsigned long tot_sectors, * the root directory and boot sector(s) */ switch(abs(fat_bits)) { - case 12: + case 12: max_clusters = FAT12-1; max_fat_size = Fs->num_fat * FAT_SIZE(12, Fs->sector_size, max_clusters); @@ -538,7 +540,7 @@ static void calc_cluster_size(struct Fs_t *Fs, unsigned long tot_sectors, max_fat_size = Fs->num_fat * FAT_SIZE(16, Fs->sector_size, max_clusters); break; - case 32: + case 32: Fs->cluster_size = 8; /* According to * http://support.microsoft.com/support/kb/articles/q154/9/97.asp @@ -644,18 +646,21 @@ static void calc_fs_parameters(struct device *dev, unsigned long tot_sectors, Fs->cluster_size = 1; } } - + if(!Fs->dir_len) { if (dev->heads == 1) Fs->dir_len = 4; else Fs->dir_len = (tot_sectors > 2000) ? 32 : 7; - } + } calc_cluster_size(Fs, tot_sectors, dev->fat_bits); +#ifdef USE_XDF if(Fs->fat_len) xdf_calc_fat_size(Fs, tot_sectors, dev->fat_bits); - else { + else +#endif + { calc_fat_bits2(Fs, tot_sectors, dev->fat_bits, may_change_cluster_size, may_change_root_size); @@ -681,7 +686,7 @@ static void calc_fs_parameters_32(unsigned long tot_sectors, * Micro$oft does not support FAT32 with less than 4K */ Fs->cluster_size = 8; - + Fs->dir_len = 0; Fs->num_clus = tot_sectors / Fs->cluster_size; set_fat32(Fs); @@ -714,8 +719,7 @@ static void usage(int ret) } #ifdef OS_linux -static int get_block_geom(int fd, struct MT_STAT *buf, struct device *dev, - char *errmsg) { +static int get_block_geom(int fd, struct device *dev, char *errmsg) { struct hd_geometry geom; long size; int heads=dev->heads; @@ -727,7 +731,7 @@ static int get_block_geom(int fd, struct MT_STAT *buf, struct device *dev, strerror(errno)); return -1; } - + if (ioctl(fd, BLKGETSIZE, &size) < 0) { sprintf(errmsg, "Could not get size of device (%s)", strerror(errno)); @@ -808,6 +812,8 @@ void mformat(int argc, char **argv, int dummy) int backupBoot = 6; + char *endptr; + hs = hs_set = 0; argtracks = 0; argheads = 0; @@ -818,7 +824,7 @@ void mformat(int argc, char **argv, int dummy) serial_set = 0; serial = 0; fsVersion = 0; - + Fs.cluster_size = 0; Fs.refs = 1; Fs.dir_len = 0; @@ -834,7 +840,7 @@ void mformat(int argc, char **argv, int dummy) if(Fs.num_fat <= 0) Fs.num_fat=2; } - Fs.Class = &FsClass; + Fs.Class = &FsClass; rate_0 = mtools_rate_0; rate_any = mtools_rate_any; @@ -844,9 +850,10 @@ void mformat(int argc, char **argv, int dummy) while ((c = getopt(argc,argv, "i:148f:t:n:v:qub" "kK:B:r:L:I:FCc:Xh:s:T:l:N:H:M:S:2:30:Aad:m:"))!= EOF) { + endptr = NULL; switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; /* standard DOS flags */ @@ -898,7 +905,7 @@ void mformat(int argc, char **argv, int dummy) fprintf(stderr, "Flag %c not supported by mtools\n",c); exit(1); - + /* flags added by mtools */ @@ -909,7 +916,7 @@ void mformat(int argc, char **argv, int dummy) case 'S': argssize = atoi(optarg) | 0x80; - if(argssize < 0x81) + if(argssize < 0x80) usage(1); if(argssize >= 0x87) { fprintf(stderr, "argssize must be less than 6\n"); @@ -950,7 +957,7 @@ void mformat(int argc, char **argv, int dummy) break; case 'N': - serial = strtoul(optarg,0,16); + serial = strtoul(optarg,&endptr,16); serial_set = 1; break; case 'a': /* Atari style serial number */ @@ -967,7 +974,7 @@ void mformat(int argc, char **argv, int dummy) break; case 'I': - fsVersion = strtoul(optarg,0,0); + fsVersion = strtoul(optarg,&endptr,0); break; case 'c': @@ -975,10 +982,10 @@ void mformat(int argc, char **argv, int dummy) break; case 'r': - Fs.dir_len = strtoul(optarg,0,0); + Fs.dir_len = strtoul(optarg,&endptr,0); break; case 'L': - Fs.fat_len = strtoul(optarg,0,0); + Fs.fat_len = strtoul(optarg,&endptr,0); break; @@ -1002,16 +1009,34 @@ void mformat(int argc, char **argv, int dummy) Fs.num_fat = atoi(optarg); break; case 'm': - mediaDesc = strtoul(optarg,0,0); + mediaDesc = strtoul(optarg,&endptr,0); + if(*endptr) + mediaDesc = strtoul(optarg,&endptr,16); break; default: usage(1); } + if(endptr && *endptr) { + fprintf(stderr, "Bad number %s\n", optarg); + exit(1); + } } - if (argc - optind != 1 || - !argv[optind][0] || argv[optind][1] != ':') + if (argc - optind > 1) + usage(1); + if(argc - optind == 1) { + if(!argv[optind][0] || argv[optind][1] != ':') usage(1); + drive = toupper(argv[argc -1][0]); + } else { + drive = get_default_drive(); + if(drive != ':') { + /* Use default drive only if it is ":" (image file), as else + it would be too dangerous... */ + fprintf(stderr, "Drive letter missing\n"); + exit(1); + } + } if(argtracks && tot_sectors) { fprintf(stderr, "Only one of -t or -T may be specified\n"); @@ -1024,11 +1049,9 @@ void mformat(int argc, char **argv, int dummy) exit(1); } #endif - - drive = toupper(argv[argc -1][0]); - /* check out a drive whose letter and parameters match */ - sprintf(errmsg, "Drive '%c:' not supported", drive); + /* check out a drive whose letter and parameters match */ + sprintf(errmsg, "Drive '%c:' not supported", drive); Fs.Direct = NULL; blocksize = 0; for(dev=devices;dev->drive;dev++) { @@ -1045,7 +1068,7 @@ void mformat(int argc, char **argv, int dummy) SET_INT(used_dev.ssize, argssize); if(hs_set) used_dev.hidden = hs; - + expand(dev->name, name); #ifdef USING_NEW_VOLD strcpy(name, getVoldName(dev, name)); @@ -1056,11 +1079,11 @@ void mformat(int argc, char **argv, int dummy) #endif Fs.Direct = 0; #ifdef USE_FLOPPYD - Fs.Direct = FloppydOpen(&used_dev, dev, name, + Fs.Direct = FloppydOpen(&used_dev, name, O_RDWR | create, - errmsg, 0, 1, &maxSize); + errmsg, &maxSize); #endif - if(!Fs.Direct) { + if(!Fs.Direct) { Fs.Direct = SimpleFileOpen(&used_dev, dev, name, O_RDWR | create, errmsg, 0, 1, @@ -1089,11 +1112,11 @@ void mformat(int argc, char **argv, int dummy) if (MT_FSTAT(fd, &stbuf) < 0) { sprintf(errmsg, "Could not stat file (%s)", strerror(errno)); - continue; + continue; } if (S_ISBLK(stbuf.st_mode) && - get_block_geom(fd, &stbuf, &used_dev, errmsg) < 0) + get_block_geom(fd, &used_dev, errmsg) < 0) continue; } #endif @@ -1138,7 +1161,7 @@ void mformat(int argc, char **argv, int dummy) blocksize = Fs.sector_size; else blocksize = used_dev.blocksize; - + if(blocksize > MAX_SECTOR) blocksize = MAX_SECTOR; @@ -1155,7 +1178,7 @@ void mformat(int argc, char **argv, int dummy) } - /* print error msg if needed */ + /* print error msg if needed */ if ( dev->drive == 0 ){ FREE(&Fs.Direct); fprintf(stderr,"%s: %s\n", argv[0],errmsg); @@ -1164,7 +1187,7 @@ void mformat(int argc, char **argv, int dummy) /* calculate the total number of sectors */ if(tot_sectors == 0) { - unsigned long sect_per_track = used_dev.heads*used_dev.sectors; + unsigned long sect_per_track = used_dev.heads*used_dev.sectors; tot_sectors = used_dev.tracks*sect_per_track - used_dev.hidden%sect_per_track; } @@ -1213,7 +1236,7 @@ void mformat(int argc, char **argv, int dummy) boot.boot.nfat = Fs.num_fat; if(!keepBoot) set_word(&boot.bytes[510], 0xaa55); - + /* Initialize the remaining parameters */ set_word(boot.boot.nsect, used_dev.sectors); set_word(boot.boot.nheads, used_dev.heads); @@ -1243,7 +1266,7 @@ void mformat(int argc, char **argv, int dummy) /* no backup boot sector */ set_word(boot.boot.ext.fat32.backupBoot, backupBoot); - + labelBlock = & boot.boot.ext.fat32.labelBlock; } else { Fs.infoSectorLoc = 0; @@ -1271,9 +1294,10 @@ void mformat(int argc, char **argv, int dummy) srandom((long)time (0)); if (!serial_set) serial=random(); - set_dword(labelBlock->serial, serial); - label_name(GET_DOSCONVERT((Stream_t *)&Fs), - label[0] ? label : "NO NAME ", 0, &mangled, &shortlabel); + set_dword(labelBlock->serial, serial); + label_name_pc(GET_DOSCONVERT((Stream_t *)&Fs), + label[0] ? label : "NO NAME ", 0, + &mangled, &shortlabel); strncpy(labelBlock->label, shortlabel.base, 11); sprintf(labelBlock->fat_type, "FAT%2.2d ", Fs.fat_bits); labelBlock->fat_type[7] = ' '; @@ -1294,7 +1318,7 @@ void mformat(int argc, char **argv, int dummy) boot.boot.banner[5] = random(); boot.boot.banner[6] = random(); boot.boot.banner[7] = random(); - } + } if(!keepBoot) inst_boot_prg(&boot, bootOffset); @@ -1352,7 +1376,7 @@ void mformat(int argc, char **argv, int dummy) "Bourne shell syntax (sh, ash, bash, ksh, zsh etc):\n" " export MTOOLS_USE_XDF=1\n\n" "C shell syntax (csh and tcsh):\n" - " setenv MTOOLS_USE_XDF 1\n" ); + " setenv MTOOLS_USE_XDF 1\n" ); #endif exit(0); } diff --git a/minfo.1 b/minfo.1 index e17e432..b8838b7 100644 --- a/minfo.1 +++ b/minfo.1 @@ -1,5 +1,5 @@ '\" t -.TH minfo 1 "29Jun11" mtools-4.0.17 +.TH minfo 1 "09Jan13" mtools-4.0.18 .SH Name minfo - print the parameters of a MSDOS filesystem '\" t @@ -32,7 +32,7 @@ with MS-DOS 1.0 file systems .ft R .PP -Mlabel supports the following option: +Minfo supports the following option: .TP \&\fR\&\f(CWv\fR\ Prints a hexdump of the boot sector, in addition to the other information diff --git a/minfo.c b/minfo.c index a799ab7..51cc65a 100644 --- a/minfo.c +++ b/minfo.c @@ -72,17 +72,21 @@ void minfo(int argc, char **argv, int type) int c; Stream_t *Stream; struct label_blk_t *labelBlock; + int have_drive = 0; unsigned long sect_per_track; int tracks_match=0; int hidden; + + char *imgFile=NULL; if(helpFlag(argc, argv)) usage(0); while ((c = getopt(argc, argv, "i:vh")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); + imgFile=optarg; break; case 'v': verbose = 1; @@ -94,13 +98,17 @@ void minfo(int argc, char **argv, int type) } } - if(argc == optind) - usage(1); - - for(;optind < argc; optind++) { - if(!argv[optind][0] || argv[optind][1] != ':') - usage(1); - drive = toupper(argv[optind][0]); + for(;optind <= argc; optind++) { + if(optind == argc) { + if(have_drive) + break; + drive = get_default_drive(); + } else { + if(!argv[optind][0] || argv[optind][1] != ':') + usage(1); + drive = toupper(argv[optind][0]); + } + have_drive = 1; if(! (Stream = find_device(drive, O_RDONLY, &dev, &boot, name, &media, 0, NULL))) @@ -130,10 +138,12 @@ void minfo(int argc, char **argv, int type) if(tot_sectors == dev.tracks * sect_per_track - hidden % sect_per_track) { tracks_match=1; - printf("-t %d", dev.tracks); + printf("-t %d ", dev.tracks); } else { - printf("-T %ld", tot_sectors); + printf("-T %ld ", tot_sectors); } + if(imgFile != NULL) + printf("-i %s ", imgFile); printf (" -h %d -s %d ", dev.heads, dev.sectors); if(hidden || !tracks_match) printf("-H %d ", hidden); @@ -144,7 +154,7 @@ void minfo(int argc, char **argv, int type) } printf("bootsector information\n"); printf("======================\n"); - printf("banner:\"%8s\"\n", boot.boot.banner); + printf("banner:\"%.8s\"\n", boot.boot.banner); printf("sector size: %d bytes\n", WORD_S(secsiz)); printf("cluster size: %d sectors\n", boot.boot.clsiz); printf("reserved (boot) sectors: %d\n", WORD_S(nrsvsect)); diff --git a/mkmanifest.1 b/mkmanifest.1 index f8f05e9..7154116 100644 --- a/mkmanifest.1 +++ b/mkmanifest.1 @@ -1,5 +1,5 @@ '\" t -.TH mkmanifest 1 "29Jun11" mtools-4.0.17 +.TH mkmanifest 1 "09Jan13" mtools-4.0.18 .SH Name mkmanifest - makes list of file names and their DOS 8+3 equivalent '\" t diff --git a/mlabel.1 b/mlabel.1 index 50bba2f..2f8db30 100644 --- a/mlabel.1 +++ b/mlabel.1 @@ -1,5 +1,5 @@ '\" t -.TH mlabel 1 "29Jun11" mtools-4.0.17 +.TH mlabel 1 "09Jan13" mtools-4.0.18 .SH Name mlabel - make an MSDOS volume label '\" t diff --git a/mlabel.c b/mlabel.c index fa3b254..4385d42 100644 --- a/mlabel.c +++ b/mlabel.c @@ -27,8 +27,8 @@ #include "nameclash.h" #include "file_name.h" -void label_name(doscp_t *cp, const char *filename, int verbose, - int *mangled, dos_name_t *ans) +static void _label_name(doscp_t *cp, const char *filename, int verbose, + int *mangled, dos_name_t *ans, int preserve_case) { int len; int i; @@ -50,7 +50,8 @@ void label_name(doscp_t *cp, const char *filename, int verbose, have_lower = 1; if(isupper(wbuffer[i])) have_upper = 1; - wbuffer[i] = towupper(wbuffer[i]); + if(!preserve_case) + wbuffer[i] = towupper(wbuffer[i]); if( #ifdef HAVE_WCHAR_H wcschr(L"^+=/[]:,?*\\<>|\".", wbuffer[i]) @@ -67,6 +68,18 @@ void label_name(doscp_t *cp, const char *filename, int verbose, wchar_to_dos(cp, wbuffer, ans->base, len, mangled); } +void label_name_uc(doscp_t *cp, const char *filename, int verbose, + int *mangled, dos_name_t *ans) +{ + _label_name(cp, filename, verbose, mangled, ans, 0); +} + +void label_name_pc(doscp_t *cp, const char *filename, int verbose, + int *mangled, dos_name_t *ans) +{ + _label_name(cp, filename, verbose, mangled, ans, 1); +} + int labelit(struct dos_name_t *dosname, char *longname, void *arg0, @@ -93,7 +106,7 @@ static void usage(int ret) void mlabel(int argc, char **argv, int type) { - char *newLabel; + const char *newLabel=""; int verbose, clear, interactive, show; direntry_t entry; int result=0; @@ -115,9 +128,10 @@ void mlabel(int argc, char **argv, int type) struct label_blk_t *labelBlock; int isRo=0; int *isRop=NULL; + char drive; init_clash_handling(&ch); - ch.name_converter = label_name; + ch.name_converter = label_name_uc; ch.ignore_entry = -2; verbose = 0; @@ -129,7 +143,7 @@ void mlabel(int argc, char **argv, int type) while ((c = getopt(argc, argv, "i:vcsnN:h")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'v': verbose = 1; @@ -162,11 +176,18 @@ void mlabel(int argc, char **argv, int type) } } - if (argc - optind != 1 || !argv[optind][0] || argv[optind][1] != ':') + if (argc - optind > 1) usage(1); + if(argc - optind == 1) { + if(!argv[optind][0] || argv[optind][1] != ':') + usage(1); + drive = toupper(argv[argc -1][0]); + newLabel = argv[optind]+2; + } else { + drive = get_default_drive(); + } init_mp(&mp); - newLabel = argv[optind]+2; if(strlen(newLabel) > VBUFSIZE) { fprintf(stderr, "Label too long\n"); FREE(&RootDir); @@ -184,7 +205,7 @@ void mlabel(int argc, char **argv, int type) FREE(&RootDir); exit(1); } - RootDir = open_root_dir(argv[optind][0], isRop ? 0 : O_RDWR, isRop); + RootDir = open_root_dir(drive, isRop ? 0 : O_RDWR, isRop); if(isRo) { show = 1; interactive = 0; @@ -215,14 +236,20 @@ void mlabel(int argc, char **argv, int type) /* ask for new label */ if(interactive){ + saved_sig_state ss; newLabel = longname; + allow_interrupts(&ss); fprintf(stderr,"Enter the new volume label : "); - if(fgets(newLabel, VBUFSIZE, stdin) == NULL) { - newLabel[0] = '\0'; + if(fgets(longname, VBUFSIZE, stdin) == NULL) { fprintf(stderr, "\n"); + if(errno == EINTR) { + FREE(&RootDir); + exit(1); + } + longname[0] = '\0'; } - if(newLabel[0]) - newLabel[strlen(newLabel)-1] = '\0'; + if(longname[0]) + longname[strlen(newLabel)-1] = '\0'; } if(strlen(newLabel) > 11) { @@ -270,7 +297,7 @@ void mlabel(int argc, char **argv, int type) else shrtLabel = newLabel; cp = GET_DOSCONVERT(Fs); - label_name(cp, shrtLabel, verbose, &mangled, &dosname); + label_name_pc(cp, shrtLabel, verbose, &mangled, &dosname); if(have_boot && boot.boot.descr >= 0xf0 && labelBlock->dos4 == 0x29) { diff --git a/mmd.1 b/mmd.1 index 40445de..8b65fd9 100644 --- a/mmd.1 +++ b/mmd.1 @@ -1,5 +1,5 @@ '\" t -.TH mmd 1 "29Jun11" mtools-4.0.17 +.TH mmd 1 "09Jan13" mtools-4.0.18 .SH Name mmd - make an MSDOS subdirectory '\" t diff --git a/mmd.c b/mmd.c index 24e4db9..bb9c1d7 100644 --- a/mmd.c +++ b/mmd.c @@ -168,7 +168,7 @@ void mmd(int argc, char **argv, int type) while ((c = getopt(argc, argv, "i:D:oh")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case '?': usage(1); diff --git a/mmount.1 b/mmount.1 index 487254f..d232cb4 100644 --- a/mmount.1 +++ b/mmount.1 @@ -1,5 +1,5 @@ '\" t -.TH mmount 1 "29Jun11" mtools-4.0.17 +.TH mmount 1 "09Jan13" mtools-4.0.18 .SH Name mmount - mount an MSDOS disk '\" t diff --git a/mmove.1 b/mmove.1 index 250d573..65a49af 100644 --- a/mmove.1 +++ b/mmove.1 @@ -1,5 +1,5 @@ '\" t -.TH mmove 1 "29Jun11" mtools-4.0.17 +.TH mmove 1 "09Jan13" mtools-4.0.18 .SH Name mmove - move or rename an MSDOS file or subdirectory '\" t diff --git a/mmove.c b/mmove.c index 13576dc..7f5e5ef 100644 --- a/mmove.c +++ b/mmove.c @@ -247,7 +247,7 @@ void mmove(int argc, char **argv, int oldsyntax) while ((c = getopt(argc, argv, "i:vD:oh")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'v': /* dummy option for mcopy */ arg.verbose = 1; diff --git a/mpartition.1 b/mpartition.1 index edbb914..1796fc8 100644 --- a/mpartition.1 +++ b/mpartition.1 @@ -1,5 +1,5 @@ '\" t -.TH mpartition 1 "29Jun11" mtools-4.0.17 +.TH mpartition 1 "09Jan13" mtools-4.0.18 .SH Name mpartition - partition an MSDOS hard disk '\" t diff --git a/mpartition.c b/mpartition.c index d76557f..24ac840 100644 --- a/mpartition.c +++ b/mpartition.c @@ -325,7 +325,7 @@ void mpartition(int argc, char **argv, int dummy) while ((c = getopt(argc, argv, "i:adprcIT:t:h:s:fvpb:l:S:B:")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'B': bootSector = optarg; diff --git a/mrd.1 b/mrd.1 index 359983d..9b4afc3 100644 --- a/mrd.1 +++ b/mrd.1 @@ -1,5 +1,5 @@ '\" t -.TH mrd 1 "29Jun11" mtools-4.0.17 +.TH mrd 1 "09Jan13" mtools-4.0.18 .SH Name mrd - remove an MSDOS subdirectory '\" t diff --git a/mren.1 b/mren.1 index c619cff..721f2ee 100644 --- a/mren.1 +++ b/mren.1 @@ -1,5 +1,5 @@ '\" t -.TH mren 1 "29Jun11" mtools-4.0.17 +.TH mren 1 "09Jan13" mtools-4.0.18 .SH Name mren - rename an existing MSDOS file '\" t diff --git a/mshortname.1 b/mshortname.1 index adad4cb..b85043f 100644 --- a/mshortname.1 +++ b/mshortname.1 @@ -1,5 +1,5 @@ '\" t -.TH mshortname 1 "29Jun11" mtools-4.0.17 +.TH mshortname 1 "09Jan13" mtools-4.0.18 .SH Name mshortname - shows short name of a file '\" t diff --git a/mshortname.c b/mshortname.c index b19112e..5cdfa3f 100644 --- a/mshortname.c +++ b/mshortname.c @@ -52,7 +52,7 @@ void mshortname(int argc, char **argv, int type) while ((c = getopt(argc, argv, "i:h")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'h': usage(0); diff --git a/mshowfat.1 b/mshowfat.1 index 5f6132e..75ac8c0 100644 --- a/mshowfat.1 +++ b/mshowfat.1 @@ -1,5 +1,5 @@ '\" t -.TH mshowfat 1 "29Jun11" mtools-4.0.17 +.TH mshowfat 1 "09Jan13" mtools-4.0.18 .SH Name mshowfat - shows FAT clusters allocated to file '\" t diff --git a/mshowfat.c b/mshowfat.c index f2844ab..6c1ebe9 100644 --- a/mshowfat.c +++ b/mshowfat.c @@ -84,7 +84,7 @@ void mshowfat(int argc, char **argv, int mtype) arg.offset = str_to_offset(optarg); break; case 'i': - set_cmd_line_image(optarg, 0); + set_cmd_line_image(optarg); break; case 'h': usage(0); diff --git a/mtools.1 b/mtools.1 index 14c28fd..7d416d4 100644 --- a/mtools.1 +++ b/mtools.1 @@ -1,5 +1,5 @@ '\" t -.TH mtools 1 "25Apr11" mtools-4.0.16 +.TH mtools 1 "09Jan13" mtools-4.0.18 .SH Name mtools - utilities to access DOS disks in Unix. '\" t @@ -36,10 +36,10 @@ Mtools can be found at the following places (and their mirrors): .nf .ft 3 .in +0.3i -http://ftp.gnu.org/gnu/mtools/mtools-4.0.16.tar.gz -http://mtools.linux.lu/mtools-4.0.16.tar.gz -ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.16.tar.gz -ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.16.tar.gz +http://ftp.gnu.org/gnu/mtools/mtools-4.0.18.tar.gz +http://mtools.linux.lu/mtools-4.0.18.tar.gz +ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.18.tar.gz +ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.18.tar.gz .fi .in -0.3i .ft R diff --git a/mtools.5 b/mtools.5 index 9b611cd..06f54b8 100644 --- a/mtools.5 +++ b/mtools.5 @@ -1,5 +1,5 @@ '\" t -.TH mtools 5 "25Apr11" MTOOLS MTOOLS +.TH mtools 5 "09Jan13" MTOOLS MTOOLS .SH Name mtools.conf - mtools configuration files '\" t @@ -13,7 +13,7 @@ mtools.conf - mtools configuration files .tr \(if` .tr \(pd" -.ds St Mtools\ 4.0.16 +.ds St Mtools\ 4.0.18 .oh '\\*(St''%' .eh '%''\\*(St' .PP diff --git a/mtools.h b/mtools.h index 765ca77..ef98e94 100644 --- a/mtools.h +++ b/mtools.h @@ -155,7 +155,14 @@ extern int got_signal; #define got_signal do_gotsignal(__FILE__, __LINE__) */ void setup_signal(void); +#ifdef HAVE_SIGACTION +typedef struct { struct sigaction sa[4]; } saved_sig_state; +#else +typedef int saved_sig_state; +#endif +void allow_interrupts(saved_sig_state *ss); +void restore_interrupts(saved_sig_state *ss); #define SET_INT(target, source) \ if(source)target=source @@ -168,8 +175,11 @@ UNUSED(static __inline__ int compare (long ref, long testee)) Stream_t *GetFs(Stream_t *Fs); -void label_name(doscp_t *cp, const char *filename, int verbose, - int *mangled, dos_name_t *ans); +void label_name_uc(doscp_t *cp, const char *filename, int verbose, + int *mangled, dos_name_t *ans); + +void label_name_pc(doscp_t *cp, const char *filename, int verbose, + int *mangled, dos_name_t *ans); /* environmental variables */ extern unsigned int mtools_skip_check; @@ -187,7 +197,7 @@ extern int mtools_raw_tty; extern int batchmode; char get_default_drive(void); -void set_cmd_line_image(char *img, int flags); +void set_cmd_line_image(char *img); void read_config(void); off_t str_to_offset(char *str); extern struct device *devices; @@ -241,7 +251,7 @@ char *getVoldName(struct device *dev, char *name); #endif -Stream_t *OpenDir(Stream_t *Parent, const char *filename); +Stream_t *OpenDir(const char *filename); /* int unix_dir_loop(Stream_t *Stream, MainParam_t *mp); int unix_loop(MainParam_t *mp, char *arg); */ diff --git a/mtools.info b/mtools.info index 4f709b3..332b042 100644 --- a/mtools.info +++ b/mtools.info @@ -1,10 +1,10 @@ This is mtools.info, produced by makeinfo version 4.13 from mtools.texi. -This manual is for Mtools (version 4.0.17, June 2011), which is a +This manual is for Mtools (version 4.0.18, January 2013), which is a collection of tools to allow Unix systems to manipulate MS-DOS files. Copyright (C) 2007, 2009 Free Software Foundation, Inc. Copyright -(C) 1996-2005,2007-2011 Alain Knaff. +(C) 1996-2005,2007-2011,2013 Alain Knaff. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -42,11 +42,11 @@ any preliminary mounting or initialization (assuming the default `/etc/mtools.conf' works on your machine). With mtools, one can change floppies too without unmounting and mounting. - This manual is for Mtools (version 4.0.17, June 2011), which is a + This manual is for Mtools (version 4.0.18, January 2013), which is a collection of tools to allow Unix systems to manipulate MS-DOS files. Copyright (C) 2007, 2009 Free Software Foundation, Inc. Copyright -(C) 1996-2005,2007-2011 Alain Knaff. +(C) 1996-2005,2007-2011,2013 Alain Knaff. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -76,10 +76,10 @@ File: mtools.info, Node: Location, Next: Common features, Prev: Top, Up: Top ********************* Mtools can be found at the following places (and their mirrors): - http://ftp.gnu.org/gnu/mtools/mtools-4.0.17.tar.gz - http://mtools.linux.lu/mtools-4.0.17.tar.gz - ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.17.tar.gz - ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.17.tar.gz + http://ftp.gnu.org/gnu/mtools/mtools-4.0.18.tar.gz + http://mtools.linux.lu/mtools-4.0.18.tar.gz + ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.18.tar.gz + ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.18.tar.gz Before reporting a bug, make sure that it has not yet been fixed in the Alpha patches which can be found at: @@ -1578,9 +1578,7 @@ low-level formatted diskette. Its syntax is: `mformat' [`-t' CYLINDERS|`-T' TOT_SECTORS] [`-h' HEADS] [`-s' SECTORS] [`-f' SIZE] [`-1'] [`-4'] [`-8'] [`-v' VOLUME_LABEL] - [`-F'] [`-S' SIZECODE] [`-X'] - [`-2' SECTORS_ON_TRACK_0] [`-3'] - [`-0' RATE_ON_TRACK_0] [`-A' RATE_ON_OTHER_TRACKS] + [`-F'] [`-S' SIZECODE] [`-M' SOFTWARE_SECTOR_SIZE] [`-N' SERIAL_NUMBER] [`-a'] [`-C'] [`-H' HIDDEN_SECTORS] [`-I' FSVERSION] @@ -1588,6 +1586,10 @@ low-level formatted diskette. Its syntax is: [`-B' BOOT_SECTOR] [`-k'] [`-m' MEDIA_DESCRIPTOR] [`-K' BACKUP_BOOT] + [`-c' CLUSTERS_PER_SECTOR] + [`-d' FAT_COPIES] + [`-X'] [`-2' SECTORS_ON_TRACK_0] [`-3'] + [`-0' RATE_ON_TRACK_0] [`-A' RATE_ON_OTHER_TRACKS] DRIVE: `Mformat' adds a minimal MS-DOS file system (boot sector, FAT, and @@ -1860,7 +1862,7 @@ another media. However, this doesn't work with 2m or XDF media, and with MS-DOS 1.0 file systems `minfo' DRIVE: - Mlabel supports the following option: + Minfo supports the following option: `v' Prints a hexdump of the boot sector, in addition to the other information @@ -2729,71 +2731,71 @@ Concept index  Tag Table: -Node: Top865 -Node: Location2942 -Node: Common features4328 -Node: arguments5092 -Node: drive letters6746 -Node: directory8098 -Node: long names8543 -Node: name clashes11089 -Node: case sensitivity13372 -Node: high capacity formats14601 -Node: more sectors15720 -Node: bigger sectors16769 -Node: 2m17491 -Node: XDF18670 -Node: exit codes20005 -Node: bugs20641 -Node: Configuration21173 -Node: configuration file location22308 -Node: general syntax22732 -Node: default values23559 -Node: global variables24086 -Node: per drive variables26167 -Node: general information27002 -Node: location information27443 -Node: geometry description28961 -Node: open flags32813 -Node: miscellaneous variables33412 -Node: miscellaneous flags35480 -Node: multiple descriptions39110 -Node: parsing order40780 -Node: old style configuration41811 -Node: Commands42506 -Node: floppyd44427 -Node: floppyd_installtest49212 -Node: mattrib49843 -Node: mbadblocks51639 -Node: mcat52932 -Node: mcd53743 -Node: mclasserase54604 -Node: mcopy55283 -Node: mdel58316 -Node: mdeltree58654 -Node: mdir59071 -Node: mdu60347 -Node: mformat60853 -Node: mkmanifest67730 -Node: minfo69702 -Node: mlabel70273 -Node: mmd71425 -Node: mmount71772 -Node: mmove72368 -Node: mpartition73174 -Node: mrd76695 -Node: mren77051 -Node: mshortname77798 -Node: mshowfat78128 -Node: mtoolstest78536 -Node: mtype79106 -Node: mzip79957 -Ref: mzip-Footnote-181990 -Ref: mzip-Footnote-282071 -Node: Compiling mtools82357 -Node: Porting mtools83452 -Node: Command Index89367 -Node: Variable Index89515 -Node: Concept Index91046 +Node: Top873 +Node: Location2958 +Node: Common features4344 +Node: arguments5108 +Node: drive letters6762 +Node: directory8114 +Node: long names8559 +Node: name clashes11105 +Node: case sensitivity13388 +Node: high capacity formats14617 +Node: more sectors15736 +Node: bigger sectors16785 +Node: 2m17507 +Node: XDF18686 +Node: exit codes20021 +Node: bugs20657 +Node: Configuration21189 +Node: configuration file location22324 +Node: general syntax22748 +Node: default values23575 +Node: global variables24102 +Node: per drive variables26183 +Node: general information27018 +Node: location information27459 +Node: geometry description28977 +Node: open flags32829 +Node: miscellaneous variables33428 +Node: miscellaneous flags35496 +Node: multiple descriptions39126 +Node: parsing order40796 +Node: old style configuration41827 +Node: Commands42522 +Node: floppyd44443 +Node: floppyd_installtest49228 +Node: mattrib49859 +Node: mbadblocks51655 +Node: mcat52948 +Node: mcd53759 +Node: mclasserase54620 +Node: mcopy55299 +Node: mdel58332 +Node: mdeltree58670 +Node: mdir59087 +Node: mdu60363 +Node: mformat60869 +Node: mkmanifest67805 +Node: minfo69777 +Node: mlabel70347 +Node: mmd71499 +Node: mmount71846 +Node: mmove72442 +Node: mpartition73248 +Node: mrd76769 +Node: mren77125 +Node: mshortname77872 +Node: mshowfat78202 +Node: mtoolstest78610 +Node: mtype79180 +Node: mzip80031 +Ref: mzip-Footnote-182064 +Ref: mzip-Footnote-282145 +Node: Compiling mtools82431 +Node: Porting mtools83526 +Node: Command Index89441 +Node: Variable Index89589 +Node: Concept Index91120  End Tag Table diff --git a/mtools.spec b/mtools.spec index 626e9f6..1fc62b4 100644 --- a/mtools.spec +++ b/mtools.spec @@ -1,6 +1,7 @@ +%define _binary_payload w9.gzdio Name: mtools Summary: mtools, read/write/list/format DOS disks under Unix -Version: 4.0.17 +Version: 4.0.18 Release: 1 License: GPLv3+ Group: Utilities/System @@ -134,6 +135,17 @@ if [ -f %{_bindir}/install-info ] ; then fi %changelog +* Wed Jan 09 2013 Alain Knaff +- Fix for names of iconv encodings on AIX +- Fix mt_size_t on NetBSD +- Fixed compilation on Mingw +- Fixed doc (especially mformat) +- Fix mformating of FAT12 filesystems with huge cluster sizes +- Minfo prints image file name in mformat command line if an image +- file name was given +- Always generate gzip-compressed RPMs, in order to remain +- compatible with older distributions +- Fixed buffer overflow with drive letter in mclasserase * Wed Jun 29 2011 Alain Knaff - mbadblocks now takes a list of bad blocks (either as sectors or as clusters) diff --git a/mtools.texi b/mtools.texi index 76aa58e..1085789 100644 --- a/mtools.texi +++ b/mtools.texi @@ -14,7 +14,7 @@ which is a collection of tools to allow Unix systems to manipulate MS-DOS files. Copyright @copyright{} 2007, 2009 Free Software Foundation, Inc. -Copyright @copyright{} 1996-2005,2007-2011 Alain Knaff. +Copyright @copyright{} 1996-2005,2007-2011,2013 Alain Knaff. @quotation Permission is granted to copy, distribute and/or modify this document @@ -1748,9 +1748,7 @@ low-level formatted diskette. Its syntax is: @code{mformat} [@code{-t} @var{cylinders}|@code{-T} @var{tot_sectors}] [@code{-h} @var{heads}] [@code{-s} @var{sectors}] [@code{-f} @var{size}] [@code{-1}] [@code{-4}] [@code{-8}] [@code{-v} @var{volume_label}] - [@code{-F}] [@code{-S} @var{sizecode}] [@code{-X}] - [@code{-2} @var{sectors_on_track_0}] [@code{-3}] - [@code{-0} @var{rate_on_track_0}] [@code{-A} @var{rate_on_other_tracks}] + [@code{-F}] [@code{-S} @var{sizecode}] [@code{-M} @var{software_sector_size}] [@code{-N} @var{serial_number}] [@code{-a}] [@code{-C}] [@code{-H} @var{hidden_sectors}] [@code{-I} @var{fsVersion}] @@ -1758,6 +1756,10 @@ low-level formatted diskette. Its syntax is: [@code{-B} @var{boot_sector}] [@code{-k}] [@code{-m} @var{media_descriptor}] [@code{-K} @var{backup_boot}] + [@code{-c} @var{clusters_per_sector}] + [@code{-d} @var{fat_copies}] + [@code{-X}] [@code{-2} @var{sectors_on_track_0}] [@code{-3}] + [@code{-0} @var{rate_on_track_0}] [@code{-A} @var{rate_on_other_tracks}] @var{drive:} @end display @@ -2010,7 +2012,7 @@ with MS-DOS 1.0 file systems @code{minfo} @var{drive}: @end display -Mlabel supports the following option: +Minfo supports the following option: @table @code @item v Prints a hexdump of the boot sector, in addition to the other information diff --git a/mtools.tmpl.1 b/mtools.tmpl.1 index e41ae71..8b62542 100644 --- a/mtools.tmpl.1 +++ b/mtools.tmpl.1 @@ -1,5 +1,5 @@ '\" t -.TH mtools 1 "29Jun11" mtools-4.0.17 +.TH mtools 1 "09Jan13" mtools-4.0.18 .SH Name mtools - utilities to access DOS disks in Unix. '\" t @@ -36,10 +36,10 @@ Mtools can be found at the following places (and their mirrors): .nf .ft 3 .in +0.3i -http://ftp.gnu.org/gnu/mtools/mtools-4.0.17.tar.gz -http://mtools.linux.lu/mtools-4.0.17.tar.gz -ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.17.tar.gz -ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.17.tar.gz +http://ftp.gnu.org/gnu/mtools/mtools-4.0.18.tar.gz +http://mtools.linux.lu/mtools-4.0.18.tar.gz +ftp://www.tux.org/pub/knaff/mtools/mtools-4.0.18.tar.gz +ftp://ibiblio.unc.edu/pub/Linux/utils/disk-management/mtools-4.0.18.tar.gz .fi .in -0.3i .ft R diff --git a/mtools.tmpl.5 b/mtools.tmpl.5 index fb4314b..565fdd7 100644 --- a/mtools.tmpl.5 +++ b/mtools.tmpl.5 @@ -1,5 +1,5 @@ '\" t -.TH mtools 5 "29Jun11" MTOOLS MTOOLS +.TH mtools 5 "09Jan13" MTOOLS MTOOLS .SH Name mtools.conf - mtools configuration files '\" t @@ -13,7 +13,7 @@ mtools.conf - mtools configuration files .tr \(if` .tr \(pd" -.ds St Mtools\ 4.0.17 +.ds St Mtools\ 4.0.18 .oh '\\*(St''%' .eh '%''\\*(St' .PP diff --git a/mtoolstest.1 b/mtoolstest.1 index 95a3b88..e56f68d 100644 --- a/mtoolstest.1 +++ b/mtoolstest.1 @@ -1,5 +1,5 @@ '\" t -.TH mtoolstest 1 "29Jun11" mtools-4.0.17 +.TH mtoolstest 1 "09Jan13" mtools-4.0.18 .SH Name mtoolstest - tests and displays the configuration '\" t diff --git a/mtype.1 b/mtype.1 index bbea5c7..9e40fc5 100644 --- a/mtype.1 +++ b/mtype.1 @@ -1,5 +1,5 @@ '\" t -.TH mtype 1 "29Jun11" mtools-4.0.17 +.TH mtype 1 "09Jan13" mtools-4.0.18 .SH Name mtype - display contents of an MSDOS file '\" t diff --git a/mzip.1 b/mzip.1 index 7dd62f3..2b54063 100644 --- a/mzip.1 +++ b/mzip.1 @@ -1,5 +1,5 @@ '\" t -.TH mzip 1 "29Jun11" mtools-4.0.17 +.TH mzip 1 "09Jan13" mtools-4.0.18 .SH Name mzip - change protection mode and eject disk on Zip/Jaz drive '\" t diff --git a/mzip.c b/mzip.c index 83a2b66..e567a4f 100644 --- a/mzip.c +++ b/mzip.c @@ -251,7 +251,7 @@ void mzip(int argc, char **argv, int type) while ((c = getopt(argc, argv, "i:efpqrwxuh")) != EOF) { switch (c) { case 'i': - set_cmd_line_image(optarg, SCSI_FLAG); + set_cmd_line_image(optarg); break; case 'f': if (get_real_uid()) { diff --git a/patchlevel.c b/patchlevel.c index 71fa88e..cfcbeee 100644 --- a/patchlevel.c +++ b/patchlevel.c @@ -15,10 +15,10 @@ * along with Mtools. If not, see . */ -const char *mversion="4.0.17"; +const char *mversion="4.0.18"; /* Multiple releases on same day should be marked with (b), (cd), (d) after * date string below */ -const char *mdate = "June 29th, 2011"; +const char *mdate = "January 9th, 2013"; -const char *mformat_banner = "MTOO4017"; +const char *mformat_banner = "MTOO4018"; diff --git a/scsi.c b/scsi.c index d72f3a4..7510edc 100644 --- a/scsi.c +++ b/scsi.c @@ -165,33 +165,33 @@ int scsi_cmd(int fd, unsigned char *cdb, int cmdlen, scsi_io_mode_t mode, return 0; #elif defined OS_linux - struct sg_io_hdr scsi_cmd; + struct sg_io_hdr my_scsi_cmd; /* ** Init the command */ memset(&scsi_cmd,0,sizeof(scsi_cmd)); - scsi_cmd.interface_id = 'S'; - scsi_cmd.dxfer_direction = (mode == SCSI_IO_READ)?(SG_DXFER_FROM_DEV):(SG_DXFER_TO_DEV); - scsi_cmd.cmd_len = cmdlen; - scsi_cmd.mx_sb_len = 0; - scsi_cmd.dxfer_len = len; - scsi_cmd.dxferp = data; - scsi_cmd.cmdp = cdb; - scsi_cmd.timeout = ~0; /* where is MAX_UINT defined??? */ - -#if DEBUG + my_scsi_cmd.interface_id = 'S'; + my_scsi_cmd.dxfer_direction = (mode == SCSI_IO_READ)?(SG_DXFER_FROM_DEV):(SG_DXFER_TO_DEV); + my_scsi_cmd.cmd_len = cmdlen; + my_scsi_cmd.mx_sb_len = 0; + my_scsi_cmd.dxfer_len = len; + my_scsi_cmd.dxferp = data; + my_scsi_cmd.cmdp = cdb; + my_scsi_cmd.timeout = ~0; /* where is MAX_UINT defined??? */ + +#ifdef DEBUG printf("CMD(%d): %02x%02x%02x%02x%02x%02x %sdevice\n",cmdlen,cdb[0],cdb[1],cdb[2],cdb[3],cdb[4],cdb[5], (mode==SCSI_IO_READ)?("<-"):("->")); printf("DATA : len = %d\n",len); #endif - if (ioctl(fd, SG_IO,&scsi_cmd) < 0) { + if (ioctl(fd, SG_IO,&my_scsi_cmd) < 0) { perror("scsi_io"); return -1; } - return scsi_cmd.status & STATUS_MASK; + return my_scsi_cmd.status & STATUS_MASK; #elif (defined _SCO_DS) && (defined SCSIUSERCMD) struct scsicmd my_scsi_cmd; diff --git a/signal.c b/signal.c index e6a4326..c8533a7 100644 --- a/signal.c +++ b/signal.c @@ -58,3 +58,77 @@ void setup_signal(void) signal(SIGQUIT, signal_handler); #endif } + +#ifdef HAVE_SIGACTION +static void _allow_interrupt(saved_sig_state *ss, int sig, int slot) +{ + struct sigaction new; + + bzero(&new, sizeof(new)); + new.sa_handler = signal_handler; + new.sa_flags &= ~SA_RESTART; + + if(sigaction(sig, &new, &ss->sa[slot]) < 0) { + perror("sigaction"); + exit(1); + } +} +#endif + +/* Allow syscalls to be interrupted by signal */ +void allow_interrupts(saved_sig_state *ss) +{ +#ifdef HAVE_SIGACTION + +# ifdef SIGHUP + _allow_interrupt(ss, SIGINT, 0); +# endif + +# ifdef SIGINT + _allow_interrupt(ss, SIGINT, 1); +# endif + +# ifdef SIGTERM + _allow_interrupt(ss, SIGINT, 2); +# endif + +# ifdef SIGQUIT + _allow_interrupt(ss, SIGINT, 3); +# endif + +#endif +} + +#ifdef HAVE_SIGACTION +static void _restore_interrupt(saved_sig_state *ss, int sig, int slot) +{ + if(sigaction(sig, &ss->sa[slot], NULL) < 0) { + perror("restore sigaction"); + exit(1); + } +} +#endif + +/* Restore syscalls to be interrupted by signal */ +void restore_interrupts(saved_sig_state *ss) +{ +#ifdef HAVE_SIGACTION + +# ifdef SIGHUP + _restore_interrupt(ss, SIGINT, 0); +# endif + +# ifdef SIGINT + _restore_interrupt(ss, SIGINT, 1); +# endif + +# ifdef SIGTERM + _restore_interrupt(ss, SIGINT, 2); +# endif + +# ifdef SIGQUIT + _restore_interrupt(ss, SIGINT, 3); +# endif + +#endif +} diff --git a/sysincludes.h b/sysincludes.h index 2e7577c..2a0e528 100644 --- a/sysincludes.h +++ b/sysincludes.h @@ -86,7 +86,7 @@ ac_cv_func_setpgrp_void=yes ../mtools/configure --build=i386-linux-gnu --host=i3 #endif #endif -#ifdef OS_mingw32msvc +#ifndef HAVE_CADDR_T typedef void *caddr_t; #endif @@ -104,12 +104,15 @@ typedef void *caddr_t; # if __GNUC__ == 2 && __GNUC_MINOR__ > 6 || __GNUC__ >= 3 /* gcc 2.6.3 doesn't have "unused" */ /* mool */ # define UNUSED(x) x __attribute__ ((unused));x +# define UNUSEDP __attribute__ ((unused)) # else # define UNUSED(x) x +# define UNUSEDP /* */ # endif # define NORETURN __attribute__ ((noreturn)) #else # define UNUSED(x) x +# define UNUSEDP /* */ # define PACKED /* */ # define NORETURN /* */ #endif diff --git a/texinfo.tex b/texinfo.tex index fd22fd6..bd18a11 100644 --- a/texinfo.tex +++ b/texinfo.tex @@ -3,11 +3,11 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2011-05-23.16} +\def\texinfoversion{2012-11-08.11} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -% 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -24,13 +24,14 @@ % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without -% restriction. (This has been our intent since Texinfo was invented.) +% restriction. This Exception is an additional permission under section 7 +% of the GNU General Public License, version 3 ("GPLv3"). % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: -% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or -% ftp://tug.org/tex/texinfo.tex -% (and all CTAN mirrors, see http://www.ctan.org). +% http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or +% http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or +% http://www.gnu.org/software/texinfo/ (the Texinfo home page) % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % @@ -116,6 +117,7 @@ % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putworderror\undefined \gdef\putworderror{error}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi @@ -229,6 +231,13 @@ \errorcontextlines16 }% +% @errormsg{MSG}. Do the index-like expansions on MSG, but if things +% aren't perfect, it's not the end of the world, being an error message, +% after all. +% +\def\errormsg{\begingroup \indexnofonts \doerrormsg} +\def\doerrormsg#1{\errmessage{#1}} + % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % @@ -586,7 +595,7 @@ \def\:{\spacefactor=1000 } % @* forces a line break. -\def\*{\hfil\break\hbox{}\ignorespaces} +\def\*{\unskip\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak @@ -879,7 +888,7 @@ where each line of input produces a line of output.} \def\popthisfilestack{\errthisfilestackempty} \def\errthisfilestackempty{\errmessage{Internal error: the stack of filenames is empty.}} - +% \def\thisfile{} % @center line @@ -887,36 +896,46 @@ where each line of input produces a line of output.} % \parseargdef\center{% \ifhmode - \let\next\centerH + \let\centersub\centerH \else - \let\next\centerV + \let\centersub\centerV \fi - \next{\hfil \ignorespaces#1\unskip \hfil}% + \centersub{\hfil \ignorespaces#1\unskip \hfil}% + \let\centersub\relax % don't let the definition persist, just in case } -\def\centerH#1{% - {% - \hfil\break - \advance\hsize by -\leftskip - \advance\hsize by -\rightskip - \line{#1}% - \break - }% +\def\centerH#1{{% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break +}} +% +\newcount\centerpenalty +\def\centerV#1{% + % The idea here is the same as in \startdefun, \cartouche, etc.: if + % @center is the first thing after a section heading, we need to wipe + % out the negative parskip inserted by \sectionheading, but still + % prevent a page break here. + \centerpenalty = \lastpenalty + \ifnum\centerpenalty>10000 \vskip\parskip \fi + \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi + \line{\kern\leftskip #1\kern\rightskip}% } -\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} % @sp n outputs n lines of vertical space - +% \parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment - +% \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} - +% \let\c=\comment % @paragraphindent NCHARS @@ -1089,50 +1108,24 @@ where each line of input produces a line of output.} % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. -% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html -% (and related messages, the final outcome is that it is up to the TeX -% user to double the backslashes and otherwise make the string valid, so -% that's what we do). - -% double active backslashes. -% -{\catcode`\@=0 \catcode`\\=\active - @gdef@activebackslashdouble{% - @catcode`@\=@active - @let\=@doublebackslash} -} - -% To handle parens, we must adopt a different approach, since parens are -% not active characters. hyperref.dtx (which has the same problem as -% us) handles it with this amazing macro to replace tokens, with minor -% changes for Texinfo. It is included here under the GPL by permission -% from the author, Heiko Oberdiek. -% -% #1 is the tokens to replace. -% #2 is the replacement. -% #3 is the control sequence with the string. -% -\def\HyPsdSubst#1#2#3{% - \def\HyPsdReplace##1#1##2\END{% - ##1% - \ifx\\##2\\% - \else - #2% - \HyReturnAfterFi{% - \HyPsdReplace##2\END - }% - \fi - }% - \xdef#3{\expandafter\HyPsdReplace#3#1\END}% -} -\long\def\HyReturnAfterFi#1\fi{\fi#1} - -% #1 is a control sequence in which to do the replacements. -\def\backslashparens#1{% - \xdef#1{#1}% redefine it as its expansion; the definition is simply - % \lastnode when called from \setref -> \pdfmkdest. - \HyPsdSubst{(}{\realbackslash(}{#1}% - \HyPsdSubst{)}{\realbackslash)}{#1}% +% +% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and +% related messages. The final outcome is that it is up to the TeX user +% to double the backslashes and otherwise make the string valid, so +% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to +% do this reliably, so we use it. + +% #1 is a control sequence in which to do the replacements, +% which we \xdef. +\def\txiescapepdf#1{% + \ifx\pdfescapestring\thisisundefined + % No primitive available; should we give a warning or log? + % Many times it won't matter. + \else + % The expandable \pdfescapestring primitive escapes parentheses, + % backslashes, and other special chars. + \xdef#1{\pdfescapestring{#1}}% + \fi } \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images @@ -1191,32 +1184,34 @@ output) for that.)} % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% - \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% - \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % - % pdftex (and the PDF format) support .png, .jpg, .pdf (among - % others). Let's try in that order. + % pdftex (and the PDF format) support .pdf, .png, .jpg (among + % others). Let's try in that order, PDF first since if + % someone has a scalable image, presumably better to use that than a + % bitmap. \let\pdfimgext=\empty \begingroup - \openin 1 #1.png \ifeof 1 - \openin 1 #1.jpg \ifeof 1 - \openin 1 #1.jpeg \ifeof 1 - \openin 1 #1.JPG \ifeof 1 - \openin 1 #1.pdf \ifeof 1 - \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 \errhelp = \nopdfimagehelp \errmessage{Could not find image file #1 for pdf}% - \else \gdef\pdfimgext{PDF}% + \else \gdef\pdfimgext{JPG}% \fi - \else \gdef\pdfimgext{pdf}% + \else \gdef\pdfimgext{jpeg}% \fi - \else \gdef\pdfimgext{JPG}% + \else \gdef\pdfimgext{jpg}% \fi - \else \gdef\pdfimgext{jpeg}% + \else \gdef\pdfimgext{png}% \fi - \else \gdef\pdfimgext{jpg}% + \else \gdef\pdfimgext{PDF}% \fi - \else \gdef\pdfimgext{png}% + \else \gdef\pdfimgext{pdf}% \fi \closein 1 \endgroup @@ -1228,8 +1223,8 @@ output) for that.)} \else \immediate\pdfximage \fi - \ifdim \wd0 >0pt width \imagewidth \fi - \ifdim \wd2 >0pt height \imageheight \fi + \ifdim \wd0 >0pt width \pdfimagewidth \fi + \ifdim \wd2 >0pt height \pdfimageheight \fi \ifnum\pdftexversion<13 #1.\pdfimgext \else @@ -1244,10 +1239,9 @@ output) for that.)} % such as \, aren't expanded when present in a section title. \indexnofonts \turnoffactive - \activebackslashdouble \makevalueexpandable \def\pdfdestname{#1}% - \backslashparens\pdfdestname + \txiescapepdf\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % @@ -1279,28 +1273,22 @@ output) for that.)} % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. - \def\pdfoutlinedest{#3}% + \edef\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \else - % Doubled backslashes in the name. - {\activebackslashdouble \xdef\pdfoutlinedest{#3}% - \backslashparens\pdfoutlinedest}% + \txiescapepdf\pdfoutlinedest \fi % - % Also double the backslashes in the display string. - {\activebackslashdouble \xdef\pdfoutlinetext{#1}% - \backslashparens\pdfoutlinetext}% + % Also escape PDF chars in the display string. + \edef\pdfoutlinetext{#1}% + \txiescapepdf\pdfoutlinetext % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup - % Thanh's hack / proper braces in bookmarks - \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace - \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace - % % Read toc silently, to get counts of subentries for \pdfoutline. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% @@ -1356,25 +1344,41 @@ output) for that.)} % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % - % xx to do this right, we have to translate 8-bit characters to - % their "best" equivalent, based on the @documentencoding. Right - % now, I guess we'll just let the pdf reader have its way. + % TODO this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Too + % much work for too little return. Just use the ASCII equivalents + % we use for the index sort strings. + % \indexnofonts \setupdatafile + % We can have normal brace characters in the PDF outlines, unlike + % Texinfo index files. So set that up. + \def\{{\lbracecharliteral}% + \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } + {\catcode`[=1 \catcode`]=2 + \catcode`{=\other \catcode`}=\other + \gdef\lbracecharliteral[{]% + \gdef\rbracecharliteral[}]% + ] % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces - \ifx\p\space\else\addtokens{\filename}{\PP}% - \advance\filenamelength by 1 - \fi + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 \fi \nextsp} - \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else @@ -1471,9 +1475,6 @@ output) for that.)} \def\ttsl{\setfontstyle{ttsl}} -% Default leading. -\newdimen\textleading \textleading = 13.2pt - % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. @@ -1485,6 +1486,7 @@ output) for that.)} % can get a sort of poor man's double spacing by redefining this. \def\baselinefactor{1} % +\newdimen\textleading \def\setleading#1{% \dimen0 = #1\relax \normalbaselineskip = \baselinefactor\dimen0 @@ -1757,18 +1759,24 @@ end \fi\fi -% Set the font macro #1 to the font named #2, adding on the -% specified font prefix (normally `cm'). +% Set the font macro #1 to the font named \fontprefix#2. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap -% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass -% empty to omit). +% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). +% Example: +% #1 = \textrm +% #2 = \rmshape +% #3 = 10 +% #4 = \mainmagstep +% #5 = OT1 +% \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% } % This is what gets called when #5 of \setfont is empty. \let\cmap\gobble -% emacs-page end of cmaps +% +% (end of cmaps) % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix @@ -1778,7 +1786,7 @@ end \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} -\def\rmbshape{bx} %where the normal face is bold +\def\rmbshape{bx} % where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} @@ -1793,8 +1801,7 @@ end \def\scshape{csc} \def\scbshape{csc} -% Definitions for a main text size of 11pt. This is the default in -% Texinfo. +% Definitions for a main text size of 11pt. (The default in Texinfo.) % \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). @@ -1919,7 +1926,7 @@ end \textleading = 13.2pt % line spacing for 11pt CM \textfonts % reset the current fonts \rm -} % end of 11pt text font size definitions +} % end of 11pt text font size definitions, \definetextfontsizexi % Definitions to make the main text be 10pt Computer Modern, with @@ -2051,7 +2058,7 @@ end \textleading = 12pt % line spacing for 10pt CM \textfonts % reset the current fonts \rm -} % end of 10pt text font size definitions +} % end of 10pt text font size definitions, \definetextfontsizex % We provide the user-level command @@ -2266,8 +2273,6 @@ end \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} - -\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft} } \let\markupsetuplqcode \markupsetcodequoteleft @@ -2276,6 +2281,9 @@ end \let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuprqexample \markupsetcodequoteright % +\let\markupsetuplqkbd \markupsetcodequoteleft +\let\markupsetuprqkbd \markupsetcodequoteright +% \let\markupsetuplqsamp \markupsetcodequoteleft \let\markupsetuprqsamp \markupsetcodequoteright % @@ -2285,8 +2293,6 @@ end \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright -\let\markupsetuplqkbd \markupsetnoligaturesquoteleft - % Allow an option to not use regular directed right quote/apostrophe % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % The undirected quote is ugly, so don't make it the default, but it @@ -2372,19 +2378,26 @@ end \else\ifx\next-% \else\ifx\next.% \else\ptexslash - \fi\fi\fi} + \fi\fi\fi + \aftersmartic +} -% like \smartslanted except unconditionally uses \ttsl, and no ic. -% @var is set to this for defun arguments. +% Unconditional use \ttsl, and no ic. @var is set to this for defuns. \def\ttslanted#1{{\ttsl #1}} % @cite is like \smartslanted except unconditionally use \sl. We never want % ttsl for book titles, do we? \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} +\def\aftersmartic{} +\def\var#1{% + \let\saveaftersmartic = \aftersmartic + \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% + \smartslanted{#1}% +} + \let\i=\smartitalic \let\slanted=\smartslanted -\def\var#1{\smartslanted{#1}} \let\dfn=\smartslanted \let\emph=\smartitalic @@ -2434,34 +2447,12 @@ end % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} -% definition of @key that produces a lozenge. Doesn't adjust to text size. -%\setfont\keyrm\rmshape{8}{1000}{OT1} -%\font\keysy=cmsy9 -%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% -% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% -% \vbox{\hrule\kern-0.4pt -% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% -% \kern-0.4pt\hrule}% -% \kern-.06em\raise0.4pt\hbox{\angleright}}}} - -% definition of @key with no lozenge. If the current font is already -% monospace, don't change it; that way, we respect @kbdinputstyle. But -% if it isn't monospace, then use \tt. -% -\def\key#1{{\setupmarkupstyle{key}% - \nohyphenation - \ifmonospace\else\tt\fi - #1}\null} - -% ctrl is no longer a Texinfo command. -\def\ctrl #1{{\tt \rawbackslash \hat}#1} - -% @file, @option are the same as @samp. -\let\file=\samp -\let\option=\samp +% @indicateurl is \samp, that is, with quotes. +\let\indicateurl=\samp -% @code is a modification of @t, -% which makes spaces the same size as normal in the surrounding text. +% @code (and similar) prints in typewriter, but with spaces the same +% size as normal in the surrounding text, without hyphenation, etc. +% This is a subroutine for that. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. @@ -2480,13 +2471,13 @@ end \plainfrenchspacing #1% }% - \null + \null % reset spacefactor to 1000 } % We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. - +% % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) @@ -2550,6 +2541,13 @@ end \fi\fi } +% For @command, @env, @file, @option quotes seem unnecessary, +% so use \code rather than \samp. +\let\command=\code +\let\env=\code +\let\file=\code +\let\option=\code + % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url @@ -2696,10 +2694,6 @@ end \let\email=\uref \fi -% @kbd is like @code, except that if the argument is just one @key command, -% then @kbd has no effect. -\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} - % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). @@ -2723,16 +2717,36 @@ end % Default is `distinct'. \kbdinputstyle distinct +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. +\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} + \def\xkey{\key} -\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% -\ifx\one\xkey\ifx\threex\three \key{#2}% -\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi -\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} +\def\kbdsub#1#2#3\par{% + \def\one{#1}\def\three{#3}\def\threex{??}% + \ifx\one\xkey\ifx\threex\three \key{#2}% + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +} -% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. -\let\indicateurl=\code -\let\env=\code -\let\command=\code +% definition of @key that produces a lozenge. Doesn't adjust to text size. +%\setfont\keyrm\rmshape{8}{1000}{OT1} +%\font\keysy=cmsy9 +%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% +% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% +% \vbox{\hrule\kern-0.4pt +% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% +% \kern-0.4pt\hrule}% +% \kern-.06em\raise0.4pt\hbox{\angleright}}}} + +% definition of @key with no lozenge. If the current font is already +% monospace, don't change it; that way, we respect @kbdinputstyle. But +% if it isn't monospace, then use \tt. +% +\def\key#1{{\setupmarkupstyle{key}% + \nohyphenation + \ifmonospace\else\tt\fi + #1}\null} % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} @@ -2762,6 +2776,7 @@ end \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi + \null % reset \spacefactor=1000 } % @abbr for "Comput. J." and the like. @@ -2774,6 +2789,7 @@ end \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi + \null % reset \spacefactor=1000 } % @asis just yields its argument. Used with @table, for example. @@ -2838,20 +2854,51 @@ end } } +% ctrl is no longer a Texinfo command, but leave this definition for fun. +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. +% Ignore unless FMTNAME == tex; then it is like @iftex and @tex, +% except specified as a normal braced arg, so no newlines to worry about. +% +\def\outfmtnametex{tex} +% +\long\def\inlinefmt#1{\doinlinefmt #1,\finish} +\long\def\doinlinefmt#1,#2,\finish{% + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi +} +% For raw, must switch into @tex before parsing the argument, to avoid +% setting catcodes prematurely. Doing it this way means that, for +% example, @inlineraw{html, foo{bar} gets a parse error instead of being +% ignored. But this isn't important because if people want a literal +% *right* brace they would have to use a command anyway, so they may as +% well use a command to get a left brace too. We could re-use the +% delimiter character idea from \verb, but it seems like overkill. +% +\long\def\inlineraw{\tex \doinlineraw} +\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} +\def\doinlinerawtwo#1,#2,\finish{% + \def\inlinerawname{#1}% + \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi + \endgroup % close group opened by \tex. +} + \message{glyphs,} % and logos. -% @@ prints an @. +% @@ prints an @, as does @atchar{}. \def\@{\char64 } +\let\atchar=\@ -% Used to generate quoted braces. Unless we're in typewriter, use -% \ecfont because the CM text fonts do not have braces, and we don't -% want to switch into math. +% @{ @} @lbracechar{} @rbracechar{} all generate brace characters. +% Unless we're in typewriter, use \ecfont because the CM text fonts do +% not have braces, and we don't want to switch into math. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} -\let\{=\mylbrace -\let\}=\myrbrace +\let\{=\mylbrace \let\lbracechar=\{ +\let\}=\myrbrace \let\rbracechar=\} \begingroup % Definitions to produce \{ and \} commands for indices, % and @{ and @} for the aux/toc files. @@ -2979,7 +3026,7 @@ end {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) -\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} +\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. @@ -3100,12 +3147,17 @@ end % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% - \ifx\curfontstyle\bfstylename - % bold: - \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \ifmonospace + % typewriter: + \font\thisecfont = ectt\ecsize \space at \nominalsize \else - % regular: - \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi \fi \thisecfont } @@ -3218,6 +3270,20 @@ end \finishedtitlepagetrue } +% Settings used for typesetting titles: no hyphenation, no indentation, +% don't worry much about spacing, ragged right. This should be used +% inside a \vbox, and fonts need to be set appropriately first. Because +% it is always used for titles, nothing else, we call \rmisbold. \par +% should be specified before the end of the \vbox, since a vbox is a group. +% +\def\raggedtitlesettings{% + \rmisbold + \hyphenpenalty=10000 + \parindent=0pt + \tolerance=5000 + \ptexraggedright +} + % Macros to be used within @titlepage: \let\subtitlerm=\tenrm @@ -3225,7 +3291,7 @@ end \parseargdef\title{% \checkenv\titlepage - \leftline{\titlefonts\rmisbold #1} + \vbox{\titlefonts \raggedtitlesettings #1\par}% % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt @@ -3955,13 +4021,13 @@ end % If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace -\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller - %% than skip between lines in the table. +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace -\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller - %% than skip between lines in the table. +\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller + % than skip between lines in the table. \fi} @@ -4162,7 +4228,7 @@ end } \def\ifsetfail{\doignore{ifset}} -% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been +% @ifclear VAR ... @end executes the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % % The `\else' inside the `\doifset' parameter is a trick to reuse the @@ -4173,6 +4239,35 @@ end \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} +% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written +% without the @) is in fact defined. We can only feasibly check at the +% TeX level, so something like `mathcode' is going to considered +% defined even though it is not a Texinfo command. +% +\makecond{ifcommanddefined} +\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} +% +\def\doifcmddefined#1#2{{% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname #2\endcsname\relax + #1% If not defined, \let\next as above. + \fi + \expandafter + }\next +} +\def\ifcmddefinedfail{\doignore{ifcommanddefined}} + +% @ifcommandnotdefined CMD ... handled similar to @ifclear above. +\makecond{ifcommandnotdefined} +\def\ifcommandnotdefined{% + \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} +\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} + +% Set the `txicommandconditionals' variable, so documents have a way to +% test if the @ifcommand...defined conditionals are available. +\set txicommandconditionals + % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory=\comment @@ -4409,6 +4504,7 @@ end \definedummyword\guillemetright \definedummyword\guilsinglleft \definedummyword\guilsinglright + \definedummyword\lbracechar \definedummyword\leq \definedummyword\minus \definedummyword\ogonek @@ -4421,6 +4517,7 @@ end \definedummyword\quoteleft \definedummyword\quoteright \definedummyword\quotesinglbase + \definedummyword\rbracechar \definedummyword\result \definedummyword\textdegree % @@ -4472,7 +4569,9 @@ end \definedummyword\t % % Commands that take arguments. + \definedummyword\abbr \definedummyword\acronym + \definedummyword\anchor \definedummyword\cite \definedummyword\code \definedummyword\command @@ -4482,7 +4581,9 @@ end \definedummyword\emph \definedummyword\env \definedummyword\file + \definedummyword\image \definedummyword\indicateurl + \definedummyword\inforef \definedummyword\kbd \definedummyword\key \definedummyword\math @@ -4529,7 +4630,10 @@ end % content at all. So for index sorting, we map @{ and @} to strings % starting with |, since that ASCII character is between ASCII { and }. \def\{{|a}% + \def\lbracechar{|a}% + % \def\}{|b}% + \def\rbracechar{|b}% % % Non-English letters. \def\AA{AA}% @@ -4705,10 +4809,9 @@ end % % ..., ready, GO: % -\def\safewhatsit#1{% -\ifhmode +\def\safewhatsit#1{\ifhmode #1% -\else + \else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% @@ -4732,7 +4835,6 @@ end % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: - % % @deffn deffn-whatever % @vindex index-whatever % Description. @@ -4745,8 +4847,7 @@ end % (the whatsit from the \write), so we must insert a \nobreak. \nobreak\vskip\whatsitskip \fi -\fi -} +\fi} % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} @@ -5493,14 +5594,6 @@ end % Define @majorheading, @heading and @subheading -% NOTE on use of \vbox for chapter headings, section headings, and such: -% 1) We use \vbox rather than the earlier \line to permit -% overlong headings to fold. -% 2) \hyphenpenalty is set to 10000 because hyphenation in a -% heading is obnoxious; this forbids it. -% 3) Likewise, headings look best if no \parindent is used, and -% if justification is not attempted. Hence \raggedright. - \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz @@ -5508,10 +5601,8 @@ end \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% - {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\ptexraggedright - \rmisbold #1\hfill}}% - \bigskip \par\penalty 200\relax + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip \nobreak \suppressfirstparagraphindent } @@ -5670,8 +5761,7 @@ end % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. - \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright - \hangindent=\wd0 \centerparametersmaybe + \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title @@ -5693,18 +5783,18 @@ end \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} % \def\unnchfopen #1{% -\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt\ptexraggedright - \rmisbold #1\hfill}}\bigskip \par\nobreak + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings #1\par}% + \nobreak\bigskip\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% -\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 - \parindent=0pt - \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak + \chapoddpage + \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% + \nobreak\bigskip \nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen @@ -5849,15 +5939,15 @@ end % % We'll almost certainly start a paragraph next, so don't let that % glue accumulate. (Not a breakpoint because it's preceded by a - % discardable item.) + % discardable item.) However, when a paragraph is not started next + % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out + % or the negative glue will cause weirdly wrong output, typically + % obscuring the section heading with something else. \vskip-\parskip % - % This is purely so the last item on the list is a known \penalty > - % 10000. This is so \startdefun can avoid allowing breakpoints after - % section headings. Otherwise, it would insert a valid breakpoint between: - % - % @section sec-whatever - % @deffn def-whatever + % This is so the last item on the main vertical list is a known + % \penalty > 10000, so \startdefun, etc., can recognize the situation + % and do the needful. \penalty 10001 } @@ -6273,6 +6363,12 @@ end \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing = t% + % + % If this cartouche directly follows a sectioning command, we need the + % \parskip glue (backspaced over by default) or the cartouche can + % collide with the section heading. + \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi + % \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop @@ -6286,7 +6382,7 @@ end \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip - \comment % For explanation, see the end of \def\group. + \comment % For explanation, see the end of def\group. } \def\Ecartouche{% \ifhmode\par\fi @@ -6464,16 +6560,9 @@ end \makedispenvdef{quotation}{\quotationstart} % \def\quotationstart{% - {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip - \parindent=0pt - % - % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \indentedblockstart % same as \indentedblock, but increase right margin too. \ifx\nonarrowing\relax - \advance\leftskip by \lispnarrowing \advance\rightskip by \lispnarrowing - \exdentamount = \lispnarrowing - \else - \let\nonarrowing = \relax \fi \parsearg\quotationlabel } @@ -6499,6 +6588,32 @@ end \fi } +% @indentedblock is like @quotation, but indents only on the left and +% has no optional argument. +% +\makedispenvdef{indentedblock}{\indentedblockstart} +% +\def\indentedblockstart{% + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \parindent=0pt + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \exdentamount = \lispnarrowing + \else + \let\nonarrowing = \relax + \fi +} + +% Keep a nonzero parskip for the environment, since we're doing normal filling. +% +\def\Eindentedblock{% + \par + {\parskip=0pt \afterenvbreak}% +} +\def\Esmallindentedblock{\Eindentedblock} + % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, @@ -6977,7 +7092,10 @@ end \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we - % want a way to get ttsl. Let's try @var for that. + % want a way to get ttsl. We used to recommend @var for that, so + % leave the code in, but it's strange for @var to lead to typewriter. + % Nowadays we recommend @code, since the difference between a ttsl hyphen + % and a tt hyphen is pretty tiny. @code also disables ?` !`. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 @@ -7242,9 +7360,15 @@ end \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments - \paramno=0 + \paramno=0\relax \else \expandafter\parsemargdef \argl;% + \if\paramno>256\relax + \ifx\eTeXversion\thisisundefined + \errhelp = \EMsimple + \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} + \fi + \fi \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% @@ -7294,9 +7418,17 @@ end \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} +% For macro processing make @ a letter so that we can make Texinfo private macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + % Parse the optional {params} list. Set up \paramno and \paramlist -% so \defmacro knows what to do. Define \macarg.blah for each blah -% in the params list to be ##N where N is the position in that list. +% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH +% in the params list to some hook where the argument si to be expanded. If +% there are less than 10 arguments that hook is to be replaced by ##N where N +% is the position in that list, that is to say the macro arguments are to be +% defined `a la TeX in the macro body. +% % That gets used by \mbodybackslash (above). % % We need to get `macro parameter char #' into several definitions. @@ -7306,12 +7438,33 @@ end % % The same technique is used to protect \eatspaces till just before % the macro is used. - +% +% If there are 10 or more arguments, a different technique is used, where the +% hook remains in the body, and when macro is to be expanded the body is +% processed again to replace the arguments. +% +% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the +% argument N value and then \edef the body (nothing else will expand because of +% the catcode regime underwhich the body was input). +% +% If you compile with TeX (not eTeX), and you have macros with 10 or more +% arguments, you need that no macro has more than 256 arguments, otherwise an +% error is produced. \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax \let\xeatspaces\relax \parsemargdefxxx#1,;,% + % In case that there are 10 or more arguments we parse again the arguments + % list to set new definitions for the \macarg.BLAH macros corresponding to + % each BLAH argument. It was anyhow needed to parse already once this list + % in order to count the arguments, and as macros with at most 9 arguments + % are by far more frequent than macro with 10 or more arguments, defining + % twice the \macarg.BLAH macros does not cost too much processing power. + \ifnum\paramno<10\relax\else + \paramno0\relax + \parsemmanyargdef@@#1,;,% 10 or more arguments + \fi } \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax @@ -7322,16 +7475,205 @@ end \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} +\def\parsemmanyargdef@@#1,{% + \if#1;\let\next=\relax + \else + \let\next=\parsemmanyargdef@@ + \edef\tempb{\eatspaces{#1}}% + \expandafter\def\expandafter\tempa + \expandafter{\csname macarg.\tempb\endcsname}% + % Note that we need some extra \noexpand\noexpand, this is because we + % don't want \the to be expanded in the \parsermacbody as it uses an + % \xdef . + \expandafter\edef\tempa + {\noexpand\noexpand\noexpand\the\toks\the\paramno}% + \advance\paramno by 1\relax + \fi\next} + % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) % + +\catcode `\@\texiatcatcode \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\catcode `\@=11\relax + +\let\endargs@\relax +\let\nil@\relax +\def\nilm@{\nil@}% +\long\def\nillm@{\nil@}% + +% This macro is expanded during the Texinfo macro expansion, not during its +% definition. It gets all the arguments values and assigns them to macros +% macarg.ARGNAME +% +% #1 is the macro name +% #2 is the list of argument names +% #3 is the list of argument values +\def\getargvals@#1#2#3{% + \def\macargdeflist@{}% + \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. + \def\paramlist{#2,\nil@}% + \def\macroname{#1}% + \begingroup + \macroargctxt + \def\argvaluelist{#3,\nil@}% + \def\@tempa{#3}% + \ifx\@tempa\empty + \setemptyargvalues@ + \else + \getargvals@@ + \fi +} + +% +\def\getargvals@@{% + \ifx\paramlist\nilm@ + % Some sanity check needed here that \argvaluelist is also empty. + \ifx\argvaluelist\nillm@ + \else + \errhelp = \EMsimple + \errmessage{Too many arguments in macro `\macroname'!}% + \fi + \let\next\macargexpandinbody@ + \else + \ifx\argvaluelist\nillm@ + % No more arguments values passed to macro. Set remaining named-arg + % macros to empty. + \let\next\setemptyargvalues@ + \else + % pop current arg name into \@tempb + \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% + \expandafter\@tempa\expandafter{\paramlist}% + % pop current argument value into \@tempc + \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% + \expandafter\@tempa\expandafter{\argvaluelist}% + % Here \@tempb is the current arg name and \@tempc is the current arg value. + % First place the new argument macro definition into \@tempd + \expandafter\macname\expandafter{\@tempc}% + \expandafter\let\csname macarg.\@tempb\endcsname\relax + \expandafter\def\expandafter\@tempe\expandafter{% + \csname macarg.\@tempb\endcsname}% + \edef\@tempd{\long\def\@tempe{\the\macname}}% + \push@\@tempd\macargdeflist@ + \let\next\getargvals@@ + \fi + \fi + \next +} + +\def\push@#1#2{% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter#2% + \expandafter\expandafter\expandafter{% + \expandafter#1#2}% +} + +% Replace arguments by their values in the macro body, and place the result +% in macro \@tempa +\def\macvalstoargs@{% + % To do this we use the property that token registers that are \the'ed + % within an \edef expand only once. So we are going to place all argument + % values into respective token registers. + % + % First we save the token context, and initialize argument numbering. + \begingroup + \paramno0\relax + % Then, for each argument number #N, we place the corresponding argument + % value into a new token list register \toks#N + \expandafter\putargsintokens@\saveparamlist@,;,% + % Then, we expand the body so that argument are replaced by their + % values. The trick for values not to be expanded themselves is that they + % are within tokens and that tokens expand only once in an \edef . + \edef\@tempc{\csname mac.\macroname .body\endcsname}% + % Now we restore the token stack pointer to free the token list registers + % which we have used, but we make sure that expanded body is saved after + % group. + \expandafter + \endgroup + \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% + } -% This defines the macro itself. There are six cases: recursive and -% nonrecursive macros of zero, one, and many arguments. +\def\macargexpandinbody@{% + %% Define the named-macro outside of this group and then close this group. + \expandafter + \endgroup + \macargdeflist@ + % First the replace in body the macro arguments by their values, the result + % is in \@tempa . + \macvalstoargs@ + % Then we point at the \norecurse or \gobble (for recursive) macro value + % with \@tempb . + \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname + % Depending on whether it is recursive or not, we need some tailing + % \egroup . + \ifx\@tempb\gobble + \let\@tempc\relax + \else + \let\@tempc\egroup + \fi + % And now we do the real job: + \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% + \@tempd +} + +\def\putargsintokens@#1,{% + \if#1;\let\next\relax + \else + \let\next\putargsintokens@ + % First we allocate the new token list register, and give it a temporary + % alias \@tempb . + \toksdef\@tempb\the\paramno + % Then we place the argument value into that token list register. + \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname + \expandafter\@tempb\expandafter{\@tempa}% + \advance\paramno by 1\relax + \fi + \next +} + +% Save the token stack pointer into macro #1 +\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} +% Restore the token stack pointer from number in macro #1 +\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} +% newtoks that can be used non \outer . +\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} + +% Tailing missing arguments are set to empty +\def\setemptyargvalues@{% + \ifx\paramlist\nilm@ + \let\next\macargexpandinbody@ + \else + \expandafter\setemptyargvaluesparser@\paramlist\endargs@ + \let\next\setemptyargvalues@ + \fi + \next +} + +\def\setemptyargvaluesparser@#1,#2\endargs@{% + \expandafter\def\expandafter\@tempa\expandafter{% + \expandafter\def\csname macarg.#1\endcsname{}}% + \push@\@tempa\macargdeflist@ + \def\paramlist{#2}% +} + +% #1 is the element target macro +% #2 is the list macro +% #3,#4\endargs@ is the list value +\def\pop@#1#2#3,#4\endargs@{% + \def#1{#3}% + \def#2{#4}% +} +\long\def\longpop@#1#2#3,#4\endargs@{% + \long\def#1{#3}% + \long\def#2{#4}% +} + +% This defines a Texinfo @macro. There are eight cases: recursive and +% nonrecursive macros of zero, one, up to nine, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. @@ -7350,17 +7692,25 @@ end \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% - \else % many - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\csname\the\macname xx\endcsname}% - \expandafter\xdef\csname\the\macname xx\endcsname##1{% - \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \else + \ifnum\paramno<10\relax % at most 9 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \else % 10 or more + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble + \fi \fi \else \ifcase\paramno @@ -7377,23 +7727,33 @@ end \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% - \else % many - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \expandafter\noexpand\csname\the\macname xx\endcsname}% - \expandafter\xdef\csname\the\macname xx\endcsname##1{% - \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{% - \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% + \else % at most 9 + \ifnum\paramno<10\relax + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % 10 or more: + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse + \fi \fi \fi} +\catcode `\@\texiatcatcode\relax + \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a @@ -7519,7 +7879,7 @@ end \fi\fi } - +% % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed @@ -7528,26 +7888,41 @@ end \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} +% +\newbox\toprefbox +\newbox\printedrefnamebox +\newbox\infofilenamebox +\newbox\printedmanualbox +% \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces - \def\printedmanual{\ignorespaces #5}% + % + % Get args without leading/trailing spaces. \def\printedrefname{\ignorespaces #3}% - \setbox1=\hbox{\printedmanual\unskip}% - \setbox0=\hbox{\printedrefname\unskip}% - \ifdim \wd0 = 0pt + \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% + % + \def\infofilename{\ignorespaces #4}% + \setbox\infofilenamebox = \hbox{\infofilename\unskip}% + % + \def\printedmanual{\ignorespaces #5}% + \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% + % + % If the printed reference name (arg #3) was not explicitly given in + % the @xref, figure out what we want to use. + \ifdim \wd\printedrefnamebox = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax - % Use the node name inside the square brackets. + % Not auto section-title: use node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else - % Use the actual chapter/section title appear inside - % the square brackets. Use the real section title if we have it. - \ifdim \wd1 > 0pt - % It is in another manual, so we don't have it. + % Auto section-title: use chapter/section title inside + % the square brackets if we have it. + \ifdim \wd\printedmanualbox > 0pt + % It is in another manual, so we don't have it; use node name. \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs - % We know the real title if we have the xref values. + % We (should) know the real title if we have the xref values. \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. @@ -7561,13 +7936,20 @@ end \ifpdf {\indexnofonts \turnoffactive + \makevalueexpandable % This expands tokens, so do it after making catcode changes, so _ - % etc. don't get their TeX definitions. + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. \getfilename{#4}% % - % See comments at \activebackslashdouble. - {\activebackslashdouble \xdef\pdfxrefdest{#1}% - \backslashparens\pdfxrefdest}% + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \edef\pdfxrefdest{#1}% + \ifx\pdfxrefdest\empty + \def\pdfxrefdest{Top}% no empty targets + \else + \txiescapepdf\pdfxrefdest % escape PDF special chars + \fi % \leavevmode \startlink attr{/Border [0 0 0]}% @@ -7594,29 +7976,42 @@ end \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". - \ifdim\wd0 = 0pt + \ifdim\wd\printedrefnamebox = 0pt \refx{#1-snt}{}% \else \printedrefname \fi % - % if the user also gave the printed manual name (fifth arg), append + % If the user also gave the printed manual name (fifth arg), append % "in MANUALNAME". - \ifdim \wd1 > 0pt + \ifdim \wd\printedmanualbox > 0pt \space \putwordin{} \cite{\printedmanual}% \fi \else % node/anchor (non-float) references. + % + % If we use \unhbox to print the node names, TeX does not insert + % empty discretionaries after hyphens, which means that it will not + % find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, + % this is a loss. Therefore, we give the text of the node name + % again, so it is as if TeX is seeing it for the first time. + % + \ifdim \wd\printedmanualbox > 0pt + % Cross-manual reference with a printed manual name. + % + \crossmanualxref{\cite{\printedmanual\unskip}}% + % + \else\ifdim \wd\infofilenamebox > 0pt + % Cross-manual reference with only an info filename (arg 4), no + % printed manual name (arg 5). This is essentially the same as + % the case above; we output the filename, since we have nothing else. + % + \crossmanualxref{\code{\infofilename\unskip}}% % - % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not - % insert empty discretionaries after hyphens, which means that it will - % not find a line break at a hyphen in a node names. Since some manuals - % are best written with fairly long node names, containing hyphens, this - % is a loss. Therefore, we give the text of the node name again, so it - % is as if TeX is seeing it for the first time. - \ifdim \wd1 > 0pt - \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% \else + % Reference within this manual. + % % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of @@ -7628,7 +8023,7 @@ end \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% - % output the `[mynode]' via a macro so it can be overridden. + % output the `[mynode]' via the macro below so it can be overridden. \xrefprintnodename\printedrefname % % But we always want a comma and a space: @@ -7636,11 +8031,37 @@ end % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% - \fi + \fi\fi \fi \endlink \endgroup} +% Output a cross-manual xref to #1. Used just above (twice). +% +% Only include the text "Section ``foo'' in" if the foo is neither +% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply +% "see The Foo Manual", the idea being to refer to the whole manual. +% +% But, this being TeX, we can't easily compare our node name against the +% string "Top" while ignoring the possible spaces before and after in +% the input. By adding the arbitrary 7sp below, we make it much less +% likely that a real node name would have the same width as "Top" (e.g., +% in a monospaced font). Hopefully it will never happen in practice. +% +% For the same basic reason, we retypeset the "Top" at every +% reference, since the current font is indeterminate. +% +\def\crossmanualxref#1{% + \setbox\toprefbox = \hbox{Top\kern7sp}% + \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% + \ifdim \wd2 > 7sp % nonempty? + \ifdim \wd2 = \wd\toprefbox \else % same as Top? + \putwordSection{} ``\printedrefname'' \putwordin{}\space + \fi + \fi + #1% +} + % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, % since square brackets don't work well in some documents. Particularly @@ -7856,7 +8277,7 @@ end % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } -% @footnotestyle is meaningful for info output only. +% @footnotestyle is meaningful for Info output only. \let\footnotestyle=\comment {\catcode `\@=11 @@ -7919,6 +8340,8 @@ end % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut + % + % Invoke rest of plain TeX footnote routine. \futurelet\next\fo@t } }%end \catcode `\@=11 @@ -8006,7 +8429,7 @@ end it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% - \ifx\epsfbox\thisiundefined + \ifx\epsfbox\thisisundefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% @@ -8030,6 +8453,13 @@ end % If the image is by itself, center it. \ifvmode \imagevmodetrue + \else \ifx\centersub\centerV + % for @center @image, we need a vbox so we can have our vertical space + \imagevmodetrue + \vbox\bgroup % vbox has better behavior than vtop herev + \fi\fi + % + \ifimagevmode \nobreak\medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space @@ -8039,9 +8469,13 @@ end \fi % % Leave vertical mode so that indentation from an enclosing - % environment such as @quotation is respected. On the other hand, if - % it's at the top level, we don't want the normal paragraph indentation. - \noindent + % environment such as @quotation is respected. + % However, if we're at the top level, we don't want the + % normal paragraph indentation. + % On the other hand, if we are in the case of @center @image, we don't + % want to start a paragraph, which will create a hsize-width box and + % eradicate the centering. + \ifx\centersub\centerV\else \noindent \fi % % Output the image. \ifpdf @@ -8053,7 +8487,10 @@ end \epsfbox{#1.eps}% \fi % - \ifimagevmode \medskip \fi % space after the standalone image + \ifimagevmode + \medskip % space after a standalone image + \fi + \ifx\centersub\centerV \egroup \fi \endgroup} @@ -9534,14 +9971,24 @@ directory should work if nowhere else does.} % In texinfo, backslash is an active character; it prints the backslash % in fixed width font. -\catcode`\\=\active -@def@normalbackslash{{@tt@backslashcurfont}} +\catcode`\\=\active % @ for escape char from now on. + +% The story here is that in math mode, the \char of \backslashcurfont +% ends up printing the roman \ from the math symbol font (because \char +% in math mode uses the \mathcode, and plain.tex sets +% \mathcode`\\="026E). It seems better for @backslashchar{} to always +% print a typewriter backslash, hence we use an explicit \mathchar, +% which is the decimal equivalent of "715c (class 7, e.g., use \fam; +% ignored family value; char position "5C). We can't use " for the +% usual hex value because it has already been made active. +@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. + % On startup, @fixbackslash assigns: % @let \ = @normalbackslash - % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with -% catcode other. +% catcode other. We switch back and forth between these. @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} @@ -9597,10 +10044,13 @@ directory should work if nowhere else does.} @def@normalslash{/} % These look ok in all fonts, so just make them not special. +% @hashchar{} gets its own user-level command, because of #line. @catcode`@& = @other @def@normalamp{&} @catcode`@# = @other @def@normalhash{#} @catcode`@% = @other @def@normalpercent{%} +@let @hashchar = @normalhash + @c Finally, make ` and ' active, so that txicodequoteundirected and @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we @c don't make ` and ' active, @code will not get them as active chars. diff --git a/unixdir.c b/unixdir.c index ea16caa..80253ea 100644 --- a/unixdir.c +++ b/unixdir.c @@ -132,7 +132,7 @@ int unix_dir_loop(Stream_t *Stream, MainParam_t *mp) return ret; } -Stream_t *OpenDir(Stream_t *Stream, const char *filename) +Stream_t *OpenDir(const char *filename) { Dir_t *This; diff --git a/version.texi b/version.texi index b1cd79b..97eb7cc 100644 --- a/version.texi +++ b/version.texi @@ -1,3 +1,3 @@ -@set EDITION 4.0.17 -@set VERSION 4.0.17 -@set UPDATED June 2011 +@set EDITION 4.0.18 +@set VERSION 4.0.18 +@set UPDATED January 2013 diff --git a/vfat.c b/vfat.c index 38076ca..0406a74 100644 --- a/vfat.c +++ b/vfat.c @@ -606,7 +606,6 @@ int vfat_lookup(direntry_t *direntry, const char *filename, int length, dirCache_t *cache; int io_error; wchar_t wfilename[MAX_VNAMELEN+1]; - wchar_t *wfilenamep = wfilename; doscp_t *cp = GET_DOSCONVERT(direntry->Dir); if(length == -1 && filename) @@ -615,10 +614,8 @@ int vfat_lookup(direntry_t *direntry, const char *filename, int length, if(filename != NULL) length = native_to_wchar(filename, wfilename, MAX_VNAMELEN, filename+length, 0); - else { - wfilenamep = NULL; + else length = 0; - } if (direntry->entry == -2) return -1; -- 2.7.4