#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
-#
+
+timestamp='2001-09-04'
+
# 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
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
-# don't specify an explicit system type (host/target name).
-#
-# Only a few systems have been added to this list; please add others
-# (but try to keep the structure clean).
-#
+# don't specify an explicit build system type.
-# Use $HOST_CC if defined. $CC may point to a cross-compiler
-if test x"$CC_FOR_BUILD" = x; then
- if test x"$HOST_CC" != x; then
- CC_FOR_BUILD="$HOST_CC"
- else
- if test x"$CC" != x; then
- CC_FOR_BUILD="$CC"
- else
- CC_FOR_BUILD=cc
- fi
- fi
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
fi
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script.
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int dummy(){}" > $dummy.c ;
+ for c in cc gcc c89 ; do
+ ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
+ if test $? = 0 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ rm -f $dummy.c $dummy.o $dummy.rel ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac'
+
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 8/24/94.)
+# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
-
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# object file format.
# Determine the machine/vendor (is the vendor relevant).
case "${UNAME_MACHINE}" in
- amiga) machine=m68k-cbm ;;
+ amiga) machine=m68k-unknown ;;
arm32) machine=arm-unknown ;;
atari*) machine=m68k-atari ;;
sun3*) machine=m68k-sun ;;
ibmrt|romp-ibm) machine=romp-ibm ;;
*) machine=${UNAME_MACHINE}-unknown ;;
esac
- # The Operating System including object format.
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE}" in
+ i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
# The OS release
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
jsr \$26,exit
.end main
EOF
+ eval $set_cc_for_build
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
if test "$?" = 0 ; then
case `./$dummy` in
2-307)
UNAME_MACHINE="alphaev67"
;;
+ 2-1307)
+ UNAME_MACHINE="alphaev68"
+ ;;
esac
fi
rm -f $dummy.s $dummy
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
- echo m68k-cbm-sysv4
+ echo m68k-unknown-sysv4
exit 0;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
- SR2?01:HI-UX/MPP:*:*)
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
+ sparc*:NetBSD:*)
+ echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
+ exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
EOF
$CC_FOR_BUILD $dummy.c -o $dummy \
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm $dummy.c $dummy && exit 0
+ && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i?86:AIX:*:*)
+ i*86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
exit(0);
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
- *:AIX:*:4)
+ *:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
- if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV=4.${UNAME_RELEASE}
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
+ case "${HPUX_REV}" in
+ 11.[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" ;;
+ esac ;;
+ esac
+ fi ;;
+ esac
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
- rm -f $dummy.c $dummy
+ (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+ if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
+ rm -f $dummy.c $dummy
+ fi ;;
esac
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit 0 ;;
3050*:HI-UX:*:*)
+ eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
exit (0);
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+ $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
- *9??*:MPE/iX:*:*)
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
- i?86:OSF1:*:*)
+ i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE}
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
- CRAY*T3E:*:*:*)
+ CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
- F300:UNIX_System_V:*:*)
+ 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 "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
- F301:UNIX_System_V:*:*)
- echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
- exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
- *:Linux:*:*)
-
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+ case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
+ big) echo mips-unknown-linux-gnu && exit 0 ;;
+ little) echo mipsel-unknown-linux-gnu && exit 0 ;;
+ esac
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit 0 ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit 0 ;;
+ 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 ;;
+ esac
+ exit 0 ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit 0 ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit 0 ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit 0 ;;
+ i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
- ld_help_string=`cd /; ld --help 2>&1`
- ld_supported_emulations=`echo $ld_help_string \
- | sed -ne '/supported emulations:/!d
+ ld_supported_targets=`cd /; ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
- s/.*supported emulations: *//
+ s/.*supported targets: *//
s/ .*//
p'`
- case "$ld_supported_emulations" in
- *ia64)
- echo "${UNAME_MACHINE}-unknown-linux"
- exit 0
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
;;
- i?86linux)
+ a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0
- ;;
- elf_i?86)
- echo "${UNAME_MACHINE}-pc-linux"
- exit 0
- ;;
- i?86coff)
+ exit 0 ;;
+ coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0
- ;;
- sparclinux)
- echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
- exit 0
- ;;
- armlinux)
- echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
- exit 0
- ;;
- elf32arm*)
- echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
- exit 0
- ;;
- armelf_linux*)
- echo "${UNAME_MACHINE}-unknown-linux-gnu"
- exit 0
- ;;
- m68klinux)
- echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
- exit 0
- ;;
- elf32ppc | elf32ppclinux)
- # Determine Lib Version
- cat >$dummy.c <<EOF
-#include <features.h>
-#if defined(__GLIBC__)
-extern char __libc_version[];
-extern char __libc_release[];
-#endif
-main(argc, argv)
- int argc;
- char *argv[];
-{
-#if defined(__GLIBC__)
- printf("%s %s\n", __libc_version, __libc_release);
-#else
- printf("unkown\n");
-#endif
- return 0;
-}
-EOF
- LIBC=""
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
- if test "$?" = 0 ; then
- ./$dummy | grep 1\.99 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
- fi
- rm -f $dummy.c $dummy
- echo powerpc-unknown-linux-gnu${LIBC}
- exit 0
- ;;
+ exit 0 ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit 0 ;;
esac
-
- if test "${UNAME_MACHINE}" = "alpha" ; then
- cat <<EOF >$dummy.s
- .data
- \$Lformat:
- .byte 37,100,45,37,120,10,0 # "%d-%x\n"
-
- .text
- .globl main
- .align 4
- .ent main
- main:
- .frame \$30,16,\$26,0
- ldgp \$29,0(\$27)
- .prologue 1
- .long 0x47e03d80 # implver \$0
- lda \$2,-1
- .long 0x47e20c21 # amask \$2,\$1
- lda \$16,\$Lformat
- mov \$0,\$17
- not \$1,\$18
- jsr \$26,printf
- ldgp \$29,0(\$26)
- mov 0,\$16
- jsr \$26,exit
- .end main
-EOF
- LIBC=""
- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
- if test "$?" = 0 ; then
- case `./$dummy` in
- 0-0)
- UNAME_MACHINE="alpha"
- ;;
- 1-0)
- UNAME_MACHINE="alphaev5"
- ;;
- 1-1)
- UNAME_MACHINE="alphaev56"
- ;;
- 1-101)
- UNAME_MACHINE="alphapca56"
- ;;
- 2-303)
- UNAME_MACHINE="alphaev6"
- ;;
- 2-307)
- UNAME_MACHINE="alphaev67"
- ;;
- esac
-
- objdump --private-headers $dummy | \
- grep ld.so.1 > /dev/null
- if test "$?" = 0 ; then
- LIBC="libc1"
- fi
- fi
- rm -f $dummy.s $dummy
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
- elif test "${UNAME_MACHINE}" = "mips" ; then
- cat >$dummy.c <<EOF
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __MIPSEB__
- printf ("%s-unknown-linux-gnu\n", argv[1]);
-#endif
-#ifdef __MIPSEL__
- printf ("%sel-unknown-linux-gnu\n", argv[1]);
-#endif
- return 0;
-}
-EOF
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
- elif test "${UNAME_MACHINE}" = "s390"; then
- echo s390-ibm-linux && exit 0
- else
- # Either a pre-BFD a.out linker (linux-gnuoldld)
- # or one that does not give us useful --help.
- # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
- # If ld does not provide *any* "supported emulations:"
- # that means it is gnuoldld.
- echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
- test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
-
- case "${UNAME_MACHINE}" in
- i?86)
- VENDOR=pc;
- ;;
- *)
- VENDOR=unknown;
- ;;
- esac
- # Determine whether the default compiler is a.out or elf
- cat >$dummy.c <<EOF
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ cat >$dummy.c <<EOF
#include <features.h>
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
- printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
+ printf ("%s-pc-linux-gnu\n", argv[1]);
# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+ printf ("%s-pc-linux-gnulibc1\n", argv[1]);
# endif
# else
- printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
+ printf ("%s-pc-linux-gnulibc1\n", argv[1]);
# endif
#else
- printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
+ printf ("%s-pc-linux-gnuaout\n", argv[1]);
#endif
return 0;
}
EOF
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
- fi ;;
-# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
-# are messed up and put the nodename in both sysname and nodename.
- i?86:DYNIX/ptx:4*:*)
+ $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
+ rm -f $dummy.c $dummy
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
echo i386-sequent-sysv4
exit 0 ;;
- i?86:UNIX_SV:4.2MP:2.*)
+ 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,
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
- i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit 0 ;;
- i?86:*:5:7*)
- # Fixed at (any) Pentium or better
- UNAME_MACHINE=i586
- if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
- echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
- fi
+ i*86:*:5:[78]*)
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit 0 ;;
- i?86:*:3.2:*)
+ i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
- i?86:*DOS:*:*)
+ i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
pc:*:*:*)
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
- m68*:LynxOS:2.*:*)
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
- i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
- rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
+ rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
echo ns32k-sni-sysv
fi
exit 0 ;;
- PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
- news*:NEWS-OS:*:6*)
+ news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit 0 ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
- NSR-W:NONSTOP_KERNEL:*:*)
+ NSR-[KW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit 0 ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit 0 ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit 0 ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit 0 ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit 0 ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit 0 ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit 0 ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
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/types.h>
#endif
#if defined (vax)
-#if !defined (ultrix)
- printf ("vax-dec-bsd\n"); exit (0);
-#else
- printf ("vax-dec-ultrix\n"); exit (0);
-#endif
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
#endif
#if defined (alliant) && defined (i860)
}
EOF
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
rm -f $dummy.c $dummy
# Apollos put the system type in the environment.
esac
fi
-#echo '(Unable to guess system type)' 1>&2
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ ftp://ftp.gnu.org/pub/gnu/config/
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
#! /bin/sh
-# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
-#
+
+timestamp='2001-09-07'
+
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-# Written by Per Bothner <bothner@cygnus.com>.
# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
-if [ x$1 = x ]
-then
- echo Configuration name missing. 1>&2
- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
- echo "or $0 ALIAS" 1>&2
- echo where ALIAS is a recognized configuration type. 1>&2
- exit 1
-fi
+me=`echo "$0" | sed -e 's,.*/,,'`
-# First pass through any local machine types.
-case $1 in
- *local*)
- echo $1
- exit 0
- ;;
- *)
- ;;
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu*)
+ nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple)
+ -apple | -axis)
os=
basic_machine=$1
;;
os=-vxworks
basic_machine=$1
;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
-hiux*)
os=-hiuxwe2
;;
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
- tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
- | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
- | 580 | i960 | h8300 \
- | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
- | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
- | hppa64 \
- | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
- | alphaev6[78] \
- | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
- | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
- | mips64orion | mips64orionel | mipstx39 | mipstx39el \
- | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
- | mips64vr5000 | miprs64vr5000el | mcore \
- | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
- | thumb | d10v | fr30 | avr)
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | c4x | clipper \
+ | d10v | d30v | dsp16xx \
+ | fr30 \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el | mips64vr4300 \
+ | mips64vr4300el | mips64vr5000 | mips64vr5000el \
+ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
+ | mipsisa32 \
+ | mn10200 | mn10300 \
+ | ns16k | ns32k \
+ | openrisc \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | s390 | s390x \
+ | sh | sh[34] | sh[34]eb | shbe | shle \
+ | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
+ | stormy16 | strongarm \
+ | tahoe | thumb | tic80 | tron \
+ | v850 \
+ | we32k \
+ | x86 | xscale \
+ | z8k)
basic_machine=$basic_machine-unknown
;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
- i[34567]86)
+ i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
exit 1
;;
# Recognize the basic CPU types with company name.
- # FIXME: clean up the formatting here.
- vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
- | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
- | xmp-* | ymp-* \
- | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
- | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
- | hppa2.0n-* | hppa64-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
- | alphaev6[78]-* \
- | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
- | clipper-* | orion-* \
- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
- | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
- | mips64el-* | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
- | mipstx39-* | mipstx39el-* | mcore-* \
- | f301-* | armv*-* | s390-* | sv1-* | t3e-* \
- | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
- | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \
- | bs2000-*)
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alphapca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armv*-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c54x-* \
+ | clipper-* | cray2-* | cydra-* \
+ | d10v-* | d30v-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | m32r-* \
+ | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
+ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \
+ | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | s390-* | s390x-* \
+ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
+ | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+ | v850-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
+ | ymp-* \
+ | z8k-*)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
os=-sysv
;;
amiga | amiga-*)
- basic_machine=m68k-cbm
+ basic_machine=m68k-unknown
;;
amigaos | amigados)
- basic_machine=m68k-cbm
+ basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
- basic_machine=m68k-cbm
+ basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=cray2-cray
os=-unicos
;;
- [ctj]90-cray)
- basic_machine=c90-cray
+ [cjt]90)
+ basic_machine=${basic_machine}-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
da30 | da30-*)
basic_machine=m68k-da30
;;
basic_machine=tron-gmicro
os=-sysv
;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
basic_machine=i370-ibm
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i[34567]86v32)
+ i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
- i[34567]86v4*)
+ i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
- i[34567]86v)
+ i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
- i[34567]86sol2)
+ i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
basic_machine=i386-unknown
os=-vsta
;;
- i386-go32 | go32)
- basic_machine=i386-unknown
- os=-go32
- ;;
- i386-mingw32 | mingw32)
- basic_machine=i386-unknown
- os=-mingw32
- ;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
basic_machine=ns32k-utek
os=-sysv
;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
miniframe)
basic_machine=m68000-convergent
;;
os=-coff
;;
msdos)
- basic_machine=i386-unknown
+ basic_machine=i386-pc
os=-msdos
;;
mvs)
basic_machine=i960-intel
os=-mon960
;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
np1)
basic_machine=np1-gould
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
- pentium | p5 | k5 | k6 | nexen)
+ pentium | p5 | k5 | k6 | nexgen)
basic_machine=i586-pc
;;
- pentiumpro | p6 | 6x86)
+ pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc
;;
pentiumii | pentium2)
- basic_machine=i786-pc
+ basic_machine=i686-pc
;;
- pentium-* | p5-* | k5-* | k6-* | nexen-*)
+ pentium-* | p5-* | k5-* | k6-* | nexgen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- pentiumpro-* | p6-* | 6x86-*)
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
- power) basic_machine=rs6000-ibm
+ power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
ps2)
basic_machine=i386-ibm
;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
basic_machine=t3e-cray
os=-unicos
;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
basic_machine=hppa1.1-winbond
os=-proelf
;;
+ windows32)
+ basic_machine=i386-pc
+ os=-windows32-msvcrt
+ ;;
xmp)
basic_machine=xmp-cray
os=-unicos
vax)
basic_machine=vax-dec
;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
- sparc | sparcv9)
+ sh3 | sh4 | sh3eb | sh4eb)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
cydra)
basic_machine=c4x-none
os=-coff
;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit*)
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
- x86-* | i[34567]86-*)
+ x86-* | i*86-*)
;;
*)
os=-nto$os
-ns2 )
os=-nextstep2
;;
- -nsk)
+ -nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-xenix)
os=-xenix
;;
- -*mint | -*MiNT)
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-none)
arm*-semi)
os=-aout
;;
+ pdp10-*)
+ os=-tops20
+ ;;
pdp11-*)
os=-none
;;
*-masscomp)
os=-rtu
;;
- f301-fujitsu)
+ f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
-mpw* | -macos*)
vendor=apple
;;
- -*mint | -*MiNT)
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
+ -vos*)
+ vendor=stratus
+ ;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
AC_PATH_PROGS(TRUEPRG, true, :)
AC_PATH_PROGS(FALSEPRG, false, :)
-dnl AC_CANONICAL_HOST
+AC_CANONICAL_HOST
dnl bacula version
VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:717: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+
VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
DATE=`sed -n -e 's/^.* \t*BDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
LSMDATE=`sed -n -e 's/^.*LSMDATE.*"\(.*\)"$/\1/p' ${srcdir}/src/version.h`
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:721: checking for $ac_word" >&5
+echo "configure:748: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:751: checking for $ac_word" >&5
+echo "configure:778: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:802: checking for $ac_word" >&5
+echo "configure:829: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:834: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:861: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cat > conftest.$ac_ext << EOF
-#line 845 "configure"
+#line 872 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:850: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:876: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:903: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:881: checking whether we are using GNU C" >&5
+echo "configure:908: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:917: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:909: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:936: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:945: checking for $ac_word" >&5
+echo "configure:972: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:977: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+echo "configure:1004: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
ac_ext=C
# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cat > conftest.$ac_ext << EOF
-#line 988 "configure"
+#line 1015 "configure"
#include "confdefs.h"
int main(){return(0);}
EOF
-if { (eval echo configure:993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cxx_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1019: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1046: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
cross_compiling=$ac_cv_prog_cxx_cross
echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1024: checking whether we are using GNU C++" >&5
+echo "configure:1051: checking whether we are using GNU C++" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=
echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1052: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1079: checking whether ${CXX-g++} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
'void exit (int);'
do
cat > conftest.$ac_ext <<EOF
-#line 1093 "configure"
+#line 1120 "configure"
#include "confdefs.h"
#include <stdlib.h>
$ac_declaration
exit (42);
; return 0; }
EOF
-if { (eval echo configure:1101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1128: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
echo "configure: failed program was:" >&5
fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 1111 "configure"
+#line 1138 "configure"
#include "confdefs.h"
$ac_declaration
int main() {
exit (42);
; return 0; }
EOF
-if { (eval echo configure:1118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
break
else
if test "x$CC" != xcc; then
echo $ac_n "checking whether $CC and cc understand -c and -o together""... $ac_c" 1>&6
-echo "configure:1136: checking whether $CC and cc understand -c and -o together" >&5
+echo "configure:1163: checking whether $CC and cc understand -c and -o together" >&5
else
echo $ac_n "checking whether cc understands -c and -o together""... $ac_c" 1>&6
-echo "configure:1139: checking whether cc understands -c and -o together" >&5
+echo "configure:1166: checking whether cc understands -c and -o together" >&5
fi
set dummy $CC; ac_cc="`echo $2 |
sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
ac_try='${CC-cc} -c conftest.c -o conftest.o 1>&5'
-if { (eval echo configure:1151: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+if { (eval echo configure:1178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+ test -f conftest.o && { (eval echo configure:1179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
if test "x$CC" != xcc; then
# Test first that cc exists at all.
- if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
ac_try='cc -c conftest.c -o conftest.o 1>&5'
- if { (eval echo configure:1159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+ if { (eval echo configure:1186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+ test -f conftest.o && { (eval echo configure:1187: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
then
# cc works too.
:
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1186: checking how to run the C preprocessor" >&5
+echo "configure:1213: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1201 "configure"
+#line 1228 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1207: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1218 "configure"
+#line 1245 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1235 "configure"
+#line 1262 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1267: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1294: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 1273 "configure"
+#line 1300 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1291 "configure"
+#line 1318 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1332: checking for a BSD compatible install" >&5
+echo "configure:1359: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1387: checking for $ac_word" >&5
+echo "configure:1414: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "mv", so it can be a program name with args.
set dummy mv; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1417: checking for $ac_word" >&5
+echo "configure:1444: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MV'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "rm", so it can be a program name with args.
set dummy rm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1453: checking for $ac_word" >&5
+echo "configure:1480: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cp", so it can be a program name with args.
set dummy cp; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1489: checking for $ac_word" >&5
+echo "configure:1516: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "sed", so it can be a program name with args.
set dummy sed; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1525: checking for $ac_word" >&5
+echo "configure:1552: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SED'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "awk", so it can be a program name with args.
set dummy awk; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1561: checking for $ac_word" >&5
+echo "configure:1588: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_AWK'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "echo", so it can be a program name with args.
set dummy echo; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1597: checking for $ac_word" >&5
+echo "configure:1624: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ECHO'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cmp", so it can be a program name with args.
set dummy cmp; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1633: checking for $ac_word" >&5
+echo "configure:1660: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "tbl", so it can be a program name with args.
set dummy tbl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1669: checking for $ac_word" >&5
+echo "configure:1696: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_TBL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1705: checking for $ac_word" >&5
+echo "configure:1732: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1741: checking for $ac_word" >&5
+echo "configure:1768: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "openssl", so it can be a program name with args.
set dummy openssl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1777: checking for $ac_word" >&5
+echo "configure:1804: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_OPENSSL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "mtx", so it can be a program name with args.
set dummy mtx; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1813: checking for $ac_word" >&5
+echo "configure:1840: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MTX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1849: checking for $ac_word" >&5
+echo "configure:1876: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKGCONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking for Operating System""... $ac_c" 1>&6
-echo "configure:1897: checking for Operating System" >&5
+echo "configure:1924: checking for Operating System" >&5
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1899: checking for Cygwin environment" >&5
+echo "configure:1926: checking for Cygwin environment" >&5
if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1904 "configure"
+#line 1931 "configure"
#include "confdefs.h"
int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:1915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1942: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
# -----------------------------------------------------------
# ----------------------------------------------------------
echo $ac_n "checking for Operating System Distribution""... $ac_c" 1>&6
-echo "configure:2261: checking for Operating System Distribution" >&5
+echo "configure:2288: checking for Operating System Distribution" >&5
if test "x$DISTNAME" != "x"
then
echo "distname set to $DISTNAME"
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2390: checking for $ac_word" >&5
+echo "configure:2417: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "gnome-config", so it can be a program name with args.
set dummy gnome-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2534: checking for $ac_word" >&5
+echo "configure:2561: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
no_gnome_config="yes"
else
echo $ac_n "checking if $GNOME_CONFIG works""... $ac_c" 1>&6
-echo "configure:2571: checking if $GNOME_CONFIG works" >&5
+echo "configure:2598: checking if $GNOME_CONFIG works" >&5
if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
echo "$ac_t""yes" 1>&6
# Extract the first word of "orbit-config", so it can be a program name with args.
set dummy orbit-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2579: checking for $ac_word" >&5
+echo "configure:2606: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ORBIT_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "orbit-idl", so it can be a program name with args.
set dummy orbit-idl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2615: checking for $ac_word" >&5
+echo "configure:2642: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ORBIT_IDL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for working ORBit environment""... $ac_c" 1>&6
-echo "configure:2649: checking for working ORBit environment" >&5
+echo "configure:2676: checking for working ORBit environment" >&5
if eval "test \"`echo '$''{'gnome_cv_orbit_found'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking for gnorba libraries""... $ac_c" 1>&6
-echo "configure:2685: checking for gnorba libraries" >&5
+echo "configure:2712: checking for gnorba libraries" >&5
if eval "test \"`echo '$''{'gnome_cv_gnorba_found'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$no_gnome_config" = "yes"; then
echo $ac_n "checking for gnomeConf.sh file in $gnome_prefix""... $ac_c" 1>&6
-echo "configure:2749: checking for gnomeConf.sh file in $gnome_prefix" >&5
+echo "configure:2776: checking for gnomeConf.sh file in $gnome_prefix" >&5
if test -f $gnome_prefix/gnomeConf.sh; then
echo "$ac_t""found" 1>&6
echo "loading gnome configuration from" \
n=""
for i in $n; do
echo $ac_n "checking extra library \"$i\"""... $ac_c" 1>&6
-echo "configure:2769: checking extra library \"$i\"" >&5
+echo "configure:2796: checking extra library \"$i\"" >&5
case $i in
applets)
fi
ac_safe=`echo "${with_readline}/readline.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for ${with_readline}/readline.h""... $ac_c" 1>&6
-echo "configure:2956: checking for ${with_readline}/readline.h" >&5
+echo "configure:2983: checking for ${with_readline}/readline.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2961 "configure"
+#line 2988 "configure"
#include "confdefs.h"
#include <${with_readline}/readline.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2966: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
# check for standard readline library
ac_safe=`echo "/usr/include/readline/readline.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for /usr/include/readline/readline.h""... $ac_c" 1>&6
-echo "configure:3004: checking for /usr/include/readline/readline.h" >&5
+echo "configure:3031: checking for /usr/include/readline/readline.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3009 "configure"
+#line 3036 "configure"
#include "confdefs.h"
#include </usr/include/readline/readline.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
# Did not find standard library, so try Bacula's default
ac_safe=`echo "${TOP_DIR}/depkgs/readline/readline.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for ${TOP_DIR}/depkgs/readline/readline.h""... $ac_c" 1>&6
-echo "configure:3044: checking for ${TOP_DIR}/depkgs/readline/readline.h" >&5
+echo "configure:3071: checking for ${TOP_DIR}/depkgs/readline/readline.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3049 "configure"
+#line 3076 "configure"
#include "confdefs.h"
#include <${TOP_DIR}/depkgs/readline/readline.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3081: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6
-echo "configure:3106: checking whether stat file-mode macros are broken" >&5
+echo "configure:3133: checking whether stat file-mode macros are broken" >&5
if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3111 "configure"
+#line 3138 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:3166: checking for $ac_hdr that defines DIR" >&5
+echo "configure:3193: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3171 "configure"
+#line 3198 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:3179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:3204: checking for opendir in -ldir" >&5
+echo "configure:3231: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3212 "configure"
+#line 3239 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
opendir()
; return 0; }
EOF
-if { (eval echo configure:3223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:3245: checking for opendir in -lx" >&5
+echo "configure:3272: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3253 "configure"
+#line 3280 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
opendir()
; return 0; }
EOF
-if { (eval echo configure:3264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
for ac_func in strcasecmp select setenv putenv tcgetattr setlocale lstat lchown
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3290: checking for $ac_func" >&5
+echo "configure:3317: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3295 "configure"
+#line 3322 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:3318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
for ac_func in nanosleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3345: checking for $ac_func" >&5
+echo "configure:3372: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3350 "configure"
+#line 3377 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:3373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
# EXTRAOBJ="$EXTRAOBJ lib/getopt.o lib/getopt1.o"])
echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:3403: checking for getopt_long" >&5
+echo "configure:3430: checking for getopt_long" >&5
if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3408 "configure"
+#line 3435 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char getopt_long(); below. */
; return 0; }
EOF
-if { (eval echo configure:3431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_getopt_long=yes"
else
echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:3456: checking for working strcoll" >&5
+echo "configure:3483: checking for working strcoll" >&5
if eval "test \"`echo '$''{'ac_cv_func_strcoll_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_func_strcoll_works=no
else
cat > conftest.$ac_ext <<EOF
-#line 3464 "configure"
+#line 3491 "configure"
#include "confdefs.h"
#include <string.h>
main ()
strcoll ("123", "456") >= 0);
}
EOF
-if { (eval echo configure:3474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_strcoll_works=yes
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3502: checking for $ac_hdr" >&5
+echo "configure:3529: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3507 "configure"
+#line 3534 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3539: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
saved_LIBS="$LIBS"
LIBS="$LIBS -lwrap -lnsl"
echo $ac_n "checking for libwrap""... $ac_c" 1>&6
-echo "configure:3677: checking for libwrap" >&5
+echo "configure:3704: checking for libwrap" >&5
cat > conftest.$ac_ext <<EOF
-#line 3679 "configure"
+#line 3706 "configure"
#include "confdefs.h"
#include <tcpd.h>
int deny_severity = 0;
hosts_access(req);
; return 0; }
EOF
-if { (eval echo configure:3689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
db_found=no
echo $ac_n "checking for MySQL support""... $ac_c" 1>&6
-echo "configure:3961: checking for MySQL support" >&5
+echo "configure:3988: checking for MySQL support" >&5
# Check whether --with-mysql or --without-mysql was given.
if test "${with_mysql+set}" = set; then
withval="$with_mysql"
db_found=no
echo $ac_n "checking for SQLite support""... $ac_c" 1>&6
-echo "configure:4118: checking for SQLite support" >&5
+echo "configure:4145: checking for SQLite support" >&5
# Check whether --with-sqlite or --without-sqlite was given.
if test "${with_sqlite+set}" = set; then
withval="$with_sqlite"
echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:4194: checking for mingw32 environment" >&5
+echo "configure:4221: checking for mingw32 environment" >&5
if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4199 "configure"
+#line 4226 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:4206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:4225: checking for executable suffix" >&5
+echo "configure:4252: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:4235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:4262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
largefile_support="no"
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:4258: checking build system type" >&5
+echo "configure:4285: checking build system type" >&5
build_alias=$build
case "$build_alias" in
build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
echo "$ac_t""$build" 1>&6
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
-fi
-
-echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:4282: checking host system type" >&5
-
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
- NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
-
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
-
if test $host != $build; then
ac_tool_prefix=${host_alias}-
else
s%@BUILD_DIR@%$BUILD_DIR%g
s%@TRUEPRG@%$TRUEPRG%g
s%@FALSEPRG@%$FALSEPRG%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
s%@VERSION@%$VERSION%g
s%@DATE@%$DATE%g
s%@LSMDATE@%$LSMDATE%g
s%@cats@%$cats%g
s%@DB_NAME@%$DB_NAME%g
s%@EXEEXT@%$EXEEXT%g
-s%@host@%$host%g
-s%@host_alias@%$host_alias%g
-s%@host_cpu@%$host_cpu%g
-s%@host_vendor@%$host_vendor%g
-s%@host_os@%$host_os%g
s%@build@%$build%g
s%@build_alias@%$build_alias%g
s%@build_cpu@%$build_cpu%g
(./create_mys... ./make_my...).
- Document c:/working directory better than /working directory.
+- Document Heart beat code
+
Testing to do: (painful)
- that ALL console command line options work and are always implemented
- Figure out how to use ssh or stunnel to protect Bacula communications.
For 1.31 release:
-- Finish Windows implementation.
+- Finish Windows implementation (add setting of correct type on restore,
+ add Portable Data Format flag).
- Remove multiple simultaneous devices code in SD.
- Check that Block number in JobMedia are correct.
- Increment DB version prior to releasing.
#undef strdup
#define strdup(buf) bad_call_on_strdup_use_bstrdup(buf)
+/* Use our fgets which handles interrupts */
+#undef fgets
+#define fgets(x,y,z) bfgets((x), (y), (z))
+
#ifdef DEBUG
#define bstrdup(str) strcpy((char *) b_malloc(__FILE__,__LINE__,strlen((str))+1),(str))
#else
if (!no_signals) {
init_signals(terminate_dird);
}
- signal(SIGCHLD, SIG_IGN);
if (argc) {
if (configfile != NULL) {
before = edit_run_codes(jcr, before, jcr->job->RunBeforeJob);
bpipe = open_bpipe(before, 0, "r");
+ free_pool_memory(before);
while (fgets(line, sizeof(line), bpipe->rfd)) {
Jmsg(jcr, M_INFO, 0, _("RunBefore: %s"), line);
}
status);
set_jcr_job_status(jcr, JS_FatalError);
update_job_end_record(jcr);
- free_pool_memory(before);
goto bail_out;
}
- free_pool_memory(before);
}
switch (jcr->JobType) {
case JT_BACKUP:
after = edit_run_codes(jcr, after, jcr->job->RunAfterJob);
bpipe = open_bpipe(after, 0, "r");
+ free_pool_memory(after);
while (fgets(line, sizeof(line), bpipe->rfd)) {
Jmsg(jcr, M_INFO, 0, _("RunAfter: %s"), line);
}
set_jcr_job_status(jcr, JS_FatalError);
update_job_end_record(jcr);
}
- free_pool_memory(after);
}
}
bail_out:
*/
jcr->reschedule_count++;
jcr->sched_time = time(NULL) + jcr->job->RescheduleInterval;
- Dmsg2(000, "Reschedule Job %s in %d seconds.\n", jcr->Job,
+ Dmsg2(100, "Rescheduled Job %s to re-run in %d seconds.\n", jcr->Job,
(int)jcr->job->RescheduleInterval);
jcr->JobStatus = JS_Created; /* force new status */
dird_free_jcr(jcr); /* partial cleanup old stuff */
fdbr.FileId = 0;
fdbr.JobId = node->JobId;
if (db_get_file_attributes_record(ua->jcr, ua->db, cwd, &fdbr)) {
- uint32_t LinkFI;
+ int32_t LinkFI;
decode_stat(fdbr.LStat, &statp, &LinkFI); /* decode stat pkt */
/*
* If we point to a hard linked file, traverse the tree to
fdbr.FileId = 0;
fdbr.JobId = node->JobId;
if (db_get_file_attributes_record(ua->jcr, ua->db, cwd, &fdbr)) {
- uint32_t LinkFI;
+ int32_t LinkFI;
decode_stat(fdbr.LStat, &statp, &LinkFI); /* decode stat pkt */
ls_output(buf, cwd, node->extract, &statp);
bsendmsg(ua, "%s\n", buf);
* Got attributes stream, decode it
*/
if (stream == STREAM_UNIX_ATTRIBUTES || stream == STREAM_UNIX_ATTRIBUTES_EX) {
- uint32_t LinkFIf, LinkFIc;
+ int32_t LinkFIf, LinkFIc;
Dmsg2(400, "file_index=%d attr=%s\n", file_index, attr);
jcr->JobFiles++;
jcr->FileIndex = file_index; /* remember attribute file_index */
switch (stream) {
case STREAM_UNIX_ATTRIBUTES:
case STREAM_UNIX_ATTRIBUTES_EX:
- uint32_t LinkFI;
- int data_stream;
Dmsg1(30, "Stream=Unix Attributes. extract=%d\n", extract);
/* If extracting, it was from previous stream, so
Dmsg3(200, "File %s\nattrib=%s\nattribsEx=%s\n", attr->fname,
attr->attr, attr->attrEx);
- data_stream = decode_stat(attr->attr, &attr->statp, &LinkFI);
+ attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
- if (!is_stream_supported(data_stream)) {
+ if (!is_stream_supported(attr->data_stream)) {
if (!non_support_data++) {
Jmsg(jcr, M_ERROR, 0, _("%s stream not supported on this Client.\n"),
- stream_to_ascii(data_stream));
+ stream_to_ascii(attr->data_stream));
}
continue;
}
/* Decode a stat packet from base64 characters */
-int decode_stat(char *buf, struct stat *statp, uint32_t *LinkFI)
+int decode_stat(char *buf, struct stat *statp, int32_t *LinkFI)
{
char *p = buf;
int64_t val;
int set_win32_backup(BFILE *bfd, int enable)
{
- return 0;
+ return !enable;
}
int is_win32_backup(void)
struct stat mstatp;
binit(ofd);
+ /* Set desired writing mode (BackupWrite() or write()) */
+ switch (attr->data_stream) {
+ case 0:
+ break; /* use default defined by system */
+
+ /* These streams require using BackupWrite() */
+ case STREAM_WIN32_ATTRIBUTES:
+ case STREAM_WIN32_DATA:
+ case STREAM_WIN32_GZIP_DATA:
+ if (!set_win32_backup(ofd, 1)) { /* use BackupWrite() */
+ Jmsg(jcr, M_ERROR, 0, _("Could not set Win32 output format.\n"));
+ return CF_ERROR;
+ }
+
+ /* All other stream use standard system I/O (portable) */
+ default:
+ set_win32_backup(ofd, 0); /* Disable using BackupWrite() */
+ break;
+ }
+
new_mode = attr->statp.st_mode;
Dmsg2(300, "newmode=%x file=%s\n", new_mode, attr->ofname);
parent_mode = S_IWUSR | S_IXUSR | new_mode;
/* from attribs.c */
void encode_stat (char *buf, FF_PKT *ff_pkt, int data_stream);
-int decode_stat (char *buf, struct stat *statp, uint32_t *LinkFI);
+int decode_stat (char *buf, struct stat *statp, int32_t *LinkFI);
int encode_attribsEx (JCR *jcr, char *attribsEx, FF_PKT *ff_pkt);
int set_attributes (JCR *jcr, ATTR *attr, BFILE *ofd);
int select_data_stream(FF_PKT *ff_pkt);
int32_t data_stream; /* id of data stream to follow */
int32_t type; /* file type FT */
int32_t file_index; /* file index */
+ int32_t LinkFI; /* file index to data if hard link */
struct stat statp; /* decoded stat packet */
char *attr; /* attributes position */
char *attrEx; /* extended attributes if any */
/* wait for worker child to exit */
for ( ;; ) {
+ Dmsg2(200, "Wait for %d opt=%d\n", bpipe->worker_pid, wait_option);
wpid = waitpid(bpipe->worker_pid, &chldstatus, wait_option);
if (wpid == bpipe->worker_pid || (wpid == -1 && errno != EINTR)) {
+ Dmsg3(200, "Got break wpid=%d status=%d ERR=%s\n", wpid, chldstatus,
+ wpid==-1?strerror(errno):"none");
break;
}
+ Dmsg3(200, "Got wpid=%d status=%d ERR=%s\n", wpid, chldstatus,
+ wpid==-1?strerror(errno):"none");
if (remaining_wait > 0) {
bmicrosleep(1, 0); /* wait one second */
remaining_wait--;
if (wpid > 0) {
if (WIFEXITED(chldstatus)) { /* process exit()ed */
stat = WEXITSTATUS(chldstatus);
+ Dmsg1(200, "status =%d\n", stat);
} else if (WIFSIGNALED(chldstatus)) { /* process died */
stat = 1;
+ Dmsg0(200, "Signaled\n");
}
if (stat != 0) {
errno = ECHILD; /* set child errno */
stop_child_timer(bpipe->timer_id);
}
free(bpipe);
-#ifdef HAVE_FREEBSD_OS
- stat = 0; /* kludge because FreeBSD doesn't seem to return valid status */
-#endif
+ Dmsg1(200, "returning stat = %d\n", stat);
return stat;
}
return (long long int)strtod(ptr, endptr);
}
#endif
+
+/*
+ * Bacula's implementation of fgets(). The difference is that it handles
+ * being interrupted by a signal (e.g. a SIGCHLD).
+ */
+#undef bfgets
+char *bfgets(char *s, int size, FILE *fd)
+{
+ char *p = s;
+ int ch;
+ *p = 0;
+ for (int i=0; i < size-1; i++) {
+ do {
+ errno = 0;
+ ch = fgetc(fd);
+ } while (ch == -1 && (errno == EINTR || errno == EAGAIN));
+ if (ch == -1) {
+ if (i == 0) {
+ return NULL;
+ } else {
+ return s;
+ }
+ }
+ *p++ = ch;
+ *p = 0;
+ if (ch == '\n') {
+ break;
+ }
+ }
+ return s;
+}
int delete_pid_file (char *dir, char *progname, int port);
void drop (char *uid, char *gid);
int bmicrosleep (time_t sec, long msec);
+char *bfgets (char *s, int size, FILE *fd);
#ifndef HAVE_STRTOLL
-long long int strtoll(const char *ptr, char **endptr, int base);
+long long int strtoll (const char *ptr, char **endptr, int base);
#endif
/* bnet.c */
struct s_tree_node {
char *fname; /* file name */
- uint32_t FileIndex; /* file index */
+ int32_t FileIndex; /* file index */
uint32_t JobId; /* JobId */
short type; /* node type */
short extract; /* set if extracting */
struct s_tree_root {
char *fname; /* file name */
- uint32_t FileIndex; /* file index */
+ int32_t FileIndex; /* file index */
uint32_t JobId; /* JobId */
short type; /* node type */
short extract; /* set if extracting */
int do_append_data(JCR *jcr)
{
int32_t n;
- long file_index, stream, last_file_index;
+ int32_t file_index, stream, last_file_index;
BSOCK *ds;
BSOCK *fd_sock = jcr->file_bsock;
int ok = TRUE;
jcr->VolFirstIndex = 0;
jcr->run_time = time(NULL); /* start counting time for rates */
for (last_file_index = 0; ok && !job_canceled(jcr); ) {
- char info[100];
/* Read Stream header from the File daemon.
* The stream header consists of the following:
ok = FALSE;
break;
}
- if (sscanf(ds->msg, "%ld %ld %100s", &file_index, &stream, info) != 3) {
+
+ /*
+ * This hand scanning is a bit more complicated than a simple
+ * sscanf, but it allows us to handle any size integer up to
+ * int64_t without worrying about whether %d, %ld, %lld, or %q
+ * is the correct format for each different architecture.
+ * It is a real pity that sscanf() is not portable.
+ */
+ char *p = ds->msg;
+ while (B_ISSPACE(*p)) {
+ p++;
+ }
+ file_index = (int32_t)str_to_int64(p);
+ while (B_ISDIGIT(*p)) {
+ p++;
+ }
+ if (!B_ISSPACE(*p) || !B_ISDIGIT(*(p+1))) {
Jmsg1(jcr, M_FATAL, 0, _("Malformed data header from FD: %s\n"), ds->msg);
ok = FALSE;
break;
}
+ stream = (int32_t)str_to_int64(p);
+
Dmsg2(190, "<filed: Header FilInx=%d stream=%d\n", file_index, stream);
if (!(file_index > 0 && (file_index == last_file_index ||
}
if (file_is_included(ff, attr->fname) && !file_is_excluded(ff, attr->fname)) {
- uint32_t LinkFI;
- int data_stream;
- data_stream = decode_stat(attr->attr, &attr->statp, &LinkFI);
- if (!is_stream_supported(data_stream)) {
+ attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
+ if (!is_stream_supported(attr->data_stream)) {
if (!non_support_data++) {
Jmsg(jcr, M_ERROR, 0, _("%s stream not supported on this Client.\n"),
- stream_to_ascii(data_stream));
+ stream_to_ascii(attr->data_stream));
}
return;
}
/* File Attributes stream */
if (rec->Stream == STREAM_UNIX_ATTRIBUTES ||
rec->Stream == STREAM_UNIX_ATTRIBUTES_EX) {
- uint32_t LinkFI;
- int data_stream;
if (!unpack_attributes_record(jcr, rec->Stream, rec->data, attr)) {
Emsg0(M_ERROR_TERM, 0, _("Cannot continue.\n"));
rec->FileIndex, attr->file_index);
}
- data_stream = decode_stat(attr->attr, &attr->statp, &LinkFI);
- if (!is_stream_supported(data_stream)) {
+ attr->data_stream = decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
+ if (!is_stream_supported(attr->data_stream)) {
if (!non_support_data++) {
Jmsg(jcr, M_ERROR, 0, _("%s stream not supported on this Client.\n"),
- stream_to_ascii(data_stream));
+ stream_to_ascii(attr->data_stream));
}
return;
}
}
if (verbose > 1) {
- uint32_t LinkFI;
- decode_stat(attr->attr, &attr->statp, &LinkFI);
+ decode_stat(attr->attr, &attr->statp, &attr->LinkFI);
build_attr_output_fnames(bjcr, attr);
print_ls_output(bjcr, attr);
}
DEVICE *dev = NULL;
DEVRES *device = NULL;
-
+
/* Forward referenced subroutines */
static void do_tape_cmds();
static void helpcmd();
static uint64_t VolBytes;
static time_t now;
static double kbs;
-static long file_index;
+static int32_t file_index;
static int end_of_tape = 0;
static uint32_t LastBlock = 0;
static uint32_t eot_block;
/*********************************************************************
*
- * Main Bacula Pool Creation Program
+ * Main Bacula Pool Creation Program
*
*/
int main(int argc, char *argv[])
/* Sanity checks */
if (TAPE_BSIZE % DEV_BSIZE != 0 || TAPE_BSIZE / DEV_BSIZE == 0) {
Emsg2(M_ABORT, 0, "Tape block size (%d) not multiple of system size (%d)\n",
- TAPE_BSIZE, DEV_BSIZE);
+ TAPE_BSIZE, DEV_BSIZE);
}
if (TAPE_BSIZE != (1 << (ffs(TAPE_BSIZE)-1))) {
Emsg1(M_ABORT, 0, "Tape block size (%d) is not a power of 2\n", TAPE_BSIZE);
while ((ch = getopt(argc, argv, "b:c:d:sv?")) != -1) {
switch (ch) {
case 'b': /* bootstrap file */
- bsr = parse_bsr(NULL, optarg);
-// dump_bsr(bsr);
- break;
+ bsr = parse_bsr(NULL, optarg);
+// dump_bsr(bsr);
+ break;
case 'c': /* specify config file */
- if (configfile != NULL) {
- free(configfile);
- }
- configfile = bstrdup(optarg);
- break;
+ if (configfile != NULL) {
+ free(configfile);
+ }
+ configfile = bstrdup(optarg);
+ break;
case 'd': /* set debug level */
- debug_level = atoi(optarg);
- if (debug_level <= 0) {
- debug_level = 1;
- }
- break;
+ debug_level = atoi(optarg);
+ if (debug_level <= 0) {
+ debug_level = 1;
+ }
+ break;
case 's':
- signals = FALSE;
- break;
+ signals = FALSE;
+ break;
case 'v':
- verbose++;
- break;
+ verbose++;
+ break;
case '?':
- default:
- helpcmd();
- exit(0);
+ default:
+ helpcmd();
+ exit(0);
}
}
Dmsg0(129, "Opening device.\n");
if (open_dev(dev, jcr->VolumeName, READ_WRITE) < 0) {
Emsg1(M_FATAL, 0, _("dev open failed: %s\n"), dev->errmsg);
- unlock_device(dev);
- free_block(block);
- goto terminate;
+ unlock_device(dev);
+ free_block(block);
+ goto terminate;
}
}
Dmsg1(129, "open_dev %s OK\n", dev_name(dev));
}
term_msg();
- close_memory_pool(); /* free memory in pool */
+ close_memory_pool(); /* free memory in pool */
sm_dump(False);
exit(stat);
LockRes();
for (device=NULL; (device=(DEVRES *)GetNextRes(R_DEVICE, (RES *)device)); ) {
if (strcmp(device->device_name, dev->dev_name) == 0) {
- jcr->device = device; /* Arggg a bit of duplication here */
- device->dev = dev;
- dev->device = device;
- found = 1;
- break;
+ jcr->device = device; /* Arggg a bit of duplication here */
+ device->dev = dev;
+ dev->device = device;
+ found = 1;
+ break;
}
}
UnlockRes();
strcpy(cmd, VolumeName);
} else {
if (!get_cmd("Enter Volume Name: ")) {
- return;
+ return;
}
}
-
+
if (!(dev->state & ST_OPENED)) {
if (!open_device(dev)) {
Pmsg1(0, "Device open failed. ERR=%s\n", strerror_dev(dev));
}
/*
- * Read the tape label
+ * Read the tape label
*/
static void readlabelcmd()
{
switch (stat) {
case VOL_NO_LABEL:
Pmsg0(0, "Volume has no label.\n");
- break;
+ break;
case VOL_OK:
Pmsg0(0, "Volume label read correctly.\n");
- break;
+ break;
case VOL_IO_ERROR:
Pmsg1(0, "I/O error on device: ERR=%s", strerror_dev(dev));
- break;
+ break;
case VOL_NAME_ERROR:
Pmsg0(0, "Volume name error\n");
- break;
+ break;
case VOL_CREATE_ERROR:
Pmsg1(0, "Error creating label. ERR=%s", strerror_dev(dev));
- break;
+ break;
case VOL_VERSION_ERROR:
Pmsg0(0, "Volume version error.\n");
- break;
+ break;
case VOL_LABEL_ERROR:
Pmsg0(0, "Bad Volume label type.\n");
- break;
+ break;
default:
Pmsg0(0, "Unknown error.\n");
- break;
+ break;
}
debug_level = 20;
}
-/* Go to the end of the medium -- raw command
+/* Go to the end of the medium -- raw command
* The idea was orginally that the end of the Bacula
* medium would be flagged differently. This is not
* currently the case. So, this is identical to the
rec->data_len = i;
sm_check(__FILE__, __LINE__, False);
if (write_record_to_block(block, rec)) {
- empty_block(block);
- blkno++;
+ empty_block(block);
+ blkno++;
Pmsg2(0, "Block %d i=%d\n", blkno, i);
} else {
- break;
+ break;
}
sm_check(__FILE__, __LINE__, False);
}
for (int i=0; i<len; i++) {
if (rec->data[i] != 3) {
Pmsg0(0, _("Bad data in record. Test failed!\n"));
- goto bail_out;
+ goto bail_out;
}
}
Pmsg0(0, _("\nBlock re-read correct. Test succeeded!\n"));
" and three records in file 2\n\n"));
rewindcmd();
wrcmd();
- weofcmd(); /* end file 0 */
+ weofcmd(); /* end file 0 */
wrcmd();
wrcmd();
- weofcmd(); /* end file 1 */
+ weofcmd(); /* end file 1 */
wrcmd();
wrcmd();
wrcmd();
- weofcmd(); /* end file 2 */
+ weofcmd(); /* end file 2 */
rewindcmd();
Pmsg0(0, _("Now moving to end of medium.\n"));
eodcmd();
int stat;
stat = append_test();
- if (stat == 1) { /* OK get out */
+ if (stat == 1) { /* OK get out */
goto all_done;
}
- if (stat == -1) { /* first test failed */
+ if (stat == -1) { /* first test failed */
if (dev_cap(dev, CAP_EOM)) {
Pmsg0(-1, "\nAppend test failed. Attempting again.\n"
"Setting \"Hardware End of Medium = no\" and retrying append test.\n\n");
- dev->capabilities &= ~CAP_EOM; /* turn off eom */
- stat = append_test();
- if (stat == 1) {
+ dev->capabilities &= ~CAP_EOM; /* turn off eom */
+ stat = append_test();
+ if (stat == 1) {
Pmsg0(-1, "\n\nIt looks like the test worked this time, please add:\n\n"
" Hardware End of Medium = No\n\n"
"to your Device resource in the Storage conf file.\n");
- goto all_done;
- }
- if (stat == -1) {
+ goto all_done;
+ }
+ if (stat == -1) {
Pmsg0(-1, "\n\nThat appears not to have corrected the problem.\n");
- goto all_done;
- }
- /* Wrong count after append */
- if (stat == -2) {
+ goto all_done;
+ }
+ /* Wrong count after append */
+ if (stat == -2) {
Pmsg0(-1, "\n\nIt looks like the append failed. Attempting again.\n"
"Setting \"BSF at EOM = yes\" and retrying append test.\n");
- dev->capabilities |= CAP_BSFATEOM; /* backspace on eom */
- stat = append_test();
- if (stat == 1) {
+ dev->capabilities |= CAP_BSFATEOM; /* backspace on eom */
+ stat = append_test();
+ if (stat == 1) {
Pmsg0(-1, "\n\nIt looks like the test worked this time, please add:\n\n"
" Hardware End of Medium = No\n"
" BSR at EOM = yes\n\n"
"to your Device resource in the Storage conf file.\n");
- goto all_done;
- }
- }
+ goto all_done;
+ }
+ }
Pmsg0(-1, "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"
"Unable to correct the problem. You MUST fix this\n"
Pmsg1(0, _("Starting scan at file %u\n"), dev->file);
for (;;) {
if ((stat = read(dev->fd, buf, sizeof(buf))) < 0) {
- clrerror_dev(dev, -1);
+ clrerror_dev(dev, -1);
Mmsg2(&dev->errmsg, "read error on %s. ERR=%s.\n",
- dev->dev_name, strerror(dev->dev_errno));
+ dev->dev_name, strerror(dev->dev_errno));
Pmsg2(0, "Bad status from read %d. ERR=%s\n", stat, strerror_dev(dev));
- if (blocks > 0)
+ if (blocks > 0)
printf("%d block%s of %d bytes in file %d\n",
blocks, blocks>1?"s":"", block_size, dev->file);
- return;
+ return;
}
Dmsg1(200, "read status = %d\n", stat);
/* sleep(1); */
if (stat != block_size) {
- update_pos_dev(dev);
- if (blocks > 0) {
+ update_pos_dev(dev);
+ if (blocks > 0) {
printf("%d block%s of %d bytes in file %d\n",
blocks, blocks>1?"s":"", block_size, dev->file);
- blocks = 0;
- }
- block_size = stat;
+ blocks = 0;
+ }
+ block_size = stat;
}
- if (stat == 0) { /* EOF */
- update_pos_dev(dev);
+ if (stat == 0) { /* EOF */
+ update_pos_dev(dev);
printf("End of File mark.\n");
- /* Two reads of zero means end of tape */
- if (dev->state & ST_EOF)
- dev->state |= ST_EOT;
- else {
- dev->state |= ST_EOF;
- dev->file++;
- }
- if (dev->state & ST_EOT) {
+ /* Two reads of zero means end of tape */
+ if (dev->state & ST_EOF)
+ dev->state |= ST_EOT;
+ else {
+ dev->state |= ST_EOF;
+ dev->file++;
+ }
+ if (dev->state & ST_EOT) {
printf("End of tape\n");
- break;
- }
- } else { /* Got data */
- dev->state &= ~ST_EOF;
- blocks++;
- tot_blocks++;
- bytes += stat;
+ break;
+ }
+ } else { /* Got data */
+ dev->state &= ~ST_EOF;
+ blocks++;
+ tot_blocks++;
+ bytes += stat;
}
}
update_pos_dev(dev);
for (;;) {
if (!read_block_from_device(jcr, dev, block, NO_BLOCK_NUMBER_CHECK)) {
Dmsg1(100, "!read_block(): ERR=%s\n", strerror_dev(dev));
- if (dev->state & ST_EOT) {
- if (blocks > 0) {
+ if (dev->state & ST_EOT) {
+ if (blocks > 0) {
printf("%d block%s of %d bytes in file %d\n",
blocks, blocks>1?"s":"", block_size, dev->file);
- blocks = 0;
- }
- goto bail_out;
- }
- if (dev->state & ST_EOF) {
- if (blocks > 0) {
+ blocks = 0;
+ }
+ goto bail_out;
+ }
+ if (dev->state & ST_EOF) {
+ if (blocks > 0) {
printf("%d block%s of %d bytes in file %d\n",
blocks, blocks>1?"s":"", block_size, dev->file);
- blocks = 0;
- }
+ blocks = 0;
+ }
printf(_("End of File mark.\n"));
- continue;
- }
- if (dev->state & ST_SHORT) {
- if (blocks > 0) {
+ continue;
+ }
+ if (dev->state & ST_SHORT) {
+ if (blocks > 0) {
printf("%d block%s of %d bytes in file %d\n",
blocks, blocks>1?"s":"", block_size, dev->file);
- blocks = 0;
- }
+ blocks = 0;
+ }
printf(_("Short block read.\n"));
- continue;
- }
+ continue;
+ }
printf(_("Error reading block. ERR=%s\n"), strerror_dev(dev));
- goto bail_out;
+ goto bail_out;
}
if (block->block_len != block_size) {
- if (blocks > 0) {
+ if (blocks > 0) {
printf("%d block%s of %d bytes in file %d\n",
blocks, blocks>1?"s":"", block_size, dev->file);
- blocks = 0;
- }
- block_size = block->block_len;
+ blocks = 0;
+ }
+ block_size = block->block_len;
}
blocks++;
tot_blocks++;
bytes += block->block_len;
Dmsg5(100, "Blk=%u blen=%u bVer=%d SessId=%u SessTim=%u\n",
- block->BlockNumber, block->block_len, block->BlockVer,
- block->VolSessionId, block->VolSessionTime);
+ block->BlockNumber, block->block_len, block->BlockVer,
+ block->VolSessionId, block->VolSessionTime);
if (verbose == 1) {
- DEV_RECORD *rec = new_record();
- read_record_from_block(block, rec);
+ DEV_RECORD *rec = new_record();
+ read_record_from_block(block, rec);
Pmsg7(-1, "Block: %u blen=%u First rec FI=%s SessId=%u SessTim=%u Strm=%s rlen=%d\n",
- block->BlockNumber, block->block_len,
- FI_to_ascii(rec->FileIndex), rec->VolSessionId, rec->VolSessionTime,
- stream_to_ascii(rec->Stream, rec->FileIndex), rec->data_len);
- rec->remainder = 0;
- free_record(rec);
+ block->BlockNumber, block->block_len,
+ FI_to_ascii(rec->FileIndex), rec->VolSessionId, rec->VolSessionTime,
+ stream_to_ascii(rec->Stream, rec->FileIndex), rec->data_len);
+ rec->remainder = 0;
+ free_record(rec);
} else if (verbose > 1) {
dump_block(block, "");
}
/*
* First we label the tape, then we fill
* it with data get a new tape and write a few blocks.
- */
+ */
static void fillcmd()
{
DEV_RECORD rec;
/*
* Acquire output device for writing. Note, after acquiring a
- * device, we MUST release it, which is done at the end of this
- * subroutine.
+ * device, we MUST release it, which is done at the end of this
+ * subroutine.
*/
Dmsg0(100, "just before acquire_device\n");
if (!(dev=acquire_device_for_append(jcr, dev, block))) {
if (!write_session_label(jcr, block, SOS_LABEL)) {
set_jcr_job_status(jcr, JS_ErrorTerminated);
Jmsg1(jcr, M_FATAL, 0, _("Write session label failed. ERR=%s\n"),
- strerror_dev(dev));
+ strerror_dev(dev));
ok = FALSE;
}
Pmsg0(-1, "Wrote Start Of Session label.\n");
* Generate data as if from File daemon, write to device
*/
jcr->VolFirstIndex = 0;
- time(&jcr->run_time); /* start counting time for rates */
+ time(&jcr->run_time); /* start counting time for rates */
Pmsg0(-1, "Begin writing records to first tape ...\n");
for (file_index = 0; ok && !job_canceled(jcr); ) {
rec.VolSessionId = jcr->VolSessionId;
*/
uint64_t *lp = (uint64_t *)rec.data;
for (uint32_t i=0; i < (rec.data_len-sizeof(uint64_t))/sizeof(uint64_t); i++) {
- *lp++ = ~file_index;
+ *lp++ = ~file_index;
}
Dmsg4(250, "before writ_rec FI=%d SessId=%d Strm=%s len=%d\n",
- rec.FileIndex, rec.VolSessionId, stream_to_ascii(rec.Stream, rec.FileIndex),
- rec.data_len);
+ rec.FileIndex, rec.VolSessionId, stream_to_ascii(rec.Stream, rec.FileIndex),
+ rec.data_len);
while (!write_record_to_block(block, &rec)) {
- /*
- * When we get here we have just filled a block
- */
+ /*
+ * When we get here we have just filled a block
+ */
Dmsg2(150, "!write_record_to_block data_len=%d rem=%d\n", rec.data_len,
- rec.remainder);
-
- /* Write block to tape */
- if (!flush_block(block, 1)) {
- return;
- }
-
- /* Every 5000 blocks (approx 322MB) report where we are.
- */
- if ((block->BlockNumber % 5000) == 0) {
- now = time(NULL);
- now -= jcr->run_time;
- if (now <= 0) {
- now = 1;
- }
- kbs = (double)dev->VolCatInfo.VolCatBytes / (1000.0 * (double)now);
+ rec.remainder);
+
+ /* Write block to tape */
+ if (!flush_block(block, 1)) {
+ return;
+ }
+
+ /* Every 5000 blocks (approx 322MB) report where we are.
+ */
+ if ((block->BlockNumber % 5000) == 0) {
+ now = time(NULL);
+ now -= jcr->run_time;
+ if (now <= 0) {
+ now = 1;
+ }
+ kbs = (double)dev->VolCatInfo.VolCatBytes / (1000.0 * (double)now);
Pmsg3(-1, "Wrote block=%u, VolBytes=%s rate=%.1f KB/s\n", block->BlockNumber,
- edit_uint64_with_commas(dev->VolCatInfo.VolCatBytes, ec1), (float)kbs);
- }
- /* Every 15000 blocks (approx 1GB) write an EOF.
- */
- if ((block->BlockNumber % 15000) == 0) {
+ edit_uint64_with_commas(dev->VolCatInfo.VolCatBytes, ec1), (float)kbs);
+ }
+ /* Every 15000 blocks (approx 1GB) write an EOF.
+ */
+ if ((block->BlockNumber % 15000) == 0) {
Pmsg0(-1, "Flush block, write EOF\n");
- flush_block(block, 0);
- weof_dev(dev, 1);
- }
-
- /* Get out after writing 10 blocks to the second tape */
- if (++BlockNumber > 10 && stop != 0) { /* get out */
- break;
- }
+ flush_block(block, 0);
+ weof_dev(dev, 1);
+ }
+
+ /* Get out after writing 10 blocks to the second tape */
+ if (++BlockNumber > 10 && stop != 0) { /* get out */
+ break;
+ }
}
if (!ok) {
Pmsg0(000, _("Not OK\n"));
- break;
+ break;
}
jcr->JobBytes += rec.data_len; /* increment bytes this job */
Dmsg4(190, "write_record FI=%s SessId=%d Strm=%s len=%d\n",
- FI_to_ascii(rec.FileIndex), rec.VolSessionId,
- stream_to_ascii(rec.Stream, rec.FileIndex), rec.data_len);
+ FI_to_ascii(rec.FileIndex), rec.VolSessionId,
+ stream_to_ascii(rec.Stream, rec.FileIndex), rec.data_len);
/* Get out after writing 10 blocks to the second tape */
- if (BlockNumber > 10 && stop != 0) { /* get out */
+ if (BlockNumber > 10 && stop != 0) { /* get out */
Pmsg0(-1, "Done writing ...\n");
- break;
+ break;
}
}
if (stop > 0) {
Dmsg0(100, "Write_end_session_label()\n");
/* Create Job status for end of session label */
if (!job_canceled(jcr) && ok) {
- set_jcr_job_status(jcr, JS_Terminated);
+ set_jcr_job_status(jcr, JS_Terminated);
} else if (!ok) {
- set_jcr_job_status(jcr, JS_ErrorTerminated);
+ set_jcr_job_status(jcr, JS_ErrorTerminated);
}
if (!write_session_label(jcr, block, EOS_LABEL)) {
Pmsg1(000, _("Error writting end session label. ERR=%s\n"), strerror_dev(dev));
- ok = FALSE;
+ ok = FALSE;
}
/* Write out final block of this session */
if (!write_block_to_device(jcr, dev, block)) {
Pmsg0(-1, _("Set ok=FALSE after write_block_to_device.\n"));
- ok = FALSE;
+ ok = FALSE;
}
Pmsg0(-1, "Wrote End Of Session label.\n");
}
if (!simple) {
/* Close device so user can use autochanger if desired */
if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) {
- offline_dev(dev);
+ offline_dev(dev);
}
force_close_dev(dev);
get_cmd(_("Mount first tape. Press enter when ready: "));
dev->state &= ~ST_READ;
if (!acquire_device_for_read(jcr, dev, block)) {
Pmsg1(-1, "%s", dev->errmsg);
- return;
+ return;
}
}
- time(&jcr->run_time); /* start counting time for rates */
+ time(&jcr->run_time); /* start counting time for rates */
stop = 0;
file_index = 0;
if (!simple) {
Pmsg0(000, "Rewinding tape ...\n");
if (!rewind_dev(dev)) {
Pmsg1(-1, _("Error rewinding: ERR=%s\n"), strerror_dev(dev));
- goto bail_out;
+ goto bail_out;
}
if (last_file > 0) {
Pmsg1(000, "Forward spacing to last file=%u\n", last_file);
- if (!fsf_dev(dev, last_file)) {
+ if (!fsf_dev(dev, last_file)) {
Pmsg1(-1, _("Error in FSF: ERR=%s\n"), strerror_dev(dev));
- goto bail_out;
- }
+ goto bail_out;
+ }
}
Pmsg1(-1, _("Forward space to file %u complete. Reading blocks ...\n"),
- last_file);
+ last_file);
Pmsg1(-1, _("Now reading to block %u.\n"), last_block_num);
for (uint32_t i=0; i <= last_block_num; i++) {
- if (!read_block_from_device(jcr, dev, block, NO_BLOCK_NUMBER_CHECK)) {
+ if (!read_block_from_device(jcr, dev, block, NO_BLOCK_NUMBER_CHECK)) {
Pmsg1(-1, _("Error reading blocks: ERR=%s\n"), strerror_dev(dev));
Pmsg2(-1, _("Wanted block %u error at block %u\n"), last_block_num, i);
- goto bail_out;
- }
- if (i > 0 && i % 1000 == 0) {
+ goto bail_out;
+ }
+ if (i > 0 && i % 1000 == 0) {
Pmsg1(-1, _("At block %u\n"), i);
- }
+ }
}
if (last_block) {
dump_block(last_block, _("Last block written"));
{
SESSION_LABEL label;
- if (stop > 1 && !dumped) { /* on second tape */
+ if (stop > 1 && !dumped) { /* on second tape */
dumped = 1;
dump_block(block, "First block on second tape");
Pmsg4(-1, "Blk: FileIndex=%d: block=%u size=%d vol=%s\n",
- rec->FileIndex, block->BlockNumber, block->block_len, dev->VolHdr.VolName);
+ rec->FileIndex, block->BlockNumber, block->block_len, dev->VolHdr.VolName);
Pmsg6(-1, " Rec: VId=%d VT=%d FI=%s Strm=%s len=%d state=%x\n",
- rec->VolSessionId, rec->VolSessionTime,
- FI_to_ascii(rec->FileIndex), stream_to_ascii(rec->Stream, rec->FileIndex),
- rec->data_len, rec->state);
+ rec->VolSessionId, rec->VolSessionTime,
+ FI_to_ascii(rec->FileIndex), stream_to_ascii(rec->Stream, rec->FileIndex),
+ rec->data_len, rec->state);
}
if (rec->FileIndex < 0) {
if (verbose > 1) {
- dump_label_record(dev, rec, 1);
+ dump_label_record(dev, rec, 1);
}
switch (rec->FileIndex) {
case PRE_LABEL:
Pmsg0(-1, "Volume is prelabeled. This tape cannot be scanned.\n");
- return;
+ return;
case VOL_LABEL:
- unser_volume_label(dev, rec);
+ unser_volume_label(dev, rec);
Pmsg3(-1, "VOL_LABEL: block=%u size=%d vol=%s\n", block->BlockNumber,
- block->block_len, dev->VolHdr.VolName);
- stop++;
- break;
+ block->block_len, dev->VolHdr.VolName);
+ stop++;
+ break;
case SOS_LABEL:
- unser_session_label(&label, rec);
+ unser_session_label(&label, rec);
Pmsg1(-1, "SOS_LABEL: JobId=%u\n", label.JobId);
- break;
+ break;
case EOS_LABEL:
- unser_session_label(&label, rec);
+ unser_session_label(&label, rec);
Pmsg2(-1, "EOS_LABEL: block=%u JobId=%u\n", block->BlockNumber,
- label.JobId);
- break;
+ label.JobId);
+ break;
case EOM_LABEL:
Pmsg0(-1, "EOM_LABEL:\n");
- break;
- case EOT_LABEL: /* end of all tapes */
- char ec1[50];
-
- if (LastBlock != block->BlockNumber) {
- VolBytes += block->block_len;
- }
- LastBlock = block->BlockNumber;
- now = time(NULL);
- now -= jcr->run_time;
- if (now <= 0) {
- now = 1;
- }
- kbs = (double)VolBytes / (1000 * now);
+ break;
+ case EOT_LABEL: /* end of all tapes */
+ char ec1[50];
+
+ if (LastBlock != block->BlockNumber) {
+ VolBytes += block->block_len;
+ }
+ LastBlock = block->BlockNumber;
+ now = time(NULL);
+ now -= jcr->run_time;
+ if (now <= 0) {
+ now = 1;
+ }
+ kbs = (double)VolBytes / (1000 * now);
Pmsg3(000, "Read block=%u, VolBytes=%s rate=%.1f KB/s\n", block->BlockNumber,
- edit_uint64_with_commas(VolBytes, ec1), (float)kbs);
+ edit_uint64_with_commas(VolBytes, ec1), (float)kbs);
Pmsg0(000, "End of all tapes.\n");
- break;
+ break;
default:
- break;
+ break;
}
return;
}
if (++file_index != rec->FileIndex) {
Pmsg3(000, "Incorrect FileIndex in Block %u. Got %d, expected %d.\n",
- block->BlockNumber, rec->FileIndex, file_index);
+ block->BlockNumber, rec->FileIndex, file_index);
}
/*
* Now check that the right data is in the record.
for (uint32_t i=0; i < (REC_SIZE-sizeof(uint64_t))/sizeof(uint64_t); i++) {
if (*lp++ != val) {
Pmsg2(000, "Record %d contains bad data in Block %u.\n",
- file_index, block->BlockNumber);
- break;
+ file_index, block->BlockNumber);
+ break;
}
}
now = time(NULL);
now -= jcr->run_time;
if (now <= 0) {
- now = 1;
+ now = 1;
}
kbs = (double)VolBytes / (1000 * now);
Pmsg3(000, "Read block=%u, VolBytes=%s rate=%.1f KB/s\n", block->BlockNumber,
- edit_uint64_with_commas(VolBytes, ec1), (float)kbs);
+ edit_uint64_with_commas(VolBytes, ec1), (float)kbs);
}
LastBlock = block->BlockNumber;
if (end_of_tape) {
this_file = dev->file;
this_block_num = dev->block_num;
if (!write_block_to_dev(jcr, dev, block)) {
- Pmsg0(000, strerror_dev(dev));
+ Pmsg0(000, strerror_dev(dev));
Pmsg3(000, "Block not written: FileIndex=%u Block=%u Size=%u\n",
- (unsigned)file_index, block->BlockNumber, block->block_len);
+ (unsigned)file_index, block->BlockNumber, block->block_len);
Pmsg2(000, "last_block_num=%u this_block_num=%d\n", last_block_num,
- this_block_num);
+ this_block_num);
if (dump) {
dump_block(block, "Block not written");
}
if (stop == 0) {
- eot_block = block->BlockNumber;
- eot_block_len = block->block_len;
- eot_FileIndex = file_index;
+ eot_block = block->BlockNumber;
+ eot_block_len = block->block_len;
+ eot_FileIndex = file_index;
}
now = time(NULL);
now -= jcr->run_time;
if (now <= 0) {
- now = 1;
+ now = 1;
}
kbs = (double)dev->VolCatInfo.VolCatBytes / (1000 * now);
vol_size = dev->VolCatInfo.VolCatBytes;
Pmsg2(000, "End of tape. VolumeCapacity=%s. Write rate = %.1f KB/s\n",
- edit_uint64_with_commas(dev->VolCatInfo.VolCatBytes, ec1), kbs);
+ edit_uint64_with_commas(dev->VolCatInfo.VolCatBytes, ec1), kbs);
if (simple) {
- stop = -1; /* stop, but do simplified test */
+ stop = -1; /* stop, but do simplified test */
} else {
- /* Full test in progress */
- if (!fixup_device_block_write_error(jcr, dev, block)) {
+ /* Full test in progress */
+ if (!fixup_device_block_write_error(jcr, dev, block)) {
Pmsg1(000, _("Cannot fixup device error. %s\n"), strerror_dev(dev));
- ok = FALSE;
- unlock_device(dev);
- return 0;
- }
- stop = 1;
- BlockNumber = 0; /* start counting for second tape */
+ ok = FALSE;
+ unlock_device(dev);
+ return 0;
+ }
+ stop = 1;
+ BlockNumber = 0; /* start counting for second tape */
}
unlock_device(dev);
- return 1; /* end of tape reached */
+ return 1; /* end of tape reached */
}
/*
/*
* First we label the tape, then we fill
* it with data get a new tape and write a few blocks.
- */
+ */
static void qfillcmd()
{
DEV_BLOCK *block;
}
if (!write_record_to_block(block, rec)) {
Pmsg0(0, _("Error writing record to block.\n"));
- goto bail_out;
+ goto bail_out;
}
if (!write_block_to_dev(jcr, dev, block)) {
Pmsg0(0, _("Error writing block to device.\n"));
- goto bail_out;
+ goto bail_out;
}
}
printf("\n");
*p = block_num;
stat = write(dev->fd, block->buf, block->buf_len);
if (stat == (int)block->buf_len) {
- if ((block_num++ % 100) == 0) {
+ if ((block_num++ % 100) == 0) {
printf("+");
- }
- continue;
+ }
+ continue;
}
break;
}
{"wr", wrcmd, "write a single Bacula block"},
{"rr", rrcmd, "read a single record"},
{"qfill", qfillcmd, "quick fill command"},
- };
+ };
#define comsize (sizeof(commands)/sizeof(struct cmdstruct))
static void
sm_check(__FILE__, __LINE__, False);
found = 0;
for (i=0; i<comsize; i++) /* search for command */
- if (fstrsch(cmd, commands[i].key)) {
- (*commands[i].func)(); /* go execute command */
- found = 1;
- break;
- }
+ if (fstrsch(cmd, commands[i].key)) {
+ (*commands[i].func)(); /* go execute command */
+ found = 1;
+ break;
+ }
if (!found)
Pmsg1(0, _("%s is an illegal command\n"), cmd);
if (quit)
- break;
+ break;
}
}
}
-/*
+/*
* Get next input command from terminal. This
* routine is REALLY primitive, and should be enhanced
* to have correct backspacing, etc.
cmd[i] = 0;
while ((ch = fgetc(stdin)) != EOF) {
if (ch == '\n') {
- strip_trailing_junk(cmd);
- return 1;
+ strip_trailing_junk(cmd);
+ return 1;
} else if (ch == 4 || ch == 0xd3 || ch == 0x8) {
- if (i > 0)
- cmd[--i] = 0;
- continue;
+ if (i > 0)
+ cmd[--i] = 0;
+ continue;
}
-
+
cmd[i++] = ch;
cmd[i] = 0;
}
}
/* Dummies to replace askdir.c */
-int dir_get_volume_info(JCR *jcr, enum get_vol_info_rw writing) { return 1;}
-int dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel) { return 1; }
-int dir_create_jobmedia_record(JCR *jcr) { return 1; }
-int dir_update_file_attributes(JCR *jcr, DEV_RECORD *rec) { return 1;}
-int dir_send_job_status(JCR *jcr) {return 1;}
+int dir_get_volume_info(JCR *jcr, enum get_vol_info_rw writing) { return 1;}
+int dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel) { return 1; }
+int dir_create_jobmedia_record(JCR *jcr) { return 1; }
+int dir_update_file_attributes(JCR *jcr, DEV_RECORD *rec) { return 1;}
+int dir_send_job_status(JCR *jcr) {return 1;}
-int dir_find_next_appendable_volume(JCR *jcr)
+int dir_find_next_appendable_volume(JCR *jcr)
{
return 1;
}
Pmsg1(-1, "%s", dev->errmsg); /* print reason */
fprintf(stderr, "Mount Volume \"%s\" on device %s and press return when ready: ",
jcr->VolumeName, dev_name(dev));
- getchar();
+ getchar();
return 1;
}
force_close_dev(dev);
fprintf(stderr, "Mount next Volume on device %s and press return when ready: ",
dev_name(dev));
- getchar();
+ getchar();
set_volume_name("TestVolume2", 2);
labelcmd();
VolumeName = NULL;
}
kbs = (double)VolBytes / (1000.0 * (double)now);
Pmsg3(-1, "Read block=%u, VolBytes=%s rate=%.1f KB/s\n", block->BlockNumber,
- edit_uint64_with_commas(VolBytes, ec1), (float)kbs);
+ edit_uint64_with_commas(VolBytes, ec1), (float)kbs);
if (strcmp(jcr->VolumeName, "TestVolume2") == 0) {
end_of_tape = 1;
Pmsg2(0, "Cannot open Dev=%s, Vol=%s\n", dev_name(dev), jcr->VolumeName);
return 0;
}
- return 1; /* next volume mounted */
+ return 1; /* next volume mounted */
}
static void set_volume_name(char *VolName, int volnum)
#define __RECORD_H 1
/* Return codes from read_device_volume_label() */
-#define VOL_NOT_READ 0 /* Volume label not read */
-#define VOL_OK 1 /* volume name OK */
-#define VOL_NO_LABEL 2 /* volume not labeled */
-#define VOL_IO_ERROR 3 /* volume I/O error */
-#define VOL_NAME_ERROR 4 /* Volume name mismatch */
-#define VOL_CREATE_ERROR 5 /* Error creating label */
-#define VOL_VERSION_ERROR 6 /* Bacula version error */
-#define VOL_LABEL_ERROR 7 /* Bad label type */
-#define VOL_NO_MEDIA 8 /* Hard error -- no media present */
+#define VOL_NOT_READ 0 /* Volume label not read */
+#define VOL_OK 1 /* volume name OK */
+#define VOL_NO_LABEL 2 /* volume not labeled */
+#define VOL_IO_ERROR 3 /* volume I/O error */
+#define VOL_NAME_ERROR 4 /* Volume name mismatch */
+#define VOL_CREATE_ERROR 5 /* Error creating label */
+#define VOL_VERSION_ERROR 6 /* Bacula version error */
+#define VOL_LABEL_ERROR 7 /* Bad label type */
+#define VOL_NO_MEDIA 8 /* Hard error -- no media present */
/* See block.h for RECHDR_LENGTH */
*/
/* Record state bit definitions */
-#define REC_NO_HEADER (1<<0) /* No header read */
+#define REC_NO_HEADER (1<<0) /* No header read */
#define REC_PARTIAL_RECORD (1<<1) /* returning partial record */
#define REC_BLOCK_EMPTY (1<<2) /* not enough data in block */
-#define REC_NO_MATCH (1<<3) /* No match on continuation data */
+#define REC_NO_MATCH (1<<3) /* No match on continuation data */
#define REC_CONTINUATION (1<<4) /* Continuation record found */
-#define REC_ISTAPE (1<<5) /* Set if device is tape */
+#define REC_ISTAPE (1<<5) /* Set if device is tape */
#define is_partial_record(r) ((r)->state & REC_PARTIAL_RECORD)
#define is_block_empty(r) ((r)->state & REC_BLOCK_EMPTY)
* This is the memory structure for the record header.
*/
struct DEV_RECORD {
- int sync; /* synchronous */
+ int sync; /* synchronous */
/* File and Block are always returned on reading records, but
* only returned on writing if sync is set (obviously).
*/
- uint32_t File; /* File number */
- uint32_t Block; /* Block number */
- uint32_t VolSessionId; /* sequential id within this session */
- uint32_t VolSessionTime; /* session start time */
- int32_t FileIndex; /* sequential file number */
- int32_t Stream; /* stream number */
- uint32_t data_len; /* current record length */
- uint32_t remainder; /* remaining bytes to read/write */
- uint32_t state; /* state bits */
+ uint32_t File; /* File number */
+ uint32_t Block; /* Block number */
+ uint32_t VolSessionId; /* sequential id within this session */
+ uint32_t VolSessionTime; /* session start time */
+ int32_t FileIndex; /* sequential file number */
+ int32_t Stream; /* stream number */
+ uint32_t data_len; /* current record length */
+ uint32_t remainder; /* remaining bytes to read/write */
+ uint32_t state; /* state bits */
uint8_t ser_buf[WRITE_RECHDR_LENGTH]; /* serialized record header goes here */
- POOLMEM *data; /* Record data. This MUST be a memory pool item */
-};
+ POOLMEM *data; /* Record data. This MUST be a memory pool item */
+};
/*
* Note, these values are negative to distinguish them
* from user records where the FileIndex is forced positive.
*/
-#define PRE_LABEL -1 /* Vol label on unwritten tape */
-#define VOL_LABEL -2 /* Volume label first file */
-#define EOM_LABEL -3 /* Writen at end of tape */
-#define SOS_LABEL -4 /* Start of Session */
-#define EOS_LABEL -5 /* End of Session */
-#define EOT_LABEL -6 /* End of physical tape (2 eofs) */
+#define PRE_LABEL -1 /* Vol label on unwritten tape */
+#define VOL_LABEL -2 /* Volume label first file */
+#define EOM_LABEL -3 /* Writen at end of tape */
+#define SOS_LABEL -4 /* Start of Session */
+#define EOS_LABEL -5 /* End of Session */
+#define EOT_LABEL -6 /* End of physical tape (2 eofs) */
/*
* Volume Label Record. This is the in-memory definition. The
* in the DEVICE buffer, but are not actually written
* to the tape.
*/
- int32_t LabelType; /* This is written in header only */
- uint32_t LabelSize; /* length of serialized label */
+ int32_t LabelType; /* This is written in header only */
+ uint32_t LabelSize; /* length of serialized label */
/*
* The items below this line are stored on
* the tape
*/
- char Id[32]; /* Bacula Immortal ... */
+ char Id[32]; /* Bacula Immortal ... */
- uint32_t VerNum; /* Label version number */
+ uint32_t VerNum; /* Label version number */
/* VerNum <= 10 */
- float64_t label_date; /* Date tape labeled */
- float64_t label_time; /* Time tape labeled */
+ float64_t label_date; /* Date tape labeled */
+ float64_t label_time; /* Time tape labeled */
/* VerNum >= 11 */
- btime_t label_btime; /* tdate tape labeled */
- btime_t write_btime; /* tdate tape written */
+ btime_t label_btime; /* tdate tape labeled */
+ btime_t write_btime; /* tdate tape written */
/* Unused with VerNum >= 11 */
- float64_t write_date; /* Date this label written */
- float64_t write_time; /* Time this label written */
+ float64_t write_date; /* Date this label written */
+ float64_t write_time; /* Time this label written */
char VolName[MAX_NAME_LENGTH]; /* Volume name */
char PrevVolName[MAX_NAME_LENGTH]; /* Previous Volume Name */
char MediaType[MAX_NAME_LENGTH]; /* Type of this media */
char HostName[MAX_NAME_LENGTH]; /* Host name of writing computer */
- char LabelProg[50]; /* Label program name */
- char ProgVersion[50]; /* Program version */
- char ProgDate[50]; /* Program build date/time */
+ char LabelProg[50]; /* Label program name */
+ char ProgVersion[50]; /* Program version */
+ char ProgDate[50]; /* Program build date/time */
};
#define SER_LENGTH_Volume_Label 1024 /* max serialised length of volume label */
* This record is at the beginning and end of each session
*/
struct Session_Label {
- char Id[32]; /* Bacula Immortal ... */
+ char Id[32]; /* Bacula Immortal ... */
- uint32_t VerNum; /* Label version number */
+ uint32_t VerNum; /* Label version number */
- uint32_t JobId; /* Job id */
- uint32_t VolumeIndex; /* Sequence no of volume for this job */
+ uint32_t JobId; /* Job id */
+ uint32_t VolumeIndex; /* Sequence no of volume for this job */
/* VerNum >= 11 */
- btime_t write_btime; /* Tdate this label written */
+ btime_t write_btime; /* Tdate this label written */
/* VerNum < 11 */
- float64_t write_date; /* Date this label written */
+ float64_t write_date; /* Date this label written */
/* Unused VerNum >= 11 */
- float64_t write_time; /* Time this label written */
+ float64_t write_time; /* Time this label written */
char PoolName[MAX_NAME_LENGTH]; /* Pool name */
char PoolType[MAX_NAME_LENGTH]; /* Pool type */
char JobName[MAX_NAME_LENGTH]; /* base Job name */
char ClientName[MAX_NAME_LENGTH];
- char Job[MAX_NAME_LENGTH]; /* Unique name of this Job */
+ char Job[MAX_NAME_LENGTH]; /* Unique name of this Job */
char FileSetName[MAX_NAME_LENGTH];
char FileSetMD5[MAX_NAME_LENGTH];
uint32_t JobType;
uint32_t StartFile;
uint32_t EndFile;
uint32_t JobErrors;
- uint32_t JobStatus; /* Job status */
+ uint32_t JobStatus; /* Job status */
};
typedef struct Session_Label SESSION_LABEL;
-#define SERIAL_BUFSIZE 1024 /* volume serialisation buffer size */
+#define SERIAL_BUFSIZE 1024 /* volume serialisation buffer size */
#endif
/* */
#define VERSION "1.31"
#define VSTRING "1"
-#define BDATE "25 Jun 2003"
-#define LSMDATE "25Jun03"
+#define BDATE "26 Jun 2003"
+#define LSMDATE "26Jun03"
/* Debug flags */
#define DEBUG 1