install: all
[ -d $(MANDIR)/man1 ] || $(INSTALL) -m 755 -d $(MANDIR)/man1
[ -d $(MANDIR)/man5 ] || $(INSTALL) -m 755 -d $(MANDIR)/man5
+ [ -d $(BINDIR) ] || $(INSTALL) -m 755 -d $(BINDIR)
$(INSTALL) -s -m 755 cpmls $(BINDIR)/cpmls
$(INSTALL) -s -m 755 cpmcp $(BINDIR)/cpmcp
$(INSTALL) -s -m 755 cpmrm $(BINDIR)/cpmrm
$(INSTALL) -s -m 755 cpmchattr $(BINDIR)/cpmchattr
$(INSTALL) -s -m 755 mkfs.cpm $(BINDIR)/mkfs.cpm
$(INSTALL) -s -m 755 fsck.cpm $(BINDIR)/fsck.cpm
- [ "$(FSED_CPM)" != '' ] && $(INSTALL) -s -m 755 fsed.cpm $(BINDIR)/fsed.cpm
+ [ "$(FSED_CPM)" == '' ] || $(INSTALL) -s -m 755 fsed.cpm $(BINDIR)/fsed.cpm
$(INSTALL_DATA) diskdefs @datarootdir@/diskdefs
$(INSTALL_DATA) cpmls.1 $(MANDIR)/man1/cpmls.1
$(INSTALL_DATA) cpmcp.1 $(MANDIR)/man1/cpmcp.1
-Changes since 2.16:
+Changes since 2.19:
-o Improved filesystem documentation
-o Many new diskdefs
-o device_win32.c fixed by Bill Buckels
+o Fixed bug in cpmfs leading to wrongly allocated blocks
#! /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, 2009, 2010
-# Free Software Foundation, Inc.
+# Copyright 1992-2013 Free Software Foundation, Inc.
-timestamp='2010-08-21'
+timestamp='2013-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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner. Please send patches (context
-# diff format) to <config-patches@gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
+# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
me=`echo "$0" | sed -e 's,.*/,,'`
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
-Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
exit 1
fi
-trap 'exit 1' HUP INT TERM
+trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ ;;
+esac
+
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
fi
;;
*)
- os=netbsd
+ os=netbsd
;;
esac
# The OS release
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
+ echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
+ esac ;;
+ esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ sed 's/^ //' << EOF >$dummy.c
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
+ aarch64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
+ esac
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}
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
- echo cris-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
- echo frv-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ hexagon:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
- LIBC=gnu
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
+ or1k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
or32:Linux:*:*)
- echo or32-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-gnu
+ echo sparc-unknown-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ echo hppa64-unknown-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
+ echo powerpc64-unknown-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-tilera-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
+ # Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
fi
exit ;;
i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
exit ;;
pc:*:*:*)
# Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
- exit ;;
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
+ /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 \
echo ns32k-sni-sysv
fi
exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv${UNAME_RELEASE}
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- i386)
- eval $set_cc_for_build
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- UNAME_PROCESSOR="x86_64"
- fi
- fi ;;
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
+ NEO-?:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
+ x86_64:VMkernel:*:*)
+ echo ${UNAME_MACHINE}-unknown-esx
+ exit ;;
esac
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
+ ); exit (0);
#endif
#endif
#define HAVE_SYS_TYPES_H 0
#define HAVE_SYS_STAT_H 0
#define HAVE_MODE_T 0
+#define NEED_NCURSES 0
+#define HAVE_NCURSES_NCURSES_H 0
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#! /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, 2009, 2010
-# Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+# 2011, 2012 Free Software Foundation, Inc.
-timestamp='2010-09-11'
+timestamp='2012-04-18'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
-Software Foundation, Inc.
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
os=
basic_machine=$1
;;
- -bluegene*)
- os=-cnk
+ -bluegene*)
+ os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
os=-chorusos
basic_machine=$1
;;
- -chorusrdb)
- os=-chorusrdb
+ -chorusrdb)
+ os=-chorusrdb
basic_machine=$1
- ;;
+ ;;
-hiux*)
os=-hiuxwe2
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
-lynx*)
os=-lynxos
;;
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
+ | aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
+ | epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | mcore | mep | metag \
| nds32 | nds32le | nds32be \
| nios | nios2 \
| ns16k | ns32k \
+ | open8 \
| or32 \
| pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
- | rx \
+ | rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
- | v850 | v850e \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
- m6811 | m68hc11 | m6812 | m68hc12 | picochip)
- # Motorola 68HC11/12.
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
basic_machine=mt-unknown
;;
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
+ | aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| clipper-* | craynv-* | cydra-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
- | romp-* | rs6000-* | rx-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile-* | tilegx-* \
+ | tile*-* \
| tron-* \
| ubicom32-* \
- | v850-* | v850e-* | vax-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
basic_machine=a29k-amd
os=-udi
;;
- abacus)
+ abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=c90-cray
os=-unicos
;;
- cegcc)
+ cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
basic_machine=craynv-cray
os=-unicosmp
;;
- cr16)
+ cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
basic_machine=ns32k-utek
os=-sysv
;;
- microblaze)
+ microblaze)
basic_machine=microblaze-xilinx
;;
mingw32)
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
+ msys)
+ basic_machine=i386-pc
+ os=-msys
+ ;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
np1)
basic_machine=np1-gould
;;
- neo-tandem)
+ neo-tandem)
basic_machine=neo-tandem
;;
- nse-tandem)
+ nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
;;
power) basic_machine=power-ibm
;;
- ppc) basic_machine=powerpc-unknown
+ ppc | ppcbe) basic_machine=powerpc-unknown
;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
basic_machine=i860-stratus
os=-sysv4
;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
sun2)
basic_machine=m68000-sun
;;
basic_machine=t90-cray
os=-unicos
;;
- # This must be matched before tile*.
- tilegx*)
- basic_machine=tilegx-unknown
- os=-linux-gnu
- ;;
tile*)
- basic_machine=tile-unknown
+ basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
xps | xps100)
basic_machine=xps100-honeywell
;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ;;
ymp)
basic_machine=ymp-cray
os=-unicos
if [ x"$os" != x"" ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
+ # First match some system type aliases
+ # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
+ -auroraux)
+ os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
-opened*)
os=-openedition
;;
- -os400*)
+ -os400*)
os=-os400
;;
-wince*)
-sinix*)
os=-sysv4
;;
- -tpf*)
+ -tpf*)
os=-tpf
;;
-triton*)
-dicos*)
os=-dicos
;;
- -nacl*)
- ;;
+ -nacl*)
+ ;;
-none)
;;
*)
# system, and we'll never get to this point.
case $basic_machine in
- score-*)
+ score-*)
os=-elf
;;
- spu-*)
+ spu-*)
os=-elf
;;
*-acorn)
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
+ c4x-* | tic4x-*)
+ os=-coff
;;
tic54x-*)
os=-coff
;;
m68000-sun)
os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
;;
m68*-cisco)
os=-aout
;;
- mep-*)
+ mep-*)
os=-elf
;;
mips*-cisco)
*-ibm)
os=-aix
;;
- *-knuth)
+ *-knuth)
os=-mmixware
;;
*-wec)
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68.
+# Generated by GNU Autoconf 2.69.
#
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
else
exitcode=1; echo positional parameters were not saved.
fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
if test "x$CONFIG_SHELL" != x; then :
- # 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
- 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+"$@"}
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
if test x$as_have_required = xno; then :
} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
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
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
if $ac_init_version; then
cat <<\_ACEOF
configure
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.69
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
+ test -x conftest$ac_exeext
}; then :
ac_retval=0
else
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-VERSION=2.17
-UPDATED='November 16, 2013'
+VERSION=2.20
+UPDATED='October 25, 2014'
DEVICE="posix"
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
if test "$GCC" = yes
then
- CFLAGS="${CFLAGS} ${EXTRA_GCFLAGS}-pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common"
+ CFLAGS="${CFLAGS} ${EXTRA_GCFLAGS}-pipe -Wall -Wextra -Wno-unused-parameter -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common"
LDFLAGS="${LDFLAGS} ${EXTRA_GLDFLAGS}-g"
else
CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
FSED_CPM=
fi
-fi
-
-if test "$LIBDSK" != ""; then
- DEVICE="libdsk"
- CPPFLAGS="$CPPFLAGS -I$LIBDSK/include"
- CFLAGS="$CFLAGS -I$LIBDSK/include $CFLAGS_LIBDSK"
- LDFLAGS="$LDFLAGS -L$LIBDSK/lib"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dsk_open in -ldsk" >&5
-$as_echo_n "checking for dsk_open in -ldsk... " >&6; }
-if ${ac_cv_lib_dsk_dsk_open+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldsk $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dsk_open ();
-int
-main ()
-{
-return dsk_open ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dsk_dsk_open=yes
-else
- ac_cv_lib_dsk_dsk_open=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dsk_dsk_open" >&5
-$as_echo "$ac_cv_lib_dsk_dsk_open" >&6; }
-if test "x$ac_cv_lib_dsk_dsk_open" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDSK 1
-_ACEOF
-
- LIBS="-ldsk $LIBS"
-
-fi
+ if test x"$FSED_CPM" != x""; then
+ $as_echo "#define NEED_NCURSES 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+ as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+ as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
done
-for ac_header in libdsk.h
+for ac_header in ncurses/ncurses.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "ncurses/ncurses.h" "ac_cv_header_ncurses_ncurses_h" "$ac_includes_default"
+if test "x$ac_cv_header_ncurses_ncurses_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_NCURSES_NCURSES_H 1
+_ACEOF
+ have_ncurses_ncurses_h=yes
+fi
+
+done
+
+ fi
+fi
+
+if test "$LIBDSK" != ""; then
+ DEVICE="libdsk"
+ CPPFLAGS="$CPPFLAGS -I$LIBDSK/include"
+ CFLAGS="$CFLAGS -I$LIBDSK/include $CFLAGS_LIBDSK"
+ LDFLAGS="$LDFLAGS -L$LIBDSK/lib"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dsk_open in -ldsk" >&5
+$as_echo_n "checking for dsk_open in -ldsk... " >&6; }
+if ${ac_cv_lib_dsk_dsk_open+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldsk $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dsk_open ();
+int
+main ()
+{
+return dsk_open ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dsk_dsk_open=yes
+else
+ ac_cv_lib_dsk_dsk_open=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dsk_dsk_open" >&5
+$as_echo "$ac_cv_lib_dsk_dsk_open" >&6; }
+if test "x$ac_cv_lib_dsk_dsk_open" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDSK 1
+_ACEOF
+
+ LIBS="-ldsk $LIBS"
+
+fi
+
+ for ac_header in libdsk.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "libdsk.h" "ac_cv_header_libdsk_h" "$ac_includes_default"
if test "x$ac_cv_header_libdsk_h" = xyes; then :
int
main ()
{
-/* FIXME: Include the comments suggested by Paul. */
+
#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
+ /* Ultrix mips cc rejects this sort of thing. */
typedef int charset[2];
- const charset cs;
+ const charset cs = { 0, 0 };
/* SunOS 4.1.1 cc rejects this. */
char const *const *pcpcc;
char **ppc;
++pcpcc;
ppc = (char**) pcpcc;
pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
+ { /* SCO 3.2v4 cc rejects this sort of thing. */
+ char tx;
+ char *t = &tx;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
iptr p = 0;
++p;
}
- { /* AIX XL C 1.02.0.0 rejects this saying
+ { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
esac
rm -rf conftest*
fi
+
+
fi
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# values after options handling.
ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
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.68,
+configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
AC_INIT(cpmfs.c)
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
-VERSION=2.17
-UPDATED='November 16, 2013'
+VERSION=2.20
+UPDATED='October 25, 2014'
DEVICE="posix"
if test "$GCC" = yes
then
- CFLAGS="${CFLAGS} ${EXTRA_GCFLAGS}-pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common"
+ CFLAGS="${CFLAGS} ${EXTRA_GCFLAGS}-pipe -Wall -Wextra -Wno-unused-parameter -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common"
LDFLAGS="${LDFLAGS} ${EXTRA_GLDFLAGS}-g"
else
CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
AC_CHECK_LIB(curses, printw, FSED_CPM=fsed.cpm LIBS="-lcurses $LIBS", FSED_CPM=)
if test x"$FSED_CPM" = x""; then
AC_CHECK_LIB(ncurses, printw, FSED_CPM=fsed.cpm LIBS="-lncurses $LIBS", FSED_CPM=)
+ if test x"$FSED_CPM" != x""; then
+ AC_DEFINE(NEED_NCURSES)
+ AC_CHECK_HEADERS(ncurses/ncurses.h,have_ncurses_ncurses_h=yes)
+ fi
fi
dnl If using libdsk, check it's available.
.\" Believe it or not, reportedly there are nroffs which do not know \(en
.if n .ds en -
.if t .ds en \(en
-.TH CPM 5 "November 16, 2013" "CP/M tools" "File formats"
+.TH CPM 5 "October 25, 2014" "CP/M tools" "File formats"
.SH NAME \"{{{roff}}}\"{{{
cpm \- CP/M disk and file system format
.\"}}}
.br
Number of reserved system tracks (optional)
.br
-Offset to start of volume (optional)
+Offset to start of volume (optional and not covered by operating system,
+but disk driver specific)
.sp
.RE
A block is the smallest allocatable storage unit. CP/M supports block
are stored with the given software skew.
.\"}}}
.SS "Device areas" \"{{{
-A CP/M disk contains three areas:
+A CP/M disk contains four areas:
.RS
.sp
-Volume offset (optional)
+Volume offset (optional and not covered by operating system, but disk driver specific)
.br
System tracks (optional)
.br
.LP
A hard disk can have the additional notion of a \fIvolume offset\fP to
locate the start of the drive image (which may or may not have system
-tracks associated with it). The base unit for volume offset is byte
+tracks associated with it). The base unit for volume offset is byte
count from the beginning of the physical disk, but specifiers of
\fIK\fP, \fIM\fP, \fIT\fP or \fIS\fP may be appended to denote
kilobytes, megabytes, tracks or sectors. If provided, a specifier
must immediately follow the numeric value with no whitespace. For
convenience upper and lower case are both accepted and only the first
letter is significant, thus 2KB, 8MB, 1000trk and 16sec are valid
-values. Offset must appear subsequent to track, sector and sector
-length values.
+values. The \fBoffset\fP must appear subsequent to track, sector and sector
+length values for the sector and track units to work.
.\"}}}
.SS "Directory entries" \"{{{
The directory is a sequence of directory entries (also called extents),
1 byte minute in BCD format
.sp
.RE
+All time stamps are stored in local time.
.\"}}}
.SS "DateStamper time stamps" \"{{{
The DateStamper software added functions to the BDOS to manage
.br
5 bytes modify datefield
.br
-1 byte checksum
+1 byte magic number/checksum
.sp
.RE
-The checksum is only used on every 8th entry (last entry in 128-byte
-record) and is the sum of the first 127 bytes of the record.
+The magic number is used for the first 7 entries of each 128-byte record
+and contains the characters \fB!\fP, \fB!\fP, \fB!\fP, \fBT\fP, \fBI\fP,
+\fBM\fP and \fBE\fP. The checksum is used on every 8th entry (last entry
+in 128-byte record) and is the sum of the first 127 bytes of the record.
Each datefield has this structure:
.RS
.sp
.br
Number of reserved system tracks (optional)
.br
-Offset to start of volume (optional)
+Offset to start of volume (optional and not covered by operating system,
+but disk driver specific)
.sp
.RE
A block is the smallest allocatable storage unit. CP/M supports block
are stored with the given software skew.
.\"}}}
.SS "Device areas" \"{{{
-A CP/M disk contains three areas:
+A CP/M disk contains four areas:
.RS
.sp
-Volume offset (optional)
+Volume offset (optional and not covered by operating system, but disk driver specific)
.br
System tracks (optional)
.br
.LP
A hard disk can have the additional notion of a \fIvolume offset\fP to
locate the start of the drive image (which may or may not have system
-tracks associated with it). The base unit for volume offset is byte
+tracks associated with it). The base unit for volume offset is byte
count from the beginning of the physical disk, but specifiers of
\fIK\fP, \fIM\fP, \fIT\fP or \fIS\fP may be appended to denote
kilobytes, megabytes, tracks or sectors. If provided, a specifier
must immediately follow the numeric value with no whitespace. For
convenience upper and lower case are both accepted and only the first
letter is significant, thus 2KB, 8MB, 1000trk and 16sec are valid
-values. Offset must appear subsequent to track, sector and sector
-length values.
+values. The \fBoffset\fP must appear subsequent to track, sector and sector
+length values for the sector and track units to work.
.\"}}}
.SS "Directory entries" \"{{{
The directory is a sequence of directory entries (also called extents),
1 byte minute in BCD format
.sp
.RE
+All time stamps are stored in local time.
.\"}}}
.SS "DateStamper time stamps" \"{{{
The DateStamper software added functions to the BDOS to manage
.br
5 bytes modify datefield
.br
-1 byte checksum
+1 byte magic number/checksum
.sp
.RE
-The checksum is only used on every 8th entry (last entry in 128-byte
-record) and is the sum of the first 127 bytes of the record.
+The magic number is used for the first 7 entries of each 128-byte record
+and contains the characters \fB!\fP, \fB!\fP, \fB!\fP, \fBT\fP, \fBI\fP,
+\fBM\fP and \fBE\fP. The checksum is used on every 8th entry (last entry
+in 128-byte record) and is the sum of the first 127 bytes of the record.
Each datefield has this structure:
.RS
.sp
-.TH CPMCHATTR 1 "November 16, 2013" "CP/M tools" "User commands"
+.TH CPMCHATTR 1 "October 25, 2014" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmchattr \- change file attributes on CP/M files
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.IP "\fIattrib\fP"
Set the file attributes as given.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.IP "\fIattrib\fP"
Set the file attributes as given.
.\"}}}
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
{
- fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
+ fprintf(stderr,"%s: cannot open %s (%s)\n",cmd,image,err);
+ exit(1);
+ }
+ if (cpmReadSuper(&drive,&root,format)==-1)
+ {
+ fprintf(stderr,"%s: cannot read superblock (%s)\n",cmd,boo);
exit(1);
}
- cpmReadSuper(&drive,&root,format);
/*}}}*/
cpmglob(optind,argc,argv,&root,&gargc,&gargv);
for (i=0; i<gargc; ++i)
if (!rc) rc = cpmAttrGet(&ino, &attrib);
if (!rc)
{
- int n, m;
+ unsigned int n;
+ int m;
+
m = 0;
for (n = 0; n < strlen(attrs); n++)
{
-.TH CPMCHMOD 1 "November 16, 2013" "CP/M tools" "User commands"
+.TH CPMCHMOD 1 "October 25, 2014" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmchmod \- change file mode on CP/M files
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.IP "\fImode\fP"
Octal file mode, as used in \fIchmod\fP(1).
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.IP "\fImode\fP"
Octal file mode, as used in \fIchmod\fP(1).
.\"}}}
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
{
- fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
+ fprintf(stderr,"%s: cannot open %s (%s)\n",cmd,image,err);
+ exit(1);
+ }
+ if (cpmReadSuper(&drive,&root,format)==-1)
+ {
+ fprintf(stderr,"%s: cannot read superblock (%s)\n",cmd,boo);
exit(1);
}
- cpmReadSuper(&drive,&root,format);
/*}}}*/
cpmglob(optind,argc,argv,&root,&gargc,&gargv);
for (i=0; i<gargc; ++i)
-.TH CPMCP 1 "November 16, 2013" "CP/M tools" "User commands"
+.TH CPMCP 1 "October 25, 2014" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmcp \- copy files from and to CP/M disks
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.IP \fB\-p\fP
Preserve time stamps when copying files from CP/M to UNIX (not
implemented for copying the other way so far).
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.IP \fB\-p\fP
Preserve time stamps when copying files from CP/M to UNIX (not
implemented for copying the other way so far).
#include <errno.h>
#include <stdio.h>
#include <string.h>
-#include <fcntl.h>
#include <limits.h>
#include <stdlib.h>
#include <utime.h>
int res;
char buf[4096];
- while ((res=cpmRead(&file,buf,sizeof(buf)))!=0)
+ while ((res=cpmRead(&file,buf,sizeof(buf)))>0)
{
int j;
}
}
endwhile:
+ if (res==-1 && !ohno) { fprintf(stderr,"%s: can not read %s (%s)\n",cmd,src,boo); exitcode=1; ohno=1; }
if (fclose(ufp)==EOF && !ohno) { fprintf(stderr,"%s: can not close %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; }
if (preserve && !ohno && (ino.atime || ino.mtime))
{
/* open image file */ /*{{{*/
if ((err=Device_open(&super.dev,image,readcpm ? O_RDONLY : O_RDWR, devopts)))
{
- fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
+ fprintf(stderr,"%s: cannot open %s (%s)\n",cmd,image,err);
+ exit(1);
+ }
+ if (cpmReadSuper(&super,&root,format)==-1)
+ {
+ fprintf(stderr,"%s: cannot read superblock (%s)\n",cmd,boo);
exit(1);
}
- cpmReadSuper(&super,&root,format);
/*}}}*/
if (readcpm) /* copy from CP/M to UNIX */ /*{{{*/
{
cpmOpen(&ino,&file,O_WRONLY);
do
{
- int j;
+ unsigned int j;
for (j=0; j<(sizeof(buf)/2) && (c=getc(ufp))!=EOF; ++j)
{
buf[j]=c;
}
if (text && c==EOF) buf[j++]='\032';
- if (cpmWrite(&file,buf,j)!=j)
+ if (cpmWrite(&file,buf,j)!=(ssize_t)j)
{
fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,boo);
ohno=1;
{
int sect, track, counter;
+ assert(d);
assert(blockno>=0);
- assert(blockno<d->size);
- assert(buffer!=(char*)0);
+ assert(buffer);
+ if (blockno>=d->size)
+ {
+ boo="Attempting to access block beyond end of disk";
+ return -1;
+ }
if (end<0) end=d->blksiz/d->secLength-1;
sect=(blockno*(d->blksiz/d->secLength)+ d->sectrk*d->boottrk)%d->sectrk;
track=(blockno*(d->blksiz/d->secLength)+ d->sectrk*d->boottrk)/d->sectrk;
{
const char *err;
+ assert(d->skewtab[sect]>=0);
+ assert(d->skewtab[sect]<d->sectrk);
if (counter>=start && (err=Device_readSector(&d->dev,track,d->skewtab[sect],buffer+(d->secLength*counter))))
{
boo=err;
{
int first=1;
+ assert(a);
+ assert(pattern);
while (*pattern)
{
switch (*pattern)
int user;
char pat[255];
+ assert(a);
+ assert(pattern);
assert(strlen(pattern)<255);
if (isdigit(*pattern) && *(pattern+1)==':') { user=(*pattern-'0'); pattern+=2; }
else if (isdigit(*pattern) && isdigit(*(pattern+1)) && *(pattern+2)==':') { user=(10*(*pattern-'0')+(*(pattern+1)-'0')); pattern+=3; }
FILE *fp;
int insideDef=0,found=0;
+ d->libdskGeometry[0] = '\0';
d->type=0;
if ((fp=fopen("diskdefs","r"))==(FILE*)0 && (fp=fopen(DISKDEFS,"r"))==(FILE*)0)
{
{
int argc;
char *argv[2];
+ char *s;
+
+ /* Allow inline comments preceded by ; or # */
+ s = strchr(line, '#');
+ if (s) strcpy(s, "\n");
+ s = strchr(line, ';');
+ if (s) strcpy(s, "\n");
for (argc=0; argc<1 && (argv[argc]=strtok(argc ? (char*)0 : line," \t\n")); ++argc);
if ((argv[argc]=strtok((char*)0,"\n"))!=(char*)0) ++argc;
for (pass=0; pass<2; ++pass)
{
- char *s;
-
sectors=0;
for (s=argv[1]; *s; )
{
errno=0;
multiplier=1;
- val = strtoul(argv[1],&endptr,10);
- if ((errno==ERANGE && val==ULONG_MAX)||(errno!=0 && val==0))
+ val = strtol(argv[1],&endptr,10);
+ if ((errno==ERANGE && val==LONG_MAX)||(errno!=0 && val<=0))
{
fprintf(stderr,"%s: invalid offset value \"%s\" - %s\n",cmd,argv[1],strerror(errno));
exit(1);
/* Have a unit specifier */
switch (toupper(*endptr))
{
- case 'K':
- multiplier=1024;
- break;
- case 'M':
- multiplier=1024*1024;
- break;
- case 'T':
- if (d->sectrk<0||d->tracks<0||d->secLength<0)
- {
- fprintf(stderr,"%s: offset must be specified after sectrk, tracks and secLength\n",cmd);
+ case 'K':
+ multiplier=1024;
+ break;
+ case 'M':
+ multiplier=1024*1024;
+ break;
+ case 'T':
+ if (d->sectrk<0||d->tracks<0||d->secLength<0)
+ {
+ fprintf(stderr,"%s: offset must be specified after sectrk, tracks and secLength\n",cmd);
+ exit(1);
+ }
+ multiplier=d->sectrk*d->secLength;
+ break;
+ case 'S':
+ if (d->sectrk<0||d->tracks<0||d->secLength<0)
+ {
+ fprintf(stderr,"%s: offset must be specified after sectrk, tracks and secLength\n",cmd);
+ exit(1);
+ }
+ multiplier=d->secLength;
+ break;
+ default:
+ fprintf(stderr,"%s: unknown unit specifier \"%c\"\n",cmd,*endptr);
exit(1);
- }
- multiplier=d->sectrk*d->secLength;
- break;
- case 'S':
- if (d->sectrk<0||d->tracks<0||d->secLength<0)
- {
- fprintf(stderr,"%s: offset must be specified after sectrk, tracks and secLength\n",cmd);
- exit(1);
- }
- multiplier=d->secLength;
- break;
- default:
- fprintf(stderr,"%s: unknown unit specifier \"%c\"\n",cmd,*endptr);
- exit(1);
}
}
if (val*multiplier>INT_MAX)
exit(1);
}
}
+ else if (strcmp(argv[0], "libdsk:format")==0)
+ {
+ strncpy(d->libdskGeometry, argv[1], sizeof(d->libdskGeometry) - 1);
+ d->libdskGeometry[sizeof(d->libdskGeometry) - 1] = 0;
+ }
}
- else if (argc>0 && argv[0][0]!='#')
+ else if (argc>0 && argv[0][0]!='#' && argv[0][0]!=';')
{
fprintf(stderr,"%s: invalid keyword `%s'\n",cmd,argv[0]);
exit(1);
insideDef=1;
d->skew=1;
d->extents=0;
- d->type|=CPMFS_DR3;
+ d->type=CPMFS_DR22;
d->skewtab=(int*)0;
d->offset=0;
d->boottrk=d->secLength=d->sectrk=d->tracks=-1;
+ d->libdskGeometry[0] = 0;
if (strcmp(argv[1],format)==0) found=1;
}
}
unsigned char boot_sector[512], *boot_spec;
const char *err;
- Device_setGeometry(&d->dev,512,9,40,0);
+ Device_setGeometry(&d->dev,512,9,40,0,"pcw180");
if ((err=Device_readSector(&d->dev, 0, 0, (char *)boot_sector)))
{
fprintf(stderr,"%s: Failed to read Amstrad superblock (%s)\n",cmd,err);
d->offset = 0;
d->size = (d->secLength*d->sectrk*(d->tracks-d->boottrk))/d->blksiz;
d->extents = ((d->size>=256 ? 8 : 16)*d->blksiz)/16384;
+ d->libdskGeometry[0] = 0; /* LibDsk can recognise an Amstrad superblock
+ * and autodect */
return 0;
}
assert(s_ifdir);
while (s_ifreg && !S_ISREG(s_ifreg)) s_ifreg<<=1;
assert(s_ifreg);
- if (strcmp(format, "amstrad")==0) amsReadSuper(d,format);
+ if (strcmp(format,"amstrad")==0) amsReadSuper(d,format);
else diskdefReadSuper(d,format);
- Device_setGeometry(&d->dev,d->secLength,d->sectrk,d->tracks,d->offset);
+ boo = Device_setGeometry(&d->dev,d->secLength,d->sectrk,d->tracks,d->offset,d->libdskGeometry);
+ if (boo) return -1;
+
if (d->skewtab==(int*)0) /* generate skew table */ /*{{{*/
{
int i,j,k;
if (( d->skewtab = malloc(d->sectrk*sizeof(int))) == (int*)0)
{
- fprintf(stderr,"%s: can not allocate memory for skew sector table\n",cmd);
- exit(1);
+ boo=strerror(errno);
+ return -1;
}
memset(d->skewtab,0,d->sectrk*sizeof(int));
for (i=j=0; i<d->sectrk; ++i,j=(j+d->skew)%d->sectrk)
{
while (1)
{
+ assert(i<d->sectrk);
+ assert(j<d->sectrk);
for (k=0; k<i && d->skewtab[k]!=j; ++k);
if (k<i) j=(j+1)%d->sectrk;
else break;
d->alvSize=((d->secLength*d->sectrk*(d->tracks-d->boottrk))/d->blksiz+INTBITS-1)/INTBITS;
if ((d->alv=malloc(d->alvSize*sizeof(int)))==(int*)0)
{
- boo="out of memory";
+ boo=strerror(errno);
return -1;
}
}
/*}}}*/
/* allocate directory buffer */ /*{{{*/
- if ((d->dir=malloc(d->maxdir*32))==(struct PhysDirectoryEntry*)0)
+ assert(sizeof(struct PhysDirectoryEntry)==32);
+ if ((d->dir=malloc(((d->maxdir*32+d->blksiz-1)/d->blksiz)*d->blksiz))==(struct PhysDirectoryEntry*)0)
{
- boo="out of memory";
+ boo=strerror(errno);
return -1;
}
/*}}}*/
/* variables */ /*{{{*/
struct PhysDirectoryEntry *cur=(struct PhysDirectoryEntry*)0;
char buf[2+8+1+3+1]; /* 00foobarxy.zzy\0 */
- int i;
char *bufp;
int hasext;
/*}}}*/
/*}}}*/
while (1)
{
+ int i;
+
if (dir->pos==0) /* first entry is . */ /*{{{*/
{
ent->ino=dir->ino->sb->maxdir;
}
/*}}}*/
}
- else if (dir->pos>=RESERVED_ENTRIES && dir->pos<dir->ino->sb->maxdir+RESERVED_ENTRIES)
+ else if (dir->pos>=RESERVED_ENTRIES && dir->pos<(int)dir->ino->sb->maxdir+RESERVED_ENTRIES)
{
int first=dir->pos-RESERVED_ENTRIES;
extcap=(file->ino->sb->size<256 ? 16 : 8)*blocksize;
if (extcap>16384) extcap=16384*file->ino->sb->extents;
- if (file->ino->ino==file->ino->sb->maxdir+1) /* [passwd] */ /*{{{*/
+ if (file->ino->ino==(ino_t)file->ino->sb->maxdir+1) /* [passwd] */ /*{{{*/
{
if ((file->pos+count)>file->ino->size) count=file->ino->size-file->pos;
if (count) memcpy(buf,file->ino->sb->passwd+file->pos,count);
return count;
}
/*}}}*/
- else if (file->ino->ino==file->ino->sb->maxdir+2) /* [label] */ /*{{{*/
+ else if (file->ino->ino==(ino_t)file->ino->sb->maxdir+2) /* [label] */ /*{{{*/
{
if ((file->pos+count)>file->ino->size) count=file->ino->size-file->pos;
if (count) memcpy(buf,file->ino->sb->label+file->pos,count);
{
start=(file->pos%blocksize)/file->ino->sb->secLength;
end=((file->pos%blocksize+count)>blocksize ? blocksize-1 : (file->pos%blocksize+count-1))/file->ino->sb->secLength;
- readBlock(file->ino->sb,block,buffer,start,end);
+ if (readBlock(file->ino->sb,block,buffer,start,end)==-1)
+ {
+ if (got==0) got=-1;
+ break;
+ }
}
}
nextblockpos=(file->pos/blocksize)*blocksize+blocksize;
{
start=(file->pos%blocksize)/file->ino->sb->secLength;
end=((file->pos%blocksize+count)>blocksize ? blocksize-1 : (file->pos%blocksize+count-1))/file->ino->sb->secLength;
- if (file->pos%file->ino->sb->secLength) readBlock(file->ino->sb,block,buffer,start,start);
- if (end!=start && (file->pos+count-1)<blocksize) readBlock(file->ino->sb,block,buffer+end*file->ino->sb->secLength,end,end);
+ if (file->pos%file->ino->sb->secLength)
+ {
+ if (readBlock(file->ino->sb,block,buffer,start,start)==-1)
+ {
+ if (got==0) got=-1;
+ break;
+ }
+ }
+ if (end!=start && (file->pos+count-1)<blocksize)
+ {
+ if (readBlock(file->ino->sb,block,buffer+end*file->ino->sb->secLength,end,end)==-1)
+ {
+ if (got==0) got=-1;
+ break;
+ }
+ }
}
/*}}}*/
nextblockpos=(file->pos/blocksize)*blocksize+blocksize;
#define CPMFS_CPM3_DATES (0x1<<1) /* has CP/M+ style time stamps */
#define CPMFS_CPM3_OTHER (0x1<<2) /* has passwords and disc label */
#define CPMFS_DS_DATES (0x1<<3) /* has datestamper timestamps */
-#define CPMFS_EXACT_SIZE (0x1<<4) /* has exact file size */
+#define CPMFS_EXACT_SIZE (0x1<<4) /* has reverse exact file size */
#define CPMFS_DR22 0
#define CPMFS_P2DOS (CPMFS_CPM3_DATES|CPMFS_HI_USER)
int skew;
int boottrk;
off_t offset;
- unsigned int type;
+ int type;
int size;
int extents; /* logical extents per physical extent */
struct PhysDirectoryEntry *dir;
int dirtyDirectory;
struct dsDate *ds;
int dirtyDs;
+ char libdskGeometry[256];
};
struct cpmStatFS
-.TH CPMLS 1 "November 16, 2013" "CP/M tools" "User commands"
+.TH CPMLS 1 "October 25, 2014" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmls \- list sorted contents of directory
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmls
-.RB [ \-d | \-D | \-F | \-A | \-l [ \-c ][ \-i ]]
.RB [ \-f
.IR format ]
+.RB [ \-T
+.IR libdsk-type ]
+.RB [ \-d | \-D | \-F | \-A | \-l [ \-c ][ \-i ]]
.I image
.RI [ file-pattern "...]"
.ad b
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.IP \fB\-d\fP
Old CP/M 2.2 dir output.
.IP \fB\-D\fP
.SH SYNOPSIS \"{{{
.ad l
.B cpmls
-.RB [ \-d | \-D | \-F | \-A | \-l [ \-c ][ \-i ]]
.RB [ \-f
.IR format ]
+.RB [ \-T
+.IR libdsk-type ]
+.RB [ \-d | \-D | \-F | \-A | \-l [ \-c ][ \-i ]]
.I image
.RI [ file-pattern "...]"
.ad b
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.IP \fB\-d\fP
Old CP/M 2.2 dir output.
.IP \fB\-D\fP
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include "getopt_.h"
#include "cpmfs.h"
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev,image,O_RDONLY,devopts)))
{
- fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
+ fprintf(stderr,"%s: cannot open %s (%s)\n",cmd,image,err);
+ exit(1);
+ }
+ if (cpmReadSuper(&drive,&root,format)==-1)
+ {
+ fprintf(stderr,"%s: cannot read superblock (%s)\n",cmd,boo);
exit(1);
}
- cpmReadSuper(&drive,&root,format);
/*}}}*/
if (optind<argc) cpmglob(optind,argc,argv,&root,&gargc,&gargv);
else cpmglob(0,1,star,&root,&gargc,&gargv);
-.TH CPMRM 1 "November 16, 2013" "CP/M tools" "User commands"
+.TH CPMRM 1 "October 25, 2014" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmrm \- remove files on CP/M disks
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
{
- fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
+ fprintf(stderr,"%s: cannot open %s (%s)\n",cmd,image,err);
+ exit(1);
+ }
+ if (cpmReadSuper(&drive,&root,format)==-1)
+ {
+ fprintf(stderr,"%s: cannot read superblock (%s)\n",cmd,boo);
exit(1);
}
- cpmReadSuper(&drive,&root,format);
/*}}}*/
cpmglob(optind,argc,argv,&root,&gargc,&gargv);
for (i=0; i<gargc; ++i)
};
const char *Device_open(struct Device *self, const char *filename, int mode, const char *deviceOpts);
-void Device_setGeometry(struct Device *self, int secLength, int sectrk, int tracks, off_t offset);
+const char *Device_setGeometry(struct Device *self, int secLength, int sectrk, int tracks, off_t offset, const char *libdskGeometry);
const char *Device_close(struct Device *self);
const char *Device_readSector(const struct Device *self, int track, int sector, char *buf);
const char *Device_writeSector(const struct Device *self, int track, int sector, const char *buf);
#endif
/*}}}*/
+static const char *lookupFormat(DSK_GEOMETRY *geom, const char *name)
+{
+ dsk_format_t fmt = FMT_180K;
+ const char *fname;
+
+ while (dg_stdformat(NULL, fmt, &fname, NULL) == DSK_ERR_OK)
+ {
+ if (!strcmp(name, fname))
+ {
+ dg_stdformat(geom, fmt, &fname, NULL);
+ return NULL;
+ }
+ ++fmt;
+ }
+ return "Unrecognised LibDsk geometry specification";
+}
+
/* Device_open -- Open an image file */ /*{{{*/
const char *Device_open(struct Device *this, const char *filename, int mode, const char *deviceOpts)
{
- dsk_err_t e = dsk_open(&this->dev, filename, deviceOpts, NULL);
+ char *format;
+ char driverName[80];
+ const char *boo;
+ dsk_err_t e;
+
+ /* Assume driver name & format name both fit in 80 characters, rather than
+ * malloccing the exact size */
+ if (deviceOpts == NULL)
+ {
+ e = dsk_open(&this->dev, filename, NULL, NULL);
+ format = NULL;
+ }
+ else
+ {
+ strncpy(driverName, deviceOpts, 79);
+ driverName[79] = 0;
+ format = strchr(driverName, ',');
+ if (format)
+ {
+ *format = 0;
+ ++format;
+ }
+ e = dsk_open(&this->dev, filename, driverName, NULL);
+ }
this->opened = 0;
if (e) return dsk_strerror(e);
this->opened = 1;
- dsk_getgeom(this->dev, &this->geom);
+ if (format)
+ {
+ boo = lookupFormat(&this->geom, format);
+ if (boo) return boo;
+ }
+ else
+ {
+ dsk_getgeom(this->dev, &this->geom);
+ }
return NULL;
}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
-void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks, off_t offset)
+const char *Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks, off_t offset, const char *libdskGeometry)
{
+ char *boo;
+
this->secLength=secLength;
this->sectrk=sectrk;
this->tracks=tracks;
/* Must be an even multiple of sector size */
assert(offset%secLength==0);
this->offset=offset;
+ /* If a geometry is named in diskdefs, use it */
+ if (libdskGeometry && libdskGeometry[0])
+ {
+ return lookupFormat(&this->geom, libdskGeometry);
+ }
this->geom.dg_secsize = secLength;
this->geom.dg_sectors = sectrk;
/* Did the autoprobe guess right about the number of sectors & cylinders? */
- if (this->geom.dg_cylinders * this->geom.dg_heads == tracks) return;
+ if (this->geom.dg_cylinders * this->geom.dg_heads == tracks) return NULL;
/* Otherwise we guess: <= 43 tracks: single-sided. Else double. This
* fails for 80-track single-sided if there are any such beasts */
if (tracks <= 43)
this->geom.dg_cylinders = tracks/2;
this->geom.dg_heads = 2;
}
+ return NULL;
}
/*}}}*/
/* Device_close -- Close an image file */ /*{{{*/
#include <assert.h>
#include <errno.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
-void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks, off_t offset)
+const char *Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks, off_t offset, const char *libdskGeometry)
{
this->secLength=secLength;
this->sectrk=sectrk;
this->tracks=tracks;
this->offset=offset;
+ return NULL;
}
/*}}}*/
/* Device_close -- Close an image file */ /*{{{*/
{
int res;
+ assert(this);
assert(sector>=0);
assert(sector<this->sectrk);
assert(track>=0);
assert(track<this->tracks);
+ assert(buf);
if (lseek(this->fd,(off_t)(((sector+track*this->sectrk)*this->secLength)+this->offset),SEEK_SET)==-1)
{
return strerror(errno);
#include "config.h"
#include <assert.h>
-#include <errno.h>
#include <ctype.h>
+#include <errno.h>
#include <stdio.h>
#include "cpmdir.h"
}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
-void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks, off_t offset)
+const char * Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks, off_t offset, const char *libdskGeometry)
{
int n;
{
DRIVEPARAMS drvp;
memset(&drvp, 0, sizeof(drvp));
- if (GetDriveParams( this->hdisk, this->fd, &drvp )) return;
+ if (GetDriveParams( this->hdisk, this->fd, &drvp )) return "GetDriveParams failed";
drvp.bytespersector = secLength;
drvp.sectorspertrack = sectrk;
*/
SetDriveParams( this->hdisk, this->fd, &drvp );
}
+ return NULL;
}
/*}}}*/
/* Device_close -- Close an image file */ /*{{{*/
skew 1
boottrk 1
os 3
+ libdsk:format pcw180
end
diskdef pc1.2m
skew 1
boottrk 2
os 3
+ libdsk:format ibm1440
end
# CP/M 86 on 720KB floppies
skew 1
boottrk 1
os 3
+ libdsk:format pcw720
end
#amstrad: values are read from super block (special name hardcoded)
skew 1
boottrk 0
os 3
+ libdsk:format pcw720
end
# Despite being Amstrad formats, CPC System and CPC Data don't have an Amstrad
skew 1
boottrk 2
os 3
+ libdsk:format cpcsys
end
diskdef cpcdata
seclen 512
skew 1
boottrk 0
os 3
+ libdsk:format cpcdata
end
# after being read in with no sector skew.
skew 1
boottrk 1
os 2.2
+ libdsk:format ibm160
end
# IBM CP/M-86
skew 0
boottrk 2
os 2.2
+ libdsk:format ibm320
end
diskdef p112
boottrk 1
logicalextents 1
skewtab 0,2,4,6,8,10,12,14,1,3,5,7,9,11,13,15,16,18,20,22,24,26,28,30,17,19,21,23,25,27,29,31
- os 2
+ os 2.2
end
+# setfdprm /dev/fd0 zerobased SS DD ssize=512 cyl=40 sect=10 head=1
# Kaypro II
diskdef kpii
seclen 512
os 2.2
end
+# setfdprm /dev/fd0 zerobased DS DD ssize=512 cyl=40 sect=10 head=2
# Kayro IV
diskdef kpiv
seclen 512
os 3
end
+#DDR
+diskdef scp624
+ seclen 256
+ tracks 160
+ sectrk 16
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 2
+ os 2.2
+end
+
+diskdef scp640
+ seclen 256
+ tracks 160
+ sectrk 16
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 0
+ os 2.2
+end
+
+diskdef scp780
+ seclen 1024
+ tracks 160
+ sectrk 5
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 2
+ os 2.2
+end
+
+diskdef scp800
+ seclen 1024
+ tracks 160
+ sectrk 5
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 0
+ os 2.2
+end
+
+diskdef z9001
+ seclen 1024
+ tracks 160
+ sectrk 5
+ blocksize 2048
+ maxdir 192
+ skew 0
+ boottrk 0
+ os 2.2
+end
+
# Visual Technology Visual 1050 computer
diskdef v1050
seclen 512
maxdir 64
skew 5
boottrk 2
- os 2.2
+ os 2.2
end
maxdir 256
skew 0
boottrk 0
- os 2.2
+ os 2.2
end
maxdir 256
skew 0
boottrk 0
- os 2.2
+ os 2.2
end
# Northstar Micro-Disk System MDS-A-D 175
blocksize 1024
maxdir 64
boottrk 3
- os 2
+ os 2.2
end
# Osborne Nuevo/Vixen/4
maxdir 128
skew 2
boottrk 2
- os 2
+ os 2.2
end
# Lobo Max-80 8" CP/M 2
os 3
end
-# PRO CP/M RZ50 DZ format, experimental
+# PRO CP/M RZ50 DZ format (Perhaps only 79 tracks should be used?)
diskdef dec_pro
seclen 512
tracks 80
boottrk 2
os 2.2
end
+
+# TDOS with DateStamper
+diskdef tdos-ds
+ seclen 1024
+ tracks 77
+ sectrk 16
+ blocksize 2048
+ maxdir 256
+ skew 0
+ boottrk 1
+ os zsys
+end
+
+# The following entires are tested and working
+# Most of the images are either from Don Maslin's archive or from
+# Dave Dunfield's site, but not all - they are noted as well as
+# their size.
+
+# PMC Micromate
+# Dave Dunfield's Imagedisk information from DSK conversion from IMD:
+# IMageDisk Utility 1.18 / Mar 07 2012
+# IMD 1.14: 10/03/2007 11:13:27
+# PMC-101 MicroMate
+# CP/M Plus
+# System Master
+# Assuming 1:1 for Binary output
+# 0/0 250 kbps DD 5x1024
+# 80 tracks(40/40), 400 sectors (12 Compressed)
+# Entry derived from above - image size = 409,600, from Dave Dunfield
+diskdef pmc101
+ seclen 1024
+ tracks 80
+ sectrk 5
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 2
+ os 3
+end
+
+# BEGIN td143ssdd8 Turbo Dos 1.43 - SSDD 8" - 512 x 16
+# Test OK - image size = 630,784, from Don Maslin's archive
+diskdef td143ssdd8
+ seclen 512
+ tracks 77
+ sectrk 9
+ blocksize 1024
+ maxdir 64
+ skew 0
+ boottrk 0
+ os 2.2
+# DENSITY MFM ,LOW
+end
+
+# BEGIN headsdd8 Heath H89, Magnolia CP/M - SSDD 8" - 512 x 16
+# Test OK - image size = 630,784, from Don Maslin's archive
+diskdef heassdd8
+ seclen 512
+ tracks 77
+ sectrk 16
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 2
+ os 2.2
+# DENSITY MFM ,LOW
+end
+
+# Morrow Designs Micro-Decision DOUBLE
+# 64k CP/M Vers. 2.2 Rev.2.3 SIDED
+# Copyright '76, '77, '78, '79, '80
+# Digital Research
+# Copyright 1982,1983 Morrow Designs, Inc.
+# Assuming 1:1 for Binary output
+# 0/0 250 kbps DD 5x1024
+# 80 tracks(40/40), 400 sectors (128 Compressed)
+# Entry derived from above data
+# Test OK - image siae = 409600, from Dave Dunfield
+diskdef mordsdd
+ seclen 1024
+ tracks 80
+ sectrk 5
+ blocksize 2048
+ maxdir 128
+ skew 3
+ boottrk 2
+ OS 2.2
+end
+
+
+# BEGIN morsddd Morrow MD2 - SSDD 48 tpi 5.25" - 1024 x 5
+# Test OK - image size = 204,800, from Don Maslin's archive
+# Also tested with image from Dave Dunfield
+diskdef morsddd
+ seclen 1024
+ tracks 40
+ sectrk 5
+ blocksize 2048
+ maxdir 128
+ skew 3
+ boottrk 2
+ os 2.2
+# DENSITY MFM ,LOW
+# BSH 4 BLM 15 EXM 1 DSM 94 DRM 127 AL0 0C0H AL1 0 OFS 2
+end
+
+# BEGIN osb1sssd Osborne 1 - SSSD 48 tpi 5.25" - 256 x 10
+# Test OK - image size = 102,400, from Don Maslin's archive
+diskdef osb1sssd
+ seclen 256
+ tracks 40
+ sectrk 10
+ blocksize 2048
+ maxdir 64
+ skew 2
+ boottrk 3
+ os 2.2
+# DENSITY MFM ,LOW
+# BSH 4 BLM 15 EXM 1 DSM 45 DRM 63 AL0 080H AL1 0 OFS 3
+end
+
+# BEGIN ampdsdd Ampro - DSDD 48 tpi 5.25" - 512 x 10
+# Test OK - image size = 409,600, from Don Maslin's archive
+diskdef ampdsdd
+ seclen 1024
+ tracks 80
+ sectrk 5
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 2
+ os 2.2
+ libdsk:format ampro400d
+# DENSITY MFM ,LOW
+# BSH 4 BLM 15 EXM 1 DSM 194 DRM 127 AL0 0C0H AL1 0 OFS 2
+end
+
+# BEGIN ampdsdd80 Ampro - DSDD 96 tpi 5.25" - 512 x 10
+# Test OK - image size = 819,200, from Don Maslin's archive
+diskdef ampdsdd80
+ seclen 1024
+ tracks 160
+ sectrk 5
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 2
+ os 2.2
+ libdsk:format ampro800
+# DENSITY MFM ,LOW
+# BSH 4 BLM 15 EXM 1 DSM 194 DRM 127 AL0 0C0H AL1 0 OFS 2
+end
+
+# BEGIN altdsdd Altos - DSDD 5" - 512 x 9
+# Test OK - both CP/M and MP/M - image size = 737,280, from Dave Dunfield
+diskdef altdsdd
+ seclen 512
+ tracks 160
+ sectrk 9
+ blocksize 4096
+ maxdir 177
+ skew 0
+ boottrk 2
+ os 3
+# DENSITY MFM ,HIGH
+# BSH 5 BLM 31 EXM 3 DSM 176 DRM 176 AL0 0C0H AL1 0 OFS 2
+end
+
+# BEGIN trsomsssd TRS-80 Model 1, Omikron CP/M - SSSD 48 tpi 5.25" - 128 x 18
+# Test OK - image size = 80,640, from TRS-80 Yahoo Group posting
+diskdef trsomsssd
+ seclen 128
+ tracks 35
+ sectrk 18
+ blocksize 1024
+ maxdir 64
+ skew 4
+ boottrk 3
+ os 2.2
+# DENSITY FM ,LOW
+# BSH 3 BLM 7 EXM 0 DSM 71 DRM 63 AL0 0C0H AL1 0 OFS 3
+end
+
+# Memotech type 03, ie: 3.5" or 5.25", D/S, D/D, S/T
+# 40 tracks, 2 sides, 16 sectors/track, 256 bytes/sector
+# Bytes on the media = 2*40*16*256 = 327680
+# CP/M sees 26 128 byte records per track (similar to 8" disks).
+# Tracks = 327680/(26*128) = 98
+# Data is in 2048 byte blocks, on track 2 onwards
+# Blocks = ((98-2)*26*128)/2048 = 156, which agrees with DPB
+
+diskdef memotech-type03
+ seclen 128
+ tracks 98
+ sectrk 26
+ blocksize 2048
+ maxdir 64
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 07, ie: 3.5" or 5.25", D/S, D/D, D/T
+# 80 tracks, 2 sides, 16 sectors/track, 256 bytes/sector
+# Bytes on the media = 2*80*16*256 = 655360
+# CP/M sees 26 128 byte records per track (similar to 8" disks).
+# Tracks = 655360/(26*128) = 196
+# Data is in 2048 byte blocks, on track 2 onwards
+# Blocks = ((196-2)*26*128)/2048 = 315, which agrees with DPB
+
+diskdef memotech-type07
+ seclen 128
+ tracks 196
+ sectrk 26
+ blocksize 2048
+ maxdir 128
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 43, ie: 1MB Silicon Disc
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for Silicon Discs includes blocks on the last incomplete track
+# Tracks = 1048576/(26*128) = 315.07
+# Data is in 4096 byte blocks, on track 2 onwards
+# Blocks = (1048576-2*26*128)/4096 = 254, which agrees with DPB
+# Blocks = ((315-2)*26*128)/4096 = 254, so we don't need the 0.07 track
+diskdef memotech-type43
+ seclen 128
+ tracks 315
+ sectrk 26
+ blocksize 4096
+ maxdir 256
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 47, ie: 2MB Silicon Disc
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for Silicon Discs includes blocks on the last incomplete track
+# Tracks = 2097152/(26*128) = 630.15
+# Data is in 4096 byte blocks, on track 2 onwards
+# Blocks = (2097152-2*26*128)/4096 = 510, which agrees with DPB
+# Blocks = ((630-2)*26*128)/4096 = 510, so we don't need the 0.15 track
+diskdef memotech-type47
+ seclen 128
+ tracks 630
+ sectrk 26
+ blocksize 4096
+ maxdir 256
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 4B, ie: 4MB Silicon Disc
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for Silicon Discs includes blocks on the last incomplete track
+# Tracks = 4194304/(26*128) = 1260.3
+# Data is in 4096 byte blocks, on track 2 onwards
+# Blocks = (4194304-2*26*128)/4096 = 1022, which agrees with DPB
+# Blocks = ((1260-2)*26*128)/4096 = 1022, so we don't need the 0.3 track
+diskdef memotech-type4B
+ seclen 128
+ tracks 1260
+ sectrk 26
+ blocksize 4096
+ maxdir 512
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 4F, ie: 8MB Silicon Disc
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for Silicon Discs includes blocks on the last incomplete track
+# Tracks = 8388608/(26*128) = 2520.61
+# Data is in 4096 byte blocks, on track 2 onwards
+# Blocks = (8388608-2*26*128)/4096 = 2046, which agrees with DPB
+# Blocks = ((2520-2)*26*128)/4096 = 2045, so we need the extra 0.61 track
+diskdef memotech-type4F
+ seclen 128
+ tracks 2521
+ sectrk 26
+ blocksize 4096
+ maxdir 512
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 18, ie: 8MB SD Card
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for SD Cards includes blocks on the last incomplete track
+# Tracks = 8388608/(26*128) = 2520.61
+# Data is in 4096 byte blocks, on track 2 onwards
+# Blocks = (8388608-2*26*128)/4096 = 2046, which agrees with DPB
+# Blocks = ((2520-2)*26*128)/4096 = 2045, so we need the extra 0.61 track
+diskdef memotech-type18
+ seclen 128
+ tracks 2521
+ sectrk 26
+ blocksize 4096
+ maxdir 512
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 19, ie: 8MB SD Card
+diskdef memotech-type19
+ seclen 128
+ tracks 2521
+ sectrk 26
+ blocksize 4096
+ maxdir 512
+ skew 1
+ boottrk 2
+ os 2.2
+ offset 8M
+end
+
+# Memotech type 1A, ie: 8MB SD Card
+diskdef memotech-type1A
+ seclen 128
+ tracks 2521
+ sectrk 26
+ blocksize 4096
+ maxdir 512
+ skew 1
+ boottrk 2
+ os 2.2
+ offset 16M
+end
+
+# Memotech type 1B, ie: 8MB SD Card
+diskdef memotech-type1B
+ seclen 128
+ tracks 2521
+ sectrk 26
+ blocksize 4096
+ maxdir 512
+ skew 1
+ boottrk 2
+ os 2.2
+ offset 24M
+end
+
+# Memotech type 1C, ie: 8MB SD Card
+diskdef memotech-type1C
+ seclen 128
+ tracks 2521
+ sectrk 26
+ blocksize 4096
+ maxdir 512
+ skew 1
+ boottrk 2
+ os 2.2
+ offset 32M
+end
+
+# Memotech type 1D, ie: 8MB SD Card
+diskdef memotech-type1D
+ seclen 128
+ tracks 2521
+ sectrk 26
+ blocksize 4096
+ maxdir 512
+ skew 1
+ boottrk 2
+ os 2.2
+ offset 40M
+end
+
+# Memotech type 1E, ie: 8MB SD Card
+diskdef memotech-type1E
+ seclen 128
+ tracks 2521
+ sectrk 26
+ blocksize 4096
+ maxdir 512
+ skew 1
+ boottrk 2
+ os 2.2
+ offset 48M
+end
+
+# Memotech type 1F, ie: 8MB SD Card
+diskdef memotech-type1F
+ seclen 128
+ tracks 2521
+ sectrk 26
+ blocksize 4096
+ maxdir 512
+ skew 1
+ boottrk 2
+ os 2.2
+ offset 56M
+end
+
+# Memotech type 50, ie: 256KB RAM Disc
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for RAM Discs includes blocks on the last incomplete track
+# Tracks = 262144/(26*128) = 78.76
+# Data is in 1024 byte blocks, on track 2 onwards
+# Blocks = (262144-2*26*128)/1024 = 249, which agrees with DPB
+# Blocks = ((78-2)*26*128)/1024 = 247, so we need the extra 0.76 track
+diskdef memotech-type50
+ seclen 128
+ tracks 79
+ sectrk 26
+ blocksize 1024
+ maxdir 64
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 51, ie: 512KB RAM Disc
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for RAM Discs includes blocks on the last incomplete track
+# Tracks = 524288/(26*128) = 157.53
+# Data is in 2048 byte blocks, on track 2 onwards
+# Blocks = (524288-2*26*128)/2048 = 252, which agrees with DPB
+# Blocks = ((157-2)*26*128)/2048 = 251, so we need the extra 0.53 track
+diskdef memotech-type51
+ seclen 128
+ tracks 158
+ sectrk 26
+ blocksize 2048
+ maxdir 128
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 51, as used in Italy, ie: 480KB RAM Disc
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for RAM Discs includes blocks on the last incomplete track
+# Tracks = 491520/(26*128) = 147.69
+# Data is in 2048 byte blocks, on track 2 onwards
+# Blocks = (491520-2*26*128)/2048 = 236, which agrees with DPB
+# Blocks = ((147-2)*26*128)/2048 = 235, so we need the extra 0.69 track
+diskdef memotech-type51-italy
+ seclen 128
+ tracks 148
+ sectrk 26
+ blocksize 2048
+ maxdir 128
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 51, after S2R64.COM, ie: 448KB RAM Disc
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for RAM Discs includes blocks on the last incomplete track
+# Tracks = 458752/(26*128) = 137.84
+# Data is in 2048 byte blocks, on track 2 onwards
+# Blocks = (458752-2*26*128)/2048 = 220, which agrees with DPB, after S2R64.COM
+# Blocks = ((137-2)*26*128)/2048 = 219, so we need the extra 0.84 track
+diskdef memotech-type51-s2r64
+ seclen 128
+ tracks 138
+ sectrk 26
+ blocksize 2048
+ maxdir 128
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 51, after S2R.COM, ie: 144KB RAM Disc
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for RAM Discs includes blocks on the last incomplete track
+# Tracks = 147456/(26*128) = 44.3
+# Data is in 2048 byte blocks, on track 2 onwards
+# Blocks = (147456-2*26*128)/2048 = 68, which agrees with DPB, after S2R.COM
+# Blocks = ((44-2)*26*128)/2048 = 68, so we don't need the extra 0.3 track
+diskdef memotech-type51-s2r
+ seclen 128
+ tracks 44
+ sectrk 26
+ blocksize 2048
+ maxdir 128
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Memotech type 52, ie: 320KB RAM Disc
+# Added for REMEMOTECH
+# CP/M sees 26 128 byte records per track
+# Note: Unlike common practice with real physical disks, with real geometry,
+# the DPB for RAM Discs includes blocks on the last incomplete track
+# Tracks = 327680/(26*128) = 98.46
+# Data is in 2048 byte blocks, on track 2 onwards
+# Blocks = (327680-2*26*128)/2048 = 156
+# Blocks = ((98-2)*26*128)/2048 = 156, so we don't need the extra 0.46 track
+# This type very deliberately and conveniently exactly matches type 03
+diskdef memotech-type52
+ seclen 128
+ tracks 98
+ sectrk 26
+ blocksize 2048
+ maxdir 64
+ skew 1
+ boottrk 2
+ os 2.2
+end
+
+# Research Machines 380Z/480Z 5.25" "Single Density" or "MDS" format.
+# All tracks are formatted FM 16x128.
+diskdef rm-sd
+ seclen 128
+ tracks 40
+ sectrk 16
+ blocksize 1024
+ maxdir 64
+ skew 3
+ boottrk 3
+ os 2.2
+end
+
+# Research Machines 380Z/480Z 5.25" "Double Density" or "MD" format.
+# Track 0 is formatted FM 16x128; 1+ are MFM 9x512.
+# If you're working with an image file, make sure that track 0 is
+# padded to be the same size as the other tracks.
+diskdef rm-dd
+ seclen 512
+ tracks 40
+ sectrk 9
+ blocksize 1024
+ maxdir 64
+ skew 5
+ boottrk 3
+ os 2.2
+end
+
+# Research Machines 380Z/480Z 5.25" "Quad Density" or "MQ" format.
+# Track 0 is formatted FM 16x128; 1+ are MFM 9x512.
+diskdef rm-qd
+ seclen 512
+ tracks 80
+ sectrk 9
+ blocksize 2048
+ maxdir 128
+ skew 5
+ boottrk 3
+ os 2.2
+end
+
+# Ampro Little Board Z80 running CP/M 2.21
+# BEGIN AMP1 Ampro - SSDD 48 tpi 5.25"
+# DENSITY MFM, LOW
+# CYLINDERS 40 SIDES 1 SECTORS 10,512 SKEW 2
+# SIDE1 0 1,2,3,4,5,6,7,8,9,10
+# BSH 4 BLM 15 EXM 1 DSM 94 DRM 63 AL0 080H AL1 0 OFS 2
+# END
+
+diskdef amp1
+ seclen 512 #= Sectors xx,512
+ tracks 40 #= (Cylinders * Sides) = 40*1 = 40
+ sectrk 10 #= Sectors 10,xxx
+ blocksize 2048 #= (128*(BLM+1)) = 2048
+ maxdir 64 #(DRM+1) = 64
+ skew 0 #= SKEW = 0
+ boottrk 2 #= OFS = 2
+ os 2.2
+end
+
+#BEGIN AMP2 Ampro - DSDD 48 tpi 5.25"
+#DENSITY MFM, LOW
+#CYLINDERS 40 SIDES 2
+#SECTORS 10,512
+#SKEW 2
+#SIDE1 0 17,18,19,20,21,22,23,24,25,26
+#SIDE2 1 17,18,19,20,21,22,23,24,25,26
+#ORDER SIDES
+#BSH 4 BLM 15 EXM 1 DSM 194 DRM 127 AL0 0C0H AL1 0 OFS 2
+#END
+
+# setfdprm /dev/fd0 DS DD ssize=512 cyl=40 sect=10 head=2
+diskdef amp2
+ seclen 512
+ tracks 80
+ sectrk 10
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 2
+ os 2.2
+end
+
+#BEGIN AMP3 Ampro - SSDD 96 tpi 3.5"
+#DENSITY MFM, LOW
+#CYLINDERS 80 SIDES 1 SECTORS 5,1024 SKEW 2
+#SIDE1 0 1,2,3,4,5
+#BSH 4 BLM 15 EXM 1 DSM 194 DRM 127 AL0 0C0H AL1 0 OFS 2
+#END
+
+# setfdprm /dev/fd0 SS DD ssize=1024 cyl=80 sect=5 head=1
+diskdef amp3
+ seclen 1024
+ tracks 80
+ sectrk 5
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 2
+ os 2.2
+end
+
+#BEGIN AMP4 Ampro - DSDD 96 tpi 3.5"
+#DENSITY MFM, LOW
+#CYLINDERS 80 SIDES 2 SECTORS 5,1024 SKEW 2
+#SIDE1 0 17,18,19,20,21
+#SIDE2 1 17,18,19,20,21
+#ORDER SIDES
+#BSH 4 BLM 15 EXM 0 DSM 394 DRM 255 AL0 0F0H AL1 0 OFS 2
+#END
+
+# setfdprm /dev/fd0 DS DD ssize=1024 cyl=80 sect=5 head=2
+diskdef amp4
+ seclen 1024
+ tracks 160
+ sectrk 5
+ blocksize 2048
+ maxdir 256
+ skew 0
+ boottrk 2
+ os 2.2
+end
+
+#BEGIN AMP5 Ampro - SSDD 3.5"
+#DENSITY MFM, LOW
+#CYLINDERS 80 SIDES 1 SECTORS 5,1024 SKEW 2
+#SIDE1 0 1,2,3,4,5
+#BSH 4 BLM 15 EXM 1 DSM 194 DRM 127 AL0 0C0H AL1 0 OFS 2
+#END
+
+# setfdprm /dev/fd0 SS DD ssize=1024 cyl=80 sect=5 head=1
+diskdef amp5
+ seclen 1024
+ tracks 80
+ sectrk 5
+ blocksize 2048
+ maxdir 128
+ skew 0
+ boottrk 2
+ os 2.2
+end
+
+#BEGIN AMP6 Ampro - DSDD 3.5"
+#DENSITY MFM, LOW
+#CYLINDERS 80 SIDES 2 SECTORS 5,1024 SKEW 2
+#SIDE1 0 17,18,19,20,21
+#SIDE2 1 17,18,19,20,21
+#ORDER SIDES
+#BSH 4 BLM 15 EXM 0 DSM 394 DRM 255 AL0 0F0H AL1 0 OFS 2
+#END
+
+# setfdprm /dev/fd0 DS DD ssize=1024 cyl=80 sect=5 head=2
+diskdef amp6
+ seclen 1024
+ tracks 160
+ sectrk 5
+ blocksize 2048
+ maxdir 256
+ skew 0
+ boottrk 2
+ os 2.2
+end
+
+diskdef ampro800
+ seclen 1024
+ tracks 160
+ sectrk 5
+ blocksize 2048
+ maxdir 256
+ skew 0
+ boottrk 2
+ os 2.2
+end
-.TH FSCK.CPM 1 "November 16, 2013" "CP/M tools" "User commands"
+.TH FSCK.CPM 1 "October 25, 2014" "CP/M tools" "User commands"
.SH NAME ..\"{{{roff}}}\"{{{
fsck.cpm \- check a CP/M file system
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.IP "\fB\-n\fP"
Open the file system read-only and do not repair any errors.
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.IP "\fB\-n\fP"
Open the file system read-only and do not repair any errors.
.\"}}}
if (block>0)
{
++usedBlocks;
- if (block<min || block>max)
+ if (block<min || block>=max)
{
printf("Error: Bad block number (extent=%d, name=\"%s\", block=%d)\n",extent,prfile(sb,extent),block);
if (ask("Remove file"))
{
if ((err=Device_open(&sb.dev, image,O_RDONLY, devopts)))
{
- fprintf(stderr,"%s: can not open %s: %s\n",cmd,image,err);
+ fprintf(stderr,"%s: cannot open %s: %s\n",cmd,image,err);
exit(1);
}
else
{
- fprintf(stderr,"%s: can not open %s for writing, no repair possible\n",cmd,image);
+ fprintf(stderr,"%s: cannot open %s for writing, no repair possible\n",cmd,image);
}
}
- cpmReadSuper(&sb,&root,format);
+ if (cpmReadSuper(&sb,&root,format)==-1)
+ {
+ fprintf(stderr,"%s: cannot read superblock (%s)\n",cmd,boo);
+ exit(1);
+ }
ret=fsck(&root,image);
if (ret&MODIFIED)
{
-.TH FSED.CPM 1 "November 16, 2013" "CP/M tools" "User commands"
+.TH FSED.CPM 1 "October 25, 2014" "CP/M tools" "User commands"
.SH NAME ..\"{{{roff}}}\"{{{
fsed.cpm \- edit a CP/M file system
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.\"}}}
.SH "RETURN VALUE" .\"{{{
Upon successful completion, exit code 0 is returned.
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
+.IP "\fB\-T\fP \fIlibdsk-type\fP"
+libdsk driver type, e.g. \fBtele\fP for Teledisk images or \fBraw\fP for raw images
+(requires building cpmtools with support for libdsk).
.\"}}}
.SH "RETURN VALUE" .\"{{{
Upon successful completion, exit code 0 is returned.
#include <assert.h>
#include <ctype.h>
+#if NEED_NCURSES
+#if HAVE_NCURSES_NCURSES_H
+#include <ncurses/ncurses.h>
+#else
+#include <ncurses.h>
+#endif
+#else
#include <curses.h>
+#endif
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <time.h>
#include "cpmfs.h"
+#include "getopt_.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
static struct tm tm;
unsigned long days=(lday&0xff)|((hday&0xff)<<8);
int d;
- int md[12]={31,0,31,30,31,30,31,31,30,31,30,31};
+ unsigned int md[12]={31,0,31,30,31,30,31,31,30,31,30,31};
tm.tm_sec=0;
tm.tm_min=((min>>4)&0xf)*10+(min&0xf);
{
const char *msg;
char bmap[18*80];
- int secmap,pos,sys,directory;
+ int secmap,sys,directory;
+ int pos;
clear();
msg="Data map";
{
for (i=0; i<16; ++i)
{
- unsigned int sector;
+ int sector;
sector=mapbuf[entry*32+16+i]&0xff;
if (sb->size>=256) sector|=(((mapbuf[entry*32+16+ ++i]&0xff)<<8));
}
}
- for (pos=0; pos<sizeof(bmap); ++pos)
+ for (pos=0; pos<(int)sizeof(bmap); ++pos)
{
move(2+pos%18,pos/18);
addch(bmap[pos]);
static void data(struct cpmSuperBlock *sb, const char *buf, unsigned long int pos) /*{{{*/
{
int offset=(pos%sb->secLength)&~0x7f;
- int i;
+ unsigned int i;
for (i=0; i<128; ++i)
{
struct cpmInode root;
const char *format;
int c,usage=0;
- unsigned long pos;
+ off_t pos;
chtype ch;
int reload;
char *buf;
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev,image,O_RDONLY,devopts)))
{
- fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
+ fprintf(stderr,"%s: cannot open %s (%s)\n",cmd,image,err);
+ exit(1);
+ }
+ if (cpmReadSuper(&drive,&root,format)==-1)
+ {
+ fprintf(stderr,"%s: cannot read superblock (%s)\n",cmd,boo);
exit(1);
}
- cpmReadSuper(&drive,&root,format);
/*}}}*/
/* alloc sector buffers */ /*{{{*/
if ((buf=malloc(drive.secLength))==(char*)0 || (mapbuf=malloc(drive.secLength))==(char*)0)
{
case 'F': /* next 16 byte */ /*{{{*/
{
- if (pos+16<(drive.sectrk*drive.tracks*(unsigned long)drive.secLength))
+ if (pos+16<(drive.sectrk*drive.tracks*(off_t)drive.secLength))
{
if (pos/drive.secLength!=(pos+16)/drive.secLength) reload=1;
pos+=16;
{
case 'F': /* next entry */ /*{{{*/
{
- if (pos+32<(drive.sectrk*drive.tracks*(unsigned long)drive.secLength))
+ if (pos+32<(drive.sectrk*drive.tracks*(off_t)drive.secLength))
{
if (pos/drive.secLength!=(pos+32)/drive.secLength) reload=1;
pos+=32;
{
case 'n': /* next record */ /*{{{*/
{
- if (pos+128<(drive.sectrk*drive.tracks*(unsigned long)drive.secLength))
+ if (pos+128<(drive.sectrk*drive.tracks*(off_t)drive.secLength))
{
if (pos/drive.secLength!=(pos+128)/drive.secLength) reload=1;
pos+=128;
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2010-02-06.18; # UTC
+scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
+# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
shift;;
-T) no_target_directory=true;;
fi
shift # arg
dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
done
fi
echo "$0: no input file specified." >&2
exit 1
fi
- # It's OK to call `install-sh -d' without argument.
+ # It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
for src
do
- # Protect names starting with `-'.
+ # Protect names problematic for 'test' and other utilities.
case $src in
- -*) src=./$src;;
+ -* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
-
dst=$dst_arg
- # Protect names starting with `-'.
- case $dst in
- -*) dst=./$dst;;
- esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writeable bit of parent directory when it shouldn't.
+ # other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
case $dstdir in
/*) prefix='/';;
- -*) prefix='./';;
+ [-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
for d
do
- test -z "$d" && continue
+ test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
-.TH MKFS.CPM 1 "November 16, 2013" "CP/M tools" "User commands"
+.TH MKFS.CPM 1 "October 25, 2014" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
mkfs.cpm \- make a CP/M file system
.\"}}}
.IR boot ]
.RB [ \-L
.IR label ]
+.RB [ \-t ]
.I image
.ad b
.\"}}}
are written to sequential sectors, padding with 0xe5 if needed.
.IP "\fB\-L\fP \fIlabel\fP"
Label the file system. This is only supported by CP/M Plus.
+.IP "\fB\-t\fP"
+Create time stamps.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.IR boot ]
.RB [ \-L
.IR label ]
+.RB [ \-t ]
.I image
.ad b
.\"}}}
are written to sequential sectors, padding with 0xe5 if needed.
.IP "\fB\-L\fP \fIlabel\fP"
Label the file system. This is only supported by CP/M Plus.
+.IP "\fB\-t\fP"
+Create time stamps.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include "getopt_.h"
#include "cpmfs.h"
/*}}}*/
/* mkfs -- make file system */ /*{{{*/
-static int mkfs(struct cpmSuperBlock *drive, const char *name, const char *label, char *bootTracks)
+static int mkfs(struct cpmSuperBlock *drive, const char *name, const char *format, const char *label, char *bootTracks, int timeStamps)
{
/* variables */ /*{{{*/
- int i;
+ unsigned int i;
char buf[128];
char firstbuf[128];
int fd;
- int bytes;
- int trkbytes;
+ unsigned int bytes;
+ unsigned int trkbytes;
/*}}}*/
/* open image file */ /*{{{*/
/* write system tracks */ /*{{{*/
/* this initialises only whole tracks, so it skew is not an issue */
trkbytes=drive->secLength*drive->sectrk;
- for (i=0; i<trkbytes*drive->boottrk; i+=drive->secLength) if (write(fd, bootTracks+i, drive->secLength)!=drive->secLength)
+ for (i=0; i<trkbytes*drive->boottrk; i+=drive->secLength) if (write(fd, bootTracks+i, drive->secLength)!=(ssize_t)drive->secLength)
{
boo=strerror(errno);
close(fd);
memset(buf,0xe5,128);
bytes=drive->maxdir*32;
if (bytes%trkbytes) bytes=((bytes+trkbytes)/trkbytes)*trkbytes;
- if (drive->type==CPMFS_P2DOS || drive->type==CPMFS_DR3) buf[3*32]=0x21;
+ if (timeStamps && (drive->type==CPMFS_P2DOS || drive->type==CPMFS_DR3)) buf[3*32]=0x21;
memcpy(firstbuf,buf,128);
if (drive->type==CPMFS_DR3)
{
firstbuf[0]=0x20;
for (i=0; i<11 && *label; ++i,++label) firstbuf[1+i]=toupper(*label&0x7f);
while (i<11) firstbuf[1+i++]=' ';
- firstbuf[12]=0x11; /* label set and first time stamp is creation date */
+ firstbuf[12]=timeStamps ? 0x11 : 0x01; /* label set and first time stamp is creation date */
memset(&firstbuf[13],0,1+2+8);
- time(&now);
- t=localtime(&now);
- min=((t->tm_min/10)<<4)|(t->tm_min%10);
- hour=((t->tm_hour/10)<<4)|(t->tm_hour%10);
- for (i=1978,days=0; i < 1900 + t->tm_year; ++i)
+ if (timeStamps)
{
- days+=365;
- if (i%4==0 && (i%100!=0 || i%400==0)) ++days;
+ int year;
+
+ /* Stamp label. */
+ time(&now);
+ t=localtime(&now);
+ min=((t->tm_min/10)<<4)|(t->tm_min%10);
+ hour=((t->tm_hour/10)<<4)|(t->tm_hour%10);
+ for (year=1978,days=0; year<1900+t->tm_year; ++year)
+ {
+ days+=365;
+ if (year%4==0 && (year%100!=0 || year%400==0)) ++days;
+ }
+ days += t->tm_yday + 1;
+ firstbuf[24]=firstbuf[28]=days&0xff; firstbuf[25]=firstbuf[29]=days>>8;
+ firstbuf[26]=firstbuf[30]=hour;
+ firstbuf[27]=firstbuf[31]=min;
}
- days += t->tm_yday + 1;
- firstbuf[24]=firstbuf[28]=days&0xff; firstbuf[25]=firstbuf[29]=days>>8;
- firstbuf[26]=firstbuf[30]=hour;
- firstbuf[27]=firstbuf[31]=min;
}
- for (i=0; i < bytes; i += 128) if (write(fd, i==0 ? firstbuf : buf, 128)!=128)
+ for (i=0; i<bytes; i+=128) if (write(fd, i==0 ? firstbuf : buf, 128)!=128)
{
boo=strerror(errno);
close(fd);
return -1;
}
/*}}}*/
+ if (timeStamps && !(drive->type==CPMFS_P2DOS || drive->type==CPMFS_DR3)) /*{{{*/
+ {
+ int offset,j;
+ struct cpmInode ino, root;
+ static const char sig[] = "!!!TIME";
+ unsigned int records;
+ struct dsDate *ds;
+ struct cpmSuperBlock super;
+ const char *err;
+
+ if ((err=Device_open(&super.dev,name,O_RDWR,NULL)))
+ {
+ fprintf(stderr,"%s: can not open %s (%s)\n",cmd,name,err);
+ exit(1);
+ }
+ cpmReadSuper(&super,&root,format);
+
+ records=root.sb->maxdir/8;
+ if (!(ds=malloc(records*128)))
+ {
+ cpmUmount(&super);
+ return -1;
+ }
+ memset(ds,0,records*128);
+ offset=15;
+ for (i=0; i<records; i++)
+ {
+ for (j=0; j<7; j++,offset+=16)
+ {
+ *((char*)ds+offset) = sig[j];
+ }
+ /* skip checksum byte */
+ offset+=16;
+ }
+
+ /* Set things up so cpmSync will generate checksums and write the
+ * file.
+ */
+ if (cpmCreat(&root,"00!!!TIME&.DAT",&ino,0)==-1)
+ {
+ fprintf(stderr,"%s: Unable to create DateStamper file: %s\n",cmd,boo);
+ return -1;
+ }
+ root.sb->ds=ds;
+ root.sb->dirtyDs=1;
+ cpmUmount(&super);
+ }
+ /*}}}*/
+
return 0;
}
/*}}}*/
struct cpmSuperBlock drive;
struct cpmInode root;
const char *label="unlabeled";
+ int timeStamps=0;
size_t bootTrackSize,used;
char *bootTracks;
const char *boot[4]={(const char*)0,(const char*)0,(const char*)0,(const char*)0};
if (!(format=getenv("CPMTOOLSFMT"))) format=FORMAT;
- while ((c=getopt(argc,argv,"b:f:L:h?"))!=EOF) switch(c)
+ while ((c=getopt(argc,argv,"b:f:L:th?"))!=EOF) switch(c)
{
case 'b':
{
}
case 'f': format=optarg; break;
case 'L': label=optarg; break;
+ case 't': timeStamps=1; break;
case 'h':
case '?': usage=1; break;
}
if (usage)
{
- fprintf(stderr,"Usage: %s [-f format] [-b boot] [-L label] image\n",cmd);
+ fprintf(stderr,"Usage: %s [-f format] [-b boot] [-L label] [-t] image\n",cmd);
exit(1);
}
drive.dev.opened=0;
used+=size;
close(fd);
}
- if (mkfs(&drive,image,label,bootTracks)==-1)
+ if (mkfs(&drive,image,format,label,bootTracks,timeStamps)==-1)
{
fprintf(stderr,"%s: can not make new file system: %s\n",cmd,boo);
exit(1);