ext3grep-0.10.1/0000777000175000017500000000000011121223252010326 500000000000000ext3grep-0.10.1/config.guess0000755000175000017500000012753410756112266012615 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-23' # 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 # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. 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 ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null 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 # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; 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. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; 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} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; 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 < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # 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) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < 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: ext3grep-0.10.1/LICENSE.GPL20000644000175000017500000004310310767002146011767 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. ext3grep-0.10.1/INSTALL0000644000175000017500000002466610766271604011333 00000000000000Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Relocatable Installation ======================== By default, `make install' will install a package with hardwired file names, and the package will not work correctly when copied or moved to a different location in the filesystem. Some packages pay attention to the `--enable-relocatable' option to `configure'. This option makes the entire installed package relocatable. This means, it can be moved or copied to a different location on the filesystem. It is possible to make symlinks to the installed and moved programs, and invoke them through the symlink. It is possible to do the same thing with a hard link _only_ if the hard linked file is in the same directory as the real program. For reliability it is best to give together with --enable-relocatable a `--prefix' option pointing to an otherwise unused (and never used again) directory, for example, `--prefix=/tmp/inst$$'. This is recommended because on some OSes the executables remember the location of shared libraries (and prefer them over LD_LIBRARY_PATH !), therefore such an executable will look for its shared libraries first in the original installation directory and only then in the current installation directory. Installation with `--enable-relocatable' will not work for setuid / setgid executables. (This is because such an executable kills its LD_LIBRARY_PATH variable when it is launched.) The runtime penalty and size penalty are nearly zero on Linux 2.2 or newer (just one system call more when an executable is launched), and small on other systems (the wrapper program just sets an environment variable and execs the real program). Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. For packages that use the GNU libiconv library, you can use the `configure' option `--with-libiconv-prefix' to specify the prefix you used while installing GNU libiconv. This option is not necessary if that other prefix is the same as the one now specified through --prefix. For packages that use the GNU libintl library, you can use the `configure' option `--with-libintl-prefix' to specify the prefix you used while installing GNU gettext-runtime. This option is not necessary if that other prefix is the same as the one now specified through --prefix. Particular Systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: env CC="cc -Ae" ./configure On AIX 3, the C include files by default don't define some necessary prototype declarations. If GNU CC is not installed, it is recommended to use the following options: env CC="xlc -D_ALL_SOURCE" ./configure On BeOS, user installed software goes in /boot/home/config, not /usr/local. It is recommended to use the following options: ./configure --prefix=/boot/home/config Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. ext3grep-0.10.1/aclocal.m40000644000175000017500000015643111121223214012112 00000000000000# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(AC_AUTOCONF_VERSION, [2.61],, [m4_warning([this file was generated for autoconf 2.61. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR # CW_AUTOMACROS m4 macro -- this file is part of cwautomacros. # Copyright (C) 2006 - 2008 Carlo Wood # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the author gives unlimited permission to copy, # distribute and modify the configure scripts that are the output of # by a tool like autoconf when using these macros as input. You need # not follow the terms of the GNU General Public License when using or # distributing such scripts, even though portions of the text of this # file appears in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the cwautomacros project. dnl CW_AUTOMACROS dnl Take care of general things needed. AC_DEFUN([CW_AUTOMACROS], [dnl dnl Check cwautomacros version. minver=$1 test -n "$minver" || minver=0 if test 20081123 -lt $minver; then AC_MSG_ERROR([cwautomacros version $minver or later is required.]) fi dnl Detect unexpanded macros. m4_pattern_forbid(CW_) dnl Define ACLOCAL_CWFLAGS, so that rerunning aclocal from 'make' will work. ACLOCAL_CWFLAGS="-I ${CWAUTOMACROSPREFIX-/usr}/share/cwautomacros/m4" if test -d $ac_confdir/libtoolm4; then ACLOCAL_CWFLAGS="$ACLOCAL_CWFLAGS -I `cd $ac_confdir; pwd`/libtoolm4" fi AC_SUBST(ACLOCAL_CWFLAGS) ]) # CW_CONFIG_FILE m4 macro -- this file is part of cwautomacros. # Copyright (C) 2007 Carlo Wood # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the author gives unlimited permission to copy, # distribute and modify the configure scripts that are the output of # by a tool like autoconf when using these macros as input. You need # not follow the terms of the GNU General Public License when using or # distributing such scripts, even though portions of the text of this # file appears in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the cwautomacros project. dnl CW_CONFIG_FILE dnl dnl Generate $1/$2 from $1/$2.in, but only if the file dnl really changed. AC_DEFUN([CW_CONFIG_FILE], [ AC_CONFIG_FILES($1/timestamp-$2:$1/$2.in, [ if cmp -s $1/$2 $1/timestamp-$2 2> /dev/null; then echo "config.status: $2 is unchanged" else echo "config.status: creating $2" cp $1/timestamp-$2 $1/$2 fi touch $1/timestamp-$2 ])]) # CW_LIB_LIBCWD m4 macro -- this file is part of cwautomacros. # Copyright (C) 2006 Carlo Wood # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the author gives unlimited permission to copy, # distribute and modify the configure scripts that are the output of # by a tool like autoconf when using these macros as input. You need # not follow the terms of the GNU General Public License when using or # distributing such scripts, even though portions of the text of this # file appears in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the cwautomacros project. # CW_LIB_LIBCWD(OPTIONNAME, WANTED, THREADED, # [ACTION_IF_FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------- # # OPTIONNAME is the name used in AC_ARG_ENABLE that requests # libcwd support. # # WANTED can be [yes], [no] or [auto]/[] and should be the result # of use --enable-OPTIONNAME, --disable-OPTIONNAME or neither. # For example: # AC_ARG_ENABLE(debugging, [ --enable-debugging enable debugging code.]) # Where OPTIONNAME is [debugging] and WANTED is [$enable_debugging]. # # THREADED can be [yes], [no] or [both] when the application is # threaded, non-threaded or when both are needed respectively. # If THREADED is set to [both] then CWD_FLAGS and CWD_LIBS # are set as appropriate for the non-threaded case and # CWD_R_FLAGS and CWD_R_LIBS are set as appropriate for # the threaded case. # # This macro tests for the usability of libcwd and sets the macro # `cw_used_libcwd' to "yes" when it is detected, "no" otherwise. # # The default ACTION_IF_FOUND is, if WANTED is unequal "no", # to set CWD_FLAGS and CWD_LIBS. # # The default ACTION-IF-NOT-FOUND is to print an error message; # ACTION-IF-NOT-FOUND is only executed when WANTED is "yes" and no # libcwd was found. AC_DEFUN([CW_LIB_LIBCWD], [cw_wanted=$2 if test x"$cw_wanted" = x"no"; then cw_used_libcwd=no else cw_libname=cwd test "$3" = "yes" && cw_libname=cwd_r AC_CACHE_CHECK([if libcwd is available], cw_cv_lib_libcwd, [ # Check if we have libcwd AC_LANG_SAVE AC_LANG_CPLUSPLUS cw_save_LIBS="$LIBS" LIBS="$LIBS `pkg-config --libs lib$cw_libname`" AC_LINK_IFELSE([AC_LANG_CALL([], [__libcwd_version])], [cw_cv_lib_libcwd=yes], [cw_cv_lib_libcwd=no]) LIBS="$cw_save_LIBS" AC_LANG_RESTORE]) if test "$3" = "both"; then AC_CACHE_CHECK([if libcwd_r is available], cw_cv_lib_libcwd_r, [ # Check if we have libcwd_r AC_LANG_SAVE AC_LANG_CPLUSPLUS cw_save_LIBS="$LIBS" LIBS="$LIBS `pkg-config --libs libcwd_r`" AC_LINK_IFELSE([AC_LANG_CALL([], [__libcwd_version])], [cw_cv_lib_libcwd_r=yes], [cw_cv_lib_libcwd_r=no]) LIBS="$cw_save_LIBS" AC_LANG_RESTORE]) fi cw_use_libcwd="$cw_wanted" test -n "$cw_use_libcwd" || cw_use_libcwd=auto test "$cw_use_libcwd" = "auto" && cw_use_libcwd=$cw_cv_lib_libcwd if test "$cw_use_libcwd" = "yes"; then if test "$cw_cv_lib_libcwd" = "no" -o "$3" = "both" -a x"$cw_cv_lib_libcwd_r" = x"no"; then m4_default([$5], [dnl AC_MSG_ERROR([ --enable-$1: You need to have libcwd installed to enable this. Or perhaps you need to add its location to PKG_CONFIG_PATH and LD_LIBRARY_PATH, for example: PKG_CONFIG_PATH=/opt/install/lib/pkgconfig LD_LIBRARY_PATH=/opt/install/lib ./configure])]) else cw_used_libcwd=yes if test "$3" = "both"; then m4_default([$4], [dnl CWD_FLAGS="`pkg-config --cflags libcwd`" CWD_LIBS="`pkg-config --libs libcwd`" CWD_R_FLAGS="`pkg-config --cflags libcwd_r`" CWD_R_LIBS="`pkg-config --libs libcwd_r`"]) AC_SUBST(CWD_R_FLAGS) AC_SUBST(CWD_R_LIBS) else m4_default([$4], [dnl CWD_FLAGS="`pkg-config --cflags lib$cw_libname`" CWD_LIBS="`pkg-config --libs lib$cw_libname`"]) fi AC_SUBST(CWD_FLAGS) AC_SUBST(CWD_LIBS) fi else cw_used_libcwd=no fi fi ]) # CW_MAKEFILEIN_PREFIX m4 macro -- this file is part of cwautomacros. # Copyright (C) 2007 Carlo Wood # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the author gives unlimited permission to copy, # distribute and modify the configure scripts that are the output of # by a tool like autoconf when using these macros as input. You need # not follow the terms of the GNU General Public License when using or # distributing such scripts, even though portions of the text of this # file appears in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the cwautomacros project. # CW_MAKEFILEIN_PREFIX # -------------------- # # This macro set @Makefilein@ to an empty string. # That allows verbatim rules to be included in Makefile.am # without that automake tries to decode them. # AC_DEFUN([CW_MAKEFILEIN_PREFIX], [ Makefilein= AC_SUBST(Makefilein) ]) # CW_OPG_FLAGS m4 macro -- this file is part of cwautomacros. # Copyright (C) 2006 Carlo Wood # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the author gives unlimited permission to copy, # distribute and modify the configure scripts that are the output of # by a tool like autoconf when using these macros as input. You need # not follow the terms of the GNU General Public License when using or # distributing such scripts, even though portions of the text of this # file appears in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the cwautomacros project. dnl CW_OPG_FLAGS dnl dnl Add --enable-debug (DEBUG, DOXYGEN_DEBUG), dnl --enable-libcwd (CWDEBUG, DOXYGEN_CWDEBUG), dnl --enable-optimize dnl and --enable-profile dnl options. dnl dnl This macro sets CXXFLAGS to include -g (or -ggdb on FreeBSD) when dnl debugging is required, -O2 when optimization is required and dnl appropriate warning flags. dnl dnl However, if CXXFLAGS already contains a -g* option then that is used dnl instead of the default -g (-ggdb). If it contains a -O* option then dnl that is used instead of -O2. Finally, if options are passed to dnl the macro, then those are used instead of the default ones. dnl dnl Update USE_LIBCWD, CWD_FLAGS, CWD_LIBS, CXXFLAGS and LDFLAGS accordingly. dnl dnl Further more, the following macros are set: dnl dnl CW_DEBUG_FLAGS : Any -g* flags. dnl CW_OPTIMISE_FLAGS : Any -O* flags. dnl CW_WARNING_FLAGS : Any -W* flags. dnl CW_STRIPPED_CXXFLAGS: Any other flags that were already in CXXFLAGS. dnl AC_DEFUN([CW_OPG_FLAGS], [dnl dnl Containers for the respective options. m4_pattern_allow(CW_DEBUG_FLAGS) m4_pattern_allow(CW_OPTIMISE_FLAGS) m4_pattern_allow(CW_WARNING_FLAGS) m4_pattern_allow(CW_STRIPPED_CXXFLAGS) m4_pattern_allow(CW_DEFAULT_DEBUG_FLAGS) # Add args to configure AC_ARG_ENABLE(debug, [ --enable-debug build for debugging @<:@no@:>@], [cw_config_debug=$enableval], [cw_config_debug=]) AC_ARG_ENABLE(libcwd, [ --enable-libcwd link with libcwd @<:@auto@:>@], [cw_config_libcwd=$enableval], [cw_config_libcwd=]) AC_ARG_ENABLE(optimize, [ --enable-optimize do code optimization @<:@auto@:>@], [cw_config_optimize=$enableval], [cw_config_optimize=]) AC_ARG_ENABLE(profile, [ --enable-profile add profiling code @<:@no@:>@], [cw_config_profile=$enableval], [cw_config_profile=]) # Strip possible -g and -O commandline options from CXXFLAGS. CW_DEBUG_FLAGS= CW_OPTIMISE_FLAGS= CW_WARNING_FLAGS= CW_STRIPPED_CXXFLAGS= for arg in $CXXFLAGS; do case "$arg" in # ( -g*) CW_DEBUG_FLAGS="$CW_DEBUG_FLAGS $arg" ;; # ( -O*) CW_OPTIMISE_FLAGS="$CW_OPTIMISE_FLAGS $arg" ;; # ( -W*) CW_WARNING_FLAGS="$CW_WARNING_FLAGS $arg" ;; # ( *) CW_STRIPPED_CXXFLAGS="$CW_STRIPPED_CXXFLAGS $arg" ;; esac done # Set various defaults, depending on other options. if test x"$cw_config_optimize" = x"no"; then CW_OPTIMISE_FLAGS="" # Explicit --disable-optimize, strip optimization even from CXXFLAGS environment variable. fi if test x"$enable_maintainer_mode" = x"yes"; then if test -z "$cw_config_optimize"; then cw_config_optimize=no # --enable-maintainer-mode, set default to --disable-optimize. fi if test -z "$cw_config_debug"; then cw_config_debug=yes # --enable-maintainer-mode, set default to --enable-debug. fi fi if test x"$cw_config_debug" = x"yes"; then if test -z "$cw_config_optimize"; then cw_config_optimize=no # --enable-debug and no --enable-optimize, set default to --disable-optimize. fi else if test -z "$cw_config_libcwd"; then cw_config_libcwd=no # No --enable-debug and no --enable-libcwd, set default to --disable-libcwd. fi fi dnl Find out which debugging options we need AC_CANONICAL_HOST case "$host" in *freebsd*) CW_DEFAULT_DEBUG_FLAGS=-ggdb ;; dnl FreeBSD needs -ggdb to include sourcefile:linenumber info in its object files. *) CW_DEFAULT_DEBUG_FLAGS=-g ;; esac # Handle cw_config_libcwd. # Check if we have libcwd, $cw_config_libcwd can be "yes", "no" or "". if test -z "$cw_used_libcwd"; then CW_LIB_LIBCWD([libcwd], [$cw_config_libcwd], [both]) fi USE_LIBCWD="$cw_used_libcwd" AC_SUBST([USE_LIBCWD]) if test "$cw_used_libcwd" = "yes"; then test -n "$CW_DEBUG_FLAGS" || CW_DEBUG_FLAGS="$CW_DEFAULT_DEBUG_FLAGS" if test -z "$cw_config_optimize"; then cw_config_optimize=no # libcwd is being used, set default to --disable-optimize. fi DOXYGEN_CWDEBUG=CWDEBUG else DOXYGEN_CWDEBUG= fi AC_SUBST([DOXYGEN_CWDEBUG]) # Handle cw_config_debug. if test x"$cw_config_debug" = x"yes"; then CW_STRIPPED_CXXFLAGS="$CW_STRIPPED_CXXFLAGS -DDEBUG" DOXYGEN_DEBUG=DEBUG test -n "$CW_DEBUG_FLAGS" || CW_DEBUG_FLAGS="$CW_DEFAULT_DEBUG_FLAGS" else DOXYGEN_DEBUG= fi AC_SUBST([DOXYGEN_DEBUG]) # Handle cw_config_optimize; when not explicitly set to "no", use user provided # optimization flags, or -O2 when nothing was provided. if test x"$cw_config_optimize" != x"no"; then test -n "$CW_OPTIMISE_FLAGS" || CW_OPTIMISE_FLAGS="-O2" elif test "$ac_test_CXXFLAGS" != set; then # If CXXFLAGS was set by configure, reset CW_OPTIMISE_FLAGS. CW_OPTIMISE_FLAGS= fi # Handle cw_config_profile. if test x"$cw_config_profile" = x"yes"; then CW_STRIPPED_CXXFLAGS="$CW_STRIPPED_CXXFLAGS -pg" LDFLAGS="$LDFLAGS -pg" fi # Choose warning options to use. # If not in maintainer mode, use the warning options that were in CXXFLAGS. # Otherwise, use those plus any passed to the macro, or if neither are # given a default string - and then filter out incompatible warnings. if test x"$enable_maintainer_mode" = x"yes"; then if test -z "$1" -a -z "$CW_WARNING_FLAGS"; then CW_WARNING_FLAGS="-W -Wall -Woverloaded-virtual -Wundef -Wpointer-arith -Wwrite-strings -Werror -Winline" else CW_WARNING_FLAGS="$CW_WARNING_FLAGS $1" fi AC_EGREP_CPP(Winline-broken, [ #if __GNUC__ < 3 Winline-broken #endif ], dnl -Winline is broken. [CW_WARNING_FLAGS="$(echo "$CW_WARNING_FLAGS" | sed -e 's/ -Winline//g')"], dnl -Winline is not broken. Remove -Werror when optimizing though. [if test -n "$CW_OPTIMISE_FLAGS"; then CW_WARNING_FLAGS="$(echo "$CW_WARNING_FLAGS" | sed -e 's/ -Werror//g')" fi] ) fi # Reassemble CXXFLAGS with debug and optimization flags. [CXXFLAGS=`echo "$CW_DEBUG_FLAGS $CW_WARNING_FLAGS $CW_OPTIMISE_FLAGS $CW_STRIPPED_CXXFLAGS" | sed -e 's/^ *//' -e 's/ */ /g' -e 's/ *$//'`] dnl Put CXXFLAGS into the Makefile. AC_SUBST(CXXFLAGS) dnl Allow fine tuning if necessary, by putting the substituting the parts too. AC_SUBST(CW_DEBUG_FLAGS) AC_SUBST(CW_WARNING_FLAGS) AC_SUBST(CW_OPTIMISE_FLAGS) AC_SUBST(CW_STRIPPED_CXXFLAGS) ]) # CW_PCHFLAGS m4 macro -- this file is part of cwautomacros. # Copyright (C) 2006 Carlo Wood # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the author gives unlimited permission to copy, # distribute and modify the configure scripts that are the output of # by a tool like autoconf when using these macros as input. You need # not follow the terms of the GNU General Public License when using or # distributing such scripts, even though portions of the text of this # file appears in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the cwautomacros project. dnl CW_PCHFLAGS dnl Add --enable-pch (-include pch.h) option. Update USE_PCH (automake conditional) and PCHFLAGS accordingly. AC_DEFUN([CW_PCHFLAGS], [dnl # Add args to configure. AC_ARG_ENABLE(pch, [ --enable-pch enable precompiled header support @<:@auto detect for g++@:>@]) # Handle enable_pch. PCHFLAGS= if test x"$enable_pch" != x"no"; then # No --disable-pch # Check if compiler supports PCH. CW_SYS_PCH if test "$cw_cv_prog_CXX_pch" = "no" -a x"$enable_pch" = x"yes"; then AC_MSG_ERROR([ --enable-pch: You need to use a PCH capable compiler to enable this. ]) fi if test "$cw_cv_prog_CXX_pch" = "yes"; then PCHFLAGS="-include pch.h" fi else AM_CONDITIONAL(USE_PCH, [false]) fi AC_SUBST([PCHFLAGS]) ]) # CW_PROG_CXX_FINGER_PRINTS m4 macro -- this file is part of cwautomacros. # Copyright (C) 2006 Carlo Wood # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the author gives unlimited permission to copy, # distribute and modify the configure scripts that are the output of # by a tool like autoconf when using these macros as input. You need # not follow the terms of the GNU General Public License when using or # distributing such scripts, even though portions of the text of this # file appears in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the cwautomacros project. # CW_PROG_CXX_FINGER_PRINTS # # Extract finger prints of C++ compiler and preprocessor and C compiler which is used for linking. AC_DEFUN([CW_PROG_CXX_FINGER_PRINTS], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXXCPP]) AC_REQUIRE([AC_PROG_CC]) cw_prog_cxx_finger_print="`$CXX -v 2>&1 | grep version | head -n 1`" cw_prog_cxxcpp_finger_print="`echo | $CXXCPP -v 2>&1 | grep version | head -n 1`" cw_prog_cc_finger_print="`$CC -v 2>&1 | grep version | head -n 1`" ]) # CW_SYS_PCH m4 macro -- this file is part of cwautomacros. # Copyright (C) 2006 Carlo Wood # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the author gives unlimited permission to copy, # distribute and modify the configure scripts that are the output of # by a tool like autoconf when using these macros as input. You need # not follow the terms of the GNU General Public License when using or # distributing such scripts, even though portions of the text of this # file appears in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the cwautomacros project. # CW_SYS_PCH # ---------- # # This macro checks if the compiler supports PCH # and if so, set `cw_cv_prog_CXX_pch' to "yes" # and sets the automake conditional `USE_PCH'. # AC_DEFUN([CW_SYS_PCH], [AC_CACHE_CHECK([for compiler with PCH support], [cw_cv_prog_CXX_pch], [ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated" AC_LANG_SAVE AC_LANG_CPLUSPLUS echo '#include ' > conftest.h rm -f conftest.h.gch if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \ -c -o conftest.h.gch 1>&5 2>&1 && echo '#error "pch failed"' > conftest.h && echo '#include "conftest.h"' > conftest.cc && $CXX -c $CXXFLAGS $CPPFLAGS conftest.cc 1>&5 2>&1 ; then cw_cv_prog_CXX_pch=yes else cw_cv_prog_CXX_pch=no fi rm -f conftest* CXXFLAGS=$ac_save_CXXFLAGS AC_LANG_RESTORE ]) AM_CONDITIONAL(USE_PCH, test "$cw_cv_prog_CXX_pch" = "yes") CW_MAKEFILEIN_PREFIX]) ext3grep-0.10.1/README0000644000175000017500000000074310773445441011150 00000000000000Don't expect this tool to work 100% automatically for you without knowing what you're doing. You might need to edit locate.cc Please read http://www.xs4all.nl/~carlo17/howto/undelete_ext3.html Mailinglist ----------- If you run into problems that you can't solve, related to this program, then join the Google Group 'ext3grep': http://groups.google.com/group/ext3grep Howto report a bug ------------------ http://groups.google.com/group/ext3grep/web/sticky-howto-report-a-bug ext3grep-0.10.1/config.sub0000755000175000017500000010115310756112266012245 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-16' # 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. # # 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 # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $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 ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; 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) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | 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 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; 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 ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: ext3grep-0.10.1/Makefile.am0000644000175000017500000000125410771332641012315 00000000000000## Process this file with automake to generate Makefile.in AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = @ACLOCAL_CWFLAGS@ SUBDIRS = src . EXTRA_DIST = LICENSE.GPL2 INSTALL README NEWS DISTCLEANFILES = stamp-h.in DEFS = @DEFS@ CXXFLAGS = @CXXFLAGS@ @CWD_FLAGS@ LIBS = @CWD_LIBS@ # --------------- Maintainer's Section distclean-local: rm -rf $(srcdir)/autom4te.cache *~ MAINTAINERCLEANFILES = $(srcdir)/aclocal.m4 $(srcdir)/config.h.in $(srcdir)/configure $(srcdir)/Makefile.in \ $(srcdir)/install-sh $(srcdir)/missing $(srcdir)/mkinstalldirs $(srcdir)/config.guess $(srcdir)/config.sub \ $(srcdir)/ltmain.sh $(srcdir)/stamp-h.in $(srcdir)/ChangeLog $(srcdir)/depcomp troep* ext3grep-0.10.1/configure0000755000175000017500000065434211121223216012167 00000000000000#! /bin/sh # From configure.ac Revision: 7 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for ext3grep 0.10.1. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='ext3grep' PACKAGE_TARNAME='ext3grep' PACKAGE_VERSION='0.10.1' PACKAGE_STRING='ext3grep 0.10.1' PACKAGE_BUGREPORT='carlo@alinoe.com' ac_unique_file="src/ext3grep.cc" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT ACLOCAL_CWFLAGS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP CPP GREP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os CWD_R_FLAGS CWD_R_LIBS CWD_FLAGS CWD_LIBS USE_LIBCWD DOXYGEN_CWDEBUG DOXYGEN_DEBUG CW_DEBUG_FLAGS CW_WARNING_FLAGS CW_OPTIMISE_FLAGS CW_STRIPPED_CXXFLAGS USE_PCH_TRUE USE_PCH_FALSE Makefilein PCHFLAGS USE_SVN_TRUE USE_SVN_FALSE USE_DEBUG_TRUE USE_DEBUG_FALSE USE_CWDEBUG_TRUE USE_CWDEBUG_FALSE CC_FINGER_PRINT CXX_FINGER_PRINT CXXCPP_FINGER_PRINT CXXFLAGS_FINGER_PRINT LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CXXCPP CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures ext3grep 0.10.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/ext3grep] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of ext3grep 0.10.1:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-debug build for debugging [no] --enable-libcwd link with libcwd [auto] --enable-optimize do code optimization [auto] --enable-profile add profiling code [no] --enable-pch enable precompiled header support [auto detect for g++] --enable-mmap Use mmap for inode tables instead of operator new [yes] --disable-largefile omit support for large files Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF ext3grep configure 0.10.1 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by ext3grep $as_me 0.10.1, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" am__api_version='1.10' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='ext3grep' VERSION='0.10.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE minver=20080318 test -n "$minver" || minver=0 if test 20081123 -lt $minver; then { { echo "$as_me:$LINENO: error: cwautomacros version $minver or later is required." >&5 echo "$as_me: error: cwautomacros version $minver or later is required." >&2;} { (exit 1); exit 1; }; } fi ACLOCAL_CWFLAGS="-I ${CWAUTOMACROSPREFIX-/usr}/share/cwautomacros/m4" if test -d $ac_confdir/libtoolm4; then ACLOCAL_CWFLAGS="$ACLOCAL_CWFLAGS -I `cd $ac_confdir; pwd`/libtoolm4" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in yes) { { echo "$as_me:$LINENO: error: ext3grep doesn't work on Big Endian systems" >&5 echo "$as_me: error: ext3grep doesn't work on Big Endian systems" >&2;} { (exit 1); exit 1; }; } ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac # Add args to configure # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; cw_config_debug=$enableval else cw_config_debug= fi # Check whether --enable-libcwd was given. if test "${enable_libcwd+set}" = set; then enableval=$enable_libcwd; cw_config_libcwd=$enableval else cw_config_libcwd= fi # Check whether --enable-optimize was given. if test "${enable_optimize+set}" = set; then enableval=$enable_optimize; cw_config_optimize=$enableval else cw_config_optimize= fi # Check whether --enable-profile was given. if test "${enable_profile+set}" = set; then enableval=$enable_profile; cw_config_profile=$enableval else cw_config_profile= fi # Strip possible -g and -O commandline options from CXXFLAGS. CW_DEBUG_FLAGS= CW_OPTIMISE_FLAGS= CW_WARNING_FLAGS= CW_STRIPPED_CXXFLAGS= for arg in $CXXFLAGS; do case "$arg" in # ( -g*) CW_DEBUG_FLAGS="$CW_DEBUG_FLAGS $arg" ;; # ( -O*) CW_OPTIMISE_FLAGS="$CW_OPTIMISE_FLAGS $arg" ;; # ( -W*) CW_WARNING_FLAGS="$CW_WARNING_FLAGS $arg" ;; # ( *) CW_STRIPPED_CXXFLAGS="$CW_STRIPPED_CXXFLAGS $arg" ;; esac done # Set various defaults, depending on other options. if test x"$cw_config_optimize" = x"no"; then CW_OPTIMISE_FLAGS="" # Explicit --disable-optimize, strip optimization even from CXXFLAGS environment variable. fi if test x"$enable_maintainer_mode" = x"yes"; then if test -z "$cw_config_optimize"; then cw_config_optimize=no # --enable-maintainer-mode, set default to --disable-optimize. fi if test -z "$cw_config_debug"; then cw_config_debug=yes # --enable-maintainer-mode, set default to --enable-debug. fi fi if test x"$cw_config_debug" = x"yes"; then if test -z "$cw_config_optimize"; then cw_config_optimize=no # --enable-debug and no --enable-optimize, set default to --disable-optimize. fi else if test -z "$cw_config_libcwd"; then cw_config_libcwd=no # No --enable-debug and no --enable-libcwd, set default to --disable-libcwd. fi fi { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac case "$host" in *freebsd*) CW_DEFAULT_DEBUG_FLAGS=-ggdb ;; *) CW_DEFAULT_DEBUG_FLAGS=-g ;; esac # Handle cw_config_libcwd. # Check if we have libcwd, $cw_config_libcwd can be "yes", "no" or "". if test -z "$cw_used_libcwd"; then cw_wanted=$cw_config_libcwd if test x"$cw_wanted" = x"no"; then cw_used_libcwd=no else cw_libname=cwd test "both" = "yes" && cw_libname=cwd_r { echo "$as_me:$LINENO: checking if libcwd is available" >&5 echo $ECHO_N "checking if libcwd is available... $ECHO_C" >&6; } if test "${cw_cv_lib_libcwd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Check if we have libcwd ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cw_save_LIBS="$LIBS" LIBS="$LIBS `pkg-config --libs lib$cw_libname`" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char __libcwd_version (); int main () { return __libcwd_version (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then cw_cv_lib_libcwd=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cw_cv_lib_libcwd=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$cw_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { echo "$as_me:$LINENO: result: $cw_cv_lib_libcwd" >&5 echo "${ECHO_T}$cw_cv_lib_libcwd" >&6; } if test "both" = "both"; then { echo "$as_me:$LINENO: checking if libcwd_r is available" >&5 echo $ECHO_N "checking if libcwd_r is available... $ECHO_C" >&6; } if test "${cw_cv_lib_libcwd_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Check if we have libcwd_r ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cw_save_LIBS="$LIBS" LIBS="$LIBS `pkg-config --libs libcwd_r`" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char __libcwd_version (); int main () { return __libcwd_version (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then cw_cv_lib_libcwd_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cw_cv_lib_libcwd_r=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$cw_save_LIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { echo "$as_me:$LINENO: result: $cw_cv_lib_libcwd_r" >&5 echo "${ECHO_T}$cw_cv_lib_libcwd_r" >&6; } fi cw_use_libcwd="$cw_wanted" test -n "$cw_use_libcwd" || cw_use_libcwd=auto test "$cw_use_libcwd" = "auto" && cw_use_libcwd=$cw_cv_lib_libcwd if test "$cw_use_libcwd" = "yes"; then if test "$cw_cv_lib_libcwd" = "no" -o "both" = "both" -a x"$cw_cv_lib_libcwd_r" = x"no"; then { { echo "$as_me:$LINENO: error: --enable-libcwd: You need to have libcwd installed to enable this. Or perhaps you need to add its location to PKG_CONFIG_PATH and LD_LIBRARY_PATH, for example: PKG_CONFIG_PATH=/opt/install/lib/pkgconfig LD_LIBRARY_PATH=/opt/install/lib ./configure" >&5 echo "$as_me: error: --enable-libcwd: You need to have libcwd installed to enable this. Or perhaps you need to add its location to PKG_CONFIG_PATH and LD_LIBRARY_PATH, for example: PKG_CONFIG_PATH=/opt/install/lib/pkgconfig LD_LIBRARY_PATH=/opt/install/lib ./configure" >&2;} { (exit 1); exit 1; }; } else cw_used_libcwd=yes if test "both" = "both"; then CWD_FLAGS="`pkg-config --cflags libcwd`" CWD_LIBS="`pkg-config --libs libcwd`" CWD_R_FLAGS="`pkg-config --cflags libcwd_r`" CWD_R_LIBS="`pkg-config --libs libcwd_r`" else CWD_FLAGS="`pkg-config --cflags lib$cw_libname`" CWD_LIBS="`pkg-config --libs lib$cw_libname`" fi fi else cw_used_libcwd=no fi fi fi USE_LIBCWD="$cw_used_libcwd" if test "$cw_used_libcwd" = "yes"; then test -n "$CW_DEBUG_FLAGS" || CW_DEBUG_FLAGS="$CW_DEFAULT_DEBUG_FLAGS" if test -z "$cw_config_optimize"; then cw_config_optimize=no # libcwd is being used, set default to --disable-optimize. fi DOXYGEN_CWDEBUG=CWDEBUG else DOXYGEN_CWDEBUG= fi # Handle cw_config_debug. if test x"$cw_config_debug" = x"yes"; then CW_STRIPPED_CXXFLAGS="$CW_STRIPPED_CXXFLAGS -DDEBUG" DOXYGEN_DEBUG=DEBUG test -n "$CW_DEBUG_FLAGS" || CW_DEBUG_FLAGS="$CW_DEFAULT_DEBUG_FLAGS" else DOXYGEN_DEBUG= fi # Handle cw_config_optimize; when not explicitly set to "no", use user provided # optimization flags, or -O2 when nothing was provided. if test x"$cw_config_optimize" != x"no"; then test -n "$CW_OPTIMISE_FLAGS" || CW_OPTIMISE_FLAGS="-O2" elif test "$ac_test_CXXFLAGS" != set; then # If CXXFLAGS was set by configure, reset CW_OPTIMISE_FLAGS. CW_OPTIMISE_FLAGS= fi # Handle cw_config_profile. if test x"$cw_config_profile" = x"yes"; then CW_STRIPPED_CXXFLAGS="$CW_STRIPPED_CXXFLAGS -pg" LDFLAGS="$LDFLAGS -pg" fi # Choose warning options to use. # If not in maintainer mode, use the warning options that were in CXXFLAGS. # Otherwise, use those plus any passed to the macro, or if neither are # given a default string - and then filter out incompatible warnings. if test x"$enable_maintainer_mode" = x"yes"; then if test -z "-W -Wall -Woverloaded-virtual -Wundef -Wpointer-arith -Wwrite-strings -Winline" -a -z "$CW_WARNING_FLAGS"; then CW_WARNING_FLAGS="-W -Wall -Woverloaded-virtual -Wundef -Wpointer-arith -Wwrite-strings -Werror -Winline" else CW_WARNING_FLAGS="$CW_WARNING_FLAGS -W -Wall -Woverloaded-virtual -Wundef -Wpointer-arith -Wwrite-strings -Winline" fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if __GNUC__ < 3 Winline-broken #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Winline-broken" >/dev/null 2>&1; then CW_WARNING_FLAGS="$(echo "$CW_WARNING_FLAGS" | sed -e 's/ -Winline//g')" else if test -n "$CW_OPTIMISE_FLAGS"; then CW_WARNING_FLAGS="$(echo "$CW_WARNING_FLAGS" | sed -e 's/ -Werror//g')" fi fi rm -f conftest* fi # Reassemble CXXFLAGS with debug and optimization flags. CXXFLAGS=`echo "$CW_DEBUG_FLAGS $CW_WARNING_FLAGS $CW_OPTIMISE_FLAGS $CW_STRIPPED_CXXFLAGS" | sed -e 's/^ *//' -e 's/ */ /g' -e 's/ *$//'` # Add args to configure. # Check whether --enable-pch was given. if test "${enable_pch+set}" = set; then enableval=$enable_pch; fi # Handle enable_pch. PCHFLAGS= if test x"$enable_pch" != x"no"; then # No --disable-pch # Check if compiler supports PCH. { echo "$as_me:$LINENO: checking for compiler with PCH support" >&5 echo $ECHO_N "checking for compiler with PCH support... $ECHO_C" >&6; } if test "${cw_cv_prog_CXX_pch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -Werror -Winvalid-pch -Wno-deprecated" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo '#include ' > conftest.h rm -f conftest.h.gch if $CXX $CXXFLAGS $CPPFLAGS -x c++-header conftest.h \ -c -o conftest.h.gch 1>&5 2>&1 && echo '#error "pch failed"' > conftest.h && echo '#include "conftest.h"' > conftest.cc && $CXX -c $CXXFLAGS $CPPFLAGS conftest.cc 1>&5 2>&1 ; then cw_cv_prog_CXX_pch=yes else cw_cv_prog_CXX_pch=no fi rm -f conftest* CXXFLAGS=$ac_save_CXXFLAGS ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { echo "$as_me:$LINENO: result: $cw_cv_prog_CXX_pch" >&5 echo "${ECHO_T}$cw_cv_prog_CXX_pch" >&6; } if test "$cw_cv_prog_CXX_pch" = "yes"; then USE_PCH_TRUE= USE_PCH_FALSE='#' else USE_PCH_TRUE='#' USE_PCH_FALSE= fi Makefilein= if test "$cw_cv_prog_CXX_pch" = "no" -a x"$enable_pch" = x"yes"; then { { echo "$as_me:$LINENO: error: --enable-pch: You need to use a PCH capable compiler to enable this. " >&5 echo "$as_me: error: --enable-pch: You need to use a PCH capable compiler to enable this. " >&2;} { (exit 1); exit 1; }; } fi if test "$cw_cv_prog_CXX_pch" = "yes"; then PCHFLAGS="-include pch.h" fi else if false; then USE_PCH_TRUE= USE_PCH_FALSE='#' else USE_PCH_TRUE='#' USE_PCH_FALSE= fi fi # Check whether --enable-mmap was given. if test "${enable_mmap+set}" = set; then enableval=$enable_mmap; fi if test x"$enable_mmap" = x"no"; then # --disable-mmap given. CXXFLAGS="$CXXFLAGS -DUSE_MMAP=0" else CXXFLAGS="$CXXFLAGS -DUSE_MMAP=1" fi DEFS="-DHAVE_CONFIG_H" if test -d "$srcdir/.svn"; then if test x"$enable_maintainer_mode" != x"yes"; then { { echo "$as_me:$LINENO: error: Always use --enable-maintainer-mode if you are using SVN." >&5 echo "$as_me: error: Always use --enable-maintainer-mode if you are using SVN." >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <<_ACEOF #define USE_SVN 1 _ACEOF fi if test -d "$srcdir/.svn"; then USE_SVN_TRUE= USE_SVN_FALSE='#' else USE_SVN_TRUE='#' USE_SVN_FALSE= fi if test x"$cw_config_debug" = x"yes"; then USE_DEBUG_TRUE= USE_DEBUG_FALSE='#' else USE_DEBUG_TRUE='#' USE_DEBUG_FALSE= fi if test x"$cw_used_libcwd" = x"yes"; then USE_CWDEBUG_TRUE= USE_CWDEBUG_FALSE='#' else USE_CWDEBUG_TRUE='#' USE_CWDEBUG_FALSE= fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -f conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -f conftest* fi fi CXXFLAGS="$CXXFLAGS `pkg-config --cflags ext2fs`" for ac_header in ext2fs/ext2_fs.h ext2fs/ext2fs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to carlo@alinoe.com ## ## ------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test x"$ac_cv_header_ext2fs_ext2_fs_h" != x"yes" -o x"$ac_cv_header_ext2fs_ext2fs_h" != x"yes"; then { { echo "$as_me:$LINENO: error: Missing headers. Please install the package e2fslibs-dev from e2fsprogs, or http://e2fsprogs.sourceforge.net for the upstream tar-ball." >&5 echo "$as_me: error: Missing headers. Please install the package e2fslibs-dev from e2fsprogs, or http://e2fsprogs.sourceforge.net for the upstream tar-ball." >&2;} { (exit 1); exit 1; }; } fi cw_prog_cxx_finger_print="`$CXX -v 2>&1 | grep version | head -n 1`" cw_prog_cxxcpp_finger_print="`echo | $CXXCPP -v 2>&1 | grep version | head -n 1`" cw_prog_cc_finger_print="`$CC -v 2>&1 | grep version | head -n 1`" CC_FINGER_PRINT="$cw_prog_cc_finger_print" CXX_FINGER_PRINT="$cw_prog_cxx_finger_print" CXXCPP_FINGER_PRINT="$cw_prog_cxxcpp_finger_print" CXXFLAGS_FINGER_PRINT=$(echo $CXXFLAGS | sed -e 's/-W[a-z-]* *//g') ac_config_files="$ac_config_files src/timestamp-sys.h:src/sys.h.in" ac_config_files="$ac_config_files Makefile src/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_PCH_TRUE}" && test -z "${USE_PCH_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_PCH\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_PCH\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_PCH_TRUE}" && test -z "${USE_PCH_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_PCH\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_PCH\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SVN_TRUE}" && test -z "${USE_SVN_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SVN\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SVN\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_DEBUG_TRUE}" && test -z "${USE_DEBUG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_CWDEBUG_TRUE}" && test -z "${USE_CWDEBUG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_CWDEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_CWDEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by ext3grep $as_me 0.10.1, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ ext3grep config.status 0.10.1 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "src/timestamp-sys.h") CONFIG_FILES="$CONFIG_FILES src/timestamp-sys.h:src/sys.h.in" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim MAINT!$MAINT$ac_delim ACLOCAL_CWFLAGS!$ACLOCAL_CWFLAGS$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim CXXCPP!$CXXCPP$ac_delim CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF CWD_R_FLAGS!$CWD_R_FLAGS$ac_delim CWD_R_LIBS!$CWD_R_LIBS$ac_delim CWD_FLAGS!$CWD_FLAGS$ac_delim CWD_LIBS!$CWD_LIBS$ac_delim USE_LIBCWD!$USE_LIBCWD$ac_delim DOXYGEN_CWDEBUG!$DOXYGEN_CWDEBUG$ac_delim DOXYGEN_DEBUG!$DOXYGEN_DEBUG$ac_delim CW_DEBUG_FLAGS!$CW_DEBUG_FLAGS$ac_delim CW_WARNING_FLAGS!$CW_WARNING_FLAGS$ac_delim CW_OPTIMISE_FLAGS!$CW_OPTIMISE_FLAGS$ac_delim CW_STRIPPED_CXXFLAGS!$CW_STRIPPED_CXXFLAGS$ac_delim USE_PCH_TRUE!$USE_PCH_TRUE$ac_delim USE_PCH_FALSE!$USE_PCH_FALSE$ac_delim Makefilein!$Makefilein$ac_delim PCHFLAGS!$PCHFLAGS$ac_delim USE_SVN_TRUE!$USE_SVN_TRUE$ac_delim USE_SVN_FALSE!$USE_SVN_FALSE$ac_delim USE_DEBUG_TRUE!$USE_DEBUG_TRUE$ac_delim USE_DEBUG_FALSE!$USE_DEBUG_FALSE$ac_delim USE_CWDEBUG_TRUE!$USE_CWDEBUG_TRUE$ac_delim USE_CWDEBUG_FALSE!$USE_CWDEBUG_FALSE$ac_delim CC_FINGER_PRINT!$CC_FINGER_PRINT$ac_delim CXX_FINGER_PRINT!$CXX_FINGER_PRINT$ac_delim CXXCPP_FINGER_PRINT!$CXXCPP_FINGER_PRINT$ac_delim CXXFLAGS_FINGER_PRINT!$CXXFLAGS_FINGER_PRINT$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 27; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_arg=$ac_file _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "src/timestamp-sys.h":F) if cmp -s src/sys.h src/timestamp-sys.h 2> /dev/null; then echo "config.status: sys.h is unchanged" else echo "config.status: creating sys.h" cp src/timestamp-sys.h src/sys.h fi touch src/timestamp-sys.h ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi ext3grep-0.10.1/Makefile.in0000644000175000017500000005016511121223215012315 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure INSTALL NEWS config.guess config.sub \ depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ ACLOCAL_CWFLAGS = @ACLOCAL_CWFLAGS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FINGER_PRINT = @CC_FINGER_PRINT@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWD_FLAGS = @CWD_FLAGS@ CWD_LIBS = @CWD_LIBS@ CWD_R_FLAGS = @CWD_R_FLAGS@ CWD_R_LIBS = @CWD_R_LIBS@ CW_DEBUG_FLAGS = @CW_DEBUG_FLAGS@ CW_OPTIMISE_FLAGS = @CW_OPTIMISE_FLAGS@ CW_STRIPPED_CXXFLAGS = @CW_STRIPPED_CXXFLAGS@ CW_WARNING_FLAGS = @CW_WARNING_FLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXCPP_FINGER_PRINT = @CXXCPP_FINGER_PRINT@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ @CWD_FLAGS@ CXXFLAGS_FINGER_PRINT = @CXXFLAGS_FINGER_PRINT@ CXX_FINGER_PRINT = @CXX_FINGER_PRINT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN_CWDEBUG = @DOXYGEN_CWDEBUG@ DOXYGEN_DEBUG = @DOXYGEN_DEBUG@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @CWD_LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ Makefilein = @Makefilein@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCHFLAGS = @PCHFLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_LIBCWD = @USE_LIBCWD@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = @ACLOCAL_CWFLAGS@ SUBDIRS = src . EXTRA_DIST = LICENSE.GPL2 INSTALL README NEWS DISTCLEANFILES = stamp-h.in MAINTAINERCLEANFILES = $(srcdir)/aclocal.m4 $(srcdir)/config.h.in $(srcdir)/configure $(srcdir)/Makefile.in \ $(srcdir)/install-sh $(srcdir)/missing $(srcdir)/mkinstalldirs $(srcdir)/config.guess $(srcdir)/config.sub \ $(srcdir)/ltmain.sh $(srcdir)/stamp-h.in $(srcdir)/ChangeLog $(srcdir)/depcomp troep* all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-local \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-generic distclean-hdr distclean-local distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am # --------------- Maintainer's Section distclean-local: rm -rf $(srcdir)/autom4te.cache *~ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ext3grep-0.10.1/NEWS0000644000175000017500000001013510777707414010770 00000000000000ext3grep-0.6.0 Don't completely and silently break if any file has a single quote in it's name. Don't exhaust the 32-bit address space with mmaps, by mmapping at most 256 inode tables on x86. Added support for recovering files larger than 2 GB. ext3grep-0.5.0 Set the correct modification time on files. Add extended directory blocks in the order parent -> child, so that it does not happen anymore that some extended directory blocks couldn't be added because their parent directory wasn't added yet. Force recompile if CXXFLAGS changes. Don't print any non-ASCII characters. Treat any non-ASCII character as 'weird' in filenames, thus also values larger than 127. Use unsigned long for bitmap_t instead of uint64_t. Added README.globals with a description of the used global variables. Added README.actions with a description of the used action functions. Allow locate database include files without first listing the parent directory. Handle orphaned inodes correctly. Fixed the reported segfault with backtrace: #0 0x0000000000419084 in Inode::dtime (this=0x0) at ./ext3.h:118 #1 0x000000000041168b in filter_dir_entry (... Do not include asm/byteorder.h anymore, which appears to be a private header. ext3grep-0.4.1 Fix compile problem with EXTERNAL_BLOCK=0 ext3grep-0.4.0 Address the problem where two dir entries have the same name but different inode numbers. Print version as first output line. Print more human readable errors if opening of device fails. If configure with libcwd, add --debug and --debug-malloc commandline options. Asserts now print a backtrace. Use EXT3_ROOT_INO instead of 2. Make --enable-debug the default. Demand --enable-maintainer-mode to be used with svn. Append '# END' to the end of the stage1/2 files, and test for it when reading it; regenerate the cache file if it doesn't end on '# END'. ext3grep-0.3.1 Accept weird characters in filenames (almost always). Added code to warn about rejected filenames because of it's characters (although that is hardly used now we that accept everything). Added code that collects statistics about the number of weird characters in a directory (not used yet). ext3grep-0.3.0 Added support for filesystems without the incompatibility feature EXT3_FEATURE_INCOMPAT_FILETYPE. Removed assertion `inode_to_count.size() == 1'. The new algorithm uses the inode found in the journal in this case now (code that I added to 0.1.0). Improved some error messages. ext3grep-0.2.0 Output error message if device can't be opened. Fixed a MAJOR bug for 32-bit systems. ext3grep-0.1.1 Added largefile support; 64-bit off_t. ext3grep-0.1.0 Now using journal to find inode numbers of extended directory blocks! Added detection of reused or corrupted indirect blocks, aborting iteration. Now using mmap(2) for the inode tables, use --disable-mmap to disable. PCH dependency problem was fixed. Write output to directory "RESTORED_FILES" instead of to ".". Fixed a bug that prevented the recovery of files in the root. Fixed infinite loop when --journal-transaction is out of range. ext3grep-0.0.4 Commandline option --histogram: Fixed initialization of commandline_before when --before is not given and time_t is signed. Use new struct Inode instead of ext3_inode. Use inode directly from what was read from disk without copying them first (sizeof(Inode) is equal to the real inode size on disk, so this is possible). Use accessors for every access to an inode. ext3grep-0.0.3 Using e2progs headers instead of kernel headers. Print inode when assert(first_block) fails. Changed license from GPL3 to GPL2. Commandline option --version: Print correct version of ext3grep . Commandline option --zeroed-inodes: Does not need parameter. Fixed compiler warning on 32-bit. Use i_reserved2 instead of i_reserved1 to store inode number (for debugging purposes only, see HOWTO). EXT3_ORPHAN_FS is only used in kernel memory, remove code to print it. ext3grep-0.0.2 Added a temporary workaround to compile with linux headers 2.6.24. ext3grep-0.0.1 Clean up of build system. ext3grep-0.0.0 First public release. ext3grep-0.10.1/install-sh0000755000175000017500000003246410753463634012303 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ext3grep-0.10.1/depcomp0000755000175000017500000000544311112331724011631 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . # Completely stripped for own purposes by Carlo Wood. if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" case "$depmode" in pch) # First compile file without dependency tracking. "$@" || exit $? # Remove the call to libtool its parameters. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift if expr "$1" : "--" >/dev/null; then shift fi fi # Remove `-o $object' and `-include pch.h'. eatpch= IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; -include) shift eatpch=yes ;; *) if test x$eatpch = xyes; then if test "$arg" = "pch.h"; then shift else set fnord "$@" -include "$arg" shift # fnord shift # $arg fi eatpch= else set fnord "$@" "$arg" shift # fnord shift # $arg fi ;; esac done # Generate dependency file. "$@" -MT "$object" -M -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 ext3grep-0.10.1/config.h.in0000644000175000017500000000341111121223221012260 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the header file. */ #undef HAVE_EXT2FS_EXT2FS_H /* Define to 1 if you have the header file. */ #undef HAVE_EXT2FS_EXT2_FS_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define when this project is checked out using svn. */ #undef USE_SVN /* Version number of package */ #undef VERSION /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES ext3grep-0.10.1/src/0000777000175000017500000000000011121223252011115 500000000000000ext3grep-0.10.1/src/debug.h0000644000175000017500000001701511031200277012276 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file debug.h //! @brief This file contains the declaration of debug related macros, objects and functions. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef DEBUG_H #define DEBUG_H #ifndef CWDEBUG #ifndef DOXYGEN // No need to document this. See http://libcwd.sourceforge.net/ for more info. #include #include // std::exit, EXIT_FAILURE #define AllocTag1(p) #define AllocTag2(p, desc) #define AllocTag_dynamic_description(p, x) #define AllocTag(p, x) #define Debug(x) #define Dout(a, b) #define DoutEntering(a, b) #define DoutFatal(a, b) LibcwDoutFatal(::std, , a, b) #define ForAllDebugChannels(STATEMENT) #define ForAllDebugObjects(STATEMENT) #define LibcwDebug(dc_namespace, x) #define LibcwDout(a, b, c, d) #define LibcwDoutFatal(a, b, c, d) do { ::std::cerr << d << ::std::endl; ::std::exit(EXIT_FAILURE); } while (1) #define NEW(x) new x #define CWDEBUG_ALLOC 0 #define CWDEBUG_MAGIC 0 #define CWDEBUG_LOCATION 0 #define CWDEBUG_LIBBFD 0 #define CWDEBUG_DEBUG 0 #define CWDEBUG_DEBUGOUTPUT 0 #define CWDEBUG_DEBUGM 0 #define CWDEBUG_DEBUGT 0 #define CWDEBUG_MARKER 0 #endif // !DOXYGEN #else // CWDEBUG #ifndef DEBUGCHANNELS //! @brief The namespace in which the \c dc namespace is declared. // // Libcwd demands that this macro is defined // before is included and must be the name of the namespace containing // the \c dc (Debug Channels) namespace. // // @sa debug::channels::dc #define DEBUGCHANNELS ::debug::channels #endif #include //! Debug specific code. namespace debug { void init(void); // Initialize debugging code, called once from main. void init_thread(void); // Initialize debugging code, called once for each thread. //! @brief Debug Channels (dc) namespace. // // @sa debug::channels::dc namespace channels { // namespace DEBUGCHANNELS //! The namespace containing the actual debug channels. namespace dc { using namespace libcwd::channels::dc; using libcwd::channel_ct; #ifndef DOXYGEN // Doxygen bug causes a warning here. // Add the declaration of new debug channels here // and add their definition in a custom debug.cc file. //extern channel_ct custom; #endif } // namespace dc } // namespace DEBUGCHANNELS #if CWDEBUG_LOCATION std::string call_location(void const* return_addr); #endif //! @brief Interface for marking scopes of invisible memory allocations. // // Creation of the object does nothing, you have to explicitly call // InvisibleAllocations::on. Destruction of the object automatically // cancels any call to \c on of this object. This makes it exception- // (stack unwinding) and recursive-safe. struct InvisibleAllocations { int M_on; //!< The number of times that InvisibleAllocations::on() was called. //! Constructor. InvisibleAllocations() : M_on(0) { } //! Destructor. ~InvisibleAllocations() { while (M_on > 0) off(); } //! Set invisible allocations on. Can be called recursively. void on(void) { libcwd::set_invisible_on(); ++M_on; } //! Cancel one call to on(). void off(void) { assert(M_on > 0); --M_on; libcwd::set_invisible_off(); } }; //! @brief Interface for marking scopes with indented debug output. // // Creation of the object increments the debug indentation. Destruction // of the object automatically decrements the indentation again. struct Indent { int M_indent; //!< The extra number of spaces that were added to the indentation. //! Construct an Indent object. Indent(int indent) : M_indent(indent) { if (M_indent > 0) libcwd::libcw_do.inc_indent(M_indent); } //! Destructor. ~Indent() { if (M_indent > 0) libcwd::libcw_do.dec_indent(M_indent); } }; } // namespace debug //! Debugging macro. // // Print "Entering " << \a data to channel \a cntrl and increment // debugging output indentation until the end of the current scope. #define DoutEntering(cntrl, data) \ int __ext3grep_debug_indentation = 2; \ { \ LIBCWD_TSD_DECLARATION; \ if (LIBCWD_DO_TSD_MEMBER_OFF(::libcwd::libcw_do) < 0) \ { \ ::libcwd::channel_set_bootstrap_st __libcwd_channel_set(LIBCWD_DO_TSD(::libcwd::libcw_do) LIBCWD_COMMA_TSD); \ bool on; \ { \ using namespace LIBCWD_DEBUGCHANNELS; \ on = (__libcwd_channel_set|cntrl).on; \ } \ if (on) \ Dout(cntrl, "Entering " << data); \ else \ __ext3grep_debug_indentation = 0; \ } \ } \ debug::Indent __ext3grep_debug_indent(__ext3grep_debug_indentation); #endif // CWDEBUG #undef ASSERT #ifdef DEBUG #include "backtrace.h" extern void assert_fail(char const* expr, char const* file, int line, char const* function); #define STRING(x) #x #define ASSERT(expr) \ (static_cast((expr) ? 0 \ : (assert_fail(STRING(expr), __FILE__, __LINE__, __PRETTY_FUNCTION__), 0))) #else // !DEBUG #include #define ASSERT(expr) assert(expr) #endif // !DEBUG #ifndef EXTERNAL_BLOCK #define EXTERNAL_BLOCK 0 #endif #if EXTERNAL_BLOCK #define SOMEONES_BLOCK_SIZE 4096 #else #define SOMEONES_BLOCK_SIZE 1 #endif extern uint32_t someones_inode_count; extern unsigned char someones_block[SOMEONES_BLOCK_SIZE]; #endif // DEBUG_H ext3grep-0.10.1/src/dump_hex_to.cc0000644000175000017500000000354611077716157013710 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file dump_hex_to.cc Implementation of the dump_hex_to function. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #endif //----------------------------------------------------------------------------- // // dump_hex_to // void dump_hex_to(std::ostream& os, unsigned char const* buf, size_t size, size_t addr_offset) { for (size_t addr = 0; addr < size; addr += 16) { os << std::hex << std::setfill('0') << std::setw(4) << (addr + addr_offset) << " |"; int offset; for (offset = 0; offset < 16 && addr + offset < size; ++offset) os << ' ' << std::hex << std::setfill('0') << std::setw(2) << (int)buf[addr + offset]; for (; offset < 16; ++offset) os << " "; os << " | "; for (int offset = 0; offset < 16 && addr + offset < size; ++offset) { unsigned char c = buf[addr + offset]; if (!std::isprint(c)) c = '.'; os << c; } os << '\n'; } os << std::dec; } ext3grep-0.10.1/src/endian_conversion.h0000644000175000017500000000561311034403061014713 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file endian_conversion.h Endianess conversion functions. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // Stanislaw T. Findeisen // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // ChangeLog // // 2008-07-07 STF // * (read_le32): Add. Read 32-bit little endian integers from a // chain of bytes. // * (__le16_to_cpu, __le32_to_cpu): Add. Convert little endian // integers to native integers. #ifndef ENDIAN_CONVERSION_H #define ENDIAN_CONVERSION_H #ifndef USE_PCH #include // Needed for uint16_t and uint32_t #include "ext3.h" // Needed for __u8 #endif // We keep using these types (actually defined in kernel headers) for clarity (to know when something is little endian and when big endian on DISK). // ext3grep assumes uint16_t and uint32_t to be little endian (intel cpu). typedef uint16_t __le16; typedef uint16_t __be16; typedef uint32_t __le32; typedef uint32_t __be32; inline uint32_t __be32_to_cpu(__be32 x) { return x << 24 | x >> 24 | (x & (uint32_t)0x0000ff00UL) << 8 | (x & (uint32_t)0x00ff0000UL) >> 8; } inline uint16_t __be16_to_cpu(__be16 x) { return x << 8 | x >> 8; } // Convert Big Endian to Little Endian. inline __le32 be2le(__be32 v) { return __be32_to_cpu(v); } inline __le16 be2le(__be16 v) { return __be16_to_cpu(v); } inline __u8 be2le(__u8 v) { return v; } // Using the headers from e2fsprogs, the big endian journal structs // use normal types. However, since WE read raw data into them, // they are really still big endian. Calling be2le on those // types therefore still needs to do the conversion. inline __le32 be2le(__s32 const& v) { return be2le(*reinterpret_cast<__be32 const*>(&v)); } // ext3grep assumes uint16_t and uint32_t to be little endian (intel cpu). inline uint32_t __le32_to_cpu(__le32 x) { return x; } inline uint16_t __le16_to_cpu(__le16 x) { return x; } /** * Reads __le32 from a string. */ inline __le32 read_le32(unsigned char* s) { __le32 v = s[3]; v <<= 8; v |= s[2]; v <<= 8; v |= s[1]; v <<= 8; v |= s[0]; return v; } #endif // ENDIAN_CONVERSION_H ext3grep-0.10.1/src/init_journal_consts.h0000644000175000017500000000216411031754425015306 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file init_journal_consts.h Declaration of function init_journal_consts. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef INIT_JOURNAL_CONSTS_H #define INIT_JOURNAL_CONSTS_H void init_journal_consts(void); #endif // INIT_JOURNAL_CONSTS_H ext3grep-0.10.1/src/superblock.h0000644000175000017500000000504511031755064013372 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file superblock.h Superblock accessors. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef SUPERBLOCK_H #define SUPERBLOCK_H #include "endian_conversion.h" // Super block accessors. inline int inode_count(ext3_super_block const& super_block) { return super_block.s_inodes_count; } inline int block_count(ext3_super_block const& super_block) { return super_block.s_blocks_count; } inline int reserved_block_count(ext3_super_block const& super_block) { return super_block.s_r_blocks_count; } inline int first_data_block(ext3_super_block const& super_block) { return super_block.s_first_data_block; } inline int block_size(ext3_super_block const& super_block) { return EXT3_BLOCK_SIZE(&super_block); } inline int fragment_size(ext3_super_block const& super_block) { return EXT3_FRAG_SIZE(&super_block); } inline int blocks_per_group(ext3_super_block const& super_block) { return EXT3_BLOCKS_PER_GROUP(&super_block); } inline int inodes_per_group(ext3_super_block const& super_block) { return EXT3_INODES_PER_GROUP(&super_block); } inline int first_inode(ext3_super_block const& super_block) { return EXT3_FIRST_INO(&super_block); } inline int inode_size(ext3_super_block const& super_block) { return EXT3_INODE_SIZE(&super_block); } inline int inode_blocks_per_group(ext3_super_block const& super_block) { return inodes_per_group(super_block) * inode_size(super_block) / block_size(super_block); } inline int groups(ext3_super_block const& super_block) { return inode_count(super_block) / inodes_per_group(super_block); } // Journal superblock accessor. inline int block_count(journal_superblock_t const& journal_super_block) { return be2le(journal_super_block.s_maxlen); } #endif // SUPERBLOCK_H ext3grep-0.10.1/src/load_meta_data.cc0000644000175000017500000000652211031575453014300 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file load_meta_data.cc Implementation of the function load_meta_data. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include "debug.h" #endif #include "globals.h" #include "conversion.h" //----------------------------------------------------------------------------- // // load_meta_data // #if !USE_MMAP void load_inodes(int group) { DoutEntering(dc::notice, "load_inodes(" << group << ")"); if (!block_bitmap[group]) load_meta_data(group); // The start block of the inode table. int block_number = group_descriptor_table[group].bg_inode_table; // Load all inodes of this group into memory. char* inode_table = new char[inodes_per_group_ * inode_size_]; device.seekg(block_to_offset(block_number)); ASSERT(device.good()); device.read(inode_table, inodes_per_group_ * inode_size_); ASSERT(device.good()); all_inodes[group] = new Inode[inodes_per_group_]; // Copy the first 128 bytes of each inode into all_inodes[group]. for (int i = 0; i < inodes_per_group_; ++i) std::memcpy(all_inodes[group][i], inode_table + i * inode_size_, sizeof(Inode)); // Free temporary table again. delete [] inode_table; #ifdef DEBUG // We set this, so that we can find back where an inode struct came from // during debugging of this program in gdb. It is not used anywhere. // Note that THIS is the only reason that !USE_MMAP exists: we can't write to a mmapped area. // Another solution would be to just allocate a seperate array for just this number, of course. for (int i = 0; i < inodes_per_group_; ++i) const_cast(all_inodes[group])[i].set_reserved2(i + 1 + group * inodes_per_group_); #endif } #endif void load_meta_data(int group) { if (block_bitmap[group]) // Already loaded? return; DoutEntering(dc::notice, "load_meta_data(" << group << ")"); // Load block bitmap. block_bitmap[group] = new bitmap_t[block_size_ / sizeof(bitmap_t)]; device.seekg(block_to_offset(group_descriptor_table[group].bg_block_bitmap)); ASSERT(device.good()); device.read(reinterpret_cast(block_bitmap[group]), block_size_); ASSERT(device.good()); // Load inode bitmap. inode_bitmap[group] = new bitmap_t[block_size_ / sizeof(bitmap_t)]; device.seekg(block_to_offset(group_descriptor_table[group].bg_inode_bitmap)); ASSERT(device.good()); device.read(reinterpret_cast(inode_bitmap[group]), block_size_); ASSERT(device.good()); #if !USE_MMAP // Load all inodes into memory. load_inodes(group); #endif } ext3grep-0.10.1/src/show_journal_inodes.cc0000644000175000017500000000341111076233233015423 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file show_journal_inodes.cc Implementation of the function show_journal_inodes. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include "ext3.h" #endif #include "journal.h" #include "print_inode_to.h" void show_journal_inodes(int inodenr) { std::vector > inodes; get_inodes_from_journal(inodenr, inodes); std::cout << "Copies of inode " << inodenr << " found in the journal:\n"; uint32_t last_mtime = std::numeric_limits::max(); for (std::vector >::iterator iter = inodes.begin(); iter != inodes.end(); ++iter) { Inode const& inode(iter->second); if (inode.mtime() != last_mtime) { last_mtime = inode.mtime(); std::cout << "\n--------------Inode " << inodenr << "-----------------------\n"; print_inode_to(std::cout, inode); } } } ext3grep-0.10.1/src/jfs_compat.h0000644000175000017500000000045011031023756013335 00000000000000#ifndef JFS_COMPAT_H #define JFS_COMPAT_H struct __whatever_s { int j_max_transaction_buffers; __whatever_s* j_committing_transaction; int t_outstanding_credits; }; typedef unsigned gfp_t; typedef unsigned int tid_t; typedef struct __whatever_s journal_t; #endif // JFS_COMPAT_H ext3grep-0.10.1/src/backtrace.h0000644000175000017500000000216710777663323013156 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file backtrace.h Declaration for backtrace.cc // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef BACKTRACE_H #define BACKTRACE_H #ifndef USE_PCH #include #endif extern void dump_backtrace_on(std::ostream& os); #endif // BACKTRACE_H ext3grep-0.10.1/src/custom.cc0000644000175000017500000020465011077723460012701 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file custom.cc Functions that can be called by passing the commandline option --custom. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include "ext3.h" #include "debug.h" #endif #include "commandline.h" #include "globals.h" #include "ostream_operators.h" #include "inode.h" #include "conversion.h" #include "init_journal_consts.h" #include "load_meta_data.h" #include "forward_declarations.h" #include "is_blockdetection.h" #include "indirect_blocks.h" #include "restore.h" #include "get_block.h" #include "init_consts.h" #include "print_inode_to.h" // The first part of this file was written and used for custom job: // recovering emails on a 40 GB partition that had no information // left in the journal and had been mounted for a week since the deletion. // In the end, 85% of the emails were recovered. // // The second part of this file was written and used for another // custom job: recovering a vmware flat file of 322 GB. // In the end, 100% was recovered. bool is_double_indirect_block(unsigned char* block_ptr) { static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; std::cout << "Calling is_indirect_block(*)..." << std::endl; if (!is_indirect_block(block_ptr), true) return false; uint32_t* p = reinterpret_cast(block_ptr); do { unsigned char* indirect_block_ptr = get_block(*p, block_buf); std::cout << "Calling is_indirect_block(" << *p << ")..." << std::endl; std::cout << "Group: " << block_to_group(super_block, *p) << "; block: " << *p << std::endl; if (!is_indirect_block(indirect_block_ptr), true) return false; } while (*++p); return true; } bool is_tripple_indirect_block(unsigned char* block_ptr) { static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; std::cout << "Calling is_indirect_block(*)..." << std::endl; if (!is_indirect_block(block_ptr), true) return false; uint32_t* p = reinterpret_cast(block_ptr); bool res = true; do { unsigned char* indirect_block_ptr = get_block(*p, block_buf); std::cout << "Calling is_double_indirect_block(" << *p << ")..." << std::endl; std::cout << "Group: " << block_to_group(super_block, *p) << "; block: " << *p << std::endl; if (!is_double_indirect_block(indirect_block_ptr)) { res = false; std::cout << "FAILED! But continue anyway..." << std::endl; //return false; } } while (*++p); return res; } #if 0 // This must be set to the full email address (I obfuscated it before // committing this to SVN for obvious reasons). #define EMAILADDRESS "g@f" uint32_t wbblocks[] = { // Delivered-To: 131961, 132587, 132598, 132599, 132600, 132601, 132602, 132603, 132610, 132617, 132621, 132623, 132625, 132626, 133492, 133520, 133522, 133523, 133524, 133536, 133537, 133552, 133554, 133556, 133564, 133565, 133568, 133569, 133570, 133571, 133576, 133577, 133578, 133579, 133843, 133864, 133865, 133866, 133867, 135213, 135217, 135218, 135219, 135220, 135222, 135223, 135224, 135225, 135227, 135228, 135245, 135246, 135254, 135255, 135256, 135261, 135263, 135264, 135265, 135267, 135269, 135270, 135271, 135272, 135273, 135276, 135278, 135279, 135280, 135287, 135289, 135290, 135291, 135292, 135293, 135294, 135295, 135298, 135300, 135301, 135302, 135303, 135304, 137578, 137588, 137606, 137607, 137608, 137609, 137610, 137611, 137612, 137621, 137622, 137623, 137625, 137626, 137629, 137631, 137638, 139352, 139353, 139354, 139357, 139360, 139361, 139362, 139363, 139364, 139365, 139366, 139367, 139368, 139369, 139370, 139372, 139373, 139374, 139375, 139376, 139377, 139379, 139381, 139383, 139384, 139385, 139387, 139388, 143609, 143627, 143628, 143630, 143631, 143641, 143642, 143644, 143645, 143646, 143650, 143665, 143669, 143670, 143671, 143675, 143717, 143747, 143748, 143749, 143750, 143751, 143752, 143753, 143754, 143755, 143762, 143769, 143774, 143777, 143780, 143781, 143783, 143785, 143787, 143800, 145435, 145437, 145446, 145447, 145448, 145449, 145453, 145454, 145461, 145469, 145470, 145471, 145472, 145473, 145474, 145476, 145477, 145480, 145482, 145484, 145485, 145486, 145489, 145490, 145491, 145492, 145493, 145494, 145495, 145880, 147756, 147757, 147758, 147759, 147760, 147761, 147762, 148099, 148100, 148531, 148533, 148535, 149548, 149550, 149551, 149552, 149553, 149554, 149555, 149556, 149568, 149569, 149570, 149572, 149573, 149575, 149576, 149577, 149578, 149579, 149580, 149582, 149592, 149593, 149594, 149596, 149597, 151594, 151618, 151633, 151643, 151646, 151647, 151648, 151650, 151652, 151661, 151673, 151676, 151677, 151679, 153637, 154270, 154843, 154854, 155336, 156087, 156908, 159508, 160258, 160260, 160262, 160263, 161968, 161969, 161971, 161972, 161973, 161984, 161986, 161988, 161990, 161995, 161997, 162002, 162003, 162004, 162008, 162010, 162014, 162016, 162018, 162020, 162022, 162024, 162028, 162031, 162033, 162035, 162037, 162039, 162041, 162043, 162045, 162047, 162050, 162051, 162052, 162053, 162054, 162055, 162057, 162059, 162075, 162077, 162079, 504599, 519014, 519211, 519423, 519858, 519919, 520076, 520126, 520909, 521778, 524033, 524100, 524236, 527110, 4784662, 4784670, 4784746, 4784758, 4784760, 4784763, 4784771, 4784789, 4784832, 4784835, 4785360, 4786179, 4786198, 4786201, 4786205, 4786206, 4786209, 4786244, 4786245, 4786246, 4786247, 4786252, 4786253, 4786256, 4786257, 4786258, 4786259, 4786260, 4786261, 4786262, 4786267, 4786268, 4786269, 4786270, 4786275, 4786287, 4788235, 4788238, 4788240, 4788243, 4788627, 4788628, 4788852, 4788858, 4788860, 4788861, 4788862, 4788863, 4788865, 4788867, 4788868, 4788871, 4788873, 4788874, 4788875, 4788887, 4788890, 4788891, 4788892, 4788893, 4788895, 4788896, 4788897, 4788898, 4788900, 4788901, 4788902, 4788903, 4788905, 4788906, 4790298, 4790320, 4790323, 4790338, 4790352, 4790421, 4790422, 4790426, 4790432, 4790469, 4790470, 4790471, 4790481, 4790658, 4791131, 4791136, 4791138, 4791139, 4791140, 4791263, 4791270, 4791272, 4791285, 4791286, 4791305, 4791306, 4791307, 4791308, 4791344, 4791345, 4791352, 4791354, 4791367, 4791368, 4791369, 4791375, 4791376, 4791377, 4791378, 4791397, 4791398, 4791399, 4791400, 4791401, 4791407, 4791421, 4791437, 4792326, 4792347, 4792384, 4792390, 4792392, 4792403, 4792441, 4792493, 4792494, 4792495, 4792496, 4792497, 4792498, 4792504, 4792505, 4792580, 4792583, 4792585, 4792593, 4792623, 4792626, 4792897, 4793539, 4794368, 4794370, 4794376, 4794392, 4794403, 4794753, 4794754, 4794787, 4794788, 4794789, 4794794, 4794796, 4794798, 4794859, 4794861, 4794862, 4794864, 4794865, 4794866, 4794867, 4794868, 4794869, 4794871, 4794874, 4794875, 4794876, 4794877, 4794878, 4794879, 4794880, 4794906, 4794908, 4794914, 4796522, 4796550, 4796551, 4796556, 4796560, 4796570, 4796592, 4796875, 4796955, 4796958, 4797450, 4798479, 4798481, 4798491, 4798515, 4798518, 4799123, 4799600, 4799603, 4799621, 4799625, 4799626, 4799628, 4799629, 4799635, 4799638, 4799639, 4799640, 4799642, 4799647, 4799648, 4799649, 4799656, 4799667, 4799668, 4799669, 4799670, 4799681, 4799684, 4799685, 4799686, 4800725, 4800728, 4800729, 4800751, 4800755, 4800756, 4800758, 4800760, 4800761, 4800762, 4800763, 4800764, 4800765, 4800766, 4800767, 4800768, 4800769, 4800770, 4800772, 4800773, 4800774, 4800775, 4800776, 4800777, 4800778, 4800779, 4800782, 4800783, 4800794, 4801101, 4801106, 4801108, 4801118, 4801132, 4802560, 4802696, 4802699, 4802789, 4802790, 4802791, 4802794, 4802798, 4802818, 4802820, 4802821, 4802991, 4804618, 4804623, 4804642, 4804652, 4804783, 4804784, 4804794, 4804807, 4804930, 4805511, 4805945, 4805946, 4805947, 4806662, 4806680, 4806723, 4806724, 4806739, 4806784, 4806786, 4806792, 4806796, 4806797, 4806798, 4806799, 4806800, 4806802, 4806803, 4806804, 4806805, 4806807, 4808748, 4808752, 4808753, 4808757, 4808762, 4808763, 4808764, 4808767, 4808771, 4808773, 4808774, 4808775, 4808776, 4808777, 4808779, 4808780, 4808781, 4808782, 4808784, 4808787, 4808788, 4808789, 4808790, 4808791, 4808792, 4808793, 4808794, 4808796, 4808797, 4808801, 4808802, 4808919, 4808922, 4809278, 4809282, 4810873, 4810889, 4810891, 4810896, 4810929, 4810930, 4810946, 4810951, 4810958, 4810970, 4810973, 4811005, 4811006, 4811011, 4811012, 4811016, 4811018, 4811019, 4811020, 4811038, 4811056, 4811057, 4811058, 4811060, 4811061, 4811077, 4811078, 4811081, 4811082, 4811083, 4811084, 4811534, 4811573, 4811633, 4811639, 4811805, 4811811, 4811815, 4811827, 4812355, 4812364, 4812808, 4812811, 4812910, 4812911, 4812934, 4812936, 4812945, 4813122, 4813455, 4813524, 4814047, 4814049, 4814051, 4814052, 4814054, 4814058, 4814059, 4814060, 4814061, 4814062, 4814063, 4814064, 4814067, 4814068, 4814070, 4814071, 4814072, 4814073, 4814079, 4814085, 4814479, 4814893, 4814900, 4814901, 4814902, 4814903, 4814907, 4814941, 4815767, 4815777, 4815778, 4815779, 4815780, 4815781, 4995757, 4998221, 5001702, 5001707, 5007956, 5011543, 5247648, 5251712, 5259945, 5261346, 5268196, 5274299, 6141983, 7444886, 7502539, // SquirrelMail authenticated: 131690, 131757, 131811, 131813, 131816, 131820, 131821, 131822, 131962, 131980, 132568, 132572, 132573, 132575, 132578, 132583, 132585, 132586, 132750, 133125, 133132, 133136, 133145, 133147, 133405, 133445, 133450, 133463, 133483, 133484, 133486, 133488, 133525, 133545, 134368, 134402, 134405, 134406, 134419, 134420, 134423, 134439, 134954, 135212, 135214, 135216, 135237, 135281, 135819, 137547, 137550, 137558, 137559, 137604, 137637, 138479, 138515, 138564, 138600, 138604, 138714, 138731, 139269, 139270, 139271, 139276, 139278, 139620, 139621, 139635, 139638, 139648, 140297, 143437, 143438, 143439, 143440, 143442, 143444, 143445, 143446, 143448, 143579, 143601, 143603, 143604, 143605, 143606, 143607, 143608, 143611, 143614, 143619, 143629, 143632, 143652, 143653, 143708, 143723, 143724, 144282, 144452, 144584, 144589, 145434, 145487, 145496, 145497, 145500, 145548, 146873, 148998, 149044, 149515, 149517, 149523, 149524, 149525, 149529, 149530, 149532, 149538, 149541, 149542, 149546, 149547, 149557, 149560, 150054, 150236, 150304, 150525, 150559, 151595, 151596, 151597, 151598, 151663, 153414, 153609, 153610, 153611, 153612, 153613, 153614, 153615, 153616, 153617, 153618, 153619, 153620, 153623, 153645, 153651, 153656, 154340, 154345, 154346, 154407, 154558, 154806, 154810, 155362, 156078, 156079, 156084, 156086, 156907, 156909, 156947, 157004, 157036, 157038, 157043, 157044, 157067, 158795, 158796, 158798, 159012, 159053, 159260, 159261, 159619, 159622, 161862, 161865, 161866, 161869, 161934, 161948, 161970, 161975, 162125, 162960, 163079, 163113, 163114, 163118, 163124, 163158, 163162, 163163, 163166, 163172, 163192, 163195, 163197, 168280, 168342, 168363, 185502, 504510, 4786178, 4786242, 4788242, 4788624, 4788849, 4788850, 4790358, 4792327, 4792389, 4793537, 4794919, 4798482, 4800771, 4804621, 4804651, 4807173, 4808747, 4811600, 4812944, 4814856, 5013485 }; struct block_size_pairs_st { uint32_t block_number; size_t size; }; // This data was extracted from remaining directory blocks containing // dir entries with inodes that were deleted in the interval where // the missing files were deleted (the interval being determined // statistically by looking at group/size matches for small files). // The file names in those directory blocks contained both, the // time at which they were created as well as the size of the file. // The size of the file was then determined by matching the given // creation time with the 'Received:' header line in the emails. // See work.log2 for a full description. int const block_size_pairs_size = 94; block_size_pairs_st block_size_pairs[block_size_pairs_size] = { { 133520, 5746 }, { 135220, 5782 }, { 135225, 4706 }, { 137631, 10012 }, { 137638, 32718 }, { 143762, 27720 }, { 143769, 12721 }, { 143781, 4478 }, { 143783, 4440 }, { 149573, 5745 }, { 153637, 4302397 }, { 154270, 140427 }, { 154843, 18110 }, { 154854, 4316909 }, { 4784760, 838866 }, { 4784771, 13350 }, { 4784789, 9698 }, { 4784835, 151939 }, { 4786179, 13067 }, { 4786206, 46274 }, { 4786209, 92893 }, { 4786242, 4629 }, { 4786275, 6337 }, { 4788238, 6531 }, { 4788240, 4307 }, { 4788243, 1516073 }, { 4788627, 5751 }, { 4788628, 882212 }, { 4788850, 6958 }, { 4788852, 9725 }, { 4790323, 53155 }, { 4790338, 9737514 }, { 4790358, 37408 }, { 4790358, 37662 }, { 4790432, 27720 }, { 4791140, 112024 }, { 4792347, 34161 }, { 4792384, 19492 }, { 4792390, 7509 }, { 4792403, 4127 }, { 4792441, 14684 }, { 4792623, 8979 }, { 4792626, 98247 }, { 4794376, 5745 }, { 4794914, 18909 }, { 4794919, 4197 }, { 4796875, 219680 }, { 4796958, 1515670 }, { 4798491, 1488414 }, { 4799600, 6602 }, { 4799603, 49768 }, { 4799621, 6409 }, { 4800751, 7756 }, { 4800773, 259336 }, { 4802798, 76966 }, { 4802818, 32372 }, { 4802991, 6257548 }, { 4804623, 4101 }, { 4804642, 74611 }, { 4804807, 398680 }, { 4804930, 5112 }, { 4805511, 14272 }, { 4806739, 6508 }, { 4806784, 4486 }, { 4806786, 6727 }, { 4806792, 12438 }, { 4806805, 7652 }, { 4806807, 6825 }, { 4807173, 22041 }, { 4808753, 11521 }, { 4808801, 64046 }, { 4808802, 14917 }, { 4808922, 1413362 }, { 4810930, 27575 }, { 4810946, 39669 }, { 4811573, 8959 }, { 4811600, 34322 }, { 4811600, 34577 }, { 4811633, 39784 }, { 4811639, 35141 }, { 4811805, 8400 }, { 4811811, 7753 }, { 4812945, 2814448 }, { 4814047, 4274 }, { 4814479, 5252 }, { 4814901, 3433765 }, { 4814903, 5798 }, { 4814907, 19876 }, { 4814941, 57078 }, { 4995757, 4671 }, { 5011543, 2492287 }, { 5251712, 283591 }, { 5261346, 267621 }, { 6141983, 2494271 } }; struct Data { bool one_block; // Set if the block ends on zeroes. bool sent; // Set if the headers have a line containing "SquirrelMail authenticated user EMAILADDRESS". bool received; // Set if the block has a line "" bool headers; // Set if the block contains all the headers. std::string boundary; // Set to the boundary string if any exists in the headers in the first block. bool multipart_match; // Set if a boundary string was found and it matched the last non-empty line in the last block. std::vector size; // Possible sizes as per block_size_pairs. size_t recovered_size; // Number of bytes that were recovered. Data(void) : one_block(false), sent(false), received(false), headers(false), multipart_match(false), recovered_size(0) { } }; unsigned int const number_of_start_blocks = sizeof(wbblocks)/sizeof(uint32_t); Data data[number_of_start_blocks]; void create_directory(std::string const& dirname) { struct stat buf; int res = stat(dirname.c_str(), &buf); if (res == -1 && errno != ENOENT) { perror("stat"); exit(EXIT_FAILURE); } if (res == -1 && errno == ENOENT) { if (mkdir(dirname.c_str(), 0750) == -1) { perror("mkdir"); exit(EXIT_FAILURE); } } else if (!S_ISDIR(buf.st_mode)) { std::cerr << dirname << " exists and is not a directory.\n"; exit(EXIT_FAILURE); } } struct BlockInfo { uint32_t next_block; // Set to non-zero if known to be the next block of the email. bool known_not_contiguous; // Set if it is known that the next block on disk is not the next block of the email. int search_depth; // Set to the number of block directly following the last block that were checked. BlockInfo(uint32_t next_block_, bool known_not_contiguous_, int search_depth_) : next_block(next_block_), known_not_contiguous(known_not_contiguous_), search_depth(search_depth_) { } }; typedef std::map block_info_map_type; block_info_map_type block_info_map; void load_block_info_map(void) { std::ifstream file; file.open("block_info_map"); uint32_t blocknr; uint32_t next_block; bool known_not_contiguous; int search_depth; while (file >> blocknr >> next_block >> known_not_contiguous >> search_depth) { block_info_map.insert(block_info_map_type::value_type(blocknr, BlockInfo(next_block, known_not_contiguous, search_depth))); } } void save_block_info_map(void) { std::ofstream file; file.open("block_info_map_out"); for (block_info_map_type::iterator iter = block_info_map.begin(); iter != block_info_map.end(); ++iter) file << iter->first << ' ' << iter->second.next_block << ' ' << iter->second.known_not_contiguous << ' ' << iter->second.search_depth << '\n'; } int get_block_size(unsigned char* block_ptr) { int size = block_size_; for (unsigned int j = block_size_ - 1; j > 0; --j) { if (block_ptr[j] != 0) { size = j + 1; break; } } return size; } enum answer_t { contiguous, not_contiguous, unclear }; class FileBlock { private: int M_current_block_number; int M_current_block_count; int M_indirect_index; int M_double_index; int M_tripple_index; uint32_t M_indirect_block_buf[EXT3_MAX_BLOCK_SIZE / sizeof(uint32_t)]; uint32_t M_double_indirect_block_buf[EXT3_MAX_BLOCK_SIZE / sizeof(uint32_t)]; uint32_t M_tripple_indirect_block_buf[EXT3_MAX_BLOCK_SIZE / sizeof(uint32_t)]; bool M_known_not_contiguous; public: FileBlock(int current_block_number) : M_current_block_number(current_block_number), M_current_block_count(1), M_indirect_index(-1), M_double_index(-1), M_tripple_index(-1), M_known_not_contiguous(false) { } bool next(void); int current_block_number(void) const { return M_current_block_number; } bool known_not_contiguous(void) const { return M_known_not_contiguous; } private: answer_t human_verification(int next_block, bool first_indirect_block); }; answer_t FileBlock::human_verification(int next_block, bool first_indirect_block) { int const max_search_depth = 10; block_info_map_type::iterator iter = block_info_map.find(M_current_block_number); if (iter != block_info_map.end()) // Block already known from previous session? { if (iter->second.next_block) { M_current_block_number = iter->second.next_block; return contiguous; } if (iter->second.known_not_contiguous && (first_indirect_block || iter->second.search_depth >= max_search_depth)) { M_known_not_contiguous = true; return not_contiguous; } } unsigned char block_buf1[EXT3_MAX_BLOCK_SIZE]; get_block(M_current_block_number, block_buf1); int prev_block = M_current_block_number; int search_depth = (first_indirect_block || iter == block_info_map.end()) ? 0 : iter->second.search_depth; std::string answer = "n"; do { if (search_depth >= max_search_depth) break; M_current_block_number = next_block + search_depth; ++search_depth; unsigned char block_buf2[EXT3_MAX_BLOCK_SIZE]; get_block(M_current_block_number, block_buf2); unsigned char* p1 = block_buf1 + block_size_; int newline_count = 0; for (--p1; newline_count < 10 && p1 >= block_buf1; --p1) if (*p1 == '\n') ++newline_count; ++p1; unsigned char* p2 = block_buf2; for (newline_count = 0; newline_count < 10 && p2 < block_buf2 + block_size_; p2++) if (*p2 == '\n') ++newline_count; --p2; std::cout << "============================================================================================================================================\n"; std::cout << "\e[31m"; std::cout.write((char const*)p1, block_buf1 + block_size_ - p1); std::cout << "\e[0m"; for (char const* p = (char const*)block_buf2; p < (char const*)p2; ++p) if (std::isprint(*p) || *p == '\n') std::cout << *p; else std::cout << '~'; std::cout << std::endl; for(;;) { std::cout << "Does this look ok? (y/n) " << std::flush; std::cin >> answer; if (answer == "y" || answer == "n" || answer == "?") break; } if (answer != "n") break; } while (!first_indirect_block); if (answer == "?") { if (--search_depth > 0) answer = "n"; } if (answer == "y") { if (iter != block_info_map.end()) block_info_map.erase(iter); block_info_map.insert(block_info_map_type::value_type(prev_block, BlockInfo(M_current_block_number, false, search_depth))); save_block_info_map(); return contiguous; } else if (answer == "n") { if (iter != block_info_map.end()) block_info_map.erase(iter); block_info_map.insert(block_info_map_type::value_type(prev_block, BlockInfo(0, true, search_depth))); M_known_not_contiguous = true; save_block_info_map(); return not_contiguous; } return unclear; } bool FileBlock::next(void) { bool find_next_indirect_block = false; ++M_current_block_count; if (M_current_block_count < 13) { answer_t answer = human_verification(M_current_block_number + 1, false); // Assume first 12 blocks are contiguous. if (answer == not_contiguous) { M_known_not_contiguous = true; return false; } } else if (M_current_block_count == 13) find_next_indirect_block = true; else { for (;;) // So we can use break. { ++M_indirect_index; if (M_indirect_index < 1024) M_current_block_number = M_indirect_block_buf[M_indirect_index]; if (M_indirect_index == 1024 || !M_current_block_number) { if (M_double_index == -1) { find_next_indirect_block = true; break; } ++M_double_index; if (M_double_index < 1024) M_current_block_number = M_double_indirect_block_buf[M_double_index]; if (M_double_index == 1024 || !M_current_block_number) { if (M_tripple_index == -1) { find_next_indirect_block = true; break; } ++M_tripple_index; if (M_tripple_index < 1024) M_current_block_number = M_tripple_indirect_block_buf[M_tripple_index]; if (M_tripple_index == 1024 || !M_current_block_number) return false; get_block(M_current_block_number, (unsigned char*)M_double_indirect_block_buf); M_double_index = 0; M_current_block_number = M_double_indirect_block_buf[M_double_index]; if (!M_current_block_number) return false; } get_block(M_current_block_number, (unsigned char*)M_indirect_block_buf); M_indirect_index = 0; M_current_block_number = M_indirect_block_buf[M_indirect_index]; if (!M_current_block_number) return false; } } } if (find_next_indirect_block) { int old_current_block_number = M_current_block_number; ++M_current_block_number; // Assume indirect block follows directly. get_block(M_current_block_number, (unsigned char*)M_indirect_block_buf); if (!is_indirect_block((unsigned char*)M_indirect_block_buf)) { M_known_not_contiguous = true; return false; // Failure. } if (is_tripple_indirect_block((unsigned char*)M_indirect_block_buf)) { std::memcpy(M_tripple_indirect_block_buf, M_indirect_block_buf, block_size_); M_tripple_index = 0; M_current_block_number = M_tripple_indirect_block_buf[M_tripple_index]; get_block(M_current_block_number, (unsigned char*)M_double_indirect_block_buf); M_double_index = 0; M_current_block_number = M_double_indirect_block_buf[M_double_index]; get_block(M_current_block_number, (unsigned char*)M_indirect_block_buf); M_indirect_index = 0; M_current_block_number = M_indirect_block_buf[M_indirect_index]; } else if (is_double_indirect_block((unsigned char*)M_indirect_block_buf)) { std::memcpy(M_double_indirect_block_buf, M_indirect_block_buf, block_size_); M_double_index = 0; M_current_block_number = M_double_indirect_block_buf[M_double_index]; get_block(M_current_block_number, (unsigned char*)M_indirect_block_buf); M_indirect_index = 0; M_current_block_number = M_indirect_block_buf[M_indirect_index]; } else { M_indirect_index = 0; M_current_block_number = M_indirect_block_buf[M_indirect_index]; } int next_block = M_current_block_number; M_current_block_number = old_current_block_number; answer_t answer = human_verification(next_block, true); if (answer == not_contiguous) { M_known_not_contiguous = true; return false; } } return true; } bool check_boundary(unsigned char* block_ptr, std::string const& boundary) { // This one crosses a block boundary; I manually verified it. if (boundary == "----_=_NextPart_001_01C8C028.8F6267F8") return true; unsigned char* p = block_ptr + block_size_; while ((*--p == 0 || *p == '\n' || std::isspace(*p)) && p > block_ptr) ; if (p == block_ptr) return false; ++p; if (*p != '\n') return false; unsigned char* end = p; while (*--p != '\n' && p > block_ptr) ; if (p == block_ptr) return false; ++p; return ("--" + boundary + "--") == std::string((char const*)p, end - p); } void custom(void) { load_block_info_map(); int one_block_count = 0; static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; // Run over all start blocks. for (unsigned int i = 0; i < number_of_start_blocks; ++i) { //std::cout << "BLOCK: " << wbblocks[i] << std::endl; // Read the start block. unsigned char* block_ptr = get_block(wbblocks[i], block_buf); // Initialize one_block. data[i].one_block = (block_ptr[block_size_ - 1] == 0); if (data[i].one_block) { ++one_block_count; data[i].size.push_back(get_block_size(block_ptr)); } // Search the headers. unsigned char* p = block_ptr; for (int line_count = 0;; ++line_count) { std::string::size_type boundary_pos; unsigned char c; std::string str; do { c = *p++; ASSERT(c != 0); str += c; } while (c != '\n' && p < &block_ptr[block_size_]); if (c != '\n') break; // Not all headers fit in the first block. if (str.size() == 1) { data[i].headers = true; break; } else if (str.find("SquirrelMail authenticated user " EMAILADDRESS) != std::string::npos) { data[i].sent = true; data[i].received = false; } else if (str.substr(0, 13) == "Delivered-To:") { ASSERT(!data[i].sent); data[i].received = true; } else if ((boundary_pos = str.find("boundary=")) != std::string::npos && str[boundary_pos - 1] != '_') { std::string::size_type first = boundary_pos + 9 + ((str[boundary_pos + 9] == '"') ? 1 : 0); std::string::size_type len = str.find_first_of("\"\n", first) - first; data[i].boundary = str.substr(first, len); } } if (data[i].sent) data[i].received = false; } std::cout << "There are " << one_block_count << " emails existing of one block.\n"; std::cout << "There are " << (number_of_start_blocks - one_block_count) << " emails existing of more than one block.\n"; // Stats. int not_contiguous_count = 0; int found_boundary = 0; int found_boundary_in_known_not_contiguous = 0; for (unsigned int i = 0; i < number_of_start_blocks; ++i) { // Sanity checks. ASSERT(data[i].sent || data[i].received); ASSERT(!(data[i].sent && data[i].received)); if (!data[i].headers) std::cout << "Block " << wbblocks[i] << " does not contain all headers.\n"; ASSERT(!(data[i].one_block && !data[i].headers)); ASSERT((data[i].size.empty() && !data[i].one_block) || (data[i].size.size() == 1 && data[i].size[0] < (size_t)block_size_ && data[i].one_block)); // Fill data[i].size with possible sizes of multi-block emails. for (int j = 0; j < block_size_pairs_size; ++j) if (block_size_pairs[j].block_number == wbblocks[i]) data[i].size.push_back(block_size_pairs[j].size); // Create block list. std::list blocks; FileBlock file_block(wbblocks[i]); do { int block_number = file_block.current_block_number(); blocks.push_back(block_number); unsigned char* block_ptr = get_block(block_number, block_buf); int size = get_block_size(block_ptr); data[i].recovered_size += size; if (size < block_size_) { if (!data[i].boundary.empty()) data[i].multipart_match = check_boundary(block_ptr, data[i].boundary); break; } } while(file_block.next()); if (!data[i].boundary.empty()) { ++found_boundary; if (file_block.known_not_contiguous()) ++found_boundary_in_known_not_contiguous; } // Create file name. std::string filename("RECOVERED/"); create_directory(filename); if (data[i].one_block) filename += "one_block/"; else { filename += "multiple_blocks/"; create_directory(filename); if (!data[i].boundary.empty()) { if (data[i].multipart_match) filename += "matched_multipart/"; else filename += "unverified_multipart/"; } create_directory(filename); if (!data[i].size.empty()) { bool size_matches = false; for (std::vector::iterator iter = data[i].size.begin(); iter != data[i].size.end(); ++iter) { if (*iter == data[i].recovered_size) { size_matches = true; break; } } if (size_matches) filename += "matched_size/"; else if (!file_block.known_not_contiguous()) filename += "SIZE_MISMATCH/"; } } create_directory(filename); if (data[i].sent) filename += "sent/"; else filename += "received/"; create_directory(filename); if (!data[i].headers) filename += "not_all_headers_in_first_block/"; create_directory(filename); if (file_block.known_not_contiguous()) { filename += "known_not_contiguous/"; ++not_contiguous_count; } create_directory(filename); std::ostringstream blocknr; blocknr << std::setfill('0') << std::setw(7) << wbblocks[i]; filename += blocknr.str(); // Write block list to file. std::ofstream file; file.open(filename.c_str()); for (std::list::iterator iter = blocks.begin(); iter != blocks.end(); ++iter) { unsigned char* block_ptr = get_block(*iter, block_buf); file.write((char const*)block_ptr, get_block_size(block_ptr)); } file.close(); } save_block_info_map(); std::cout << "Total number of emails with a multipart boundary: " << found_boundary << '\n'; std::cout << "Number of non-contiguous emails: " << not_contiguous_count << '\n'; std::cout << "Number of non-contiguous emails with a multipart boundary: " << found_boundary_in_known_not_contiguous << '\n'; std::cout << "Total number of emails recovered: " << number_of_start_blocks << '\n'; std::cout << "Number of complete emails: " << (number_of_start_blocks - not_contiguous_count) << '\n'; std::cout << "Percentage fully recovered: " << (100.0 * (number_of_start_blocks - not_contiguous_count) / number_of_start_blocks) << "%\n"; } #endif #if 0 void custom(void) { static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; #if 0 #if 0 static unsigned char mail_size[4096]; int len = 0; for (unsigned int i = 0; i < sizeof(wbblocks) / sizeof(uint32_t); ++i) { unsigned char* block_ptr = get_block(wbblocks[i], block_buf); bool saw_zero = false; for (int j = 0; j < block_size_; ++j) { if (block_ptr[j] != 0) { ASSERT(!saw_zero); } else { if (!saw_zero) { len = j; } saw_zero = true; } } if (saw_zero) { std::cout << "BLOCK: " << wbblocks[i] << "; size = " << len << '\n'; ++mail_size[len]; } else { std::cout << "BLOCK: " << wbblocks[i] << "; size > 4096\n"; } } #endif static int groups_count[257]; print_restrictions(); if (commandline_deleted || commandline_histogram == hist_dtime) std::cout << "Only showing deleted entries.\n"; if (commandline_histogram == hist_atime || commandline_histogram == hist_ctime || commandline_histogram == hist_mtime || commandline_histogram == hist_dtime) hist_init(commandline_after, commandline_before); else if (commandline_histogram == hist_group) hist_init(0, groups_); // Run over all (requested) groups. std::vector inodes_group_any; for (int group = 0, ibase = 0; group < groups_; ++group, ibase += inodes_per_group_) { if (commandline_group != -1 && group != commandline_group) continue; // Run over all inodes. for (int bit = 0, inode_number = (group == 0) ? first_inode(super_block) : ibase + 1; bit < inodes_per_group_; ++bit, ++inode_number) { InodePointer inode(get_inode(inode_number)); if (commandline_deleted && !inode->is_deleted()) continue; if ((commandline_histogram == hist_dtime || commandline_histogram == hist_group) && !inode->has_valid_dtime()) continue; if (commandline_directory && !is_directory(inode)) continue; if (commandline_allocated || commandline_unallocated) { bitmap_ptr bmp = get_bitmap_mask(bit); bool allocated = (inode_bitmap[group][bmp.index] & bmp.mask); if (commandline_allocated && !allocated) continue; if (commandline_unallocated && allocated) continue; } time_t xtime = 0; if (commandline_histogram == hist_dtime) xtime = inode->dtime(); else if (commandline_histogram == hist_atime) { xtime = inode->atime(); if (xtime == 0) continue; } else if (commandline_histogram == hist_ctime) { xtime = inode->ctime(); if (xtime == 0) continue; } else if (commandline_histogram == hist_mtime) { xtime = inode->mtime(); if (xtime == 0) continue; } if (xtime && commandline_after <= xtime && xtime < commandline_before) { hist_add(xtime); ++groups_count[group]; inodes_group_any.push_back(inode_number); } if (commandline_histogram == hist_group) { if (commandline_after && commandline_after > (time_t)inode->dtime()) continue; if (commandline_before && (time_t)inode->dtime() >= commandline_before) continue; hist_add(group); } } } hist_print(); #if 0 for (int i = 0; i < groups_; ++i) { std::cout << i << ' ' << groups_count[i] << '\n'; } unsigned int max146 = 0; unsigned int min146 = 0xffffffff; for (std::vector::iterator iter = inodes_group146.begin(); iter != inodes_group146.end(); ++iter) { max146 = std::max(max146, *iter); min146 = std::min(min146, *iter); } std::cout << "min146 = " << min146 << "; max146 = " << max146 << '\n'; std::cout << "diff146 = " << (max146 - min146) << '\n'; ++max146; unsigned char ino146[max146 - min146]; std::memset(ino146, 0, max146 - min146); for (std::vector::iterator iter = inodes_group146.begin(); iter != inodes_group146.end(); ++iter) ino146[*iter - min146] = 1; unsigned int max4 = 0; unsigned int min4 = 0xffffffff; for (std::vector::iterator iter = inodes_group4.begin(); iter != inodes_group4.end(); ++iter) { max4 = std::max(max4, *iter); min4 = std::min(min4, *iter); } std::cout << "min4 = " << min4 << "; max4 = " << max4 << '\n'; std::cout << "diff4 = " << (max4 - min4) << '\n'; ++max4; unsigned char ino4[max4 - min4]; std::memset(ino4, 0, max4 - min4); for (std::vector::iterator iter = inodes_group4.begin(); iter != inodes_group4.end(); ++iter) ino4[*iter - min4] = 1; #else for (std::vector::iterator iter = inodes_group_any.begin(); iter != inodes_group_any.end(); ++iter) { std::cout << "INODE: " << *iter << '\n'; } unsigned int max = 0; unsigned int min = 0xffffffff; for (std::vector::iterator iter = inodes_group_any.begin(); iter != inodes_group_any.end(); ++iter) { max = std::max(max, *iter); min = std::min(min, *iter); } std::cout << "min = " << min << "; max = " << max << '\n'; std::cout << "diff = " << (max - min) << '\n'; ++max; unsigned char ino[max - min]; std::memset(ino, 0, max - min); for (std::vector::iterator iter = inodes_group_any.begin(); iter != inodes_group_any.end(); ++iter) ino[*iter - min] = 1; #endif #endif #if 1 for (int group = 0; group < groups_; ++group) { if (group != 4 && group != 15 && group != 16 && group != 146 && group != 152 && group != 160 && group != 187 && group != 227 && group != 228) continue; //std::cout << "\nSearching group " << group << ": " << std::flush; int first_block = first_data_block(super_block) + group * blocks_per_group(super_block); int last_block = std::min(first_block + blocks_per_group(super_block), block_count(super_block)); for (int block = first_block; block < last_block; ++block) { if (is_journal(block)) continue; unsigned char* block_ptr = get_block(block, block_buf); #if 0 DirectoryBlockStats stats; is_directory_type result = is_directory(block_ptr, block, stats, false); if (result != isdir_no) { int offset = 0; while (offset < block_size_) { ext3_dir_entry_2* dir_entry = reinterpret_cast(block_ptr + offset); if (dir_entry->inode >= min && dir_entry->inode < max && ino[dir_entry->inode - min]) { std::cout << "Block " << block << " has an entry with inode " << dir_entry->inode << " ("; print_buf_to(std::cout, dir_entry->name, dir_entry->name_len); std::cout << ")\n"; } offset += dir_entry->rec_len; } } #else if (strncmp((char const*)block_ptr, "Return-Path:", 12) == 0 && block_ptr[4095] != 0) { for (char const* p = (char const*)block_ptr; p < (char const*)block_ptr + 4095; ++p) { if (*p == 'i' && p[1] == 'n' && p[2] == 'v' && p[3] == 'o' && p[4] == 'k' && p[5] == 'e' && p[6] == 'd' && p[7] == ' ') { if (strncmp(p, "invoked by uid ", 15) == 0) { p += 15; while(std::isdigit(*p)) ++p; } else if (strncmp(p, "invoked from network", 20) == 0) { p += 20; } else if (strncmp(p, "invoked for bounce", 18) == 0) { p += 18; } else if (strncmp(p, "invoked by alias", 16) == 0) { p += 16; } else { std::cout << "XXX p = \"" << p << "\"." << std::endl; ASSERT(false); } if (*p == '[') { while(*p && *p != ']') ++p; ++p; } if (!(p[0] == ')' && p[1] == ';' && p[2] == ' ')) std::cout << "ZZZ p = \"" << p << "\"." << std::endl; ASSERT(p[0] == ')' && p[1] == ';' && p[2] == ' '); p += 3; #if 0 if (std::isdigit(*p)) { char const* q = p; while(std::isdigit(*q)) ++q; ASSERT(*q == ' '); } else { char day[4]; strncpy(day, p, 3); if (!(!strcmp(day, "Mon") || !strcmp(day, "Tue") || !strcmp(day, "Wed") || !strcmp(day, "Thu") || !strcmp(day, "Fri") || !strcmp(day, "Sat") || !strcmp(day, "Sun"))) std::cout << "YYY p = \"" << p << "\"." << std::endl; ASSERT(!strcmp(day, "Mon") || !strcmp(day, "Tue") || !strcmp(day, "Wed") || !strcmp(day, "Thu") || !strcmp(day, "Fri") || !strcmp(day, "Sat") || !strcmp(day, "Sun")); } #endif char const* q = p; while (*q == ' ' || std::isalnum(*q) || *q == ':' || *q == '-' || *q == '+') ++q; struct tm tm; strptime(p, "%d %b %Y %H:%M:%S %z", &tm); time_t t = mktime(&tm) + 7200; std::cout << "GROUP: " << group << "; BLOCK: " << block << /*"; SIZE: " << strlen((char const*)block_ptr) <<*/ "; TIME: " << t << std::endl; break; } } } #endif } } std::cout << '\n'; #endif } #endif #if 0 void custom(void) { static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; for (int group = 0; group < groups_; ++group) { if (group != 4 && group != 15 && group != 16 && group != 146 && group != 152 && group != 160 && group != 187 && group != 227 && group != 228) continue; //std::cout << "\nSearching group " << group << ": " << std::flush; int first_block = first_data_block(super_block) + group * blocks_per_group(super_block); int last_block = std::min(first_block + blocks_per_group(super_block), block_count(super_block)); for (int block = first_block; block < last_block; ++block) { if (is_journal(block)) continue; unsigned char* block_ptr = get_block(block, block_buf); } } } #endif #if 0 struct Data { int count; int failures; }; void indirect_block_action(int block_number, void* data) { Data& number_of_indirect_blocks(*reinterpret_cast(data)); static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; get_block(block_number, block_buf); if (!is_indirect_block(block_buf)) { std::cout << "BLOCK " << block_number << " is an indirect block, but is_indirect_block() returns false!\n"; ++number_of_indirect_blocks.failures; } ++number_of_indirect_blocks.count; } void direct_block_action(int block_number, void* data) { Data& number_of_direct_blocks(*reinterpret_cast(data)); static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; get_block(block_number, block_buf); if (is_indirect_block(block_buf)) { std::cout << "BLOCK " << block_number << " is a direct block, but is_indirect_block() returns true!\n"; ++number_of_direct_blocks.failures; } ++number_of_direct_blocks.count; } void custom(void) { int allocated_inode_count = 0; Data number_of_indirect_blocks = { 0, 0 }; Data number_of_direct_blocks = { 0, 0 }; // Run over all groups. for (int group = 0, ibase = 0; group < groups_; ++group, ibase += inodes_per_group_) { // Run over all inodes. for (int bit = 0, inode_number = (group == 0) ? first_inode(super_block) : ibase + 1; bit < inodes_per_group_; ++bit, ++inode_number) { // Only run over allocated inodes. if (!is_allocated(inode_number)) continue; InodePointer inode(get_inode(inode_number)); // Skip inodes with size 0 (whatever). if (inode->size() == 0) // Files with size 0 exist, of course. continue; // Skip symlinks. if (is_symlink(inode)) continue; ASSERT(inode->block()[0]); ++allocated_inode_count; bool corrupt_indirect_block = iterate_over_all_blocks_of(inode, inode_number, indirect_block_action, &number_of_indirect_blocks, indirect_bit, false); ASSERT(!corrupt_indirect_block); iterate_over_all_blocks_of(inode, inode_number, direct_block_action, &number_of_direct_blocks, direct_bit, false); } } std::cout << "allocated_inode_count = " << allocated_inode_count << std::endl; std::cout << "number_of_indirect_blocks = " << number_of_indirect_blocks.count << std::endl; std::cout << "number_of_indirect_blocks_failures = " << number_of_indirect_blocks.failures << std::endl; std::cout << "Percentage correct: " << 100.0 * ((number_of_indirect_blocks.count - number_of_indirect_blocks.failures) / number_of_indirect_blocks.count) << "%." << std::endl; std::cout << "number_of_direct_blocks = " << number_of_direct_blocks.count << std::endl; std::cout << "number_of_direct_blocks_failures = " << number_of_direct_blocks.failures << std::endl; std::cout << "Percentage correct: " << 100.0 * ((number_of_direct_blocks.count - number_of_direct_blocks.failures) / number_of_direct_blocks.count) << "%." << std::endl; } #endif //----------------------------------------------------------------------------- // // The code of the second custom job starts here. // // This code was written and used to successfully recover a 322 GB vmware file, // containing an ext3 filesystem with all emails and websites of all clients // of a small webhosting company. Work hours: 80. Recovery: 100%. // This table contained blocks changed by running fsck. int fsckd_blocks[] = { 0 // Deleted to save space in this demonstration code. }; union block_t { struct data_st { int file_block_offset; int sequence_number; } data; unsigned char raw[4096]; }; static block_t buf; void custom_action(int block_nr, int file_block_nr, void*) { static int last_file_block_nr = -1; if (file_block_nr != -1) { if (file_block_nr != ++last_file_block_nr) { std::cout << "SKIPPED " << (file_block_nr - last_file_block_nr) << " BLOCKS, file blocks " << last_file_block_nr << " up till and including " << (file_block_nr - 1) << "!" << std::endl; last_file_block_nr = file_block_nr; } get_block(block_nr, buf.raw); std::cout << "buf.data.file_block_offset = " << buf.data.file_block_offset << "; file_block_nr = " << file_block_nr << std::endl; assert(buf.data.file_block_offset == file_block_nr); } assert(block_nr); if (block_nr == 167575554 || (block_nr >= 167606272 && block_nr <= 167606300)) { std::cout << "USING BLOCK " << block_nr << "OVERWRITTEN BY FOREMOST!" << std::endl; //assert(false); } for (unsigned int i = 0; i < sizeof(fsckd_blocks) / sizeof(fsckd_blocks[0]); ++i) { if (fsckd_blocks[i] == block_nr) { std::cout << "USING FSCK-ED BLOCK "<< block_nr << "!" << std::endl; //assert(false); } } std::cout << "File block nr: " << file_block_nr << "; block: " << block_nr << std::endl; } struct block_color { int blocknr; block_color(int bn) : blocknr(bn) { } friend std::ostream& operator<<(std::ostream& os, block_color const& bc) { int group = block_to_group(super_block, bc.blocknr); int first_block = group_to_block(super_block, group); int last_block = first_block + 32767; if ((group & 1) == 1) os << "\e[31m"; else os << "\e[34m"; os << bc.blocknr << "\e[0m"; if (bc.blocknr == first_block) os << '^'; else if (bc.blocknr == last_block) os << '$'; return os; } }; class Range { private: bool first; int last_blocknr; int current_begin; std::vector > v; public: Range(void) : first(true) { } Range& operator+=(int blocknr) { if (first) { first = false; current_begin = blocknr; } else { assert(blocknr > last_blocknr); if (blocknr != last_blocknr + 1) { v.push_back(std::pair(current_begin, last_blocknr)); current_begin = blocknr; } } last_blocknr = blocknr; return *this; } friend std::ostream& operator<<(std::ostream& os, Range const& range) { for (std::vector >::const_iterator iter = range.v.begin(); iter != range.v.end(); ++iter) if (iter->first != iter->second) os << '[' << block_color(iter->first) << " - " << block_color(iter->second) << " (" << (iter->second - iter->first + 1) << ")]"; else os << '[' << block_color(iter->first) << ']'; if (!range.first) { if (range.current_begin != range.last_blocknr) os << '[' << block_color(range.current_begin) << " - " << block_color(range.last_blocknr) << " (" << (range.last_blocknr - range.current_begin + 1) << ")]"; else os << '[' << block_color(range.current_begin) << ']'; } return os; } }; bool has_at_least_n_increasing_block_numbers(int n, unsigned char* block_buf) { __le32* p = reinterpret_cast<__le32*>(block_buf); __le32 last_block = 0; int total = 0; for (int i = 0; i < 1024; ++i) { if (p[i]) { if (p[i] < last_block) return false; if (p[i] == last_block + 1) ++total; last_block = p[i]; } } return total >= n; } // This function guesses what is the first valid Indirect Block in group 'group'. // Later I found a smarter way to do this by looking at the block bitmap updates // in the journal-- but this worked too. int first_indirect_block(int group, size_t& size) { std::cout << "Entering first_indirect_block(" << group << ")\n"; static unsigned char block_buf[4096]; int first_block = group_to_block(super_block, group); std::cout << "first_block = " << first_block << '\n'; int group_end = first_block + blocks_per_group(super_block); std::cout << "group_end = " << group_end << '\n'; int freq[1025]; std::memset(freq, 0, sizeof(freq)); for (int b = first_block; b < group_end; ++b) { get_block(b, block_buf); if (is_indirect_block(block_buf) && has_at_least_n_increasing_block_numbers(32, block_buf)) { //std::cout << "Found indirect block at " << b << '\n'; freq[(b - first_block - 514) % 1025] += 1; // 514 = bitmaps + inode table. 1025 = indirect block + its 1024 data blocks. } } int best = 0; int fbest = 0; int total = 0; std::vector > candidates; for (int i = 0; i < 1025; ++i) { if (freq[i]) { if (freq[i] > 1) { std::cout << i << " (" << freq[i] << "), "; candidates.push_back(std::pair(i, freq[i])); } total += freq[i]; if (freq[i] > fbest) { fbest = freq[i]; best = i; } } } std::cout << '\n'; std::cout << '\t' << "total: " << total << std::endl; assert(!candidates.empty()); size = candidates.size(); if (size > 2) { std::cout << "FAILURE FOR GROUP " << group << ": indirect blocks are scattered! Returning -1.\n"; return -1; } if (size == 2) { int jump = 1; if (group == 5146) jump = 2; // Special case, because this group contains the double indirect block. int diff = candidates[1].first - candidates[0].first; int sum = fbest; if (diff == jump) { std::cout << "Choosing smallest of two\n"; best = candidates[0].first; sum = candidates[0].second + candidates[1].second; } if (sum < 30) { std::cout << "WARNING: LOW INDIRECT BLOCK COUNT! There is a not insignificant chance that the heuristics fail in this case!\n"; } } else if (best > 0 && freq[best - 1] == 1) { size_t prev_size; int prev_first_indirect_block = first_indirect_block(group - 1, prev_size); // Turn it into the real block number. prev_first_indirect_block += group_to_block(super_block, group - 1) + 514; // Do the same for 'best - 1'. int next_first_indirect_block = group_to_block(super_block, group) + 514 + best - 1; // Use this heuristic magical formula to test if it's likely that in fact // we have a pair with sizes (1, 30). if ((prev_first_indirect_block + 520) % 1025 == next_first_indirect_block % 1025 && prev_size == 1) { std::cout << "Decrementing best!\n"; --best; } } std::cout << "Leaving first_indirect_block() (returning " << best << ")\n"; return best; } int first_indirect_block(int group) { size_t dummy; return first_indirect_block(group, dummy); } int fib_table1[] = { 190, 742, 269, 821, 348, 900, 427, 979, 506, 33, 585, 112, 664, 191, 743, 270, // ... lots of numbers deleted to save space in the demonstration code. 456, 1008, 535, 62 }; // WARNING: This table was HAND EDITTED (after generation). int fib_table2[] = { 570, 91, 644, 170, 722, 248, 800, 321, 873, 400, 952, 479, 6, 558, 85, 637, // ... lots of numbers deleted to save space in the demonstration code. 198, 750, 277, 829, 356, 908, 435, 987, 514, 41, 593, 120, 672 }; // Manually recovered Tripple Indirect Block. int tib_table[] = { 168649904, 169716665, 170782906, 171849661, 172915902, 173982663, 175049424, 176115659, 177182420, 178248661, 179315416, 180381657, 181448418, 182514659, 117359, 1189230, 2256495, 3324280, 4392059, 5458300, 6525061, 7591302, 8659087, 9725322, 30015342, 31082103, 32151318, 33217553, 34284314, 35350549, 36417310, 37483551, 38550306, 39617067, 40683308, 41750069, 42816304, 43883065, 44949306, 46016067, 47082302, 48149063, 49215304, 50282065, 51348820, 52415061, 53481822, 54548057, 55614818, 56681059, 57747820, 58814061, 59880816, 60947057, 62013818, 63080573, 64146814, 65213575, 66279816, 67346571, 68412812, 69479573, 70545808, 71612569, 72680349, 73746590, 74813351, 75879586, 76946347, 78012588, 79080373, 80146614, 81213375, 82279616 }; __le32 const dib_169716665[/*1024*/] = { /* 1024 block numbers deleted to save space */ }; __le32 const dib_39617067[/*1024*/] = { /* 1024 block numbers deleted to save space */ }; __le32 const dib_49215304[/*1024*/] = { /* 1024 block numbers deleted to save space */ }; __le32 const dib_56681059[/*1024*/] = { /* 1024 block numbers deleted to save space */ }; __le32 const dib_66279816[/*1024*/] = { /* 1024 block numbers deleted to save space */ }; // The function 'first_indirect_block' is rather slow. // Therefore it was once used to generate fib_table1 and fib_table2, // and this function uses the table. int first_indirect_block_table(int group) { if (5147 <= group && group <= 5598) return fib_table1[group - 5147]; else if (2 <= group && group <= 2510) { int res = fib_table2[group - 2]; if (res == -1) { std::cout << "FAILURE for group " << group << "\n\t"; first_indirect_block(group); std::cout << std::endl; } assert(res != -1); return res; } int res = first_indirect_block(group); std::cout << "MISSING: first_indirect_block_table(" << group << ") = " << res << std::endl; assert(res != -1); return res; } // Given the block number of an (single) 'Indirect Block', return the next Indirect block // using the following heuristics: The next indirect block immediately follows the // last data block, which all immediately followed the last Indirect block; hence: // the next Indirect block is the current one plus 1025, UNLESS we reach the end // of a group. Then the next indirect block is retrieved from a table, which was // generated by determining what was the statistically most likely offset of such // equally spaced indirect blocks in the next group. __le32 next_indirect_block(__le32 current_indirect_block, bool need_restoring) { // Special cases that the heuristics fail for: if (current_indirect_block == 183467615) return 183469160; if (current_indirect_block == 183499910) return 36375; if (current_indirect_block == 10517828) return 10519373; if (current_indirect_block == 10523473) return 10537013; if (current_indirect_block == 10537013) return 29726800; if (current_indirect_block == 29754995) return 29778002; if (current_indirect_block == 32048904) return 32052383; int current_group = block_to_group(super_block, current_indirect_block); int next_group = block_to_group(super_block, current_indirect_block + 1025); if (current_group != next_group) { int group_start = group_to_block(super_block, current_group); int group_end = group_start + blocks_per_group(super_block); int left = group_end - current_indirect_block - 1; std::cout << "left = " << left << std::endl; int next_group_start = group_to_block(super_block, next_group); std::cout << "next_group_start = " << next_group_start << std::endl; int fib = need_restoring ? first_indirect_block(next_group) : first_indirect_block_table(next_group); std::cout << "Returning " << next_group_start + fib + 514 << std::endl; return next_group_start + fib + 514; } return current_indirect_block + 1025; } // Return true if this block is wiped (contains only zeroes). bool all_zeroes(__le32* indirect_block_buf) { for(int i = 0; i < 1024; ++i) { if (indirect_block_buf[i]) return false; } return true; } // Retriece a Double Indirect Block. void get_dib(int block_number, __le32* buf) { // These blocks were wiped during deletion. if (block_number == 169716665) memcpy(buf, dib_169716665, sizeof(dib_169716665)); else if (block_number == 39617067) memcpy(buf, dib_39617067, sizeof(dib_39617067)); else if (block_number == 49215304) memcpy(buf, dib_49215304, sizeof(dib_49215304)); else if (block_number == 56681059) memcpy(buf, dib_56681059, sizeof(dib_56681059)); else if (block_number == 66279816) memcpy(buf, dib_66279816, sizeof(dib_66279816)); else // The rest is still intact. get_block(block_number, (unsigned char*)buf); } void generate_sib(int sib_number, __le32* buf, __le32 next_indirect_block) { int sib_group = block_to_group(super_block, sib_number); int next_group_start = group_to_block(super_block, sib_group + 1); if (sib_group == 5599) // Last group? next_group_start = 183500446; // Byte-past-the-end in this group (fake a new group start). int block_number = sib_number; for (int k = 0; k < 1024; ++k) { ++block_number; if (block_number == next_group_start) { int next_block_number = next_indirect_block - (1024 - k); #if 0 // Not a gamble anymore. See skip6check. if (sib_number == 183499910) // The only special case (manualy checked to be ok too) { std::cout << "Gambling that data block " << next_block_number << " follows " << (block_number - 1) << std::endl; int group = block_to_group(super_block, next_block_number); int next_group_start = group_to_block(super_block, group); std::cout << " number of skipped blocks at the start of group " << group << ": " << (next_block_number - next_group_start - 514) << std::endl; } #endif block_number = next_block_number; } buf[k] = block_number; } } // This function retrieves a Single (normal) Indirect Block 'block_number'). void get_sib(int block_number, __le32* buf, __le32 next_indirect_block) { // These blocks were wiped during deletion. if (block_number == 169868396 || block_number == 181632444 || block_number == 183499910 || block_number == 1900225 || block_number == 3801011 || block_number == 5668471 || block_number == 34111044 || block_number == 36011825 || block_number == 37879292 || block_number == 39780073 || block_number == 41680859 || block_number == 43548320 || block_number == 45449107 || block_number == 47316568 || block_number == 49249650 || block_number == 51117110 || block_number == 53017897 || block_number == 54918678 || block_number == 56819465 || block_number == 58720251 || block_number == 60620007 || block_number == 62520788 || block_number == 64421575 || block_number == 66386952 || block_number == 80608995 || block_number == 82509782) generate_sib(block_number, buf, next_indirect_block); else // The rest is still intact. get_block(block_number, (unsigned char*)buf); } #define DO_ACTUAL_RECOVERY 0 #if DO_ACTUAL_RECOVERY int outfd; #endif int count = 0; struct timeval& operator-=(struct timeval& t1, struct timeval const& t2) { t1.tv_sec -= t2.tv_sec; if ((t1.tv_usec -= t2.tv_usec) < 0) { t1.tv_usec += 1000000; --t1.tv_sec; } return t1; } static char const zeroes[4096] = { 0, }; struct timeval start_time; struct timeval current_time; int const total_blocks = 78643200; int remaining_blocks = total_blocks; // This function is called for every data block. void process_data_block(int block_number) { #if DO_ACTUAL_RECOVERY assert(block_number); // If the block is a block that was corrupted by running 'foremost' after deletion, // and before umounting, then gamble it originally only contained zeroes because // many blocks before and after this region turn out to contain zeroes. if (block_number == 167575554 || (block_number >= 167606272 && block_number <= 167606300)) { int len = ::write(outfd, zeroes, 4096); assert(len == 4096); } else { static unsigned char block_buf[4096]; get_block(block_number, block_buf); int len = ::write(outfd, (char*)block_buf, 4096); assert(len == 4096); } #else if (block_number == 167575554 || (block_number >= 167606272 && block_number <= 167606300)) { std::cout << "Using foremost block " << block_number << " at file block " << count << '\n'; } #endif ++count; --remaining_blocks; if (remaining_blocks % 10000 == 0) { gettimeofday(¤t_time, NULL); current_time -= start_time; double seconds = current_time.tv_sec + current_time.tv_usec * 1e-6; double blocks_per_second = (total_blocks - remaining_blocks) / seconds; std::cout << "Speed: " << (blocks_per_second * 4.096e-3) << " MB/s. "; double remaining_minutes = remaining_blocks / blocks_per_second / 60; std::cout << "ETA: " << std::fixed << remaining_minutes << " minutes." << std::endl; } } void custom(void) { #if 0 // This code was used to do many/various quick queries. std::cout << block_to_group(super_block, 182514659) << '\n'; //std::cout << group_to_block(super_block, block_to_group(super_block, 2589192)) << '\n'; //first_indirect_block(5184); return; #endif //init_journal(); #if 1 // This code was used to do the final recovery. #if DO_ACTUAL_RECOVERY outfd = ::open("/home/carlo/RECOVERED.MOSES-DRIVE-322GB.VDMK-flat.vmdk", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0644); #endif gettimeofday(&start_time, NULL); int blocknrs[] = { 163021314, 163021315, 163021316, 163021317, 163021318, 163021319, 163054082, 163054083, 163054084, 163054085, 163054086, 163054087 }; for (int i = 0; i < (int)(sizeof(blocknrs) / sizeof(int)); ++i) { process_data_block(blocknrs[i]); } static __le32 sib_buf[1024]; get_block(167582637, (unsigned char*)sib_buf); for (int k = 0; k < 1024; ++k) { process_data_block(sib_buf[k]); } static __le32 dib_buf[1024]; get_block(167583662, (unsigned char*)dib_buf); for (int i = 0; i < 1024; ++i) { assert(dib_buf[i]); get_block(dib_buf[i], (unsigned char*)sib_buf); for (int k = 0; k < 1024; ++k) { process_data_block(sib_buf[k]); } } for (unsigned int j = 0; j < sizeof(tib_table) / sizeof(*tib_table); ++j) { bool saw_zeroes = false; int block_number = tib_table[j]; get_dib(block_number, dib_buf); assert(is_indirect_block((unsigned char*)dib_buf)); for (int i = 0; i < 1024; ++i) { if (!dib_buf[i]) continue; __le32 next_indirect_block; if (i < 1023) next_indirect_block = dib_buf[i + 1]; else next_indirect_block = tib_table[j + 1]; get_sib(dib_buf[i], sib_buf, next_indirect_block); if (all_zeroes(sib_buf)) { #if 0 std::cout << block_number << " --> " << dib_buf[i] << " == ZEROES!\n"; saw_zeroes = true; #else assert(false); #endif } else { assert(is_indirect_block((unsigned char*)sib_buf, true)); if (sib_buf[0] != dib_buf[i] + 1) { assert(dib_buf[i] + 1 == (__le32)group_to_block(super_block, block_to_group(super_block, sib_buf[0]))); } process_data_block(sib_buf[0]); for (int k = 1; k < 1024; ++k) { if (dib_buf[i] == 83344321 && sib_buf[k] == 0) continue; if (sib_buf[k] != sib_buf[k - 1] + 1) { if (sib_buf[k - 1] != (__le32)group_to_block(super_block, block_to_group(super_block, sib_buf[k])) - 1) { std::cout << block_number << " --> " << dib_buf[i] << " --> " << sib_buf[k] << " fails hypothesis. It is the previous entry plus " << (sib_buf[k] - sib_buf[k - 1]) << " instead of plus 1.\n"; } } process_data_block(sib_buf[k]); } if (dib_buf[i] == 83344321) continue; if (sib_buf[1023] + 1 != next_indirect_block) { int current_group = block_to_group(super_block, sib_buf[1023]); int next_group = block_to_group(super_block, sib_buf[1023] + 1); assert(current_group == next_group - 1); } } } if (!saw_zeroes) std::cout << block_number << " OK" << std::endl; } std::cout << "Total number of blocks: " << count << std::endl; #if DO_ACTUAL_RECOVERY ::close(outfd); #endif #endif #if 0 // This code was used to see if the file that had to be recovered used sparse data // (zero block numbers, meaning a block with only zeroes) and whether or not // blocks where used that were corrupted AFTER the deletion of this file (the // so called 'foremost' blocks). Inode inode; int inode_nr = 34818; // 81362958 get_undeleted_inode_type res = get_undeleted_inode(inode_nr, inode); //assert(res == ui_journal_inode); iterate_over_all_blocks_of(inode, inode_nr, custom_action, NULL, direct_bit|indirect_bit, false); #endif #if 0 // This was used to create fib_table2 (and fib_table1 with different loop parameters). // However, fib_table2 was hand editted at a few places after that. std::vector v; for (int group = 2; group <= 2510; ++group) { int res = first_indirect_block(group); v.push_back(res); } int count = 0; for (std::vector::iterator iter = v.begin(); iter != v.end(); ++iter) { if (count % 16 == 0) std::cout << ",\n "; else std::cout << ", "; std::cout << *iter; ++count; } std::cout << std::endl; return; #endif #if 0 // This code either tests the heuristic code to generate double indirect blocks, // by comparing what it would do with the actual data of existing blocks, // or it generates such a block; used to generate tables dib_169716665, dib_39617067 etc. for (unsigned int j = 0; j < sizeof(tib_table) / sizeof(*tib_table); ++j) { int block_number = tib_table[j]; bool need_restoring = (block_number == 169716665 || block_number == 39617067 || block_number == 49215304 || block_number == 56681059 || block_number == 66279816); // Toggle this to test the heuristic code, or to generate the missing double indirect blocks. if (!need_restoring) continue; __le32 predicted_indirect_block = block_number + 1; std::cout << block_color(block_number) << ": Double indirect block.\n"; __le32 double_block_buf[1024]; __le32 indirect_block_buf[1024]; get_block(block_number, (unsigned char*)double_block_buf); for (int i = 0; i < 1024; ++i) { if (!need_restoring || double_block_buf[i]) { std::cout << '\t' << block_color(double_block_buf[i]) << ": Indirect block.\n"; get_block(double_block_buf[i], (unsigned char*)indirect_block_buf); if (all_zeroes(indirect_block_buf)) { std::cout << "\t\tZEROES\n"; assert(double_block_buf[i] == predicted_indirect_block); } else { assert(is_indirect_block((unsigned char*)indirect_block_buf)); if (double_block_buf[i] != predicted_indirect_block) { unsigned char buf[4096]; get_block(predicted_indirect_block, buf); assert(!is_indirect_block(buf)); predicted_indirect_block += 1025; } assert(double_block_buf[i] == predicted_indirect_block); Range range; for (int j = 0; j < 1024; ++j) range += indirect_block_buf[j]; std::cout << "\t\t" << range << '\n'; } } else { std::cout << "\tPredicted indirect block: " << predicted_indirect_block << '\n'; get_block(predicted_indirect_block, (unsigned char*)indirect_block_buf); if (all_zeroes(indirect_block_buf)) { std::cout << "\t\tZEROES\n"; } else { assert(is_indirect_block((unsigned char*)indirect_block_buf)); } } predicted_indirect_block = next_indirect_block(predicted_indirect_block, need_restoring); } } #endif } ext3grep-0.10.1/src/dir_inode_to_block.cc0000644000175000017500000003734711031437466015204 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file dir_inode_to_block.cc Code related to dir_inode_to_block. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include "ext3.h" #include #include #include #include #include #endif #include "blocknr_vector_type.h" #include "globals.h" #include "superblock.h" #include "get_block.h" #include "is_blockdetection.h" #include "forward_declarations.h" #include "print_inode_to.h" #include "directories.h" #include "journal.h" //----------------------------------------------------------------------------- // // dir_inode_to_block // // dir_inode_to_block_cache is an array of either // one block number stored directly, or pointers to an // array with more than one block (allocated with new). // The first entry of such an array contains the length // of the array. // // This pseudo vector only stores non-zero block values. // If 'blocknr' is empty, then the vector is empty. blocknr_vector_type* dir_inode_to_block_cache; std::vector extended_blocks; #define INCLUDE_JOURNAL 1 // Returns true if file 'cachename' does not end // on '# END\n'. bool does_not_end_on_END(std::string const& cachename) { // Open the file. std::ifstream cache; cache.open(cachename.c_str()); // Seek to the end minus 6 positions. cache.seekg(-6, std::ios::end); char last_line[6]; cache.getline(last_line, sizeof(last_line)); bool does_not = strcmp(last_line, "# END") != 0; cache.close(); return does_not; } void init_dir_inode_to_block_cache(void) { if (dir_inode_to_block_cache) return; DoutEntering(dc::notice, "init_dir_inode_to_block_cache()"); ASSERT(sizeof(size_t) == sizeof(uint32_t*)); // Used in blocknr_vector_type. ASSERT(sizeof(size_t) == sizeof(blocknr_vector_type)); dir_inode_to_block_cache = new blocknr_vector_type [inode_count_ + 1]; std::memset(dir_inode_to_block_cache, 0, sizeof(blocknr_vector_type) * (inode_count_ + 1)); std::string device_name_basename = device_name.substr(device_name.find_last_of('/') + 1); std::string cache_stage1 = device_name_basename + ".ext3grep.stage1"; struct stat sb; bool have_cache = !(stat(cache_stage1.c_str(), &sb) == -1); if (have_cache) { if (does_not_end_on_END(cache_stage1)) have_cache = false; } else if (errno != ENOENT) { int error = errno; std::cout << std::flush; std::cerr << progname << ": failed to open \"" << cache_stage1 << "\": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } if (!have_cache) { std::cout << "Finding all blocks that might be directories.\n"; std::cout << "D: block containing directory start, d: block containing more directory entries.\n"; std::cout << "Each plus represents a directory start that references the same inode as a directory start that we found previously.\n"; static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; for (int group = 0; group < groups_; ++group) { std::cout << "\nSearching group " << group << ": " << std::flush; int first_block = first_data_block(super_block) + group * blocks_per_group(super_block); int last_block = std::min(first_block + blocks_per_group(super_block), block_count(super_block)); for (int block = first_block; block < last_block; ++block) { #if !INCLUDE_JOURNAL if (is_journal(block)) continue; #endif unsigned char* block_ptr = get_block(block, block_buf); DirectoryBlockStats stats; is_directory_type result = is_directory(block_ptr, block, stats, false); if (result == isdir_start) { ext3_dir_entry_2* dir_entry = reinterpret_cast(block_ptr); ASSERT(dir_entry->name_len == 1 && dir_entry->name[0] == '.'); if (dir_inode_to_block_cache[dir_entry->inode].empty()) std::cout << 'D' << std::flush; else std::cout << '+' << std::flush; dir_inode_to_block_cache[dir_entry->inode].push_back(block); } else if (result == isdir_extended) { std::cout << 'd' << std::flush; extended_blocks.push_back(block); } } } std::cout << '\n'; std::cout << "Writing analysis so far to '" << cache_stage1 << "'. Delete that file if you want to do this stage again.\n"; std::ofstream cache; cache.open(cache_stage1.c_str()); cache << "# Stage 1 data for " << device_name << ".\n"; cache << "# Inodes and directory start blocks that use it for dir entry '.'.\n"; cache << "# INODE : BLOCK [BLOCK ...]\n"; for (uint32_t i = 1; i <= inode_count_; ++i) { blocknr_vector_type const bv = dir_inode_to_block_cache[i]; if (bv.empty()) continue; cache << i << " :"; uint32_t const size = bv.size(); for (uint32_t j = 0; j < size; ++j) cache << ' ' << bv[j]; cache << '\n'; } cache << "# Extended directory blocks.\n"; for (std::vector::iterator iter = extended_blocks.begin(); iter != extended_blocks.end(); ++iter) cache << *iter << '\n'; cache << "# END\n"; cache.close(); } else { std::cout << "Loading " << cache_stage1 << "...\n"; std::ifstream cache; cache.open(cache_stage1.c_str()); if (!cache.is_open()) { int error = errno; std::cout << std::flush; std::cerr << progname << ": failed to open " << cache_stage1 << ": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } int inode; int block; char c; for(;;) { cache.get(c); if (c == '#') cache.ignore(std::numeric_limits::max(), '\n'); else { cache.putback(c); break; } } while (cache >> inode) { cache >> c; if (cache.eof()) break; ASSERT(c == ':'); std::vector blocknr; while(cache >> block) { blocknr.push_back(block); c = cache.get(); if (c != ' ') { ASSERT(c == '\n'); break; } } dir_inode_to_block_cache[inode] = blocknr; } cache.clear(); for(;;) { cache.get(c); if (c == '#') cache.ignore(std::numeric_limits::max(), '\n'); else { cache.putback(c); break; } } while (cache >> block) extended_blocks.push_back(block); cache.close(); } int inc = 0, sinc = 0, ainc = 0, asinc = 0, cinc = 0; for (uint32_t i = 1; i <= inode_count_; ++i) { bool allocated = is_allocated(i); blocknr_vector_type const bv = dir_inode_to_block_cache[i]; if (allocated) { InodePointer inode = get_inode(i); if (is_directory(inode)) { ++ainc; uint32_t first_block = inode->block()[0]; // If the inode is an allocated directory, it must reference at least one block. if (!first_block) { std::cout << std::flush; std::cerr << progname << ": inode " << i << " is an allocated inode that does not reference any block. " "This seems to indicate a corrupted file system. Manual investigation is needed." << std::endl; } ASSERT(first_block); // If inode is an allocated directory, then we must have found it's directory block already. if (bv.empty()) { std::cout << std::flush; std::cerr << "---- Mail this to the mailinglist -------------------------------\n"; std::cerr << "WARNING: inode " << i << " is an allocated inode without directory block pointing to it!" << std::endl; std::cerr << " inode_size_ = " << inode_size_ << '\n'; std::cerr << " Inode " << i << ":"; print_inode_to(std::cerr, inode); DirectoryBlockStats stats; unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; get_block(first_block, block_buf); is_directory_type isdir = is_directory(block_buf, first_block, stats, false); std::cerr << " is_directory(" << first_block << ") returns " << isdir << '\n'; if (isdir == isdir_no) { std::cerr << " Hex dump:\n"; print_block_to(std::cerr, block_buf); } std::cerr << "-----------------------------------------------------------------\n"; continue; } int count = 0; uint32_t size = bv.size(); for (uint32_t j = 0; j < size; ++j) if (bv[j] == first_block) { ++count; break; // Remaining blocks have different value. } // We must have found the actual directory. ASSERT(count == 1); // Replace the blocks we found with the canonical block. dir_inode_to_block_cache[i].erase(); dir_inode_to_block_cache[i].push_back(first_block); ++cinc; } } if (bv.empty()) continue; ++inc; if (bv.is_vector()) { ++sinc; if (allocated) ++asinc; } } std::cout << "Result of stage one:\n"; std::cout << " " << inc << " inodes are referenced by one or more directory blocks, " << ainc << " of those inodes " << ((ainc == 1) ? "is" : "are") << " still allocated.\n"; std::cout << " " << sinc << " inodes are referenced by more than one directory block, " << asinc << " of those inodes " << ((asinc == 1) ? "is" : "are") << " still allocated.\n"; std::cout << " " << extended_blocks.size() << " blocks contain an extended directory.\n"; // Resolve shared inodes. int esinc = 0, jsinc = 0, hsinc = 0; for (uint32_t i = 1; i <= inode_count_; ++i) { // All blocks refering to this inode. blocknr_vector_type const bv = dir_inode_to_block_cache[i]; // None? if (bv.empty()) continue; uint32_t size = bv.size(); // Only one? Then we're done. if (size == 1) continue; // Make a list of these blocks as DirectoryBlock. std::list dirs(size); std::list::iterator iter = dirs.begin(); for (uint32_t j = 0; j < size; ++j, ++iter) iter->read_block(bv[j], iter); // Remove blocks that are part of the journal, except if all blocks // are part of the journal: then keep the block with the highest // sequence number. #if INCLUDE_JOURNAL uint32_t highest_sequence = 0; int min_block = std::numeric_limits::max(); int journal_block_count = 0; int total_block_count = 0; iter = dirs.begin(); while (iter != dirs.end()) { ++total_block_count; if (is_journal(iter->block())) { ++journal_block_count; block_in_journal_to_descriptors_map_type::iterator iter2 = block_in_journal_to_descriptors_map.find(iter->block()); if (iter2 != block_in_journal_to_descriptors_map.end()) { uint32_t sequence = iter2->second->sequence(); highest_sequence = std::max(highest_sequence, sequence); } else min_block = std::min(min_block, iter->block()); } else break; // No need to continue. ++iter; } bool need_keep_one_journal = (total_block_count == journal_block_count); #endif iter = dirs.begin(); while (iter != dirs.end()) { #if !INCLUDE_JOURNAL ASSERT(!is_journal(iter->block())); #else if (is_journal(iter->block())) { if (need_keep_one_journal) { block_in_journal_to_descriptors_map_type::iterator iter2 = block_in_journal_to_descriptors_map.find(iter->block()); if (highest_sequence == 0 && iter->block() == min_block) { std::cout << std::flush; std::cerr << "WARNING: More than one directory block references inode " << i << " but all of them are in the journal and none of them have a descriptor block (the start of the transaction was probably overwritten)." " The mostly likely correct directory block would be block " << min_block << " but we're disregarding it because ext3grep can't deal with journal blocks without a descriptor block."; std::cerr << std::endl; } if (iter2 != block_in_journal_to_descriptors_map.end() && iter2->second->sequence() == highest_sequence) { ++iter; continue; } } if (size > 1) dir_inode_to_block_cache[i].remove(iter->block()); else dir_inode_to_block_cache[i].erase(); --size; iter = dirs.erase(iter); } else #endif ++iter; } // Only one left? Then we're done with this inode. if (dirs.size() == 1) { ++jsinc; continue; } ASSERT(dirs.size() > 0); ASSERT(size == dirs.size()); // Find blocks in the journal and select the one with the highest sequence number. int best_blocknr = -1; uint32_t max_sequence = 0; iter = dirs.begin(); for (iter = dirs.begin(); iter != dirs.end(); ++iter) { int blocknr = iter->block(); uint32_t sequence_found = find_largest_journal_sequence_number(blocknr); if (sequence_found > max_sequence) { max_sequence = sequence_found; best_blocknr = blocknr; } } if (best_blocknr != -1) { iter = dirs.begin(); while (iter != dirs.end()) { if (iter->block() != best_blocknr) { dir_inode_to_block_cache[i].remove(iter->block()); iter = dirs.erase(iter); } else ++iter; } } // Only one left? Then we're done with this inode. if (dirs.size() == 1) { ++hsinc; continue; } // Remove blocks that are exactly equal. iter = dirs.begin(); while (iter != dirs.end()) { bool found_duplicate = false; for (std::list::iterator iter2 = dirs.begin(); iter2 != iter; ++iter2) if (iter2->exactly_equal(*iter)) { found_duplicate = true; break; } if (found_duplicate) { dir_inode_to_block_cache[i].remove(iter->block()); iter = dirs.erase(iter); } else ++iter; } // Only one left? Then we're done with this inode. if (dirs.size() == 1) { ++esinc; continue; } } // Next inode. std::cout << "Result of stage two:\n"; if (cinc > 0) std::cout << " " << cinc << " of those inodes could be resolved because " << ((cinc == 1) ? "it is" : "they are") << " still allocated.\n"; if (jsinc > 0) std::cout << " " << jsinc << " inodes could be resolved because all refering blocks but one were journal blocks.\n"; if (hsinc > 0) std::cout << " " << hsinc << " inodes could be resolved because at least one of the blocks was found in the journal.\n"; if (esinc > 0) std::cout << " " << esinc << " inodes could be resolved because all refering blocks were exactly identical.\n"; if (sinc - asinc - jsinc - esinc - hsinc > 0) { std::cout << " " << sinc - asinc - jsinc - esinc - hsinc << " remaining inodes to solve...\n"; std::cout << "Blocks sharing the same inode:\n"; std::cout << "# INODE : BLOCK [BLOCK ...]\n"; for (uint32_t i = 1; i <= inode_count_; ++i) { blocknr_vector_type const bv = dir_inode_to_block_cache[i]; if (bv.empty()) continue; uint32_t size = bv.size(); if (size == 1) continue; std::cout << i << " :"; for (uint32_t j = 0; j < size; ++j) std::cout << ' ' << bv[j]; std::cout << '\n'; } } else std::cout << "All directory inodes are accounted for!\n"; std::cout << '\n'; } void init_directories(void); int dir_inode_to_block(uint32_t inode) { ASSERT(inode > 0 && inode <= inode_count_); if (!dir_inode_to_block_cache) init_directories(); blocknr_vector_type const bv = dir_inode_to_block_cache[inode]; if (bv.empty()) return -1; // In case of multiple values... return one. return bv[0]; } ext3grep-0.10.1/src/indirect_blocks.h0000644000175000017500000000600611077150711014353 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file indirect_blocks.h Declaration of code related to indirect blocks. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // Stanislaw T. Findeisen // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // ChangeLog // // 2008-07-07 STF // * (is_indirect_block): Add. #ifndef INDIRECT_BLOCKS_H #define INDIRECT_BLOCKS_H #ifndef USE_PCH #include "ext3.h" #endif #include "inode.h" // Constants used with iterate_over_all_blocks_of unsigned int const direct_bit = 1; // Call action() for real blocks. unsigned int const indirect_bit = 2; // Call action() for (double/tripple) indirect blocks. unsigned int const hole_bit = 4; // Call action() for holes (blocknr will be 0). void print_directory_action(int blocknr, int file_block_nr, void*); bool iterate_over_all_blocks_of(Inode const& inode, int inode_number, void (*action)(int, int, void*), void* data = NULL, unsigned int indirect_mask = direct_bit, bool diagnose = false); void find_block_action(int blocknr, int file_block_nr, void* ptr); struct find_block_data_st { bool found_block; int block_looking_for; }; inline bool iterate_over_all_blocks_of(InodePointer inode, int inode_number, void (*action)(int, int, void*), void* data = NULL, unsigned int indirect_mask = direct_bit, bool diagnose = false) { // inode is dereferenced here in good faith that no reference to it is kept (since there are no structs or classes that do so). return iterate_over_all_blocks_of(*inode, inode_number, action, data, indirect_mask, diagnose); } /** * Checks if a block is an indirect one. * * WARNING THIS IS A HEURISTIC FUNCTION! A block can be classified as indirect * when in fact it is not. That's because analysis is based solely on this single * block contents. * * Parameters: * block_ptr - preloaded block contents (ie, 4096 bytes) * * Returns true iff given block is of the form: * * [b1], [b2], ... [bi], ... [bk] ZEROES * * where * - 1 <= i <= k * - [bi] are valid block numbers (is_data_block_number() returns true). * - [bi] are all different. * - [bi] != 0 for all i. */ bool is_indirect_block(unsigned char* block_ptr, bool verbose = false); #endif // INDIRECT_BLOCKS_H ext3grep-0.10.1/src/accept.h0000644000175000017500000000403311031746763012462 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file accept.h Declaration class Accept. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef ACCEPT_H #define ACCEPT_H #ifndef USE_PCH #include #include #endif struct Accept { static std::bitset<256> S_illegal; // Bit mask reflecting illegal characters. static std::bitset<256> S_unlikely; // Bit mask reflecting unlikely characters. private: std::string M_filename; // The filename. std::bitset<256> M_mask; // Bit mask reflecting unlikely characters in filename. bool M_accept; // True if this filename should be accepted. public: Accept(std::string const& filename, bool accept) : M_filename(filename), M_accept(accept) { M_mask.reset(); for (std::string::const_iterator iter = M_filename.begin(); iter != M_filename.end(); ++iter) { __u8 c = *iter; ASSERT(!S_illegal[c]); if (S_unlikely[c]) M_mask.set(c); } } std::string const& filename(void) const { return M_filename; } bool accepted(void) const { return M_accept; } friend bool operator<(Accept const& a1, Accept const& a2) { return a1.M_filename < a2.M_filename; } }; extern std::set accepted_filenames; #endif // ACCEPT_H ext3grep-0.10.1/src/is_filename_char.h0000644000175000017500000000446411031206725014470 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file is_filename_char.h Implementation of function is_filename_char. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef IS_FILENAME_CHAR_H #define IS_FILENAME_CHAR_H #ifndef USE_PCH #include "sys.h" #endif //----------------------------------------------------------------------------- // // is_filename_char // enum filename_char_type { fnct_ok, fnct_illegal, fnct_unlikely, fnct_non_ascii }; inline filename_char_type is_filename_char(__s8 c) { if (c == 0 || c == '/') return fnct_illegal; // These characters are legal... but unlikely // (* They did not appear in any of the files on MY partition). static unsigned char hit[128 - 32] = { // Mark 22 ("), 2a (*), 3b (;), 3c (<), 3e (>), 3f (?), 5c (\), 60 (`), 7c (|) // 0 1 2 3 4 5 6 7 8 9 a b c d e f 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, // 2 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, // 3 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, // 5 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 // 7 }; // These characters are legal, but very unlikely. // Don't reject them when a specific block was requested. if (c < 32 || c == 127) return fnct_non_ascii; // These characters are legal ASCII, but unlikely. if (hit[c - 32]) return fnct_unlikely; return fnct_ok; } #endif // IS_FILENAME_CHAR_H ext3grep-0.10.1/src/commandline.cc0000644000175000017500000005401111121222601013624 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file commandline.cc Implementation of commandline options. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include #endif #include "commandline.h" #include "globals.h" #include "restore.h" #include "accept.h" // Commandline options. bool commandline_superblock = false; int commandline_group = -1; int commandline_inode_to_block = -1; int commandline_inode = -1; int commandline_block = -1; int commandline_journal_block = -1; int commandline_journal_transaction = -1; bool commandline_print = false; bool commandline_ls = false; bool commandline_journal = false; bool commandline_dump_names = false; int commandline_depth = 0; bool commandline_deleted = false; bool commandline_directory = false; time_t commandline_before = 0; time_t commandline_after = 0; bool commandline_allocated = false; bool commandline_unallocated = false; bool commandline_reallocated = false; bool commandline_action = false; bool commandline_search_zeroed_inodes = false; bool commandline_zeroed_inodes = false; bool commandline_show_path_inodes = false; std::string commandline_search; std::string commandline_search_start; int commandline_search_inode = -1; hist_type commandline_histogram = hist_none; std::string commandline_inode_dirblock_table; int commandline_show_journal_inodes = -1; std::vector commandline_restore_file; std::string commandline_restore_inode; bool commandline_restore_all = false; bool commandline_show_hardlinks = false; bool commandline_debug = false; bool commandline_debug_malloc = false; bool commandline_custom = false; bool commandline_accept_all = false; //----------------------------------------------------------------------------- // // Commandline // static void print_usage(std::ostream& os) { os << "Usage: " << progname << " [options] [--] device-file\n"; // 012345678901234567890123456789012345678901234567890123456789012345678901234567890 os << "Options:\n"; os << " --version, -[vV] Print version and exit successfully.\n"; os << " --help, Print this help and exit successfully.\n"; os << " --superblock Print contents of superblock in addition to the rest.\n"; os << " If no action is specified then this option is implied.\n"; os << " --print Print content of block or inode, if any.\n"; os << " --ls Print directories with only one line per entry.\n"; os << " This option is often needed to turn on filtering.\n"; os << " --accept filen Accept 'filen' as a legal filename. Can be used multi-\n"; os << " ple times. If you change any --accept you must remove\n"; os << " BOTH stage* files!\n"; os << " --accept-all Simply accept everything as filename.\n"; os << " --journal Show content of journal.\n"; os << " --show-path-inodes Show the inode of each directory component in paths.\n"; #ifdef CWDEBUG os << " --debug Turn on printing of debug output.\n"; os << " --debug-malloc Turn on debugging of memory allocations.\n"; #endif // 012345678901234567890123456789012345678901234567890123456789012345678901234567890 os << "Filters:\n"; os << " --group grp Only process group 'grp'.\n"; os << " --directory Only process directory inodes.\n"; os << " --after dtime Only entries deleted on or after 'dtime'.\n"; os << " --before dtime Only entries deleted before 'dtime'.\n"; os << " --deleted Only show/process deleted entries.\n"; os << " --allocated Only show/process allocated inodes/blocks.\n"; os << " --unallocated Only show/process unallocated inodes/blocks.\n"; os << " --reallocated Do not suppress entries with reallocated inodes.\n"; os << " Inodes are considered 'reallocated' if the entry\n"; os << " is deleted but the inode is allocated, but also when\n"; os << " the file type in the dir entry and the inode are\n"; os << " different.\n"; os << " --zeroed-inodes Do not suppress entries with zeroed inodes. Linked\n"; os << " entries are always shown, regardless of this option.\n"; os << " --depth depth Process directories recursively up till a depth\n"; os << " of 'depth'.\n"; // 012345678901234567890123456789012345678901234567890123456789012345678901234567890 os << "Actions:\n"; os << " --inode-to-block ino Print the block that contains inode 'ino'.\n"; os << " --inode ino Show info on inode 'ino'.\n"; os << " If --ls is used and the inode is a directory, then\n"; os << " the filters apply to the entries of the directory.\n"; os << " If you do not use --ls then --print is implied.\n"; os << " --block blk Show info on block 'blk'.\n"; os << " If --ls is used and the block is the first block\n"; os << " of a directory, then the filters apply to entries\n"; os << " of the directory.\n"; os << " If you do not use --ls then --print is implied.\n"; // 012345678901234567890123456789012345678901234567890123456789012345678901234567890 os << " --histogram=[atime|ctime|mtime|dtime|group]\n"; os << " Generate a histogram based on the given specs.\n"; os << " Using atime, ctime or mtime will change the\n"; os << " meaning of --after and --before to those times.\n"; os << " --journal-block jblk Show info on journal block 'jblk'.\n"; os << " --journal-transaction seq\n"; os << " Show info on transaction with sequence number 'seq'.\n"; os << " --dump-names Write the path of files to stdout.\n"; os << " This implies --ls but suppresses it's output.\n"; os << " --search-start str Find blocks that start with the fixed string 'str'.\n"; os << " --search str Find blocks that contain the fixed string 'str'.\n"; os << " --search-inode blk Find inodes that refer to block 'blk'.\n"; os << " --search-zeroed-inodes Return allocated inode table entries that are zeroed.\n"; // 012345678901234567890123456789012345678901234567890123456789012345678901234567890 os << " --inode-dirblock-table dir\n"; os << " Print a table for directory path 'dir' of directory\n"; os << " block numbers found and the inodes used for each file.\n"; os << " --show-journal-inodes ino\n"; os << " Show copies of inode 'ino' still in the journal.\n"; os << " --restore-inode ino[,ino,...]\n"; os << " Restore the file(s) with known inode number 'ino'.\n"; os << " The restored files are created in ./" << outputdir << "\n"; os << " with their inode number as extension (ie, inode.12345).\n"; os << " --restore-file 'path' [--restore-file 'path' ...]\n"; os << " Will restore file 'path'. 'path' is relative to the\n"; os << " root of the partition and does not start with a '/' (it\n"; os << " must be one of the paths returned by --dump-names).\n"; os << " The restored directory, file or symbolic link is\n"; os << " created in the current directory as '"<< outputdir << "path'.\n"; os << " --restore-all As --restore-file but attempts to restore everything.\n"; os << " The use of --after is highly recommended because the\n"; os << " attempt to restore very old files will only result in\n"; os << " them being hard linked to a more recently deleted file\n"; os << " and as such polute the output.\n"; os << " --show-hardlinks Show all inodes that are shared by two or more files.\n"; } static void print_version(void) { std::cout << "ext3grep v" VERSION ", Copyright (C) 2008 Carlo Wood.\n"; std::cout << "ext3grep comes with ABSOLUTELY NO WARRANTY;\n"; std::cout << "This program is free software; your freedom to use, change\n"; std::cout << "and distribute this program is protected by the GPL.\n"; } extern char *optarg; extern int optind, opterr, optopt; enum opts { opt_version, opt_superblock, opt_group, opt_inode, opt_block, opt_print, opt_ls, opt_after, opt_before, opt_deleted, opt_allocated, opt_unallocated, opt_histogram, opt_directory, opt_accept, opt_accept_all, opt_dump_names, opt_reallocated, opt_depth, opt_journal, opt_journal_block, opt_journal_transaction, opt_search, opt_search_start, opt_search_inode, opt_search_zeroed_inodes, opt_inode_to_block, opt_zeroed_inodes, opt_show_path_inodes, opt_inode_dirblock_table, opt_show_journal_inodes, opt_restore_file, opt_restore_inode, opt_restore_all, opt_show_hardlinks, opt_help, opt_debug, opt_debug_malloc, opt_custom }; void decode_commandline_options(int& argc, char**& argv) { int short_option; static int long_option; struct option longopts[] = { {"help", 0, &long_option, opt_help}, {"version", 0, &long_option, opt_version}, {"superblock", 0, &long_option, opt_superblock}, {"group", 1, &long_option, opt_group}, {"inode", 1, &long_option, opt_inode}, {"block", 1, &long_option, opt_block}, {"print", 0, &long_option, opt_print}, {"ls", 0, &long_option, opt_ls}, {"after", 1, &long_option, opt_after}, {"before", 1, &long_option, opt_before}, {"deleted", 0, &long_option, opt_deleted}, {"allocated", 0, &long_option, opt_allocated}, {"unallocated", 0, &long_option, opt_unallocated}, {"reallocated", 0, &long_option, opt_reallocated}, {"histogram", 1, &long_option, opt_histogram}, {"directory", 0, &long_option, opt_directory}, {"accept", 1, &long_option, opt_accept}, {"accept-all", 0, &long_option, opt_accept_all}, {"dump-names", 0, &long_option, opt_dump_names}, {"depth", 1, &long_option, opt_depth}, {"journal", 0, &long_option, opt_journal}, {"journal-block", 1, &long_option, opt_journal_block}, {"journal-transaction", 1, &long_option, opt_journal_transaction}, {"search", 1, &long_option, opt_search}, {"search-start", 1, &long_option, opt_search_start}, {"search-inode", 1, &long_option, opt_search_inode}, {"search-zeroed-inodes", 0, &long_option, opt_search_zeroed_inodes}, {"inode-to-block", 1, &long_option, opt_inode_to_block}, {"zeroed-inodes", 0, &long_option, opt_zeroed_inodes}, {"show-path-inodes", 0, &long_option, opt_show_path_inodes}, {"inode-dirblock-table", 1, &long_option, opt_inode_dirblock_table}, {"show-journal-inodes", 1, &long_option, opt_show_journal_inodes}, {"restore-inode", 1, &long_option, opt_restore_inode}, {"restore-file", 1, &long_option, opt_restore_file}, {"restore-all", 0, &long_option, opt_restore_all}, {"show-hardlinks", 0, &long_option, opt_show_hardlinks}, {"debug", 0, &long_option, opt_debug}, {"debug-malloc", 0, &long_option, opt_debug_malloc}, {"custom", 0, &long_option, opt_custom}, {NULL, 0, NULL, 0} }; int exclusive1 = 0; int exclusive2 = 0; std::string hist_arg; progname = argv[0]; while ((short_option = getopt_long(argc, argv, "vV", longopts, NULL)) != -1) { switch (short_option) { case 0: switch (long_option) { case opt_help: print_usage(std::cout); exit(EXIT_SUCCESS); case opt_version: print_version(); exit(EXIT_SUCCESS); case opt_debug: commandline_debug = true; break; case opt_debug_malloc: commandline_debug_malloc = true; break; case opt_custom: commandline_custom = true; break; case opt_superblock: commandline_superblock = true; break; case opt_print: commandline_print = true; break; case opt_ls: commandline_ls = true; break; case opt_dump_names: commandline_dump_names = true; ++exclusive1; ++exclusive2; break; case opt_journal: commandline_journal = true; break; case opt_show_path_inodes: commandline_show_path_inodes = true; break; case opt_depth: commandline_depth = atoi(optarg); if (commandline_depth < 0) { std::cout << std::flush; std::cerr << progname << ": --depth: cannot use negative values." << std::endl; exit(EXIT_FAILURE); } break; case opt_deleted: commandline_deleted = true; break; case opt_directory: commandline_directory = true; break; case opt_allocated: commandline_allocated = true; break; case opt_unallocated: commandline_unallocated = true; break; case opt_reallocated: commandline_reallocated = true; break; case opt_zeroed_inodes: commandline_zeroed_inodes = true; break; case opt_after: commandline_after = atoi(optarg); break; case opt_before: commandline_before = atoi(optarg); break; case opt_search_zeroed_inodes: commandline_search_zeroed_inodes = true; ++exclusive2; break; case opt_search: commandline_search = optarg; ++exclusive2; break; case opt_search_start: commandline_search_start = optarg; ++exclusive2; break; case opt_inode_dirblock_table: commandline_inode_dirblock_table = optarg; break; case opt_restore_inode: commandline_restore_inode = optarg; break; case opt_restore_file: commandline_restore_file.push_back(optarg); break; case opt_restore_all: commandline_restore_all = true; break; case opt_show_hardlinks: commandline_show_hardlinks = true; break; case opt_search_inode: commandline_search_inode = atoi(optarg); if (commandline_search_inode <= 0) { std::cout << std::flush; std::cerr << progname << ": --search-inode: block " << commandline_search_inode << " is out of range." << std::endl; exit(EXIT_FAILURE); } ++exclusive2; break; case opt_group: commandline_group = atoi(optarg); if (commandline_group < 0) { std::cout << std::flush; std::cerr << progname << ": --group: group " << commandline_group << " is out of range." << std::endl; exit(EXIT_FAILURE); } ++exclusive1; break; case opt_inode_to_block: commandline_inode_to_block = atoi(optarg); if (commandline_inode_to_block < 1) { std::cout << std::flush; std::cerr << progname << ": --inode-to-block: inode " << commandline_inode_to_block << " is out of range." << std::endl; exit(EXIT_FAILURE); } break; case opt_inode: commandline_inode = atoi(optarg); if (commandline_inode < 1) { std::cout << std::flush; std::cerr << progname << ": --inode: inode " << commandline_inode << " is out of range." << std::endl; exit(EXIT_FAILURE); } ++exclusive1; ++exclusive2; break; case opt_block: commandline_block = atoi(optarg); if (commandline_block < 0) { std::cout << std::flush; std::cerr << progname << ": --block: block " << commandline_block << " is out of range." << std::endl; exit(EXIT_FAILURE); } ++exclusive1; ++exclusive2; break; case opt_show_journal_inodes: commandline_show_journal_inodes = atoi(optarg); if (commandline_show_journal_inodes < 1) { std::cout << std::flush; std::cerr << progname << ": --show-journal-inodes: inode " << commandline_show_journal_inodes << " is out of range." << std::endl; exit(EXIT_FAILURE); } ++exclusive1; ++exclusive2; break; case opt_journal_block: commandline_journal_block = atoi(optarg); if (commandline_journal_block < 0) { std::cout << std::flush; std::cerr << progname << ": --journal-block: block " << commandline_journal_block << " is out of range." << std::endl; exit(EXIT_FAILURE); } ++exclusive1; ++exclusive2; break; case opt_journal_transaction: commandline_journal_transaction = atoi(optarg); break; case opt_histogram: { hist_arg = optarg; if (hist_arg == "atime") commandline_histogram = hist_atime; else if (hist_arg == "ctime") commandline_histogram = hist_ctime; else if (hist_arg == "mtime") commandline_histogram = hist_mtime; else if (hist_arg == "dtime") commandline_histogram = hist_dtime; else if (hist_arg == "group") commandline_histogram = hist_group; else { std::cout << std::flush; std::cerr << progname << ": --histogram: " << hist_arg << ": unknown histogram type." << std::endl; exit(EXIT_FAILURE); } break; } case opt_accept: { accepted_filenames.insert(Accept(optarg, true)); break; } case opt_accept_all: { commandline_accept_all = true; } } break; case 'v': case 'V': print_version(); exit(EXIT_SUCCESS); } } if (exclusive1 > 1) { std::cout << std::flush; std::cerr << progname << ": Only one of --group, --inode, --block, --journal-block, --dump-names or --show-journal-inodes may be specified." << std::endl; exit(EXIT_FAILURE); } if (exclusive2 > 1) { std::cout << std::flush; std::cerr << progname << ": Only one of --inode, --block, --search*, --journal-block, --dump-names or --show-journal-inodes may be specified." << std::endl; exit(EXIT_FAILURE); } if (commandline_allocated && commandline_unallocated) { std::cout << std::flush; std::cerr << progname << ": Only one of --allocated or --unallocated may be specified." << std::endl; exit(EXIT_FAILURE); } if (commandline_dump_names) commandline_ls = true; bool outputwritten = false; if ((commandline_block != -1 || commandline_inode != -1) && !commandline_ls && !commandline_print) { std::cout << "No --ls used; implying --print.\n"; commandline_print = true; outputwritten = true; } commandline_action = (commandline_inode != -1 || commandline_block != -1 || commandline_journal_block != -1 || commandline_journal_transaction != -1 || commandline_dump_names || commandline_show_journal_inodes != -1 || commandline_histogram || !commandline_search.empty() || !commandline_search_start.empty() || commandline_search_inode != -1|| commandline_search_zeroed_inodes || commandline_inode_to_block != -1 || !commandline_restore_inode.empty() || !commandline_restore_file.empty() || commandline_restore_all || commandline_show_hardlinks); if (!commandline_action && !commandline_superblock) { std::cout << "No action specified; implying --superblock.\n"; commandline_superblock = true; outputwritten = true; } if ((commandline_histogram == hist_atime || commandline_histogram == hist_ctime || commandline_histogram == hist_mtime || commandline_histogram == hist_dtime) && !(commandline_before && commandline_after)) { if (!commandline_before) { commandline_before = std::numeric_limits::max(); std::cout << progname << ": --histogram=" << hist_arg << ": no --before given, assuming --before=" << commandline_before << '\n'; } if (!commandline_after) { commandline_after = 1; std::cout << progname << ": --histogram=" << hist_arg << ": no --after given, assuming --after=" << commandline_after << '\n'; } } if (commandline_before || commandline_after) { std::cout << "Only show/process deleted entries if they are deleted "; outputwritten = true; std::string after(std::ctime(&commandline_after)); std::string before(std::ctime(&commandline_before)); if (commandline_after) std::cout << "on or after " << after.substr(0, after.length() - 1); if (commandline_before && commandline_after) std::cout << " and "; if (commandline_before) std::cout << "before " << before.substr(0, before.length() - 1); std::cout << '.' << std::endl; if (commandline_before && commandline_after) ASSERT(commandline_after < commandline_before); } if (!accepted_filenames.empty()) { std::cout << "Accepted filenames:"; for (std::set::iterator iter = accepted_filenames.begin(); iter != accepted_filenames.end(); ++iter) { ASSERT(iter->accepted()); std::cout << " '" << iter->filename() << "'"; } outputwritten = true; } if (outputwritten) std::cout << '\n'; argv += optind; argc -= optind; if (argc == 0) { print_usage(std::cerr); exit(EXIT_FAILURE); } } ext3grep-0.10.1/src/ext3grep.cc0000644000175000017500000007252211121222606013113 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file ext3grep.cc Main implementation. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ext3.h" #include "debug.h" #endif #include "commandline.h" #include "globals.h" #include "ostream_operators.h" #include "inode.h" #include "conversion.h" #include "init_journal_consts.h" #include "load_meta_data.h" #include "forward_declarations.h" #include "is_blockdetection.h" #include "indirect_blocks.h" #include "restore.h" #include "get_block.h" #include "init_consts.h" #include "print_inode_to.h" //----------------------------------------------------------------------------- // // main // #ifdef USE_SVN extern char const* svn_revision; #endif extern void custom(void); void run_program(void) { Debug(if (!commandline_debug) dc::notice.off()); Debug(if (commandline_debug) while(!dc::notice.is_on()) dc::notice.on()); Debug(if (!commandline_debug_malloc) dc::malloc.off()); Debug(if (commandline_debug_malloc) while(!dc::malloc.is_on()) dc::malloc.on()); Debug(libcw_do.on()); DoutEntering(dc::notice, "run_program()"); if (commandline_superblock && !commandline_journal) { // Print contents of superblock. std::cout << super_block << '\n'; } // The features that we support. feature_incompat_filetype = super_block.s_feature_incompat & EXT3_FEATURE_INCOMPAT_FILETYPE; // Do we have a journal? if (super_block.s_journal_inum != 0) { InodePointer journal_inode = get_inode(super_block.s_journal_inum); int first_block = journal_inode->block()[0]; ASSERT(first_block); // Read the first superblock. device.seekg(block_to_offset(first_block)); ASSERT(device.good()); // journal_super_block is initialized here. device.read(reinterpret_cast(&journal_super_block), sizeof(journal_superblock_s)); ASSERT(device.good()); if (commandline_superblock && commandline_journal) { // Print contents of superblock. std::cout << "Journal Super Block:\n\n"; std::cout << "Signature: 0x" << be2le(journal_super_block.s_header.h_magic) << std::dec << '\n'; std::cout << journal_super_block << '\n'; } // Sanity checks. ASSERT(be2le(journal_super_block.s_header.h_magic) == JFS_MAGIC_NUMBER); init_journal_consts(); } // Check commandline options against superblock contents. if (commandline_journal && !super_block.s_journal_inum) { std::cout << std::flush; std::cerr << progname << ": --journal: The journal is on an external device. Please add support for it." << std::endl; exit(EXIT_FAILURE); } if (commandline_custom) { custom(); exit(EXIT_SUCCESS); } if (commandline_inode != -1) { if ((uint32_t)commandline_inode > inode_count_) { std::cout << std::flush; std::cerr << progname << ": --inode: inode " << commandline_inode << " is out of range. There are only " << inode_count_ << " inodes." << std::endl; exit(EXIT_FAILURE); } commandline_group = inode_to_group(super_block, commandline_inode); // std::cout << "Inode " << commandline_inode << " is in group " << commandline_group << '\n'; } if (commandline_block != -1) { if (commandline_block >= block_count(super_block)) { std::cout << std::flush; std::cerr << progname << ": --block: block " << commandline_block << " is out of range. There are only " << block_count(super_block) << " blocks." << std::endl; exit(EXIT_FAILURE); } commandline_group = block_to_group(super_block, commandline_block); } if (commandline_journal_block != -1) { if (commandline_journal_block >= block_count(journal_super_block)) { std::cout << std::flush; std::cerr << progname << ": --journal-block: block " << commandline_journal_block << " is out of range. There are only " << block_count(journal_super_block) << " blocks in the journal." << std::endl; exit(EXIT_FAILURE); } } if (commandline_show_journal_inodes != -1) { if ((uint32_t)commandline_show_journal_inodes > inode_count_) { std::cout << std::flush; std::cerr << progname << ": --show-journal-inodes: inode " << commandline_show_journal_inodes << " is out of range. There are only " << inode_count_ << " inodes." << std::endl; exit(EXIT_FAILURE); } commandline_group = inode_to_group(super_block, commandline_show_journal_inodes); // std::cout << "Inode " << commandline_show_journal_inodes << " is in group " << commandline_group << '\n'; } // Print group summary, if needed. if (!commandline_journal && commandline_inode_to_block == -1) { std::cout << "Number of groups: " << groups_ << '\n'; if (commandline_group == -1) { if (!commandline_action) for (int group = 0; group < groups_; ++group) { std::cout << " Group\t" << group << ": "; std::cout << group_descriptor_table[group] << '\n'; } } else if (commandline_group < 0 || commandline_group >= groups_) { std::cout << std::flush; std::cerr << progname << ": --group: group " << commandline_group << " is out of range." << std::endl; exit(EXIT_FAILURE); } else if (!commandline_action) { std::cout << " Group\t" << commandline_group << ": "; std::cout << group_descriptor_table[commandline_group] << '\n'; } } if (commandline_action && !commandline_journal) { if (commandline_inode_to_block != -1) commandline_group = inode_to_group(super_block, commandline_inode_to_block); if (!commandline_group) std::cout << "Loading group metadata.." << std::flush; for (int group = 0; group < groups_; ++group) { if (commandline_group != -1 && group != commandline_group) continue; if (!commandline_group) std::cout << '.' << std::flush; load_meta_data(group); } if (!commandline_group) std::cout << " done\n"; } // Needed here? init_journal(); // Handle --inode if (commandline_inode != -1) { InodePointer inode(get_inode(commandline_inode)); if (commandline_print) { std::cout << "\nHex dump of inode " << commandline_inode << ":\n"; dump_hex_to(std::cout, (unsigned char const*)&(*inode), inode_size_); std::cout << '\n'; } unsigned int bit = commandline_inode - 1 - commandline_group * inodes_per_group_; ASSERT(bit < 8U * block_size_); bitmap_ptr bmp = get_bitmap_mask(bit); bool allocated = (inode_bitmap[commandline_group][bmp.index] & bmp.mask); if (allocated) std::cout << "Inode is Allocated\n"; else std::cout << "Inode is Unallocated\n"; if (commandline_print) { std::cout << "Group: " << commandline_group << '\n'; print_inode_to(std::cout, *inode); } if (is_directory(inode)) print_directory_inode(commandline_inode); } // Handle --block if (commandline_block != -1 || (commandline_journal_block != -1 && commandline_journal)) { if (commandline_journal && commandline_block != -1) { print_block_descriptors(commandline_block); } else { if (commandline_journal_block != -1 && commandline_journal) { // Translate block number. commandline_block = journal_block_to_real_block(commandline_journal_block); commandline_group = block_to_group(super_block, commandline_block); } unsigned char* block = new unsigned char[block_size_]; if (EXTERNAL_BLOCK && commandline_block == 0) { assert(block_size_ == sizeof(someones_block)); std::memcpy(block, someones_block, block_size_); DirectoryBlockStats stats; int blocknr = commandline_block; commandline_block = -1; inode_count_ = someones_inode_count; is_directory_type isdir = is_directory(block, blocknr, stats, false); std::cout << "is_directory returned " << isdir << " for someones_block." << std::endl; exit(EXIT_SUCCESS); } else { device.seekg(block_to_offset(commandline_block)); ASSERT(device.good()); device.read(reinterpret_cast(block), block_size_); ASSERT(device.good()); } if (commandline_print) { std::cout << "Hex dump of block " << commandline_block << ":\n"; print_block_to(std::cout, block); std::cout << '\n'; } std::cout << "Group: " << commandline_group << '\n'; unsigned int bit = commandline_block - first_data_block(super_block) - commandline_group * blocks_per_group(super_block); ASSERT(bit < 8U * block_size_); bitmap_ptr bmp = get_bitmap_mask(bit); DirectoryBlockStats stats; is_directory_type isdir = is_directory(block, commandline_block, stats, false); if (block_bitmap[commandline_group] == NULL) load_meta_data(commandline_group); bool allocated = (block_bitmap[commandline_group][bmp.index] & bmp.mask); bool journal = is_journal(commandline_block); if (isdir == isdir_no) { if (allocated) { std::cout << "Block " << commandline_block; if (journal) { std::cout << " belongs to the journal."; int real_block; journal_header_t* header = reinterpret_cast(block); if (be2le(header->h_magic) == JFS_MAGIC_NUMBER) { std::cout << "\n\n"; switch (be2le(header->h_blocktype)) { case JFS_DESCRIPTOR_BLOCK: { std::cout << *header << '\n'; journal_block_tag_t* journal_block_tag = reinterpret_cast(block + sizeof(journal_header_t)); int curblock = commandline_block; for (;;) { uint32_t flags = be2le(journal_block_tag->t_flags); ++curblock; while(is_indirect_block_in_journal(curblock)) ++curblock; int refered_block = be2le(journal_block_tag->t_blocknr); std::cout << " " << curblock << ((flags & JFS_FLAG_ESCAPE) ? "(escaped)" : "") << " = " << refered_block << ((flags & JFS_FLAG_DELETED) ? "(deleted)" : "") << '\n'; if ((flags & JFS_FLAG_LAST_TAG)) break; if (!(flags & JFS_FLAG_SAME_UUID)) journal_block_tag = reinterpret_cast((unsigned char*)journal_block_tag + 16); ++journal_block_tag; } break; } case JFS_COMMIT_BLOCK: { std::cout << *header << '\n'; break; } case JFS_SUPERBLOCK_V1: case JFS_SUPERBLOCK_V2: { std::cout << *reinterpret_cast(block) << '\n'; break; } case JFS_REVOKE_BLOCK: { std::cout << *reinterpret_cast(block) << '\n'; break; } } } else if ((real_block = is_inode_block(commandline_block))) { std::cout << " It contains inode table block " << real_block << ".\n"; if (commandline_print) { int inodenr = block_to_inode(real_block); for (Inode const* inode = reinterpret_cast(block); reinterpret_cast(inode) < block + block_size_; inode = reinterpret_cast(reinterpret_cast(inode) + inode_size_), ++inodenr) { std::cout << "\n--------------Inode " << inodenr << "-----------------------\n"; print_inode_to(std::cout, *inode); } } } else std::cout << '\n'; } else { std::cout << " is Allocated."; if (is_inode(commandline_block)) { int inode = block_to_inode(commandline_block); std::cout << " It's inside the inode table of group " << commandline_group << " (inodes [" << inode << " - " << (inode + block_size_ / inode_size_) << ">)."; } std::cout << '\n'; } } else { std::cout << "Block " << commandline_block << " is Unallocated.\n"; // If this assertion fails, then it is possible that this DATA block looks like an inode, // most likely because the data itself is an ext3 filesystem. For example an ext3 image. // If that is possible, then just comment this assertion out. //ASSERT(!is_inode(commandline_block)); // All inode blocks are allocated. ASSERT(!journal); // All journal blocks are allocated. } if (is_indirect_block(block)) { std::cout << "Block " << commandline_block << " appears to be an (double/tripple) indirect block.\n"; if (commandline_print) { std::cout << "It contains the following block numbers:\n"; __le32* block_numbers = reinterpret_cast<__le32*>(block); for (int i = 0; i < block_size_ >> 2; ++i) { std::cout << ' ' << std::setw(9) << std::setfill(' ') << block_numbers[i]; if ((i + 1) % 10 == 0) std::cout << '\n'; } std::cout << '\n'; } } } else { std::cout << "\nBlock " << commandline_block << " is a directory. The block is " << (allocated ? journal ? "a Journal block" : "Allocated" : "Unallocated") << "\n\n"; if (commandline_ls) print_restrictions(); if (isdir == isdir_start) { ext3_dir_entry_2* dir_entry = reinterpret_cast(block); InodePointer inode = get_inode(dir_entry->inode); if (!is_directory(inode) || (inode->block()[0] && inode->block()[0] != (__le32)commandline_block)) { print_directory(block, commandline_block); std::cout << "WARNING: inode " << dir_entry->inode << " was reallocated!\n"; } else if (!inode->block()[0]) { print_directory(block, commandline_block); if (allocated) // Is this at all possible? std::cout << "WARNING: inode " << dir_entry->inode << " doesn't contain any blocks. This directory was deleted.\n"; } else { #ifdef CPPGRAPH // Tell cppgraph that we call print_directory_action from here. iterate_over_all_blocks_of__with__print_directory_action(); #endif // Run over all blocks. bool reused_or_corrupted_indirect_block1 = iterate_over_all_blocks_of(inode, dir_entry->inode, print_directory_action); if (reused_or_corrupted_indirect_block1) { std::cout << "Note: Block " << commandline_block << " is a directory start, it's \".\" entry has inode " << dir_entry->inode << " which is indeed a directory, but this inode has reused or corrupted (double/triple) indirect blocks so that not all" " directory blocks could be printed!\n"; } } } else print_directory(block, commandline_block); } delete [] block; } } // Make sure the output directory exists. if (!commandline_restore_file.empty() || commandline_restore_all || !commandline_restore_inode.empty()) { struct stat statbuf; if (stat(outputdir.c_str(), &statbuf) == -1) { if (errno != ENOENT) { int error = errno; std::cout << std::flush; std::cerr << progname << ": stat: " << outputdir << ": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } else if (mkdir(outputdir.c_str(), 0755) == -1 && errno != EEXIST) { int error = errno; std::cout << std::flush; std::cerr << progname << ": failed to create output directory " << outputdir << ": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } std::cout << "Writing output to directory " << outputdir << std::endl; } else if (!S_ISDIR(statbuf.st_mode)) { std::cout << std::flush; std::cerr << progname << ": " << outputdir << " exists but is not a directory!" << std::endl; exit(EXIT_FAILURE); } } // Handle --dump-names if (commandline_restore_all || commandline_dump_names) dump_names(); // Handle --restore-file if (!commandline_restore_file.empty()) for (std::vector::iterator iter = commandline_restore_file.begin(); iter != commandline_restore_file.end(); ++iter) restore_file(*iter); // Handle --restore-inode if (!commandline_restore_inode.empty()) { std::istringstream is(commandline_restore_inode); int inodenr; char comma; while(is >> inodenr) { InodePointer real_inode = get_inode(inodenr); std::ostringstream oss; oss << "inode." << inodenr; restore_inode(inodenr, real_inode, oss.str()); is >> comma; }; } // Handle --show-hardlinks if (commandline_show_hardlinks) show_hardlinks(); // Handle --journal-transaction if (commandline_journal_transaction != -1) handle_commandline_journal_transaction(); // Handle --histogram if (commandline_histogram) { std::cout << '\n'; if (commandline_group != -1) std::cout << "Only showing histogram of group " << commandline_group << '\n'; print_restrictions(); if (commandline_deleted || commandline_histogram == hist_dtime) std::cout << "Only showing deleted entries.\n"; if (commandline_histogram == hist_atime || commandline_histogram == hist_ctime || commandline_histogram == hist_mtime || commandline_histogram == hist_dtime) hist_init(commandline_after, commandline_before); else if (commandline_histogram == hist_group) hist_init(0, groups_); // Run over all (requested) groups. for (int group = 0, ibase = 0; group < groups_; ++group, ibase += inodes_per_group_) { if (commandline_group != -1 && group != commandline_group) continue; // Run over all inodes. for (int bit = 0, inode_number = ibase + 1; bit < inodes_per_group_; ++bit, ++inode_number) { InodePointer inode(get_inode(inode_number)); if (commandline_deleted && !inode->is_deleted()) continue; if ((commandline_histogram == hist_dtime || commandline_histogram == hist_group) && !inode->has_valid_dtime()) continue; if (commandline_directory && !is_directory(inode)) continue; if (commandline_allocated || commandline_unallocated) { bitmap_ptr bmp = get_bitmap_mask(bit); bool allocated = (inode_bitmap[group][bmp.index] & bmp.mask); if (commandline_allocated && !allocated) continue; if (commandline_unallocated && allocated) continue; } time_t xtime = 0; if (commandline_histogram == hist_dtime) xtime = inode->dtime(); else if (commandline_histogram == hist_atime) { xtime = inode->atime(); if (xtime == 0) continue; } else if (commandline_histogram == hist_ctime) { xtime = inode->ctime(); if (xtime == 0) continue; } else if (commandline_histogram == hist_mtime) { xtime = inode->mtime(); if (xtime == 0) continue; } if (xtime && commandline_after <= xtime && xtime < commandline_before) hist_add(xtime); if (commandline_histogram == hist_group) { if (commandline_after && commandline_after > (time_t)inode->dtime()) continue; if (commandline_before && (time_t)inode->dtime() >= commandline_before) continue; hist_add(group); } } } hist_print(); } // Handle --search and --search-start if (!commandline_search_start.empty() || !commandline_search.empty()) { bool start = !commandline_search_start.empty(); size_t len = start ? commandline_search_start.length() : commandline_search.length(); ASSERT(len <= (size_t)block_size_); char* pattern = new char [len]; strncpy(pattern, start ? commandline_search_start.data() : commandline_search.data(), len); static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; if (commandline_allocated && commandline_unallocated) commandline_allocated = commandline_unallocated = false; if (commandline_allocated) std::cout << "Allocated blocks "; else if (commandline_unallocated) std::cout << "Unallocated blocks "; else std::cout << "Blocks "; std::cout << (start ? "starting with" : "containing") << " \"" << std::string(pattern, len) << "\":" << std::flush; ASSERT((inodes_per_group_ * inode_size_) % block_size_ == 0); for (int group = 0; group < groups_; ++group) { int first_block = group_to_block(super_block, group); int last_block = std::min(first_block + blocks_per_group(super_block), block_count(super_block)); // Skip inodes. int inode_table = group_descriptor_table[group].bg_inode_table; first_block = inode_table + inodes_per_group_ * inode_size_ / block_size_; unsigned int bit = first_block - first_data_block(super_block) - group * blocks_per_group(super_block); for (int block = first_block; block < last_block; ++block, ++bit) { bitmap_ptr bmp = get_bitmap_mask(bit); bool allocated = (block_bitmap[group][bmp.index] & bmp.mask); if (commandline_allocated && !allocated) continue; if (commandline_unallocated && allocated) continue; bool found = false; get_block(block, block_buf); if (start) { #if 1 if (std::memcmp(block_buf, pattern, len) == 0) found = true; #else if (std::isdigit(block_buf[0]) && std::isdigit(block_buf[1]) && std::isdigit(block_buf[2]) && block_buf[3] == ' ' && std::isdigit(block_buf[4]) && std::isdigit(block_buf[5]) && block_buf[9] == 0 && block_buf[10] == 0 && block_buf[11] == 0 && block_buf[12] == 0 && block_buf[13] == 0 && block_buf[14] == 0 && block_buf[15] == 0 && block_buf[16] == 0) std::cout << block << " : " << block_buf << '\n'; #endif } else { for (unsigned char* ptr = block_buf; ptr < block_buf + block_size_ - len; ++ptr) { if (*ptr == *pattern && (len == 1 || (ptr[1] == pattern[1] && (len == 2 || (ptr[2] == pattern[2] && std::memcmp(ptr, pattern, len) == 0))))) { found = true; break; } } } if (found) { if (!commandline_allocated && allocated) std::cout << ' ' << block << " (allocated)" << std::flush; else std::cout << ' ' << block << std::flush; } } } delete [] pattern; std::cout << '\n'; } // Handle --search-inode if (commandline_search_inode != -1) { std::cout << "Inodes refering to block " << commandline_search_inode << ':' << std::flush; for (uint32_t inode = 1; inode <= inode_count_; ++inode) { InodePointer ino = get_inode(inode); if (is_symlink(ino)) continue; // Does not refer to any block, and indirect blocks to run over. find_block_data_st data; data.block_looking_for = commandline_search_inode; data.found_block = false; #ifdef CPPGRAPH // Tell cppgraph that we call find_block_action from here. iterate_over_all_blocks_of__with__find_block_action(); #endif bool reused_or_corrupted_indirect_block2 = iterate_over_all_blocks_of(ino, inode, find_block_action, &data); if (reused_or_corrupted_indirect_block2) { std::cout << "\nWARNING: while iterating over all blocks of inode " << inode << " a reused or corrupt indirect block was encountered; search aborted.\n"; std::cout << "Inodes refering to block " << commandline_search_inode << " (cont):" << std::flush; } if (data.found_block) std::cout << ' ' << inode << std::flush; } std::cout << '\n'; } // Handle --search-zeroed-inodes if (commandline_search_zeroed_inodes) { std::cout << "Allocated inodes filled with zeroes:" << std::flush; for (uint32_t inode = 1; inode <= inode_count_; ++inode) { if (commandline_group != -1) { int group = (inode - 1) / inodes_per_group_; if (group != commandline_group) continue; } InodePointer ino = get_inode(inode); static char zeroes[128] = {0, }; if (is_allocated(inode) && std::memcmp(&ino, zeroes, sizeof(zeroes)) == 0) std::cout << ' ' << inode << std::flush; } std::cout << '\n'; } // Handle --inode-to-block if (commandline_inode_to_block != -1) { if ((uint32_t)commandline_inode_to_block > inode_count_) { std::cout << std::flush; std::cerr << progname << ": --inode-to-block: inode " << commandline_inode_to_block << " is out of range. There are only " << inode_count_ << " inodes." << std::endl; exit(EXIT_FAILURE); } int block = inode_to_block(super_block, commandline_inode_to_block); std::cout << "Inode " << commandline_inode_to_block << " resides in block " << block << " at offset 0x" << std::hex << ((commandline_inode_to_block - block_to_inode(block)) * inode_size_) << std::dec << ".\n"; } // Handle --show-journal-inodes if (commandline_show_journal_inodes != -1) show_journal_inodes(commandline_show_journal_inodes); // Print some useful information if no useful information was printed yet. if (!commandline_action && !commandline_journal) { std::cout << "\nNo action was specified. For example, specify one of:\n"; std::cout << " --inode ino Show info on inode 'ino'; inode " << EXT3_ROOT_INO << " is the root.\n"; std::cout << " --block blk [--ls] Show info on block 'blk'.\n"; std::cout << " --histogram=dtime --after=1000000000 --before=1400000000\n"; std::cout << " Show deletion-time histogram (zoom in afterwards).\n"; std::cout << " --help Show all possible command line options.\n"; } // Clean up. if (commandline_action) { delete [] inodes_buf; for (int group = 0; group < groups_; ++group) { if (block_bitmap[group]) { delete [] inode_bitmap[group]; delete [] block_bitmap[group]; #if !USE_MMAP delete [] all_inodes[group]; #endif } #if USE_MMAP if (all_inodes[group]) inode_unmap(group); #endif } delete [] inode_bitmap; delete [] block_bitmap; delete [] all_inodes; #if USE_MMAP ASSERT(nr_mmaps == 0); delete [] all_mmaps; delete [] refs_to_mmap; #endif delete [] group_descriptor_table; } } int main(int argc, char* argv[]) { Debug(debug::init()); #ifdef USE_SVN std::cout << "Running " << svn_revision << '\n'; #else std::cout << "Running ext3grep version " VERSION "\n"; #endif decode_commandline_options(argc, argv); // Sanity checks on the user. if (argc != 1) { if (argc == 0) std::cerr << progname << ": Missing device name. Use --help for a usage message." << std::endl; else std::cerr << progname << ": Too many non-options. Use --help for a usage message." << std::endl; exit(EXIT_FAILURE); } struct stat statbuf; if (stat(*argv, &statbuf) == -1) { int error = errno; std::cout << std::flush; std::cerr << progname << ": stat \"" << *argv << "\": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } if (S_ISDIR(statbuf.st_mode)) { std::cerr << progname << ": \"" << *argv << "\" is a directory. You need to use the raw ext3 filesystem device (or a copy thereof)." << std::endl; exit(EXIT_FAILURE); } if (!S_ISBLK(statbuf.st_mode) && statbuf.st_size < SUPER_BLOCK_OFFSET + 1024) { std::cerr << progname << ": \"" << *argv << "\" is not an ext3 fs; it's WAY too small (" << statbuf.st_size << " bytes)." << std::endl; exit(EXIT_FAILURE); } // Open the device. device.open(*argv); if (!device.good()) { int error = errno; std::cout << std::flush; std::cerr << progname << ": failed to read-only open device \"" << *argv << "\": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } #if USE_MMAP device_fd = open(*argv, O_RDONLY); if (device_fd == -1) { int error = errno; std::cout << std::flush; std::cerr << progname << ": failed to open device \"" << *argv << "\" for reading: " << strerror(error) << std::endl; exit(EXIT_FAILURE); } #endif // Read the first superblock. // The size of a super block is 1024 bytes. assert(sizeof(ext3_super_block) == 1024); device.seekg(SUPER_BLOCK_OFFSET); if (!device.good()) { int error = errno; std::cout << std::flush; std::cerr << progname << ": failed to seek to position " << SUPER_BLOCK_OFFSET << " of \"" << *argv << "\": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } // super_block is initialized here. device.read(reinterpret_cast(&super_block), sizeof(ext3_super_block)); if (!device.good()) { int error = errno; std::cout << std::flush; std::cerr << progname << ": failed to read first superblock from \"" << *argv << "\": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } // Initialize global constants. device_name = *argv; init_consts(); try { run_program(); } catch (std::bad_alloc& error) { std::cerr << "Caught exception " << error.what() << '\n'; #ifdef CWDEBUG // We never get here, because libcwd doesn't throw bad::alloc: it dumps core. Dout(dc::malloc, malloc_report << '.'); #else std::cerr << "Please install libcwd (http://sourceforge.net/project/showfiles.php?group_id=47536)," " reconfigure & recompile ext3grep and rerun the command with --debug." << std::endl; #endif exit(EXIT_FAILURE); } device.close(); #if USE_MMAP close(device_fd); #endif } ext3grep-0.10.1/src/inode.h0000644000175000017500000000725311031754463012324 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file inode.h Declaration of class InodePointer and function get_inode. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef INODE_H #define INODE_H #ifndef USE_PCH #include "ext3.h" // Needed for Inode #include "debug.h" #endif #include "globals.h" #include "load_meta_data.h" #if USE_MMAP void inode_mmap(int group); void inode_unmap(int group); #endif class InodePointer { private: Inode const* M_inode; int M_group; static Inode S_fake_inode; public: // Default constructor. InodePointer(void) : M_inode(NULL), M_group(-1) { } // Copy constructor. InodePointer(InodePointer const& ref) : M_inode(ref.M_inode), M_group(ref.M_group) { #if USE_MMAP if (M_group != -1) refs_to_mmap[M_group]++; #endif } // Create an InodePointer to a fake inode. InodePointer(int) : M_inode(&S_fake_inode), M_group(-1) { } // Destructor. ~InodePointer() { #if USE_MMAP if (M_group != -1) refs_to_mmap[M_group]--; #endif } InodePointer& operator=(InodePointer const& inode_reference) { M_inode = inode_reference.M_inode; #if USE_MMAP if (M_group != -1) refs_to_mmap[M_group]--; #endif M_group = inode_reference.M_group; #if USE_MMAP if (M_group != -1) refs_to_mmap[M_group]++; #endif return *this; } // Accessors. Inode const* operator->(void) const { return M_inode; } Inode const& operator*(void) const { return *M_inode; } private: friend InodePointer get_inode(uint32_t inode); InodePointer(Inode const& inode, int group) : M_inode(&inode), M_group(group) { ASSERT(M_group != -1); #if USE_MMAP refs_to_mmap[M_group]++; #endif } }; inline unsigned int bit_to_all_inodes_group_index(unsigned int bit) { #if USE_MMAP // If bit is incremented by one, we need to skip inode_size_ bytes in the (mmap-ed) inode table. // Since the type of the table is Inode* the index needs to be incremented with the number of Inode structs that we need to skip. // Because both inode_size_ and sizeof(Inode) are a power of 2 and inode_size_ >= sizeof(Inode), this amounts to inode_size_ / sizeof(Inode) // index incrementation per bit. return bit * (inode_size_ / sizeof(Inode)); #else // If no mmap is used, the table only contains the first 128 bytes of each inode. return bit; #endif } inline InodePointer get_inode(uint32_t inode) { int group = (inode - 1) / inodes_per_group_; unsigned int bit = inode - 1 - group * inodes_per_group_; // The bit in the bit mask must fit inside a single block. ASSERT(bit < 8U * block_size_); #if USE_MMAP if (all_inodes[group] == NULL) inode_mmap(group); #else if (block_bitmap[group] == NULL) load_meta_data(group); #endif return InodePointer(all_inodes[group][bit_to_all_inodes_group_index(bit)], group); } #endif // INODE_H ext3grep-0.10.1/src/Parent.cc0000644000175000017500000000367411031756763012625 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file Parent.cc This file contains the implementation of class Parent. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #endif #include "Parent.h" #include "directories.h" std::string Parent::dirname(bool show_inodes) const { if (!M_dir_entry) return std::string(); std::string path(M_dir_entry->name, M_dir_entry->name_len); if (show_inodes) { std::ostringstream tmp; tmp << '(' << M_dir_entry->inode << ')'; path += tmp.str(); for (Parent const* lparent = M_parent; lparent->M_dir_entry; lparent = lparent->M_parent) { tmp.str(""); tmp << std::string(lparent->M_dir_entry->name, lparent->M_dir_entry->name_len) << '(' << lparent->M_dir_entry->inode << ')'; path = tmp.str() + '/' + path; } } else { for (Parent const* lparent = M_parent; lparent->M_dir_entry; lparent = lparent->M_parent) if (lparent->M_dir_entry->name_len > 0) path = std::string(lparent->M_dir_entry->name, lparent->M_dir_entry->name_len) + '/' + path; } return path; } ext3grep-0.10.1/src/last_undeleted_directory_inode_refering_to_block.cc0000644000175000017500000000450211035713001023334 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file last_undeleted_directory_inode_refering_to_block.cc Definition of the function last_undeleted_directory_inode_refering_to_block. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #endif #include "is_blockdetection.h" #include "inode_refers_to.h" #include "journal.h" // Return std::numeric_limits::max() if the inode is still allocated // and refering to the given block, otherwise return the Journal sequence // number that contains the last copy of an undeleted inode that refers // to the given block, or return 0 if none could be found. int last_undeleted_directory_inode_refering_to_block(uint32_t inode_number, int directory_block_number) { if (is_allocated(inode_number)) { InodePointer real_inode = get_inode(inode_number); if (is_directory(*real_inode) && inode_refers_to(*real_inode, inode_number, directory_block_number)) return std::numeric_limits::max(); } // Get sequence/Inode pairs from the Journal. std::vector > inodes; get_inodes_from_journal(inode_number, inodes); // This runs from high to low sequence numbers, so we'll find the highest matching sequence number. for (std::vector >::iterator iter = inodes.begin(); iter != inodes.end(); ++iter) if (is_directory(iter->second) && inode_refers_to(iter->second, inode_number, directory_block_number)) return iter->first; // Nothing found. return 0; } ext3grep-0.10.1/src/pch-source.h0000644000175000017500000000162511024521733013265 00000000000000#define USE_PCH #include "sys.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ext3.h" #include "debug.h" #ifdef CWDEBUG #include #include #endif ext3grep-0.10.1/src/get_block.h0000644000175000017500000000214111031747765013155 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file get_block.h Declaration of function get_block. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef GET_BLOCK_H #define GET_BLOCK_H unsigned char* get_block(int block, unsigned char* block_buf); #endif // GET_BLOCK_H ext3grep-0.10.1/src/directories.h0000644000175000017500000000726711031747302013541 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file directories.h Declaration of class Directory and related classes. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef DIRECTORIES_H #define DIRECTORIES_H #ifndef USE_PCH #include #include #include #include "ext3.h" #include "debug.h" #endif class DirectoryBlock; class Directory; struct Index { int cur; // Indicates the order in memory. int next; // The index of the DirEntry that ext3_dir_entry_2::rec_len refers to or zero if it refers to the end. }; struct DirEntry { std::list::const_iterator M_directory_iterator; // Pointer to DirectoryBlock containing this entry. Directory* M_directory; // Pointer to Directory, if this is a directory. int M_file_type; // The dir entry file type. int M_inode; // The inode referenced by this DirEntry. std::string M_name; // The file name of this DirEntry. union { ext3_dir_entry_2 const* dir_entry; // Temporary pointer into block_buf. Index index; // Ordering index of dir entry. }; bool deleted; // Copies of values calculated by filter_dir_entry. bool allocated; bool reallocated; bool zero_inode; bool linked; bool filtered; bool exactly_equal(DirEntry const& de) const; void print(void) const; }; class DirectoryBlock { private: int M_block; std::vector M_dir_entry; public: void read_block(int block, std::list::iterator iter); void read_dir_entry(ext3_dir_entry_2 const& dir_entry, Inode const& inode, bool deleted, bool allocated, bool reallocated, bool zero_inode, bool linked, bool filtered, std::list::iterator iter); bool exactly_equal(DirectoryBlock const& dir) const; int block(void) const { return M_block; } void print(void) const; std::vector const& dir_entries(void) const { return M_dir_entry; } std::vector& dir_entries(void) { return M_dir_entry; } }; class Directory { private: uint32_t M_inode_number; std::list M_blocks; #ifdef DEBUG bool M_extended_blocks_added; #endif public: Directory(uint32_t inode_number) : M_inode_number(inode_number) #ifdef DEBUG , M_extended_blocks_added(false) #endif { } Directory(uint32_t inode_number, int first_block); std::list& blocks(void) { return M_blocks; } std::list const& blocks(void) const { return M_blocks; } uint32_t inode_number(void) const { return M_inode_number; } int first_block(void) const { ASSERT(!M_blocks.empty()); return M_blocks.begin()->block(); } #ifdef DEBUG bool extended_blocks_added(void) const { return M_extended_blocks_added; } void set_extended_blocks_added(void) { M_extended_blocks_added = true; } #endif }; extern int depth; // Used in print_directory #endif // DIRECTORIES_H ext3grep-0.10.1/src/commandline.h0000644000175000017500000000520011121222544013470 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file commandline.h Declarations of commandline option variables. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef COMMANDLINE_H #define COMMANDLINE_H #ifndef USE_PCH #include // Needed for std::string #include // Needed for std::vector #include // Needed for time_t #endif #include "histogram.h" // Needed for hist_type // Commandline options. extern bool commandline_superblock; extern int commandline_group; extern int commandline_inode_to_block; extern int commandline_inode; extern int commandline_block; extern int commandline_journal_block; extern int commandline_journal_transaction; extern bool commandline_print; extern bool commandline_ls; extern bool commandline_journal; extern bool commandline_dump_names; extern int commandline_depth; extern bool commandline_deleted; extern bool commandline_directory; extern time_t commandline_before; extern time_t commandline_after; extern bool commandline_allocated; extern bool commandline_unallocated; extern bool commandline_reallocated; extern bool commandline_action; extern bool commandline_search_zeroed_inodes; extern bool commandline_zeroed_inodes; extern bool commandline_show_path_inodes; extern std::string commandline_search; extern std::string commandline_search_start; extern int commandline_search_inode; extern hist_type commandline_histogram; extern std::string commandline_inode_dirblock_table; extern int commandline_show_journal_inodes; extern std::vector commandline_restore_file; extern std::string commandline_restore_inode; extern bool commandline_restore_all; extern bool commandline_show_hardlinks; extern bool commandline_debug; extern bool commandline_debug_malloc; extern bool commandline_custom; extern bool commandline_accept_all; #endif // COMMANDLINE_H ext3grep-0.10.1/src/print_symlink.h0000644000175000017500000000267711031755025014130 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file print_symlink.h Declaration of function print_symlink. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef PRINT_SYMLINK_H #define PRINT_SYMLINK_H #ifndef USE_PCH #include #endif #include "inode.h" int print_symlink(std::ostream& os, Inode const& inode); // Same for an InodePointer. inline int print_symlink(std::ostream& os, InodePointer const& inoderef) { // We can dereference inoderef here because it is known that print_symlink does not keep a pointer or reference to the inode. return print_symlink(os, *inoderef); } #endif // PRINT_SYMLINK_H ext3grep-0.10.1/src/forward_declarations.h0000644000175000017500000000643411077716157015432 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file forward_declarations.h Various forward declarations. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef FORWARD_DECLARATIONS_H #define FORWARD_DECLARATIONS_H #ifndef USE_PCH #include // Needed for std::ostream #include // Needed for std::string #endif #include "is_blockdetection.h" // Needed for is_directory_type // Forward declarations. struct Parent; class DirectoryBlockStats; void decode_commandline_options(int& argc, char**& argv); void dump_hex_to(std::ostream& os, unsigned char const* buf, size_t size, size_t addr_offset = 0); void print_block_to(std::ostream& os, unsigned char* block); void iterate_over_directory(unsigned char* block, int blocknr, bool (*action)(ext3_dir_entry_2 const&, Inode const&, bool, bool, bool, bool, bool, bool, Parent*, void*), Parent* parent, void* data); void iterate_over_directory_action(int blocknr, void* data); void iterate_over_existing_directory_action(int blocknr, int, void* data); void iterate_over_journal( bool (*action_tag)(uint32_t block, uint32_t sequence, journal_block_tag_t*, void* data), bool (*action_revoke)(uint32_t block, uint32_t sequence, journal_revoke_header_t*, void* data), bool (*action_commit)(uint32_t block, uint32_t sequence, void* data), void* data); void print_directory(unsigned char* block, int blocknr); void print_restrictions(void); bool is_directory(Inode const& inode); is_directory_type is_directory(unsigned char* block, int blocknr, DirectoryBlockStats& stats, bool start_block = true, bool certainly_linked = true, int offset = 0); bool is_journal(int blocknr); bool is_in_journal(int blocknr); int is_inode_block(int blocknr); bool is_indirect_block_in_journal(int blocknr); bool is_symlink(Inode const& inode); void hist_init(size_t min, size_t max); void hist_add(size_t val); void hist_print(void); int dir_inode_to_block(uint32_t inode); int journal_block_to_real_block(int blocknr); void init_journal(void); int journal_block_contains_inodes(int blocknr); void handle_commandline_journal_transaction(void); void print_block_descriptors(uint32_t block); void print_directory_inode(int inode); void dump_names(void); void init_files(void); void show_journal_inodes(int inode); void restore_file(std::string const& outfile); void show_hardlinks(void); void init_accept(void); int last_undeleted_directory_inode_refering_to_block(uint32_t inode_number, int directory_block_number); #endif // FORWARD_DECLARATIONS_H ext3grep-0.10.1/src/accept.cc0000644000175000017500000000351511031431700012602 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file accept.cc Implementation of things related to --accept. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include "ext3.h" #include "debug.h" #endif #include "is_filename_char.h" #include "accept.h" //----------------------------------------------------------------------------- // // Accepted filenames and unlikely characters. // std::bitset<256> Accept::S_illegal; std::bitset<256> Accept::S_unlikely; // Set with all Accept objects. std::set accepted_filenames; // Global initialization. void init_accept(void) { Accept::S_illegal.reset(); Accept::S_unlikely.reset(); for (int i = 0; i < 256; ++i) { __s8 c = i; filename_char_type res = is_filename_char(c); switch(res) { case fnct_ok: break; case fnct_illegal: Accept::S_illegal.set(i); break; case fnct_unlikely: case fnct_non_ascii: Accept::S_unlikely.set(i); break; } } } ext3grep-0.10.1/src/init_consts.cc0000644000175000017500000001400311061740474013707 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file init_consts.cc Definition of the function init_consts. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include "debug.h" #endif #include "globals.h" #include "superblock.h" #include "forward_declarations.h" #include "init_consts.h" #include "conversion.h" //----------------------------------------------------------------------------- // // Initialization // void init_consts() { // Sanity checks. assert(super_block.s_magic == 0xEF53); // EXT3. assert(super_block.s_creator_os == 0); // Linux. assert(super_block.s_block_group_nr == 0); // First super block. // Frequently used constants. groups_ = groups(super_block); block_size_ = block_size(super_block); block_size_log_ = EXT3_BLOCK_SIZE_BITS(&super_block); inodes_per_group_ = inodes_per_group(super_block); inode_size_ = inode_size(super_block); inode_count_ = inode_count(super_block); block_count_ = block_count(super_block); #if USE_MMAP page_size_ = sysconf(_SC_PAGESIZE); #endif // More sanity checks. assert((uint32_t)groups_ * inodes_per_group(super_block) == inode_count_); // All inodes belong to a group. // extX does not support block fragments. // "File System Forensic Analysis, chapter 14, Overview --> Blocks" assert(block_size_ == fragment_size(super_block)); // The inode bitmap has to fit in a single block. assert(inodes_per_group(super_block) <= 8 * block_size_); // The rest of the code assumes that sizeof(Inode) is a power of 2. assert(sizeof(Inode) == 128); // inode_size is expected to be (at least) the size of Inode. assert((size_t)inode_size_ >= sizeof(Inode)); // Each inode must fit within one block. assert(inode_size_ <= block_size_); // inode_size must be a power of 2. assert(!((inode_size_ - 1) & inode_size_)); // There should fit exactly an integer number of inodes in one block. assert((block_size_ / inode_size_) * inode_size_ == block_size_); // Space needed for the inode table should match the returned value of the number of blocks they need. assert((inodes_per_group_ * inode_size_ - 1) / block_size_ + 1 == inode_blocks_per_group(super_block)); // File system must have a journal. assert((super_block.s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL)); if ((super_block.s_feature_compat & EXT3_FEATURE_COMPAT_DIR_PREALLOC)) std::cout << "WARNING: I don't know what EXT3_FEATURE_COMPAT_DIR_PREALLOC is.\n"; if ((super_block.s_feature_compat & EXT3_FEATURE_COMPAT_IMAGIC_INODES)) std::cout << "WARNING: I don't know what EXT3_FEATURE_COMPAT_IMAGIC_INODES is (sounds scary).\n"; if ((super_block.s_feature_compat & EXT3_FEATURE_COMPAT_EXT_ATTR)) std::cout << "WARNING: I don't know what EXT3_FEATURE_COMPAT_EXT_ATTR is.\n"; if ((super_block.s_feature_incompat & EXT3_FEATURE_INCOMPAT_COMPRESSION)) std::cout << "WARNING: I don't know what EXT3_FEATURE_INCOMPAT_COMPRESSION is (Houston, we have problem).\n"; if ((super_block.s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER)) { std::cout << "WARNING: EXT3_FEATURE_INCOMPAT_RECOVER is set. " "This either means that your partition is still mounted, and/or the file system is in an unclean state.\n"; } if ((super_block.s_feature_incompat & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)) std::cout << "WARNING: I don't know what EXT3_FEATURE_INCOMPAT_JOURNAL_DEV is, but it doesn't sound good!\n"; if ((super_block.s_feature_incompat & EXT3_FEATURE_INCOMPAT_META_BG)) std::cout << "WARNING: I don't know what EXT3_FEATURE_INCOMPAT_META_BG is.\n"; // Initialize accept bitmasks. init_accept(); // Global arrays. reserved_memory = new char [50000]; // This is freed in dump_backtrace_on to make sure we have enough memory. inodes_buf = new char[inodes_per_group_ * inode_size_]; // Global arrays of pointers. all_inodes = new Inode const* [groups_]; #if USE_MMAP // We use this array to know of which groups we mmapped, therefore zero it out. std::memset(all_inodes, 0, sizeof(Inode*) * groups_); all_mmaps = new void* [groups_]; nr_mmaps = 0; refs_to_mmap = new int [groups_]; // We use this array to know of which mmap inodes are being used, therefore zero it out. std::memset(refs_to_mmap, 0, sizeof(int) * groups_); #endif block_bitmap = new bitmap_t* [groups_]; // We use this array to know of which groups we loaded the metadata. Therefore zero it out. std::memset(block_bitmap, 0, sizeof(bitmap_t*) * groups_); inode_bitmap = new bitmap_t* [groups_]; // Initialize group_descriptor_table. // Calculate the block where the group descriptor table starts. int const super_block_block = SUPER_BLOCK_OFFSET / block_size(super_block); // The block following the superblock is the group descriptor table. int const group_descriptor_table_block = super_block_block + 1; // Allocate group descriptor table. ASSERT(EXT3_DESC_PER_BLOCK(&super_block) * sizeof(ext3_group_desc) == (size_t)block_size_); group_descriptor_table = new ext3_group_desc[groups_]; device.seekg(block_to_offset(group_descriptor_table_block)); ASSERT(device.good()); device.read(reinterpret_cast(group_descriptor_table), sizeof(ext3_group_desc) * groups_); ASSERT(device.good()); } ext3grep-0.10.1/src/init_files.h0000644000175000017500000000231711031754403013341 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file init_files.h Declaration of init_files and its map. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef INIT_FILES_H #define INIT_FILES_H #ifndef USE_PCH #include #include #endif typedef std::map path_to_inode_map_type; extern path_to_inode_map_type path_to_inode_map; #endif // INIT_FILES_H ext3grep-0.10.1/src/ostream_operators.h0000644000175000017500000000345311031754727014777 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file ostream_operators.h Declaration of various ostream inserter functions. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef OSTREAM_OPERATORS_H #define OSTREAM_OPERATORS_H #ifndef USE_PCH #include // Needed for std::ostream #include "ext3.h" // Needed for all other types. #endif // Print superblock contents. std::ostream& operator<<(std::ostream& os, ext3_super_block const& super_block); std::ostream& operator<<(std::ostream& os, journal_superblock_t const& journal_super_block); // Print group descriptor. std::ostream& operator<<(std::ostream& os, ext3_group_desc const& group_desc); // Print journal header. std::ostream& operator<<(std::ostream& os, journal_header_t const& journal_header); std::ostream& operator<<(std::ostream& os, journal_block_tag_t const& journal_block_tag); std::ostream& operator<<(std::ostream& os, journal_revoke_header_t const& journal_revoke_header); #endif // OSTREAM_OPERATORS_H ext3grep-0.10.1/src/locate.cc0000644000175000017500000002007411077723064012632 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file location.cc Implementation of heuristic functions parent_directory and path_exists that use an (old) locate database output file. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include #include #include #include #include #include #include #endif #include "locate.h" class LocatePath { private: std::string M_path; mutable bool M_is_certainly_directory; public: LocatePath(void) : M_is_certainly_directory(false) { } LocatePath(std::string const& path, bool is_certainly_directory = false) : M_path(path), M_is_certainly_directory(is_certainly_directory) { } std::string const& path(void) const { return M_path; } bool is_certainly_directory(void) const { return M_is_certainly_directory; } void set_certainly_directory(void) const { M_is_certainly_directory = true; } }; struct LocatePathPred { bool operator()(LocatePath const& lp1, LocatePath const& lp2) const { return lp1.path() < lp2.path(); } }; typedef std::set locatepaths_type; typedef std::vector filename_to_locatepath_map_info_type; typedef std::map filename_to_locatepath_map_type; locatepaths_type locatepaths; filename_to_locatepath_map_type filename_to_locatepath_map; static bool initialized = false; void load_locate_data(void) { std::ifstream infile; infile.open("locate_output"); if (!infile) std::cerr << "WARNING: Failed to open file 'locate_output'. See locate.cc\n"; std::string line; while (std::getline(infile, line)) { std::pair res = locatepaths.insert(LocatePath(line)); std::string::size_type pos = line.find_last_of('/'); if (pos != std::string::npos) { std::string dirname = line.substr(0, pos); // Use insert, in case the parent directory wasn't seen first. // Since it's a set, it will only be inserted if it isn't already there. locatepaths_type::iterator locatepath_iter = locatepaths.insert(LocatePath(dirname)).first; locatepath_iter->set_certainly_directory(); std::string filename = line.substr(pos + 1); filename_to_locatepath_map_type::iterator iter = filename_to_locatepath_map.find(filename); if (iter == filename_to_locatepath_map.end()) filename_to_locatepath_map[filename] = filename_to_locatepath_map_type::mapped_type(1, locatepath_iter); else iter->second.push_back(locatepath_iter); } } infile.close(); initialized = true; } #if 0 int const test_blocknr = 1418523; #endif std::string parent_directory(int #if 0 blocknr #endif , std::set const& filenames) { if (!initialized) load_locate_data(); //#ifdef CARLO_WOODS_CASE This should be automatic now. // if (blocknr == 1016319 || blocknr == 1640008 || blocknr == 1640009) // return "lost+found"; // Google Earth junk. //#endif typedef std::map > possible_directories_type; possible_directories_type possible_directories; for (std::set::const_iterator filename_iter = filenames.begin(); filename_iter != filenames.end(); ++filename_iter) { filename_to_locatepath_map_type::iterator directories_iter = filename_to_locatepath_map.find(*filename_iter); if (directories_iter != filename_to_locatepath_map.end()) { int count = 0; possible_directories_type::iterator possible_directory_iter; for (filename_to_locatepath_map_type::mapped_type::iterator directory_iter = directories_iter->second.begin(); directory_iter != directories_iter->second.end(); ++directory_iter) { std::string const& path = (*directory_iter)->path(); std::string fullpath = path + '/' + *filename_iter; locatepaths_type::iterator iter = locatepaths.find(LocatePath(fullpath)); assert(iter != locatepaths.end()); if (iter->is_certainly_directory()) continue; ++count; possible_directory_iter = possible_directories.find(path); if (possible_directory_iter == possible_directories.end()) possible_directory_iter = possible_directories.insert(possible_directories_type::value_type(path, std::pair(1, false))).first; else ++(possible_directories[path].first); } if (count == 1) possible_directory_iter->second.second = true; } } int maxhits = 0; int total = filenames.size(); std::string result; for (possible_directories_type::iterator possible_directory_iter = possible_directories.begin(); possible_directory_iter != possible_directories.end(); ++possible_directory_iter) { int hits = possible_directory_iter->second.first + (possible_directory_iter->second.second ? 1 : 0); double percentage = 100.0 * hits / total; double threshold = possible_directory_iter->second.second ? 10 : 70; #if 0 if (blocknr == test_blocknr) std::cout << hits << " (" << percentage << "% of the files) match " << possible_directory_iter->first << '\n'; #endif if (hits >= maxhits && percentage >= threshold) { if (hits > maxhits || possible_directory_iter->first.size() < result.size()) { maxhits = hits; result = possible_directory_iter->first; } } } if (maxhits == 0) { // EDIT THIS TO SUITE YOUR NEEDS! // The format is: "regular expression of files", "parent directory" // You can set test_blocknr and uncomment the #if 0'd code below to debug your regular expressions. static struct { char const* regexp; char const* path; } table[] = { //#ifdef CARLO_WOODS_CASE This should be automatic now. // { "^([0-9]{10}-[0-9]{3,5}-[0-9]+|11c0a8020[0-9]{28})\\.ms$", "carlo/k3b/temp" }, // { "^1[12][0-9]{11}_(AutoSpeedSearchHistory|SpeedMan|seltrace|thread|alerts|debug)_[12]\\.log$", "carlo/.azureus/logs/save" }, // { "^opr0[0-9][0-9A-Z]{3}\\.(js|ico|htm|gif|png|html|jpeg|xml|flv|css|swf|jpg)$", "lost+found" }, // { "\\.(md5|eps|tex)$", "lost+found" } //#endif }; regex_t preg; int re_end = sizeof(table) / sizeof(table[0]); for (int re = 0; re < re_end; ++re) { int hits = 0; regcomp(&preg, table[re].regexp, REG_EXTENDED|REG_NOSUB); for (std::set::const_iterator filename_iter = filenames.begin(); filename_iter != filenames.end(); ++filename_iter) { #if 0 if (blocknr == test_blocknr) std::cout << "Matching \"" << filename_iter->c_str() << "\" against \"" << table[re].regexp << "\": "; #endif if (regexec(&preg, filename_iter->c_str(), 0, NULL, 0) == 0) { #if 0 if (blocknr == test_blocknr) std::cout << "match!\n"; #endif ++hits; } #if 0 else if (blocknr == test_blocknr) std::cout << " no match.\n"; #endif } regfree(&preg); #if 0 if (blocknr == test_blocknr) std::cout << (100.0 * hits / total) << "% matched regular expression #" << re << ".\n"; #endif if (100.0 * hits / total > 90) return table[re].path; } } return result; } bool path_exists(std::string const& path) { if (!initialized) load_locate_data(); locatepaths_type::iterator iter = locatepaths.find(LocatePath(path)); return iter != locatepaths.end(); } ext3grep-0.10.1/src/print_dir_entry_long_action.cc0000644000175000017500000000645011031743414017143 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file print_dir_entry_long_action.cc Definition of the function print_dir_entry_long_action. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include "ext3.h" #endif #include "Parent.h" #include "utils.h" #include "is_filename_char.h" #include "is_blockdetection.h" #include "print_symlink.h" #include "commandline.h" #include "conversion.h" #include "print_inode_to.h" bool print_dir_entry_long_action(ext3_dir_entry_2 const& dir_entry, Inode const& inode, bool UNUSED(deleted), bool UNUSED(allocated), bool reallocated, bool zero_inode, bool linked, bool filtered, Parent*, void*) { std::cout << "\ninode: " << dir_entry.inode << '\n'; std::cout << "Directory entry length: " << dir_entry.rec_len << '\n'; std::cout << "Name length: " << (int)dir_entry.name_len << '\n'; if (feature_incompat_filetype) std::cout << "File type: " << dir_entry_file_type(dir_entry.file_type, false); int number_of_weird_characters = 0; for (int c = 0; c < dir_entry.name_len; ++c) { filename_char_type fnct = is_filename_char(dir_entry.name[c]); if (fnct != fnct_ok) { ASSERT(fnct != fnct_illegal); ++number_of_weird_characters; } } if (number_of_weird_characters < 4 && number_of_weird_characters < dir_entry.name_len) std::cout << "\nFile name: \"" << std::string(dir_entry.name, dir_entry.name_len) << "\"\n"; if (number_of_weird_characters > 0) { std::cout << "\nEscaped file name: \""; print_buf_to(std::cout, dir_entry.name, dir_entry.name_len); std::cout << "\"\n"; } if (!reallocated && !zero_inode && feature_incompat_filetype && (dir_entry.file_type & 7) == EXT3_FT_SYMLINK) { std::cout << "Symbolic link to: "; print_symlink(std::cout, inode); std::cout << '\n'; } std::cout << "Filtered: " << (filtered ? "Yes" : "No") << '\n'; if (commandline_group == -1 || inode_to_group(super_block, dir_entry.inode) == commandline_group) { if (zero_inode) std::cout << "Inode: ZERO\n"; else { std::cout << "\nInode:\n"; print_inode_to(std::cout, inode); } if (zero_inode && linked) std::cout << "The directory entry is linked but has a zero inode. This needs to be fixed!\n"; } return false; } #ifdef CPPGRAPH void iterate_over_directory__with__print_dir_entry_long_action(void) { (void)print_dir_entry_long_action(*(ext3_dir_entry_2 const*)NULL, *(Inode const*)NULL, 0, 0, 0, 0, 0, 0, NULL, NULL); } #endif ext3grep-0.10.1/src/utils.h0000644000175000017500000000230511031755111012346 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file utils.h Declarations for utils.cc. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef UTILS_H #define UTILS_H #ifndef USE_PCH #include #endif char const* dir_entry_file_type(int file_type, bool ls); mode_t inode_mode_to_mkdir_mode(uint16_t mode); char const* mode_str(int16_t i_mode); #endif // UTILS_H ext3grep-0.10.1/src/indirect_blocks.cc0000644000175000017500000003245111077150711014514 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file indirect_blocks.cc Implementation dealing with (double/tripple) indirect blocks. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // Stanislaw T. Findeisen // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // ChangeLog // // 2008-07-07 STF // * (is_indirect_block): Add. Heuristic detection of indirect // blocks based solely on their content. // // 2008-07-10 Carlo Wood // * (is_indirect_block): // -Add SKIPZEROES. // - Call is_data_block_number. // - Return false if there are only ZEROES. // - Bug fix: Abort loops when reaching the ZEROES. // - Only use an array on the stack if the block numbers are less than the // size of one group apart (instead of allocating and clearing 32 MB on // the stack every time). // - Use return value of std::set<>::insert instead of calling std::set<>::count. // // 2008-10-13 Carlo Wood // * (is_indirect_block): // - SKIPZEROES must be 0: zeroes a completely legal in any indirect block. #ifndef USE_PCH #include "sys.h" #endif #include "indirect_blocks.h" #include "get_block.h" #include "is_blockdetection.h" #include "forward_declarations.h" #include "endian_conversion.h" #include "superblock.h" //----------------------------------------------------------------------------- // // Indirect blocks // void find_block_action(int blocknr, int, void* ptr) { find_block_data_st& data(*reinterpret_cast(ptr)); if (blocknr == data.block_looking_for) data.found_block = true; } #ifdef CPPGRAPH void iterate_over_all_blocks_of__with__find_block_action(void) { find_block_action(0, 0, NULL); } #endif void print_directory_action(int blocknr, int, void*) { static bool using_static_buffer = false; ASSERT(!using_static_buffer); static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; unsigned char* block = get_block(blocknr, block_buf); using_static_buffer = true; ext3_dir_entry_2* dir_entry = reinterpret_cast(block); if (dir_entry->rec_len < block_size_) // The directory could be entirely empty (unused). print_directory(block, blocknr); using_static_buffer = false; } #ifdef CPPGRAPH void iterate_over_all_blocks_of__with__print_directory_action(void) { print_directory_action(0, 0, NULL); } #endif bool iterate_over_all_blocks_of_indirect_block(int block, int& file_block_nr, void (*action)(int, int, void*), void* data, unsigned int indirect_mask, bool diagnose) { if (diagnose) std::cout << "Processing indirect block " << block << ": " << std::flush; unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; __le32* block_ptr = (__le32*)get_block(block, block_buf); unsigned int i = 0; while (i < block_size_ / sizeof(__le32)) { if (block_ptr[i] || (indirect_mask & hole_bit)) { if (!is_block_number(block_ptr[i])) { if (diagnose) std::cout << "entry " << i << " contains block number " << block_ptr[i] << ", which is too large." << std::endl; break; } if (!diagnose) action(block_ptr[i], file_block_nr, data); } ++i; ++file_block_nr; } bool result = (i < block_size_ / sizeof(__le32)); if (diagnose && !result) std::cout << "OK" << std::endl; return result; } bool iterate_over_all_blocks_of_double_indirect_block(int block, int& file_block_nr, void (*action)(int, int, void*), void* data, unsigned int indirect_mask, bool diagnose) { if (diagnose) std::cout << "Start processing double indirect block " << block << '.' << std::endl; unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; __le32* block_ptr = (__le32*)get_block(block, block_buf); unsigned int i = 0; unsigned int const limit = block_size_ >> 2; while (i < limit) { if (block_ptr[i] || (indirect_mask & hole_bit)) { if (!is_block_number(block_ptr[i])) { if (diagnose) std::cout << "Entry " << i << " of double indirect block " << block << " contains block number " << block_ptr[i] << ", which is too large." << std::endl; break; } if ((indirect_mask & indirect_bit) && !diagnose) action(block_ptr[i], -1, data); if ((indirect_mask & direct_bit)) { if (iterate_over_all_blocks_of_indirect_block(block_ptr[i], file_block_nr, action, data, indirect_mask, diagnose)) break; } else file_block_nr += limit; } else file_block_nr += limit; ++i; } if (diagnose) std::cout << "End processing double indirect block " << block << '.' << std::endl; return i < block_size_ / sizeof(__le32); } bool iterate_over_all_blocks_of_tripple_indirect_block(int block, int& file_block_nr, void (*action)(int, int, void*), void* data, unsigned int indirect_mask, bool diagnose) { if (diagnose) std::cout << "Start processing tripple indirect block " << block << '.' << std::endl; unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; __le32* block_ptr = (__le32*)get_block(block, block_buf); unsigned int i = 0; unsigned int const limit = block_size_ >> 2; while (i < limit) { if (block_ptr[i] || (indirect_mask & hole_bit)) { if (!is_block_number(block_ptr[i])) { if (diagnose) std::cout << "Entry " << i << " of tripple indirect block " << block << " contains block number " << block_ptr[i] << ", which is too large." << std::endl; break; } if ((indirect_mask & indirect_bit) && !diagnose) action(block_ptr[i], -1, data); if (iterate_over_all_blocks_of_double_indirect_block(block_ptr[i], file_block_nr, action, data, indirect_mask, diagnose)) break; } else file_block_nr += limit * limit; ++i; } if (diagnose) std::cout << "End processing tripple indirect block " << block << '.' << std::endl; return i < limit; } // Returns true if an indirect block was encountered that doesn't look like an indirect block anymore. bool iterate_over_all_blocks_of(Inode const& inode, int inode_number, void (*action)(int, int, void*), void* data, unsigned int indirect_mask, bool diagnose) { if (is_symlink(inode) && inode.blocks() == 0) return false; // Block pointers contain text. __le32 const* block_ptr = inode.block(); if (diagnose) std::cout << "Processing direct blocks..." << std::flush; int file_block_nr = 0; unsigned int const limit = block_size_ >> 2; if ((indirect_mask & direct_bit)) { for (int i = 0; i < EXT3_NDIR_BLOCKS; ++i, ++file_block_nr) if (block_ptr[i] || (indirect_mask & hole_bit)) { if (diagnose) std::cout << ' ' << block_ptr[i] << std::flush; else action(block_ptr[i], file_block_nr, data); } } else file_block_nr += EXT3_NDIR_BLOCKS; if (diagnose) std::cout << std::endl; if (block_ptr[EXT3_IND_BLOCK] || (indirect_mask & hole_bit)) { if (!is_block_number(block_ptr[EXT3_IND_BLOCK])) { std::cout << std::flush; std::cerr << "\nWARNING: The indirect block number of inode " << inode_number << " (or a journal copy thereof) doesn't look like a block number (it is too large, " "block number " << EXT3_IND_BLOCK << " in it's block list is too large (" << block_ptr[EXT3_IND_BLOCK] << ")). Treating this as if one of the indirect blocks " "were overwritten, although this is a more serious corruption." << std::endl; return true; } if ((indirect_mask & indirect_bit) && !diagnose) action(block_ptr[EXT3_IND_BLOCK], -1, data); if ((indirect_mask & direct_bit)) { if (iterate_over_all_blocks_of_indirect_block(block_ptr[EXT3_IND_BLOCK], file_block_nr, action, data, indirect_mask, diagnose)) return true; } } else file_block_nr += limit; if (block_ptr[EXT3_DIND_BLOCK] || (indirect_mask & hole_bit)) { if (!is_block_number(block_ptr[EXT3_DIND_BLOCK])) { std::cout << std::flush; std::cerr << "WARNING: The double indirect block number of inode " << inode_number << " (or a journal copy thereof) doesn't look like a block number (it is too large, " "block number " << EXT3_DIND_BLOCK << " in it's block list is too large (" << block_ptr[EXT3_DIND_BLOCK] << ")). Treating this as if one of the indirect blocks " "were overwritten, although this is a more serious corruption." << std::endl; return true; } if ((indirect_mask & indirect_bit) && !diagnose) action(block_ptr[EXT3_DIND_BLOCK], -1, data); if (iterate_over_all_blocks_of_double_indirect_block(block_ptr[EXT3_DIND_BLOCK], file_block_nr, action, data, indirect_mask, diagnose)) return true; } else file_block_nr += limit * limit; if (block_ptr[EXT3_TIND_BLOCK] || (indirect_mask & hole_bit)) { if (!is_block_number(block_ptr[EXT3_TIND_BLOCK])) { std::cout << std::flush; std::cerr << "WARNING: The tripple indirect block number of inode " << inode_number << " (or a journal copy thereof) doesn't look like a block number (it is too large, " "block number " << EXT3_TIND_BLOCK << " in it's block list is too large (" << block_ptr[EXT3_TIND_BLOCK] << ")). Treating this as if one of the indirect blocks " "were overwritten, although this is a more serious corruption." << std::endl; return true; } if ((indirect_mask & indirect_bit) && !diagnose) action(block_ptr[EXT3_TIND_BLOCK], -1, data); if (iterate_over_all_blocks_of_tripple_indirect_block(block_ptr[EXT3_TIND_BLOCK], file_block_nr, action, data, indirect_mask, diagnose)) return true; } return false; } // See header file for description. // Define this to return false if any [bi] is zero, otherwise // only false is returned when the first block is zero. // This must be 0. #define SKIPZEROES 0 bool is_indirect_block(unsigned char* block_ptr, bool verbose) { // Number of 32-bit values per block. int const values_per_block = block_size_ / sizeof(__le32); // Block values. uint32_t blockVals[values_per_block]; uint32_t vmin = 0xffffffff; uint32_t vmax = 0; bool hasZero = false; // Search for zeroes, min and max. for (int i = 0, offset = 0; i < values_per_block; ++i, offset += sizeof(__le32)) { uint32_t v = __le32_to_cpu(read_le32(block_ptr + offset)); blockVals[i] = v; if (v) { #if SKIPZEROES if (hasZero) { if (verbose) std::cout << "Found non-zero after zero!" << std::endl; // There already was 0, now it is not 0 --- this might be an indirect block of a file with 'holes'. // However, fail and return false. return false; } #endif if (!is_data_block_number(v)) { // This is not a valid block pointer. if (verbose) std::cout << "Invalid block pointer!" << std::endl; return false; } #if !SKIPZEROES if (hasZero) continue; #endif if (v < vmin) vmin = v; if (vmax < v) vmax = v; } else hasZero = true; } if (vmax == 0) { if (verbose) { std::cout << "Block with only zeroes!" << std::endl; std::cout << std::flush; std::cerr << "WARNING: is_indirect_block() was called for a block with ONLY zeroes. " "The correct return value depends on where we were called from. This is not " "implemented yet!" << std::endl; } // This should return 'true' if we're called from is_double_indirect_block or is_tripple_indirect_block: // it should not lead to failure namely. In any case, we can definitely not be sure we return the // correct value; a block with only zeroes can theoretically be anything. return false; // Only zeroes. } // Maximum number of bytes to allocate in an array. uint32_t const max_array_size = blocks_per_group(super_block); // [2] Search for duplicate entries. if (vmax - vmin < max_array_size) { char t[max_array_size]; std::memset(t, 0, sizeof(t)); for (int i = 0; i < values_per_block; ++i) { uint32_t v = blockVals[i]; if (!v) break; if (t[v - vmin]) { // Value already present! if (verbose) std::cout << "Duplicated values!" << std::endl; return false; } t[v - vmin] = 1; } return true; } else { // Block is of the form [b1], [b2], ... [bk] ZEROES, but // [b1] ... [bk] spans more than one group. // Use a set<> to check if they are all different. std::set bvSet; for (int i = 0; i < values_per_block; ++i) { uint32_t v = blockVals[i]; if (!v) break; if (!bvSet.insert(v).second) // Was already inserted? { if (verbose) std::cout << "Duplicated values!" << std::endl; return false; } } return true; } } ext3grep-0.10.1/src/init_files.cc0000644000175000017500000003232611031572745013511 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file init_files.cc Implementation of init_files. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #endif #include "init_files.h" #include "directories.h" #include "init_directories.h" #include "commandline.h" #include "globals.h" #include "forward_declarations.h" #include "journal.h" //----------------------------------------------------------------------------- // // Individual files // // Map files to a single inode. // path_to_inode_map_type path_to_inode_map; struct JournalData { int last_tag_sequence; JournalData(int lts) : last_tag_sequence(lts) { } }; class Sorter { private: int M_sequence; int M_index; DirectoryBlock* M_directory_block; public: Sorter(int sequence, int index, DirectoryBlock& directory_block) : M_sequence(sequence), M_index(index), M_directory_block(&directory_block) { } int sequence(void) const { return M_sequence; } int index(void) const { return M_index; } DirectoryBlock& directory_block(void) const { return *M_directory_block; } friend bool operator<(Sorter const& s1, Sorter const& s2) { return s1.M_sequence > s2.M_sequence; } }; typedef std::map::iterator> > inode_to_dir_entry_type; inode_to_dir_entry_type inode_to_dir_entry; void init_files(void) { static bool initialized = false; if (initialized) return; initialized = true; DoutEntering(dc::notice, "init_files()"); init_directories(); bool show_inode_dirblock_table = !commandline_inode_dirblock_table.empty(); all_directories_type::iterator show_inode_dirblock_table_iter; if (show_inode_dirblock_table) { show_inode_dirblock_table_iter = all_directories.find(commandline_inode_dirblock_table); if (show_inode_dirblock_table_iter == all_directories.end()) { std::cout << std::flush; std::cerr << progname << ": --inode-dirblock-table: No such directory: " << commandline_inode_dirblock_table << std::endl; exit(EXIT_FAILURE); } } // Run over all directories. for (all_directories_type::iterator directory_iter = all_directories.begin(); directory_iter != all_directories.end(); ++directory_iter) { Directory& directory(directory_iter->second); // Find all non-journal blocks and fill journal_data_map. typedef std::map journal_data_map_type; journal_data_map_type journal_data_map; for (std::list::iterator directory_block_iter = directory.blocks().begin(); directory_block_iter != directory.blocks().end(); ++directory_block_iter) { DirectoryBlock& directory_block(*directory_block_iter); if (is_in_journal(directory_block.block())) continue; // Find related journal information. JournalData journal_data(0); block_to_descriptors_map_type::iterator iter = block_to_descriptors_map.find(directory_block.block()); if (iter != block_to_descriptors_map.end()) { std::vector& descriptors(iter->second); for (std::vector::reverse_iterator descriptor_iter = descriptors.rbegin(); descriptor_iter != descriptors.rend(); ++descriptor_iter) { Descriptor& descriptor(**descriptor_iter); if (!journal_data.last_tag_sequence && descriptor.descriptor_type() == dt_tag) journal_data.last_tag_sequence = descriptor.sequence(); if (journal_data.last_tag_sequence) break; } } journal_data_map.insert(journal_data_map_type::value_type(directory_block.block(), journal_data)); } // Add journal blocks too. for (std::list::iterator directory_block_iter = directory.blocks().begin(); directory_block_iter != directory.blocks().end(); ++directory_block_iter) { DirectoryBlock& directory_block(*directory_block_iter); if (!is_in_journal(directory_block.block())) continue; ASSERT(is_journal(directory_block.block())); block_in_journal_to_descriptors_map_type::iterator descriptors_iter = block_in_journal_to_descriptors_map.find(directory_block.block()); if (descriptors_iter == block_in_journal_to_descriptors_map.end()) { std::cout << std::flush; std::cerr << "WARNING: Disregarding directory block " << directory_block.block() << " from the journal, " " that appears to belong to a directory with inode number " << directory.inode_number() << ", because it doesn't have a descriptor block (the start of the transaction was probably overwritten)." " We're disregarding it because ext3grep can't deal with journal blocks without a descriptor block." << std::endl; continue; } Descriptor& descriptor(*descriptors_iter->second); ASSERT(descriptor.descriptor_type() == dt_tag); //DescriptorTag& descriptor_tag(static_cast(descriptor)); //journal_data_map_type::iterator iter = journal_data_map.find(descriptor_tag.block()); //if (iter != journal_data_map.end()) // continue; // Refers to a block we already have. journal_data_map.insert(journal_data_map_type::value_type(directory_block.block(), JournalData(descriptor.sequence()))); } // Run over all directoy blocks and dir_entries and fill DirEntry::M_directory for (std::list::iterator directory_block_iter = directory.blocks().begin(); directory_block_iter != directory.blocks().end(); ++directory_block_iter) { DirectoryBlock& directory_block(*directory_block_iter); for (std::vector::iterator dir_entry_iter = directory_block.dir_entries().begin(); dir_entry_iter != directory_block.dir_entries().end(); ++dir_entry_iter) { DirEntry& dir_entry(*dir_entry_iter); dir_entry.M_directory = &directory; } } // Count the number of different filenames and directory blocks in this directory. int number_of_directory_blocks = 0; int number_of_files = 0; typedef std::map filename_to_index_map_type; filename_to_index_map_type filename_to_index_map; // Run over all directoy blocks and dir_entries. for (std::list::iterator directory_block_iter = directory.blocks().begin(); directory_block_iter != directory.blocks().end(); ++directory_block_iter) { DirectoryBlock& directory_block(*directory_block_iter); journal_data_map_type::iterator iter = journal_data_map.find(directory_block.block()); if (iter == journal_data_map.end()) continue; // Count the number of directory blocks. ++number_of_directory_blocks; for (std::vector::iterator dir_entry_iter = directory_block.dir_entries().begin(); dir_entry_iter != directory_block.dir_entries().end(); ++dir_entry_iter) { DirEntry& dir_entry(*dir_entry_iter); if (dir_entry.zero_inode || dir_entry.reallocated) continue; if (dir_entry.M_file_type == EXT3_FT_DIR) continue; // Count the number of different files. std::pair res = filename_to_index_map.insert(filename_to_index_map_type::value_type(dir_entry.M_name, number_of_files)); if (res.second) ++number_of_files; // Fill inode_to_dir_entry inode_to_dir_entry_type::iterator iter2 = inode_to_dir_entry.find(dir_entry.M_inode); if (iter2 == inode_to_dir_entry.end()) inode_to_dir_entry.insert(inode_to_dir_entry_type::value_type(dir_entry.M_inode, std::vector::iterator>(1, dir_entry_iter))); else iter2->second.push_back(dir_entry_iter); } } ASSERT((size_t)number_of_files == filename_to_index_map.size()); // Create a two-dimensional array of number_of_directory_blocks x number_of_files. std::vector > file_dirblock_matrix(number_of_directory_blocks, std::vector(number_of_files, 0)); std::vector index_to_filename(number_of_files); // Fill the array with inode numbers corresponding to filename / directory block. int dirblock_index = -1; size_t longest_filename_size = 19; // Run over all directoy blocks and dir_entries. for (std::list::iterator directory_block_iter = directory.blocks().begin(); directory_block_iter != directory.blocks().end(); ++directory_block_iter) { DirectoryBlock& directory_block(*directory_block_iter); journal_data_map_type::iterator iter = journal_data_map.find(directory_block.block()); if (iter == journal_data_map.end()) continue; ++dirblock_index; for (std::vector::iterator dir_entry_iter = directory_block.dir_entries().begin(); dir_entry_iter != directory_block.dir_entries().end(); ++dir_entry_iter) { DirEntry& dir_entry(*dir_entry_iter); if (dir_entry.zero_inode || dir_entry.reallocated) continue; if (dir_entry.M_file_type == EXT3_FT_DIR) continue; int inode = dir_entry.M_inode; // Get our filename index. int filename_index = filename_to_index_map[dir_entry.M_name]; index_to_filename[filename_index] = dir_entry.M_name; // Find the size of the longest filename. longest_filename_size = std::max(longest_filename_size, dir_entry.M_name.size()); // Fill the array. file_dirblock_matrix[dirblock_index][filename_index] = inode; } } std::vector sort_array; dirblock_index = -1; for (std::list::iterator directory_block_iter = directory.blocks().begin(); directory_block_iter != directory.blocks().end(); ++directory_block_iter) { DirectoryBlock& directory_block(*directory_block_iter); journal_data_map_type::iterator iter = journal_data_map.find(directory_block.block()); if (iter == journal_data_map.end()) continue; ++dirblock_index; sort_array.push_back(Sorter(iter->second.last_tag_sequence, dirblock_index, directory_block)); } ASSERT(sort_array.size() == (size_t)number_of_directory_blocks); std::sort(sort_array.begin(), sort_array.end()); if (show_inode_dirblock_table && directory_iter == show_inode_dirblock_table_iter) { std::cout << "Possible inodes for files in \"" << directory_iter->first << "\":\n"; // Print a header. std::cout << std::right << std::setw(longest_filename_size) << "Directory block nr:"; for (std::vector::iterator iter = sort_array.begin(); iter != sort_array.end(); ++iter) { DirectoryBlock& directory_block(iter->directory_block()); std::cout << " |" << std::setfill(' ') << std::setw(7) << directory_block.block(); } std::cout << '\n'; int prev_sequence = max_sequence; std::cout << std::right << std::setw(longest_filename_size) << "Last tag sequence: "; for (std::vector::iterator iter = sort_array.begin(); iter != sort_array.end(); ++iter) { //DirectoryBlock& directory_block(iter->directory_block()); int sequence = iter->sequence(); ASSERT(sequence <= prev_sequence); std::cout << " |" << std::setfill(' ') << std::setw(7) << sequence; prev_sequence = sequence; } std::cout << '\n'; std::cout << std::string(longest_filename_size, '-'); for (int dirblock_index = 0; dirblock_index < number_of_directory_blocks; ++dirblock_index) std::cout << "-+-------"; std::cout << '\n'; // Print the array. for (int filename_index = 0; filename_index < number_of_files; ++filename_index) { std::string filename = index_to_filename[filename_index]; std::cout << std::setfill(' ') << std::left << std::setw(longest_filename_size) << filename; for (int dirblock_index = 0; dirblock_index < number_of_directory_blocks; ++dirblock_index) { int inode = file_dirblock_matrix[sort_array[dirblock_index].index()][filename_index]; if (inode == 0) std::cout << " | "; else std::cout << " |" << std::setfill(' ') << std::right << std::setw(7) << inode; } std::cout << '\n'; } } // Fill path_to_inode_map. for (int filename_index = 0; filename_index < number_of_files; ++filename_index) { std::string full_path = directory_iter->first; if (!full_path.empty()) full_path += '/'; full_path += index_to_filename[filename_index]; int inode = 0; for (int dirblock_index = 0; dirblock_index < number_of_directory_blocks; ++dirblock_index) if ((inode = file_dirblock_matrix[sort_array[dirblock_index].index()][filename_index])) break; if (inode == 0) continue; path_to_inode_map.insert(path_to_inode_map_type::value_type(full_path, inode)); } } } ext3grep-0.10.1/src/restore.h0000644000175000017500000000276211075526137012714 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file restore.h Declarations for file restore.cc. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef RESTORE_H #define RESTORE_H #ifndef USE_PCH #include // Needed for std::string #endif #include "inode.h" // Needed for InodePointer // Real constants. std::string const outputdir = "RESTORED_FILES/"; void restore_inode(int inodenr, InodePointer real_inode, std::string const& outfile); enum get_undeleted_inode_type { ui_no_inode, ui_real_inode, ui_journal_inode, ui_inode_too_old }; get_undeleted_inode_type get_undeleted_inode(int inodenr, Inode& inode, int* sequence = NULL); #endif // RESTORE_H ext3grep-0.10.1/src/journal.cc0000644000175000017500000006712411076233233013035 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file journal.cc Journal related code. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include "ext3.h" #include "debug.h" #endif #include "journal.h" #include "endian_conversion.h" #include "globals.h" #include "forward_declarations.h" #include "superblock.h" #include "indirect_blocks.h" #include "get_block.h" #include "commandline.h" //----------------------------------------------------------------------------- // // Journal // class Descriptor; static void add_block_descriptor(uint32_t block, Descriptor*); static void add_block_in_journal_descriptor(Descriptor* descriptor); std::ostream& operator<<(std::ostream& os, descriptor_type_nt descriptor_type) { switch (descriptor_type) { case dt_unknown: os << "*UNKNOWN*"; break; case dt_tag: os << "TAG"; break; case dt_revoke: os << "REVOKE"; break; case dt_commit: os << "COMMIT"; break; } return os; } class DescriptorTag : public Descriptor { private: uint32_t M_blocknr; // Block number on the file system. uint32_t M_flags; public: DescriptorTag(uint32_t block, uint32_t sequence, journal_block_tag_t* block_tag) : Descriptor(block, sequence), M_blocknr(be2le(block_tag->t_blocknr)), M_flags(be2le(block_tag->t_flags)) { } virtual descriptor_type_nt descriptor_type(void) const { return dt_tag; } virtual void print_blocks(void) const; virtual void add_block_descriptors(void) { add_block_descriptor(M_blocknr, this); add_block_in_journal_descriptor(this); } uint32_t block(void) const { return M_blocknr; } }; void DescriptorTag::print_blocks(void) const { std::cout << ' ' << Descriptor::block() << '=' << M_blocknr; if ((M_flags & (JFS_FLAG_ESCAPE|JFS_FLAG_DELETED))) { std::cout << '('; uint32_t flags = M_flags; if ((flags & JFS_FLAG_ESCAPE)) { std::cout << "ESCAPED"; flags &= ~JFS_FLAG_ESCAPE; } if (flags) std::cout << '|'; if ((flags & JFS_FLAG_DELETED)) { std::cout << "DELETED"; flags &= ~JFS_FLAG_DELETED; } std::cout << ')'; } } class DescriptorRevoke : public Descriptor { private: std::vector M_blocks; public: DescriptorRevoke(uint32_t block, uint32_t sequence, journal_revoke_header_t* revoke_header); virtual descriptor_type_nt descriptor_type(void) const { return dt_revoke; } virtual void print_blocks(void) const; virtual void add_block_descriptors(void); }; void DescriptorRevoke::add_block_descriptors(void) { for (std::vector::iterator iter = M_blocks.begin(); iter != M_blocks.end(); ++iter) add_block_descriptor(*iter, this); add_block_in_journal_descriptor(this); } DescriptorRevoke::DescriptorRevoke(uint32_t block, uint32_t sequence, journal_revoke_header_t* revoke_header) : Descriptor(block, sequence) { uint32_t count = be2le(revoke_header->r_count); ASSERT(sizeof(journal_revoke_header_t) <= count && count <= (size_t)block_size_); count -= sizeof(journal_revoke_header_t); ASSERT(count % sizeof(__be32) == 0); count /= sizeof(__be32); __be32* ptr = reinterpret_cast<__be32*>((unsigned char*)revoke_header + sizeof(journal_revoke_header_t)); for (uint32_t b = 0; b < count; ++b) M_blocks.push_back(be2le(ptr[b])); } void DescriptorRevoke::print_blocks(void) const { for (std::vector::const_iterator iter = M_blocks.begin(); iter != M_blocks.end(); ++iter) std::cout << ' ' << *iter; } class DescriptorCommit : public Descriptor { public: DescriptorCommit(uint32_t block, uint32_t sequence) : Descriptor(block, sequence) { } virtual descriptor_type_nt descriptor_type(void) const { return dt_commit; } virtual void print_blocks(void) const { } virtual void add_block_descriptors(void) { add_block_in_journal_descriptor(this); }; }; class Transaction { private: int M_block; int M_sequence; bool M_committed; std::vector M_descriptor; public: void init(int block, int sequence) { M_block = block; M_sequence = sequence; M_committed = false; } void set_committed(void) { ASSERT(!M_committed); M_committed = true; } void append(Descriptor* descriptor) { M_descriptor.push_back(descriptor); } void print_descriptors(void) const; int block(void) const { return M_block; } int sequence(void) const { return M_sequence; } bool committed(void) const { return M_committed; } bool contains_tag_for_block(int block); }; bool Transaction::contains_tag_for_block(int block) { for (std::vector::iterator iter = M_descriptor.begin(); iter != M_descriptor.end(); ++iter) { if ((*iter)->descriptor_type() == dt_tag) { DescriptorTag& tag(*static_cast(*iter)); if (tag.block() == (uint32_t)block) return true; } } return false; } void Transaction::print_descriptors(void) const { descriptor_type_nt dt = dt_unknown; for (std::vector::const_iterator iter = M_descriptor.begin(); iter != M_descriptor.end(); ++iter) { if ((*iter)->descriptor_type() != dt) { if (dt != dt_unknown) std::cout << '\n'; dt = (*iter)->descriptor_type(); std::cout << dt << ':'; } (*iter)->print_blocks(); } std::cout << '\n'; } std::vector all_descriptors; typedef std::map sequence_transaction_map_type; sequence_transaction_map_type sequence_transaction_map; block_to_descriptors_map_type block_to_descriptors_map; block_in_journal_to_descriptors_map_type block_in_journal_to_descriptors_map; block_to_dir_inode_map_type block_to_dir_inode_map; static unsigned int number_of_descriptors; static uint32_t min_sequence; uint32_t max_sequence; static void add_block_descriptor(uint32_t block, Descriptor* descriptor) { block_to_descriptors_map_type::iterator iter = block_to_descriptors_map.find(block); if (iter == block_to_descriptors_map.end()) { std::pair res = block_to_descriptors_map.insert(block_to_descriptors_map_type::value_type(block, std::vector())); ASSERT(res.second); res.first->second.push_back(descriptor); } else iter->second.push_back(descriptor); } static void add_block_in_journal_descriptor(Descriptor* descriptor) { std::pair res = block_in_journal_to_descriptors_map.insert(block_in_journal_to_descriptors_map_type::value_type(descriptor->block(), descriptor)); ASSERT(res.second); } void print_block_descriptors(uint32_t block) { block_to_descriptors_map_type::iterator iter = block_to_descriptors_map.find(block); if (iter == block_to_descriptors_map.end()) { std::cout << "There are no descriptors in the journal referencing block " << block << ".\n"; return; } std::cout << "Journal descriptors referencing block " << block << ":\n"; for (std::vector::iterator iter2 = iter->second.begin(); iter2 != iter->second.end(); ++iter2) { std::cout << (*iter2)->sequence() << ' ' << (*iter2)->block() << '\n'; } } uint32_t find_largest_journal_sequence_number(int block) { block_to_descriptors_map_type::iterator iter = block_to_descriptors_map.find(block); if (iter == block_to_descriptors_map.end()) return 0; return (*iter->second.rbegin())->sequence(); } bool action_tag_count(uint32_t, uint32_t sequence, journal_block_tag_t*, void*) { min_sequence = std::min(sequence, min_sequence); max_sequence = std::max(sequence, max_sequence); ++number_of_descriptors; return false; } bool action_revoke_count(uint32_t, uint32_t sequence, journal_revoke_header_t*, void*) { min_sequence = std::min(sequence, min_sequence); max_sequence = std::max(sequence, max_sequence); ++number_of_descriptors; return false; } bool action_commit_count(uint32_t, uint32_t sequence, void*) { min_sequence = std::min(sequence, min_sequence); max_sequence = std::max(sequence, max_sequence); ++number_of_descriptors; return false; } void count_descriptors(void) { number_of_descriptors = 0; min_sequence = 0xffffffff; max_sequence = 0; iterate_over_journal(action_tag_count, action_revoke_count, action_commit_count, NULL); } bool action_tag_fill(uint32_t block, uint32_t sequence, journal_block_tag_t* block_tag, void* data) { uint32_t& descriptor_count = *reinterpret_cast(data); all_descriptors[descriptor_count++] = new DescriptorTag(block, sequence, block_tag); return false; } bool action_revoke_fill(uint32_t block, uint32_t sequence, journal_revoke_header_t* revoke_header, void* data) { uint32_t& descriptor_count = *reinterpret_cast(data); all_descriptors[descriptor_count++] = new DescriptorRevoke(block, sequence, revoke_header); return false; } bool action_commit_fill(uint32_t block, uint32_t sequence, void* data) { uint32_t& descriptor_count = *reinterpret_cast(data); all_descriptors[descriptor_count++] = new DescriptorCommit(block, sequence); return false; } struct AllDescriptorsPred { bool operator()(Descriptor* d1, Descriptor* d2) const { return d1->sequence() < d2->sequence(); } }; static int smallest_block_nr; static int largest_block_nr; static bitmap_t* journal_block_bitmap = NULL; static int min_journal_block; static int max_journal_block; // One more than largest block belonging to the journal. static bitmap_t* is_indirect_block_in_journal_bitmap = NULL; void find_blocknr_range_action(int blocknr, int, void*) { if (blocknr > largest_block_nr) largest_block_nr = blocknr; if (blocknr < smallest_block_nr) smallest_block_nr = blocknr; } #ifdef CPPGRAPH void iterate_over_all_blocks_of__with__find_blocknr_range_action(void) { find_blocknr_range_action(0, 0, NULL); } #endif void fill_journal_bitmap_action(int blocknr, int, void*) { bitmap_ptr bmp = get_bitmap_mask(blocknr - min_journal_block); journal_block_bitmap[bmp.index] |= bmp.mask; } #ifdef CPPGRAPH void iterate_over_all_blocks_of__with__fill_journal_bitmap_action(void) { fill_journal_bitmap_action(0, 0, NULL); } #endif void indirect_journal_block_action(int blocknr, int, void*) { bitmap_ptr bmp = get_bitmap_mask(blocknr - min_journal_block); is_indirect_block_in_journal_bitmap[bmp.index] |= bmp.mask; } #ifdef CPPGRAPH void iterate_over_all_blocks_of__with__indirect_journal_block_action(void) { indirect_journal_block_action(0, 0, NULL); } #endif void directory_inode_action(int blocknr, int, void* data) { int inode_number = *reinterpret_cast(data); block_to_dir_inode_map_type::iterator iter = block_to_dir_inode_map.find(blocknr); if (iter == block_to_dir_inode_map.end()) block_to_dir_inode_map.insert(block_to_dir_inode_map_type::value_type(blocknr, inode_number)); else iter->second = inode_number; // We're called with ascending sequence numbers. Therefore, keep the last. } #ifdef CPPGRAPH void iterate_over_all_blocks_of__with__directory_inode_action(void) { directory_inode_action(0, 0, NULL); } #endif void init_journal(void) { DoutEntering(dc::notice, "init_journal()"); // Determine which blocks belong to the journal. ASSERT(is_allocated(super_block.s_journal_inum)); // Maybe this is the way to detect external journals? InodePointer journal_inode = get_inode(super_block.s_journal_inum); // Find the block range used by the journal. smallest_block_nr = block_count(super_block); largest_block_nr = 0; #ifdef CPPGRAPH // Tell cppgraph that we call find_blocknr_range_action from here. iterate_over_all_blocks_of__with__find_blocknr_range_action(); #endif bool reused_or_corrupted_indirect_block4 = iterate_over_all_blocks_of(journal_inode, super_block.s_journal_inum, find_blocknr_range_action, NULL, indirect_bit | direct_bit); ASSERT(!reused_or_corrupted_indirect_block4); ASSERT(smallest_block_nr < largest_block_nr); // A non-external journal must have a size. min_journal_block = smallest_block_nr; max_journal_block = largest_block_nr + 1; std::cout << "Minimum / maximum journal block: " << min_journal_block << " / " << max_journal_block << '\n'; // Allocate and fill the bitmaps. int size = (max_journal_block - min_journal_block + 8 * sizeof(bitmap_t) - 1) / (8 * sizeof(bitmap_t)); is_indirect_block_in_journal_bitmap = new bitmap_t [size]; memset(is_indirect_block_in_journal_bitmap, 0, size * sizeof(bitmap_t)); #ifdef CPPGRAPH // Tell cppgraph that we call indirect_journal_block_action from here. iterate_over_all_blocks_of__with__indirect_journal_block_action(); #endif bool reused_or_corrupted_indirect_block5 = iterate_over_all_blocks_of(journal_inode, super_block.s_journal_inum, indirect_journal_block_action, NULL, indirect_bit); ASSERT(!reused_or_corrupted_indirect_block5); journal_block_bitmap = new bitmap_t [size]; memset(journal_block_bitmap, 0, size * sizeof(bitmap_t)); #ifdef CPPGRAPH // Tell cppgraph that we call fill_journal_bitmap_action from here. iterate_over_all_blocks_of__with__fill_journal_bitmap_action(); #endif bool reused_or_corrupted_indirect_block6 = iterate_over_all_blocks_of(journal_inode, super_block.s_journal_inum, fill_journal_bitmap_action, NULL, indirect_bit | direct_bit); ASSERT(!reused_or_corrupted_indirect_block6); // Initialize the Descriptors. std::cout << "Loading journal descriptors..." << std::flush; wrapped_journal_sequence = 0; count_descriptors(); all_descriptors.clear(); all_descriptors.resize(number_of_descriptors); uint32_t descriptor_count = 0; iterate_over_journal(action_tag_fill, action_revoke_fill, action_commit_fill, &descriptor_count); ASSERT(all_descriptors.size() == number_of_descriptors); ASSERT(number_of_descriptors == 0 || all_descriptors[number_of_descriptors - 1]->descriptor_type() != dt_unknown); // Sort the descriptors in ascending sequence number. std::cout << " sorting..." << std::flush; std::sort(all_descriptors.begin(), all_descriptors.end(), AllDescriptorsPred()); for (std::vector::iterator iter = all_descriptors.begin(); iter != all_descriptors.end(); ++iter) { int sequence = (*iter)->sequence(); std::pair res = sequence_transaction_map.insert(sequence_transaction_map_type::value_type(sequence, Transaction())); switch((*iter)->descriptor_type()) { case dt_tag: case dt_revoke: if (res.second) // Did we just create this Transaction object? res.first->second.init((*iter)->block(), sequence); // Initialize it. res.first->second.append(*iter); (*iter)->add_block_descriptors(); break; case dt_commit: if (res.second) // Did we just create this Transaction object? sequence_transaction_map.erase(res.first); // We're not interested in a descriptor that exists of only a commit block. // FIXME: could be a wrapped around commit. else res.first->second.set_committed(); break; case dt_unknown: ASSERT((*iter)->descriptor_type() != dt_unknown); // Fail; this should really never happen. break; } } static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; Inode const* inode = reinterpret_cast(block_buf); // Run over all descriptors, in increasing sequence number. time_t oldtime = 0; for (std::vector::iterator iter = all_descriptors.begin(); iter != all_descriptors.end(); ++iter) { // Skip non-tags. if ((*iter)->descriptor_type() != dt_tag) continue; DescriptorTag* tag = static_cast(*iter); // Only process those that contain inodes. uint32_t block_nr = tag->block(); if (!is_block_number(block_nr)) { std::cout << block_nr << " is not a block number.\n"; std::cout << "Sequence number: " << tag->sequence() << "; "; tag->print_blocks(); std::cout << '\n'; exit(EXIT_FAILURE); } if (is_inode(block_nr)) { int inode_number = block_to_inode(block_nr); // Run over all inodes in the journal block. get_block(tag->Descriptor::block(), block_buf); __le32 lasttime = 0; for (unsigned int i = 0; i < block_size_ / sizeof(Inode); i += inode_size_ / sizeof(Inode), ++inode_number) { // REMOVE THIS: // print the inode number: //std::cout << "INODE IN JOURNAL: " << inode_number << std::endl; if (inode[i].atime() > lasttime || lasttime == 0) lasttime = inode[i].atime(); if (inode[i].ctime() > lasttime) lasttime = inode[i].ctime(); if (inode[i].mtime() > lasttime) lasttime = inode[i].mtime(); if (inode[i].dtime() > lasttime) lasttime = inode[i].dtime(); // Skip non-directories. if (!is_directory(inode[i])) continue; // Skip deleted inodes. if (inode[i].is_deleted()) continue; #ifdef CPPGRAPH // Tell cppgraph that we call directory_inode_action from here. iterate_over_all_blocks_of__with__directory_inode_action(); #endif // Run over all blocks of the directory inode. bool reused_or_corrupted_indirect_block7 = iterate_over_all_blocks_of(inode[i], inode_number, directory_inode_action, &inode_number); if (reused_or_corrupted_indirect_block7) { std::cout << "Note: Block " << tag->Descriptor::block() << " in the journal contains a copy of inode " << inode_number << " which is a directory, but this directory has reused or corrupted (double/triple) indirect blocks.\n"; } } // Normally a lasttime != 0 should do. But I ran into a case where the supposedly inode block // didn't contain inodes at all, but block numbers?! Therefore, check that lasttime > inode_count_, // which will be the case in 99.999% of the cases for a real time_t. if ((uint32_t)lasttime > inode_count_ && (__le32_to_cpu(lasttime) < (uint32_t)oldtime || oldtime == 0)) oldtime = __le32_to_cpu(lasttime); } } std::cout << " done\n"; std::cout << "The oldest inode block that is still in the journal, appears to be from " << oldtime << " = " << std::ctime(&oldtime); if (wrapped_journal_sequence) { static bool printed = false; if (!printed) { printed = true; std::cout << "Journal transaction " << wrapped_journal_sequence << " wraps around, some data blocks might have been lost of this transaction.\n"; } } std::cout << "Number of descriptors in journal: " << number_of_descriptors << "; min / max sequence numbers: " << min_sequence << " / " << max_sequence << '\n'; } bool is_in_journal(int blocknr) { if (!journal_block_bitmap) init_journal(); return blocknr >= min_journal_block && blocknr < max_journal_block; } bool is_journal(int blocknr) { if (!super_block.s_journal_inum) { ASSERT(!commandline_journal); return false; } if (!is_in_journal(blocknr)) return false; bitmap_ptr bmp = get_bitmap_mask(blocknr - min_journal_block); return (journal_block_bitmap[bmp.index] & bmp.mask); } bool is_indirect_block_in_journal(int blocknr) { ASSERT(is_indirect_block_in_journal_bitmap); if (blocknr >= max_journal_block || blocknr < min_journal_block) return false; bitmap_ptr bmp = get_bitmap_mask(blocknr - min_journal_block); return (is_indirect_block_in_journal_bitmap[bmp.index] & bmp.mask); } int journal_block_contains_inodes(int blocknr) { block_in_journal_to_descriptors_map_type::iterator iter = block_in_journal_to_descriptors_map.find(blocknr); if (iter == block_in_journal_to_descriptors_map.end()) return 0; Descriptor& descriptor(*iter->second); if (descriptor.descriptor_type() != dt_tag) return 0; DescriptorTag& descriptor_tag(static_cast(descriptor)); return is_inode(descriptor_tag.block()) ? descriptor_tag.block() : 0; } // This is the only function that accepts "journal block numbers", // as opposed to "file system block numbers". int journal_block_to_real_block(int blocknr) { static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; ASSERT(blocknr >= 0 && blocknr < journal_maxlen_); if (blocknr < 12) return journal_inode.block()[blocknr]; blocknr -= 12; int const vpb = block_size_ / sizeof(__le32); // Values Per Block. if (blocknr < vpb) { get_block(journal_inode.block()[EXT3_IND_BLOCK], block_buf); __le32* indirect_block = reinterpret_cast<__le32*>(block_buf); return indirect_block[blocknr]; } blocknr -= vpb; if (blocknr < vpb * vpb) { get_block(journal_inode.block()[EXT3_DIND_BLOCK], block_buf); __le32* double_indirect_block = reinterpret_cast<__le32*>(block_buf); get_block(double_indirect_block[blocknr / vpb], block_buf); __le32* indirect_block = reinterpret_cast<__le32*>(block_buf); return indirect_block[blocknr % vpb]; } blocknr -= vpb * vpb; ASSERT(blocknr < vpb * vpb * vpb); get_block(journal_inode.block()[EXT3_TIND_BLOCK], block_buf); __le32* tripple_indirect_block = reinterpret_cast<__le32*>(block_buf); get_block(tripple_indirect_block[blocknr / (vpb * vpb)], block_buf); __le32* double_indirect_block = reinterpret_cast<__le32*>(block_buf); get_block(double_indirect_block[(blocknr / vpb) % vpb], block_buf); __le32* indirect_block = reinterpret_cast<__le32*>(block_buf); return indirect_block[blocknr % vpb]; } void iterate_over_journal( bool (*action_tag)(uint32_t block, uint32_t sequence, journal_block_tag_t*, void* data), bool (*action_revoke)(uint32_t block, uint32_t sequence, journal_revoke_header_t*, void* data), bool (*action_commit)(uint32_t block, uint32_t sequence, void* data), void* data) { uint32_t jbn = be2le(journal_super_block.s_first); static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; while(jbn < (uint32_t)journal_maxlen_) { // bn is the real block number inside the journal. uint32_t bn = journal_block_to_real_block(jbn); unsigned char* block = get_block(bn, block_buf); journal_header_t* descriptor = reinterpret_cast(block); if (be2le(descriptor->h_magic) == JFS_MAGIC_NUMBER) { uint32_t blocktype = be2le(descriptor->h_blocktype); uint32_t sequence = be2le(descriptor->h_sequence); switch (blocktype) { case JFS_DESCRIPTOR_BLOCK: { journal_block_tag_t* ptr = reinterpret_cast((unsigned char*)descriptor + sizeof(journal_header_t)); uint32_t flags; do { ++jbn; if (jbn >= (uint32_t)journal_maxlen_) { // This could be cheched by checking that the wrapped around block starts with JFS_MAGIC_NUMBER (which thus overwrote the data block). wrapped_journal_sequence = sequence; return; } else if (action_tag(journal_block_to_real_block(jbn), sequence, ptr, data)) return; flags = be2le(ptr->t_flags); if (!(flags & JFS_FLAG_SAME_UUID)) ptr = reinterpret_cast((char*)ptr + 16); ++ptr; } while(!(flags & JFS_FLAG_LAST_TAG)); break; } case JFS_COMMIT_BLOCK: { if (action_commit && action_commit(bn, sequence, data)) return; break; } case JFS_REVOKE_BLOCK: { if (action_revoke(bn, sequence, (journal_revoke_header_t*)descriptor, data)) return; break; } default: { std::cout << std::flush; std::cerr << "WARNING: iterate_over_journal: unexpected blocktype (" << blocktype << "). Journal corrupt?" << std::endl; return; } } } ++jbn; } } void handle_commandline_journal_transaction(void) { sequence_transaction_map_type::iterator iter = sequence_transaction_map.find(commandline_journal_transaction); int prev = -1; int next = -1; if (iter == sequence_transaction_map.end()) { std::cout << "There is no transaction in the journal with sequence number " << commandline_journal_transaction << '\n'; if ((size_t)commandline_journal_transaction > max_sequence || (size_t)commandline_journal_transaction < min_sequence) std::cout << "The sequences numbers found are in the range [" << min_sequence << ", " << max_sequence << "].\n"; if ((size_t)commandline_journal_transaction < max_sequence) { if ((size_t)commandline_journal_transaction > min_sequence) { prev = commandline_journal_transaction; do { --prev; iter = sequence_transaction_map.find(prev); } while(iter == sequence_transaction_map.end()); } } else if ((size_t)commandline_journal_transaction > min_sequence) prev = max_sequence; if ((size_t)commandline_journal_transaction > min_sequence) { if ((size_t)commandline_journal_transaction < max_sequence) { next = commandline_journal_transaction; do { ++next; iter = sequence_transaction_map.find(next); } while(iter == sequence_transaction_map.end()); } } else if ((size_t)commandline_journal_transaction < max_sequence) next = min_sequence; if (prev != -1 && next != -1) std::cout << "Prev / Next sequences numbers: " << prev << ' ' << next << '\n'; else if (prev != -1) std::cout << "Prev sequence number: " << prev << '\n'; else if (next != -1) std::cout << "Next sequence number: " << next << '\n'; } else { sequence_transaction_map_type::iterator store = iter; ++iter; if (iter != sequence_transaction_map.end()) next = iter->second.sequence(); iter = store; if (iter != sequence_transaction_map.begin()) { --iter; prev = iter->second.sequence(); iter = store; } Transaction& transaction(iter->second); if (prev != -1 && next != -1) std::cout << "Prev / Current / Next sequences numbers: " << prev << ' ' << transaction.sequence() << ' ' << next << '\n'; else if (prev != -1) std::cout << "Prev / Current sequences numbers: " << prev << ' ' << transaction.sequence() << '\n'; else if (next != -1) std::cout << "Current / Next sequences numbers: " << transaction.sequence() << ' ' << next << '\n'; else std::cout << "Sequence number: " << transaction.sequence() << '\n'; if (!transaction.committed()) std::cout << "Transaction was NOT COMMITTED!\n"; transaction.print_descriptors(); } } void get_inodes_from_journal(int inode, std::vector >& inodes) { uint32_t block = inode_to_block(super_block, inode); int offset = (inode - block_to_inode(block)) * inode_size_; block_to_descriptors_map_type::iterator descriptors_iter = block_to_descriptors_map.find(block); if (descriptors_iter != block_to_descriptors_map.end()) { std::vector& descriptors(descriptors_iter->second); for (std::vector::reverse_iterator descriptor_iter = descriptors.rbegin(); descriptor_iter != descriptors.rend(); ++descriptor_iter) { Descriptor& descriptor(**descriptor_iter); if (descriptor.descriptor_type() != dt_tag) continue; DescriptorTag& tag(static_cast(descriptor)); ASSERT(tag.block() == block); static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; get_block(descriptor.block(), block_buf); Inode const* inode_ptr = reinterpret_cast(block_buf + offset); inodes.push_back(std::pair(descriptor.sequence(), *inode_ptr)); } } } ext3grep-0.10.1/src/utils.cc0000644000175000017500000000550111031746154012514 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file utils.cc Various utility functions. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include "debug.h" #endif #include "globals.h" char const* dir_entry_file_type(int file_type, bool ls) { ASSERT(feature_incompat_filetype); switch ((file_type & 7)) { case EXT3_FT_UNKNOWN: return (ls ? "?" : "EXT3_FT_UNKNOWN"); case EXT3_FT_REG_FILE: return (ls ? "r" : "EXT3_FT_REG_FILE"); case EXT3_FT_DIR: return (ls ? "d" : "EXT3_FT_DIR"); case EXT3_FT_CHRDEV: return (ls ? "c" : "EXT3_FT_CHRDEV"); case EXT3_FT_BLKDEV: return (ls ? "b" : "EXT3_FT_BLKDEV"); case EXT3_FT_FIFO: return (ls ? "p" : "EXT3_FT_FIFO"); case EXT3_FT_SOCK: return (ls ? "s" : "EXT3_FT_SOCK"); case EXT3_FT_SYMLINK: return (ls ? "l" : "EXT3_FT_SYMLINK"); } exit(EXIT_FAILURE); // Suppress compiler warning. } mode_t inode_mode_to_mkdir_mode(uint16_t mode) { mode_t result = 0; if ((mode & 04000)) result |= S_ISUID; if ((mode & 02000)) result |= S_ISGID; if ((mode & 01000)) result |= S_ISVTX; if ((mode & 0400)) result |= S_IRUSR; if ((mode & 0200)) result |= S_IWUSR; if ((mode & 0100)) result |= S_IXUSR; if ((mode & 040)) result |= S_IRGRP; if ((mode & 020)) result |= S_IWGRP; if ((mode & 010)) result |= S_IXGRP; if ((mode & 04)) result |= S_IROTH; if ((mode & 02)) result |= S_IWOTH; if ((mode & 01)) result |= S_IXOTH; return result; } char const* mode_str(int16_t i_mode) { switch ((i_mode & 0xf000)) { case 0x1000: return "FIFO"; case 0x2000: return "Character device"; case 0x4000: return "Directory"; case 0x6000: return "Block device"; case 0x8000: return "Regular file"; case 0xA000: return "Symbolic link"; case 0xC000: return "UNIX socket"; } // To prevent a compiler warning. return "*UNKNOWN*"; } ext3grep-0.10.1/src/init_consts.h0000644000175000017500000000221511031754317013551 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file init_consts.h Declaration of function init_consts. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef INIT_CONSTS_H #define INIT_CONSTS_H // The (first) super block starts here. int const SUPER_BLOCK_OFFSET = 1024; void init_consts(); #endif // INIT_CONSTS_H ext3grep-0.10.1/src/backtrace.cc0000644000175000017500000000617410777663315013317 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file backtrace.cc Support for printing a backtrace. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef DEBUG // This is a bug in src/Makefile.am. #error : This source file shouldn't be included at all when DEBUG isn't set. #endif #ifdef __OPTIMIZE__ // It makes no sense to dump backtraces if optimization is being used. #error : Please add --disable-optimize to your configure options. #endif #ifndef USE_PCH #include "sys.h" #include #include #include #include #include #include #include "debug.h" #endif #include #include "backtrace.h" extern char const* progname; extern char* reserved_memory; static size_t const BACKTRACE_SIZE = 256; static void* return_addresses[BACKTRACE_SIZE]; void dump_backtrace_on(std::ostream& os) { // Free some memory to make this work. delete [] reserved_memory; reserved_memory = NULL; // Get the backtrace. int nptrs = backtrace(return_addresses, BACKTRACE_SIZE); // Print it. #ifdef CWDEBUG for (int j = 0; j < nptrs; ++j) { libcwd::location_ct loc((char*)return_addresses[j] + libcwd::builtin_return_address_offset); os << '#' << std::left << std::setw(3) << j; os << std::left << std::setw(16) << return_addresses[j] << ' ' << loc << "\n in "; char const* mangled_function_name = loc.mangled_function_name(); if (mangled_function_name != libcwd::unknown_function_c) { std::string demangled_function_name; libcwd::demangle_symbol(mangled_function_name, demangled_function_name); os << demangled_function_name << '\n'; } else os << mangled_function_name << '\n'; } #else char** symbols = backtrace_symbols(return_addresses, BACKTRACE_SIZE); if (symbols == NULL) { perror("backtrace_symbols"); // Attempt to write to stderr directly. backtrace_symbols_fd(return_addresses, nptrs, STDERR_FILENO); exit(EXIT_FAILURE); } for (int j = 0; j < nptrs; ++j) { std::cout << '#' << std::left << std::setw(3) << j; std::cout << symbols[j] << std::endl; std::ostringstream command; command << "addr2line -e " << progname << ' ' << return_addresses[j]; std::cout << " " << std::flush; system(command.str().c_str()); } free(symbols); #endif } ext3grep-0.10.1/src/is_blockdetection.h0000644000175000017500000000714211035524011014673 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file is_blockdetection.h Various is_* test functions. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef IS_BLOCKDETECTION_H #define IS_BLOCKDETECTION_H #ifndef USE_PCH #include // Needed for uint32_t #include // Needed for std::ostream #endif #include "inode.h" // Needed for InodePointer // Return type of is_directory. enum is_directory_type { isdir_no = 0, // Block is not a directory. isdir_start, // Block is a directory containing "." and "..". isdir_extended // Block is a directory not containing "." and "..". }; class DirectoryBlockStats { private: int M_number_of_entries; // Number of entries in chain to the end. __u8 M_unlikely_character_count[256]; // Character count of filenames. public: DirectoryBlockStats(void) { std::memset(this, 0, sizeof(DirectoryBlockStats)); } int number_of_entries(void) const { return M_number_of_entries; } void increment_number_of_entries(void) { ++M_number_of_entries; } void increment_unlikely_character_count(__u8 c) { ++M_unlikely_character_count[c]; } }; // Return true if this inode is a directory. inline bool is_directory(Inode const& inode) { return (inode.mode() & 0xf000) == 0x4000; } // Same for an InodePointer. inline bool is_directory(InodePointer const& inoderef) { // We can dereference inoderef here because it is known that is_directory does not keep a pointer or reference to the inode. return is_directory(*inoderef); } // Return true if this inode is a symlink. inline bool is_symlink(Inode const& inode) { return (inode.mode() & 0xf000) == 0xa000; } // Same for an InodePointer. inline bool is_symlink(InodePointer const& inoderef) { // We can dereference inoderef here because it is known that is_symlink does not keep a pointer or reference to the inode. return is_symlink(*inoderef); } // Return true if this inode is a regular file. inline bool is_regular_file(Inode const& inode) { return (inode.mode() & 0xf000) == 0x8000; } // Same for an InodePointer. inline bool is_regular_file(InodePointer const& inoderef) { // We can dereference inoderef here because it is known that is_regular_file does not keep a pointer or reference to the inode. return is_regular_file(*inoderef); } inline bool is_block_number(uint32_t block_number) { return block_number < block_count_; } inline bool is_data_block_number(uint32_t block_number) { return block_number < block_count_; // FIXME: not all blocks contain data (ie, skip at least the inode tables). } int block_to_inode(int block); bool is_inode(int block); bool is_allocated(int inode); int inode_to_block(ext3_super_block const& super_block, int inode); void print_buf_to(std::ostream& os, char const* buf, int len); #endif // IS_BLOCKDETECTION_H ext3grep-0.10.1/src/dir_inode_to_block.h0000644000175000017500000000262111031747445015032 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file dir_inode_to_block.h Declarations for dir_inode_to_block.cc // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef DIR_INIDE_TO_BLOCK_H #define DIR_INIDE_TO_BLOCK_H #ifndef USE_PCH #include #include #endif #include "blocknr_vector_type.h" bool does_not_end_on_END(std::string const& cachename); void init_dir_inode_to_block_cache(void); int dir_inode_to_block(uint32_t inode); extern blocknr_vector_type* dir_inode_to_block_cache; extern std::vector extended_blocks; #endif // DIR_INIDE_TO_BLOCK_H ext3grep-0.10.1/src/print_directory_inode.cc0000644000175000017500000000510211031743015015740 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file print_directory_inode.cc Definition of functions print_directory_inode. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #endif #include "init_directories.h" #include "dir_inode_to_block.h" #include "commandline.h" #include "forward_declarations.h" void print_directory_inode(int inode) { init_directories(); int first_block = dir_inode_to_block(inode); if (first_block == -1) { std::cout << "There is no directory block associated with inode " << inode << ".\n"; return; } std::cout << "The first block of the directory is " << first_block << ".\n"; inode_to_directory_type::iterator iter = inode_to_directory.find(inode); ASSERT(iter != inode_to_directory.end()); all_directories_type::iterator directory_iter = iter->second; std::cout << "Inode " << inode << " is directory \"" << directory_iter->first << "\".\n"; if (commandline_dump_names) dump_names(); else { Directory& directory(directory_iter->second); for (std::list::iterator directory_block_iter = directory.blocks().begin(); directory_block_iter != directory.blocks().end(); ++directory_block_iter) { std::cout << "Directory block " << directory_block_iter->block() << ":\n"; if (feature_incompat_filetype) std::cout << " .-- File type in dir_entry (r=regular file, d=directory, l=symlink)\n"; std::cout << " | .-- D: Deleted ; R: Reallocated\n"; std::cout << "Indx Next | Inode | Deletion time Mode File name\n"; std::cout << "==========+==========+----------------data-from-inode------+-----------+=========\n"; directory_block_iter->print(); } } } ext3grep-0.10.1/src/journal.h0000644000175000017500000000445111076233233012671 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file journal.h Journal access related declarations. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef JOURNAL_H #define JOURNAL_H #ifndef USE_PCH #include #include #include #endif enum descriptor_type_nt { dt_unknown, dt_tag, dt_revoke, dt_commit }; class Descriptor { private: uint32_t const M_block; // Block number in the journal. uint32_t const M_sequence; public: Descriptor(uint32_t block, uint32_t sequence) : M_block(block), M_sequence(sequence) { } uint32_t block(void) const { return M_block; } uint32_t sequence(void) const { return M_sequence; } virtual descriptor_type_nt descriptor_type(void) const = 0; virtual void print_blocks(void) const = 0; virtual void add_block_descriptors(void) = 0; protected: virtual ~Descriptor() { } }; typedef std::map block_in_journal_to_descriptors_map_type; extern block_in_journal_to_descriptors_map_type block_in_journal_to_descriptors_map; typedef std::map block_to_dir_inode_map_type; extern block_to_dir_inode_map_type block_to_dir_inode_map; typedef std::map > block_to_descriptors_map_type; extern block_to_descriptors_map_type block_to_descriptors_map; extern uint32_t max_sequence; uint32_t find_largest_journal_sequence_number(int block); void get_inodes_from_journal(int inode, std::vector >& inodes); #endif // JOURNAL_H ext3grep-0.10.1/src/print_dir_entry_long_action.h0000644000175000017500000000262011031754764017012 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file print_dir_entry_long_action.h Declaration of function print_dir_entry_long_action. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef PRINT_DIR_ENTRY_LONG_ACTION_H #define PRINT_DIR_ENTRY_LONG_ACTION_H #ifndef USE_PCH #include "ext3.h" #endif struct Parent; bool print_dir_entry_long_action(ext3_dir_entry_2 const& dir_entry, Inode const& inode, bool UNUSED(deleted), bool UNUSED(allocated), bool reallocated, bool zero_inode, bool linked, bool filtered, Parent*, void*); #endif // PRINT_DIR_ENTRY_LONG_ACTION_H ext3grep-0.10.1/src/init_directories.h0000644000175000017500000000265211031754355014563 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file init_directories.h Declaration of init_directories and its maps. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef INIT_DIRECTORIES_H #define INIT_DIRECTORIES_H #ifndef USE_PCH #include #include #include #endif #include "directories.h" typedef std::map all_directories_type; extern all_directories_type all_directories; typedef std::map inode_to_directory_type; extern inode_to_directory_type inode_to_directory; void init_directories(void); #endif ext3grep-0.10.1/src/revision.cc0000644000175000017500000000005411076400606013206 00000000000000char const* svn_revision = "Revision: 121"; ext3grep-0.10.1/src/Makefile.am0000644000175000017500000001202411035740355013100 00000000000000## Process this file with automake to generate Makefile.in AUTOMAKE_OPTIONS = foreign EXTRA_DIST = pch-source.h bin_PROGRAMS = ext3grep BUILT_SOURCES = DEFS = @DEFS@ CXXFLAGS = ext3grep_SOURCES = \ custom.cc \ accept.cc \ blocknr_vector_type.cc \ commandline.cc \ directories.cc \ dir_inode_to_block.cc \ dump_hex_to.cc \ dump_names.cc \ init_journal_consts.cc \ get_block.cc \ globals.cc \ histogram.cc \ indirect_blocks.cc \ init_consts.cc \ init_directories.cc \ init_files.cc \ inode.cc \ inode_refers_to.cc \ is_blockdetection.cc \ journal.cc \ last_undeleted_directory_inode_refering_to_block.cc \ load_meta_data.cc \ ostream_operators.cc \ Parent.cc \ print_directory.cc \ print_directory_inode.cc \ print_dir_entry_long_action.cc \ printing.cc \ print_inode_to.cc \ print_symlink.cc \ restore.h \ restore.cc \ show_hardlinks.cc \ show_journal_inodes.cc \ utils.cc \ ext3grep.cc \ locate.cc \ locate.h \ ext3.h \ Parent.h \ forward_declarations.h \ histogram.h \ indirect_blocks.h \ init_directories.h \ utils.h \ dir_inode_to_block.h \ is_filename_char.h \ superblock.h \ directories.h \ is_blockdetection.h \ conversion.h \ commandline.h \ inode.h \ ostream_operators.h \ print_inode_to.h \ bitmap.h \ load_meta_data.h \ FileMode.h \ accept.h \ endian_conversion.h \ inode_refers_to.h \ journal.h \ init_files.h \ init_journal_consts.h \ print_dir_entry_long_action.h \ get_block.h \ init_consts.h \ print_symlink.h \ blocknr_vector_type.h \ restore.h \ globals.h \ kernel-jbd.h \ jfs_compat.h ext3grep_CXXFLAGS = @CXXFLAGS@ @CWD_FLAGS@ ext3grep_LDADD = @LIBS@ @CWD_LIBS@ ext3grep_LDFLAGS = if USE_DEBUG ext3grep_SOURCES += backtrace.cc backtrace.h debug.cc debug.h ext3grep_LDFLAGS += -rdynamic ext3grep_SOURCES += else if USE_CWDEBUG ext3grep_SOURCES += debug.cc debug.h endif endif if USE_PCH @Makefilein@PREVCXXDEPMODE := $(CXXDEPMODE) @Makefilein@CXXDEPMODE = $(PREVCXXDEPMODE) havepch=yes @Makefilein@ifeq (./$(DEPDIR)/pch.po, $(wildcard ./$(DEPDIR)/pch.po)) @Makefilein@@am__include@ ./$(DEPDIR)/pch.po @Makefilein@endif ext3grep_CXXFLAGS += @PCHFLAGS@ APPLICATIONSUM := $(shell echo "$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS)" | md5sum | sed -e 's/ .*//') BUILT_SOURCES += pch.h.gch/$(APPLICATIONSUM) pch.h.gch/$(APPLICATIONSUM): $(srcdir)/pch-source.h @rm -rf pch.h.gch @mkdir pch.h.gch @test -d $(DEPDIR) || mkdir $(DEPDIR) @mkdir -p empty.pch.h @touch empty.pch.h/pch.h @if $(CXX) -Iempty.pch.h $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) \ -UUSE_PCH -M -MT pch.h.gch -MF $(DEPDIR)/pch.TTpo $(srcdir)/pch-source.h; then \ cat $(DEPDIR)/pch.TTpo | sed -e 's%^pch\.h\.gch:%pch.h.gch/$(APPLICATIONSUM):%' -e 's% empty\.pch\.h/pch\.h%%' > $(DEPDIR)/pch.Tpo; \ cmp -s $(DEPDIR)/pch.Tpo $(DEPDIR)/pch.po || mv $(DEPDIR)/pch.Tpo $(DEPDIR)/pch.po; \ fi $(CXX) -Iempty.pch.h $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) \ -c -o $@ $(srcdir)/pch-source.h test ! -e sys.h || touch sys.h @rm empty.pch.h/pch.h @rmdir empty.pch.h endif if USE_SVN ext3grep_SOURCES += revision.cc revision.cc: FORCE @(cd $(srcdir) && svn info) | grep '^Revision' | sed -e 's/R/char const* svn_revision = "R/;s/$$/";/' > revision.cc.tmp @cmp -s revision.cc revision.cc.tmp || mv revision.cc.tmp revision.cc && echo "Generating revision.cc" @rm -f revision.cc.tmp FORCE: .PHONY: FORCE endif # --------------- Maintainer's Section #dist-hook: all-local: @if test -e $(top_srcdir)/../.libcwdrc-src -a ! -e .libcwdrc; then \ echo "ln -s $(top_srcdir)/../.libcwdrc-src .libcwdrc"; \ ln -s $(top_srcdir)/../.libcwdrc-src .libcwdrc; \ fi @if test -e $(top_srcdir)/../.gdbinit-src -a ! -e .gdbinit; then \ echo "ln -s $(top_srcdir)/../.gdbinit-src .gdbinit"; \ ln -s $(top_srcdir)/../.gdbinit-src .gdbinit; \ fi distclean-local: rm -rf $(srcdir)/autom4te.cache pch.h.gch sys.h test -L .libcwdrc && rm .libcwdrc || true test -L .gdbinit && rm .gdbinit || true @MAINTAINER_MODE_TRUE@rm -f .all_sources *.s *.ii clean-local: if USE_PCH rm -f pch.h.gch/* $(DEPDIR)/pch.*po endif if USE_SVN rm -f revision.cc endif MAINTAINERCLEANFILES = $(srcdir)/Makefile.in tags troep* *.cgd if MAINTAINER_MODE if !USE_DEBUG EXTRA_DIST += backtrace.cc backtrace.h endif if !USE_CWDEBUG EXTRA_DIST += debug.cc debug.h endif # Usage: You have to set the CTAGS_ROOT_SRCDIRS environment variable yourself, # for example: export CTAGS_ROOT_SRCDIRS="/usr/src/gtk/glib-current /usr/src/gtk/gtk+-current" # Then run 'vim -u /some/path/.vimrc' where the .vimrc is the normal .vimrc, but with the # additional lines: set tags=/full/path/to/top_builddir/tags # nmap :tnext ctags: rm -f .all_sources touch .all_sources for d in $(CTAGS_ROOT_SRCDIRS) $(top_srcdir); do \ find $$d -follow -type f -name '*.h' -o -name '*.hpp' -o -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.cxx' -o -name '*.C' -o -name '*.inl' >> .all_sources; \ done ctags `cat .all_sources` endif ext3grep-0.10.1/src/ext3.h0000644000175000017500000001414510777123177012117 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file ext3.h Declaration of ext3 types and macros. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef EXT3_H #define EXT3_H // Use the header files from e2progs (http://e2fsprogs.sourceforge.net) // We can use these headers and then everything named ext2 or ext3. #include // Definitions of ext2, ext3 and ext4. // All of the following is backwards compatible, so we can use the EXT2 versions. #define EXT3_BLOCK_SIZE EXT2_BLOCK_SIZE #define EXT3_FRAG_SIZE EXT2_FRAG_SIZE #define EXT3_BLOCKS_PER_GROUP EXT2_BLOCKS_PER_GROUP #define EXT3_INODES_PER_GROUP EXT2_INODES_PER_GROUP #define EXT3_FIRST_INO EXT2_FIRST_INO #define EXT3_INODE_SIZE EXT2_INODE_SIZE #define EXT3_BLOCK_SIZE_BITS EXT2_BLOCK_SIZE_BITS #define EXT3_DESC_PER_BLOCK EXT2_DESC_PER_BLOCK #define EXT3_DIR_ROUND EXT2_DIR_ROUND #define EXT3_DIR_REC_LEN EXT2_DIR_REC_LEN #define EXT3_FT_DIR EXT2_FT_DIR #define EXT3_FT_UNKNOWN EXT2_FT_UNKNOWN #define EXT3_FT_MAX EXT2_FT_MAX #define EXT3_MAX_BLOCK_SIZE EXT2_MAX_BLOCK_SIZE #define EXT3_NDIR_BLOCKS EXT2_NDIR_BLOCKS #define EXT3_IND_BLOCK EXT2_IND_BLOCK #define EXT3_DIND_BLOCK EXT2_DIND_BLOCK #define EXT3_TIND_BLOCK EXT2_TIND_BLOCK #define EXT3_VALID_FS EXT2_VALID_FS #define EXT3_ERROR_FS EXT2_ERROR_FS #define EXT3_FT_REG_FILE EXT2_FT_REG_FILE #define EXT3_FT_CHRDEV EXT2_FT_CHRDEV #define EXT3_FT_BLKDEV EXT2_FT_BLKDEV #define EXT3_FT_FIFO EXT2_FT_FIFO #define EXT3_FT_SOCK EXT2_FT_SOCK #define EXT3_FT_SYMLINK EXT2_FT_SYMLINK #define EXT3_N_BLOCKS EXT2_N_BLOCKS #define EXT3_DIR_PAD EXT2_DIR_PAD #define EXT3_ROOT_INO EXT2_ROOT_INO #define EXT3_I_SIZE EXT2_I_SIZE #define EXT3_FEATURE_COMPAT_DIR_PREALLOC EXT2_FEATURE_COMPAT_DIR_PREALLOC #define EXT3_FEATURE_COMPAT_IMAGIC_INODES EXT2_FEATURE_COMPAT_IMAGIC_INODES #define EXT3_FEATURE_COMPAT_EXT_ATTR EXT2_FEATURE_COMPAT_EXT_ATTR #define EXT3_FEATURE_COMPAT_RESIZE_INODE EXT2_FEATURE_COMPAT_RESIZE_INODE #define EXT3_FEATURE_COMPAT_DIR_INDEX EXT2_FEATURE_COMPAT_DIR_INDEX #define EXT3_FEATURE_INCOMPAT_COMPRESSION EXT2_FEATURE_INCOMPAT_COMPRESSION #define EXT3_FEATURE_INCOMPAT_FILETYPE EXT2_FEATURE_INCOMPAT_FILETYPE #define EXT3_FEATURE_INCOMPAT_META_BG EXT2_FEATURE_INCOMPAT_META_BG #define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE EXT2_FEATURE_RO_COMPAT_LARGE_FILE #define EXT3_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 typedef ext2_super_block ext3_super_block; typedef ext2_group_desc ext3_group_desc; typedef ext2_inode ext3_inode; typedef ext2_dir_entry_2 ext3_dir_entry_2; // Get declaration of journal_superblock_t #include // This header is a copy from e2fsprogs-1.40.7 except that the type // of 'journal_revoke_header_t::r_count' was changed from int to __s32. #include "kernel-jbd.h" #ifndef USE_PCH #include #endif extern uint32_t inode_count_; // This (POD) struct protects it's members so we // can do access control for debugging purposes. struct Inode : protected ext3_inode { public: __u16 mode(void) const { return i_mode; } __u16 uid_low(void) const { return i_uid_low; } off_t size(void) const { return EXT3_I_SIZE(this); } __u32 atime(void) const { return i_atime; } __u32 ctime(void) const { return i_ctime; } __u32 mtime(void) const { return i_mtime; } __u32 dtime(void) const { return i_dtime; } __u16 gid_low(void) const { return i_gid_low; } __u16 links_count(void) const { return i_links_count; } __u32 blocks(void) const { return i_blocks; } __u32 flags(void) const { return i_flags; } __u32 const* block(void) const { return i_block; } __u32 generation(void) const { return i_generation; } __u32 file_acl(void) const { return i_file_acl; } __u32 dir_acl(void) const { return i_dir_acl; } __u32 faddr(void) const { return i_faddr; } __u16 uid_high(void) const { return i_uid_high; } __u16 gid_high(void) const { return i_gid_high; } __u32 reserved2(void) const { return i_reserved2; } void set_reserved2(__u32 val) { i_reserved2 = val; } // Returns true if this inode is part of an ORPHAN list. // In that case, dtime is overloaded to point to the next orphan and contains an inode number. bool is_orphan(void) const { // This relies on the fact that time_t is larger than the number of inodes. // Assuming we might deal with files as old as five years, then this would // go wrong for partitions larger than ~ 8 TB (assuming a block size of 4096 // and twice as many blocks as inodes). return i_links_count == 0 && i_atime && i_dtime < i_atime && i_dtime <= inode_count_; } // This returns true if dtime() is expected to contain a date. bool has_valid_dtime(void) const { return i_dtime && !is_orphan(); } // This returns true if the inode appears to contain data refering to a previously // deleted file, directory or symlink but does not contain the block list anymore. // That means it will return false for orphan-ed inodes, although they are basically // (partially) deleted. bool is_deleted(void) const { return i_links_count == 0 && i_mode && (i_block[0] == 0 || !((i_mode & 0xf000) == 0x4000 || (i_mode & 0xf000) == 0x8000)); } }; #endif // EXT3_H ext3grep-0.10.1/src/print_inode_to.cc0000644000175000017500000001031511075764763014405 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file print_inode_to.cc Definition of the function print_inode_to. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include "ext3.h" #endif #include "FileMode.h" #include "globals.h" #include "print_symlink.h" void print_inode_to(std::ostream& os, Inode const& inode) { os << "Generation Id: " << inode.generation() << '\n'; union { uid_t uid; uint16_t uid_word[2]; }; uid_word[0] = inode.uid_low(); uid_word[1] = inode.uid_high(); union { uid_t gid; uint16_t gid_word[2]; }; gid_word[0] = inode.gid_low(); gid_word[1] = inode.gid_high(); os << "uid / gid: " << uid << " / " << gid << '\n'; os << "mode: " << FileMode(inode.mode()) << '\n'; os << "size: " << inode.size() << '\n'; os << "num of links: " << inode.links_count() << '\n'; os << "sectors: " << inode.blocks(); // A sector is 512 bytes. Therefore, we are using 'inode.i_blocks * 512 / block_size_' blocks. // 'inode.i_size / block_size_' blocks are used for the content, thus // '(inode.i_blocks * 512 - inode.i_size) / block_size_' blocks should // be used for indirect blocks. if ((inode.mode() & 0xf000) != 0xa000 || inode.blocks() != 0) // Not an inline symlink? { unsigned int number_of_indirect_blocks = (inode.blocks() * 512 - inode.size()) / block_size_; os << " (--> " << number_of_indirect_blocks << " indirect " << ((number_of_indirect_blocks == 1) ? "block" : "blocks") << ").\n"; } time_t atime = inode.atime(); os << "\nInode Times:\n"; os << "Accessed: "; if (atime > 0) os << atime << " = " << std::ctime(&atime); else os << "0\n"; time_t ctime = inode.ctime(); os << "File Modified: "; if (ctime > 0) os << ctime << " = " << std::ctime(&ctime); else os << "0\n"; time_t mtime = inode.mtime(); os << "Inode Modified: "; if (mtime > 0) os << mtime << " = " << std::ctime(&mtime); else os << "0\n"; os << "Deletion time: "; if (inode.has_valid_dtime()) { time_t dtime = inode.dtime(); os << dtime << " = " << std::ctime(&dtime); } else if (inode.is_orphan()) os << "ORPHAN (next inode: " << inode.dtime() << ")\n"; else os << "0\n"; //os << "File flags: " << inode.flags() << '\n'; if ((inode.mode() & 0xf000) != 0xa000 || inode.blocks() != 0) // Not an inline symlink? { os << "\nDirect Blocks:"; long sb = (inode.size() + block_size_ - 1) / block_size_; // Size in blocks. for (int n = 0; n < EXT3_NDIR_BLOCKS; ++n) { os << ' ' << inode.block()[n]; --sb; if (sb <= 0) break; } os << '\n'; if (sb > 0) os << "Indirect Block: " << inode.block()[EXT3_IND_BLOCK] << '\n'; sb -= block_size_ >> 2; if (sb > 0) os << "Double Indirect Block: " << inode.block()[EXT3_DIND_BLOCK] << '\n'; sb -= (block_size_ >> 2) * (block_size_ >> 2); if (sb > 0) os << "Tripple Indirect Block: " << inode.block()[EXT3_TIND_BLOCK] << '\n'; } else { os << "Symbolic link target name: "; print_symlink(os, inode); os << '\n'; } //os << "File ACL: " << inode.file_acl() << '\n'; //os << "Directory ACL: " << inode.dir_acl() << '\n'; //os << "Fragment address: " << inode.faddr() << '\n'; //os << "Fragment number: " << (int)inode.osd2.linux2.l_i_frag << '\n'; //os << "Fragment size: " << (int)inode.osd2.linux2.l_i_fsize << '\n'; } ext3grep-0.10.1/src/inode_refers_to.h0000644000175000017500000000227011035712522014360 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file inode_refers_to.h Declaration of function inode_refers_to. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef INODE_REFERS_TO_H #define INODE_REFERS_TO_H #ifndef USE_PCH #include "ext3.h" #endif bool inode_refers_to(Inode const& inode, int inode_number, int block_number); #endif // INODE_REFERS_TO_H ext3grep-0.10.1/src/kernel-jbd.h0000644000175000017500000006727110766651513013257 00000000000000/* * linux/include/linux/jbd.h * * Written by Stephen C. Tweedie * * Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved * * This file is part of the Linux kernel and is made available under * the terms of the GNU General Public License, version 2, or at your * option, any later version, incorporated herein by reference. * * Definitions for transaction data structures for the buffer cache * filesystem journaling support. */ #ifndef _LINUX_JBD_H #define _LINUX_JBD_H #if defined(CONFIG_JBD) || defined(CONFIG_JBD_MODULE) || !defined(__KERNEL__) /* Allow this file to be included directly into e2fsprogs */ #ifndef __KERNEL__ #include "jfs_compat.h" #define JFS_DEBUG #define jfs_debug jbd_debug #else #include #include #include #endif #ifndef __GNUC__ #define __FUNCTION__ "" #endif #define journal_oom_retry 1 #ifdef __STDC__ #ifdef CONFIG_JBD_DEBUG /* * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal * consistency checks. By default we don't do this unless * CONFIG_JBD_DEBUG is on. */ #define JBD_EXPENSIVE_CHECKING extern int journal_enable_debug; #define jbd_debug(n, f, a...) \ do { \ if ((n) <= journal_enable_debug) { \ printk (KERN_DEBUG "(%s, %d): %s: ", \ __FILE__, __LINE__, __FUNCTION__); \ printk (f, ## a); \ } \ } while (0) #else #ifdef __GNUC__ #define jbd_debug(f, a...) /**/ #else #define jbd_debug(f, ...) /**/ #endif #endif #else #define jbd_debug(x) /* AIX doesn't do STDC */ #endif extern void * __jbd_kmalloc (char *where, size_t size, int flags, int retry); #define jbd_kmalloc(size, flags) \ __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry) #define jbd_rep_kmalloc(size, flags) \ __jbd_kmalloc(__FUNCTION__, (size), (flags), 1) #define JFS_MIN_JOURNAL_BLOCKS 1024 #ifdef __KERNEL__ typedef struct handle_s handle_t; /* Atomic operation type */ typedef struct journal_s journal_t; /* Journal control structure */ #endif /* * Internal structures used by the logging mechanism: */ #define JFS_MAGIC_NUMBER 0xc03b3998U /* The first 4 bytes of /dev/random! */ /* * On-disk structures */ /* * Descriptor block types: */ #define JFS_DESCRIPTOR_BLOCK 1 #define JFS_COMMIT_BLOCK 2 #define JFS_SUPERBLOCK_V1 3 #define JFS_SUPERBLOCK_V2 4 #define JFS_REVOKE_BLOCK 5 /* * Standard header for all descriptor blocks: */ typedef struct journal_header_s { __u32 h_magic; __u32 h_blocktype; __u32 h_sequence; } journal_header_t; /* * The block tag: used to describe a single buffer in the journal */ typedef struct journal_block_tag_s { __u32 t_blocknr; /* The on-disk block number */ __u32 t_flags; /* See below */ } journal_block_tag_t; /* * The revoke descriptor: used on disk to describe a series of blocks to * be revoked from the log */ typedef struct journal_revoke_header_s { journal_header_t r_header; __s32 r_count; /* Count of bytes used in the block */ } journal_revoke_header_t; /* Definitions for the journal tag flags word: */ #define JFS_FLAG_ESCAPE 1 /* on-disk block is escaped */ #define JFS_FLAG_SAME_UUID 2 /* block has same uuid as previous */ #define JFS_FLAG_DELETED 4 /* block deleted by this transaction */ #define JFS_FLAG_LAST_TAG 8 /* last tag in this descriptor block */ /* * The journal superblock. All fields are in big-endian byte order. */ typedef struct journal_superblock_s { /* 0x0000 */ journal_header_t s_header; /* 0x000C */ /* Static information describing the journal */ __u32 s_blocksize; /* journal device blocksize */ __u32 s_maxlen; /* total blocks in journal file */ __u32 s_first; /* first block of log information */ /* 0x0018 */ /* Dynamic information describing the current state of the log */ __u32 s_sequence; /* first commit ID expected in log */ __u32 s_start; /* blocknr of start of log */ /* 0x0020 */ /* Error value, as set by journal_abort(). */ __s32 s_errno; /* 0x0024 */ /* Remaining fields are only valid in a version-2 superblock */ __u32 s_feature_compat; /* compatible feature set */ __u32 s_feature_incompat; /* incompatible feature set */ __u32 s_feature_ro_compat; /* readonly-compatible feature set */ /* 0x0030 */ __u8 s_uuid[16]; /* 128-bit uuid for journal */ /* 0x0040 */ __u32 s_nr_users; /* Nr of filesystems sharing log */ __u32 s_dynsuper; /* Blocknr of dynamic superblock copy*/ /* 0x0048 */ __u32 s_max_transaction; /* Limit of journal blocks per trans.*/ __u32 s_max_trans_data; /* Limit of data blocks per trans. */ /* 0x0050 */ __u32 s_padding[44]; /* 0x0100 */ __u8 s_users[16*48]; /* ids of all fs'es sharing the log */ /* 0x0400 */ } journal_superblock_t; #define JFS_HAS_COMPAT_FEATURE(j,mask) \ ((j)->j_format_version >= 2 && \ ((j)->j_superblock->s_feature_compat & cpu_to_be32((mask)))) #define JFS_HAS_RO_COMPAT_FEATURE(j,mask) \ ((j)->j_format_version >= 2 && \ ((j)->j_superblock->s_feature_ro_compat & cpu_to_be32((mask)))) #define JFS_HAS_INCOMPAT_FEATURE(j,mask) \ ((j)->j_format_version >= 2 && \ ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask)))) #define JFS_FEATURE_INCOMPAT_REVOKE 0x00000001 /* Features known to this kernel version: */ #define JFS_KNOWN_COMPAT_FEATURES 0 #define JFS_KNOWN_ROCOMPAT_FEATURES 0 #define JFS_KNOWN_INCOMPAT_FEATURES JFS_FEATURE_INCOMPAT_REVOKE #ifdef __KERNEL__ #include #include #define JBD_ASSERTIONS #ifdef JBD_ASSERTIONS #define J_ASSERT(assert) \ do { \ if (!(assert)) { \ printk (KERN_EMERG \ "Assertion failure in %s() at %s:%d: \"%s\"\n", \ __FUNCTION__, __FILE__, __LINE__, # assert); \ BUG(); \ } \ } while (0) #if defined(CONFIG_BUFFER_DEBUG) void buffer_assertion_failure(struct buffer_head *bh); #define J_ASSERT_BH(bh, expr) \ do { \ if (!(expr)) \ buffer_assertion_failure(bh); \ J_ASSERT(expr); \ } while (0) #define J_ASSERT_JH(jh, expr) J_ASSERT_BH(jh2bh(jh), expr) #else #define J_ASSERT_BH(bh, expr) J_ASSERT(expr) #define J_ASSERT_JH(jh, expr) J_ASSERT(expr) #endif #else #define J_ASSERT(assert) #endif /* JBD_ASSERTIONS */ enum jbd_state_bits { BH_JWrite = BH_PrivateStart, /* 1 if being written to log (@@@ DEBUGGING) */ BH_Freed, /* 1 if buffer has been freed (truncated) */ BH_Revoked, /* 1 if buffer has been revoked from the log */ BH_RevokeValid, /* 1 if buffer revoked flag is valid */ BH_JBDDirty, /* 1 if buffer is dirty but journaled */ }; /* Return true if the buffer is one which JBD is managing */ static inline int buffer_jbd(struct buffer_head *bh) { return __buffer_state(bh, JBD); } static inline struct buffer_head *jh2bh(struct journal_head *jh) { return jh->b_bh; } static inline struct journal_head *bh2jh(struct buffer_head *bh) { return bh->b_private; } struct jbd_revoke_table_s; /* The handle_t type represents a single atomic update being performed * by some process. All filesystem modifications made by the process go * through this handle. Recursive operations (such as quota operations) * are gathered into a single update. * * The buffer credits field is used to account for journaled buffers * being modified by the running process. To ensure that there is * enough log space for all outstanding operations, we need to limit the * number of outstanding buffers possible at any time. When the * operation completes, any buffer credits not used are credited back to * the transaction, so that at all times we know how many buffers the * outstanding updates on a transaction might possibly touch. */ struct handle_s { /* Which compound transaction is this update a part of? */ transaction_t * h_transaction; /* Number of remaining buffers we are allowed to dirty: */ int h_buffer_credits; /* Reference count on this handle */ int h_ref; /* Field for caller's use to track errors through large fs operations */ int h_err; /* Flags */ unsigned int h_sync: 1; /* sync-on-close */ unsigned int h_jdata: 1; /* force data journaling */ unsigned int h_aborted: 1; /* fatal error on handle */ }; /* The transaction_t type is the guts of the journaling mechanism. It * tracks a compound transaction through its various states: * * RUNNING: accepting new updates * LOCKED: Updates still running but we don't accept new ones * RUNDOWN: Updates are tidying up but have finished requesting * new buffers to modify (state not used for now) * FLUSH: All updates complete, but we are still writing to disk * COMMIT: All data on disk, writing commit record * FINISHED: We still have to keep the transaction for checkpointing. * * The transaction keeps track of all of the buffers modified by a * running transaction, and all of the buffers committed but not yet * flushed to home for finished transactions. */ struct transaction_s { /* Pointer to the journal for this transaction. */ journal_t * t_journal; /* Sequence number for this transaction */ tid_t t_tid; /* Transaction's current state */ enum { T_RUNNING, T_LOCKED, T_RUNDOWN, T_FLUSH, T_COMMIT, T_FINISHED } t_state; /* Where in the log does this transaction's commit start? */ unsigned long t_log_start; /* Doubly-linked circular list of all inodes owned by this transaction */ /* AKPM: unused */ struct inode * t_ilist; /* Number of buffers on the t_buffers list */ int t_nr_buffers; /* Doubly-linked circular list of all buffers reserved but not yet modified by this transaction */ struct journal_head * t_reserved_list; /* Doubly-linked circular list of all metadata buffers owned by this transaction */ struct journal_head * t_buffers; /* * Doubly-linked circular list of all data buffers still to be * flushed before this transaction can be committed. * Protected by journal_datalist_lock. */ struct journal_head * t_sync_datalist; /* * Doubly-linked circular list of all writepage data buffers * still to be written before this transaction can be committed. * Protected by journal_datalist_lock. */ struct journal_head * t_async_datalist; /* Doubly-linked circular list of all forget buffers (superceded buffers which we can un-checkpoint once this transaction commits) */ struct journal_head * t_forget; /* * Doubly-linked circular list of all buffers still to be * flushed before this transaction can be checkpointed. */ /* Protected by journal_datalist_lock */ struct journal_head * t_checkpoint_list; /* Doubly-linked circular list of temporary buffers currently undergoing IO in the log */ struct journal_head * t_iobuf_list; /* Doubly-linked circular list of metadata buffers being shadowed by log IO. The IO buffers on the iobuf list and the shadow buffers on this list match each other one for one at all times. */ struct journal_head * t_shadow_list; /* Doubly-linked circular list of control buffers being written to the log. */ struct journal_head * t_log_list; /* Number of outstanding updates running on this transaction */ int t_updates; /* Number of buffers reserved for use by all handles in this * transaction handle but not yet modified. */ int t_outstanding_credits; /* * Forward and backward links for the circular list of all * transactions awaiting checkpoint. */ /* Protected by journal_datalist_lock */ transaction_t *t_cpnext, *t_cpprev; /* When will the transaction expire (become due for commit), in * jiffies ? */ unsigned long t_expires; /* How many handles used this transaction? */ int t_handle_count; }; /* The journal_t maintains all of the journaling state information for a * single filesystem. It is linked to from the fs superblock structure. * * We use the journal_t to keep track of all outstanding transaction * activity on the filesystem, and to manage the state of the log * writing process. */ struct journal_s { /* General journaling state flags */ unsigned long j_flags; /* Is there an outstanding uncleared error on the journal (from * a prior abort)? */ int j_errno; /* The superblock buffer */ struct buffer_head * j_sb_buffer; journal_superblock_t * j_superblock; /* Version of the superblock format */ int j_format_version; /* Number of processes waiting to create a barrier lock */ int j_barrier_count; /* The barrier lock itself */ struct semaphore j_barrier; /* Transactions: The current running transaction... */ transaction_t * j_running_transaction; /* ... the transaction we are pushing to disk ... */ transaction_t * j_committing_transaction; /* ... and a linked circular list of all transactions waiting * for checkpointing. */ /* Protected by journal_datalist_lock */ transaction_t * j_checkpoint_transactions; /* Wait queue for waiting for a locked transaction to start committing, or for a barrier lock to be released */ wait_queue_head_t j_wait_transaction_locked; /* Wait queue for waiting for checkpointing to complete */ wait_queue_head_t j_wait_logspace; /* Wait queue for waiting for commit to complete */ wait_queue_head_t j_wait_done_commit; /* Wait queue to trigger checkpointing */ wait_queue_head_t j_wait_checkpoint; /* Wait queue to trigger commit */ wait_queue_head_t j_wait_commit; /* Wait queue to wait for updates to complete */ wait_queue_head_t j_wait_updates; /* Semaphore for locking against concurrent checkpoints */ struct semaphore j_checkpoint_sem; /* The main journal lock, used by lock_journal() */ struct semaphore j_sem; /* Journal head: identifies the first unused block in the journal. */ unsigned long j_head; /* Journal tail: identifies the oldest still-used block in the * journal. */ unsigned long j_tail; /* Journal free: how many free blocks are there in the journal? */ unsigned long j_free; /* Journal start and end: the block numbers of the first usable * block and one beyond the last usable block in the journal. */ unsigned long j_first, j_last; /* Device, blocksize and starting block offset for the location * where we store the journal. */ kdev_t j_dev; int j_blocksize; unsigned int j_blk_offset; /* Device which holds the client fs. For internal journal this * will be equal to j_dev. */ kdev_t j_fs_dev; /* Total maximum capacity of the journal region on disk. */ unsigned int j_maxlen; /* Optional inode where we store the journal. If present, all * journal block numbers are mapped into this inode via * bmap(). */ struct inode * j_inode; /* Sequence number of the oldest transaction in the log */ tid_t j_tail_sequence; /* Sequence number of the next transaction to grant */ tid_t j_transaction_sequence; /* Sequence number of the most recently committed transaction */ tid_t j_commit_sequence; /* Sequence number of the most recent transaction wanting commit */ tid_t j_commit_request; /* Journal uuid: identifies the object (filesystem, LVM volume * etc) backed by this journal. This will eventually be * replaced by an array of uuids, allowing us to index multiple * devices within a single journal and to perform atomic updates * across them. */ __u8 j_uuid[16]; /* Pointer to the current commit thread for this journal */ struct task_struct * j_task; /* Maximum number of metadata buffers to allow in a single * compound commit transaction */ int j_max_transaction_buffers; /* What is the maximum transaction lifetime before we begin a * commit? */ unsigned long j_commit_interval; /* The timer used to wakeup the commit thread: */ struct timer_list * j_commit_timer; int j_commit_timer_active; /* Link all journals together - system-wide */ struct list_head j_all_journals; /* The revoke table: maintains the list of revoked blocks in the current transaction. */ struct jbd_revoke_table_s *j_revoke; }; /* * Journal flag definitions */ #define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */ #define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */ #define JFS_ACK_ERR 0x004 /* The errno in the sb has been acked */ #define JFS_FLUSHED 0x008 /* The journal superblock has been flushed */ #define JFS_LOADED 0x010 /* The journal superblock has been loaded */ /* * Function declarations for the journaling transaction and buffer * management */ /* Filing buffers */ extern void __journal_unfile_buffer(struct journal_head *); extern void journal_unfile_buffer(struct journal_head *); extern void __journal_refile_buffer(struct journal_head *); extern void journal_refile_buffer(struct journal_head *); extern void __journal_file_buffer(struct journal_head *, transaction_t *, int); extern void __journal_free_buffer(struct journal_head *bh); extern void journal_file_buffer(struct journal_head *, transaction_t *, int); extern void __journal_clean_data_list(transaction_t *transaction); /* Log buffer allocation */ extern struct journal_head * journal_get_descriptor_buffer(journal_t *); extern unsigned long journal_next_log_block(journal_t *); /* Commit management */ extern void journal_commit_transaction(journal_t *); /* Checkpoint list management */ int __journal_clean_checkpoint_list(journal_t *journal); extern void journal_remove_checkpoint(struct journal_head *); extern void __journal_remove_checkpoint(struct journal_head *); extern void journal_insert_checkpoint(struct journal_head *, transaction_t *); extern void __journal_insert_checkpoint(struct journal_head *,transaction_t *); /* Buffer IO */ extern int journal_write_metadata_buffer(transaction_t *transaction, struct journal_head *jh_in, struct journal_head **jh_out, int blocknr); /* Transaction locking */ extern void __wait_on_journal (journal_t *); /* * Journal locking. * * We need to lock the journal during transaction state changes so that * nobody ever tries to take a handle on the running transaction while * we are in the middle of moving it to the commit phase. * * Note that the locking is completely interrupt unsafe. We never touch * journal structures from interrupts. * * In 2.2, the BKL was required for lock_journal. This is no longer * the case. */ static inline void lock_journal(journal_t *journal) { down(&journal->j_sem); } /* This returns zero if we acquired the semaphore */ static inline int try_lock_journal(journal_t * journal) { return down_trylock(&journal->j_sem); } static inline void unlock_journal(journal_t * journal) { up(&journal->j_sem); } static inline handle_t *journal_current_handle(void) { return current->journal_info; } /* The journaling code user interface: * * Create and destroy handles * Register buffer modifications against the current transaction. */ extern handle_t *journal_start(journal_t *, int nblocks); extern handle_t *journal_try_start(journal_t *, int nblocks); extern int journal_restart (handle_t *, int nblocks); extern int journal_extend (handle_t *, int nblocks); extern int journal_get_write_access (handle_t *, struct buffer_head *); extern int journal_get_create_access (handle_t *, struct buffer_head *); extern int journal_get_undo_access (handle_t *, struct buffer_head *); extern int journal_dirty_data (handle_t *, struct buffer_head *, int async); extern int journal_dirty_metadata (handle_t *, struct buffer_head *); extern void journal_release_buffer (handle_t *, struct buffer_head *); extern void journal_forget (handle_t *, struct buffer_head *); extern void journal_sync_buffer (struct buffer_head *); extern int journal_flushpage(journal_t *, struct page *, unsigned long); extern int journal_try_to_free_buffers(journal_t *, struct page *, int); extern int journal_stop(handle_t *); extern int journal_flush (journal_t *); extern void journal_lock_updates (journal_t *); extern void journal_unlock_updates (journal_t *); extern journal_t * journal_init_dev(kdev_t dev, kdev_t fs_dev, int start, int len, int bsize); extern journal_t * journal_init_inode (struct inode *); extern int journal_update_format (journal_t *); extern int journal_check_used_features (journal_t *, unsigned long, unsigned long, unsigned long); extern int journal_check_available_features (journal_t *, unsigned long, unsigned long, unsigned long); extern int journal_set_features (journal_t *, unsigned long, unsigned long, unsigned long); extern int journal_create (journal_t *); extern int journal_load (journal_t *journal); extern void journal_destroy (journal_t *); extern int journal_recover (journal_t *journal); extern int journal_wipe (journal_t *, int); extern int journal_skip_recovery (journal_t *); extern void journal_update_superblock (journal_t *, int); extern void __journal_abort (journal_t *); extern void journal_abort (journal_t *, int); extern int journal_errno (journal_t *); extern void journal_ack_err (journal_t *); extern int journal_clear_err (journal_t *); extern unsigned long journal_bmap(journal_t *journal, unsigned long blocknr); extern int journal_force_commit(journal_t *journal); /* * journal_head management */ extern struct journal_head *journal_add_journal_head(struct buffer_head *bh); extern void journal_remove_journal_head(struct buffer_head *bh); extern void __journal_remove_journal_head(struct buffer_head *bh); extern void journal_unlock_journal_head(struct journal_head *jh); /* Primary revoke support */ #define JOURNAL_REVOKE_DEFAULT_HASH 256 extern int journal_init_revoke(journal_t *, int); extern void journal_destroy_revoke_caches(void); extern int journal_init_revoke_caches(void); extern void journal_destroy_revoke(journal_t *); extern int journal_revoke (handle_t *, unsigned long, struct buffer_head *); extern int journal_cancel_revoke(handle_t *, struct journal_head *); extern void journal_write_revoke_records(journal_t *, transaction_t *); /* Recovery revoke support */ extern int journal_set_revoke(journal_t *, unsigned long, tid_t); extern int journal_test_revoke(journal_t *, unsigned long, tid_t); extern void journal_clear_revoke(journal_t *); extern void journal_brelse_array(struct buffer_head *b[], int n); /* The log thread user interface: * * Request space in the current transaction, and force transaction commit * transitions on demand. */ extern int log_space_left (journal_t *); /* Called with journal locked */ extern tid_t log_start_commit (journal_t *, transaction_t *); extern void log_wait_commit (journal_t *, tid_t); extern int log_do_checkpoint (journal_t *, int); extern void log_wait_for_space(journal_t *, int nblocks); extern void __journal_drop_transaction(journal_t *, transaction_t *); extern int cleanup_journal_tail(journal_t *); /* Reduce journal memory usage by flushing */ extern void shrink_journal_memory(void); /* Debugging code only: */ #define jbd_ENOSYS() \ do { \ printk (KERN_ERR "JBD unimplemented function " __FUNCTION__); \ current->state = TASK_UNINTERRUPTIBLE; \ schedule(); \ } while (1) /* * is_journal_abort * * Simple test wrapper function to test the JFS_ABORT state flag. This * bit, when set, indicates that we have had a fatal error somewhere, * either inside the journaling layer or indicated to us by the client * (eg. ext3), and that we and should not commit any further * transactions. */ static inline int is_journal_aborted(journal_t *journal) { return journal->j_flags & JFS_ABORT; } static inline int is_handle_aborted(handle_t *handle) { if (handle->h_aborted) return 1; return is_journal_aborted(handle->h_transaction->t_journal); } static inline void journal_abort_handle(handle_t *handle) { handle->h_aborted = 1; } /* Not all architectures define BUG() */ #ifndef BUG #define BUG() do { \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ * ((char *) 0) = 0; \ } while (0) #endif /* BUG */ #else extern int journal_recover (journal_t *journal); extern int journal_skip_recovery (journal_t *); /* Primary revoke support */ extern int journal_init_revoke(journal_t *, int); extern void journal_destroy_revoke_caches(void); extern int journal_init_revoke_caches(void); /* Recovery revoke support */ extern int journal_set_revoke(journal_t *, unsigned long, tid_t); extern int journal_test_revoke(journal_t *, unsigned long, tid_t); extern void journal_clear_revoke(journal_t *); extern void journal_brelse_array(struct buffer_head *b[], int n); extern void journal_destroy_revoke(journal_t *); #endif /* __KERNEL__ */ static inline int tid_gt(tid_t x, tid_t y) EXT2FS_ATTR((unused)); static inline int tid_geq(tid_t x, tid_t y) EXT2FS_ATTR((unused)); /* Comparison functions for transaction IDs: perform comparisons using * modulo arithmetic so that they work over sequence number wraps. */ static inline int tid_gt(tid_t x, tid_t y) { int difference = (x - y); return (difference > 0); } static inline int tid_geq(tid_t x, tid_t y) { int difference = (x - y); return (difference >= 0); } extern int journal_blocks_per_page(struct inode *inode); /* * Definitions which augment the buffer_head layer */ /* journaling buffer types */ #define BJ_None 0 /* Not journaled */ #define BJ_SyncData 1 /* Normal data: flush before commit */ #define BJ_AsyncData 2 /* writepage data: wait on it before commit */ #define BJ_Metadata 3 /* Normal journaled metadata */ #define BJ_Forget 4 /* Buffer superceded by this transaction */ #define BJ_IO 5 /* Buffer is for temporary IO use */ #define BJ_Shadow 6 /* Buffer contents being shadowed to the log */ #define BJ_LogCtl 7 /* Buffer contains log descriptors */ #define BJ_Reserved 8 /* Buffer is reserved for access by journal */ #define BJ_Types 9 extern int jbd_blocks_per_page(struct inode *inode); #ifdef __KERNEL__ extern spinlock_t jh_splice_lock; /* * Once `expr1' has been found true, take jh_splice_lock * and then reevaluate everything. */ #define SPLICE_LOCK(expr1, expr2) \ ({ \ int ret = (expr1); \ if (ret) { \ spin_lock(&jh_splice_lock); \ ret = (expr1) && (expr2); \ spin_unlock(&jh_splice_lock); \ } \ ret; \ }) /* * A number of buffer state predicates. They test for * buffer_jbd() because they are used in core kernel code. * * These will be racy on SMP unless we're *sure* that the * buffer won't be detached from the journalling system * in parallel. */ /* Return true if the buffer is on journal list `list' */ static inline int buffer_jlist_eq(struct buffer_head *bh, int list) { return SPLICE_LOCK(buffer_jbd(bh), bh2jh(bh)->b_jlist == list); } /* Return true if this bufer is dirty wrt the journal */ static inline int buffer_jdirty(struct buffer_head *bh) { return buffer_jbd(bh) && __buffer_state(bh, JBDDirty); } /* Return true if it's a data buffer which journalling is managing */ static inline int buffer_jbd_data(struct buffer_head *bh) { return SPLICE_LOCK(buffer_jbd(bh), bh2jh(bh)->b_jlist == BJ_SyncData || bh2jh(bh)->b_jlist == BJ_AsyncData); } #ifdef CONFIG_SMP #define assert_spin_locked(lock) J_ASSERT(spin_is_locked(lock)) #else #define assert_spin_locked(lock) do {} while(0) #endif #define buffer_trace_init(bh) do {} while (0) #define print_buffer_fields(bh) do {} while (0) #define print_buffer_trace(bh) do {} while (0) #define BUFFER_TRACE(bh, info) do {} while (0) #define BUFFER_TRACE2(bh, bh2, info) do {} while (0) #define JBUFFER_TRACE(jh, info) do {} while (0) #endif /* __KERNEL__ */ #endif /* CONFIG_JBD || CONFIG_JBD_MODULE || !__KERNEL__ */ /* * Compatibility no-ops which allow the kernel to compile without CONFIG_JBD * go here. */ #if defined(__KERNEL__) && !(defined(CONFIG_JBD) || defined(CONFIG_JBD_MODULE)) #define J_ASSERT(expr) do {} while (0) #define J_ASSERT_BH(bh, expr) do {} while (0) #define buffer_jbd(bh) 0 #define buffer_jlist_eq(bh, val) 0 #define journal_buffer_journal_lru(bh) 0 #endif /* defined(__KERNEL__) && !defined(CONFIG_JBD) */ #endif /* _LINUX_JBD_H */ ext3grep-0.10.1/src/directories.cc0000644000175000017500000003465511075471213013703 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file directories.cc Implementation of class Directory and iteration over directories. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include "ext3.h" #endif #include "Parent.h" #include "commandline.h" #include "is_blockdetection.h" #include "forward_declarations.h" #include "indirect_blocks.h" #include "get_block.h" #include "directories.h" //----------------------------------------------------------------------------- // // Directories // Iterating over directories // static int const mode_map[8] = { 0x10000, // EXT3_FT_UNKNOWN 0x8000, // EXT3_FT_REG_FILE 0x4000, // EXT3_FT_DIR 0x2000, // EXT3_FT_CHRDEV 0x6000, // EXT3_FT_BLKDEV 0x1000, // EXT3_FT_FIFO 0xC000, // EXT3_FT_SOCK 0xA000 // EXT3_FT_SYMLINK }; struct iterate_data_st { bool (*action)(ext3_dir_entry_2 const&, Inode const&, bool, bool, bool, bool, bool, bool, Parent*, void*); Parent* parent; void* data; unsigned char* block_buf; iterate_data_st(void) : block_buf(NULL) { } ~iterate_data_st() { if (block_buf) delete [] block_buf; } }; int depth; bool read_block_action(ext3_dir_entry_2 const& dir_entry, Inode const& inode, bool deleted, bool allocated, bool reallocated, bool zero_inode, bool linked, bool filtered, Parent* parent, void* data); #ifdef CPPGRAPH void iterate_over_directory__with__read_block_action(void) { (void)read_block_action(*(ext3_dir_entry_2 const*)NULL, *(Inode const*)NULL, 0, 0, 0, 0, 0, 0, NULL, NULL); } #endif bool init_directories_action(ext3_dir_entry_2 const& dir_entry, Inode const&, bool, bool, bool, bool, bool, bool, Parent* parent, void*); static void filter_dir_entry(ext3_dir_entry_2 const& dir_entry, bool deleted, bool linked, bool (*action)(ext3_dir_entry_2 const&, Inode const&, bool, bool, bool, bool, bool, bool, Parent*, void*), Parent* parent, void* data) { InodePointer inode; int file_type = (dir_entry.file_type & 7); bool zero_inode = (dir_entry.inode == 0); bool filtered = (zero_inode && !commandline_zeroed_inodes); bool allocated = false; bool reallocated = false; if (!zero_inode) { inode = get_inode(dir_entry.inode); allocated = is_allocated(dir_entry.inode); reallocated = (deleted && allocated) || (deleted && !inode->is_deleted()) || (feature_incompat_filetype && mode_map[file_type] != (inode->mode() & 0xf000)); deleted = deleted || inode->is_deleted(); // Block pointers are erased on ext3 on deletion (that is the whole point of writing this tool!), // however - in the case of symlinks, the name of the symlink is (still) in this place. // Only printing this for regular files and directories, as also char/block devices seem to // sometimes have a non-zero block list, and we don't "recover" those anyway. if (inode->has_valid_dtime() && inode->block()[0] != 0 && (is_regular_file(inode) || is_directory(inode))) { time_t dtime = inode->dtime(); std::string dtime_str(std::ctime(&dtime)); std::cout << "Note: Inode " << dir_entry.inode << " has non-zero dtime (" << inode->dtime() << " " << dtime_str.substr(0, dtime_str.length() - 1) << ") but non-zero block list (" << inode->block()[0] << ") [ext3grep does" << (inode->is_deleted() ? "" : " not") << " consider this inode to be deleted]\n"; } filtered = !( (!commandline_allocated || allocated) && (!commandline_unallocated || !allocated) && (!commandline_deleted || deleted) && (!commandline_directory || is_directory(inode)) && (!reallocated || commandline_reallocated) && (reallocated || (!inode->is_deleted() && !commandline_deleted) || (inode->has_valid_dtime() && commandline_after <= (time_t)inode->dtime() && (!commandline_before || (time_t)inode->dtime() < commandline_before)))); } if (no_filtering) // Also no recursion. // inode is dereferenced here in good faith that no reference to it is kept (since there are no structs or classes that do so). action(dir_entry, *inode, deleted, allocated, reallocated, zero_inode, linked, filtered, parent, data); else if (!filtered) { // inode is dereferenced here in good faith that no reference to it is kept (since there are no structs or classes that do so). if (action(dir_entry, *inode, deleted, allocated, reallocated, zero_inode, linked, filtered, parent, data)) return; // Recursion aborted. // Handle recursion. if (parent && is_directory(inode) && depth < commandline_depth) { // Skip "." and ".." when iterating recursively. if ((dir_entry.name_len == 1 && dir_entry.name[0] == '.') || (dir_entry.name_len == 2 && dir_entry.name[0] == '.' && dir_entry.name[1] == '.')) return; iterate_data_st idata; idata.action = action; idata.data = data; Parent new_parent(parent, &dir_entry, inode, dir_entry.inode); idata.parent = &new_parent; // Break possible loops as soon as we see an inode number that we encountered before. static std::vector inodes(64); if (inodes.size() < (size_t)depth + 1) inodes.resize(inodes.size() * 2); for (int d = 1; d < depth; ++d) { if (inodes[d] == dir_entry.inode) { std::cout << "Detected loop for inode " << dir_entry.inode << " (" << idata.parent->dirname(commandline_show_path_inodes) << ").\n"; return; } } inodes[depth] = dir_entry.inode; ++depth; if (!deleted && allocated && !reallocated) // Existing directory? { InodePointer inoderef(get_inode(dir_entry.inode)); bool reused_or_corrupted_indirect_block3 = iterate_over_all_blocks_of(inoderef, dir_entry.inode, iterate_over_existing_directory_action, &idata); ASSERT(!reused_or_corrupted_indirect_block3); } else { // We only know the first block, but that is enough to construct the directory tree. int blocknr = dir_inode_to_block(dir_entry.inode); if (blocknr != -1) { // There could be loops if we linked the wrong directory to an inode. // In any case we have to break those loops. Try to be smart about it: // Find the dtime of the parent, or a parent of the parent. uint32_t dtime = 0; Parent* parent_iter = parent; while (!dtime) { if (!parent_iter) break; if (parent_iter->M_inode->has_valid_dtime()) dtime = parent_iter->M_inode->dtime(); parent_iter = parent_iter->M_parent; } // It turns out that a parent can be time-stamped as deleted before // it's subdirectories when using rm -rf (?). Allow for 60 seconds // of time difference. if (!dtime || !inode->has_valid_dtime() || dtime + 60 >= inode->dtime()) { // Now, before actually processing this new directory, check if the inode it contains for ".." is equal to the inode // of it's parent directory! idata.block_buf = new unsigned char [block_size_]; get_block(blocknr, idata.block_buf); ext3_dir_entry_2* dir_entry = reinterpret_cast(idata.block_buf); ASSERT(dir_entry->name_len == 1 && dir_entry->name[0] == '.'); dir_entry = reinterpret_cast(idata.block_buf + dir_entry->rec_len); ASSERT(dir_entry->name_len == 2 && dir_entry->name[0] == '.' && dir_entry->name[1] == '.'); if (dir_entry->inode == parent->M_inodenr) iterate_over_directory_action(blocknr, &idata); else std::cout << "The directory \"" << idata.parent->dirname(commandline_show_path_inodes) << "\" is lost.\n"; } } else std::cout << "Cannot find a directory block for inode " << dir_entry.inode << ".\n"; } --depth; } } } #ifdef CPPGRAPH void iterate_over_directory__with__init_directories_action(void) { (void)init_directories_action(*(ext3_dir_entry_2 const*)NULL, *(Inode const*)NULL, 0, 0, 0, 0, 0, 0, NULL, NULL); } #endif void iterate_over_directory_action(int blocknr, void* data) { iterate_data_st* idata = reinterpret_cast(data); iterate_over_directory(idata->block_buf, blocknr, idata->action, idata->parent, idata->data); } void iterate_over_existing_directory_action(int blocknr, int, void* data) { iterate_data_st* idata = reinterpret_cast(data); unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; get_block(blocknr, block_buf); iterate_over_directory(block_buf, blocknr, idata->action, idata->parent, idata->data); } void iterate_over_directory(unsigned char* block, int blocknr, bool (*action)(ext3_dir_entry_2 const&, Inode const&, bool, bool, bool, bool, bool, bool, Parent*, void*), Parent* parent, void* data) { ext3_dir_entry_2 const* dir_entry; ext3_dir_entry_2 const* map[EXT3_MAX_BLOCK_SIZE / EXT3_DIR_PAD]; std::memset(map, 0, sizeof(map)); if (action == read_block_action) ++no_filtering; int offset = 0; while (offset < block_size_) { dir_entry = reinterpret_cast(block + offset); filter_dir_entry(*dir_entry, false, true, action, parent, data); map[offset / EXT3_DIR_PAD] = dir_entry; offset += dir_entry->rec_len; } // Search for deleted entries. offset = block_size_ - EXT3_DIR_REC_LEN(1); while (offset > 0) { dir_entry = reinterpret_cast(block + offset); if (!map[offset / EXT3_DIR_PAD]) { DirectoryBlockStats stats; if (is_directory(block, blocknr, stats, false, false, offset)) filter_dir_entry(*dir_entry, true, false, action, parent, data); } offset -= EXT3_DIR_PAD; } if (action == read_block_action) --no_filtering; } bool DirEntry::exactly_equal(DirEntry const& de) const { ASSERT(index.cur == de.index.cur); return M_inode == de.M_inode && M_name == de.M_name && M_file_type == de.M_file_type && index.next == de.index.next; } bool DirectoryBlock::exactly_equal(DirectoryBlock const& dir) const { if (M_dir_entry.size() != dir.M_dir_entry.size()) return false; std::vector::const_iterator iter1 = M_dir_entry.begin(); std::vector::const_iterator iter2 = dir.M_dir_entry.begin(); for (;iter1 != M_dir_entry.end(); ++iter1, ++iter2) if (!iter1->exactly_equal(*iter2)) return false; return true; } bool read_block_action(ext3_dir_entry_2 const& dir_entry, Inode const& inode, bool deleted, bool allocated, bool reallocated, bool zero_inode, bool linked, bool filtered, Parent*, void* data) { std::list::iterator* iter_ptr = reinterpret_cast::iterator*>(data); DirectoryBlock* directory = &**iter_ptr; directory->read_dir_entry(dir_entry, inode, deleted, allocated, reallocated, zero_inode, linked, filtered, *iter_ptr); return false; } void DirectoryBlock::read_dir_entry(ext3_dir_entry_2 const& dir_entry, Inode const& UNUSED(inode), bool deleted, bool allocated, bool reallocated, bool zero_inode, bool linked, bool filtered, std::list::iterator iter) { DirEntry new_dir_entry; new_dir_entry.M_directory_iterator = iter; new_dir_entry.M_directory = NULL; new_dir_entry.M_file_type = dir_entry.file_type & 7; // Only the last 3 bits are used. new_dir_entry.M_inode = dir_entry.inode; new_dir_entry.M_name = std::string(dir_entry.name, dir_entry.name_len); new_dir_entry.dir_entry = &dir_entry; // This points directy into the block_buf that we are processing. // It will be replaced with the indices before that buffer is destroyed. new_dir_entry.deleted = deleted; new_dir_entry.allocated = allocated; new_dir_entry.reallocated = reallocated; new_dir_entry.zero_inode = zero_inode; new_dir_entry.linked = linked; new_dir_entry.filtered = filtered; M_dir_entry.push_back(new_dir_entry); } struct DirEntrySortPred { bool operator()(DirEntry const& de1, DirEntry const& de2) const { return de1.dir_entry < de2.dir_entry; } }; void DirectoryBlock::read_block(int block, std::list::iterator list_iter) { M_block = block; static bool using_static_buffer = false; ASSERT(!using_static_buffer); static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; get_block(block, block_buf); using_static_buffer = true; #ifdef CPPGRAPH // Let cppgraph know that we call read_block_action from here. iterate_over_directory__with__read_block_action(); #endif iterate_over_directory(block_buf, block, read_block_action, NULL, &list_iter); // Sort the vector by dir_entry pointer. std::sort(M_dir_entry.begin(), M_dir_entry.end(), DirEntrySortPred()); int size = M_dir_entry.size(); ASSERT(size > 0); // Every directory has at least one entry. // Make a temporary backup of the dir_entry pointers. // At the same time, overwrite the pointers in the vector with with the index. ext3_dir_entry_2 const** index_to_dir_entry = new ext3_dir_entry_2 const* [size]; int i = 0; for (std::vector::iterator iter = M_dir_entry.begin(); iter != M_dir_entry.end(); ++iter, ++i) { index_to_dir_entry[i] = iter->dir_entry; iter->index.cur = i; } // Assign a value to index.next, if any. for (std::vector::iterator iter = M_dir_entry.begin(); iter != M_dir_entry.end(); ++iter) { ext3_dir_entry_2 const* dir_entry = index_to_dir_entry[iter->index.cur]; ext3_dir_entry_2 const* next_dir_entry = (ext3_dir_entry_2 const*)(reinterpret_cast(dir_entry) + dir_entry->rec_len); int next = 0; for (int j = 0; j < size; ++j) if (index_to_dir_entry[j] == next_dir_entry) { next = j; break; } // Either this entry points to another that we found, or it should point to the end of this block. ASSERT(next > 0 || (unsigned char*)next_dir_entry == block_buf + block_size_); // If we didn't find anything, use the value 0. iter->index.next = next; } delete [] index_to_dir_entry; using_static_buffer = false; } ext3grep-0.10.1/src/is_blockdetection.cc0000644000175000017500000002761611121222102015031 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file is_blockdetection.cc Implementation of various is_* functions that detect the type of blocks. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include "debug.h" #endif #include "globals.h" #include "conversion.h" #include "load_meta_data.h" #include "is_blockdetection.h" #include "is_filename_char.h" #include "commandline.h" #include "accept.h" #include "forward_declarations.h" //----------------------------------------------------------------------------- // // Block type detection: is_* // bool is_inode(int block) { int group = block_to_group(super_block, block); if (block_bitmap[group] == NULL) load_meta_data(group); int inode_table = group_descriptor_table[group].bg_inode_table; return block >= inode_table && // The first block of the inode table. (size_t)block_size_ * (block + 1) <= (size_t)block_size_ * inode_table + inodes_per_group_ * inode_size_; // The first byte after the block/inode table. } // Only valid when is_inode returns true. // Returns the number of the first inode in the block. int block_to_inode(int block) { int group = block_to_group(super_block, block); ASSERT(block_bitmap[group]); int inode_table = group_descriptor_table[group].bg_inode_table; ASSERT(block >= inode_table && (size_t)block_size_ * (block + 1) <= (size_t)block_size_ * inode_table + inodes_per_group_ * inode_size_); return 1 + group * inodes_per_group_ + (size_t)block_size_ * (block - inode_table) / inode_size_; } // Convert inode number to block number. // Return the block number that contains the inode. int inode_to_block(ext3_super_block const& super_block, int inode) { int group = inode_to_group(super_block, inode); return group_descriptor_table[group].bg_inode_table + (size_t)(inode - 1 - group * inodes_per_group_) * inode_size_ / block_size_; } struct DelayedWarning { std::ostringstream* delayed_warning; DelayedWarning() : delayed_warning(NULL) { } ~DelayedWarning() { if (delayed_warning) delete delayed_warning; } void init(void) { if (!delayed_warning) delayed_warning = new std::ostringstream; } operator bool(void) const { return delayed_warning; } std::string str(void) const { ASSERT(delayed_warning); return delayed_warning->str(); } std::ostream& stream(void) { init(); return *delayed_warning; } }; // Print string, escaping non ASCII characters. void print_buf_to(std::ostream& os, char const* buf, int len) { for (int i = 0; i < len; ++i) { __s8 c = buf[i]; if (c > 31 && c != 92 && c != 127) // Only print pure ASCII (and therefore UTF8) characters. os.put(c); else { static char const c2s_tab[7] = { 'a', 'b', 't', 'n', 'v', 'f', 'r' }; os.put('\\'); if (c > 6 && c < 14) { os.put(c2s_tab[c - 7]); return; } else if (c == '\e') { os.put('e'); return; } else if (c == '\\') { os.put('\\'); return; } short old_fill = os.fill('0'); std::ios_base::fmtflags old_flgs = os.flags(); os.width(3); os << std::oct << (int)((unsigned char)c); os.setf(old_flgs); os.fill(old_fill); } } } // Return true if this block looks like it contains a directory. is_directory_type is_directory(unsigned char* block, int blocknr, DirectoryBlockStats& stats, bool start_block, bool certainly_linked, int offset) { ASSERT(!start_block || offset == 0); // Must be aligned to 4 bytes. if ((offset & EXT3_DIR_ROUND)) return isdir_no; // A minimal ext3_dir_entry_2 must fit. if (offset + EXT3_DIR_REC_LEN(1) > block_size_) return isdir_no; ext3_dir_entry_2* dir_entry = reinterpret_cast(block + offset); // The first block has the "." and ".." directories at the start. bool is_start = false; if (offset == 0) { ext3_dir_entry_2* parent_dir_entry = reinterpret_cast(block + EXT3_DIR_REC_LEN(1)); is_start = (dir_entry->name_len == 1 && dir_entry->name[0] == '.' && dir_entry->rec_len == EXT3_DIR_REC_LEN(1) && (!feature_incompat_filetype || dir_entry->file_type == EXT3_FT_DIR) && parent_dir_entry->name_len == 2 && parent_dir_entry->name[0] == '.' && parent_dir_entry->name[1] == '.' && (!feature_incompat_filetype || parent_dir_entry->file_type == EXT3_FT_DIR)); } if (start_block) { // If a start block is requested, return isdir_no when it is NOT isdir_start, // even though it might still really be isdir_extended, in order to speed // up the test. if (!is_start) return isdir_no; } // The inode is not overwritten when a directory is deleted (except // for the first inode of an extended directory block). // So even for deleted directories we can check the inode range. DelayedWarning delayed_warning; if (dir_entry->inode == 0 && dir_entry->name_len > 0) { // If the inode is zero and the filename makes no sense, reject the directory. bool non_ascii = false; for (int c = 0; c < dir_entry->name_len; ++c) { filename_char_type result = is_filename_char(dir_entry->name[c]); if (result == fnct_illegal) return isdir_no; if (result == fnct_non_ascii) non_ascii = true; } // If the inode is zero, but the filename makes sense, print a warning // only when the inode really wasn't expected to be zero. Do not reject // the directory though. if (certainly_linked && (offset != 0 || start_block) && (blocknr != 4745500 && blocknr != 6546132 && blocknr != 6549681 && blocknr != 6550057 && blocknr != 6582345 && blocknr != 6582333 && blocknr != 6583272)) { delayed_warning.stream() << "WARNING: zero inode (name: "; if (non_ascii) delayed_warning.stream() << "*contains non-ASCII characters* "; delayed_warning.stream() << "\""; print_buf_to(delayed_warning.stream(), dir_entry->name, dir_entry->name_len); delayed_warning.stream() << "\"; block: " << blocknr << "; offset 0x" << std::hex << offset << std::dec << ")\n"; } } if (dir_entry->inode > inode_count_) return isdir_no; // Inode out of range. // File names are at least 1 character long. if (dir_entry->name_len == 0) return isdir_no; // The record length must make sense. if ((dir_entry->rec_len & EXT3_DIR_ROUND) || dir_entry->rec_len < EXT3_DIR_REC_LEN(dir_entry->name_len) || offset + dir_entry->rec_len > block_size_) return isdir_no; // Add some extra paranoia in the case that the whole block appears to exist of a single direntry (for an extended block). if (dir_entry->rec_len == block_size_ && ((feature_incompat_filetype && dir_entry->file_type == EXT3_FT_UNKNOWN) || dir_entry->file_type >= EXT3_FT_MAX || dir_entry->name_len == 1 || (dir_entry->name[0] == '_' && dir_entry->name[1] == 'Z'))) // Symbol table entry? return isdir_no; // The record length must point to the end of the block or chain to it. offset += dir_entry->rec_len; // NOT USED; int previous_number_of_entries = stats.number_of_entries(); if (offset != block_size_ && is_directory(block, blocknr, stats, false, certainly_linked, offset) == isdir_no) return isdir_no; // The file name may only exist of certain characters. bool illegal = false; bool ok = true; int number_of_weird_characters = 0; for (int c = 0; c < dir_entry->name_len; ++c) { filename_char_type fnct = is_filename_char(dir_entry->name[c]); if (fnct != fnct_ok) { if (fnct == fnct_illegal) { ok = false; illegal = true; break; } ++number_of_weird_characters; stats.increment_unlikely_character_count(dir_entry->name[c]); } } // If the user asks for a specific block, don't suppress anything. if (commandline_block != -1) number_of_weird_characters = 0; #if 1 // Accept everything at this point, except filenames existing of a single unlikely character. // If --accept-all is given, accept even those. if (!commandline_accept_all && dir_entry->name_len == 1 && number_of_weird_characters > 0) ok = false; #else // Setting ok to false means we reject this entry. Also setting illegal will reject it silently. // The larger the number of previous entries, the larger the chance that this is really a good dir entry. // Therefore, accept weird characters to a certain extend. if (number_of_weird_characters > previous_number_of_entries || number_of_weird_characters > dir_entry->name_len / 2) ok = false; // If a filenames exists of exclusively weird characters (most notably filenames of length 1), don't believe this can be a real entry. if (!illegal && number_of_weird_characters == dir_entry->name_len) { if (dir_entry->name_len > 1) { // But you never know, so let the user know about it. std::cout << "Note: Rejecting '"; print_buf_to(std::cout, dir_entry->name, dir_entry->name_len); std::cout << "' as possibly legal filename.\n"; } illegal = true; ok = false; } #endif if (ok && delayed_warning) { std::cout << std::flush; std::cerr << delayed_warning.str(); std::cerr << std::flush; } if (!ok && !illegal) { std::ostringstream escaped_name; print_buf_to(escaped_name, dir_entry->name, dir_entry->name_len); Accept const accept(escaped_name.str(), false); std::set::iterator accept_iter = accepted_filenames.find(accept); if (accept_iter != accepted_filenames.end()) ok = accept_iter->accepted(); else { // Add this entry to avoid us printing this again. accepted_filenames.insert(accept); std::cout << std::flush; if (certainly_linked) std::cerr << "\nWARNING: Rejecting possible directory (block " << blocknr << ") because an entry contains legal but unlikely characters.\n"; else // Aparently we're looking for deleted entries. std::cerr << "\nWARNING: Rejecting a dir_entry (block " << blocknr << ") because it contains legal but unlikely characters.\n"; std::cerr << " Use --ls --block " << blocknr << " to examine this possible directory block.\n"; std::cerr << " If it looks like a directory to you, and '" << escaped_name.str() << "'\n"; std::cerr << " looks like a filename that might belong in that directory, then add\n"; std::cerr << " --accept='" << escaped_name.str() << "' as commandline parameter AND remove both stage* files!" << std::endl; } } if (ok) stats.increment_number_of_entries(); return ok ? (is_start ? isdir_start : isdir_extended) : isdir_no; } // Returns true if the block is inside an inode table, // or part of the journal, containing inodes. int is_inode_block(int block) { if (is_inode(block)) return block; if (!is_journal(block) || is_indirect_block_in_journal(block)) return 0; return journal_block_contains_inodes(block); } bool is_allocated(int inode) { int group = (inode - 1) / inodes_per_group_; if (!block_bitmap[group]) load_meta_data(group); unsigned int bit = inode - 1 - group * inodes_per_group_; ASSERT(bit < 8U * block_size_); bitmap_ptr bmp = get_bitmap_mask(bit); return (inode_bitmap[group][bmp.index] & bmp.mask); } ext3grep-0.10.1/src/print_symlink.cc0000644000175000017500000000404511031744166014261 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file print_symlink.cc Definition of the function print_symlink. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include "ext3.h" #include "debug.h" #endif #include "endian_conversion.h" #include "get_block.h" #include "print_symlink.h" int print_symlink(std::ostream& os, Inode const& inode) { uint32_t len = 0; if (inode.blocks() == 0) { if (inode.size() == 0) { std::cout << ""; return 0; } for (int i = 0; i < EXT3_N_BLOCKS; ++i) { union { char chars[4]; __le32 block; } translate; translate.block = inode.block()[i]; for (int j = 0; j < 4; ++j) { char c = translate.chars[j]; ASSERT(c != 0); os << c; if (++len == inode.size()) return len; } } } else { ASSERT(inode.block()[0]); ASSERT(!inode.block()[1]); // Name can't be longer than block_size_?! unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; unsigned char* block = get_block(inode.block()[0], block_buf); ASSERT(block[block_size_ - 1] == '\0'); // Zero termination exists. len = strlen((char*)block); os << block; } return len; } ext3grep-0.10.1/src/load_meta_data.h0000644000175000017500000000213311031754654014136 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file load_meta_data.h Declaration of function load_meta_data. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef LOAD_META_DATA_H #define LOAD_META_DATA_H void load_meta_data(int group); #endif // LOAD_META_DATA_H ext3grep-0.10.1/src/show_hardlinks.cc0000644000175000017500000001152711031745650014400 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file show_hardlinks.cc Implementation of --show-hardlinks. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include #include #include #include #include "debug.h" #endif #include "forward_declarations.h" #include "init_files.h" #include "init_directories.h" void show_hardlinks(void) { DoutEntering(dc::notice, "show_hardlinks()"); init_files(); #if 0 // I added this loop with a plan... but I forgot what it was. for (all_directories_type::iterator iter = all_directories.begin(); iter != all_directories.end(); ++iter) { } #endif typedef std::map > inodes_type; inodes_type inodes; for (path_to_inode_map_type::iterator iter = path_to_inode_map.begin(); iter != path_to_inode_map.end(); ++iter) { struct stat statbuf; if (lstat(iter->first.c_str(), &statbuf) == -1) { int error = errno; if (error != ENOENT) { std::cout << std::flush; std::cerr << "WARNING: lstat: " << iter->first << ": " << strerror(error) << std::endl; } } else if (!S_ISDIR(statbuf.st_mode)) { std::pair res = inodes.insert(inodes_type::value_type(iter->second, std::vector())); res.first->second.push_back(iter); } else { std::cout << std::flush; std::cerr << "WARNING: lstat: " << iter->first << ": is a directory" << std::endl; } } for (inodes_type::iterator iter = inodes.begin(); iter != inodes.end(); ++iter) { if (iter->second.size() > 1) { std::cout << "Inode " << iter->first << ":\n"; for (std::vector::iterator iter3 = iter->second.begin(); iter3 != iter->second.end(); ++iter3) { std::string::size_type slash = (*iter3)->first.find_last_of('/'); ASSERT(slash != std::string::npos); std::string dirname = (*iter3)->first.substr(0, slash); all_directories_type::iterator iter5 = all_directories.find(dirname); ASSERT(iter5 != all_directories.end()); std::cout << " " << (*iter3)->first << " (" << iter5->second.inode_number() << ")\n"; } #if 0 // Try to figure out which directory it belongs to. inode_to_dir_entry_type::iterator iter2 = inode_to_dir_entry.find(iter->first); ASSERT(iter2 != inode_to_dir_entry.end()); Inode inode; int sequence; get_undeleted_inode_type res = get_undeleted_inode(iter->first, inode, &sequence); if (res == ui_no_inode) { std::cout << "ok: no inode\n"; } else if (res == ui_inode_too_old) { std::cout << "ok: inode too old\n"; } else if (res == ui_real_inode) { for (std::vector::iterator>::iterator iter4 = iter2->second.begin(); iter4 != iter2->second.end(); ++iter4) { DirEntry& dir_entry(**iter4); int dirblocknr = dir_entry.M_directory_iterator->block(); int group = block_to_group(super_block, dirblocknr);; unsigned int bit = dirblocknr - first_data_block(super_block) - group * blocks_per_group(super_block); ASSERT(bit < 8U * block_size_); bitmap_ptr bmp = get_bitmap_mask(bit); ASSERT(block_bitmap[group]); bool allocated = (block_bitmap[group][bmp.index] & bmp.mask); if (allocated) std::cout << "ok: " << dir_entry.M_directory->inode_number() << '/' << dir_entry.M_name << '\n'; } } else if (res == ui_journal_inode) { Transaction& transaction(sequence_transaction_map.find(sequence)->second); for (std::vector::iterator>::iterator iter4 = iter2->second.begin(); iter4 != iter2->second.end(); ++iter4) { DirEntry& dir_entry(**iter4); int dirblocknr = dir_entry.M_directory_iterator->block(); if (transaction.contains_tag_for_block(dirblocknr)) std::cout << "ok: " << dir_entry.M_directory->inode_number() << '/' << dir_entry.M_name << '\n'; } } #endif } } } ext3grep-0.10.1/src/restore.cc0000644000175000017500000002325111076400456013042 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file restore.cc Implementation of --restore-inode and --restore-file. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include #include #include #include #include "ext3.h" #endif #include "inode.h" #include "journal.h" #include "commandline.h" #include "get_block.h" #include "forward_declarations.h" #include "init_files.h" #include "init_directories.h" #include "restore.h" #include "utils.h" #include "FileMode.h" #include "indirect_blocks.h" #include "print_symlink.h" #ifdef CPPGRAPH void iterate_over_all_blocks_of__with__restore_file_action(void) { restore_file_action(0, 0, NULL); } #endif get_undeleted_inode_type get_undeleted_inode(int inodenr, Inode& inode, int* sequence) { InodePointer real_inode(get_inode(inodenr)); if (!real_inode->is_deleted()) { inode = *real_inode; return ui_real_inode; } std::vector > inodes; get_inodes_from_journal(inodenr, inodes); for (std::vector >::iterator iter = inodes.begin(); iter != inodes.end(); ++iter) { Inode const& journal_inode(iter->second); if (!journal_inode.is_deleted()) { inode = journal_inode; if (sequence) *sequence = iter->first; return ui_journal_inode; } else if (commandline_after && (time_t)journal_inode.dtime() < commandline_after) return ui_inode_too_old; } return ui_no_inode; } extern "C" int lutimes (char const*, struct timeval const [2]); struct Data { int out; off_t remaining_size; int expected_file_block_nr; Data(int out_, off_t remaining_size_) : out(out_), remaining_size(remaining_size_), expected_file_block_nr(0) { } }; void restore_file_action(int blocknr, int file_block_nr, void* ptr) { Data& data(*reinterpret_cast(ptr)); static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; int len; if (data.expected_file_block_nr != file_block_nr) { ASSERT(data.expected_file_block_nr != -1); // It's set to -1 below when we reached the end of the file. off64_t pos = ((off64_t) file_block_nr) * block_size_; if (lseek64(data.out, pos, SEEK_SET) == (off_t) -1) { int error = errno; std::cout << std::flush; std::cerr << progname << "restore_file_action: could not lseek64 to position " << pos << ": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } data.expected_file_block_nr = file_block_nr; } get_block(blocknr, block_buf); if (data.remaining_size > block_size_) { len = block_size_; data.expected_file_block_nr += block_size_; } else { len = data.remaining_size; data.expected_file_block_nr = -1; // This was the last block. } int res = ::write(data.out, (char const*)block_buf, len); ASSERT(res == len); data.remaining_size -= len; } void restore_file(std::string const& outfile) { ASSERT(!outfile.empty()); ASSERT(outfile[0] != '/'); init_files(); int inodenr; path_to_inode_map_type::iterator inode_iter = path_to_inode_map.find(outfile); if (inode_iter != path_to_inode_map.end()) inodenr = inode_iter->second; else { all_directories_type::iterator directory_iter = all_directories.find(outfile); if (directory_iter == all_directories.end()) { std::cout << "Cannot find an inode number for file \"" << outfile << "\".\n"; return; } inodenr = directory_iter->second.inode_number(); } InodePointer real_inode = get_inode(inodenr); std::string::size_type slash = outfile.find_last_of('/'); if (slash != std::string::npos) { std::string dirname = outfile.substr(0, slash); struct stat statbuf; if (lstat((outputdir + dirname).c_str(), &statbuf) == -1) { int error = errno; if (error != ENOENT) { std::cout << std::flush; std::cerr << "WARNING: lstat: " << (outputdir + dirname) << ": " << strerror(error) << std::endl; std::cout << "Failed to recover " << outfile << '\n'; return; } else restore_file(dirname); } else if (!S_ISDIR(statbuf.st_mode)) { std::cout << std::flush; std::cerr << progname << ": failed to recover " << outfile << ": " << (outputdir + dirname) << " exists but is not a directory!" << std::endl; exit(EXIT_FAILURE); } } restore_inode(inodenr, real_inode, outfile); } void restore_inode(int inodenr, InodePointer real_inode, std::string const& outfile) { std::string outputdir_outfile = outputdir + outfile; if (is_directory(*real_inode)) { mode_t mode = inode_mode_to_mkdir_mode(real_inode->mode()); if ((mode & (S_IWUSR|S_IXUSR)) != (S_IWUSR|S_IXUSR)) std::cout << "Note: Restoring directory " << outputdir_outfile << " with mode " << FileMode(real_inode->mode() | 0500) << " although it's original mode is " << FileMode(real_inode->mode()) << ".\n"; if (mkdir(outputdir_outfile.c_str(), mode|S_IWUSR|S_IXUSR) == -1 && errno != EEXIST) { int error = errno; std::cout << std::flush; std::cerr << progname << ": could not create directory " << outputdir_outfile << ": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } if (chmod(outputdir_outfile.c_str(), mode) == -1) { int error = errno; std::cout << "WARNING: failed to set mode on directory " << outputdir_outfile << std::endl; std::cerr << progname << ": chmod: " << strerror(error) << std::endl; } struct utimbuf ub; ub.actime = real_inode->atime(); ub.modtime = real_inode->mtime(); if (utime(outputdir_outfile.c_str(), &ub) == -1) { int error = errno; std::cout << "WARNING: Failed to set access and modification time on " << outputdir_outfile << ": " << strerror(error) << '\n'; } } else { Inode inode; get_undeleted_inode_type res = get_undeleted_inode(inodenr, inode); if (res != ui_real_inode && res != ui_journal_inode) { if (res == ui_no_inode) std::cout << "Cannot find an undeleted inode for file \"" << outfile << "\".\n"; else std::cout << "Not undeleting \"" << outfile << "\" because it was deleted before " << commandline_after << " (" << inode.ctime() << ")\n"; return; } ASSERT(!inode.is_deleted()); if (is_regular_file(inode)) { int out; out = ::open(outputdir_outfile.c_str(), O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0777); if (out == -1) { std::cout << "Failed to open \"" << outputdir_outfile << "\".\n"; return; } Data data(out, inode.size()); std::cout << "Restoring " << outfile << '\n'; #ifdef CPPGRAPH // Tell cppgraph that we call restore_file_action from here. iterate_over_all_blocks_of__with__restore_file_action(); #endif bool reused_or_corrupted_indirect_block8 = iterate_over_all_blocks_of(inode, inodenr, restore_file_action, &data); ::close(out); if (reused_or_corrupted_indirect_block8) { std::cout << "WARNING: Failed to restore " << outfile << ": encountered a reused or corrupted (double/triple) indirect block!\n"; std::cout << "Running iterate_over_all_blocks_of again with diagnostic messages ON:\n"; iterate_over_all_blocks_of(inode, inodenr, restore_file_action, &data, direct_bit, true); // FIXME: file should be renamed. } if (chmod(outputdir_outfile.c_str(), inode_mode_to_mkdir_mode(inode.mode())) == -1) { int error = errno; std::cout << "WARNING: failed to set file mode on " << outputdir_outfile << std::endl; std::cerr << progname << ": chmod: " << strerror(error) << std::endl; } struct utimbuf ub; ub.actime = inode.atime(); ub.modtime = inode.mtime(); if (utime(outputdir_outfile.c_str(), &ub) == -1) { int error = errno; std::cout << "WARNING: Failed to set access and modification time on " << outputdir_outfile << ": " << strerror(error) << '\n'; return; } } else if (is_symlink(inode)) { std::ostringstream symlink_name; int len = print_symlink(symlink_name, inode); if (len == 0) { std::cout << "WARNING: Failed to recover " << outfile << ": symlink has zero length!\n"; return; } else { if (symlink(symlink_name.str().c_str(), outputdir_outfile.c_str()) == -1) { int error = errno; std::cout << "WARNING: symlink: " << outputdir_outfile << ": " << strerror(error) << '\n'; return; } struct timeval tvp[2]; tvp[0].tv_sec = inode.atime(); tvp[0].tv_usec = 0; tvp[1].tv_sec = inode.mtime(); tvp[1].tv_usec = 0; if (lutimes(outputdir_outfile.c_str(), tvp) == -1) { int error = errno; std::cout << "WARNING: Failed to set access and modification time on " << outputdir_outfile << ": " << strerror(error) << '\n'; return; } } } else { std::cout << "WARNING: Not recovering \"" << outfile << "\", which is a " << mode_str(inode.mode()) << '\n'; return; } } } ext3grep-0.10.1/src/print_directory.cc0000644000175000017500000000743411031577345014607 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file print_directory.cc Implementation of the function print_directory. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #endif #include "directories.h" #include "globals.h" #include "utils.h" #include "inode.h" #include "FileMode.h" #include "print_symlink.h" #include "forward_declarations.h" #include "commandline.h" #include "print_dir_entry_long_action.h" //----------------------------------------------------------------------------- // // Directory printing // void DirEntry::print(void) const { if (filtered) return; std::cout << std::setfill(' ') << std::setw(4) << index.cur << ' '; if (index.next) std::cout << std::setfill(' ') << std::setw(4) << index.next << ' '; else std::cout << " end "; if (feature_incompat_filetype) std::cout << dir_entry_file_type(M_file_type, true); else std::cout << '-'; std::cout << std::setfill(' ') << std::setw(8) << M_inode << " "; std::cout << (zero_inode ? 'Z' : deleted ? reallocated ? 'R' : 'D' : ' '); InodePointer inode; if (!zero_inode) { inode = get_inode(M_inode); if (deleted && !reallocated) { time_t dtime = inode->dtime(); std::string dtime_str(ctime(&dtime)); std::cout << ' ' << std::setw(10) << dtime << ' ' << dtime_str.substr(0, dtime_str.length() - 1); } } if (zero_inode && linked) std::cout << " * LINKED ENTRY WITH ZERO INODE * "; else if (zero_inode || !deleted || reallocated) std::cout << std::string(36, ' '); if (zero_inode || reallocated) std::cout << " ??????????"; else std::cout << " " << FileMode(inode->mode()); std::cout << " " << M_name; if (!(reallocated || zero_inode) && is_symlink(inode)) { std::cout << " -> "; print_symlink(std::cout, inode); } std::cout << '\n'; } void DirectoryBlock::print(void) const { for (std::vector::const_iterator iter = M_dir_entry.begin(); iter != M_dir_entry.end(); ++iter) iter->print(); } void print_directory(unsigned char* block, int blocknr) { depth = 1; if (commandline_ls) { if (feature_incompat_filetype) std::cout << " .-- File type in dir_entry (r=regular file, d=directory, l=symlink)\n"; std::cout << " | .-- D: Deleted ; R: Reallocated\n"; std::cout << "Indx Next | Inode | Deletion time Mode File name\n"; std::cout << "==========+==========+----------------data-from-inode------+-----------+=========\n"; std::list db(1); db.begin()->read_block(blocknr, db.begin()); db.begin()->print(); std::cout << '\n'; } else { #ifdef CPPGRAPH // Let cppgraph know that we call print_dir_entry_long_action from here. iterate_over_directory__with__print_dir_entry_long_action(); #endif ++no_filtering; iterate_over_directory(block, blocknr, print_dir_entry_long_action, NULL, NULL); --no_filtering; } } ext3grep-0.10.1/src/print_inode_to.h0000644000175000017500000000264111031755005014227 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file print_inode_to.h Declaration of function print_inode_to. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef PRINT_INODE_TO_H #define PRINT_INODE_TO_H #ifndef USE_PCH #include #endif #include "inode.h" void print_inode_to(std::ostream& os, Inode const& inode); inline void print_inode_to(std::ostream& os, InodePointer inoderef) { // We can dereference inoderef here because it is known that print_inode_to does not keep a pointer or reference to the inode. print_inode_to(os, *inoderef); } #endif // PRINT_INODE_TO_H ext3grep-0.10.1/src/globals.cc0000644000175000017500000000407211031442060012766 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file globals.cc Definitions of the global variables used in the application. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include "ext3.h" #endif #include "bitmap.h" // The superblock. ext3_super_block super_block; // Frequently used constant values from the superblock. int groups_; int block_size_; int block_size_log_; int inodes_per_group_; int inode_size_; uint32_t inode_count_; uint32_t block_count_; // The journal super block. journal_superblock_t journal_super_block; // Frequently used constant values from the journal superblock. int journal_block_size_; int journal_maxlen_; int journal_first_; int journal_sequence_; int journal_start_; Inode journal_inode; // Globally used variables. char const* progname; std::ifstream device; #if USE_MMAP int device_fd; long page_size_; void** all_mmaps; int* refs_to_mmap; int nr_mmaps; #endif char* reserved_memory; Inode const** all_inodes; bitmap_t** block_bitmap; bitmap_t** inode_bitmap; char* inodes_buf; ext3_group_desc* group_descriptor_table; int no_filtering = 0; std::string device_name; bool feature_incompat_filetype = false; uint32_t wrapped_journal_sequence = 0; ext3grep-0.10.1/src/Makefile.in0000644000175000017500000030350211121223215013100 00000000000000# Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = ext3grep$(EXEEXT) @USE_DEBUG_TRUE@am__append_1 = backtrace.cc backtrace.h debug.cc \ @USE_DEBUG_TRUE@ debug.h @USE_DEBUG_TRUE@am__append_2 = -rdynamic @USE_CWDEBUG_TRUE@@USE_DEBUG_FALSE@am__append_3 = debug.cc debug.h @USE_PCH_TRUE@am__append_4 = @PCHFLAGS@ @USE_PCH_TRUE@am__append_5 = pch.h.gch/$(APPLICATIONSUM) @USE_SVN_TRUE@am__append_6 = revision.cc @MAINTAINER_MODE_TRUE@@USE_DEBUG_FALSE@am__append_7 = backtrace.cc backtrace.h @MAINTAINER_MODE_TRUE@@USE_CWDEBUG_FALSE@am__append_8 = debug.cc debug.h subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/sys.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = timestamp-sys.h am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am__ext3grep_SOURCES_DIST = custom.cc accept.cc blocknr_vector_type.cc \ commandline.cc directories.cc dir_inode_to_block.cc \ dump_hex_to.cc dump_names.cc init_journal_consts.cc \ get_block.cc globals.cc histogram.cc indirect_blocks.cc \ init_consts.cc init_directories.cc init_files.cc inode.cc \ inode_refers_to.cc is_blockdetection.cc journal.cc \ last_undeleted_directory_inode_refering_to_block.cc \ load_meta_data.cc ostream_operators.cc Parent.cc \ print_directory.cc print_directory_inode.cc \ print_dir_entry_long_action.cc printing.cc print_inode_to.cc \ print_symlink.cc restore.h restore.cc show_hardlinks.cc \ show_journal_inodes.cc utils.cc ext3grep.cc locate.cc locate.h \ ext3.h Parent.h forward_declarations.h histogram.h \ indirect_blocks.h init_directories.h utils.h \ dir_inode_to_block.h is_filename_char.h superblock.h \ directories.h is_blockdetection.h conversion.h commandline.h \ inode.h ostream_operators.h print_inode_to.h bitmap.h \ load_meta_data.h FileMode.h accept.h endian_conversion.h \ inode_refers_to.h journal.h init_files.h init_journal_consts.h \ print_dir_entry_long_action.h get_block.h init_consts.h \ print_symlink.h blocknr_vector_type.h globals.h kernel-jbd.h \ jfs_compat.h backtrace.cc backtrace.h debug.cc debug.h \ revision.cc @USE_DEBUG_TRUE@am__objects_1 = ext3grep-backtrace.$(OBJEXT) \ @USE_DEBUG_TRUE@ ext3grep-debug.$(OBJEXT) @USE_CWDEBUG_TRUE@@USE_DEBUG_FALSE@am__objects_2 = \ @USE_CWDEBUG_TRUE@@USE_DEBUG_FALSE@ ext3grep-debug.$(OBJEXT) @USE_SVN_TRUE@am__objects_3 = ext3grep-revision.$(OBJEXT) am_ext3grep_OBJECTS = ext3grep-custom.$(OBJEXT) \ ext3grep-accept.$(OBJEXT) \ ext3grep-blocknr_vector_type.$(OBJEXT) \ ext3grep-commandline.$(OBJEXT) ext3grep-directories.$(OBJEXT) \ ext3grep-dir_inode_to_block.$(OBJEXT) \ ext3grep-dump_hex_to.$(OBJEXT) ext3grep-dump_names.$(OBJEXT) \ ext3grep-init_journal_consts.$(OBJEXT) \ ext3grep-get_block.$(OBJEXT) ext3grep-globals.$(OBJEXT) \ ext3grep-histogram.$(OBJEXT) \ ext3grep-indirect_blocks.$(OBJEXT) \ ext3grep-init_consts.$(OBJEXT) \ ext3grep-init_directories.$(OBJEXT) \ ext3grep-init_files.$(OBJEXT) ext3grep-inode.$(OBJEXT) \ ext3grep-inode_refers_to.$(OBJEXT) \ ext3grep-is_blockdetection.$(OBJEXT) \ ext3grep-journal.$(OBJEXT) \ ext3grep-last_undeleted_directory_inode_refering_to_block.$(OBJEXT) \ ext3grep-load_meta_data.$(OBJEXT) \ ext3grep-ostream_operators.$(OBJEXT) ext3grep-Parent.$(OBJEXT) \ ext3grep-print_directory.$(OBJEXT) \ ext3grep-print_directory_inode.$(OBJEXT) \ ext3grep-print_dir_entry_long_action.$(OBJEXT) \ ext3grep-printing.$(OBJEXT) ext3grep-print_inode_to.$(OBJEXT) \ ext3grep-print_symlink.$(OBJEXT) ext3grep-restore.$(OBJEXT) \ ext3grep-show_hardlinks.$(OBJEXT) \ ext3grep-show_journal_inodes.$(OBJEXT) \ ext3grep-utils.$(OBJEXT) ext3grep-ext3grep.$(OBJEXT) \ ext3grep-locate.$(OBJEXT) $(am__objects_1) $(am__objects_2) \ $(am__objects_3) ext3grep_OBJECTS = $(am_ext3grep_OBJECTS) ext3grep_DEPENDENCIES = ext3grep_LINK = $(CXXLD) $(ext3grep_CXXFLAGS) $(CXXFLAGS) \ $(ext3grep_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(ext3grep_SOURCES) DIST_SOURCES = $(am__ext3grep_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ACLOCAL_CWFLAGS = @ACLOCAL_CWFLAGS@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FINGER_PRINT = @CC_FINGER_PRINT@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWD_FLAGS = @CWD_FLAGS@ CWD_LIBS = @CWD_LIBS@ CWD_R_FLAGS = @CWD_R_FLAGS@ CWD_R_LIBS = @CWD_R_LIBS@ CW_DEBUG_FLAGS = @CW_DEBUG_FLAGS@ CW_OPTIMISE_FLAGS = @CW_OPTIMISE_FLAGS@ CW_STRIPPED_CXXFLAGS = @CW_STRIPPED_CXXFLAGS@ CW_WARNING_FLAGS = @CW_WARNING_FLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXCPP_FINGER_PRINT = @CXXCPP_FINGER_PRINT@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = CXXFLAGS_FINGER_PRINT = @CXXFLAGS_FINGER_PRINT@ CXX_FINGER_PRINT = @CXX_FINGER_PRINT@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DOXYGEN_CWDEBUG = @DOXYGEN_CWDEBUG@ DOXYGEN_DEBUG = @DOXYGEN_DEBUG@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ Makefilein = @Makefilein@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCHFLAGS = @PCHFLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_LIBCWD = @USE_LIBCWD@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = pch-source.h $(am__append_7) $(am__append_8) BUILT_SOURCES = $(am__append_5) ext3grep_SOURCES = custom.cc accept.cc blocknr_vector_type.cc \ commandline.cc directories.cc dir_inode_to_block.cc \ dump_hex_to.cc dump_names.cc init_journal_consts.cc \ get_block.cc globals.cc histogram.cc indirect_blocks.cc \ init_consts.cc init_directories.cc init_files.cc inode.cc \ inode_refers_to.cc is_blockdetection.cc journal.cc \ last_undeleted_directory_inode_refering_to_block.cc \ load_meta_data.cc ostream_operators.cc Parent.cc \ print_directory.cc print_directory_inode.cc \ print_dir_entry_long_action.cc printing.cc print_inode_to.cc \ print_symlink.cc restore.h restore.cc show_hardlinks.cc \ show_journal_inodes.cc utils.cc ext3grep.cc locate.cc locate.h \ ext3.h Parent.h forward_declarations.h histogram.h \ indirect_blocks.h init_directories.h utils.h \ dir_inode_to_block.h is_filename_char.h superblock.h \ directories.h is_blockdetection.h conversion.h commandline.h \ inode.h ostream_operators.h print_inode_to.h bitmap.h \ load_meta_data.h FileMode.h accept.h endian_conversion.h \ inode_refers_to.h journal.h init_files.h init_journal_consts.h \ print_dir_entry_long_action.h get_block.h init_consts.h \ print_symlink.h blocknr_vector_type.h restore.h globals.h \ kernel-jbd.h jfs_compat.h $(am__append_1) $(am__append_3) \ $(am__append_6) ext3grep_CXXFLAGS = @CXXFLAGS@ @CWD_FLAGS@ $(am__append_4) ext3grep_LDADD = @LIBS@ @CWD_LIBS@ ext3grep_LDFLAGS = $(am__append_2) @USE_PCH_TRUE@@Makefilein@PREVCXXDEPMODE := $(CXXDEPMODE) @USE_PCH_TRUE@@Makefilein@CXXDEPMODE = $(PREVCXXDEPMODE) havepch=yes @USE_PCH_TRUE@APPLICATIONSUM := $(shell echo "$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS)" | md5sum | sed -e 's/ .*//') MAINTAINERCLEANFILES = $(srcdir)/Makefile.in tags troep* *.cgd all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .cc .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh timestamp-sys.h: $(top_builddir)/config.status $(srcdir)/sys.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) ext3grep$(EXEEXT): $(ext3grep_OBJECTS) $(ext3grep_DEPENDENCIES) @rm -f ext3grep$(EXEEXT) $(ext3grep_LINK) $(ext3grep_OBJECTS) $(ext3grep_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-Parent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-accept.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-backtrace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-blocknr_vector_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-commandline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-custom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-dir_inode_to_block.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-directories.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-dump_hex_to.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-dump_names.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-ext3grep.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-get_block.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-globals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-histogram.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-indirect_blocks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-init_consts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-init_directories.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-init_files.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-init_journal_consts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-inode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-inode_refers_to.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-is_blockdetection.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-journal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-last_undeleted_directory_inode_refering_to_block.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-load_meta_data.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-locate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-ostream_operators.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-print_dir_entry_long_action.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-print_directory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-print_directory_inode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-print_inode_to.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-print_symlink.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-printing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-restore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-revision.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-show_hardlinks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-show_journal_inodes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext3grep-utils.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ext3grep-custom.o: custom.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-custom.o -MD -MP -MF $(DEPDIR)/ext3grep-custom.Tpo -c -o ext3grep-custom.o `test -f 'custom.cc' || echo '$(srcdir)/'`custom.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-custom.Tpo $(DEPDIR)/ext3grep-custom.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='custom.cc' object='ext3grep-custom.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-custom.o `test -f 'custom.cc' || echo '$(srcdir)/'`custom.cc ext3grep-custom.obj: custom.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-custom.obj -MD -MP -MF $(DEPDIR)/ext3grep-custom.Tpo -c -o ext3grep-custom.obj `if test -f 'custom.cc'; then $(CYGPATH_W) 'custom.cc'; else $(CYGPATH_W) '$(srcdir)/custom.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-custom.Tpo $(DEPDIR)/ext3grep-custom.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='custom.cc' object='ext3grep-custom.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-custom.obj `if test -f 'custom.cc'; then $(CYGPATH_W) 'custom.cc'; else $(CYGPATH_W) '$(srcdir)/custom.cc'; fi` ext3grep-accept.o: accept.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-accept.o -MD -MP -MF $(DEPDIR)/ext3grep-accept.Tpo -c -o ext3grep-accept.o `test -f 'accept.cc' || echo '$(srcdir)/'`accept.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-accept.Tpo $(DEPDIR)/ext3grep-accept.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='accept.cc' object='ext3grep-accept.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-accept.o `test -f 'accept.cc' || echo '$(srcdir)/'`accept.cc ext3grep-accept.obj: accept.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-accept.obj -MD -MP -MF $(DEPDIR)/ext3grep-accept.Tpo -c -o ext3grep-accept.obj `if test -f 'accept.cc'; then $(CYGPATH_W) 'accept.cc'; else $(CYGPATH_W) '$(srcdir)/accept.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-accept.Tpo $(DEPDIR)/ext3grep-accept.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='accept.cc' object='ext3grep-accept.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-accept.obj `if test -f 'accept.cc'; then $(CYGPATH_W) 'accept.cc'; else $(CYGPATH_W) '$(srcdir)/accept.cc'; fi` ext3grep-blocknr_vector_type.o: blocknr_vector_type.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-blocknr_vector_type.o -MD -MP -MF $(DEPDIR)/ext3grep-blocknr_vector_type.Tpo -c -o ext3grep-blocknr_vector_type.o `test -f 'blocknr_vector_type.cc' || echo '$(srcdir)/'`blocknr_vector_type.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-blocknr_vector_type.Tpo $(DEPDIR)/ext3grep-blocknr_vector_type.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='blocknr_vector_type.cc' object='ext3grep-blocknr_vector_type.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-blocknr_vector_type.o `test -f 'blocknr_vector_type.cc' || echo '$(srcdir)/'`blocknr_vector_type.cc ext3grep-blocknr_vector_type.obj: blocknr_vector_type.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-blocknr_vector_type.obj -MD -MP -MF $(DEPDIR)/ext3grep-blocknr_vector_type.Tpo -c -o ext3grep-blocknr_vector_type.obj `if test -f 'blocknr_vector_type.cc'; then $(CYGPATH_W) 'blocknr_vector_type.cc'; else $(CYGPATH_W) '$(srcdir)/blocknr_vector_type.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-blocknr_vector_type.Tpo $(DEPDIR)/ext3grep-blocknr_vector_type.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='blocknr_vector_type.cc' object='ext3grep-blocknr_vector_type.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-blocknr_vector_type.obj `if test -f 'blocknr_vector_type.cc'; then $(CYGPATH_W) 'blocknr_vector_type.cc'; else $(CYGPATH_W) '$(srcdir)/blocknr_vector_type.cc'; fi` ext3grep-commandline.o: commandline.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-commandline.o -MD -MP -MF $(DEPDIR)/ext3grep-commandline.Tpo -c -o ext3grep-commandline.o `test -f 'commandline.cc' || echo '$(srcdir)/'`commandline.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-commandline.Tpo $(DEPDIR)/ext3grep-commandline.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='commandline.cc' object='ext3grep-commandline.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-commandline.o `test -f 'commandline.cc' || echo '$(srcdir)/'`commandline.cc ext3grep-commandline.obj: commandline.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-commandline.obj -MD -MP -MF $(DEPDIR)/ext3grep-commandline.Tpo -c -o ext3grep-commandline.obj `if test -f 'commandline.cc'; then $(CYGPATH_W) 'commandline.cc'; else $(CYGPATH_W) '$(srcdir)/commandline.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-commandline.Tpo $(DEPDIR)/ext3grep-commandline.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='commandline.cc' object='ext3grep-commandline.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-commandline.obj `if test -f 'commandline.cc'; then $(CYGPATH_W) 'commandline.cc'; else $(CYGPATH_W) '$(srcdir)/commandline.cc'; fi` ext3grep-directories.o: directories.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-directories.o -MD -MP -MF $(DEPDIR)/ext3grep-directories.Tpo -c -o ext3grep-directories.o `test -f 'directories.cc' || echo '$(srcdir)/'`directories.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-directories.Tpo $(DEPDIR)/ext3grep-directories.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='directories.cc' object='ext3grep-directories.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-directories.o `test -f 'directories.cc' || echo '$(srcdir)/'`directories.cc ext3grep-directories.obj: directories.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-directories.obj -MD -MP -MF $(DEPDIR)/ext3grep-directories.Tpo -c -o ext3grep-directories.obj `if test -f 'directories.cc'; then $(CYGPATH_W) 'directories.cc'; else $(CYGPATH_W) '$(srcdir)/directories.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-directories.Tpo $(DEPDIR)/ext3grep-directories.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='directories.cc' object='ext3grep-directories.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-directories.obj `if test -f 'directories.cc'; then $(CYGPATH_W) 'directories.cc'; else $(CYGPATH_W) '$(srcdir)/directories.cc'; fi` ext3grep-dir_inode_to_block.o: dir_inode_to_block.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-dir_inode_to_block.o -MD -MP -MF $(DEPDIR)/ext3grep-dir_inode_to_block.Tpo -c -o ext3grep-dir_inode_to_block.o `test -f 'dir_inode_to_block.cc' || echo '$(srcdir)/'`dir_inode_to_block.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-dir_inode_to_block.Tpo $(DEPDIR)/ext3grep-dir_inode_to_block.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dir_inode_to_block.cc' object='ext3grep-dir_inode_to_block.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-dir_inode_to_block.o `test -f 'dir_inode_to_block.cc' || echo '$(srcdir)/'`dir_inode_to_block.cc ext3grep-dir_inode_to_block.obj: dir_inode_to_block.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-dir_inode_to_block.obj -MD -MP -MF $(DEPDIR)/ext3grep-dir_inode_to_block.Tpo -c -o ext3grep-dir_inode_to_block.obj `if test -f 'dir_inode_to_block.cc'; then $(CYGPATH_W) 'dir_inode_to_block.cc'; else $(CYGPATH_W) '$(srcdir)/dir_inode_to_block.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-dir_inode_to_block.Tpo $(DEPDIR)/ext3grep-dir_inode_to_block.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dir_inode_to_block.cc' object='ext3grep-dir_inode_to_block.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-dir_inode_to_block.obj `if test -f 'dir_inode_to_block.cc'; then $(CYGPATH_W) 'dir_inode_to_block.cc'; else $(CYGPATH_W) '$(srcdir)/dir_inode_to_block.cc'; fi` ext3grep-dump_hex_to.o: dump_hex_to.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-dump_hex_to.o -MD -MP -MF $(DEPDIR)/ext3grep-dump_hex_to.Tpo -c -o ext3grep-dump_hex_to.o `test -f 'dump_hex_to.cc' || echo '$(srcdir)/'`dump_hex_to.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-dump_hex_to.Tpo $(DEPDIR)/ext3grep-dump_hex_to.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dump_hex_to.cc' object='ext3grep-dump_hex_to.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-dump_hex_to.o `test -f 'dump_hex_to.cc' || echo '$(srcdir)/'`dump_hex_to.cc ext3grep-dump_hex_to.obj: dump_hex_to.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-dump_hex_to.obj -MD -MP -MF $(DEPDIR)/ext3grep-dump_hex_to.Tpo -c -o ext3grep-dump_hex_to.obj `if test -f 'dump_hex_to.cc'; then $(CYGPATH_W) 'dump_hex_to.cc'; else $(CYGPATH_W) '$(srcdir)/dump_hex_to.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-dump_hex_to.Tpo $(DEPDIR)/ext3grep-dump_hex_to.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dump_hex_to.cc' object='ext3grep-dump_hex_to.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-dump_hex_to.obj `if test -f 'dump_hex_to.cc'; then $(CYGPATH_W) 'dump_hex_to.cc'; else $(CYGPATH_W) '$(srcdir)/dump_hex_to.cc'; fi` ext3grep-dump_names.o: dump_names.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-dump_names.o -MD -MP -MF $(DEPDIR)/ext3grep-dump_names.Tpo -c -o ext3grep-dump_names.o `test -f 'dump_names.cc' || echo '$(srcdir)/'`dump_names.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-dump_names.Tpo $(DEPDIR)/ext3grep-dump_names.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dump_names.cc' object='ext3grep-dump_names.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-dump_names.o `test -f 'dump_names.cc' || echo '$(srcdir)/'`dump_names.cc ext3grep-dump_names.obj: dump_names.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-dump_names.obj -MD -MP -MF $(DEPDIR)/ext3grep-dump_names.Tpo -c -o ext3grep-dump_names.obj `if test -f 'dump_names.cc'; then $(CYGPATH_W) 'dump_names.cc'; else $(CYGPATH_W) '$(srcdir)/dump_names.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-dump_names.Tpo $(DEPDIR)/ext3grep-dump_names.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dump_names.cc' object='ext3grep-dump_names.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-dump_names.obj `if test -f 'dump_names.cc'; then $(CYGPATH_W) 'dump_names.cc'; else $(CYGPATH_W) '$(srcdir)/dump_names.cc'; fi` ext3grep-init_journal_consts.o: init_journal_consts.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-init_journal_consts.o -MD -MP -MF $(DEPDIR)/ext3grep-init_journal_consts.Tpo -c -o ext3grep-init_journal_consts.o `test -f 'init_journal_consts.cc' || echo '$(srcdir)/'`init_journal_consts.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-init_journal_consts.Tpo $(DEPDIR)/ext3grep-init_journal_consts.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='init_journal_consts.cc' object='ext3grep-init_journal_consts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-init_journal_consts.o `test -f 'init_journal_consts.cc' || echo '$(srcdir)/'`init_journal_consts.cc ext3grep-init_journal_consts.obj: init_journal_consts.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-init_journal_consts.obj -MD -MP -MF $(DEPDIR)/ext3grep-init_journal_consts.Tpo -c -o ext3grep-init_journal_consts.obj `if test -f 'init_journal_consts.cc'; then $(CYGPATH_W) 'init_journal_consts.cc'; else $(CYGPATH_W) '$(srcdir)/init_journal_consts.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-init_journal_consts.Tpo $(DEPDIR)/ext3grep-init_journal_consts.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='init_journal_consts.cc' object='ext3grep-init_journal_consts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-init_journal_consts.obj `if test -f 'init_journal_consts.cc'; then $(CYGPATH_W) 'init_journal_consts.cc'; else $(CYGPATH_W) '$(srcdir)/init_journal_consts.cc'; fi` ext3grep-get_block.o: get_block.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-get_block.o -MD -MP -MF $(DEPDIR)/ext3grep-get_block.Tpo -c -o ext3grep-get_block.o `test -f 'get_block.cc' || echo '$(srcdir)/'`get_block.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-get_block.Tpo $(DEPDIR)/ext3grep-get_block.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='get_block.cc' object='ext3grep-get_block.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-get_block.o `test -f 'get_block.cc' || echo '$(srcdir)/'`get_block.cc ext3grep-get_block.obj: get_block.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-get_block.obj -MD -MP -MF $(DEPDIR)/ext3grep-get_block.Tpo -c -o ext3grep-get_block.obj `if test -f 'get_block.cc'; then $(CYGPATH_W) 'get_block.cc'; else $(CYGPATH_W) '$(srcdir)/get_block.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-get_block.Tpo $(DEPDIR)/ext3grep-get_block.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='get_block.cc' object='ext3grep-get_block.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-get_block.obj `if test -f 'get_block.cc'; then $(CYGPATH_W) 'get_block.cc'; else $(CYGPATH_W) '$(srcdir)/get_block.cc'; fi` ext3grep-globals.o: globals.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-globals.o -MD -MP -MF $(DEPDIR)/ext3grep-globals.Tpo -c -o ext3grep-globals.o `test -f 'globals.cc' || echo '$(srcdir)/'`globals.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-globals.Tpo $(DEPDIR)/ext3grep-globals.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='globals.cc' object='ext3grep-globals.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-globals.o `test -f 'globals.cc' || echo '$(srcdir)/'`globals.cc ext3grep-globals.obj: globals.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-globals.obj -MD -MP -MF $(DEPDIR)/ext3grep-globals.Tpo -c -o ext3grep-globals.obj `if test -f 'globals.cc'; then $(CYGPATH_W) 'globals.cc'; else $(CYGPATH_W) '$(srcdir)/globals.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-globals.Tpo $(DEPDIR)/ext3grep-globals.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='globals.cc' object='ext3grep-globals.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-globals.obj `if test -f 'globals.cc'; then $(CYGPATH_W) 'globals.cc'; else $(CYGPATH_W) '$(srcdir)/globals.cc'; fi` ext3grep-histogram.o: histogram.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-histogram.o -MD -MP -MF $(DEPDIR)/ext3grep-histogram.Tpo -c -o ext3grep-histogram.o `test -f 'histogram.cc' || echo '$(srcdir)/'`histogram.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-histogram.Tpo $(DEPDIR)/ext3grep-histogram.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='histogram.cc' object='ext3grep-histogram.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-histogram.o `test -f 'histogram.cc' || echo '$(srcdir)/'`histogram.cc ext3grep-histogram.obj: histogram.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-histogram.obj -MD -MP -MF $(DEPDIR)/ext3grep-histogram.Tpo -c -o ext3grep-histogram.obj `if test -f 'histogram.cc'; then $(CYGPATH_W) 'histogram.cc'; else $(CYGPATH_W) '$(srcdir)/histogram.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-histogram.Tpo $(DEPDIR)/ext3grep-histogram.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='histogram.cc' object='ext3grep-histogram.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-histogram.obj `if test -f 'histogram.cc'; then $(CYGPATH_W) 'histogram.cc'; else $(CYGPATH_W) '$(srcdir)/histogram.cc'; fi` ext3grep-indirect_blocks.o: indirect_blocks.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-indirect_blocks.o -MD -MP -MF $(DEPDIR)/ext3grep-indirect_blocks.Tpo -c -o ext3grep-indirect_blocks.o `test -f 'indirect_blocks.cc' || echo '$(srcdir)/'`indirect_blocks.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-indirect_blocks.Tpo $(DEPDIR)/ext3grep-indirect_blocks.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='indirect_blocks.cc' object='ext3grep-indirect_blocks.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-indirect_blocks.o `test -f 'indirect_blocks.cc' || echo '$(srcdir)/'`indirect_blocks.cc ext3grep-indirect_blocks.obj: indirect_blocks.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-indirect_blocks.obj -MD -MP -MF $(DEPDIR)/ext3grep-indirect_blocks.Tpo -c -o ext3grep-indirect_blocks.obj `if test -f 'indirect_blocks.cc'; then $(CYGPATH_W) 'indirect_blocks.cc'; else $(CYGPATH_W) '$(srcdir)/indirect_blocks.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-indirect_blocks.Tpo $(DEPDIR)/ext3grep-indirect_blocks.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='indirect_blocks.cc' object='ext3grep-indirect_blocks.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-indirect_blocks.obj `if test -f 'indirect_blocks.cc'; then $(CYGPATH_W) 'indirect_blocks.cc'; else $(CYGPATH_W) '$(srcdir)/indirect_blocks.cc'; fi` ext3grep-init_consts.o: init_consts.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-init_consts.o -MD -MP -MF $(DEPDIR)/ext3grep-init_consts.Tpo -c -o ext3grep-init_consts.o `test -f 'init_consts.cc' || echo '$(srcdir)/'`init_consts.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-init_consts.Tpo $(DEPDIR)/ext3grep-init_consts.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='init_consts.cc' object='ext3grep-init_consts.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-init_consts.o `test -f 'init_consts.cc' || echo '$(srcdir)/'`init_consts.cc ext3grep-init_consts.obj: init_consts.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-init_consts.obj -MD -MP -MF $(DEPDIR)/ext3grep-init_consts.Tpo -c -o ext3grep-init_consts.obj `if test -f 'init_consts.cc'; then $(CYGPATH_W) 'init_consts.cc'; else $(CYGPATH_W) '$(srcdir)/init_consts.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-init_consts.Tpo $(DEPDIR)/ext3grep-init_consts.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='init_consts.cc' object='ext3grep-init_consts.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-init_consts.obj `if test -f 'init_consts.cc'; then $(CYGPATH_W) 'init_consts.cc'; else $(CYGPATH_W) '$(srcdir)/init_consts.cc'; fi` ext3grep-init_directories.o: init_directories.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-init_directories.o -MD -MP -MF $(DEPDIR)/ext3grep-init_directories.Tpo -c -o ext3grep-init_directories.o `test -f 'init_directories.cc' || echo '$(srcdir)/'`init_directories.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-init_directories.Tpo $(DEPDIR)/ext3grep-init_directories.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='init_directories.cc' object='ext3grep-init_directories.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-init_directories.o `test -f 'init_directories.cc' || echo '$(srcdir)/'`init_directories.cc ext3grep-init_directories.obj: init_directories.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-init_directories.obj -MD -MP -MF $(DEPDIR)/ext3grep-init_directories.Tpo -c -o ext3grep-init_directories.obj `if test -f 'init_directories.cc'; then $(CYGPATH_W) 'init_directories.cc'; else $(CYGPATH_W) '$(srcdir)/init_directories.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-init_directories.Tpo $(DEPDIR)/ext3grep-init_directories.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='init_directories.cc' object='ext3grep-init_directories.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-init_directories.obj `if test -f 'init_directories.cc'; then $(CYGPATH_W) 'init_directories.cc'; else $(CYGPATH_W) '$(srcdir)/init_directories.cc'; fi` ext3grep-init_files.o: init_files.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-init_files.o -MD -MP -MF $(DEPDIR)/ext3grep-init_files.Tpo -c -o ext3grep-init_files.o `test -f 'init_files.cc' || echo '$(srcdir)/'`init_files.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-init_files.Tpo $(DEPDIR)/ext3grep-init_files.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='init_files.cc' object='ext3grep-init_files.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-init_files.o `test -f 'init_files.cc' || echo '$(srcdir)/'`init_files.cc ext3grep-init_files.obj: init_files.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-init_files.obj -MD -MP -MF $(DEPDIR)/ext3grep-init_files.Tpo -c -o ext3grep-init_files.obj `if test -f 'init_files.cc'; then $(CYGPATH_W) 'init_files.cc'; else $(CYGPATH_W) '$(srcdir)/init_files.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-init_files.Tpo $(DEPDIR)/ext3grep-init_files.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='init_files.cc' object='ext3grep-init_files.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-init_files.obj `if test -f 'init_files.cc'; then $(CYGPATH_W) 'init_files.cc'; else $(CYGPATH_W) '$(srcdir)/init_files.cc'; fi` ext3grep-inode.o: inode.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-inode.o -MD -MP -MF $(DEPDIR)/ext3grep-inode.Tpo -c -o ext3grep-inode.o `test -f 'inode.cc' || echo '$(srcdir)/'`inode.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-inode.Tpo $(DEPDIR)/ext3grep-inode.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='inode.cc' object='ext3grep-inode.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-inode.o `test -f 'inode.cc' || echo '$(srcdir)/'`inode.cc ext3grep-inode.obj: inode.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-inode.obj -MD -MP -MF $(DEPDIR)/ext3grep-inode.Tpo -c -o ext3grep-inode.obj `if test -f 'inode.cc'; then $(CYGPATH_W) 'inode.cc'; else $(CYGPATH_W) '$(srcdir)/inode.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-inode.Tpo $(DEPDIR)/ext3grep-inode.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='inode.cc' object='ext3grep-inode.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-inode.obj `if test -f 'inode.cc'; then $(CYGPATH_W) 'inode.cc'; else $(CYGPATH_W) '$(srcdir)/inode.cc'; fi` ext3grep-inode_refers_to.o: inode_refers_to.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-inode_refers_to.o -MD -MP -MF $(DEPDIR)/ext3grep-inode_refers_to.Tpo -c -o ext3grep-inode_refers_to.o `test -f 'inode_refers_to.cc' || echo '$(srcdir)/'`inode_refers_to.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-inode_refers_to.Tpo $(DEPDIR)/ext3grep-inode_refers_to.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='inode_refers_to.cc' object='ext3grep-inode_refers_to.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-inode_refers_to.o `test -f 'inode_refers_to.cc' || echo '$(srcdir)/'`inode_refers_to.cc ext3grep-inode_refers_to.obj: inode_refers_to.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-inode_refers_to.obj -MD -MP -MF $(DEPDIR)/ext3grep-inode_refers_to.Tpo -c -o ext3grep-inode_refers_to.obj `if test -f 'inode_refers_to.cc'; then $(CYGPATH_W) 'inode_refers_to.cc'; else $(CYGPATH_W) '$(srcdir)/inode_refers_to.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-inode_refers_to.Tpo $(DEPDIR)/ext3grep-inode_refers_to.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='inode_refers_to.cc' object='ext3grep-inode_refers_to.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-inode_refers_to.obj `if test -f 'inode_refers_to.cc'; then $(CYGPATH_W) 'inode_refers_to.cc'; else $(CYGPATH_W) '$(srcdir)/inode_refers_to.cc'; fi` ext3grep-is_blockdetection.o: is_blockdetection.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-is_blockdetection.o -MD -MP -MF $(DEPDIR)/ext3grep-is_blockdetection.Tpo -c -o ext3grep-is_blockdetection.o `test -f 'is_blockdetection.cc' || echo '$(srcdir)/'`is_blockdetection.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-is_blockdetection.Tpo $(DEPDIR)/ext3grep-is_blockdetection.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='is_blockdetection.cc' object='ext3grep-is_blockdetection.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-is_blockdetection.o `test -f 'is_blockdetection.cc' || echo '$(srcdir)/'`is_blockdetection.cc ext3grep-is_blockdetection.obj: is_blockdetection.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-is_blockdetection.obj -MD -MP -MF $(DEPDIR)/ext3grep-is_blockdetection.Tpo -c -o ext3grep-is_blockdetection.obj `if test -f 'is_blockdetection.cc'; then $(CYGPATH_W) 'is_blockdetection.cc'; else $(CYGPATH_W) '$(srcdir)/is_blockdetection.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-is_blockdetection.Tpo $(DEPDIR)/ext3grep-is_blockdetection.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='is_blockdetection.cc' object='ext3grep-is_blockdetection.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-is_blockdetection.obj `if test -f 'is_blockdetection.cc'; then $(CYGPATH_W) 'is_blockdetection.cc'; else $(CYGPATH_W) '$(srcdir)/is_blockdetection.cc'; fi` ext3grep-journal.o: journal.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-journal.o -MD -MP -MF $(DEPDIR)/ext3grep-journal.Tpo -c -o ext3grep-journal.o `test -f 'journal.cc' || echo '$(srcdir)/'`journal.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-journal.Tpo $(DEPDIR)/ext3grep-journal.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='journal.cc' object='ext3grep-journal.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-journal.o `test -f 'journal.cc' || echo '$(srcdir)/'`journal.cc ext3grep-journal.obj: journal.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-journal.obj -MD -MP -MF $(DEPDIR)/ext3grep-journal.Tpo -c -o ext3grep-journal.obj `if test -f 'journal.cc'; then $(CYGPATH_W) 'journal.cc'; else $(CYGPATH_W) '$(srcdir)/journal.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-journal.Tpo $(DEPDIR)/ext3grep-journal.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='journal.cc' object='ext3grep-journal.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-journal.obj `if test -f 'journal.cc'; then $(CYGPATH_W) 'journal.cc'; else $(CYGPATH_W) '$(srcdir)/journal.cc'; fi` ext3grep-last_undeleted_directory_inode_refering_to_block.o: last_undeleted_directory_inode_refering_to_block.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-last_undeleted_directory_inode_refering_to_block.o -MD -MP -MF $(DEPDIR)/ext3grep-last_undeleted_directory_inode_refering_to_block.Tpo -c -o ext3grep-last_undeleted_directory_inode_refering_to_block.o `test -f 'last_undeleted_directory_inode_refering_to_block.cc' || echo '$(srcdir)/'`last_undeleted_directory_inode_refering_to_block.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-last_undeleted_directory_inode_refering_to_block.Tpo $(DEPDIR)/ext3grep-last_undeleted_directory_inode_refering_to_block.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='last_undeleted_directory_inode_refering_to_block.cc' object='ext3grep-last_undeleted_directory_inode_refering_to_block.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-last_undeleted_directory_inode_refering_to_block.o `test -f 'last_undeleted_directory_inode_refering_to_block.cc' || echo '$(srcdir)/'`last_undeleted_directory_inode_refering_to_block.cc ext3grep-last_undeleted_directory_inode_refering_to_block.obj: last_undeleted_directory_inode_refering_to_block.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-last_undeleted_directory_inode_refering_to_block.obj -MD -MP -MF $(DEPDIR)/ext3grep-last_undeleted_directory_inode_refering_to_block.Tpo -c -o ext3grep-last_undeleted_directory_inode_refering_to_block.obj `if test -f 'last_undeleted_directory_inode_refering_to_block.cc'; then $(CYGPATH_W) 'last_undeleted_directory_inode_refering_to_block.cc'; else $(CYGPATH_W) '$(srcdir)/last_undeleted_directory_inode_refering_to_block.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-last_undeleted_directory_inode_refering_to_block.Tpo $(DEPDIR)/ext3grep-last_undeleted_directory_inode_refering_to_block.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='last_undeleted_directory_inode_refering_to_block.cc' object='ext3grep-last_undeleted_directory_inode_refering_to_block.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-last_undeleted_directory_inode_refering_to_block.obj `if test -f 'last_undeleted_directory_inode_refering_to_block.cc'; then $(CYGPATH_W) 'last_undeleted_directory_inode_refering_to_block.cc'; else $(CYGPATH_W) '$(srcdir)/last_undeleted_directory_inode_refering_to_block.cc'; fi` ext3grep-load_meta_data.o: load_meta_data.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-load_meta_data.o -MD -MP -MF $(DEPDIR)/ext3grep-load_meta_data.Tpo -c -o ext3grep-load_meta_data.o `test -f 'load_meta_data.cc' || echo '$(srcdir)/'`load_meta_data.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-load_meta_data.Tpo $(DEPDIR)/ext3grep-load_meta_data.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='load_meta_data.cc' object='ext3grep-load_meta_data.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-load_meta_data.o `test -f 'load_meta_data.cc' || echo '$(srcdir)/'`load_meta_data.cc ext3grep-load_meta_data.obj: load_meta_data.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-load_meta_data.obj -MD -MP -MF $(DEPDIR)/ext3grep-load_meta_data.Tpo -c -o ext3grep-load_meta_data.obj `if test -f 'load_meta_data.cc'; then $(CYGPATH_W) 'load_meta_data.cc'; else $(CYGPATH_W) '$(srcdir)/load_meta_data.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-load_meta_data.Tpo $(DEPDIR)/ext3grep-load_meta_data.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='load_meta_data.cc' object='ext3grep-load_meta_data.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-load_meta_data.obj `if test -f 'load_meta_data.cc'; then $(CYGPATH_W) 'load_meta_data.cc'; else $(CYGPATH_W) '$(srcdir)/load_meta_data.cc'; fi` ext3grep-ostream_operators.o: ostream_operators.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-ostream_operators.o -MD -MP -MF $(DEPDIR)/ext3grep-ostream_operators.Tpo -c -o ext3grep-ostream_operators.o `test -f 'ostream_operators.cc' || echo '$(srcdir)/'`ostream_operators.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-ostream_operators.Tpo $(DEPDIR)/ext3grep-ostream_operators.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ostream_operators.cc' object='ext3grep-ostream_operators.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-ostream_operators.o `test -f 'ostream_operators.cc' || echo '$(srcdir)/'`ostream_operators.cc ext3grep-ostream_operators.obj: ostream_operators.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-ostream_operators.obj -MD -MP -MF $(DEPDIR)/ext3grep-ostream_operators.Tpo -c -o ext3grep-ostream_operators.obj `if test -f 'ostream_operators.cc'; then $(CYGPATH_W) 'ostream_operators.cc'; else $(CYGPATH_W) '$(srcdir)/ostream_operators.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-ostream_operators.Tpo $(DEPDIR)/ext3grep-ostream_operators.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ostream_operators.cc' object='ext3grep-ostream_operators.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-ostream_operators.obj `if test -f 'ostream_operators.cc'; then $(CYGPATH_W) 'ostream_operators.cc'; else $(CYGPATH_W) '$(srcdir)/ostream_operators.cc'; fi` ext3grep-Parent.o: Parent.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-Parent.o -MD -MP -MF $(DEPDIR)/ext3grep-Parent.Tpo -c -o ext3grep-Parent.o `test -f 'Parent.cc' || echo '$(srcdir)/'`Parent.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-Parent.Tpo $(DEPDIR)/ext3grep-Parent.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Parent.cc' object='ext3grep-Parent.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-Parent.o `test -f 'Parent.cc' || echo '$(srcdir)/'`Parent.cc ext3grep-Parent.obj: Parent.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-Parent.obj -MD -MP -MF $(DEPDIR)/ext3grep-Parent.Tpo -c -o ext3grep-Parent.obj `if test -f 'Parent.cc'; then $(CYGPATH_W) 'Parent.cc'; else $(CYGPATH_W) '$(srcdir)/Parent.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-Parent.Tpo $(DEPDIR)/ext3grep-Parent.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Parent.cc' object='ext3grep-Parent.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-Parent.obj `if test -f 'Parent.cc'; then $(CYGPATH_W) 'Parent.cc'; else $(CYGPATH_W) '$(srcdir)/Parent.cc'; fi` ext3grep-print_directory.o: print_directory.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-print_directory.o -MD -MP -MF $(DEPDIR)/ext3grep-print_directory.Tpo -c -o ext3grep-print_directory.o `test -f 'print_directory.cc' || echo '$(srcdir)/'`print_directory.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-print_directory.Tpo $(DEPDIR)/ext3grep-print_directory.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='print_directory.cc' object='ext3grep-print_directory.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-print_directory.o `test -f 'print_directory.cc' || echo '$(srcdir)/'`print_directory.cc ext3grep-print_directory.obj: print_directory.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-print_directory.obj -MD -MP -MF $(DEPDIR)/ext3grep-print_directory.Tpo -c -o ext3grep-print_directory.obj `if test -f 'print_directory.cc'; then $(CYGPATH_W) 'print_directory.cc'; else $(CYGPATH_W) '$(srcdir)/print_directory.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-print_directory.Tpo $(DEPDIR)/ext3grep-print_directory.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='print_directory.cc' object='ext3grep-print_directory.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-print_directory.obj `if test -f 'print_directory.cc'; then $(CYGPATH_W) 'print_directory.cc'; else $(CYGPATH_W) '$(srcdir)/print_directory.cc'; fi` ext3grep-print_directory_inode.o: print_directory_inode.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-print_directory_inode.o -MD -MP -MF $(DEPDIR)/ext3grep-print_directory_inode.Tpo -c -o ext3grep-print_directory_inode.o `test -f 'print_directory_inode.cc' || echo '$(srcdir)/'`print_directory_inode.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-print_directory_inode.Tpo $(DEPDIR)/ext3grep-print_directory_inode.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='print_directory_inode.cc' object='ext3grep-print_directory_inode.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-print_directory_inode.o `test -f 'print_directory_inode.cc' || echo '$(srcdir)/'`print_directory_inode.cc ext3grep-print_directory_inode.obj: print_directory_inode.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-print_directory_inode.obj -MD -MP -MF $(DEPDIR)/ext3grep-print_directory_inode.Tpo -c -o ext3grep-print_directory_inode.obj `if test -f 'print_directory_inode.cc'; then $(CYGPATH_W) 'print_directory_inode.cc'; else $(CYGPATH_W) '$(srcdir)/print_directory_inode.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-print_directory_inode.Tpo $(DEPDIR)/ext3grep-print_directory_inode.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='print_directory_inode.cc' object='ext3grep-print_directory_inode.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-print_directory_inode.obj `if test -f 'print_directory_inode.cc'; then $(CYGPATH_W) 'print_directory_inode.cc'; else $(CYGPATH_W) '$(srcdir)/print_directory_inode.cc'; fi` ext3grep-print_dir_entry_long_action.o: print_dir_entry_long_action.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-print_dir_entry_long_action.o -MD -MP -MF $(DEPDIR)/ext3grep-print_dir_entry_long_action.Tpo -c -o ext3grep-print_dir_entry_long_action.o `test -f 'print_dir_entry_long_action.cc' || echo '$(srcdir)/'`print_dir_entry_long_action.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-print_dir_entry_long_action.Tpo $(DEPDIR)/ext3grep-print_dir_entry_long_action.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='print_dir_entry_long_action.cc' object='ext3grep-print_dir_entry_long_action.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-print_dir_entry_long_action.o `test -f 'print_dir_entry_long_action.cc' || echo '$(srcdir)/'`print_dir_entry_long_action.cc ext3grep-print_dir_entry_long_action.obj: print_dir_entry_long_action.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-print_dir_entry_long_action.obj -MD -MP -MF $(DEPDIR)/ext3grep-print_dir_entry_long_action.Tpo -c -o ext3grep-print_dir_entry_long_action.obj `if test -f 'print_dir_entry_long_action.cc'; then $(CYGPATH_W) 'print_dir_entry_long_action.cc'; else $(CYGPATH_W) '$(srcdir)/print_dir_entry_long_action.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-print_dir_entry_long_action.Tpo $(DEPDIR)/ext3grep-print_dir_entry_long_action.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='print_dir_entry_long_action.cc' object='ext3grep-print_dir_entry_long_action.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-print_dir_entry_long_action.obj `if test -f 'print_dir_entry_long_action.cc'; then $(CYGPATH_W) 'print_dir_entry_long_action.cc'; else $(CYGPATH_W) '$(srcdir)/print_dir_entry_long_action.cc'; fi` ext3grep-printing.o: printing.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-printing.o -MD -MP -MF $(DEPDIR)/ext3grep-printing.Tpo -c -o ext3grep-printing.o `test -f 'printing.cc' || echo '$(srcdir)/'`printing.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-printing.Tpo $(DEPDIR)/ext3grep-printing.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='printing.cc' object='ext3grep-printing.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-printing.o `test -f 'printing.cc' || echo '$(srcdir)/'`printing.cc ext3grep-printing.obj: printing.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-printing.obj -MD -MP -MF $(DEPDIR)/ext3grep-printing.Tpo -c -o ext3grep-printing.obj `if test -f 'printing.cc'; then $(CYGPATH_W) 'printing.cc'; else $(CYGPATH_W) '$(srcdir)/printing.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-printing.Tpo $(DEPDIR)/ext3grep-printing.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='printing.cc' object='ext3grep-printing.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-printing.obj `if test -f 'printing.cc'; then $(CYGPATH_W) 'printing.cc'; else $(CYGPATH_W) '$(srcdir)/printing.cc'; fi` ext3grep-print_inode_to.o: print_inode_to.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-print_inode_to.o -MD -MP -MF $(DEPDIR)/ext3grep-print_inode_to.Tpo -c -o ext3grep-print_inode_to.o `test -f 'print_inode_to.cc' || echo '$(srcdir)/'`print_inode_to.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-print_inode_to.Tpo $(DEPDIR)/ext3grep-print_inode_to.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='print_inode_to.cc' object='ext3grep-print_inode_to.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-print_inode_to.o `test -f 'print_inode_to.cc' || echo '$(srcdir)/'`print_inode_to.cc ext3grep-print_inode_to.obj: print_inode_to.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-print_inode_to.obj -MD -MP -MF $(DEPDIR)/ext3grep-print_inode_to.Tpo -c -o ext3grep-print_inode_to.obj `if test -f 'print_inode_to.cc'; then $(CYGPATH_W) 'print_inode_to.cc'; else $(CYGPATH_W) '$(srcdir)/print_inode_to.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-print_inode_to.Tpo $(DEPDIR)/ext3grep-print_inode_to.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='print_inode_to.cc' object='ext3grep-print_inode_to.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-print_inode_to.obj `if test -f 'print_inode_to.cc'; then $(CYGPATH_W) 'print_inode_to.cc'; else $(CYGPATH_W) '$(srcdir)/print_inode_to.cc'; fi` ext3grep-print_symlink.o: print_symlink.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-print_symlink.o -MD -MP -MF $(DEPDIR)/ext3grep-print_symlink.Tpo -c -o ext3grep-print_symlink.o `test -f 'print_symlink.cc' || echo '$(srcdir)/'`print_symlink.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-print_symlink.Tpo $(DEPDIR)/ext3grep-print_symlink.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='print_symlink.cc' object='ext3grep-print_symlink.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-print_symlink.o `test -f 'print_symlink.cc' || echo '$(srcdir)/'`print_symlink.cc ext3grep-print_symlink.obj: print_symlink.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-print_symlink.obj -MD -MP -MF $(DEPDIR)/ext3grep-print_symlink.Tpo -c -o ext3grep-print_symlink.obj `if test -f 'print_symlink.cc'; then $(CYGPATH_W) 'print_symlink.cc'; else $(CYGPATH_W) '$(srcdir)/print_symlink.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-print_symlink.Tpo $(DEPDIR)/ext3grep-print_symlink.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='print_symlink.cc' object='ext3grep-print_symlink.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-print_symlink.obj `if test -f 'print_symlink.cc'; then $(CYGPATH_W) 'print_symlink.cc'; else $(CYGPATH_W) '$(srcdir)/print_symlink.cc'; fi` ext3grep-restore.o: restore.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-restore.o -MD -MP -MF $(DEPDIR)/ext3grep-restore.Tpo -c -o ext3grep-restore.o `test -f 'restore.cc' || echo '$(srcdir)/'`restore.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-restore.Tpo $(DEPDIR)/ext3grep-restore.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='restore.cc' object='ext3grep-restore.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-restore.o `test -f 'restore.cc' || echo '$(srcdir)/'`restore.cc ext3grep-restore.obj: restore.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-restore.obj -MD -MP -MF $(DEPDIR)/ext3grep-restore.Tpo -c -o ext3grep-restore.obj `if test -f 'restore.cc'; then $(CYGPATH_W) 'restore.cc'; else $(CYGPATH_W) '$(srcdir)/restore.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-restore.Tpo $(DEPDIR)/ext3grep-restore.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='restore.cc' object='ext3grep-restore.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-restore.obj `if test -f 'restore.cc'; then $(CYGPATH_W) 'restore.cc'; else $(CYGPATH_W) '$(srcdir)/restore.cc'; fi` ext3grep-show_hardlinks.o: show_hardlinks.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-show_hardlinks.o -MD -MP -MF $(DEPDIR)/ext3grep-show_hardlinks.Tpo -c -o ext3grep-show_hardlinks.o `test -f 'show_hardlinks.cc' || echo '$(srcdir)/'`show_hardlinks.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-show_hardlinks.Tpo $(DEPDIR)/ext3grep-show_hardlinks.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='show_hardlinks.cc' object='ext3grep-show_hardlinks.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-show_hardlinks.o `test -f 'show_hardlinks.cc' || echo '$(srcdir)/'`show_hardlinks.cc ext3grep-show_hardlinks.obj: show_hardlinks.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-show_hardlinks.obj -MD -MP -MF $(DEPDIR)/ext3grep-show_hardlinks.Tpo -c -o ext3grep-show_hardlinks.obj `if test -f 'show_hardlinks.cc'; then $(CYGPATH_W) 'show_hardlinks.cc'; else $(CYGPATH_W) '$(srcdir)/show_hardlinks.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-show_hardlinks.Tpo $(DEPDIR)/ext3grep-show_hardlinks.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='show_hardlinks.cc' object='ext3grep-show_hardlinks.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-show_hardlinks.obj `if test -f 'show_hardlinks.cc'; then $(CYGPATH_W) 'show_hardlinks.cc'; else $(CYGPATH_W) '$(srcdir)/show_hardlinks.cc'; fi` ext3grep-show_journal_inodes.o: show_journal_inodes.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-show_journal_inodes.o -MD -MP -MF $(DEPDIR)/ext3grep-show_journal_inodes.Tpo -c -o ext3grep-show_journal_inodes.o `test -f 'show_journal_inodes.cc' || echo '$(srcdir)/'`show_journal_inodes.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-show_journal_inodes.Tpo $(DEPDIR)/ext3grep-show_journal_inodes.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='show_journal_inodes.cc' object='ext3grep-show_journal_inodes.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-show_journal_inodes.o `test -f 'show_journal_inodes.cc' || echo '$(srcdir)/'`show_journal_inodes.cc ext3grep-show_journal_inodes.obj: show_journal_inodes.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-show_journal_inodes.obj -MD -MP -MF $(DEPDIR)/ext3grep-show_journal_inodes.Tpo -c -o ext3grep-show_journal_inodes.obj `if test -f 'show_journal_inodes.cc'; then $(CYGPATH_W) 'show_journal_inodes.cc'; else $(CYGPATH_W) '$(srcdir)/show_journal_inodes.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-show_journal_inodes.Tpo $(DEPDIR)/ext3grep-show_journal_inodes.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='show_journal_inodes.cc' object='ext3grep-show_journal_inodes.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-show_journal_inodes.obj `if test -f 'show_journal_inodes.cc'; then $(CYGPATH_W) 'show_journal_inodes.cc'; else $(CYGPATH_W) '$(srcdir)/show_journal_inodes.cc'; fi` ext3grep-utils.o: utils.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-utils.o -MD -MP -MF $(DEPDIR)/ext3grep-utils.Tpo -c -o ext3grep-utils.o `test -f 'utils.cc' || echo '$(srcdir)/'`utils.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-utils.Tpo $(DEPDIR)/ext3grep-utils.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='utils.cc' object='ext3grep-utils.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-utils.o `test -f 'utils.cc' || echo '$(srcdir)/'`utils.cc ext3grep-utils.obj: utils.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-utils.obj -MD -MP -MF $(DEPDIR)/ext3grep-utils.Tpo -c -o ext3grep-utils.obj `if test -f 'utils.cc'; then $(CYGPATH_W) 'utils.cc'; else $(CYGPATH_W) '$(srcdir)/utils.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-utils.Tpo $(DEPDIR)/ext3grep-utils.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='utils.cc' object='ext3grep-utils.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-utils.obj `if test -f 'utils.cc'; then $(CYGPATH_W) 'utils.cc'; else $(CYGPATH_W) '$(srcdir)/utils.cc'; fi` ext3grep-ext3grep.o: ext3grep.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-ext3grep.o -MD -MP -MF $(DEPDIR)/ext3grep-ext3grep.Tpo -c -o ext3grep-ext3grep.o `test -f 'ext3grep.cc' || echo '$(srcdir)/'`ext3grep.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-ext3grep.Tpo $(DEPDIR)/ext3grep-ext3grep.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ext3grep.cc' object='ext3grep-ext3grep.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-ext3grep.o `test -f 'ext3grep.cc' || echo '$(srcdir)/'`ext3grep.cc ext3grep-ext3grep.obj: ext3grep.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-ext3grep.obj -MD -MP -MF $(DEPDIR)/ext3grep-ext3grep.Tpo -c -o ext3grep-ext3grep.obj `if test -f 'ext3grep.cc'; then $(CYGPATH_W) 'ext3grep.cc'; else $(CYGPATH_W) '$(srcdir)/ext3grep.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-ext3grep.Tpo $(DEPDIR)/ext3grep-ext3grep.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ext3grep.cc' object='ext3grep-ext3grep.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-ext3grep.obj `if test -f 'ext3grep.cc'; then $(CYGPATH_W) 'ext3grep.cc'; else $(CYGPATH_W) '$(srcdir)/ext3grep.cc'; fi` ext3grep-locate.o: locate.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-locate.o -MD -MP -MF $(DEPDIR)/ext3grep-locate.Tpo -c -o ext3grep-locate.o `test -f 'locate.cc' || echo '$(srcdir)/'`locate.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-locate.Tpo $(DEPDIR)/ext3grep-locate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='locate.cc' object='ext3grep-locate.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-locate.o `test -f 'locate.cc' || echo '$(srcdir)/'`locate.cc ext3grep-locate.obj: locate.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-locate.obj -MD -MP -MF $(DEPDIR)/ext3grep-locate.Tpo -c -o ext3grep-locate.obj `if test -f 'locate.cc'; then $(CYGPATH_W) 'locate.cc'; else $(CYGPATH_W) '$(srcdir)/locate.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-locate.Tpo $(DEPDIR)/ext3grep-locate.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='locate.cc' object='ext3grep-locate.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-locate.obj `if test -f 'locate.cc'; then $(CYGPATH_W) 'locate.cc'; else $(CYGPATH_W) '$(srcdir)/locate.cc'; fi` ext3grep-backtrace.o: backtrace.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-backtrace.o -MD -MP -MF $(DEPDIR)/ext3grep-backtrace.Tpo -c -o ext3grep-backtrace.o `test -f 'backtrace.cc' || echo '$(srcdir)/'`backtrace.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-backtrace.Tpo $(DEPDIR)/ext3grep-backtrace.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='backtrace.cc' object='ext3grep-backtrace.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-backtrace.o `test -f 'backtrace.cc' || echo '$(srcdir)/'`backtrace.cc ext3grep-backtrace.obj: backtrace.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-backtrace.obj -MD -MP -MF $(DEPDIR)/ext3grep-backtrace.Tpo -c -o ext3grep-backtrace.obj `if test -f 'backtrace.cc'; then $(CYGPATH_W) 'backtrace.cc'; else $(CYGPATH_W) '$(srcdir)/backtrace.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-backtrace.Tpo $(DEPDIR)/ext3grep-backtrace.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='backtrace.cc' object='ext3grep-backtrace.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-backtrace.obj `if test -f 'backtrace.cc'; then $(CYGPATH_W) 'backtrace.cc'; else $(CYGPATH_W) '$(srcdir)/backtrace.cc'; fi` ext3grep-debug.o: debug.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-debug.o -MD -MP -MF $(DEPDIR)/ext3grep-debug.Tpo -c -o ext3grep-debug.o `test -f 'debug.cc' || echo '$(srcdir)/'`debug.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-debug.Tpo $(DEPDIR)/ext3grep-debug.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='debug.cc' object='ext3grep-debug.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-debug.o `test -f 'debug.cc' || echo '$(srcdir)/'`debug.cc ext3grep-debug.obj: debug.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-debug.obj -MD -MP -MF $(DEPDIR)/ext3grep-debug.Tpo -c -o ext3grep-debug.obj `if test -f 'debug.cc'; then $(CYGPATH_W) 'debug.cc'; else $(CYGPATH_W) '$(srcdir)/debug.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-debug.Tpo $(DEPDIR)/ext3grep-debug.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='debug.cc' object='ext3grep-debug.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-debug.obj `if test -f 'debug.cc'; then $(CYGPATH_W) 'debug.cc'; else $(CYGPATH_W) '$(srcdir)/debug.cc'; fi` ext3grep-revision.o: revision.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-revision.o -MD -MP -MF $(DEPDIR)/ext3grep-revision.Tpo -c -o ext3grep-revision.o `test -f 'revision.cc' || echo '$(srcdir)/'`revision.cc @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-revision.Tpo $(DEPDIR)/ext3grep-revision.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='revision.cc' object='ext3grep-revision.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-revision.o `test -f 'revision.cc' || echo '$(srcdir)/'`revision.cc ext3grep-revision.obj: revision.cc @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -MT ext3grep-revision.obj -MD -MP -MF $(DEPDIR)/ext3grep-revision.Tpo -c -o ext3grep-revision.obj `if test -f 'revision.cc'; then $(CYGPATH_W) 'revision.cc'; else $(CYGPATH_W) '$(srcdir)/revision.cc'; fi` @am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/ext3grep-revision.Tpo $(DEPDIR)/ext3grep-revision.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='revision.cc' object='ext3grep-revision.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) $(CXXFLAGS) -c -o ext3grep-revision.obj `if test -f 'revision.cc'; then $(CYGPATH_W) 'revision.cc'; else $(CYGPATH_W) '$(srcdir)/revision.cc'; fi` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi @MAINTAINER_MODE_FALSE@ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) all-local installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-local distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ clean-binPROGRAMS clean-generic clean-local ctags distclean \ distclean-compile distclean-generic distclean-local \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS @USE_PCH_TRUE@@Makefilein@ifeq (./$(DEPDIR)/pch.po, $(wildcard ./$(DEPDIR)/pch.po)) @USE_PCH_TRUE@@Makefilein@@am__include@ ./$(DEPDIR)/pch.po @USE_PCH_TRUE@@Makefilein@endif @USE_PCH_TRUE@pch.h.gch/$(APPLICATIONSUM): $(srcdir)/pch-source.h @USE_PCH_TRUE@ @rm -rf pch.h.gch @USE_PCH_TRUE@ @mkdir pch.h.gch @USE_PCH_TRUE@ @test -d $(DEPDIR) || mkdir $(DEPDIR) @USE_PCH_TRUE@ @mkdir -p empty.pch.h @USE_PCH_TRUE@ @touch empty.pch.h/pch.h @USE_PCH_TRUE@ @if $(CXX) -Iempty.pch.h $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) \ @USE_PCH_TRUE@ -UUSE_PCH -M -MT pch.h.gch -MF $(DEPDIR)/pch.TTpo $(srcdir)/pch-source.h; then \ @USE_PCH_TRUE@ cat $(DEPDIR)/pch.TTpo | sed -e 's%^pch\.h\.gch:%pch.h.gch/$(APPLICATIONSUM):%' -e 's% empty\.pch\.h/pch\.h%%' > $(DEPDIR)/pch.Tpo; \ @USE_PCH_TRUE@ cmp -s $(DEPDIR)/pch.Tpo $(DEPDIR)/pch.po || mv $(DEPDIR)/pch.Tpo $(DEPDIR)/pch.po; \ @USE_PCH_TRUE@ fi @USE_PCH_TRUE@ $(CXX) -Iempty.pch.h $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext3grep_CXXFLAGS) \ @USE_PCH_TRUE@ -c -o $@ $(srcdir)/pch-source.h @USE_PCH_TRUE@ test ! -e sys.h || touch sys.h @USE_PCH_TRUE@ @rm empty.pch.h/pch.h @USE_PCH_TRUE@ @rmdir empty.pch.h @USE_SVN_TRUE@revision.cc: FORCE @USE_SVN_TRUE@ @(cd $(srcdir) && svn info) | grep '^Revision' | sed -e 's/R/char const* svn_revision = "R/;s/$$/";/' > revision.cc.tmp @USE_SVN_TRUE@ @cmp -s revision.cc revision.cc.tmp || mv revision.cc.tmp revision.cc && echo "Generating revision.cc" @USE_SVN_TRUE@ @rm -f revision.cc.tmp @USE_SVN_TRUE@FORCE: @USE_SVN_TRUE@.PHONY: FORCE # --------------- Maintainer's Section #dist-hook: all-local: @if test -e $(top_srcdir)/../.libcwdrc-src -a ! -e .libcwdrc; then \ echo "ln -s $(top_srcdir)/../.libcwdrc-src .libcwdrc"; \ ln -s $(top_srcdir)/../.libcwdrc-src .libcwdrc; \ fi @if test -e $(top_srcdir)/../.gdbinit-src -a ! -e .gdbinit; then \ echo "ln -s $(top_srcdir)/../.gdbinit-src .gdbinit"; \ ln -s $(top_srcdir)/../.gdbinit-src .gdbinit; \ fi distclean-local: rm -rf $(srcdir)/autom4te.cache pch.h.gch sys.h test -L .libcwdrc && rm .libcwdrc || true test -L .gdbinit && rm .gdbinit || true @MAINTAINER_MODE_TRUE@rm -f .all_sources *.s *.ii clean-local: @USE_PCH_TRUE@ rm -f pch.h.gch/* $(DEPDIR)/pch.*po @USE_SVN_TRUE@ rm -f revision.cc # Usage: You have to set the CTAGS_ROOT_SRCDIRS environment variable yourself, # for example: export CTAGS_ROOT_SRCDIRS="/usr/src/gtk/glib-current /usr/src/gtk/gtk+-current" # Then run 'vim -u /some/path/.vimrc' where the .vimrc is the normal .vimrc, but with the # additional lines: set tags=/full/path/to/top_builddir/tags # nmap :tnext @MAINTAINER_MODE_TRUE@ctags: @MAINTAINER_MODE_TRUE@ rm -f .all_sources @MAINTAINER_MODE_TRUE@ touch .all_sources @MAINTAINER_MODE_TRUE@ for d in $(CTAGS_ROOT_SRCDIRS) $(top_srcdir); do \ @MAINTAINER_MODE_TRUE@ find $$d -follow -type f -name '*.h' -o -name '*.hpp' -o -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.cxx' -o -name '*.C' -o -name '*.inl' >> .all_sources; \ @MAINTAINER_MODE_TRUE@ done @MAINTAINER_MODE_TRUE@ ctags `cat .all_sources` # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ext3grep-0.10.1/src/blocknr_vector_type.h0000644000175000017500000000420311031756606015274 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file blocknr_vector_type.h Declaration of union blocknr_vector_type. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef BLOCKNR_VECTOR_TYPE_H #define BLOCKNR_VECTOR_TYPE_H #ifndef USE_PCH #include "sys.h" #include #include #include #include "debug.h" #endif #define BVASSERT(x) ASSERT(x) union blocknr_vector_type { size_t blocknr; // This must be a size_t in order to align the least significant bit with the least significant bit of blocknr_vector. uint32_t* blocknr_vector; void push_back(uint32_t blocknr); void remove(uint32_t blocknr); void erase(void) { if (is_vector()) delete [] blocknr_vector; blocknr = 0; } blocknr_vector_type& operator=(std::vector const& vec); bool empty(void) const { return blocknr == 0; } // The rest is only valid if empty() returned false. bool is_vector(void) const { BVASSERT(!empty()); return !(blocknr & 1); } uint32_t size(void) const { return is_vector() ? blocknr_vector[0] : 1; } uint32_t first_entry(void) const { return is_vector() ? blocknr_vector[1] : (blocknr >> 1); } uint32_t operator[](int index) const { BVASSERT(index >= 0 && (size_t)index < size()); return (index == 0) ? first_entry() : blocknr_vector[index + 1]; } }; #endif // BLOCKNR_VECTOR_TYPE_H ext3grep-0.10.1/src/inode.cc0000644000175000017500000000647211031573427012463 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file inode.cc Inode related code. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include "debug.h" #include #include #include "ext3.h" #endif #include "load_meta_data.h" #include "globals.h" #include "conversion.h" #include "inode.h" #if USE_MMAP void inode_unmap(int group) { if (all_inodes[group]) { DoutEntering(dc::notice, "inode_unmap(" << group << ")"); ASSERT(refs_to_mmap[group] == 0 && nr_mmaps > 0); --nr_mmaps; munmap(all_mmaps[group], inodes_per_group_ * inode_size_ + ((char*)all_inodes[group] - (char*)all_mmaps[group])); all_inodes[group] = NULL; } } // Maximum number of simultaneously mmapped inode tables. // One inode table is roughly 4 MB: 32768 inodes times 128 bytes. // If we want to maximally use 1 GB of address space for those, // we should map at most 1024/4 = 256 inode tables. // On 64-bit machines, this can be infinitely higher. int const max_mmaps = (sizeof(void*) == 4) ? 256 : std::numeric_limits::max(); void inode_mmap(int group) { if (all_inodes[group]) return; DoutEntering(dc::notice, "inode_mmap(" << group << ")"); if (nr_mmaps >= max_mmaps) { // FIXME: This can be done more intelligent I guess. // For now, just munmap all inode tables that are not in use. for (int grp = 0; grp < groups_; ++grp) { if (!all_inodes[grp]) // Not mapped at all? continue; if (refs_to_mmap[grp] > 0) // Referenced? continue; inode_unmap(grp); if (nr_mmaps == 0) break; } } int block_number = group_descriptor_table[group].bg_inode_table; int const blocks_per_page = page_size_ / block_size_; off_t page = block_number / blocks_per_page; off_t page_aligned_offset = page * page_size_; off_t offset = block_to_offset(block_number); all_mmaps[group] = mmap(NULL, inodes_per_group_ * inode_size_ + (offset - page_aligned_offset), PROT_READ, MAP_PRIVATE | MAP_NORESERVE, device_fd, page_aligned_offset); if (all_mmaps[group] == MAP_FAILED) { int error = errno; all_mmaps[group] = NULL; std::cerr << progname << ": mmap: " << strerror(error) << std::endl; // Fail. ASSERT(all_mmaps[group] != MAP_FAILED); } all_inodes[group] = reinterpret_cast((char*)all_mmaps[group] + (offset - page_aligned_offset)); ASSERT(refs_to_mmap[group] == 0); ++nr_mmaps; } #endif Inode InodePointer::S_fake_inode; // This will be filled with zeroes. ext3grep-0.10.1/src/ostream_operators.cc0000644000175000017500000002644711077150711015136 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file ostream_operators.cc Implementation of various ostream inserter functions. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include "debug.h" #endif #include "endian_conversion.h" #include "superblock.h" #include "globals.h" //----------------------------------------------------------------------------- // // ostream operator<<'s // struct FileSystemState { private: __le16 M_state; public: FileSystemState(__le16 state) : M_state(state) { } friend std::ostream& operator<<(std::ostream& os, FileSystemState const& state) { if ((state.M_state & EXT3_VALID_FS)) os << "'Unmounted cleanly'"; else os << "Not clean"; if ((state.M_state & EXT3_ERROR_FS)) os << " 'Errors detected'"; return os; } }; std::ostream& operator<<(std::ostream& os, ext3_super_block const& super_block) { // This was generated with: // awk 'BEGIN { decode=0 } /^struct ext3_super_block/ { decode=1 } /^};/ { decode=0 } { if (decode) print; }' /usr/include/linux/ext3_fs.h | sed -rn 's/^[[:space:]]*(|\/\*[0-9A-F]*\*\/[[:space:]]*)__[[:alnum:]_]*[[:space:]]*(s_[[:alnum:]_]*)(;|\[[0-9]+\];)[[:space:]]*\/\*[[:space:]](.*)[[:space:]]\*\/.*/ os << "\4: " << super_block.\2 << '"'"'\\n'"'"';/p' os << "Inodes count: " << inode_count(super_block) << '\n'; os << "Blocks count: " << block_count(super_block) << '\n'; os << "Reserved blocks count: " << reserved_block_count(super_block) << '\n'; os << "Free blocks count: " << super_block.s_free_blocks_count << '\n'; os << "Free inodes count: " << super_block.s_free_inodes_count << '\n'; os << "First Data Block: " << first_data_block(super_block) << '\n'; os << "Block size: " << block_size(super_block) << '\n'; os << "Fragment size: " << fragment_size(super_block) << '\n'; os << "Number of blocks per group: " << blocks_per_group(super_block) << '\n'; os << "Number of fragments per group: " << super_block.s_frags_per_group << '\n'; os << "Number of inodes per group: " << inodes_per_group(super_block) << '\n'; time_t mtime = super_block.s_mtime; os << "Mount time: " << std::ctime(&mtime); time_t wtime = super_block.s_wtime; os << "Write time: " << std::ctime(&wtime); os << "Mount count: " << super_block.s_mnt_count << '\n'; os << "Maximal mount count: " << super_block.s_max_mnt_count << '\n'; os << "Magic signature: " << std::hex << "0x" << super_block.s_magic << std::dec << '\n'; os << "File system state: " << FileSystemState(super_block.s_state) << '\n'; // os << "Behaviour when detecting errors: " << super_block.s_errors << '\n'; // os << "minor revision level: " << super_block.s_minor_rev_level << '\n'; // os << "time of last check: " << super_block.s_lastcheck << '\n'; // os << "max. time between checks: " << super_block.s_checkinterval << '\n'; // os << "OS: " << super_block.s_creator_os << '\n'; // os << "Revision level: " << super_block.s_rev_level << '\n'; // os << "Default uid for reserved blocks: " << super_block.s_def_resuid << '\n'; // os << "Default gid for reserved blocks: " << super_block.s_def_resgid << '\n'; // os << "First non-reserved inode: " << super_block.s_first_ino << '\n'; os << "Size of inode structure: " << super_block.s_inode_size << '\n'; os << "Block group # of this superblock: " << super_block.s_block_group_nr << '\n'; os << "compatible feature set:"; if ((super_block.s_feature_compat & EXT3_FEATURE_COMPAT_DIR_PREALLOC)) os << " DIR_PREALLOC"; if ((super_block.s_feature_compat & EXT3_FEATURE_COMPAT_IMAGIC_INODES)) os << " IMAGIC_INODES"; if ((super_block.s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL)) os << " HAS_JOURNAL"; if ((super_block.s_feature_compat & EXT3_FEATURE_COMPAT_EXT_ATTR)) os << " EXT_ATTR"; if ((super_block.s_feature_compat & EXT3_FEATURE_COMPAT_RESIZE_INODE)) os << " RESIZE_INODE"; if ((super_block.s_feature_compat & EXT3_FEATURE_COMPAT_DIR_INDEX)) os << " DIR_INDEX"; os << '\n'; os << "incompatible feature set:"; if ((super_block.s_feature_incompat & EXT3_FEATURE_INCOMPAT_COMPRESSION)) os << " COMPRESSION"; if ((super_block.s_feature_incompat & EXT3_FEATURE_INCOMPAT_FILETYPE)) os << " FILETYPE"; if ((super_block.s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER)) os << " RECOVER"; if ((super_block.s_feature_incompat & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)) os << " JOURNAL_DEV"; if ((super_block.s_feature_incompat & EXT3_FEATURE_INCOMPAT_META_BG)) os << " META_BG"; os << '\n'; os << "readonly-compatible feature set:"; if ((super_block.s_feature_ro_compat & EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER)) os << " SPARSE_SUPER"; if ((super_block.s_feature_ro_compat & EXT3_FEATURE_RO_COMPAT_LARGE_FILE)) os << " LARGE_FILE"; if ((super_block.s_feature_ro_compat & EXT3_FEATURE_RO_COMPAT_BTREE_DIR)) os << " BTREE_DIR"; os << '\n'; // os << "128-bit uuid for volume: " << super_block.s_uuid << '\n'; // os << "For compression: " << super_block.s_algorithm_usage_bitmap << '\n'; // os << "Nr to preallocate for dirs: " << super_block.s_prealloc_dir_blocks << '\n'; os << "Per group desc for online growth: " << super_block.s_reserved_gdt_blocks << '\n'; os << "UUID of journal superblock:"; for (int i = 0; i < 16; ++i) os << " 0x" << std::hex << std::setfill('0') << std::setw(2) << (int)super_block.s_journal_uuid[i]; os << std::dec << '\n'; os << "Inode number of journal file: " << super_block.s_journal_inum << '\n'; os << "Device number of journal file: " << super_block.s_journal_dev << '\n'; os << "Start of list of inodes to delete: " << super_block.s_last_orphan << '\n'; // os << "HTREE hash seed: " << super_block.s_hash_seed << '\n'; // os << "Default hash version to use: " << super_block.s_def_hash_version << '\n'; os << "First metablock block group: " << super_block.s_first_meta_bg << '\n'; // os << "Padding to the end of the block: " << super_block.s_reserved << '\n'; return os; } std::ostream& operator<<(std::ostream& os, ext3_group_desc const& group_desc) { os << "block bitmap at " << group_desc.bg_block_bitmap << ", inodes bitmap at " << group_desc.bg_inode_bitmap << ", inode table at " << group_desc.bg_inode_table << '\n'; os << "\t " << group_desc.bg_free_blocks_count << " free blocks, " << group_desc.bg_free_inodes_count << " free inodes, " << group_desc.bg_used_dirs_count << " used directory"; return os; } std::ostream& operator<<(std::ostream& os, journal_header_t const& journal_header) { os << "Block type: "; switch (be2le(journal_header.h_blocktype)) { case JFS_DESCRIPTOR_BLOCK: os << "Descriptor block"; break; case JFS_COMMIT_BLOCK: os << "Commit block"; break; case JFS_SUPERBLOCK_V1: os << "Superblock version 1"; break; case JFS_SUPERBLOCK_V2: os << "Superblock version 2"; break; case JFS_REVOKE_BLOCK: os << "Revoke block"; break; default: os << "*UNKNOWN* (0x" << std::hex << be2le(journal_header.h_blocktype) << std::dec << ')'; break; } os << '\n'; os << "Sequence Number: " << be2le(journal_header.h_sequence); return os; } std::ostream& operator<<(std::ostream& os, journal_superblock_t const& journal_super_block) { os << journal_super_block.s_header << '\n'; os << "Journal block size: " << be2le(journal_super_block.s_blocksize) << '\n'; os << "Number of journal blocks: " << be2le(journal_super_block.s_maxlen) << '\n'; os << "Journal block where the journal actually starts: " << be2le(journal_super_block.s_first) << '\n'; os << "Sequence number of first transaction: " << be2le(journal_super_block.s_sequence) << '\n'; os << "Journal block of first transaction: " << be2le(journal_super_block.s_start) << '\n'; os << "Error number: " << be2le(journal_super_block.s_errno) << '\n'; if (be2le(journal_super_block.s_header.h_blocktype) != JFS_SUPERBLOCK_V2) return os; os << "Compatible Features: " << be2le(journal_super_block.s_feature_compat) << '\n'; os << "Incompatible features: " << be2le(journal_super_block.s_feature_incompat) << '\n'; os << "Read only compatible features: " << be2le(journal_super_block.s_feature_ro_compat) << '\n'; os << "Journal UUID:"; for (int i = 0; i < 16; ++i) os << std::hex << " 0x" << std::setfill('0') << std::setw(2) << (int)be2le(journal_super_block.s_uuid[i]); os << std::dec << '\n'; int32_t nr_users = be2le(journal_super_block.s_nr_users); os << "Number of file systems using journal: " << nr_users << '\n'; ASSERT(nr_users <= 48); os << "Location of superblock copy: " << be2le(journal_super_block.s_dynsuper) << '\n'; os << "Max journal blocks per transaction: " << be2le(journal_super_block.s_max_transaction) << '\n'; os << "Max file system blocks per transaction: " << be2le(journal_super_block.s_max_trans_data) << '\n'; os << "IDs of all file systems using the journal:\n"; for (int u = 0; u < nr_users; ++u) { os << (u + 1) << '.'; for (int i = 0; i < 16; ++i) os << std::hex << " 0x" << std::setfill('0') << std::setw(2) << (int)be2le(journal_super_block.s_users[u * 16 + i]); os << std::dec << '\n'; } return os; } std::ostream& operator<<(std::ostream& os, journal_block_tag_t const& journal_block_tag) { os << "File system block: " << be2le(journal_block_tag.t_blocknr) << '\n'; os << "Entry flags:"; uint32_t flags = be2le(journal_block_tag.t_flags); if ((flags & JFS_FLAG_ESCAPE)) os << " ESCAPED"; if ((flags & JFS_FLAG_SAME_UUID)) os << " SAME_UUID"; if ((flags & JFS_FLAG_DELETED)) os << " DELETED"; if ((flags & JFS_FLAG_LAST_TAG)) os << " LAST_TAG"; os << '\n'; return os; } std::ostream& operator<<(std::ostream& os, journal_revoke_header_t const& journal_revoke_header) { os << journal_revoke_header.r_header << '\n'; uint32_t count = be2le(journal_revoke_header.r_count); os << "Bytes used: " << count << '\n'; ASSERT(sizeof(journal_revoke_header_t) <= count && count <= (size_t)block_size_); count -= sizeof(journal_revoke_header_t); ASSERT(count % sizeof(__be32) == 0); count /= sizeof(__be32); __be32 const* ptr = reinterpret_cast<__be32 const*>((unsigned char const*)&journal_revoke_header + sizeof(journal_revoke_header_t)); int c = 0; if (count > 0) std::cout << "Revoked blocks:\n"; for (uint32_t b = 0; b < count; ++b) { std::cout << std::setfill(' ') << std::setw(9) << be2le(ptr[b]); ++c; c &= 7; if (c == 0) std::cout << '\n'; else std::cout << ' '; } return os; } ext3grep-0.10.1/src/Parent.h0000644000175000017500000000332011031754744012450 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file Parent.h Declaration of struct Parent. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef PARENT_H #define PARENT_H #ifndef USE_PCH #include "ext3.h" // Needed for ext3_dir_entry_2 #include // Needed for uint32_t #include // Needed for std::string #endif #include "inode.h" // Needed for InodePointer struct Parent { Parent* M_parent; ext3_dir_entry_2 const* M_dir_entry; InodePointer M_inode; uint32_t M_inodenr; Parent(InodePointer const& inode, uint32_t inodenr) : M_parent(NULL), M_dir_entry(NULL), M_inode(inode), M_inodenr(inodenr) { } Parent(Parent* parent, ext3_dir_entry_2 const* dir_entry, InodePointer const& inode, uint32_t inodenr) : M_parent(parent), M_dir_entry(dir_entry), M_inode(inode), M_inodenr(inodenr) { } std::string dirname(bool show_inodes) const; }; #endif // PARENT_H ext3grep-0.10.1/src/printing.cc0000644000175000017500000000476011077716157013226 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file printing.cc Functions that print stuff. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #endif #include "globals.h" #include "forward_declarations.h" #include "commandline.h" //----------------------------------------------------------------------------- // // Printing // void print_block_to(std::ostream& os, unsigned char* block) { unsigned char buf[16]; size_t offset = 0; bool last_was_star = false; for (unsigned char* p = block; p < block + block_size_; p += 16, offset += 16) { if (offset > 0 && offset + 16 < block_size_ && memcmp(buf, p, 16) == 0) { if (!last_was_star) { os << " *\n"; last_was_star = true; } continue; } dump_hex_to(os, p, 16, offset); memcpy(buf, p, 16); last_was_star = false; } } void print_restrictions(void) { if (commandline_allocated) std::cout << "Only showing entries with allocated inodes.\n"; if (commandline_unallocated) std::cout << "Only showing entries with unallocated inodes.\n"; if (commandline_deleted) std::cout << "Only showing entries that were deleted.\n"; if (commandline_directory) std::cout << "Only showing inodes that are directories.\n"; if (commandline_before || commandline_after) { std::cout << "Only show/process deleted entries if they are deleted "; if (commandline_after) std::cout << "on or after " << commandline_after; if (commandline_before && commandline_after) std::cout << " and "; if (commandline_before) std::cout << "before " << commandline_before; std::cout << '.' << std::endl; } } ext3grep-0.10.1/src/blocknr_vector_type.cc0000644000175000017500000000476511031434216015435 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file blocknr_vector_type.cc Implementation of union blocknr_vector_type. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #endif #include "blocknr_vector_type.h" blocknr_vector_type& blocknr_vector_type::operator=(std::vector const& vec) { if (!empty()) erase(); uint32_t size = vec.size(); if (size > 0) { if (size == 1) blocknr = (vec[0] << 1) | 1; else { blocknr_vector = new uint32_t [size + 1]; blocknr_vector[0] = size; for (uint32_t i = 0; i < size; ++i) blocknr_vector[i + 1] = vec[i]; } } return *this; } void blocknr_vector_type::push_back(uint32_t bnr) { if (empty()) { ASSERT(bnr); blocknr = (bnr << 1) | 1; } else if (is_vector()) { uint32_t size = blocknr_vector[0] + 1; uint32_t* ptr = new uint32_t [size + 1]; ptr[0] = size; for (uint32_t i = 1; i < size; ++i) ptr[i] = blocknr_vector[i]; ptr[size] = bnr; delete [] blocknr_vector; blocknr_vector = ptr; } else { uint32_t* ptr = new uint32_t [3]; ptr[0] = 2; ptr[1] = blocknr >> 1; ptr[2] = bnr; blocknr_vector = ptr; } } void blocknr_vector_type::remove(uint32_t blknr) { ASSERT(is_vector()); uint32_t size = blocknr_vector[0]; int found = 0; for (uint32_t j = 1; j <= size; ++j) if (blocknr_vector[j] == blknr) { found = j; break; } ASSERT(found); blocknr_vector[found] = blocknr_vector[size]; blocknr_vector[0] = --size; if (size == 1) { int last_block = blocknr_vector[1]; delete [] blocknr_vector; blocknr = (last_block << 1) | 1; } } ext3grep-0.10.1/src/get_block.cc0000644000175000017500000000246211031441720013277 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file get_block.cc Implementation of the get_block function. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include "debug.h" #endif #include "globals.h" #include "conversion.h" unsigned char* get_block(int block, unsigned char* block_buf) { device.seekg(block_to_offset(block)); ASSERT(device.good()); device.read((char*)block_buf, block_size_); ASSERT(device.good()); return block_buf; } ext3grep-0.10.1/src/globals.h0000644000175000017500000000470611031750027012641 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file globals.h Declaration of global variables. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef GLOBALS_H #define GLOBALS_H #ifndef USE_PCH #include // Needed for uint32_t #include // Needed for std::ifstream #include // Needed for std::string #endif #include "ext3.h" // Needed for ext3_super_block, ext3_group_desc and Inode #include "bitmap.h" // Needed for bitmap_t // The superblock. extern ext3_super_block super_block; // Frequently used constant values from the superblock. extern int groups_; extern int block_size_; extern int block_size_log_; extern int inodes_per_group_; extern int inode_size_; extern uint32_t inode_count_; extern uint32_t block_count_; // The journal super block. extern journal_superblock_t journal_super_block; // Frequently used constant values from the journal superblock. extern int journal_block_size_; extern int journal_maxlen_; extern int journal_first_; extern int journal_sequence_; extern int journal_start_; extern Inode journal_inode; // Globally used variables. extern char const* progname; extern std::ifstream device; #if USE_MMAP extern int device_fd; extern long page_size_; extern void** all_mmaps; extern int* refs_to_mmap; extern int nr_mmaps; #endif extern char* reserved_memory; extern Inode const** all_inodes; extern bitmap_t** block_bitmap; extern bitmap_t** inode_bitmap; extern char* inodes_buf; extern ext3_group_desc* group_descriptor_table; extern int no_filtering; extern std::string device_name; extern bool feature_incompat_filetype; extern uint32_t wrapped_journal_sequence; #endif // GLOBALS_H ext3grep-0.10.1/src/dump_names.cc0000644000175000017500000000345411031441364013504 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file dump_names.cc Implementation of --dump_names and --restore-all. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include "debug.h" #endif #include "forward_declarations.h" #include "init_directories.h" #include "init_files.h" #include "commandline.h" void dump_names(void) { DoutEntering(dc::notice, "dump_names()"); init_files(); std::list paths; for (all_directories_type::iterator iter = all_directories.begin(); iter != all_directories.end(); ++iter) paths.push_back(iter->first); for (path_to_inode_map_type::iterator iter = path_to_inode_map.begin(); iter != path_to_inode_map.end(); ++iter) paths.push_back(iter->first); paths.sort(); for (std::list::iterator iter = paths.begin(); iter != paths.end(); ++iter) if (!iter->empty()) { if (commandline_restore_all) restore_file(*iter); else std::cout << *iter << '\n'; } } ext3grep-0.10.1/src/histogram.h0000644000175000017500000000272611031750111013205 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file histogram.h Declarations for histogram.cc // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef HISTOGRAM_H #define HISTOGRAM_H // The type of commandline_histogram. enum hist_type { hist_none = 0, // No histogram. hist_atime, // Request histogram of access times. hist_ctime, // Request histogram of file modification times. hist_mtime, // Request histogram of inode modification times. hist_dtime, // Request histogram of deletion times. hist_group // Request histogram of deletions per group. }; #endif // HISTOGRAM_H ext3grep-0.10.1/src/locate.h0000644000175000017500000000225611031754702012467 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file locate.h Header for file locate.cc. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef LOCATE_H #define LOCATE_H #include #include std::string parent_directory(int blocknr, std::set const& filenames); bool path_exists(std::string const& path); #endif // LOCATE_H ext3grep-0.10.1/src/FileMode.h0000644000175000017500000000437011031747657012716 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file FileMode.h Declaration of class FileMode. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef FILEMODE_H #define FILEMODE_H #ifndef USE_PCH #include // Needed for std::ostream and several operator<<'s. #endif #include "endian_conversion.h" // Needed for __le16 class FileMode { private: __le16 M_mode; public: FileMode(__le16 mode) : M_mode(mode) { } friend std::ostream& operator<<(std::ostream& os, FileMode const& file_mode) { __le16 mode(file_mode.M_mode); switch ((mode & 0xf000)) { case 0x1000: os << 'p'; // "FIFO"; break; case 0x2000: os << 'c'; // "Character device"; break; case 0x4000: os << 'd'; // "Directory"; break; case 0x6000: os << 'b'; // "Block device"; break; case 0x8000: os << 'r'; // "Regular file"; break; case 0xA000: os << 'l'; // "Symbolic link"; break; case 0xC000: os << 's'; // "UNIX socket"; break; } static char const* s[4] = { "rwxrwxrwx", "rwsrwsrwt", "---------", "--S--S--T" }; int i = 0; __le16 smask = 04000; for (__le16 mask = 0400; mask; mask >>= 1, ++i) { int k = (mode & (smask >> (i / 3))) ? 1 : 0; if ((mode & mask)) os << s[k][i]; else os << s[k + 2][i]; } return os; } }; #endif // FILEMODE_H ext3grep-0.10.1/src/inode_refers_to.cc0000644000175000017500000000425611075471534014535 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file inode_refers_to.cc Implementation of function inode_refers_to. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include "ext3.h" #endif #include "indirect_blocks.h" struct inode_refers_to_st { int block_number; bool found; }; void inode_refers_to_action(int blocknr, int, void* ptr) { inode_refers_to_st& data(*reinterpret_cast(ptr)); if (blocknr == data.block_number) data.found = true; } #ifdef CPPGRAPH void iterate_over_all_blocks_of__with__inode_refers_to_action(void) { inode_refers_to_action(0, 0, NULL); } #endif bool inode_refers_to(Inode const& inode, int inode_number, int block_number) { inode_refers_to_st data; data.block_number = block_number; data.found = false; #ifdef CPPGRAPH // Tell cppgraph that we call inode_refers_to_action from here. iterate_over_all_blocks_of__with__inode_refers_to_action(); #endif bool reused_or_corrupted_indirect_block9 = iterate_over_all_blocks_of(inode, inode_number, inode_refers_to_action, &data); if (data.found) return true; if (reused_or_corrupted_indirect_block9) std::cout << "WARNING: Could not verify if inode " << inode_number << " refers to block " << block_number << " : encountered a reused or corrupted (double/triple) indirect block!\n"; return false; } ext3grep-0.10.1/src/histogram.cc0000644000175000017500000000573111031443413013346 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file histogram.cc Implementation of --histogram. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include "debug.h" #endif #include "commandline.h" //----------------------------------------------------------------------------- // // Histogram // int const histsize = 100; static size_t S_min; static size_t S_max; static size_t S_bs; static int histo[histsize]; static int S_maxcount; void hist_init(size_t min, size_t max) { S_min = min; S_max = max; ASSERT(max > min); S_bs = 1; while ((max - 1 - min) / S_bs > histsize - 1) ++S_bs; std::memset(histo, 0, sizeof(histo)); S_maxcount = 0; } void hist_add(size_t val) { ASSERT(val >= S_min && val < S_max); histo[(val - S_min) / S_bs] += 1; S_maxcount = std::max(S_maxcount, histo[(val - S_min) / S_bs]); } void hist_print(void) { if (S_maxcount == 0) { std::cout << "No counts\n"; return; } static char const line[] = "===============================================================================================================================================================END!"; int i = 0; size_t total_count = 0; for (size_t val = S_min;; val += S_bs, ++i) { if (commandline_histogram == hist_atime || commandline_histogram == hist_ctime || commandline_histogram == hist_mtime || commandline_histogram == hist_dtime) { time_t time_val = val; std::string time_str(ctime(&time_val)); std::cout << time_str.substr(0, time_str.length() - 1) << " "; } std::cout << std::setfill(' ') << std::setw(8) << val << ' '; if (val >= S_max) break; std::cout << std::setfill(' ') << std::setw(8) << histo[i] << ' '; std::streamsize tower = static_cast(histo[i] * 100.0 / S_maxcount); std::cout.write(line, tower); std::cout << '\n'; total_count += histo[i]; } std::cout << "\nTotals:\n"; std::cout << std::setw(8) << S_min << " - " << std::setfill(' ') << std::setw(8) << (S_max - 1) << ' '; std::cout << std::setfill(' ') << std::setw(8) << total_count << '\n'; } ext3grep-0.10.1/src/conversion.h0000644000175000017500000000436611031747203013407 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file conversion.h Conversion functions. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef CONVERSION_H #define CONVERSION_H #include "superblock.h" #include "globals.h" // Convert byte-offset to block. // Returns the block number that contains the byte at offset bytes from the start of the device file. inline int offset_to_block(ext3_super_block const& super_block, off_t offset) { return offset / block_size(super_block); } // Convert block number to group. // Returns the group number of block. inline int block_to_group(ext3_super_block const& super_block, int block) { return (block - first_data_block(super_block)) / blocks_per_group(super_block); } // Convert group to block number. // Returns the block number of the first block of a group. inline int group_to_block(ext3_super_block const& super_block, int group) { return first_data_block(super_block) + group * blocks_per_group(super_block); } // Convert inode number to group. // Returns the group number of inode. inline int inode_to_group(ext3_super_block const& super_block, int inode_number) { return (inode_number - 1) / inodes_per_group(super_block); } // Convert block to byte-offset. // Returns the offset (dd --seek) in the device file to the first byte of the block. inline off_t block_to_offset(int block) { off_t offset = block; offset <<= block_size_log_; return offset; } #endif // CONVERSION_H ext3grep-0.10.1/src/init_directories.cc0000644000175000017500000007210711031756657014732 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file init_directories.cc Implementation of init_directories (stage 2). // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include #include #include #include #include #endif #include "locate.h" #include "init_directories.h" #include "blocknr_vector_type.h" #include "Parent.h" #include "forward_declarations.h" #include "commandline.h" #include "get_block.h" #include "journal.h" #include "dir_inode_to_block.h" all_directories_type all_directories; inode_to_directory_type inode_to_directory; Directory::Directory(uint32_t inode_number, int first_block) : M_inode_number(inode_number), M_blocks(1) #ifdef DEBUG , M_extended_blocks_added(false) #endif { std::list::iterator iter = M_blocks.begin(); iter->read_block(first_block, iter); } typedef std::map inode_to_extended_blocks_map_type; bool init_directories_action(ext3_dir_entry_2 const& dir_entry, Inode const&, bool, bool, bool, bool, bool, bool, Parent* parent, void*) { // Get the inode number. uint32_t const inode_number = dir_entry.inode; // If this is a new directory, skip iterating into it if we already processed it. // If it's directory '.' we need to continue with this function. if (dir_entry.name_len != 1 || dir_entry.name[0] != '.') { inode_to_directory_type::iterator iter = inode_to_directory.find(inode_number); return iter != inode_to_directory.end(); } // If we get here then that means that 'inode_number' is a directory that // we have a first block for (dir_entry is for entry "."). We possibly found // more directory start blocks for this inode number in which case we'll // get here more than once for this inode number. // Get the first block. int first_block = dir_inode_to_block(inode_number); if (first_block == -1) { std::cout << std::flush; std::cerr << "ERROR: dir_inode_to_block(" << inode_number << ") returned -1.\n"; } ASSERT(first_block != -1); // Store a new entry in the all_directories container. std::pair res = all_directories.insert(all_directories_type::value_type(parent->dirname(false), Directory(inode_number, first_block))); if (!res.second) // Did we already see this path before? Make sure the inode is consistent. { if (inode_number == res.first->second.inode_number() && first_block == res.first->second.first_block()) { //std::cout << "Aborting recursion of " << parent->dirname(commandline_show_path_inodes) << '\n'; return true; // Abort recursion. } std::cout << "Directory \"" << parent->dirname(commandline_show_path_inodes) << "\" is linked to both inode/block " << inode_number << '/' << first_block << " as well as " << res.first->second.inode_number() << '/' << res.first->second.first_block() << "\n"; // If we don't do anything here, the assertion `directory.inode_number() == iter->first' in init_directories() will fail. // See http://groups.google.com/group/ext3grep/browse_thread/thread/38bbcc9bba214240/987815a7bba17190?hl=en#987815a7bba17190 // Lets call inode_number/first_block 'new', and inode_number()/first_block() 'old'. int sequence_number_new = last_undeleted_directory_inode_refering_to_block(inode_number, first_block); int sequence_number_old = last_undeleted_directory_inode_refering_to_block(res.first->second.inode_number(), res.first->second.first_block()); if (sequence_number_new == sequence_number_old) { std::cout << std::endl; std::cerr << "WARNING: ext3grep currently does not support this situation:\n"; std::cerr << " last_undeleted_directory_inode_refering_to_block(" << inode_number << ", " << first_block << ") = " << sequence_number_new << '\n'; std::cerr << " last_undeleted_directory_inode_refering_to_block(" << res.first->second.inode_number() << ", " << res.first->second.first_block() << ") = " << sequence_number_old << '\n'; std::cerr << "Since most people don't like it if ext3grep aborts; we'll randomly pick one of them. It could be the WRONG one though." << std::endl; sequence_number_new = 0; // Drop the new one. } if (sequence_number_new > sequence_number_old) { // The new inode/block pair is newer, therefore we keep 'inode_number' and replace all_directories element. std::cout << "Replacing " << res.first->second.inode_number() << '/' << res.first->second.first_block() << " (sequence " << sequence_number_old << ") with " << inode_number << '/' << first_block; if (sequence_number_new == std::numeric_limits::max()) std::cout << " (allocated"; else std::cout << " (sequence " << sequence_number_new; std::cout << ").\n"; inode_to_directory_type::iterator iter = inode_to_directory.find(res.first->second.inode_number()); ASSERT(iter != inode_to_directory.end()); ASSERT(iter->second == res.first); inode_to_directory.erase(iter); all_directories.erase(res.first); res = all_directories.insert(all_directories_type::value_type(parent->dirname(false), Directory(inode_number, first_block))); ASSERT(res.second); } else { // The old inode/block pair is newer, therefore we keep the all_directories element // and do not insert the new inode in inode_to_directory. Moreover, we consider // the current directory block to unusable, so we abort recursion of it. std::cout << "Keeping " << res.first->second.inode_number() << '/' << res.first->second.first_block(); if (sequence_number_old == std::numeric_limits::max()) std::cout << " (allocated"; else std::cout << " (sequence " << sequence_number_old; std::cout << ") over " << inode_number << '/' << first_block << " (sequence " << sequence_number_new << ").\n"; return true; // Abort recursion. } // Consistency check: ASSERT(inode_number == res.first->second.inode_number()); } std::pair res2 = inode_to_directory.insert(inode_to_directory_type::value_type(inode_number, res.first)); if (!res2.second) // Did we get here with this inode number before? Make sure the path is consistent! { if (inode_number == res2.first->second->second.inode_number() && res.first == res2.first->second) { //std::cout << "Aborting recursion of " << parent->dirname(commandline_show_path_inodes) << '\n'; return true; // Abort recursion. } std::cout << "Inode number " << inode_number << " is linked to both, " << parent->dirname(commandline_show_path_inodes) << " as well as " << res2.first->second->first << "!\n"; bool new_path = path_exists(parent->dirname(false)); bool old_path = path_exists(res2.first->second->first); if (new_path && !old_path) { std::cout << "Using \"" << parent->dirname(commandline_show_path_inodes) << "\" as \"" << res2.first->second->first << " doesn't exist in the locate database.\n"; inode_to_directory.erase(res2.first); std::pair res3 = inode_to_directory.insert(inode_to_directory_type::value_type(inode_number, res.first)); ASSERT(res3.second); } else if (!new_path && old_path) std::cout << "Keeping \"" << res2.first->second->first << "\" as \"" << parent->dirname(commandline_show_path_inodes) << " doesn't exist in the locate database.\n"; else if (!new_path && !old_path) std::cout << "WARNING: Neither exist in the locate database (you might want to add one). Keeping \"" << res2.first->second->first << "\".\n"; ASSERT(!(new_path && old_path)); } return false; } struct extended_directory_action_data_st { int blocknr; std::map linked; // inode to count (number of times a linked dir_entry refers to it). std::map unlinked; // inode to count (number of times an unlinked dir_entry refers to it). }; bool filename_heuristics_action(ext3_dir_entry_2 const& dir_entry, Inode const& UNUSED(inode), bool UNUSED(deleted), bool UNUSED(allocated), bool UNUSED(reallocated), bool UNUSED(zero_inode), bool UNUSED(linked), bool UNUSED(filtered), Parent*, void* data) { std::set* filesnames = reinterpret_cast*>(data); std::string filename(dir_entry.name, dir_entry.name_len); filesnames->insert(filename); return false; } #ifdef CPPGRAPH void iterate_over_directory__with__filename_heuristics_action(void) { (void)filename_heuristics_action(*(ext3_dir_entry_2 const*)NULL, *(Inode const*)NULL, 0, 0, 0, 0, 0, 0, NULL, NULL); } #endif bool extended_directory_action(ext3_dir_entry_2 const& dir_entry, Inode const& inode, bool UNUSED(deleted), bool UNUSED(allocated), bool reallocated, bool zero_inode, bool linked, bool UNUSED(filtered), Parent*, void* ptr) { extended_directory_action_data_st* data = reinterpret_cast(ptr); bool is_maybe_directory = true; // Maybe, because if !feature_incompat_filetype then it isn't // garanteed that the contents of the inode still belong to this entry. if (feature_incompat_filetype) is_maybe_directory = (dir_entry.file_type & 7) == EXT3_FT_DIR; else if (!zero_inode && !reallocated) is_maybe_directory = is_directory(inode); if (is_maybe_directory && !zero_inode) { int blocknr2 = dir_inode_to_block(dir_entry.inode); if (blocknr2 == -1) { // Don't print this message if !feature_incompat_filetype && reallocated // because it more likely to just not being a directory inode. if (feature_incompat_filetype || !reallocated) std::cout << "Cannot find a directory block for inode " << dir_entry.inode << ".\n"; return true; } static unsigned char block_buf[EXT3_MAX_BLOCK_SIZE]; get_block(blocknr2, block_buf); ext3_dir_entry_2 const* dir_entry2 = reinterpret_cast(block_buf); ASSERT(dir_entry2->inode == dir_entry.inode); dir_entry2 = reinterpret_cast(block_buf + dir_entry2->rec_len); ASSERT(dir_entry2->name_len == 2 && dir_entry2->name[0] == '.' && dir_entry2->name[1] == '.'); ASSERT(dir_entry2->inode); std::map& inode_to_count(linked ? data->linked : data->unlinked); std::map::iterator iter = inode_to_count.find(dir_entry2->inode); if (iter == inode_to_count.end()) inode_to_count[dir_entry2->inode] = 1; else ++(inode_to_count[dir_entry2->inode]); } return false; } #ifdef CPPGRAPH void iterate_over_directory__with__extended_directory_action(void) { (void)extended_directory_action(*(ext3_dir_entry_2 const*)NULL, *(Inode const*)NULL, 0, 0, 0, 0, 0, 0, NULL, NULL); } #endif bool find_inode_number_of_extended_directory_block(int blocknr, unsigned char* block_buf, uint32_t& inode_number, uint32_t& inode_from_journal) { block_to_dir_inode_map_type::iterator iter = block_to_dir_inode_map.find(blocknr); inode_from_journal = (iter == block_to_dir_inode_map.end()) ? 0 : iter->second; get_block(blocknr, block_buf); extended_directory_action_data_st data; data.blocknr = blocknr; #ifdef CPPGRAPH // Let cppgraph know that we call extended_directory_action from here. iterate_over_directory__with__extended_directory_action(); #endif ++no_filtering; iterate_over_directory(block_buf, blocknr, extended_directory_action, NULL, &data); --no_filtering; bool linked = (data.linked.size() > 0); std::map& inode_to_count(linked ? data.linked : data.unlinked); inode_number = 0; if (inode_to_count.size() > 0) { if (inode_to_count.size() > 1) { if (inode_from_journal) std::cout << "Extended directory at " << blocknr << " has entries that appear to be directories, but their parent directory inode is not consistent.\n"; else { std::cout << "WARNING: extended directory at " << blocknr << " has entries that appear to be directories, " "but their parent directory inode is not consistent! I can't make this decision for you. " "You will have to manually pick an inode for this block number. The inodes that I found are (although ALL could be wrong):\n"; for (std::map::iterator iter = inode_to_count.begin(); iter != inode_to_count.end(); ++iter) { std::cout << " " << iter->first << " (" << iter->second; if (iter->second == 1) std::cout << " time)\n"; else std::cout << " times)\n"; } } } else { inode_number = inode_to_count.begin()->first; bool journal_disagrees_with_found_directory_inodes = inode_from_journal && inode_from_journal != inode_number; if (journal_disagrees_with_found_directory_inodes) { std::cout << "Extended directory at " << blocknr << " appears to contains " << inode_to_count.begin()->second << ' ' << (linked ? "linked" : "unlinked") << " directory whose parent directory has inode " << inode_number << " but according to the journal it should be " << inode_from_journal << ". Using the latter.\n"; // We trust our journal based algorithm more because the content of // inodes can hardly be trusted: they can be reused and not refer // to this dir entry at all. Especially in the case of !feature_incompat_filetype // where even regular files' inodes can have been reused (by directories) // this will happen frequently, but independent of the frequency at which // it occurs, the journal is simply more reliable. inode_number = inode_from_journal; // However... if (linked) std::cout << "WARNING: We really only expect that to happen for unlinked directory entries. Have a look at block " << blocknr << '\n'; if (inode_to_count.begin()->second > 1) std::cout << "WARNING: It's suspiciously weird that there are more than one such \"directories\". Have a look at block " << blocknr << '\n'; } else std::cout << "Extended directory at " << blocknr << " belongs to inode " << inode_number << " (from " << inode_to_count.begin()->second << ' ' << (linked ? "linked" : "unlinked") << " directories).\n"; } } if (!inode_number) // Not found yet? { #ifdef CPPGRAPH // Let cppgraph know that we call filename_heuristics_action from here. iterate_over_directory__with__filename_heuristics_action(); #endif // Do some heuristics on the filenames. std::set filenames; ++no_filtering; iterate_over_directory(block_buf, blocknr, filename_heuristics_action, NULL, &filenames); --no_filtering; if (filenames.empty()) { if (inode_from_journal) { std::cout << "Extended directory at " << blocknr << " belongs to inode " << inode_from_journal << " (empty; from journal)).\n"; inode_number = inode_from_journal; } else std::cout << "Could not find an inode for empty extended directory at " << blocknr << '\n'; } else { std::string dir = parent_directory(blocknr, filenames); if (dir.empty()) { if (inode_from_journal) { std::cout << "Extended directory at " << blocknr << " belongs to inode " << inode_from_journal << " (from journal).\n"; inode_number = inode_from_journal; } else std::cout << "Could not find an inode for extended directory at " << blocknr << ", disregarding it's contents.\n"; } else { all_directories_type::iterator directory_iter = all_directories.find(dir); if (directory_iter == all_directories.end()) { std::cout << "Extended directory at " << blocknr << " belongs to directory " << dir << " which isn't in all_directories yet.\n"; return true; // Needs to be processed again later. } else { inode_number = directory_iter->second.inode_number(); std::cout << "Extended directory at " << blocknr << " belongs to inode " << inode_number << '\n'; if (inode_from_journal && inode_from_journal != inode_number) std::cout << "WARNING: according to the journal it should have been inode " << inode_from_journal << "!?\n"; } } } } return false; // Done } void init_directories(void) { static bool initialized = false; if (initialized) return; initialized = true; DoutEntering(dc::notice, "init_directories()"); std::string device_name_basename = device_name.substr(device_name.find_last_of('/') + 1); std::string cache_stage2 = device_name_basename + ".ext3grep.stage2"; struct stat sb; bool have_cache = !(stat(cache_stage2.c_str(), &sb) == -1); if (have_cache) { if (does_not_end_on_END(cache_stage2)) have_cache = false; } else if (errno != ENOENT) { int error = errno; std::cout << std::flush; std::cerr << progname << ": failed to open " << cache_stage2 << ": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } if (!have_cache) { init_dir_inode_to_block_cache(); unsigned char* block_buf = new unsigned char [block_size_]; inode_to_extended_blocks_map_type inode_to_extended_blocks_map; // Run over all extended directory blocks. for (std::vector::iterator iter = extended_blocks.begin(); iter != extended_blocks.end(); ++iter) { int blocknr = *iter; uint32_t inode_number; uint32_t inode_from_journal; bool needs_reprocessing = find_inode_number_of_extended_directory_block(blocknr, block_buf, inode_number, inode_from_journal); if (needs_reprocessing) { // FIXME: should be processed again after adding extended directory blocks to all_directories! std::cout << "FIXME: Extended directory at " << blocknr << " belongs to non-existent directory!\n"; // Fall back to journal. if (inode_from_journal) { std::cout << "Extended directory at " << blocknr << " belongs to inode " << inode_from_journal << " (fall back to journal).\n"; inode_number = inode_from_journal; } } if (inode_number) { // Add the found inode number of this extended block to inode_to_extended_blocks_map. inode_to_extended_blocks_map_type::iterator iter2 = inode_to_extended_blocks_map.find(inode_number); if (iter2 != inode_to_extended_blocks_map.end()) iter2->second.push_back(blocknr); else { blocknr_vector_type bv; bv.blocknr = 0; bv.push_back(blocknr); inode_to_extended_blocks_map.insert(inode_to_extended_blocks_map_type::value_type(inode_number, bv)); } } } // Get root inode. InodePointer root_inode(get_inode(EXT3_ROOT_INO)); Parent parent(root_inode, EXT3_ROOT_INO); // Get the block that refers to inode EXT3_ROOT_INO. int root_blocknr = dir_inode_to_block(EXT3_ROOT_INO); ASSERT(root_blocknr != -1); // This should be impossible; inode EXT3_ROOT_INO is never wiped(?). // Initialize root_extended_blocks to be the extended directory blocks of the root. blocknr_vector_type root_extended_blocks; int root_extended_blocks_size = 0; inode_to_extended_blocks_map_type::iterator root_extended_blocks_iter = inode_to_extended_blocks_map.find(EXT3_ROOT_INO); if (root_extended_blocks_iter != inode_to_extended_blocks_map.end()) { root_extended_blocks = root_extended_blocks_iter->second; root_extended_blocks_size = root_extended_blocks.size(); ASSERT(root_extended_blocks_size > 0); } #ifdef CPPGRAPH // Let cppgraph know that we call init_directories_action from here. iterate_over_directory__with__init_directories_action(); #endif // Run over all directory blocks and add all start blocks to all_directories, updating inode_to_directory. int last_extended_block_index = root_extended_blocks_size; for(int blocknr = root_blocknr;; blocknr = root_extended_blocks[--last_extended_block_index]) { // Get the contents of this block of the root directory. get_block(blocknr, block_buf); // Iterate over all directory blocks. int depth_store = commandline_depth; commandline_depth = 10000; iterate_over_directory(block_buf, root_blocknr, init_directories_action, &parent, NULL); commandline_depth = depth_store; if (last_extended_block_index == 0) break; } // Next, add all extended directory blocks. for (all_directories_type::iterator dir_iter = all_directories.begin(); dir_iter != all_directories.end(); ++dir_iter) { #ifdef DEBUG ASSERT(!dir_iter->second.extended_blocks_added()); #endif uint32_t inode_number = dir_iter->second.inode_number(); inode_to_extended_blocks_map_type::iterator iter = inode_to_extended_blocks_map.find(inode_number); if (iter != inode_to_extended_blocks_map.end()) { blocknr_vector_type bv = iter->second; int const size = bv.size(); if (size > 0) { std::cout << "Adding extended directory block(s) for directory \"" << dir_iter->first << "\"." << std::endl; unsigned char* block_buf = new unsigned char [block_size_]; for (int j = 0; j < size; ++j) { int blocknr = bv[j]; get_block(blocknr, block_buf); // Add extended directory as DirectoryBlock to the corresponding Directory. dir_iter->second.blocks().push_back(DirectoryBlock()); std::list::iterator directory_block_iter = dir_iter->second.blocks().end(); --directory_block_iter; directory_block_iter->read_block(blocknr, directory_block_iter); // Set up a Parent object that will return the correct dirname. ext3_dir_entry_2 fake_dir_entry; fake_dir_entry.inode = inode_number; fake_dir_entry.rec_len = 0; // Not used fake_dir_entry.file_type = 0; // Not used fake_dir_entry.name_len = dir_iter->first.size(); strncpy(fake_dir_entry.name, dir_iter->first.c_str(), fake_dir_entry.name_len); InodePointer fake_reference(0); Parent dummy_parent(fake_reference, 0); InodePointer inoderef(get_inode(inode_number)); Parent parent(&dummy_parent, &fake_dir_entry, inoderef, inode_number); ASSERT(parent.dirname(false) == dir_iter->first); // Iterate over all directory blocks that we can reach. int depth_store = commandline_depth; commandline_depth = 10000; iterate_over_directory(block_buf, blocknr, init_directories_action, &parent, NULL); commandline_depth = depth_store; } delete [] block_buf; } } #ifdef DEBUG dir_iter->second.set_extended_blocks_added(); #endif } #ifdef DEBUG // The block inside the above loop adds new elements to all_directories. If those are // added AFTER dir_iter then there is no problem because std::map iterators aren't // invalidated by insertion and they will be taken into account later in the // same loop. If dir_iter points to a Directory with a path a/b/c then inode_number // is the inode number of that 'c' directory. Extended blocks of that directory // only add "." dir entries for recursively found directories, ie a/b/c/d and // are therefore inserted after the current element and processed automatically // in the same loop. Therefore, the following should hold: for (all_directories_type::iterator dir_iter = all_directories.begin(); dir_iter != all_directories.end(); ++dir_iter) ASSERT(dir_iter->second.extended_blocks_added()); #endif all_directories_type::iterator lost_plus_found_directory_iter = all_directories.find("lost+found"); ASSERT(lost_plus_found_directory_iter != all_directories.end()); // Add all remaining extended directory blocks to lost+found. // Also free memory of inode_to_extended_blocks_map. for (inode_to_extended_blocks_map_type::iterator iter = inode_to_extended_blocks_map.begin(); iter != inode_to_extended_blocks_map.end(); ++iter) { uint32_t inode_number = iter->first; blocknr_vector_type bv = iter->second; inode_to_directory_type::iterator directory_iter = inode_to_directory.find(inode_number); if (directory_iter == inode_to_directory.end()) // Not added already? { if (bv.size() == 1) std::cout << "WARNING: Can't link block"; else std::cout << "WARNING: Can't link blocks"; for (size_t j = 0; j < bv.size(); ++j) std::cout << ' ' << bv[j]; std::cout << " to inode " << inode_number << " because that inode cannot be found in the inode_to_directory map. Linking it to lost+found instead!\n"; // FIXME: namespace polution. These should be put in lost+found/inode_number or something. for (size_t j = 0; j < bv.size(); ++j) { int blocknr = bv[j]; // Add extended directory as DirectoryBlock to lost+found. lost_plus_found_directory_iter->second.blocks().push_back(DirectoryBlock()); std::list::iterator directory_block_iter = lost_plus_found_directory_iter->second.blocks().end(); --directory_block_iter; directory_block_iter->read_block(blocknr, directory_block_iter); } } // Free memory. bv.erase(); } delete [] block_buf; std::cout << '\n'; std::cout << "Writing analysis so far to '" << cache_stage2 << "'. Delete that file if you want to do this stage again.\n"; std::ofstream cache; cache.open(cache_stage2.c_str()); cache << "# Stage 2 data for " << device_name << ".\n"; cache << "# Inodes path and directory blocks.\n"; cache << "# INODE PATH BLOCK [BLOCK ...]\n"; for (inode_to_directory_type::iterator iter = inode_to_directory.begin(); iter != inode_to_directory.end(); ++iter) { cache << iter->first << " '" << iter->second->first << "'"; Directory& directory(iter->second->second); if (directory.inode_number() != iter->first) { std::cerr << "ERROR: inode_to_directory entry with inode number " << iter->first << " points to a Directory with inode number " << directory.inode_number() << " (path \"" << iter->second->first << "\")." << std::endl; } ASSERT(directory.inode_number() == iter->first); for (std::list::iterator iter2 = directory.blocks().begin(); iter2 != directory.blocks().end(); ++iter2) cache << ' ' << iter2->block(); cache << '\n'; } cache << "# END\n"; cache.close(); } else { std::cout << "Loading " << cache_stage2 << "..." << std::flush; std::ifstream cache; cache.open(cache_stage2.c_str()); if (!cache.is_open()) { int error = errno; std::cout << " error" << std::endl; std::cerr << progname << ": failed to open " << cache_stage2 << ": " << strerror(error) << std::endl; exit(EXIT_FAILURE); } int inode; int blocknr; char c; // Skip initial comments. for(;;) { cache.get(c); if (c == '#') cache.ignore(std::numeric_limits::max(), '\n'); else { cache.putback(c); break; } } ASSERT(!dir_inode_to_block_cache); dir_inode_to_block_cache = new blocknr_vector_type [inode_count_ + 1]; std::memset(dir_inode_to_block_cache, 0, sizeof(blocknr_vector_type) * (inode_count_ + 1)); std::stringstream buf; int count = 0; while (cache >> inode) { cache.get(c); ASSERT(c == ' '); cache.get(c); ASSERT(c == '\''); buf.clear(); buf.str(""); cache.get(*buf.rdbuf(), '\n'); if (inode == EXT3_ROOT_INO) // If the function extracts no elements, it calls setstate(failbit). cache.clear(); cache.get(c); // Extraction stops on end-of-file or on an element that compares equal to delim (which is not extracted). ASSERT(c == '\n'); std::string::size_type pos = buf.str().find_last_of('\''); ASSERT(pos != std::string::npos); std::pair res = all_directories.insert(all_directories_type::value_type(buf.str().substr(0, pos), Directory(inode))); ASSERT(res.second); std::pair res2 = inode_to_directory.insert(inode_to_directory_type::value_type(inode, res.first)); ASSERT(res2.second); buf.seekg(pos + 1); std::vector block_numbers; while(buf >> blocknr) { block_numbers.push_back(blocknr); c = buf.get(); if (c != ' ') { ASSERT(buf.eof()); break; } } dir_inode_to_block_cache[inode] = block_numbers; std::list& blocks(res.first->second.blocks()); blocks.resize(block_numbers.size()); std::list::iterator directory_block_iter = blocks.begin(); for (std::vector::iterator block_number_iter = block_numbers.begin(); block_number_iter != block_numbers.end(); ++block_number_iter, ++directory_block_iter) directory_block_iter->read_block(*block_number_iter, directory_block_iter); if (++count % 100 == 0) std::cout << '.' << std::flush; } cache.close(); std::cout << " done\n"; } } ext3grep-0.10.1/src/debug.cc0000644000175000017500000004357011031757313012451 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file debug.cc //! @brief This file contains the definitions of debug related objects and functions. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" // Needed for platform-specific code #endif #ifdef CWDEBUG #ifndef USE_PCH #include // Needed for std::isprint #include // Needed for setfill #include #include #include #include #include "debug.h" #ifdef USE_LIBCW #include // memleak_filter #endif #endif // USE_PCH namespace debug { namespace channels { // namespace DEBUGCHANNELS namespace dc { #ifndef DOXYGEN #define DDCN(x) (x) #endif // Add new debug channels here. //channel_ct custom DDCN("CUSTOM"); //!< This debug channel is used for ... } // namespace dc } // namespace DEBUGCHANNELS // Anonymous namespace, this map and its initialization functions are private to this file // for Thead-safeness reasons. namespace { /*! @brief The type of rcfile_dc_states. * @internal */ typedef std::map rcfile_dc_states_type; /*! @brief Map containing the default debug channel states used at the start of each new thread. * @internal * * The first thread calls main, which calls debug::init which will initialize this * map with all debug channel labels and whether or not they were turned on in the * rcfile or not. */ rcfile_dc_states_type rcfile_dc_states; /*! @brief Set the default state of debug channel \a dc_label. * @internal * * This function is called once for each debug channel. */ void set_state(char const* dc_label, bool is_on) { std::pair res = rcfile_dc_states.insert(rcfile_dc_states_type::value_type(std::string(dc_label), is_on)); if (!res.second) Dout(dc::warning, "Calling set_state() more than once for the same label!"); return; } /*! @brief Save debug channel states. * @internal * * One time initialization function of rcfile_dc_state. * This must be called from debug::init after reading the rcfile. */ void save_dc_states(void) { // We may only call this function once: it reflects the states as stored // in the rcfile and that won't change. Therefore it is not needed to // lock `rcfile_dc_states', it is only written to by the first thread // (once, via main -> init) when there are no other threads yet. static bool second_time = false; if (second_time) { Dout(dc::warning, "Calling save_dc_states() more than once!"); return; } second_time = true; ForAllDebugChannels( set_state(debugChannel.get_label(), debugChannel.is_on()) ); } } // anonymous namespace /*! @brief Returns the the original state of a debug channel. * @internal * * For a given \a dc_label, which must be the exact name (channel_ct::get_label) of an * existing debug channel, this function returns \c true when the corresponding debug channel was * on at the startup of the application, directly after reading the libcwd runtime * configuration file (.libcwdrc). * * If the label/channel did not exist at the start of the application, it will return \c false * (note that libcwd disallows adding debug channels to modules - so this would probably * a bug). */ bool is_on_in_rcfile(char const* dc_label) { rcfile_dc_states_type::const_iterator iter = rcfile_dc_states.find(std::string(dc_label)); if (iter == rcfile_dc_states.end()) { Dout(dc::warning, "is_on_in_rcfile(\"" << dc_label << "\"): \"" << dc_label << "\" is an unknown label!"); return false; } return iter->second; } /*! @brief Initialize debugging code from new threads. * * This function needs to be called at the start of each new thread, * because a new thread starts in a completely reset state. * * The function turns on all debug channels that were turned on * after reading the rcfile at the start of the application. * Furthermore it initializes the debug ostream, its mutex and the * margin of the default debug object (Dout). */ void init_thread(void) { // Turn on all debug channels that are turned on as per rcfile configuration. ForAllDebugChannels( if (!debugChannel.is_on() && is_on_in_rcfile(debugChannel.get_label())) debugChannel.on(); ); // Turn on debug output. Debug( libcw_do.on() ); #if LIBCWD_THREAD_SAFE Debug( libcw_do.set_ostream(&std::cout, &cout_mutex) ); #else Debug( libcw_do.set_ostream(&std::cout) ); #endif static bool first_thread = true; if (!first_thread) // So far, the application has only one thread. So don't add a thread id. { // Set the thread id in the margin. char margin[12]; sprintf(margin, "%-10lu ", pthread_self()); Debug( libcw_do.margin().assign(margin, 11) ); } } /*! @brief Initialize debugging code from main. * * This function initializes the debug code. */ void init(void) { #if CWDEBUG_ALLOC && defined(USE_LIBCW) // Tell the memory leak detector which parts of the code are // expected to leak so that we won't get an alarm for those. { std::vector > hide_list; hide_list.push_back(std::pair("libdl.so.2", "_dlerror_run")); hide_list.push_back(std::pair("libstdc++.so.6", "__cxa_get_globals")); // The following is actually necessary because of a bug in glibc // (see http://sources.redhat.com/bugzilla/show_bug.cgi?id=311). hide_list.push_back(std::pair("libc.so.6", "dl_open_worker")); memleak_filter().hide_functions_matching(hide_list); } { std::vector hide_list; // Also because of http://sources.redhat.com/bugzilla/show_bug.cgi?id=311 hide_list.push_back(std::string("ld-linux.so.2")); memleak_filter().hide_objectfiles_matching(hide_list); } memleak_filter().set_flags(libcwd::show_objectfile|libcwd::show_function); #endif // The following call allocated the filebuf's of cin, cout, cerr, wcin, wcout and wcerr. // Because this causes a memory leak being reported, make them invisible. Debug(set_invisible_on()); // You want this, unless you mix streams output with C output. // Read http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#8 for an explanation. //std::ios::sync_with_stdio(false); // Cancel previous call to set_invisible_on. Debug(set_invisible_off()); // This will warn you when you are using header files that do not belong to the // shared libcwd object that you linked with. Debug( check_configuration() ); Debug( libcw_do.on(); // Show which rcfile we are reading! ForAllDebugChannels( while (debugChannel.is_on()) debugChannel.off() // Print as little as possible though. ); read_rcfile(); // Put 'silent = on' in the rcfile to suppress most of the output here. libcw_do.off() ); save_dc_states(); init_thread(); } #if CWDEBUG_LOCATION /*! @brief Return call location. * * @param return_addr The return address of the call. */ std::string call_location(void const* return_addr) { libcwd::location_ct loc((char*)return_addr + libcwd::builtin_return_address_offset); std::ostringstream convert; convert << loc; return convert.str(); } #endif } // namespace debug #endif // CWDEBUG //----------------------------------------------------------------------------- // // Debug stuff #include "debug.h" // Define our own assert. #ifdef DEBUG #include #include "backtrace.h" #include void assert_fail(char const* expr, char const* file, int line, char const* function) { std::cout << file << ':' << line << ": " << function << ": Assertion `" << expr << "' failed." << std::endl; std::cout << "Backtrace:\n"; dump_backtrace_on(std::cout); raise(6); } #endif #if EXTERNAL_BLOCK #if 0 // Ian Jacobi's '\\' file. uint32_t someones_inode_count = std::numeric_limits::max(); unsigned char someones_block[SOMEONES_BLOCK_SIZE] = { 0x21, 0x47, 0xf1, 0x00, 0x0c, 0x00, 0x01, 0x02, 0x2e, 0x00, 0x00, 0x00, 0x20, 0x47, 0xf1, 0x00, 0x0c, 0x00, 0x02, 0x02, 0x2e, 0x2e, 0x00, 0x00, 0x22, 0x47, 0xf1, 0x00, 0xe8, 0x0f, 0x01, 0x02, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0 }; #else // siegelring -- directory, not detected as directory. uint32_t someones_inode_count = 1465920; unsigned char someones_block[SOMEONES_BLOCK_SIZE] = { 0x34, 0xba, 0x08, 0x00, 0x0c, 0x00, 0x01, 0x02, 0x2e, 0x00, 0x00, 0x00, 0x2d, 0xba, 0x08, 0x00, 0x0c, 0x00, 0x02, 0x02, 0x2e, 0x2e, 0x00, 0x00, 0x35, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0d, 0x01, 0x56, 0x65, 0x72, 0x73, 0x75, 0x63, 0x68, 0x30, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x00, 0x00, 0x00, 0x36, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0d, 0x01, 0x56, 0x65, 0x72, 0x73, 0x75, 0x63, 0x68, 0x30, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x00, 0x00, 0x00, 0x37, 0xba, 0x08, 0x00, 0x24, 0x00, 0x1b, 0x01, 0x46, 0x61, 0x68, 0x72, 0x74, 0x65, 0x6e, 0x62, 0x75, 0x63, 0x68, 0x2d, 0x61, 0x75, 0x66, 0x72, 0x75, 0x66, 0x2d, 0x6a, 0x61, 0x76, 0x61, 0x2e, 0x74, 0x78, 0x74, 0x00, 0x38, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0b, 0x01, 0x46, 0x62, 0x31, 0x24, 0x34, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x39, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0f, 0x01, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x6d, 0x6f, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x3a, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0e, 0x01, 0x56, 0x65, 0x72, 0x73, 0x75, 0x63, 0x68, 0x30, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x3b, 0xba, 0x08, 0x00, 0x10, 0x00, 0x08, 0x01, 0x2e, 0x6e, 0x62, 0x61, 0x74, 0x74, 0x72, 0x73, 0x3c, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0e, 0x01, 0x4a, 0x61, 0x72, 0x4d, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x3d, 0xba, 0x08, 0x00, 0x1c, 0x00, 0x14, 0x01, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x65, 0x73, 0x74, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x3e, 0xba, 0x08, 0x00, 0x14, 0x00, 0x09, 0x01, 0x46, 0x62, 0x31, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x00, 0x3f, 0xba, 0x08, 0x00, 0x10, 0x00, 0x08, 0x01, 0x46, 0x62, 0x31, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x40, 0xba, 0x08, 0x00, 0x10, 0x00, 0x08, 0x01, 0x46, 0x62, 0x31, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x41, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0b, 0x01, 0x46, 0x62, 0x31, 0x24, 0x35, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x42, 0xba, 0x08, 0x00, 0x10, 0x00, 0x08, 0x01, 0x46, 0x62, 0x33, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x43, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0e, 0x01, 0x66, 0x62, 0x5f, 0x4f, 0x6b, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x00, 0x44, 0xba, 0x08, 0x00, 0x24, 0x00, 0x1a, 0x01, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x24, 0x4d, 0x79, 0x42, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x45, 0xba, 0x08, 0x00, 0x1c, 0x00, 0x12, 0x01, 0x4a, 0x4d, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x00, 0x00, 0x46, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0b, 0x01, 0x46, 0x62, 0x31, 0x24, 0x36, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x47, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0e, 0x01, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x6d, 0x6f, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x00, 0x00, 0x48, 0xba, 0x08, 0x00, 0x20, 0x00, 0x16, 0x01, 0x46, 0x62, 0x31, 0x24, 0x4d, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x49, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0d, 0x01, 0x66, 0x62, 0x5f, 0x41, 0x75, 0x67, 0x75, 0x73, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x00, 0x00, 0x4a, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0f, 0x01, 0x66, 0x62, 0x5f, 0x4e, 0x6f, 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x4b, 0xba, 0x08, 0x00, 0x14, 0x00, 0x09, 0x01, 0x46, 0x62, 0x33, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x00, 0x4c, 0xba, 0x08, 0x00, 0x1c, 0x00, 0x13, 0x01, 0x42, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x4d, 0x61, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x00, 0x4d, 0xba, 0x08, 0x00, 0x1c, 0x00, 0x13, 0x01, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x24, 0x31, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x4e, 0xba, 0x08, 0x00, 0x14, 0x00, 0x09, 0x01, 0x55, 0x74, 0x69, 0x6c, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x00, 0x00, 0x00, 0x4f, 0xba, 0x08, 0x00, 0x18, 0x00, 0x10, 0x01, 0x56, 0x65, 0x72, 0x73, 0x75, 0x63, 0x68, 0x30, 0x24, 0x31, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x50, 0xba, 0x08, 0x00, 0x18, 0x00, 0x10, 0x01, 0x66, 0x62, 0x5f, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x64, 0x61, 0x74, 0x51, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0d, 0x01, 0x66, 0x6f, 0x6e, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x00, 0x00, 0x00, 0x52, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0d, 0x01, 0x66, 0x6f, 0x6e, 0x74, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x00, 0x00, 0x00, 0x53, 0xba, 0x08, 0x00, 0x1c, 0x00, 0x11, 0x01, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x00, 0x54, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0b, 0x01, 0x4d, 0x41, 0x4e, 0x49, 0x46, 0x45, 0x53, 0x54, 0x2e, 0x4d, 0x46, 0x00, 0x55, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0b, 0x01, 0x46, 0x62, 0x31, 0x24, 0x31, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x56, 0xba, 0x08, 0x00, 0x24, 0x00, 0x1c, 0x01, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x6d, 0x6f, 0x24, 0x4d, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x57, 0xba, 0x08, 0x00, 0x20, 0x00, 0x15, 0x01, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x54, 0x65, 0x73, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x00, 0x58, 0xba, 0x08, 0x00, 0x18, 0x00, 0x10, 0x01, 0x56, 0x65, 0x72, 0x73, 0x75, 0x63, 0x68, 0x30, 0x24, 0x32, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x59, 0xba, 0x08, 0x00, 0x18, 0x00, 0x10, 0x01, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x5a, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0d, 0x01, 0x4a, 0x61, 0x72, 0x4d, 0x61, 0x6b, 0x65, 0x72, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x00, 0x00, 0x00, 0x5b, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0c, 0x01, 0x66, 0x62, 0x5f, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x2e, 0x64, 0x61, 0x74, 0x5c, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0f, 0x01, 0x66, 0x61, 0x68, 0x72, 0x74, 0x65, 0x6e, 0x62, 0x75, 0x63, 0x68, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x5d, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0c, 0x01, 0x66, 0x62, 0x5f, 0x4d, 0x61, 0x65, 0x72, 0x7a, 0x2e, 0x64, 0x61, 0x74, 0x5e, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0b, 0x01, 0x46, 0x62, 0x31, 0x24, 0x32, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x5f, 0xba, 0x08, 0x00, 0x1c, 0x00, 0x11, 0x01, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x6d, 0x6f, 0x24, 0x31, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x00, 0x60, 0xba, 0x08, 0x00, 0x18, 0x00, 0x10, 0x01, 0x56, 0x65, 0x72, 0x73, 0x75, 0x63, 0x68, 0x30, 0x24, 0x33, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x61, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0c, 0x01, 0x46, 0x62, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x62, 0xba, 0x08, 0x00, 0x1c, 0x00, 0x13, 0x01, 0x4a, 0x4d, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x63, 0xba, 0x08, 0x00, 0x1c, 0x00, 0x13, 0x01, 0x66, 0x62, 0x5f, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x5f, 0x32, 0x30, 0x30, 0x34, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x64, 0xba, 0x08, 0x00, 0x1c, 0x00, 0x13, 0x01, 0x66, 0x62, 0x5f, 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x5f, 0x32, 0x30, 0x30, 0x35, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x65, 0xba, 0x08, 0x00, 0x1c, 0x00, 0x12, 0x01, 0x66, 0x62, 0x5f, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x5f, 0x32, 0x30, 0x30, 0x34, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x00, 0x66, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0a, 0x01, 0x55, 0x74, 0x69, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x67, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0b, 0x01, 0x66, 0x62, 0x5f, 0x4a, 0x75, 0x6c, 0x69, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x68, 0xba, 0x08, 0x00, 0x18, 0x00, 0x0f, 0x01, 0x66, 0x62, 0x5f, 0x44, 0x65, 0x7a, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x69, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0b, 0x01, 0x46, 0x62, 0x31, 0x24, 0x33, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x6a, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0b, 0x01, 0x66, 0x62, 0x5f, 0x4a, 0x75, 0x6e, 0x69, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x6b, 0xba, 0x08, 0x00, 0x14, 0x00, 0x0a, 0x01, 0x66, 0x62, 0x5f, 0x4d, 0x61, 0x69, 0x2e, 0x64, 0x61, 0x74, 0x00, 0x00, 0x6c, 0xba, 0x08, 0x00, 0xc8, 0x0a, 0x01, 0x01, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0 }; #endif #else // !EXTERNAL_BLOCK // Not used, except in compiler check. uint32_t someones_inode_count; unsigned char someones_block[SOMEONES_BLOCK_SIZE]; #endif // !EXTERNAL_BLOCK ext3grep-0.10.1/src/init_journal_consts.cc0000644000175000017500000000323211031441527015435 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file init_journal_consts.cc Definition of function init_journal_consts. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef USE_PCH #include "sys.h" #include "debug.h" #endif #include "globals.h" #include "endian_conversion.h" #include "inode.h" void init_journal_consts(void) { // Initialize journal constants. journal_block_size_ = be2le(journal_super_block.s_blocksize); ASSERT(journal_block_size_ == block_size_); // Sorry, I'm trying to recover my own data-- have no time to deal with this. journal_maxlen_ = be2le(journal_super_block.s_maxlen); journal_first_ = be2le(journal_super_block.s_first); journal_sequence_ = be2le(journal_super_block.s_sequence); journal_start_ = be2le(journal_super_block.s_start); journal_inode = *get_inode(super_block.s_journal_inum); } ext3grep-0.10.1/src/bitmap.h0000644000175000017500000000474311031747067012505 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // //! @file bitmap.h Declarations of bitmap related code. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef BITMAP_H #define BITMAP_H // A bitmap (variables ending on _bitmap) is represented as an array of bitmap_t. typedef unsigned long bitmap_t; // A bitmap_ptr represents a single bit in a bit map. struct bitmap_ptr { int index; // The index into the array of bitmap_t. union { bitmap_t mask; // The mask for that array element (a single bit). unsigned char byte[sizeof(bitmap_t)]; // For byte-level access. }; }; // Translate 'bit' into a bitmap_ptr. inline bitmap_ptr get_bitmap_mask(unsigned int bit) { bitmap_ptr result; result.mask = 0; // Initialize all bits in the mask to zero. // From the book "File System Forensic Analysis": // Like other bitmaps we have seen in this book, it is organized into bytes, // and the least-significant bit corresponds to the block after the most-significant // bit of the previous byte. In other words, when we read the bytes we go left to // right, but inside each byte we read right to left. // Number of bits in bitmap_t. static int const bitmap_t_bits = 8 * sizeof(bitmap_t); // Higher bit's result in higher indexes. Every bitmap_t_bits the index is incremented by one. result.index = bit / bitmap_t_bits; // Higher bits means higher bytes. Every 8 bit the byte index is incremented by one. // Higher bits means more significant bits. There are 2^3 bits per byte. result.byte[(bit & (bitmap_t_bits - 1)) >> 3] = 1 << (bit & 7); return result; } #endif // BITMAP_H ext3grep-0.10.1/src/sys.h.in0000644000175000017500000000342211076400561012437 00000000000000// ext3grep -- An ext3 file system investigation and undelete tool // @configure_input@ // This file contains operating system header workarounds and application // wide macro definitions related to third party libraries and/or compilation // in general. // // Copyright (C) 2008, by // // Carlo Wood, Run on IRC // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . #ifndef SYS_H #define SYS_H #if HAVE_CONFIG_H #include "config.h" #endif // This is needed for lseek64. #define _LARGEFILE64_SOURCE #ifdef CWDEBUG #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #ifdef USE_LIBCW #include #else #include #endif #endif #define UNUSED(x) // Compilers and preprocessor used. Put here to cause a recompile when changed. // CC : @CC_FINGER_PRINT@ // CXX : @CXX_FINGER_PRINT@ // CXXCPP: @CXXCPP_FINGER_PRINT@ // // Also cause a full recompile when the definition of CWDEBUG is changed. // CWDEBUG: @USE_LIBCWD@ // // Also cause a full recompile if CXXFLAGS is changed. // CXXFLAGS: @CXXFLAGS_FINGER_PRINT@ #endif // SYS_H ext3grep-0.10.1/missing0000755000175000017500000002557710753463634011705 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: ext3grep-0.10.1/configure.ac0000644000175000017500000001012311121223203012521 00000000000000dnl Run autogen.sh to produce a configure script. dnl CW_VERSION_MAJOR : Increment when the whole application was rewritten; or some VERY MAJOR change was made. dnl CW_VERSION_MINOR : Increment when major changes have occured. dnl CW_VERSION_REVISION : Increment every public release; or set to 0 when CW_VERSION_MINOR was incremented. define(CW_VERSION_MAJOR, 0) define(CW_VERSION_MINOR, 10) define(CW_VERSION_REVISION, 1) define(CW_PACKAGE_NAME, [ext3grep]) define(CW_BUGREPORT, [carlo@alinoe.com]) dnl Package name and version AC_INIT(CW_PACKAGE_NAME, CW_VERSION_MAJOR.CW_VERSION_MINOR.CW_VERSION_REVISION, CW_BUGREPORT) dnl Put resulting configuration defines in this header file. AC_CONFIG_HEADERS([config.h]) dnl Put revision of configure.ac in configure script. AC_REVISION($Revision: 7 $)dnl dnl Ensure that the directory specified with --srcdir was correct dnl by demanding that it contains `ext3grep.pc.in'. AC_CONFIG_SRCDIR([src/ext3grep.cc]) dnl Automake options. AM_INIT_AUTOMAKE dnl Include maintainer mode targets AM_MAINTAINER_MODE dnl Because we use cwautomacros. CW_AUTOMACROS([20080318]) dnl Demand at least version 2.57 of autoconf. AC_PREREQ(2.57) dnl Check for compiler and preprocessor AC_PROG_CC AC_PROG_CXX AC_PROG_CXXCPP dnl Demand little endian system AC_C_BIGENDIAN([AC_MSG_ERROR([ext3grep doesn't work on Big Endian systems])]) dnl Make these two the default until ext3grep is stable. dnl Add --enable-debug (DEBUG, DOXYGEN_DEBUG), --enable-libcwd (CWDEBUG, DOXYGEN_CWDEBUG), dnl --enable-optimise and --enable-profile options. Update USE_LIBCWD, CWD_LIBS and CXXFLAGS accordingly. CW_OPG_FLAGS([-W -Wall -Woverloaded-virtual -Wundef -Wpointer-arith -Wwrite-strings -Winline]) dnl Add --enable-pch (USE_PCH (macro)) option. dnl Update USE_PCH (automake conditional) and PCHFLAGS accordingly. CW_PCHFLAGS dnl Add --enable-mmap option. dnl Sets USE_MMAP appropriately. AC_ARG_ENABLE(mmap, [ --enable-mmap Use mmap for inode tables instead of operator new @<:@yes@:>@]) if test x"$enable_mmap" = x"no"; then # --disable-mmap given. CXXFLAGS="$CXXFLAGS -DUSE_MMAP=0" else CXXFLAGS="$CXXFLAGS -DUSE_MMAP=1" fi dnl Each Makefile.am should use DEFS = @DEFS@. Set DEFS here. DEFS="-DHAVE_CONFIG_H" AC_SUBST(DEFS) dnl Test if we are checked out by svn. if test -d "$srcdir/.svn"; then if test x"$enable_maintainer_mode" != x"yes"; then AC_MSG_ERROR([Always use --enable-maintainer-mode if you are using SVN.]) fi AC_DEFINE_UNQUOTED([USE_SVN], 1, [Define when this project is checked out using svn.]) fi AM_CONDITIONAL([USE_SVN], [test -d "$srcdir/.svn"]) dnl Set this conditional when --enable-debug was given. AM_CONDITIONAL([USE_DEBUG], [test x"$cw_config_debug" = x"yes"]) dnl Set this conditional if we're linking with libcwd. AM_CONDITIONAL([USE_CWDEBUG], [test x"$cw_used_libcwd" = x"yes"]) dnl Checks for other programs. AC_PROG_INSTALL dnl Include support for 64-bit file offsets if supported. AC_SYS_LARGEFILE dnl Include flags needed for the e2progs header files. CXXFLAGS="$CXXFLAGS `pkg-config --cflags ext2fs`" dnl Warn user if those headers couldn't be found. AC_CHECK_HEADERS(ext2fs/ext2_fs.h ext2fs/ext2fs.h) if test x"$ac_cv_header_ext2fs_ext2_fs_h" != x"yes" -o x"$ac_cv_header_ext2fs_ext2fs_h" != x"yes"; then AC_MSG_ERROR([Missing headers. Please install the package e2fslibs-dev from e2fsprogs, or http://e2fsprogs.sourceforge.net for the upstream tar-ball.]) fi dnl Used in sys.h to force recompilation when the compiler version changes. CW_PROG_CXX_FINGER_PRINTS CC_FINGER_PRINT="$cw_prog_cc_finger_print" AC_SUBST([CC_FINGER_PRINT]) CXX_FINGER_PRINT="$cw_prog_cxx_finger_print" AC_SUBST([CXX_FINGER_PRINT]) CXXCPP_FINGER_PRINT="$cw_prog_cxxcpp_finger_print" AC_SUBST([CXXCPP_FINGER_PRINT]) dnl Use in sys.h to force recompilation when CXXFLAGS change. CXXFLAGS_FINGER_PRINT=[$(echo $CXXFLAGS | sed -e 's/-W[a-z-]* *//g')] AC_SUBST([CXXFLAGS_FINGER_PRINT]) dnl Generate src/sys.h from src/sys.h.in CW_CONFIG_FILE([src], [sys.h]) dnl Output the other configuration files. AC_CONFIG_FILES( [Makefile] [src/Makefile]) AC_OUTPUT