code
stringlengths 0
56.1M
| repo_name
stringclasses 515
values | path
stringlengths 2
147
| language
stringclasses 447
values | license
stringclasses 7
values | size
int64 0
56.8M
|
---|---|---|---|---|---|
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002 Free Software Foundation, Inc.
timestamp='2002-10-21'
# 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, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Per Bothner <per@bothner.com>.
# Please send patches to <config-patches@gnu.org>. 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 <config-patches@gnu.org>."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
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.
# This shell variable is my proudest work .. or something. --bje
set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
|| (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
dummy=$tmpdir/dummy ;
files="$dummy.c $dummy.o $dummy.rel $dummy" ;
trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
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 ;
rm -f $files ;
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 ;
unset files'
# 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 ;;
*) 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
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
# 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 0 ;;
amiga:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
arc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
hp300:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
macppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme68k:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvme88k:OpenBSD:*:*)
echo m88k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
mvmeppc:OpenBSD:*:*)
echo powerpc-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sgi:OpenBSD:*:*)
echo mipseb-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
wgrisc:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
# 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.
eval $set_cc_for_build
cat <<EOF >$dummy.s
.data
\$Lformat:
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
.text
.globl main
.align 4
.ent main
main:
.frame \$30,16,\$26,0
ldgp \$29,0(\$27)
.prologue 1
.long 0x47e03d80 # implver \$0
lda \$2,-1
.long 0x47e20c21 # amask \$2,\$1
lda \$16,\$Lformat
mov \$0,\$17
not \$1,\$18
jsr \$26,printf
ldgp \$29,0(\$26)
mov 0,\$16
jsr \$26,exit
.end main
EOF
$CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
if test "$?" = 0 ; then
case `$dummy` in
0-0)
UNAME_MACHINE="alpha"
;;
1-0)
UNAME_MACHINE="alphaev5"
;;
1-1)
UNAME_MACHINE="alphaev56"
;;
1-101)
UNAME_MACHINE="alphapca56"
;;
2-303)
UNAME_MACHINE="alphaev6"
;;
2-307)
UNAME_MACHINE="alphaev67"
;;
2-1307)
UNAME_MACHINE="alphaev68"
;;
3-1307)
UNAME_MACHINE="alphaev7"
;;
esac
fi
rm -f $dummy.s $dummy && rmdir $tmpdir
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
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 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit 0;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit 0 ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit 0;;
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 0 ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
DRS?6000:UNIX_SV:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7 && exit 0 ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
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 0 ;;
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 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
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 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
# 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 0 ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit 0 ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit 0 ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit 0 ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
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 \
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
rm -f $dummy.c $dummy && rmdir $tmpdir
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit 0 ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit 0 ;;
Night_Hawk:*:*:PowerMAX_OS)
echo powerpc-harris-powermax
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
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 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
rm -f $dummy.c $dummy && rmdir $tmpdir
echo rs6000-ibm-aix3.2.5
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 0 ;;
*:AIX:*:[45])
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 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
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 <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
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`
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
rm -f $dummy.c $dummy && rmdir $tmpdir
fi ;;
esac
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
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 && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
rm -f $dummy.c $dummy && rmdir $tmpdir
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit 0 ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit 0 ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit 0 ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3D:*:*:*)
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
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 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
# Determine whether the default compiler uses glibc.
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#if __GLIBC__ >= 2
LIBC=gnu
#else
LIBC=
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
rm -f $dummy.c && rmdir $tmpdir
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit 0 ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit 0 ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
x86:Interix*:3*)
echo i386-pc-interix3
exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i386-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit 0 ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
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 | grep ^CPU=`
rm -f $dummy.c && rmdir $tmpdir
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit 0 ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
exit 0 ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit 0 ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit 0 ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit 0 ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit 0 ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit 0 ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
# 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 0 ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
exit 0 ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
exit 0 ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <features.h>
#ifdef __ELF__
# ifdef __GLIBC__
# if __GLIBC__ >= 2
LIBC=gnu
# else
LIBC=gnulibc1
# endif
# else
LIBC=gnulibc1
# endif
#else
#ifdef __INTEL_COMPILER
LIBC=gnu
#else
LIBC=gnuaout
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
rm -f $dummy.c && rmdir $tmpdir
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit 0 ;;
i*86:UNIX_SV:4.2MP:2.*)
# 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 0 ;;
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 0 ;;
i*86:*:5:[78]*)
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit 0 ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/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 0 ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit 0 ;;
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 0 ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit 0 ;;
paragon:*:*:*)
echo i860-intel-osf1
exit 0 ;;
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 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*: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)
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 0
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
*: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 0 ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit 0 ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit 0 ;;
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 0 ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit 0 ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit 0 ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit 0 ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit 0 ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
echo `uname -p`-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*: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 0 ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit 0 ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit 0 ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit 0 ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit 0 ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit 0 ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit 0 ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit 0 ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit 0 ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#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 <sys/param.h>
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"); 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 <sys/param.h>
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
rm -f $dummy.c $dummy && rmdir $tmpdir
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
# 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 0 ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
c34*)
echo c34-convex-bsd
exit 0 ;;
c38*)
echo c38-convex-bsd
exit 0 ;;
c4*)
echo c4-convex-bsd
exit 0 ;;
esac
fi
cat >&2 <<EOF
$0: unable to guess system type
This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
|
orochi/ext4magic
|
config.guess
|
guess
|
mit
| 39,855 |
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* 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 home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
|
orochi/ext4magic
|
config.h.in
|
in
|
mit
| 1,716 |
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002 Free Software Foundation, Inc.
timestamp='2002-09-05'
# 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, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>. 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 <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | 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)
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
;;
-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/'`
;;
-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] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k \
| m32r | m68000 | m68k | m88k | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64vr | mips64vrel \
| mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mipsisa32 | mipsisa32el \
| mipsisa64 | mipsisa64el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| ns16k | ns32k \
| openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic80 | tron \
| v850 | v850e \
| we32k \
| x86 | xscale | 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)
;;
# 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-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
| clipper-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* \
| m32r-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64vr-* | mips64vrel-* \
| mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39 | mipstx39el \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
| xtensa-* \
| ymp-* \
| z8k-*)
;;
# 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
;;
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
;;
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
;;
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
;;
crds | unos)
basic_machine=m68k-crds
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
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
;;
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
;;
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
;;
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
;;
mmix*)
basic_machine=mmix-knuth
os=-mmixware
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
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
;;
or32 | or32-*)
basic_machine=or32-unknown
os=-coff
;;
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
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2)
basic_machine=i686-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-*)
basic_machine=i686-`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
;;
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
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
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
;;
t3d)
basic_machine=alpha-cray
os=-unicos
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tic4x | c4x*)
basic_machine=tic4x-unknown
os=-coff
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
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
;;
windows32)
basic_machine=i386-pc
os=-windows32-msvcrt
;;
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
;;
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
;;
sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
basic_machine=sh-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv9 | sparcv9b)
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* | -netbsd* | -openbsd* | -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* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -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*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto*)
os=-nto-qnx
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-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
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-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
;;
-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
;;
-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
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
# 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
;;
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
;;
*-ibm)
os=-aix
;;
*-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
;;
-ptx*)
vendor=sequent
;;
-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 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
|
orochi/ext4magic
|
config.sub
|
sub
|
mit
| 29,558 |
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
#
# Copyright (C) 1992-1996, 1998-2012 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=:
# Pre-4.2 versions of Zsh do 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_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
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.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
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
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
as_fn_exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do 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_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
PATH=/empty FPATH=/empty; export PATH FPATH
test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
|| test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
if (eval "$as_required") 2>/dev/null; then :
as_have_required=yes
else
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir/$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
CONFIG_SHELL=$as_shell as_have_required=yes
if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
break 2
fi
fi
done;;
esac
as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
if test x$as_have_required = xno; then :
$as_echo "$0: This script requires a shell more modern than all"
$as_echo "$0: the shells that I found on your system."
if test x${ZSH_VERSION+set} = xset ; then
$as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_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 ||
$as_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" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
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
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# 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
as_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# 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" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
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 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
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 -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
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='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
SHELL=${CONFIG_SHELL-/bin/sh}
test -n "$DJDIR" || exec 7<&0 </dev/null
exec 6>&1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME=
PACKAGE_TARNAME=
PACKAGE_VERSION=
PACKAGE_STRING=
PACKAGE_BUGREPORT=
PACKAGE_URL=
ac_unique_file="configure.ac"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
#ifdef HAVE_STRING_H
# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
CPP
OTOOL64
OTOOL
LIPO
NMEDIT
DSYMUTIL
MANIFEST_TOOL
RANLIB
ac_ct_AR
AR
DLLTOOL
OBJDUMP
LN_S
NM
ac_ct_DUMPBIN
DUMPBIN
LD
FGREP
EGREP
GREP
SED
host_os
host_vendor
host_cpu
host
build_os
build_vendor
build_cpu
build
LIBTOOL
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
am__quote
am__include
DEPDIR
OBJEXT
EXEEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC
am__untar
am__tar
AMTAR
am__leading_dot
SET_MAKE
AWK
mkdir_p
MKDIR_P
INSTALL_STRIP_PROGRAM
STRIP
install_sh
MAKEINFO
AUTOHEADER
AUTOMAKE
AUTOCONF
ACLOCAL
VERSION
PACKAGE
CYGPATH_W
am__isrc
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_dependency_tracking
enable_shared
enable_static
with_pic
enable_fast_install
with_gnu_ld
with_sysroot
enable_libtool_lock
enable_debug
enable_debug_magic
enable_file_attr
enable_expert_mode
'
ac_precious_vars='build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# 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}'
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= ;;
*) 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_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=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_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=\$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=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 ;;
-*) as_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
$as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
$as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
# Check all directory arguments for consistency.
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
# Remove trailing slashes.
case $ac_val in
*/ )
ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
# 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
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 .` ||
as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "pwd does not report name of working directory"
# 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 -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_myself" |
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 .."
as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
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 this package 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/PACKAGE]
--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
cat <<\_ACEOF
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-dependency-tracking
do not reject slow dependency extractors
--disable-dependency-tracking
speeds up one-time build
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-debug Turn on debugging
--enable-debug-magic Turn on debugging magic-scan-engine
--enable-file-attr enable restore of file attribute
--enable-expert-mode enable advanced options for expert mode
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot=DIR Search for dependent libraries within DIR
(or the compiler's sysroot if not specified).
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
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 the package provider.
_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" ||
{ cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && 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=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_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
$as_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
configure
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##
# ac_fn_c_try_compile LINENO
# --------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_link
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_cpp ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if { { ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } > conftest.i && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
# ac_fn_c_try_run LINENO
# ----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
# that executables *can* be run.
ac_fn_c_try_run ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then :
ac_retval=0
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=$ac_status
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_run
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $2 (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
#undef $2
/* 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 $2 ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_$2 || defined __stub___$2
choke me
#endif
int
main ()
{
return $2 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
# the include files in INCLUDES and setting the cache variable VAR
# accordingly.
ac_fn_c_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if eval \${$3+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
$as_echo_n "checking $2 usability... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_header_compiler=yes
else
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
$as_echo_n "checking $2 presence... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <$2>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
ac_header_preproc=yes
else
ac_header_preproc=no
fi
rm -f conftest.err conftest.i conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
yes:no: )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
;;
no:yes:* )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_mongrel
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
generated by GNU Autoconf 2.69. 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=.
$as_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=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
as_fn_append 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
as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset 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
$as_echo "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; 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
$as_echo "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
$as_echo "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
$as_echo "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
$as_echo "$as_me: caught signal $ac_signal"
$as_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'; as_fn_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
$as_echo "/* confdefs.h */" > 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
cat >>confdefs.h <<_ACEOF
#define PACKAGE_URL "$PACKAGE_URL"
_ACEOF
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
# We do not want a PATH search for config.site.
case $CONFIG_SITE in #((
-*) ac_site_file1=./$CONFIG_SITE;;
*/*) ac_site_file1=$CONFIG_SITE;;
*) ac_site_file1=./$CONFIG_SITE;;
esac
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
else
ac_site_file1=$ac_default_prefix/share/config.site
ac_site_file2=$ac_default_prefix/etc/config.site
fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
test "x$ac_site_file" = xNONE && continue
if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
|| { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
done
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
$as_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,)
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
$as_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
# differences in whitespace do not lead to failure.
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`$as_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.
*) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##
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.12'
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
as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
# 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.
# Reject install programs that cannot install multiple files.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if ${ac_cv_path_install+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
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
rm -rf conftest.one conftest.two conftest.dir
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
break 3
fi
fi
fi
done
done
;;
esac
done
IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
$as_echo "$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'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[\\\"\#\$\&\'\`$am_lf]*)
as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
esac
# 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 (
am_has_slept=no
for am_try in 1 2; do
echo "timestamp, slept: $am_has_slept" > conftest.file
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
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".
as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
alias in your environment" "$LINENO" 5
fi
if test "$2" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
am_has_slept=yes
done
test "$2" = conftest.file
)
then
# Ok.
:
else
as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
( sleep 1 ) &
am_sleep_pid=$!
fi
rm -f conftest.file
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 $.
# By default was `s,x,x', remove it if useless.
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
# 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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_STRIP+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
$as_echo "$STRIP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
$as_echo "$ac_ct_STRIP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
STRIP=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
if ${ac_cv_path_mkdir+:} false; then :
$as_echo_n "(cached) " >&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
as_fn_executable_p "$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
test -d ./--version && rmdir ./--version
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.
MKDIR_P="$ac_install_sh -d"
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_AWK+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:${as_lineno-$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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
$as_echo "$AWK" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$AWK" && break
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
$as_echo_n "(cached) " >&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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
SET_MAKE=
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "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
as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
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=ext4magic
VERSION=0.3.2
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"}
mkdir_p="$MKDIR_P"
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
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
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
$as_echo "$as_me:${as_lineno-$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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "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:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
fi
fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM 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.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; 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 | *.dSYM | *.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
if test -z "$ac_file"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
$as_echo_n "checking for C compiler default output file name... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; 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 | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
int
main ()
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if ${ac_cv_objext+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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 ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; 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 | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; then :
$as_echo_n "(cached) " >&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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
$as_echo "$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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
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"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c89=$ac_arg
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)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
xno)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :
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
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
$as_echo "$_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='\'
am__nodep='_no'
fi
if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
AMDEP_FALSE='#'
else
AMDEP_TRUE='#'
AMDEP_FALSE=
fi
depcc="$CC" am_compiler_list=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CC_dependencies_compiler_type+:} false; then :
$as_echo_n "(cached) " >&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".
rm -rf conftest.dir
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
am__universal=false
case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac
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 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# 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. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
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
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
$as_echo "$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
if test "x$CC" != xcc; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
fi
set dummy $CC; ac_cc=`$as_echo "$2" |
sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
# Make sure it works both with $CC and with simple cc.
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
rm -f conftest2.*
if { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } &&
test -f conftest2.$ac_objext && { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; };
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
if test "x$CC" != xcc; then
# Test first that cc exists at all.
if { ac_try='cc -c conftest.$ac_ext >&5'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
rm -f conftest2.*
if { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } &&
test -f conftest2.$ac_objext && { { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; };
then
# cc works too.
:
else
# cc exists but doesn't like -o.
eval ac_cv_prog_cc_${ac_cc}_c_o=no
fi
fi
fi
else
eval ac_cv_prog_cc_${ac_cc}_c_o=no
fi
rm -f core conftest*
fi
if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
fi
# FIXME: we rely on the cache variable name because
# there is no other way.
set dummy $CC
am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
if test "$am_t" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
# A longer-term fix would be to have automake use am__CC in this case,
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
case `pwd` in
*\ * | *\ *)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
esac
macro_version='2.4.2'
macro_revision='1.3337'
ltmain="$ac_aux_dir/ltmain.sh"
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
if ${ac_cv_build+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
test "x$ac_build_alias" = x &&
as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
if ${ac_cv_host+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
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
# Backslashify metacharacters that are still active within
# double-quoted strings.
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
# Same as above, but do not quote variable references.
double_quote_subst='s/\(["`\\]\)/\\\1/g'
# Sed substitution to delay expansion of an escaped shell variable in a
# double_quote_subst'ed string.
delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
# Sed substitution to delay expansion of an escaped single quote.
delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
# Sed substitution to avoid accidental globbing in evaled expressions
no_glob_subst='s/\*/\\\*/g'
ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
$as_echo_n "checking how to print strings... " >&6; }
# Test print first, because it will be a builtin if present.
if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
ECHO='print -r --'
elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
ECHO='printf %s\n'
else
# Use this function as a fallback that always works.
func_fallback_echo ()
{
eval 'cat <<_LTECHO_EOF
$1
_LTECHO_EOF'
}
ECHO='func_fallback_echo'
fi
# func_echo_all arg...
# Invoke $ECHO with all args, space-separated.
func_echo_all ()
{
$ECHO ""
}
case "$ECHO" in
printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
$as_echo "printf" >&6; } ;;
print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
$as_echo "print -r" >&6; } ;;
*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
$as_echo "cat" >&6; } ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
$as_echo_n "checking for a sed that does not truncate output... " >&6; }
if ${ac_cv_path_SED+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
for ac_i in 1 2 3 4 5 6 7; do
ac_script="$ac_script$as_nl$ac_script"
done
echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
{ ac_script=; unset ac_script;}
if test -z "$SED"; then
ac_path_SED_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
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_SED" || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
*GNU*)
ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo '' >> "conftest.nl"
"$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_SED_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_SED="$ac_path_SED"
ac_path_SED_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_SED_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_SED"; then
as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
fi
else
ac_cv_path_SED=$SED
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
$as_echo "$ac_cv_path_SED" >&6; }
SED="$ac_cv_path_SED"
rm -f conftest.sed
test -z "$SED" && SED=sed
Xsed="$SED -e 1s/^X//"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$GREP"; then
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"
as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_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
as_fn_arith $ac_count + 1 && ac_count=$as_val
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
if test -z "$ac_cv_path_GREP"; then
as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
$as_echo "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
if ${ac_cv_path_EGREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
if test -z "$EGREP"; then
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"
as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_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
as_fn_arith $ac_count + 1 && ac_count=$as_val
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
if test -z "$ac_cv_path_EGREP"; then
as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
$as_echo "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
$as_echo_n "checking for fgrep... " >&6; }
if ${ac_cv_path_FGREP+:} false; then :
$as_echo_n "(cached) " >&6
else
if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
then ac_cv_path_FGREP="$GREP -F"
else
if test -z "$FGREP"; then
ac_path_FGREP_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 fgrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_FGREP" || continue
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
case `"$ac_path_FGREP" --version 2>&1` in
*GNU*)
ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
*)
ac_count=0
$as_echo_n 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
$as_echo 'FGREP' >> "conftest.nl"
"$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_FGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_FGREP="$ac_path_FGREP"
ac_path_FGREP_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_FGREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_FGREP"; then
as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_FGREP=$FGREP
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
$as_echo "$ac_cv_path_FGREP" >&6; }
FGREP="$ac_cv_path_FGREP"
test -z "$GREP" && GREP=grep
# Check whether --with-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then :
withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
else
with_gnu_ld=no
fi
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
$as_echo_n "checking for ld used by $CC... " >&6; }
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[\\/]* | ?:[\\/]*)
re_direlt='/[^/][^/]*/\.\./'
# Canonicalize the pathname of ld
ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
$as_echo_n "checking for GNU ld... " >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
$as_echo_n "checking for non-GNU ld... " >&6; }
fi
if ${lt_cv_path_LD+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$LD"; then
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
lt_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break
;;
*)
test "$with_gnu_ld" != yes && break
;;
esac
fi
done
IFS="$lt_save_ifs"
else
lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi
LD="$lt_cv_path_LD"
if test -n "$LD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
$as_echo "$LD" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
if ${lt_cv_prog_gnu_ld+:} false; then :
$as_echo_n "(cached) " >&6
else
# I'd rather use --version here, but apparently some GNU lds only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
lt_cv_prog_gnu_ld=yes
;;
*)
lt_cv_prog_gnu_ld=no
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
$as_echo "$lt_cv_prog_gnu_ld" >&6; }
with_gnu_ld=$lt_cv_prog_gnu_ld
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
if ${lt_cv_path_NM+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$NM"; then
# Let the user override the test.
lt_cv_path_NM="$NM"
else
lt_nm_to_check="${ac_tool_prefix}nm"
if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
lt_nm_to_check="$lt_nm_to_check nm"
fi
for lt_tmp_nm in $lt_nm_to_check; do
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
tmp_nm="$ac_dir/$lt_tmp_nm"
if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
# Check to see if the nm accepts a BSD-compat flag.
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
*/dev/null* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break
;;
*)
lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
continue # so that we can try to find one that supports BSD flags
;;
esac
;;
esac
fi
done
IFS="$lt_save_ifs"
done
: ${lt_cv_path_NM=no}
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
$as_echo "$lt_cv_path_NM" >&6; }
if test "$lt_cv_path_NM" != "no"; then
NM="$lt_cv_path_NM"
else
# Didn't find any BSD compatible name lister, look for dumpbin.
if test -n "$DUMPBIN"; then :
# Let the user override the test.
else
if test -n "$ac_tool_prefix"; then
for ac_prog in dumpbin "link -dump"
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_DUMPBIN+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$DUMPBIN"; then
ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
DUMPBIN=$ac_cv_prog_DUMPBIN
if test -n "$DUMPBIN"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
$as_echo "$DUMPBIN" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$DUMPBIN" && break
done
fi
if test -z "$DUMPBIN"; then
ac_ct_DUMPBIN=$DUMPBIN
for ac_prog in dumpbin "link -dump"
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_DUMPBIN"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
if test -n "$ac_ct_DUMPBIN"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
$as_echo "$ac_ct_DUMPBIN" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ac_ct_DUMPBIN" && break
done
if test "x$ac_ct_DUMPBIN" = x; then
DUMPBIN=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DUMPBIN=$ac_ct_DUMPBIN
fi
fi
case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols"
;;
*)
DUMPBIN=:
;;
esac
fi
if test "$DUMPBIN" != ":"; then
NM="$DUMPBIN"
fi
fi
test -z "$NM" && NM=nm
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
$as_echo_n "checking the name lister ($NM) interface... " >&6; }
if ${lt_cv_nm_interface+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
(eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
(eval echo "\"\$as_me:$LINENO: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
fi
rm -f conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
$as_echo "$lt_cv_nm_interface" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
$as_echo_n "checking whether ln -s works... " >&6; }
LN_S=$as_ln_s
if test "$LN_S" = "ln -s"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
$as_echo "no, using $LN_S" >&6; }
fi
# find the maximum length of command line arguments
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
$as_echo_n "checking the maximum length of command line arguments... " >&6; }
if ${lt_cv_sys_max_cmd_len+:} false; then :
$as_echo_n "(cached) " >&6
else
i=0
teststring="ABCD"
case $build_os in
msdosdjgpp*)
# On DJGPP, this test can blow up pretty badly due to problems in libc
# (any single argument exceeding 2000 bytes causes a buffer overrun
# during glob expansion). Even if it were fixed, the result of this
# check would be larger than it should be.
lt_cv_sys_max_cmd_len=12288; # 12K is about right
;;
gnu*)
# Under GNU Hurd, this test is not required because there is
# no limit to the length of command line arguments.
# Libtool will interpret -1 as no limit whatsoever
lt_cv_sys_max_cmd_len=-1;
;;
cygwin* | mingw* | cegcc*)
# On Win9x/ME, this test blows up -- it succeeds, but takes
# about 5 minutes as the teststring grows exponentially.
# Worse, since 9x/ME are not pre-emptively multitasking,
# you end up with a "frozen" computer, even though with patience
# the test eventually succeeds (with a max line length of 256k).
# Instead, let's just punt: use the minimum linelength reported by
# all of the supported platforms: 8192 (on NT/2K/XP).
lt_cv_sys_max_cmd_len=8192;
;;
mint*)
# On MiNT this can take a long time and run out of memory.
lt_cv_sys_max_cmd_len=8192;
;;
amigaos*)
# On AmigaOS with pdksh, this test takes hours, literally.
# So we just punt and use a minimum line length of 8192.
lt_cv_sys_max_cmd_len=8192;
;;
netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
elif test -x /usr/sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
else
lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
fi
# And add a safety zone
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
;;
interix*)
# We know the value 262144 and hardcode it with a safety zone (like BSD)
lt_cv_sys_max_cmd_len=196608
;;
os2*)
# The test takes a long time on OS/2.
lt_cv_sys_max_cmd_len=8192
;;
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
# nice to cause kernel panics so lets avoid the loop below.
# First set a reasonable default.
lt_cv_sys_max_cmd_len=16384
#
if test -x /sbin/sysconfig; then
case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
*1*) lt_cv_sys_max_cmd_len=-1 ;;
esac
fi
;;
sco3.2v5*)
lt_cv_sys_max_cmd_len=102400
;;
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
;;
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
if test -n "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
# Make teststring a little bigger before we do anything with it.
# a 1K string should be a reasonable start.
for i in 1 2 3 4 5 6 7 8 ; do
teststring=$teststring$teststring
done
SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
test $i != 17 # 1/2 MB should be enough
do
i=`expr $i + 1`
teststring=$teststring$teststring
done
# Only check the string length outside the loop.
lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
teststring=
# Add a significant safety factor because C++ compilers can tack on
# massive amounts of additional arguments before passing them to the
# linker. It appears as though 1/2 is a usable value.
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
fi
;;
esac
fi
if test -n $lt_cv_sys_max_cmd_len ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
$as_echo "none" >&6; }
fi
max_cmd_len=$lt_cv_sys_max_cmd_len
: ${CP="cp -f"}
: ${MV="mv -f"}
: ${RM="rm -f"}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
# Try some XSI features
xsi_shell=no
( _lt_dummy="a/b/c"
test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
= c,a/b,b/c, \
&& eval 'test $(( 1 + 1 )) -eq 2 \
&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
&& xsi_shell=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
$as_echo "$xsi_shell" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
lt_shell_append=no
( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
>/dev/null 2>&1 \
&& lt_shell_append=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
$as_echo "$lt_shell_append" >&6; }
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
lt_unset=unset
else
lt_unset=false
fi
# test EBCDIC or ASCII
case `echo X|tr X '\101'` in
A) # ASCII based system
# \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
lt_SP2NL='tr \040 \012'
lt_NL2SP='tr \015\012 \040\040'
;;
*) # EBCDIC based system
lt_SP2NL='tr \100 \n'
lt_NL2SP='tr \r\n \100\100'
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
if ${lt_cv_to_host_file_cmd+:} false; then :
$as_echo_n "(cached) " >&6
else
case $host in
*-*-mingw* )
case $build in
*-*-mingw* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
;;
*-*-cygwin* )
lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
;;
* ) # otherwise, assume *nix
lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
;;
esac
;;
*-*-cygwin* )
case $build in
*-*-mingw* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
;;
*-*-cygwin* )
lt_cv_to_host_file_cmd=func_convert_file_noop
;;
* ) # otherwise, assume *nix
lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
;;
esac
;;
* ) # unhandled hosts (and "normal" native builds)
lt_cv_to_host_file_cmd=func_convert_file_noop
;;
esac
fi
to_host_file_cmd=$lt_cv_to_host_file_cmd
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
$as_echo "$lt_cv_to_host_file_cmd" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
if ${lt_cv_to_tool_file_cmd+:} false; then :
$as_echo_n "(cached) " >&6
else
#assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
*-*-mingw* )
case $build in
*-*-mingw* ) # actually msys
lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
;;
esac
;;
esac
fi
to_tool_file_cmd=$lt_cv_to_tool_file_cmd
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
$as_echo_n "checking for $LD option to reload object files... " >&6; }
if ${lt_cv_ld_reload_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_ld_reload_flag='-r'
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
$as_echo "$lt_cv_ld_reload_flag" >&6; }
reload_flag=$lt_cv_ld_reload_flag
case $reload_flag in
"" | " "*) ;;
*) reload_flag=" $reload_flag" ;;
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
if test "$GCC" != yes; then
reload_cmds=false
fi
;;
darwin*)
if test "$GCC" = yes; then
reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
else
reload_cmds='$LD$reload_flag -o $output$reload_objs'
fi
;;
esac
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ac_tool_prefix}objdump; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_OBJDUMP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OBJDUMP"; then
ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
OBJDUMP=$ac_cv_prog_OBJDUMP
if test -n "$OBJDUMP"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
$as_echo "$OBJDUMP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_OBJDUMP"; then
ac_ct_OBJDUMP=$OBJDUMP
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OBJDUMP"; then
ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
if test -n "$ac_ct_OBJDUMP"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
$as_echo "$ac_ct_OBJDUMP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_OBJDUMP" = x; then
OBJDUMP="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OBJDUMP=$ac_ct_OBJDUMP
fi
else
OBJDUMP="$ac_cv_prog_OBJDUMP"
fi
test -z "$OBJDUMP" && OBJDUMP=objdump
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
$as_echo_n "checking how to recognize dependent libraries... " >&6; }
if ${lt_cv_deplibs_check_method+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_deplibs_check_method='unknown'
# Need to set the preceding variable on all platforms that support
# interlibrary dependencies.
# 'none' -- dependencies not supported.
# `unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
# which responds to the $file_magic_cmd with a given extended regex.
# If you have `file' or equivalent on your system and you're not sure
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
aix[4-9]*)
lt_cv_deplibs_check_method=pass_all
;;
beos*)
lt_cv_deplibs_check_method=pass_all
;;
bsdi[45]*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
lt_cv_file_magic_cmd='/usr/bin/file -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
cygwin*)
# func_win32_libid is a shell function defined in ltmain.sh
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
;;
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
# func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
else
# Keep this pattern in sync with the one in func_win32_libid.
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
lt_cv_file_magic_cmd='$OBJDUMP -f'
fi
;;
cegcc*)
# use the weaker test based on 'objdump'. See mingw*.
lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
lt_cv_file_magic_cmd='$OBJDUMP -f'
;;
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
else
lt_cv_deplibs_check_method=pass_all
fi
;;
gnu*)
lt_cv_deplibs_check_method=pass_all
;;
haiku*)
lt_cv_deplibs_check_method=pass_all
;;
hpux10.20* | hpux11*)
lt_cv_file_magic_cmd=/usr/bin/file
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
;;
hppa*64*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
;;
*)
lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
lt_cv_file_magic_test_file=/usr/lib/libc.sl
;;
esac
;;
interix[3-9]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
;;
irix5* | irix6* | nonstopux*)
case $LD in
*-32|*"-32 ") libmagic=32-bit;;
*-n32|*"-n32 ") libmagic=N32;;
*-64|*"-64 ") libmagic=64-bit;;
*) libmagic=never-match;;
esac
lt_cv_deplibs_check_method=pass_all
;;
# This must be glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
fi
;;
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
lt_cv_file_magic_cmd=/usr/bin/file
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
*nto* | *qnx*)
lt_cv_deplibs_check_method=pass_all
;;
openbsd*)
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
fi
;;
osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
rdos*)
lt_cv_deplibs_check_method=pass_all
;;
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
lt_cv_deplibs_check_method=pass_all
;;
sysv4 | sysv4.3*)
case $host_vendor in
motorola)
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
;;
ncr)
lt_cv_deplibs_check_method=pass_all
;;
sequent)
lt_cv_file_magic_cmd='/bin/file'
lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
;;
sni)
lt_cv_file_magic_cmd='/bin/file'
lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
lt_cv_file_magic_test_file=/lib/libc.so
;;
siemens)
lt_cv_deplibs_check_method=pass_all
;;
pc)
lt_cv_deplibs_check_method=pass_all
;;
esac
;;
tpf*)
lt_cv_deplibs_check_method=pass_all
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
$as_echo "$lt_cv_deplibs_check_method" >&6; }
file_magic_glob=
want_nocaseglob=no
if test "$build" = "$host"; then
case $host_os in
mingw* | pw32*)
if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
want_nocaseglob=yes
else
file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
fi
;;
esac
fi
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_DLLTOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$DLLTOOL"; then
ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
DLLTOOL=$ac_cv_prog_DLLTOOL
if test -n "$DLLTOOL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
$as_echo "$DLLTOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_DLLTOOL"; then
ac_ct_DLLTOOL=$DLLTOOL
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_DLLTOOL"; then
ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
if test -n "$ac_ct_DLLTOOL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
$as_echo "$ac_ct_DLLTOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_DLLTOOL" = x; then
DLLTOOL="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DLLTOOL=$ac_ct_DLLTOOL
fi
else
DLLTOOL="$ac_cv_prog_DLLTOOL"
fi
test -z "$DLLTOOL" && DLLTOOL=dlltool
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_sharedlib_from_linklib_cmd='unknown'
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# two different shell functions defined in ltmain.sh
# decide which to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
*--identify-strict*)
lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
;;
*)
lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
;;
esac
;;
*)
# fallback: assume linklib IS sharedlib
lt_cv_sharedlib_from_linklib_cmd="$ECHO"
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
if test -n "$ac_tool_prefix"; then
for ac_prog in ar
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_AR+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$AR"; then
ac_cv_prog_AR="$AR" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
AR=$ac_cv_prog_AR
if test -n "$AR"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
$as_echo "$AR" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$AR" && break
done
fi
if test -z "$AR"; then
ac_ct_AR=$AR
for ac_prog in ar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_AR+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_AR"; then
ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AR="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_AR=$ac_cv_prog_ac_ct_AR
if test -n "$ac_ct_AR"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
$as_echo "$ac_ct_AR" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ac_ct_AR" && break
done
if test "x$ac_ct_AR" = x; then
AR="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
AR=$ac_ct_AR
fi
fi
: ${AR=ar}
: ${AR_FLAGS=cru}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
$as_echo_n "checking for archiver @FILE support... " >&6; }
if ${lt_cv_ar_at_file+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_ar_at_file=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
echo conftest.$ac_objext > conftest.lst
lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
(eval $lt_ar_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if test "$ac_status" -eq 0; then
# Ensure the archiver fails upon bogus file names.
rm -f conftest.$ac_objext libconftest.a
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
(eval $lt_ar_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if test "$ac_status" -ne 0; then
lt_cv_ar_at_file=@
fi
fi
rm -f conftest.* libconftest.a
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
$as_echo "$lt_cv_ar_at_file" >&6; }
if test "x$lt_cv_ar_at_file" = xno; then
archiver_list_spec=
else
archiver_list_spec=$lt_cv_ar_at_file
fi
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_STRIP+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
$as_echo "$STRIP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
$as_echo_n "(cached) " >&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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
$as_echo "$ac_ct_STRIP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
STRIP=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
fi
else
STRIP="$ac_cv_prog_STRIP"
fi
test -z "$STRIP" && STRIP=:
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_RANLIB+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
$as_echo "$RANLIB" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_RANLIB"; then
ac_ct_RANLIB=$RANLIB
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_RANLIB"; then
ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
if test -n "$ac_ct_RANLIB"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
$as_echo "$ac_ct_RANLIB" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_RANLIB" = x; then
RANLIB=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
RANLIB=$ac_ct_RANLIB
fi
else
RANLIB="$ac_cv_prog_RANLIB"
fi
test -z "$RANLIB" && RANLIB=:
# Determine commands to create old-style static archives.
old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
;;
*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
;;
esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
darwin*)
lock_old_archive_extraction=yes ;;
*)
lock_old_archive_extraction=no ;;
esac
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
compiler=$CC
# Check for command to grab the raw symbol name followed by C symbol from nm.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
if ${lt_cv_sys_global_symbol_pipe+:} false; then :
$as_echo_n "(cached) " >&6
else
# These are sane defaults that work on at least a few old systems.
# [They come from Ultrix. What could be older than Ultrix?!! ;)]
# Character class describing NM global symbol codes.
symcode='[BCDEGRST]'
# Regexp to match symbols that can be accessed directly from C.
sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
# Define system-specific variables.
case $host_os in
aix*)
symcode='[BCDT]'
;;
cygwin* | mingw* | pw32* | cegcc*)
symcode='[ABCDGISTW]'
;;
hpux*)
if test "$host_cpu" = ia64; then
symcode='[ABCDEGRST]'
fi
;;
irix* | nonstopux*)
symcode='[BCDEGRST]'
;;
osf*)
symcode='[BCDEGQRST]'
;;
solaris*)
symcode='[BDRT]'
;;
sco3.2v5*)
symcode='[DT]'
;;
sysv4.2uw2*)
symcode='[DT]'
;;
sysv5* | sco5v6* | unixware* | OpenUNIX*)
symcode='[ABDT]'
;;
sysv4)
symcode='[DFNSTU]'
;;
esac
# If we're using GNU nm, then use its standard symbol codes.
case `$NM -V 2>&1` in
*GNU* | *'with BFD'*)
symcode='[ABCDGIRSTW]' ;;
esac
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
mingw*)
opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
esac
# Try without a prefix underscore, then with it.
for ac_symprfx in "" "_"; do
# Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
symxfrm="\\1 $ac_symprfx\\2 \\2"
# Write the raw and C identifiers.
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function
# and D for any global variable.
# Also find C++ and __fastcall symbols from MSVC++,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\
" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
" {if(hide[section]) next};"\
" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
" s[1]~/^[@?]/{print s[1], s[1]; next};"\
" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx"
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
rm -f conftest*
cat > conftest.$ac_ext <<_LT_EOF
#ifdef __cplusplus
extern "C" {
#endif
char nm_test_var;
void nm_test_func(void);
void nm_test_func(void){}
#ifdef __cplusplus
}
#endif
int main(){nm_test_var='a';nm_test_func();return(0);}
_LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
# Now try to grab the symbols.
nlist=conftest.nm
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
(eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
else
rm -f "$nlist"T
fi
# Make sure that we snagged all the symbols we need.
if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
/* DATA imports from DLLs on WIN32 con't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs. */
# define LT_DLSYM_CONST
#elif defined(__osf__)
/* This system does not cope well with relocations in const data. */
# define LT_DLSYM_CONST
#else
# define LT_DLSYM_CONST const
#endif
#ifdef __cplusplus
extern "C" {
#endif
_LT_EOF
# Now generate the symbol file.
eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
cat <<_LT_EOF >> conftest.$ac_ext
/* The mapping between symbol names and symbols. */
LT_DLSYM_CONST struct {
const char *name;
void *address;
}
lt__PROGRAM__LTX_preloaded_symbols[] =
{
{ "@PROGRAM@", (void *) 0 },
_LT_EOF
$SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
cat <<\_LT_EOF >> conftest.$ac_ext
{0, (void *) 0}
};
/* This works around a problem in FreeBSD linker */
#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
return lt__PROGRAM__LTX_preloaded_symbols;
}
#endif
#ifdef __cplusplus
}
#endif
_LT_EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
lt_globsym_save_LIBS=$LIBS
lt_globsym_save_CFLAGS=$CFLAGS
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
LIBS=$lt_globsym_save_LIBS
CFLAGS=$lt_globsym_save_CFLAGS
else
echo "cannot find nm_test_func in $nlist" >&5
fi
else
echo "cannot find nm_test_var in $nlist" >&5
fi
else
echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
fi
else
echo "$progname: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
break
else
lt_cv_sys_global_symbol_pipe=
fi
done
fi
if test -z "$lt_cv_sys_global_symbol_pipe"; then
lt_cv_sys_global_symbol_to_cdecl=
fi
if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
$as_echo "failed" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
fi
# Response file support.
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
nm_file_list_spec='@'
elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
nm_file_list_spec='@'
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
$as_echo_n "checking for sysroot... " >&6; }
# Check whether --with-sysroot was given.
if test "${with_sysroot+set}" = set; then :
withval=$with_sysroot;
else
with_sysroot=no
fi
lt_sysroot=
case ${with_sysroot} in #(
yes)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
;; #(
/*)
lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
$as_echo "${with_sysroot}" >&6; }
as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
$as_echo "${lt_sysroot:-no}" >&6; }
# Check whether --enable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then :
enableval=$enable_libtool_lock;
fi
test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
case `/usr/bin/file conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE="32"
;;
*ELF-64*)
HPUX_IA64_MODE="64"
;;
esac
fi
rm -rf conftest*
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line '$LINENO' "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
*N32*)
LD="${LD-ld} -melf32bmipn32"
;;
*64-bit*)
LD="${LD-ld} -melf64bmip"
;;
esac
else
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
*N32*)
LD="${LD-ld} -n32"
;;
*64-bit*)
LD="${LD-ld} -64"
;;
esac
fi
fi
rm -rf conftest*
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
ppc64-*linux*|powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
LD="${LD-ld} -m elf_s390"
;;
sparc64-*linux*)
LD="${LD-ld} -m elf32_sparc"
;;
esac
;;
*64-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_x86_64_fbsd"
;;
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
ppc*-*linux*|powerpc*-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
LD="${LD-ld} -m elf64_s390"
;;
sparc*-*linux*)
LD="${LD-ld} -m elf64_sparc"
;;
esac
;;
esac
fi
rm -rf conftest*
;;
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
if ${lt_cv_cc_needs_belf+:} false; then :
$as_echo_n "(cached) " >&6
else
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
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
lt_cv_cc_needs_belf=yes
else
lt_cv_cc_needs_belf=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
$as_echo "$lt_cv_cc_needs_belf" >&6; }
if test x"$lt_cv_cc_needs_belf" != x"yes"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
CFLAGS="$SAVE_CFLAGS"
fi
;;
*-*solaris*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*)
case $host in
i?86-*-solaris*)
LD="${LD-ld} -m elf_x86_64"
;;
sparc*-*-solaris*)
LD="${LD-ld} -m elf64_sparc"
;;
esac
# GNU ld 2.21 introduced _sol2 emulations. Use them if available.
if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
LD="${LD-ld}_sol2"
fi
;;
*)
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
LD="${LD-ld} -64"
fi
;;
esac
;;
esac
fi
rm -rf conftest*
;;
esac
need_locks="$enable_libtool_lock"
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
set dummy ${ac_tool_prefix}mt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$MANIFEST_TOOL"; then
ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
if test -n "$MANIFEST_TOOL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
$as_echo "$MANIFEST_TOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
# Extract the first word of "mt", so it can be a program name with args.
set dummy mt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_MANIFEST_TOOL"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
if test -n "$ac_ct_MANIFEST_TOOL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_MANIFEST_TOOL" = x; then
MANIFEST_TOOL=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
fi
else
MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
fi
test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
if ${lt_cv_path_mainfest_tool+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_path_mainfest_tool=no
echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
$MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
cat conftest.err >&5
if $GREP 'Manifest Tool' conftest.out > /dev/null; then
lt_cv_path_mainfest_tool=yes
fi
rm -f conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
$as_echo "$lt_cv_path_mainfest_tool" >&6; }
if test "x$lt_cv_path_mainfest_tool" != xyes; then
MANIFEST_TOOL=:
fi
case $host_os in
rhapsody* | darwin*)
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_DSYMUTIL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$DSYMUTIL"; then
ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
DSYMUTIL=$ac_cv_prog_DSYMUTIL
if test -n "$DSYMUTIL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
$as_echo "$DSYMUTIL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_DSYMUTIL"; then
ac_ct_DSYMUTIL=$DSYMUTIL
# Extract the first word of "dsymutil", so it can be a program name with args.
set dummy dsymutil; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_DSYMUTIL"; then
ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
if test -n "$ac_ct_DSYMUTIL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
$as_echo "$ac_ct_DSYMUTIL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_DSYMUTIL" = x; then
DSYMUTIL=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
DSYMUTIL=$ac_ct_DSYMUTIL
fi
else
DSYMUTIL="$ac_cv_prog_DSYMUTIL"
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
set dummy ${ac_tool_prefix}nmedit; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_NMEDIT+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$NMEDIT"; then
ac_cv_prog_NMEDIT="$NMEDIT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
NMEDIT=$ac_cv_prog_NMEDIT
if test -n "$NMEDIT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
$as_echo "$NMEDIT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_NMEDIT"; then
ac_ct_NMEDIT=$NMEDIT
# Extract the first word of "nmedit", so it can be a program name with args.
set dummy nmedit; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_NMEDIT"; then
ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_NMEDIT="nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
if test -n "$ac_ct_NMEDIT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
$as_echo "$ac_ct_NMEDIT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_NMEDIT" = x; then
NMEDIT=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
NMEDIT=$ac_ct_NMEDIT
fi
else
NMEDIT="$ac_cv_prog_NMEDIT"
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
set dummy ${ac_tool_prefix}lipo; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_LIPO+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$LIPO"; then
ac_cv_prog_LIPO="$LIPO" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
LIPO=$ac_cv_prog_LIPO
if test -n "$LIPO"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
$as_echo "$LIPO" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_LIPO"; then
ac_ct_LIPO=$LIPO
# Extract the first word of "lipo", so it can be a program name with args.
set dummy lipo; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_LIPO"; then
ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_LIPO="lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
if test -n "$ac_ct_LIPO"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
$as_echo "$ac_ct_LIPO" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_LIPO" = x; then
LIPO=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
LIPO=$ac_ct_LIPO
fi
else
LIPO="$ac_cv_prog_LIPO"
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
set dummy ${ac_tool_prefix}otool; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_OTOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OTOOL"; then
ac_cv_prog_OTOOL="$OTOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
OTOOL=$ac_cv_prog_OTOOL
if test -n "$OTOOL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
$as_echo "$OTOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_OTOOL"; then
ac_ct_OTOOL=$OTOOL
# Extract the first word of "otool", so it can be a program name with args.
set dummy otool; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OTOOL"; then
ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL="otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
if test -n "$ac_ct_OTOOL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
$as_echo "$ac_ct_OTOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_OTOOL" = x; then
OTOOL=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OTOOL=$ac_ct_OTOOL
fi
else
OTOOL="$ac_cv_prog_OTOOL"
fi
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
set dummy ${ac_tool_prefix}otool64; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_OTOOL64+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$OTOOL64"; then
ac_cv_prog_OTOOL64="$OTOOL64" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
OTOOL64=$ac_cv_prog_OTOOL64
if test -n "$OTOOL64"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
$as_echo "$OTOOL64" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_OTOOL64"; then
ac_ct_OTOOL64=$OTOOL64
# Extract the first word of "otool64", so it can be a program name with args.
set dummy otool64; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_OTOOL64"; then
ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL64="otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
if test -n "$ac_ct_OTOOL64"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
$as_echo "$ac_ct_OTOOL64" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_OTOOL64" = x; then
OTOOL64=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
OTOOL64=$ac_ct_OTOOL64
fi
else
OTOOL64="$ac_cv_prog_OTOOL64"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
$as_echo_n "checking for -single_module linker flag... " >&6; }
if ${lt_cv_apple_cc_single_mod+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_apple_cc_single_mod=no
if test -z "${LT_MULTI_MODULE}"; then
# By default we will add the -single_module flag. You can override
# by either setting the environment variable LT_MULTI_MODULE
# non-empty at configure time, or by adding -multi_module to the
# link flags.
rm -rf libconftest.dylib*
echo "int foo(void){return 1;}" > conftest.c
echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c" >&5
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
_lt_result=$?
# If there is a non-empty error log, and "single_module"
# appears in it, assume the flag caused a linker warning
if test -s conftest.err && $GREP single_module conftest.err; then
cat conftest.err >&5
# Otherwise, if the output was created with a 0 exit code from
# the compiler, it worked.
elif test -f libconftest.dylib && test $_lt_result -eq 0; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&5
fi
rm -rf libconftest.dylib*
rm -f conftest.*
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
if ${lt_cv_ld_exported_symbols_list+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_ld_exported_symbols_list=no
save_LDFLAGS=$LDFLAGS
echo "_main" > conftest.sym
LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
lt_cv_ld_exported_symbols_list=yes
else
lt_cv_ld_exported_symbols_list=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS="$save_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
$as_echo_n "checking for -force_load linker flag... " >&6; }
if ${lt_cv_ld_force_load+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_ld_force_load=no
cat > conftest.c << _LT_EOF
int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
echo "$AR cru libconftest.a conftest.o" >&5
$AR cru libconftest.a conftest.o 2>&5
echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF
int main() { return 0;}
_LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
_lt_result=$?
if test -s conftest.err && $GREP force_load conftest.err; then
cat conftest.err >&5
elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&5
fi
rm -f conftest.err libconftest.a conftest conftest.c
rm -rf conftest.dSYM
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
$as_echo "$lt_cv_ld_force_load" >&6; }
case $host_os in
rhapsody* | darwin1.[012])
_lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
darwin*) # darwin 5.x on
# if running on 10.5 or later, the deployment target defaults
# to the OS version, if on x86, and 10.4, the deployment
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[91]*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
10.[012]*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10.*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
if test "$lt_cv_apple_cc_single_mod" = "yes"; then
_lt_dar_single_mod='$single_module'
fi
if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
_lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
else
_lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
fi
if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
fi
;;
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if ${ac_cv_prog_CPP+:} false; then :
$as_echo_n "(cached) " >&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 <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i 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
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
$as_echo "$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 <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
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
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if ${ac_cv_header_stdc+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_header_stdc=yes
else
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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <string.h>
_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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdlib.h>
_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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <ctype.h>
#include <stdlib.h>
#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
if ac_fn_c_try_run "$LINENO"; then :
else
ac_cv_header_stdc=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
$as_echo "#define STDC_HEADERS 1" >>confdefs.h
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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
for ac_header in dlfcn.h
do :
ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
"
if test "x$ac_cv_header_dlfcn_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_DLFCN_H 1
_ACEOF
fi
done
# Set options
enable_dlopen=no
enable_win32_dll=no
# Check whether --enable-shared was given.
if test "${enable_shared+set}" = set; then :
enableval=$enable_shared; p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac
else
enable_shared=yes
fi
# Check whether --enable-static was given.
if test "${enable_static+set}" = set; then :
enableval=$enable_static; p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac
else
enable_static=yes
fi
# Check whether --with-pic was given.
if test "${with_pic+set}" = set; then :
withval=$with_pic; lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for lt_pkg in $withval; do
IFS="$lt_save_ifs"
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS="$lt_save_ifs"
;;
esac
else
pic_mode=default
fi
test -z "$pic_mode" && pic_mode=default
# Check whether --enable-fast-install was given.
if test "${enable_fast_install+set}" = set; then :
enableval=$enable_fast_install; p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac
else
enable_fast_install=yes
fi
# This can be used to rebuild libtool when needed
LIBTOOL_DEPS="$ltmain"
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
test -z "$LN_S" && LN_S="ln -s"
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
$as_echo_n "checking for objdir... " >&6; }
if ${lt_cv_objdir+:} false; then :
$as_echo_n "(cached) " >&6
else
rm -f .libs 2>/dev/null
mkdir .libs 2>/dev/null
if test -d .libs; then
lt_cv_objdir=.libs
else
# MS-DOS does not allow filenames that begin with a dot.
lt_cv_objdir=_libs
fi
rmdir .libs 2>/dev/null
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
$as_echo "$lt_cv_objdir" >&6; }
objdir=$lt_cv_objdir
cat >>confdefs.h <<_ACEOF
#define LT_OBJDIR "$lt_cv_objdir/"
_ACEOF
case $host_os in
aix3*)
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
;;
esac
# Global variables:
ofile=libtool
can_build_shared=yes
# All known linkers require a `.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
with_gnu_ld="$lt_cv_prog_gnu_ld"
old_CC="$CC"
old_CFLAGS="$CFLAGS"
# Set sane defaults for various variables
test -z "$CC" && CC=cc
test -z "$LTCC" && LTCC=$CC
test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
test -z "$LD" && LD=ld
test -z "$ac_objext" && ac_objext=o
for cc_temp in $compiler""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
# Only perform the check for file, if the check method requires it
test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
file_magic*)
if test "$file_magic_cmd" = '$MAGIC_CMD'; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
if ${lt_cv_path_MAGIC_CMD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
*)
lt_save_MAGIC_CMD="$MAGIC_CMD"
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
for ac_dir in $ac_dummy; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/${ac_tool_prefix}file; then
lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
else
cat <<_LT_EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such. This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem. Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
_LT_EOF
fi ;;
esac
fi
break
fi
done
IFS="$lt_save_ifs"
MAGIC_CMD="$lt_save_MAGIC_CMD"
;;
esac
fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
$as_echo_n "checking for file... " >&6; }
if ${lt_cv_path_MAGIC_CMD+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
*)
lt_save_MAGIC_CMD="$MAGIC_CMD"
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
for ac_dir in $ac_dummy; do
IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/file; then
lt_cv_path_MAGIC_CMD="$ac_dir/file"
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
else
cat <<_LT_EOF 1>&2
*** Warning: the command libtool uses to detect shared libraries,
*** $file_magic_cmd, produces output that libtool cannot recognize.
*** The result is that libtool may fail to recognize shared libraries
*** as such. This will affect the creation of libtool libraries that
*** depend on shared libraries, but programs linked with such libtool
*** libraries will work regardless of this problem. Nevertheless, you
*** may want to report the problem to your system manager and/or to
*** bug-libtool@gnu.org
_LT_EOF
fi ;;
esac
fi
break
fi
done
IFS="$lt_save_ifs"
MAGIC_CMD="$lt_save_MAGIC_CMD"
;;
esac
fi
MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
if test -n "$MAGIC_CMD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
else
MAGIC_CMD=:
fi
fi
fi
;;
esac
# Use C for the default configuration in the libtool script
lt_save_CC="$CC"
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
# Source file extension for C test sources.
ac_ext=c
# Object file extension for compiled C test sources.
objext=o
objext=$objext
# Code to be used in simple compile tests
lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
lt_simple_link_test_code='int main(){return(0);}'
# If no C compiler was specified, use CC.
LTCC=${LTCC-"$CC"}
# If no C compiler flags were specified, use CFLAGS.
LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
compiler=$CC
# Save the default compiler, since it gets overwritten when the other
# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
compiler_DEFAULT=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$RM conftest*
ac_outfile=conftest.$ac_objext
echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
$RM -r conftest*
if test -n "$compiler"; then
lt_prog_compiler_no_builtin_flag=
if test "$GCC" = yes; then
case $cc_basename in
nvcc*)
lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
*)
lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
# The option is referenced via a variable to avoid confusing sed.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_rtti_exceptions=yes
fi
fi
$RM conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
else
:
fi
fi
lt_prog_compiler_wl=
lt_prog_compiler_pic=
lt_prog_compiler_static=
if test "$GCC" = yes; then
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_static='-static'
case $host_os in
aix*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
lt_prog_compiler_static='-Bstatic'
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
lt_prog_compiler_pic='-fPIC'
;;
m68k)
# FIXME: we need at least 68020 code to build shared libraries, but
# adding the `-m68020' flag to GCC prevents building anything better,
# like `-m68040'.
lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
;;
esac
;;
beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
# Although the cygwin gcc ignores -fPIC, still need this for old-style
# (--disable-auto-import) libraries
lt_prog_compiler_pic='-DDLL_EXPORT'
;;
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
lt_prog_compiler_pic='-fno-common'
;;
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
lt_prog_compiler_static=
;;
hpux*)
# PIC is the default for 64-bit PA HP-UX, but not for 32-bit
# PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
# sets the default TLS model and affects inlining.
case $host_cpu in
hppa*64*)
# +Z the default
;;
*)
lt_prog_compiler_pic='-fPIC'
;;
esac
;;
interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
msdosdjgpp*)
# Just because we use GCC doesn't mean we suddenly get shared libraries
# on systems that don't support them.
lt_prog_compiler_can_build_shared=no
enable_shared=no
;;
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
lt_prog_compiler_pic='-fPIC -shared'
;;
sysv4*MP*)
if test -d /usr/nec; then
lt_prog_compiler_pic=-Kconform_pic
fi
;;
*)
lt_prog_compiler_pic='-fPIC'
;;
esac
case $cc_basename in
nvcc*) # Cuda Compiler Driver 2.2
lt_prog_compiler_wl='-Xlinker '
if test -n "$lt_prog_compiler_pic"; then
lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
fi
;;
esac
else
# PORTME Check for flag to pass linker flags through the system compiler.
case $host_os in
aix*)
lt_prog_compiler_wl='-Wl,'
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
lt_prog_compiler_static='-Bstatic'
else
lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
fi
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
;;
hpux9* | hpux10* | hpux11*)
lt_prog_compiler_wl='-Wl,'
# PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
# not for PA HP-UX.
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
;;
*)
lt_prog_compiler_pic='+Z'
;;
esac
# Is there a better lt_prog_compiler_static that works with the bundled CC?
lt_prog_compiler_static='${wl}-a ${wl}archive'
;;
irix5* | irix6* | nonstopux*)
lt_prog_compiler_wl='-Wl,'
# PIC (with -KPIC) is the default.
lt_prog_compiler_static='-non_shared'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
# old Intel for x86_64 which still supported -KPIC.
ecc*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fPIC'
lt_prog_compiler_static='-static'
;;
# Lahey Fortran 8.1.
lf95*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='--shared'
lt_prog_compiler_static='--static'
;;
nagfor*)
# NAG Fortran compiler
lt_prog_compiler_wl='-Wl,-Wl,,'
lt_prog_compiler_pic='-PIC'
lt_prog_compiler_static='-Bstatic'
;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fpic'
lt_prog_compiler_static='-Bstatic'
;;
ccc*)
lt_prog_compiler_wl='-Wl,'
# All Alpha code is PIC.
lt_prog_compiler_static='-non_shared'
;;
xl* | bgxl* | bgf* | mpixl*)
# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-qpic'
lt_prog_compiler_static='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl=''
;;
*Sun\ F* | *Sun*Fortran*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl='-Qoption ld '
;;
*Sun\ C*)
# Sun C 5.9
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl='-Wl,'
;;
*Intel*\ [CF]*Compiler*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fPIC'
lt_prog_compiler_static='-static'
;;
*Portland\ Group*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fpic'
lt_prog_compiler_static='-Bstatic'
;;
esac
;;
esac
;;
newsos6)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
;;
*nto* | *qnx*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
# it will coredump.
lt_prog_compiler_pic='-fPIC -shared'
;;
osf3* | osf4* | osf5*)
lt_prog_compiler_wl='-Wl,'
# All OSF/1 code is PIC.
lt_prog_compiler_static='-non_shared'
;;
rdos*)
lt_prog_compiler_static='-non_shared'
;;
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
case $cc_basename in
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
lt_prog_compiler_wl='-Qoption ld ';;
*)
lt_prog_compiler_wl='-Wl,';;
esac
;;
sunos4*)
lt_prog_compiler_wl='-Qoption ld '
lt_prog_compiler_pic='-PIC'
lt_prog_compiler_static='-Bstatic'
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
;;
sysv4*MP*)
if test -d /usr/nec ;then
lt_prog_compiler_pic='-Kconform_pic'
lt_prog_compiler_static='-Bstatic'
fi
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
;;
unicos*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_can_build_shared=no
;;
uts4*)
lt_prog_compiler_pic='-pic'
lt_prog_compiler_static='-Bstatic'
;;
*)
lt_prog_compiler_can_build_shared=no
;;
esac
fi
case $host_os in
# For platforms which do not support PIC, -DPIC is meaningless:
*djgpp*)
lt_prog_compiler_pic=
;;
*)
lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
if ${lt_cv_prog_compiler_pic+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
$as_echo "$lt_cv_prog_compiler_pic" >&6; }
lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
if ${lt_cv_prog_compiler_pic_works+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_pic_works=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
# The option is referenced via a variable to avoid confusing sed.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_pic_works=yes
fi
fi
$RM conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
case $lt_prog_compiler_pic in
"" | " "*) ;;
*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
esac
else
lt_prog_compiler_pic=
lt_prog_compiler_can_build_shared=no
fi
fi
#
# Check to make sure the static flag actually works.
#
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
if ${lt_cv_prog_compiler_static_works+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_static_works=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&5
$ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler_static_works=yes
fi
else
lt_cv_prog_compiler_static_works=yes
fi
fi
$RM -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
if test x"$lt_cv_prog_compiler_static_works" = xyes; then
:
else
lt_prog_compiler_static=
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
if ${lt_cv_prog_compiler_c_o+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_c_o=no
$RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
mkdir out
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
$ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o=yes
fi
fi
chmod u+w . 2>&5
$RM conftest*
# SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
$RM out/* && rmdir out
cd ..
$RM -r conftest
$RM conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
if ${lt_cv_prog_compiler_c_o+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_c_o=no
$RM -r conftest 2>/dev/null
mkdir conftest
cd conftest
mkdir out
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
# with a dollar sign (not a hyphen), so the echo should work correctly.
lt_compile=`echo "$ac_compile" | $SED \
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
$ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
$SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
lt_cv_prog_compiler_c_o=yes
fi
fi
chmod u+w . 2>&5
$RM conftest*
# SGI C++ compiler will create directory out/ii_files/ for
# template instantiation
test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
$RM out/* && rmdir out
cd ..
$RM -r conftest
$RM conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
hard_links="nottested"
if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
# do not overwrite the value of need_locks provided by the user
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
$as_echo_n "checking if we can lock with hard links... " >&6; }
hard_links=yes
$RM conftest*
ln conftest.a conftest.b 2>/dev/null && hard_links=no
touch conftest.a
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
$as_echo "$hard_links" >&6; }
if test "$hard_links" = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
need_locks=warn
fi
else
need_locks=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
runpath_var=
allow_undefined_flag=
always_export_symbols=no
archive_cmds=
archive_expsym_cmds=
compiler_needs_object=no
enable_shared_with_static_runtimes=no
export_dynamic_flag_spec=
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
hardcode_automatic=no
hardcode_direct=no
hardcode_direct_absolute=no
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
inherit_rpath=no
link_all_deplibs=unknown
module_cmds=
module_expsym_cmds=
old_archive_from_new_cmds=
old_archive_from_expsyms_cmds=
thread_safe_flag_spec=
whole_archive_flag_spec=
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
include_expsyms=
# exclude_expsyms can be an extended regexp of symbols to exclude
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
# Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
# On some targets, GNU ld is compatible enough with the native linker
# that we're better off using the native interface for both.
lt_use_gnu_ld_interface=no
if test "$with_gnu_ld" = yes; then
case $host_os in
aix*)
# The AIX port of GNU ld has always aspired to compatibility
# with the native linker. However, as the warning in the GNU ld
# block says, versions before 2.19.5* couldn't really create working
# shared libraries, regardless of the interface used.
case `$LD -v 2>&1` in
*\ \(GNU\ Binutils\)\ 2.19.5*) ;;
*\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
*\ \(GNU\ Binutils\)\ [3-9]*) ;;
*)
lt_use_gnu_ld_interface=yes
;;
esac
;;
*)
lt_use_gnu_ld_interface=yes
;;
esac
fi
if test "$lt_use_gnu_ld_interface" = yes; then
# If archive_cmds runs LD, not CC, wlarc should be empty
wlarc='${wl}'
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
export_dynamic_flag_spec='${wl}--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
whole_archive_flag_spec=
fi
supports_anon_versioning=no
case `$LD -v 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
*\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
*\ 2.11.*) ;; # other 2.11 versions
*) supports_anon_versioning=yes ;;
esac
# See if GNU ld supports shared libraries.
case $host_os in
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
cat <<_LT_EOF 1>&2
*** Warning: the GNU linker, at least up to release 2.19, is reported
*** to be unable to reliably create shared libraries on AIX.
*** Therefore, libtool is disabling shared libraries support. If you
*** really care for shared libraries, you may want to install binutils
*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
*** You will then need to restart the configuration process.
_LT_EOF
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds=''
;;
m68k)
archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
beos*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
allow_undefined_flag=unsupported
# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32* | cegcc*)
# _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
export_dynamic_flag_spec='${wl}--export-all-symbols'
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
# If the export-symbols file already is a .def file (1st line
# is EXPORTS), use it as is; otherwise, prepend...
archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
cp $export_symbols $output_objdir/$soname.def;
else
echo EXPORTS > $output_objdir/$soname.def;
cat $export_symbols >> $output_objdir/$soname.def;
fi~
$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
ld_shlibs=no
fi
;;
haiku*)
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
link_all_deplibs=yes
;;
interix[3-9]*)
hardcode_direct=no
hardcode_shlibpath_var=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
export_dynamic_flag_spec='${wl}-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
if test "$host_os" = linux-dietlibc; then
case $cc_basename in
diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
esac
fi
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group f77 and f90 compilers
whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
tmp_addflag=' -i_dynamic -nofor_main' ;;
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
lf95*) # Lahey Fortran 8.1
whole_archive_flag_spec=
tmp_sharedflag='--shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
nvcc*) # Cuda Compiler Driver 2.2
whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
compiler_needs_object=yes
;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
compiler_needs_object=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
esac
archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
else
ld_shlibs=no
fi
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
solaris*)
if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
cat <<_LT_EOF 1>&2
*** Warning: The releases 2.8.* of the GNU linker cannot reliably
*** create shared libraries on Solaris systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.9.1 or newer. Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
cat <<_LT_EOF 1>&2
*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
*** reliably create shared libraries on SCO systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
*** your PATH or compiler configuration so that the native linker is
*** used, and then restart.
_LT_EOF
;;
*)
# For security reasons, it is highly recommended that you always
# use absolute paths for naming shared libraries, and exclude the
# DT_RUNPATH tag from executables and libraries. But doing so
# requires that you compile everything twice, which is a pain.
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
wlarc=
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = no; then
runpath_var=
hardcode_libdir_flag_spec=
export_dynamic_flag_spec=
whole_archive_flag_spec=
fi
else
# PORTME fill in a description of your system's linker (not GNU ld)
case $host_os in
aix3*)
allow_undefined_flag=unsupported
always_export_symbols=yes
archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
exp_sym_flag='-Bexport'
no_entry_flag=""
else
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
# Also, AIX nm treats weak defined symbols like other global
# defined symbols, whereas GNU nm marks them as "W".
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
else
export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
exp_sym_flag='-bexport'
no_entry_flag='-bnoentry'
fi
# When large executables or shared objects are built, AIX ld can
# have problems creating the table of contents. If linking a library
# or program results in "error TOC overflow" add -mminimal-toc to
# CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
# enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
archive_cmds=''
hardcode_direct=yes
hardcode_direct_absolute=yes
hardcode_libdir_separator=':'
link_all_deplibs=yes
file_list_spec='${wl}-f,'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
hardcode_direct=unsupported
# It fails to find uninstalled libraries when the uninstalled
# path is not listed in the libpath. Setting hardcode_minus_L
# to unsupported forces relinking
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
shared_flag='-shared'
if test "$aix_use_runtimelinking" = yes; then
shared_flag="$shared_flag "'${wl}-G'
fi
else
# not using gcc
if test "$host_cpu" = ia64; then
# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
if test "$aix_use_runtimelinking" = yes; then
shared_flag='${wl}-G'
else
shared_flag='${wl}-bM:SRE'
fi
fi
fi
export_dynamic_flag_spec='${wl}-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
always_export_symbols=yes
if test "$aix_use_runtimelinking" = yes; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
if test "${lt_cv_aix_libpath+set}" = set; then
aix_libpath=$lt_cv_aix_libpath
else
if ${lt_cv_aix_libpath_+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\([^ ]*\) *$/\1/
p
}
}'
lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_="/usr/lib:/lib"
fi
fi
aix_libpath=$lt_cv_aix_libpath_
fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
if test "${lt_cv_aix_libpath+set}" = set; then
aix_libpath=$lt_cv_aix_libpath
else
if ${lt_cv_aix_libpath_+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\([^ ]*\) *$/\1/
p
}
}'
lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_="/usr/lib:/lib"
fi
fi
aix_libpath=$lt_cv_aix_libpath_
fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
no_undefined_flag=' ${wl}-bernotok'
allow_undefined_flag=' ${wl}-berok'
if test "$with_gnu_ld" = yes; then
# We only use this code for GNU lds that support --whole-archive.
whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
whole_archive_flag_spec='$convenience'
fi
archive_cmds_need_lc=yes
# This is similar to how AIX traditionally builds its shared libraries.
archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
fi
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds=''
;;
m68k)
archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
bsdi[45]*)
export_dynamic_flag_spec=-rdynamic
;;
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
cl*)
# Native MSVC
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
always_export_symbols=yes
file_list_spec='@'
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack.
archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
else
sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
fi~
$CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
enable_shared_with_static_runtimes=yes
exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
# Don't use ranlib
old_postinstall_cmds='chmod 644 $oldlib'
postlink_cmds='lt_outputfile="@OUTPUT@"~
lt_tool_outputfile="@TOOL_OUTPUT@"~
case $lt_outputfile in
*.exe|*.EXE) ;;
*)
lt_outputfile="$lt_outputfile.exe"
lt_tool_outputfile="$lt_tool_outputfile.exe"
;;
esac~
if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
$MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
$RM "$lt_outputfile.manifest";
fi'
;;
*)
# Assume MSVC wrapper
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
shrext_cmds=".dll"
# FIXME: Setting linknames here is a bad hack.
archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
old_archive_from_new_cmds='true'
# FIXME: Should let the user specify the lib program.
old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
enable_shared_with_static_runtimes=yes
;;
esac
;;
darwin* | rhapsody*)
archive_cmds_need_lc=no
hardcode_direct=no
hardcode_automatic=yes
hardcode_shlibpath_var=unsupported
if test "$lt_cv_ld_force_load" = "yes"; then
whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
else
whole_archive_flag_spec=''
fi
link_all_deplibs=yes
allow_undefined_flag="$_lt_dar_allow_undefined"
case $cc_basename in
ifort*) _lt_dar_can_shared=yes ;;
*) _lt_dar_can_shared=$GCC ;;
esac
if test "$_lt_dar_can_shared" = "yes"; then
output_verbose_link_cmd=func_echo_all
archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
ld_shlibs=no
fi
;;
dgux*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_shlibpath_var=no
;;
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
# extra space).
freebsd2.2*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
freebsd2.*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_minus_L=yes
hardcode_shlibpath_var=no
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
hpux9*)
if test "$GCC" = yes; then
archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
export_dynamic_flag_spec='${wl}-E'
;;
hpux10*)
if test "$GCC" = yes && test "$with_gnu_ld" = no; then
archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
hardcode_direct_absolute=yes
export_dynamic_flag_spec='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$GCC" = yes && test "$with_gnu_ld" = no; then
case $host_cpu in
hppa*64*)
archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
hppa*64*)
archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
# Older versions of the 11.00 compiler do not understand -b yet
# (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
$as_echo_n "checking if $CC understands -b... " >&6; }
if ${lt_cv_prog_compiler__b+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler__b=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -b"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s conftest.err; then
# Append any errors to the config.log.
cat conftest.err 1>&5
$ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler__b=yes
fi
else
lt_cv_prog_compiler__b=yes
fi
fi
$RM -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
$as_echo "$lt_cv_prog_compiler__b" >&6; }
if test x"$lt_cv_prog_compiler__b" = xyes; then
archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
;;
esac
fi
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
hardcode_shlibpath_var=no
;;
*)
hardcode_direct=yes
hardcode_direct_absolute=yes
export_dynamic_flag_spec='${wl}-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
# This should be the same for all languages, so no per-tag cache variable.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
if ${lt_cv_irix_exported_symbol+:} false; then :
$as_echo_n "(cached) " >&6
else
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int foo (void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
lt_cv_irix_exported_symbol=yes
else
lt_cv_irix_exported_symbol=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS="$save_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
$as_echo "$lt_cv_irix_exported_symbol" >&6; }
if test "$lt_cv_irix_exported_symbol" = yes; then
archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
fi
else
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
fi
archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
inherit_rpath=yes
link_all_deplibs=yes
;;
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
fi
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
;;
newsos6)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_shlibpath_var=no
;;
*nto* | *qnx*)
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
hardcode_shlibpath_var=no
hardcode_direct_absolute=yes
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
export_dynamic_flag_spec='${wl}-E'
else
case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
else
ld_shlibs=no
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
allow_undefined_flag=unsupported
archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
;;
osf3*)
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
fi
archive_cmds_need_lc='no'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
archive_cmds_need_lc='no'
hardcode_libdir_separator=:
;;
solaris*)
no_undefined_flag=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
wlarc=''
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
;;
*)
wlarc='${wl}'
archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
$CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
;;
esac
fi
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
# The compiler driver will combine and reorder linker options,
# but understands `-z linker_flag'. GCC discards it without `$wl',
# but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
if test "$GCC" = yes; then
whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
else
whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
fi
;;
esac
link_all_deplibs=yes
;;
sunos4*)
if test "x$host_vendor" = xsequent; then
# Use $CC to link under sequent, because it throws in some extra .o
# files that make .init and .fini sections work.
archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
fi
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
hardcode_shlibpath_var=no
;;
sysv4)
case $host_vendor in
sni)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes # is this really true???
;;
siemens)
## LD is ld it makes a PLAMLIB
## CC just makes a GrossModule.
archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
reload_cmds='$CC -r -o $output$reload_objs'
hardcode_direct=no
;;
motorola)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
runpath_var='LD_RUN_PATH'
hardcode_shlibpath_var=no
;;
sysv4.3*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_shlibpath_var=no
export_dynamic_flag_spec='-Bexport'
;;
sysv4*MP*)
if test -d /usr/nec; then
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_shlibpath_var=no
runpath_var=LD_RUN_PATH
hardcode_runpath_var=yes
ld_shlibs=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag='${wl}-z,text'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
runpath_var='LD_RUN_PATH'
if test "$GCC" = yes; then
archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
sysv5* | sco3.2v5* | sco5v6*)
# Note: We can NOT use -z defs as we might desire, because we do not
# link with -lc, and that would cause any symbols used from libc to
# always be unresolved, which means just about no library would
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
no_undefined_flag='${wl}-z,text'
allow_undefined_flag='${wl}-z,nodefs'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
hardcode_libdir_flag_spec='${wl}-R,$libdir'
hardcode_libdir_separator=':'
link_all_deplibs=yes
export_dynamic_flag_spec='${wl}-Bexport'
runpath_var='LD_RUN_PATH'
if test "$GCC" = yes; then
archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
uts4*)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-L$libdir'
hardcode_shlibpath_var=no
;;
*)
ld_shlibs=no
;;
esac
if test x$host_vendor = xsni; then
case $host in
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
export_dynamic_flag_spec='${wl}-Blargedynsym'
;;
esac
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
$as_echo "$ld_shlibs" >&6; }
test "$ld_shlibs" = no && can_build_shared=no
with_gnu_ld=$with_gnu_ld
#
# Do we need to explicitly link libc?
#
case "x$archive_cmds_need_lc" in
x|xyes)
# Assume -lc should be added
archive_cmds_need_lc=yes
if test "$enable_shared" = yes && test "$GCC" = yes; then
case $archive_cmds in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
;;
'$CC '*)
# Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
if ${lt_cv_archive_cmds_need_lc+:} false; then :
$as_echo_n "(cached) " >&6
else
$RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } 2>conftest.err; then
soname=conftest
lib=conftest
libobjs=conftest.$ac_objext
deplibs=
wl=$lt_prog_compiler_wl
pic_flag=$lt_prog_compiler_pic
compiler_flags=-v
linker_flags=-v
verstring=
output_objdir=.
libname=conftest
lt_save_allow_undefined_flag=$allow_undefined_flag
allow_undefined_flag=
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
(eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then
lt_cv_archive_cmds_need_lc=no
else
lt_cv_archive_cmds_need_lc=yes
fi
allow_undefined_flag=$lt_save_allow_undefined_flag
else
cat conftest.err 1>&5
fi
$RM conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
;;
esac
fi
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
$as_echo_n "checking dynamic linker characteristics... " >&6; }
if test "$GCC" = yes; then
case $host_os in
darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
*) lt_awk_arg="/^libraries:/" ;;
esac
case $host_os in
mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
*) lt_sed_strip_eq="s,=/,/,g" ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
case $lt_search_path_spec in
*\;*)
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
;;
*)
lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
;;
esac
# Ok, now we have the path, separated by spaces, we can step through it
# and add multilib dir if necessary.
lt_tmp_lt_search_path_spec=
lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
for lt_sys_path in $lt_search_path_spec; do
if test -d "$lt_sys_path/$lt_multi_os_dir"; then
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
else
test -d "$lt_sys_path" && \
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
fi
done
lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
BEGIN {RS=" "; FS="/|\n";} {
lt_foo="";
lt_count=0;
for (lt_i = NF; lt_i > 0; lt_i--) {
if ($lt_i != "" && $lt_i != ".") {
if ($lt_i == "..") {
lt_count++;
} else {
if (lt_count == 0) {
lt_foo="/" $lt_i lt_foo;
} else {
lt_count--;
}
}
}
}
if (lt_foo != "") { lt_freq[lt_foo]++; }
if (lt_freq[lt_foo] == 1) { print lt_foo; }
}'`
# AWK program above erroneously prepends '/' to C:/dos/paths
# for these hosts.
case $host_os in
mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
$SED 's,/\([A-Za-z]:\),\1,g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi
library_names_spec=
libname_spec='lib$name'
soname_spec=
shrext_cmds=".so"
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
finish_eval=
shlibpath_var=
shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
need_lib_prefix=unknown
hardcode_into_libs=no
# when you set need_version to no, make sure it does not cause -set_version
# flags to be left without arguments
need_version=unknown
case $host_os in
aix3*)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
shlibpath_var=LIBPATH
# AIX 3 has no versioning support, so we append a major version to the name.
soname_spec='${libname}${release}${shared_ext}$major'
;;
aix[4-9]*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
if test "$host_cpu" = ia64; then
# AIX 5 supports IA64
library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
else
# With GCC up to 2.95.x, collect2 would create an import file
# for dependence libraries. The import file would start with
# the line `#! .'. This would cause the generated library to
# depend on `.', always an invalid library. This was fixed in
# development snapshots of GCC prior to 3.0.
case $host_os in
aix4 | aix4.[01] | aix4.[01].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
:
else
can_build_shared=no
fi
;;
esac
# AIX (on Power*) has no versioning support, so currently we can not hardcode correct
# soname into executable. Probably we can add versioning support to
# collect2, so additional links can be useful in future.
if test "$aix_use_runtimelinking" = yes; then
# If using run time linking (on AIX 4.2 or later) use lib<name>.so
# instead of lib<name>.a to let people know that these are not
# typical AIX shared libraries.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
else
# We preserve .a as extension for shared libraries through AIX4.2
# and later when we are not doing run time linking.
library_names_spec='${libname}${release}.a $libname.a'
soname_spec='${libname}${release}${shared_ext}$major'
fi
shlibpath_var=LIBPATH
fi
;;
amigaos*)
case $host_cpu in
powerpc)
# Since July 2007 AmigaOS4 officially supports .so libraries.
# When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
;;
m68k)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
;;
esac
;;
beos*)
library_names_spec='${libname}${shared_ext}'
dynamic_linker="$host_os ld.so"
shlibpath_var=LIBRARY_PATH
;;
bsdi[45]*)
version_type=linux # correct to gnu/linux during the next big refactor
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
# the default ld.so.conf also contains /usr/contrib/lib and
# /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
# libtool to hard-code these into programs
;;
cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
shrext_cmds=".dll"
need_version=no
need_lib_prefix=no
case $GCC,$cc_basename in
yes,*)
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname~
chmod a+x \$dldir/$dlname~
if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
fi'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
shlibpath_overrides_runpath=yes
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
;;
esac
dynamic_linker='Win32 ld.exe'
;;
*,cl*)
# Native MSVC
libname_spec='$name'
soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
library_names_spec='${libname}.dll.lib'
case $build_os in
mingw*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
for lt_path in $LIB
do
IFS=$lt_save_ifs
# Let DOS variable expansion print the short 8.3 style file name.
lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
done
IFS=$lt_save_ifs
# Convert to MSYS style.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
# but this time dos style (no spaces!) so that the unix form looks
# like /cygdrive/c/PROGRA~1:/cygdr...
sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
;;
*)
sys_lib_search_path_spec="$LIB"
if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
# It is most probably a Windows format PATH.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
else
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
# FIXME: find the short name or the path components, as spaces are
# common. (e.g. "Program Files" -> "PROGRA~1")
;;
esac
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
shlibpath_overrides_runpath=yes
dynamic_linker='Win32 link.exe'
;;
*)
# Assume MSVC wrapper
library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
esac
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
darwin* | rhapsody*)
dynamic_linker="$host_os dyld"
version_type=darwin
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
dgux*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
;;
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
objformat=`/usr/bin/objformat`
else
case $host_os in
freebsd[23].*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
need_version=no
need_lib_prefix=no
;;
freebsd-*)
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
need_version=yes
;;
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
freebsd2.*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[01]* | freebsdelf3.[01]*)
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
*) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
esac
;;
gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
haiku*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LIBRARY_PATH
shlibpath_overrides_runpath=yes
sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
hpux9* | hpux10* | hpux11*)
# Give a soname corresponding to the major version so that dld.sl refuses to
# link against other versions.
version_type=sunos
need_lib_prefix=no
need_version=no
case $host_cpu in
ia64*)
shrext_cmds='.so'
hardcode_into_libs=yes
dynamic_linker="$host_os dld.so"
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
if test "X$HPUX_IA64_MODE" = X32; then
sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
else
sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
fi
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
hppa*64*)
shrext_cmds='.sl'
hardcode_into_libs=yes
dynamic_linker="$host_os dld.sl"
shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
*)
shrext_cmds='.sl'
dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH
shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
;;
esac
# HP-UX runs *really* slowly unless shared libraries are mode 555, ...
postinstall_cmds='chmod 555 $lib'
# or fails outright, so override atomically:
install_override_mode=555
;;
interix[3-9]*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
irix5* | irix6* | nonstopux*)
case $host_os in
nonstopux*) version_type=nonstopux ;;
*)
if test "$lt_cv_prog_gnu_ld" = yes; then
version_type=linux # correct to gnu/linux during the next big refactor
else
version_type=irix
fi ;;
esac
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}${shared_ext}$major'
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
case $host_os in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in # libtool.m4 will add one of these switches to LD
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
libsuff= shlibsuff= libmagic=32-bit;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
libsuff=32 shlibsuff=N32 libmagic=N32;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
libsuff=64 shlibsuff=64 libmagic=64-bit;;
*) libsuff= shlibsuff= libmagic=never-match;;
esac
;;
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
shlibpath_overrides_runpath=no
sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
hardcode_into_libs=yes
;;
# No shared lib support for Linux oldld, aout, or coff.
linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
# This must be glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
# Some binutils ld are patched to set DT_RUNPATH
if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_shlibpath_overrides_runpath=no
save_LDFLAGS=$LDFLAGS
save_libdir=$libdir
eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
lt_cv_shlibpath_overrides_runpath=yes
fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
libdir=$save_libdir
fi
shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
# This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install
# before this can be enabled.
hardcode_into_libs=yes
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
# powerpc, because MkLinux only supported shared libraries with the
# GNU dynamic linker. Since this was broken with cross compilers,
# most powerpc-linux boxes support dynamic linking these days and
# people can always --disable-shared, the test was removed, and we
# assume the GNU/Linux dynamic linker is in use.
dynamic_linker='GNU/Linux ld.so'
;;
netbsd*)
version_type=sunos
need_lib_prefix=no
need_version=no
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
else
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
dynamic_linker='NetBSD ld.elf_so'
fi
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
;;
*nto* | *qnx*)
version_type=qnx
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
dynamic_linker='ldqnx.so'
;;
openbsd*)
version_type=sunos
sys_lib_dlsearch_path_spec="/usr/lib"
need_lib_prefix=no
# Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
case $host_os in
openbsd3.3 | openbsd3.3.*) need_version=yes ;;
*) need_version=no ;;
esac
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
case $host_os in
openbsd2.[89] | openbsd2.[89].*)
shlibpath_overrides_runpath=no
;;
*)
shlibpath_overrides_runpath=yes
;;
esac
else
shlibpath_overrides_runpath=yes
fi
;;
os2*)
libname_spec='$name'
shrext_cmds=".dll"
need_lib_prefix=no
library_names_spec='$libname${shared_ext} $libname.a'
dynamic_linker='OS/2 ld.exe'
shlibpath_var=LIBPATH
;;
osf3* | osf4* | osf5*)
version_type=osf
need_lib_prefix=no
need_version=no
soname_spec='${libname}${release}${shared_ext}$major'
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
rdos*)
dynamic_linker=no
;;
solaris*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
# ldd complains unless libraries are executable
postinstall_cmds='chmod +x $lib'
;;
sunos4*)
version_type=sunos
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
if test "$with_gnu_ld" = yes; then
need_lib_prefix=no
fi
need_version=yes
;;
sysv4 | sysv4.3*)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
case $host_vendor in
sni)
shlibpath_overrides_runpath=no
need_lib_prefix=no
runpath_var=LD_RUN_PATH
;;
siemens)
need_lib_prefix=no
;;
motorola)
need_lib_prefix=no
need_version=no
shlibpath_overrides_runpath=no
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
;;
esac
;;
sysv4*MP*)
if test -d /usr/nec ;then
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
soname_spec='$libname${shared_ext}.$major'
shlibpath_var=LD_LIBRARY_PATH
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
version_type=freebsd-elf
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
if test "$with_gnu_ld" = yes; then
sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
else
sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
case $host_os in
sco3.2v5*)
sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
;;
esac
fi
sys_lib_dlsearch_path_spec='/usr/lib'
;;
tpf*)
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
uts4*)
version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
;;
*)
dynamic_linker=no
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
$as_echo "$dynamic_linker" >&6; }
test "$dynamic_linker" = no && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
fi
if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" ||
test -n "$runpath_var" ||
test "X$hardcode_automatic" = "Xyes" ; then
# We can hardcode non-existent directories.
if test "$hardcode_direct" != no &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
test "$hardcode_minus_L" != no; then
# Linking always hardcodes the temporary library directory.
hardcode_action=relink
else
# We can link without hardcoding, and we can hardcode nonexisting dirs.
hardcode_action=immediate
fi
else
# We cannot hardcode anything, or else we can only hardcode existing
# directories.
hardcode_action=unsupported
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
$as_echo "$hardcode_action" >&6; }
if test "$hardcode_action" = relink ||
test "$inherit_rpath" = yes; then
# Fast installation is not supported
enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes ||
test "$enable_shared" = no; then
# Fast installation is not necessary
enable_fast_install=needless
fi
if test "x$enable_dlopen" != xyes; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
else
lt_cv_dlopen=no
lt_cv_dlopen_libs=
case $host_os in
beos*)
lt_cv_dlopen="load_add_on"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
;;
mingw* | pw32* | cegcc*)
lt_cv_dlopen="LoadLibrary"
lt_cv_dlopen_libs=
;;
cygwin*)
lt_cv_dlopen="dlopen"
lt_cv_dlopen_libs=
;;
darwin*)
# if libdl is installed we need to link against it
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
int
main ()
{
return dlopen ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dl_dlopen=yes
else
ac_cv_lib_dl_dlopen=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
lt_cv_dlopen="dyld"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
fi
;;
*)
ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
if test "x$ac_cv_func_shl_load" = xyes; then :
lt_cv_dlopen="shl_load"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
$as_echo_n "checking for shl_load in -ldld... " >&6; }
if ${ac_cv_lib_dld_shl_load+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char shl_load ();
int
main ()
{
return shl_load ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dld_shl_load=yes
else
ac_cv_lib_dld_shl_load=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
else
ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
if test "x$ac_cv_func_dlopen" = xyes; then :
lt_cv_dlopen="dlopen"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
int
main ()
{
return dlopen ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dl_dlopen=yes
else
ac_cv_lib_dl_dlopen=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
$as_echo_n "checking for dlopen in -lsvld... " >&6; }
if ${ac_cv_lib_svld_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
int
main ()
{
return dlopen ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_svld_dlopen=yes
else
ac_cv_lib_svld_dlopen=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
$as_echo_n "checking for dld_link in -ldld... " >&6; }
if ${ac_cv_lib_dld_dld_link+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dld_link ();
int
main ()
{
return dld_link ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dld_dld_link=yes
else
ac_cv_lib_dld_dld_link=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
fi
fi
fi
fi
fi
fi
;;
esac
if test "x$lt_cv_dlopen" != xno; then
enable_dlopen=yes
else
enable_dlopen=no
fi
case $lt_cv_dlopen in
dlopen)
save_CPPFLAGS="$CPPFLAGS"
test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
save_LDFLAGS="$LDFLAGS"
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
save_LIBS="$LIBS"
LIBS="$lt_cv_dlopen_libs $LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
$as_echo_n "checking whether a program can dlopen itself... " >&6; }
if ${lt_cv_dlopen_self+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line $LINENO "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
#include <dlfcn.h>
#endif
#include <stdio.h>
#ifdef RTLD_GLOBAL
# define LT_DLGLOBAL RTLD_GLOBAL
#else
# ifdef DL_GLOBAL
# define LT_DLGLOBAL DL_GLOBAL
# else
# define LT_DLGLOBAL 0
# endif
#endif
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
# ifdef RTLD_LAZY
# define LT_DLLAZY_OR_NOW RTLD_LAZY
# else
# ifdef DL_LAZY
# define LT_DLLAZY_OR_NOW DL_LAZY
# else
# ifdef RTLD_NOW
# define LT_DLLAZY_OR_NOW RTLD_NOW
# else
# ifdef DL_NOW
# define LT_DLLAZY_OR_NOW DL_NOW
# else
# define LT_DLLAZY_OR_NOW 0
# endif
# endif
# endif
# endif
#endif
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
#endif
int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
else
{
if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
else puts (dlerror ());
}
/* dlclose (self); */
}
else
puts (dlerror ());
return status;
}
_LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
esac
else :
# compilation failed
lt_cv_dlopen_self=no
fi
fi
rm -fr conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
$as_echo "$lt_cv_dlopen_self" >&6; }
if test "x$lt_cv_dlopen_self" = xyes; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
if ${lt_cv_dlopen_self_static+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
lt_cv_dlopen_self_static=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line $LINENO "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
#include <dlfcn.h>
#endif
#include <stdio.h>
#ifdef RTLD_GLOBAL
# define LT_DLGLOBAL RTLD_GLOBAL
#else
# ifdef DL_GLOBAL
# define LT_DLGLOBAL DL_GLOBAL
# else
# define LT_DLGLOBAL 0
# endif
#endif
/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
find out it does not work in some platform. */
#ifndef LT_DLLAZY_OR_NOW
# ifdef RTLD_LAZY
# define LT_DLLAZY_OR_NOW RTLD_LAZY
# else
# ifdef DL_LAZY
# define LT_DLLAZY_OR_NOW DL_LAZY
# else
# ifdef RTLD_NOW
# define LT_DLLAZY_OR_NOW RTLD_NOW
# else
# ifdef DL_NOW
# define LT_DLLAZY_OR_NOW DL_NOW
# else
# define LT_DLLAZY_OR_NOW 0
# endif
# endif
# endif
# endif
#endif
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
#endif
int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
int status = $lt_dlunknown;
if (self)
{
if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
else
{
if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
else puts (dlerror ());
}
/* dlclose (self); */
}
else
puts (dlerror ());
return status;
}
_LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
esac
else :
# compilation failed
lt_cv_dlopen_self_static=no
fi
fi
rm -fr conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
$as_echo "$lt_cv_dlopen_self_static" >&6; }
fi
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
;;
esac
case $lt_cv_dlopen_self in
yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
*) enable_dlopen_self=unknown ;;
esac
case $lt_cv_dlopen_self_static in
yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
*) enable_dlopen_self_static=unknown ;;
esac
fi
striplib=
old_striplib=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
$as_echo_n "checking whether stripping libraries is possible... " >&6; }
if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
test -z "$striplib" && striplib="$STRIP --strip-unneeded"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
if test -n "$STRIP" ; then
striplib="$STRIP -x"
old_striplib="$STRIP -S"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
;;
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
;;
esac
fi
# Report which library types will actually be built
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
$as_echo_n "checking if libtool supports shared libraries... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
$as_echo "$can_build_shared" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
$as_echo_n "checking whether to build shared libraries... " >&6; }
test "$can_build_shared" = "no" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
test "$enable_shared" = yes && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
fi
;;
aix[4-9]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
$as_echo "$enable_shared" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
$as_echo_n "checking whether to build static libraries... " >&6; }
# Make sure either enable_shared or enable_static is yes.
test "$enable_shared" = yes || enable_static=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
$as_echo "$enable_static" >&6; }
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
CC="$lt_save_CC"
ac_config_commands="$ac_config_commands libtool"
# Only expand once:
fail=0
ac_fn_c_check_header_mongrel "$LINENO" "ext2fs/ext2fs.h" "ac_cv_header_ext2fs_ext2fs_h" "$ac_includes_default"
if test "x$ac_cv_header_ext2fs_ext2fs_h" = xyes; then :
else
fail=1
fi
ac_fn_c_check_header_mongrel "$LINENO" "blkid/blkid.h" "ac_cv_header_blkid_blkid_h" "$ac_includes_default"
if test "x$ac_cv_header_blkid_blkid_h" = xyes; then :
else
fail=1
fi
ac_fn_c_check_header_mongrel "$LINENO" "e2p/e2p.h" "ac_cv_header_e2p_e2p_h" "$ac_includes_default"
if test "x$ac_cv_header_e2p_e2p_h" = xyes; then :
else
fail=1
fi
ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
else
fail=1
fi
test $fail = 1 &&
as_fn_error $? "You must install the develop packages \"ext2fs , blkid , e2p , uuid\" to build ext4magic" "$LINENO" 5
fail=0
ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
if test "x$ac_cv_header_zlib_h" = xyes; then :
else
fail=1
fi
ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default"
if test "x$ac_cv_header_bzlib_h" = xyes; then :
else
fail=1
fi
test $fail = 1 &&
as_fn_error $? "You must install the packages \"zlib-devel and libbz2-devel\" to build this version" "$LINENO" 5
fail=0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ext2fs_test_inode_bitmap_range" >&5
$as_echo_n "checking for library containing ext2fs_test_inode_bitmap_range... " >&6; }
if ${ac_cv_search_ext2fs_test_inode_bitmap_range+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ext2fs_test_inode_bitmap_range ();
int
main ()
{
return ext2fs_test_inode_bitmap_range ();
;
return 0;
}
_ACEOF
for ac_lib in '' ext2fs; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_ext2fs_test_inode_bitmap_range=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_ext2fs_test_inode_bitmap_range+:} false; then :
break
fi
done
if ${ac_cv_search_ext2fs_test_inode_bitmap_range+:} false; then :
else
ac_cv_search_ext2fs_test_inode_bitmap_range=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ext2fs_test_inode_bitmap_range" >&5
$as_echo "$ac_cv_search_ext2fs_test_inode_bitmap_range" >&6; }
ac_res=$ac_cv_search_ext2fs_test_inode_bitmap_range
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
else
fail=1
fi
test $fail = 1 &&
as_fn_error $? "You must have ext2fs version >= 1.41.9 to build ext4magic" "$LINENO" 5
fail=0
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing magic_getpath" >&5
$as_echo_n "checking for library containing magic_getpath... " >&6; }
if ${ac_cv_search_magic_getpath+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char magic_getpath ();
int
main ()
{
return magic_getpath ();
;
return 0;
}
_ACEOF
for ac_lib in '' magic; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_magic_getpath=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_magic_getpath+:} false; then :
break
fi
done
if ${ac_cv_search_magic_getpath+:} false; then :
else
ac_cv_search_magic_getpath=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_magic_getpath" >&5
$as_echo "$ac_cv_search_magic_getpath" >&6; }
ac_res=$ac_cv_search_magic_getpath
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
else
fail=1
fi
test $fail = 1 &&
as_fn_error $? "library libmagic.so >= 5.04 not found, install package \"file-5.04\" and \"file-devel\" (workaround see INSTALL)" "$LINENO" 5
# Check whether --enable-debug was given.
if test "${enable_debug+set}" = set; then :
enableval=$enable_debug; if test x$enableval == xyes && test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DDEBUG"; fi
fi
# Check whether --enable-debug-magic was given.
if test "${enable_debug_magic+set}" = set; then :
enableval=$enable_debug_magic; if test x$enableval == xyes && test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DDEBUG_MAGIC_SCAN"; fi
fi
# Check whether --enable-file-attr was given.
if test "${enable_file_attr+set}" = set; then :
enableval=$enable_file_attr; if test x$enableval == xyes && test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DFILE_ATTR"; fi
fi
# Check whether --enable-expert-mode was given.
if test "${enable_expert_mode+set}" = set; then :
enableval=$enable_expert_mode; if test x$enableval == xyes && test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DEXPERT_MODE"; fi
fi
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_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; 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
if test "x$cache_file" != "x/dev/null"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
case $cache_file in #(
*/* | ?:*)
mv -f confcache "$cache_file"$$ &&
mv -f "$cache_file"$$ "$cache_file" ;; #(
*)
mv -f confcache "$cache_file" ;;
esac
fi
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
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=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`$as_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.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
$as_echo_n "checking that generated files are newer than configure... " >&6; }
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
$as_echo "done" >&6; }
if test -n "$EXEEXT"; then
am__EXEEXT_TRUE=
am__EXEEXT_FALSE='#'
else
am__EXEEXT_TRUE='#'
am__EXEEXT_FALSE=
fi
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
as_fn_error $? "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $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}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## 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=:
# Pre-4.2 versions of Zsh do 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_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
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.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
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
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
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
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# 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
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
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 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
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 -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_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 ||
$as_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" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# 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
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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 $as_me, which was
generated by GNU Autoconf 2.69. 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
case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac
case $ac_config_headers in *"
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
esac
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# 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_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
--config print configuration, then exit
-q, --quiet, --silent
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 the package provider."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
config.status
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
MKDIR_P='$MKDIR_P'
AWK='$AWK'
test -n "\$AWK" || AWK=awk
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
--*=)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
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 )
$as_echo "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
$as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append CONFIG_HEADERS " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
--help | --hel | -h )
$as_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.
-*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append 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 || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
fi
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
$as_echo "$ac_log"
} >&5
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
sed_quote_subst='$sed_quote_subst'
double_quote_subst='$double_quote_subst'
delay_variable_subst='$delay_variable_subst'
macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
LTCC='$LTCC'
LTCFLAGS='$LTCFLAGS'
compiler='$compiler_DEFAULT'
# A function that is used when there is no print builtin or printf.
func_fallback_echo ()
{
eval 'cat <<_LTECHO_EOF
\$1
_LTECHO_EOF'
}
# Quote evaled strings.
for var in SHELL \
ECHO \
PATH_SEPARATOR \
SED \
GREP \
EGREP \
FGREP \
LD \
NM \
LN_S \
lt_SP2NL \
lt_NL2SP \
reload_flag \
OBJDUMP \
deplibs_check_method \
file_magic_cmd \
file_magic_glob \
want_nocaseglob \
DLLTOOL \
sharedlib_from_linklib_cmd \
AR \
AR_FLAGS \
archiver_list_spec \
STRIP \
RANLIB \
CC \
CFLAGS \
compiler \
lt_cv_sys_global_symbol_pipe \
lt_cv_sys_global_symbol_to_cdecl \
lt_cv_sys_global_symbol_to_c_name_address \
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
nm_file_list_spec \
lt_prog_compiler_no_builtin_flag \
lt_prog_compiler_pic \
lt_prog_compiler_wl \
lt_prog_compiler_static \
lt_cv_prog_compiler_c_o \
need_locks \
MANIFEST_TOOL \
DSYMUTIL \
NMEDIT \
LIPO \
OTOOL \
OTOOL64 \
shrext_cmds \
export_dynamic_flag_spec \
whole_archive_flag_spec \
compiler_needs_object \
with_gnu_ld \
allow_undefined_flag \
no_undefined_flag \
hardcode_libdir_flag_spec \
hardcode_libdir_separator \
exclude_expsyms \
include_expsyms \
file_list_spec \
variables_saved_for_relink \
libname_spec \
library_names_spec \
soname_spec \
install_override_mode \
finish_eval \
old_striplib \
striplib; do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[\\\\\\\`\\"\\\$]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
;;
esac
done
# Double-quote double-evaled strings.
for var in reload_cmds \
old_postinstall_cmds \
old_postuninstall_cmds \
old_archive_cmds \
extract_expsyms_cmds \
old_archive_from_new_cmds \
old_archive_from_expsyms_cmds \
archive_cmds \
archive_expsym_cmds \
module_cmds \
module_expsym_cmds \
export_symbols_cmds \
prelink_cmds \
postlink_cmds \
postinstall_cmds \
postuninstall_cmds \
finish_cmds \
sys_lib_search_path_spec \
sys_lib_dlsearch_path_spec; do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[\\\\\\\`\\"\\\$]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
;;
esac
done
ac_aux_dir='$ac_aux_dir'
xsi_shell='$xsi_shell'
lt_shell_append='$lt_shell_append'
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes INIT.
if test -n "\${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
PACKAGE='$PACKAGE'
VERSION='$VERSION'
TIMESTAMP='$TIMESTAMP'
RM='$RM'
ofile='$ofile'
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# 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" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
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= ac_tmp=
trap 'exit_status=$?
: "${ac_tmp:=$tmp}"
{ test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' <conf$$subs.awk | sed '
/^[^""]/{
N
s/\n//
}
' >>$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
h
s///
s/^/:/
s/[ ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[ ]*\).*/\1/
G
s/\n//
s/^[^=]*=[ ]*$//
}'
fi
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with `./config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF
# Transform confdefs.h into an awk script `defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.
# Create a delimiter string that does not exist in confdefs.h, to ease
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
if test -z "$ac_tt"; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
# For the awk script, D is an array of macro values keyed by name,
# likewise P contains macro parameters if any. Preserve backslash
# newline sequences.
ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
sed -n '
s/.\{148\}/&'"$ac_delim"'/g
t rset
:rset
s/^[ ]*#[ ]*define[ ][ ]*/ /
t def
d
:def
s/\\$//
t bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3"/p
s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
d
:bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3\\\\\\n"\\/p
t cont
s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
t cont
d
:cont
n
s/.\{148\}/&'"$ac_delim"'/g
t clear
:clear
s/\\$//
t bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/"/p
d
:bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
b cont
' <confdefs.h | sed '
s/'"$ac_delim"'/"\\\
"/g' >>$CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
for (key in D) D_is_set[key] = 1
FS = ""
}
/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
line = \$ 0
split(line, arg, " ")
if (arg[1] == "#") {
defundef = arg[2]
mac1 = arg[3]
} else {
defundef = substr(arg[1], 2)
mac1 = arg[2]
}
split(mac1, mac2, "(") #)
macro = mac2[1]
prefix = substr(line, 1, index(line, defundef) - 1)
if (D_is_set[macro]) {
# Preserve the white space surrounding the "#".
print prefix "define", macro P[macro] D[macro]
next
} else {
# 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.
if (defundef == "undef") {
print "/*", prefix defundef, macro, "*/"
next
}
}
}
{ print }
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"
eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
shift
for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[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="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
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 '`
$as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
$as_echo "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
ac_sed_conf_input=`$as_echo "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
case $ac_tag in
*:-:* | *:-) cat >"$ac_tmp/stdin" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
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 ||
$as_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"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_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 || ac_write_fail=1
# 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=
ac_sed_dataroot='
/datarootdir/ {
p
q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
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 || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;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
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
case $ac_file in
-) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
*) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
:H)
#
# CONFIG_HEADER
#
if test x"$ac_file" != x-; then
{
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
} >"$ac_tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$ac_tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
# 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 ||
$as_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) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
$as_echo "$as_me: executing $ac_file commands" >&6;}
;;
esac
case $ac_file$ac_mode in
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
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 ||
$as_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"`
# 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'`; 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 ||
$as_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; as_fn_mkdir_p
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
;;
"libtool":C)
# See if we are running on zsh, and set the options which allow our
# commands through without removal of \ escapes.
if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
fi
cfgfile="${ofile}T"
trap "$RM \"$cfgfile\"; exit 1" 1 2 15
$RM "$cfgfile"
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
#
# GNU Libtool 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.
#
# As a special exception to the GNU General Public License,
# if you distribute this file as part of a program or library that
# is built using GNU Libtool, you may include this file under the
# same distribution terms that you use for the rest of that program.
#
# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
# obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# The names of the tagged configurations supported by this script.
available_tags=""
# ### BEGIN LIBTOOL CONFIG
# Which release of libtool.m4 was used?
macro_version=$macro_version
macro_revision=$macro_revision
# Whether or not to build shared libraries.
build_libtool_libs=$enable_shared
# Whether or not to build static libraries.
build_old_libs=$enable_static
# What type of objects to build.
pic_mode=$pic_mode
# Whether or not to optimize for fast installation.
fast_install=$enable_fast_install
# Shell to use when invoking shell scripts.
SHELL=$lt_SHELL
# An echo program that protects backslashes.
ECHO=$lt_ECHO
# The PATH separator for the build system.
PATH_SEPARATOR=$lt_PATH_SEPARATOR
# The host system.
host_alias=$host_alias
host=$host
host_os=$host_os
# The build system.
build_alias=$build_alias
build=$build
build_os=$build_os
# A sed program that does not truncate output.
SED=$lt_SED
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
Xsed="\$SED -e 1s/^X//"
# A grep program that handles long lines.
GREP=$lt_GREP
# An ERE matcher.
EGREP=$lt_EGREP
# A literal string matcher.
FGREP=$lt_FGREP
# A BSD- or MS-compatible name lister.
NM=$lt_NM
# Whether we need soft or hard links.
LN_S=$lt_LN_S
# What is the maximum length of a command?
max_cmd_len=$max_cmd_len
# Object file suffix (normally "o").
objext=$ac_objext
# Executable file suffix (normally "").
exeext=$exeext
# whether the shell understands "unset".
lt_unset=$lt_unset
# turn spaces into newlines.
SP2NL=$lt_lt_SP2NL
# turn newlines into spaces.
NL2SP=$lt_lt_NL2SP
# convert \$build file names to \$host format.
to_host_file_cmd=$lt_cv_to_host_file_cmd
# convert \$build files to toolchain format.
to_tool_file_cmd=$lt_cv_to_tool_file_cmd
# An object symbol dumper.
OBJDUMP=$lt_OBJDUMP
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
# Command to use when deplibs_check_method = "file_magic".
file_magic_cmd=$lt_file_magic_cmd
# How to find potential files when deplibs_check_method = "file_magic".
file_magic_glob=$lt_file_magic_glob
# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
want_nocaseglob=$lt_want_nocaseglob
# DLL creation program.
DLLTOOL=$lt_DLLTOOL
# Command to associate shared and link libraries.
sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
# The archiver.
AR=$lt_AR
# Flags to create an archive.
AR_FLAGS=$lt_AR_FLAGS
# How to feed a file listing to the archiver.
archiver_list_spec=$lt_archiver_list_spec
# A symbol stripping program.
STRIP=$lt_STRIP
# Commands used to install an old-style archive.
RANLIB=$lt_RANLIB
old_postinstall_cmds=$lt_old_postinstall_cmds
old_postuninstall_cmds=$lt_old_postuninstall_cmds
# Whether to use a lock for old archive extraction.
lock_old_archive_extraction=$lock_old_archive_extraction
# A C compiler.
LTCC=$lt_CC
# LTCC compiler flags.
LTCFLAGS=$lt_CFLAGS
# Take the output of nm and produce a listing of raw symbols and C names.
global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
# Transform the output of nm in a proper C declaration.
global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
# Transform the output of nm in a C name address pair.
global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
# Transform the output of nm in a C name address pair when lib prefix is needed.
global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
# Specify filename containing input files for \$NM.
nm_file_list_spec=$lt_nm_file_list_spec
# The root where to search for dependent libraries,and in which our libraries should be installed.
lt_sysroot=$lt_sysroot
# The name of the directory that contains temporary libtool files.
objdir=$objdir
# Used to examine libraries when file_magic_cmd begins with "file".
MAGIC_CMD=$MAGIC_CMD
# Must we lock files when doing compilation?
need_locks=$lt_need_locks
# Manifest tool.
MANIFEST_TOOL=$lt_MANIFEST_TOOL
# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
DSYMUTIL=$lt_DSYMUTIL
# Tool to change global to local symbols on Mac OS X.
NMEDIT=$lt_NMEDIT
# Tool to manipulate fat objects and archives on Mac OS X.
LIPO=$lt_LIPO
# ldd/readelf like tool for Mach-O binaries on Mac OS X.
OTOOL=$lt_OTOOL
# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
OTOOL64=$lt_OTOOL64
# Old archive suffix (normally "a").
libext=$libext
# Shared library suffix (normally ".so").
shrext_cmds=$lt_shrext_cmds
# The commands to extract the exported symbol list from a shared archive.
extract_expsyms_cmds=$lt_extract_expsyms_cmds
# Variables whose values should be saved in libtool wrapper scripts and
# restored at link time.
variables_saved_for_relink=$lt_variables_saved_for_relink
# Do we need the "lib" prefix for modules?
need_lib_prefix=$need_lib_prefix
# Do we need a version for libraries?
need_version=$need_version
# Library versioning type.
version_type=$version_type
# Shared library runtime path variable.
runpath_var=$runpath_var
# Shared library path variable.
shlibpath_var=$shlibpath_var
# Is shlibpath searched before the hard-coded library search path?
shlibpath_overrides_runpath=$shlibpath_overrides_runpath
# Format of library name prefix.
libname_spec=$lt_libname_spec
# List of archive names. First name is the real one, the rest are links.
# The last name is the one that the linker finds with -lNAME
library_names_spec=$lt_library_names_spec
# The coded name of the library, if different from the real name.
soname_spec=$lt_soname_spec
# Permission mode override for installation of shared libraries.
install_override_mode=$lt_install_override_mode
# Command to use after installation of a shared archive.
postinstall_cmds=$lt_postinstall_cmds
# Command to use after uninstallation of a shared archive.
postuninstall_cmds=$lt_postuninstall_cmds
# Commands used to finish a libtool library installation in a directory.
finish_cmds=$lt_finish_cmds
# As "finish_cmds", except a single script fragment to be evaled but
# not shown.
finish_eval=$lt_finish_eval
# Whether we should hardcode library paths into libraries.
hardcode_into_libs=$hardcode_into_libs
# Compile-time system search path for libraries.
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
# Run-time system search path for libraries.
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Whether dlopen is supported.
dlopen_support=$enable_dlopen
# Whether dlopen of programs is supported.
dlopen_self=$enable_dlopen_self
# Whether dlopen of statically linked programs is supported.
dlopen_self_static=$enable_dlopen_self_static
# Commands to strip libraries.
old_striplib=$lt_old_striplib
striplib=$lt_striplib
# The linker used to build libraries.
LD=$lt_LD
# How to create reloadable object files.
reload_flag=$lt_reload_flag
reload_cmds=$lt_reload_cmds
# Commands used to build an old-style archive.
old_archive_cmds=$lt_old_archive_cmds
# A language specific compiler.
CC=$lt_compiler
# Is the compiler the GNU compiler?
with_gcc=$GCC
# Compiler flag to turn off builtin functions.
no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
# Additional compiler flags for building library objects.
pic_flag=$lt_lt_prog_compiler_pic
# How to pass a linker flag through the compiler.
wl=$lt_lt_prog_compiler_wl
# Compiler flag to prevent dynamic linking.
link_static_flag=$lt_lt_prog_compiler_static
# Does compiler simultaneously support -c and -o options?
compiler_c_o=$lt_lt_cv_prog_compiler_c_o
# Whether or not to add -lc for building shared libraries.
build_libtool_need_lc=$archive_cmds_need_lc
# Whether or not to disallow shared libs when runtime libs are static.
allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
# Compiler flag to allow reflexive dlopens.
export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
# Compiler flag to generate shared objects directly from archives.
whole_archive_flag_spec=$lt_whole_archive_flag_spec
# Whether the compiler copes with passing no objects directly.
compiler_needs_object=$lt_compiler_needs_object
# Create an old-style archive from a shared archive.
old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
# Create a temporary old-style archive to link instead of a shared archive.
old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
# Commands used to build a shared archive.
archive_cmds=$lt_archive_cmds
archive_expsym_cmds=$lt_archive_expsym_cmds
# Commands used to build a loadable module if different from building
# a shared archive.
module_cmds=$lt_module_cmds
module_expsym_cmds=$lt_module_expsym_cmds
# Whether we are building with GNU ld or not.
with_gnu_ld=$lt_with_gnu_ld
# Flag that allows shared libraries with undefined symbols to be built.
allow_undefined_flag=$lt_allow_undefined_flag
# Flag that enforces no undefined symbols.
no_undefined_flag=$lt_no_undefined_flag
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
# Whether we need a single "-rpath" flag with a separated argument.
hardcode_libdir_separator=$lt_hardcode_libdir_separator
# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
# DIR into the resulting binary.
hardcode_direct=$hardcode_direct
# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
# DIR into the resulting binary and the resulting library dependency is
# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
# library is relocated.
hardcode_direct_absolute=$hardcode_direct_absolute
# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
# into the resulting binary.
hardcode_minus_L=$hardcode_minus_L
# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
# into the resulting binary.
hardcode_shlibpath_var=$hardcode_shlibpath_var
# Set to "yes" if building a shared library automatically hardcodes DIR
# into the library and all subsequent libraries and executables linked
# against it.
hardcode_automatic=$hardcode_automatic
# Set to yes if linker adds runtime paths of dependent libraries
# to runtime path list.
inherit_rpath=$inherit_rpath
# Whether libtool must link a program against all its dependency libraries.
link_all_deplibs=$link_all_deplibs
# Set to "yes" if exported symbols are required.
always_export_symbols=$always_export_symbols
# The commands to list exported symbols.
export_symbols_cmds=$lt_export_symbols_cmds
# Symbols that should not be listed in the preloaded symbols.
exclude_expsyms=$lt_exclude_expsyms
# Symbols that must always be exported.
include_expsyms=$lt_include_expsyms
# Commands necessary for linking programs (against libraries) with templates.
prelink_cmds=$lt_prelink_cmds
# Commands necessary for finishing linking programs.
postlink_cmds=$lt_postlink_cmds
# Specify filename containing input files.
file_list_spec=$lt_file_list_spec
# How to hardcode a shared library path into an executable.
hardcode_action=$hardcode_action
# ### END LIBTOOL CONFIG
_LT_EOF
case $host_os in
aix3*)
cat <<\_LT_EOF >> "$cfgfile"
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
if test "X${COLLECT_NAMES+set}" != Xset; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
_LT_EOF
;;
esac
ltmain="$ac_aux_dir/ltmain.sh"
# We use sed instead of cat because bash on DJGPP gets confused if
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
sed '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
if test x"$xsi_shell" = xyes; then
sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
func_dirname ()\
{\
\ case ${1} in\
\ */*) func_dirname_result="${1%/*}${2}" ;;\
\ * ) func_dirname_result="${3}" ;;\
\ esac\
} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
sed -e '/^func_basename ()$/,/^} # func_basename /c\
func_basename ()\
{\
\ func_basename_result="${1##*/}"\
} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
func_dirname_and_basename ()\
{\
\ case ${1} in\
\ */*) func_dirname_result="${1%/*}${2}" ;;\
\ * ) func_dirname_result="${3}" ;;\
\ esac\
\ func_basename_result="${1##*/}"\
} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
func_stripname ()\
{\
\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
\ # positional parameters, so assign one to ordinary parameter first.\
\ func_stripname_result=${3}\
\ func_stripname_result=${func_stripname_result#"${1}"}\
\ func_stripname_result=${func_stripname_result%"${2}"}\
} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
func_split_long_opt ()\
{\
\ func_split_long_opt_name=${1%%=*}\
\ func_split_long_opt_arg=${1#*=}\
} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
func_split_short_opt ()\
{\
\ func_split_short_opt_arg=${1#??}\
\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
func_lo2o ()\
{\
\ case ${1} in\
\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
\ *) func_lo2o_result=${1} ;;\
\ esac\
} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
sed -e '/^func_xform ()$/,/^} # func_xform /c\
func_xform ()\
{\
func_xform_result=${1%.*}.lo\
} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
sed -e '/^func_arith ()$/,/^} # func_arith /c\
func_arith ()\
{\
func_arith_result=$(( $* ))\
} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
sed -e '/^func_len ()$/,/^} # func_len /c\
func_len ()\
{\
func_len_result=${#1}\
} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
fi
if test x"$lt_shell_append" = xyes; then
sed -e '/^func_append ()$/,/^} # func_append /c\
func_append ()\
{\
eval "${1}+=\\${2}"\
} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
func_append_quoted ()\
{\
\ func_quote_for_eval "${2}"\
\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
# Save a `func_append' function call where possible by direct use of '+='
sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
else
# Save a `func_append' function call even when '+=' is not available
sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
&& mv -f "$cfgfile.tmp" "$cfgfile" \
|| (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
test 0 -eq $? || _lt_function_replace_fail=:
fi
if test x"$_lt_function_replace_fail" = x":"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
fi
mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
;;
esac
done # for ac_tag
as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# 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 || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
|
orochi/ext4magic
|
configure
|
none
|
mit
| 416,669 |
AC_INIT(configure.ac)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(ext4magic, 0.3.2)
AC_LANG_C
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_LIBTOOL
fail=0
AC_CHECK_HEADER([ext2fs/ext2fs.h],[],[fail=1])
AC_CHECK_HEADER([blkid/blkid.h],[],[fail=1])
AC_CHECK_HEADER([e2p/e2p.h],[],[fail=1])
AC_CHECK_HEADER([uuid/uuid.h],[],[fail=1])
test $fail = 1 &&
AC_MSG_ERROR([You must install the develop packages "ext2fs , blkid , e2p , uuid" to build ext4magic])
fail=0
AC_CHECK_HEADER([zlib.h],[],[fail=1])
AC_CHECK_HEADER([bzlib.h],[],[fail=1])
test $fail = 1 &&
AC_MSG_ERROR([You must install the packages "zlib-devel and libbz2-devel" to build this version])
fail=0
AC_SEARCH_LIBS([ext2fs_test_inode_bitmap_range], [ext2fs], [], [fail=1])
test $fail = 1 &&
AC_MSG_ERROR([You must have ext2fs version >= 1.41.9 to build ext4magic])
fail=0
AC_SEARCH_LIBS([magic_getpath], [magic], [], [fail=1])
test $fail = 1 &&
AC_MSG_ERROR([library libmagic.so >= 5.04 not found, install package "file-5.04" and "file-devel" (workaround see INSTALL)])
AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging ],
[if test x$enableval == xyes && test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DDEBUG"; fi])
AC_ARG_ENABLE(debug-magic,[ --enable-debug-magic Turn on debugging magic-scan-engine ],
[if test x$enableval == xyes && test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DDEBUG_MAGIC_SCAN"; fi])
AC_ARG_ENABLE(file-attr,[ --enable-file-attr enable restore of file attribute ],
[if test x$enableval == xyes && test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DFILE_ATTR"; fi])
AC_ARG_ENABLE(expert-mode,[ --enable-expert-mode enable advanced options for expert mode ],
[if test x$enableval == xyes && test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -DEXPERT_MODE"; fi])
AC_OUTPUT(Makefile src/Makefile)
|
orochi/ext4magic
|
configure.ac
|
ac
|
mit
| 1,834 |
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
# Copyright 1999, 2000 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, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
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'.
depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. This file always lives in the current directory.
# Also, the AIX compiler puts `$object:' at the start of each line;
# $object doesn't have directory information.
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
outname="$stripped.o"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Must come before tru64.
# Intel's C compiler understands `-MD -MF file'. However
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 AIX compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
tmpdepfile1="$object.d"
tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'`
if test "$libtool" = yes; then
"$@" -Wc,-MD
else
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
if test -f "$tmpdepfile1"; then
tmpdepfile="$tmpdepfile1"
else
tmpdepfile="$tmpdepfile2"
fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a space and a tab in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
test -z "$dashmflag" && dashmflag=-M
( IFS=" "
case " $* " in
*" --mode=compile "*) # this is libtool, let us make it quiet
for arg
do # cycle over the arguments
case "$arg" in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
# X makedepend
(
shift
cleared=no
for arg in "$@"; do
case $cleared in no)
set ""; shift
cleared=yes
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift;;
-*)
;;
*)
set fnord "$@" "$arg"; shift;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tail +3 "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
( IFS=" "
case " $* " in
*" --mode=compile "*)
for arg
do # cycle over the arguments
case $arg in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
( IFS=" "
case " $* " in
*" --mode=compile "*)
for arg
do # cycle over the arguments
case $arg in
"--mode=compile")
# insert --quiet before "--mode=compile"
set fnord "$@" --quiet
shift # fnord
;;
esac
set fnord "$@" "$arg"
shift # fnord
shift # "$arg"
done
;;
esac
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
) &
proc=$!
"$@"
stat=$?
wait "$proc"
if test "$stat" != 0; then exit $stat; fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
|
orochi/ext4magic
|
depcomp
|
none
|
mit
| 12,854 |
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# 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. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd=$cpprog
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "$0: no input file specified" >&2
exit 1
else
:
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d "$dst" ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "$0: $src does not exist" >&2
exit 1
fi
if [ x"$dst" = x ]
then
echo "$0: no destination specified" >&2
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d "$dst" ]
then
dst=$dst/`basename "$src"`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp=$pathcomp$1
shift
if [ ! -d "$pathcomp" ] ;
then
$mkdirprog "$pathcomp"
else
:
fi
pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd "$dst" &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename "$dst"`
else
dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename "$dst"`
else
:
fi
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/#inst.$$#
rmtmp=$dstdir/#rm.$$#
# Trap to clean up temp files at exit.
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
# Move or copy the file name to the temp name
$doit $instcmd "$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 $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
# 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.
{
if [ -f "$dstdir/$dstfile" ]
then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
{
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit
}
|
orochi/ext4magic
|
install-sh
|
none
|
mit
| 6,315 |
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun configure.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
# Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 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 <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if [ -z $echo ]; then echo="echo"; fi
# Check that we have a working $echo.
if test "X$1" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test "X$1" = X--fallback-echo; then
# Avoid inline document here, it may be left over
:
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
# Yippee, $echo works!
:
else
# Restart under the correct shell, and then maybe $echo will work.
exec $SHELL "$0" --no-reexec ${1+"$@"}
fi
if test "X$1" = X--fallback-echo; then
# used as fallback echo
shift
cat <<EOF
$*
EOF
exit 0
fi
# The name of this program.
progname=`$echo "$0" | ${SED} 's%^.*/%%'`
modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
VERSION=1.5a
TIMESTAMP=" (1.1240 2003/06/26 06:55:19)"
default_mode=
help="Try \`$progname --help' for more information."
magic="%%%MAGIC variable%%%"
mkdir="mkdir"
mv="mv -f"
rm="rm -f"
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
# test EBCDIC or ASCII
case `echo A|tr A '\301'` in
A) # EBCDIC based system
SP2NL="tr '\100' '\n'"
NL2SP="tr '\r\n' '\100\100'"
;;
*) # Assume ASCII based system
SP2NL="tr '\040' '\012'"
NL2SP="tr '\015\012' '\040\040'"
;;
esac
# NLS nuisances.
# Only set LANG and LC_ALL to C if already set.
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode.
if test "${LC_ALL+set}" = set; then
save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
fi
if test "${LANG+set}" = set; then
save_LANG="$LANG"; LANG=C; export LANG
fi
# Make sure IFS has a sensible default
: ${IFS=" "}
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
$echo "$modename: not configured to build any kind of library" 1>&2
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1
fi
# Global variables.
mode=$default_mode
nonopt=
prev=
prevopt=
run=
show="$echo"
show_help=
execute_dlfiles=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
#####################################
# Shell function definitions:
# This seems to be the best place for them
# Need a lot of goo to handle *both* DLLs and import libs
# Has to be a shell function in order to 'eat' the argument
# that is supplied when $file_magic_command is called.
win32_libid () {
win32_libid_type="unknown"
win32_fileres=`file -L $1 2>/dev/null`
case $win32_fileres in
*ar\ archive\ import\ library*) # definitely import
win32_libid_type="x86 archive import"
;;
*ar\ archive*) # could be an import, or static
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
win32_nmres=`eval $NM -f posix -A $1 | \
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
if test "X$win32_nmres" = "Ximport" ; then
win32_libid_type="x86 archive import"
else
win32_libid_type="x86 archive static"
fi
fi
;;
*DLL*)
win32_libid_type="x86 DLL"
;;
*executable*) # but shell scripts are "executable" too...
case $win32_fileres in
*MS\ Windows\ PE\ Intel*)
win32_libid_type="x86 DLL"
;;
esac
;;
esac
$echo $win32_libid_type
}
# End of Shell function definitions
#####################################
# Parse our command line options once, thoroughly.
while test "$#" -gt 0
do
arg="$1"
shift
case $arg in
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case $prev in
execute_dlfiles)
execute_dlfiles="$execute_dlfiles $arg"
;;
tag)
tagname="$arg"
# Check whether tagname contains only valid characters
case $tagname in
*[!-_A-Za-z0-9,/]*)
$echo "$progname: invalid tag name: $tagname" 1>&2
exit 1
;;
esac
case $tagname in
CC)
# Don't test for the "default" C tag, as we know, it's there, but
# not specially marked.
;;
*)
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
taglist="$taglist $tagname"
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
else
$echo "$progname: ignoring unknown tag $tagname" 1>&2
fi
;;
esac
;;
*)
eval "$prev=\$arg"
;;
esac
prev=
prevopt=
continue
fi
# Have we seen a non-optional argument yet?
case $arg in
--help)
show_help=yes
;;
--version)
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
$echo
$echo "Copyright (C) 2003 Free Software Foundation, Inc."
$echo "This is free software; see the source for copying conditions. There is NO"
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
exit 0
;;
--config)
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
# Now print the configurations for the tags.
for tagname in $taglist; do
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
done
exit 0
;;
--debug)
$echo "$progname: enabling shell trace mode"
set -x
;;
--dry-run | -n)
run=:
;;
--features)
$echo "host: $host"
if test "$build_libtool_libs" = yes; then
$echo "enable shared libraries"
else
$echo "disable shared libraries"
fi
if test "$build_old_libs" = yes; then
$echo "enable static libraries"
else
$echo "disable static libraries"
fi
exit 0
;;
--finish) mode="finish" ;;
--mode) prevopt="--mode" prev=mode ;;
--mode=*) mode="$optarg" ;;
--preserve-dup-deps) duplicate_deps="yes" ;;
--quiet | --silent)
show=:
;;
--tag) prevopt="--tag" prev=tag ;;
--tag=*)
set tag "$optarg" ${1+"$@"}
shift
prev=tag
;;
-dlopen)
prevopt="-dlopen"
prev=execute_dlfiles
;;
-*)
$echo "$modename: unrecognized option \`$arg'" 1>&2
$echo "$help" 1>&2
exit 1
;;
*)
nonopt="$arg"
break
;;
esac
done
if test -n "$prevopt"; then
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
$echo "$help" 1>&2
exit 1
fi
# If this variable is set in any of the actions, the command in it
# will be execed at the end. This prevents here-documents from being
# left over by shells.
exec_cmd=
if test -z "$show_help"; then
# Infer the operation mode.
if test -z "$mode"; then
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
$echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
case $nonopt in
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
mode=link
for arg
do
case $arg in
-c)
mode=compile
break
;;
esac
done
;;
*db | *dbx | *strace | *truss)
mode=execute
;;
*install*|cp|mv)
mode=install
;;
*rm)
mode=uninstall
;;
*)
# If we have no mode, but dlfiles were specified, then do execute mode.
test -n "$execute_dlfiles" && mode=execute
# Just use the default operation mode.
if test -z "$mode"; then
if test -n "$nonopt"; then
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
else
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
fi
fi
;;
esac
fi
# Only execute mode is allowed to have -dlopen flags.
if test -n "$execute_dlfiles" && test "$mode" != execute; then
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Change the help message to a mode-specific one.
generic_help="$help"
help="Try \`$modename --help --mode=$mode' for more information."
# These modes are in order of execution frequency so that they run quickly.
case $mode in
# libtool compile mode
compile)
modename="$modename: compile"
# Get the compilation command and the source file.
base_compile=
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
suppress_output=
arg_mode=normal
libobj=
for arg
do
case "$arg_mode" in
arg )
# do not "continue". Instead, add this to base_compile
lastarg="$arg"
arg_mode=normal
;;
target )
libobj="$arg"
arg_mode=normal
continue
;;
normal )
# Accept any command-line options.
case $arg in
-o)
if test -n "$libobj" ; then
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
exit 1
fi
arg_mode=target
continue
;;
-static)
build_old_libs=yes
continue
;;
-prefer-pic)
pic_mode=yes
continue
;;
-prefer-non-pic)
pic_mode=no
continue
;;
-Xcompiler)
arg_mode=arg # the next one goes into the "base_compile" arg list
continue # The current "srcfile" will either be retained or
;; # replaced later. I would guess that would be a bug.
-Wc,*)
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
lastarg=
save_ifs="$IFS"; IFS=','
for arg in $args; do
IFS="$save_ifs"
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
lastarg="$lastarg $arg"
done
IFS="$save_ifs"
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
# Add the arguments to base_compile.
base_compile="$base_compile $lastarg"
continue
;;
* )
# Accept the current argument as the source file.
# The previous "srcfile" becomes the current argument.
#
lastarg="$srcfile"
srcfile="$arg"
;;
esac # case $arg
;;
esac # case $arg_mode
# Aesthetically quote the previous argument.
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
case $lastarg in
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
lastarg="\"$lastarg\""
;;
esac
base_compile="$base_compile $lastarg"
done # for arg
case $arg_mode in
arg)
$echo "$modename: you must specify an argument for -Xcompile"
exit 1
;;
target)
$echo "$modename: you must specify a target with \`-o'" 1>&2
exit 1
;;
*)
# Get the name of the library object.
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
;;
esac
# Recognize several different file suffixes.
# If the user specifies -o file.o, it is replaced with file.lo
xform='[cCFSifmso]'
case $libobj in
*.ada) xform=ada ;;
*.adb) xform=adb ;;
*.ads) xform=ads ;;
*.asm) xform=asm ;;
*.c++) xform=c++ ;;
*.cc) xform=cc ;;
*.ii) xform=ii ;;
*.class) xform=class ;;
*.cpp) xform=cpp ;;
*.cxx) xform=cxx ;;
*.f90) xform=f90 ;;
*.for) xform=for ;;
*.java) xform=java ;;
esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
case $libobj in
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
*)
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
exit 1
;;
esac
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base compile
# command doesn't match the default compiler.
if test -n "$available_tags" && test -z "$tagname"; then
case $base_compile in
# Blanks in the command may have been stripped by the calling shell,
# but not from the CC environment variable when configure was run.
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
# Blanks at the start of $base_compile will cause this to fail
# if we don't check for them as well.
*)
for z in $available_tags; do
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
case "$base_compile " in
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
# The compiler in the base compile command matches
# the one in the tagged configuration.
# Assume this is the tagged configuration we want.
tagname=$z
break
;;
esac
fi
done
# If $tagname still isn't set, then no tagged configuration
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
$echo "$modename: unable to infer tagged configuration"
$echo "$modename: specify a tag with \`--tag'" 1>&2
exit 1
# else
# $echo "$modename: using $tagname tagged configuration"
fi
;;
esac
fi
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$obj"; then
xdir=
else
xdir=$xdir/
fi
lobj=${xdir}$objdir/$objname
if test -z "$base_compile"; then
$echo "$modename: you must specify a compilation command" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Delete any leftover library objects.
if test "$build_old_libs" = yes; then
removelist="$obj $lobj $libobj ${libobj}T"
else
removelist="$lobj $libobj ${libobj}T"
fi
$run $rm $removelist
trap "$run $rm $removelist; exit 1" 1 2 15
# On Cygwin there's no "real" PIC flag so we must build both object types
case $host_os in
cygwin* | mingw* | pw32* | os2*)
pic_mode=default
;;
esac
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
# non-PIC code in shared libraries is not supported
pic_mode=default
fi
# Calculate the filename of the output object if compiler does
# not support -o with -c
if test "$compiler_c_o" = no; then
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
lockfile="$output_obj.lock"
removelist="$removelist $output_obj $lockfile"
trap "$run $rm $removelist; exit 1" 1 2 15
else
output_obj=
need_locks=no
lockfile=
fi
# Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file
if test "$need_locks" = yes; then
until $run ln "$0" "$lockfile" 2>/dev/null; do
$show "Waiting for $lockfile to be removed"
sleep 2
done
elif test "$need_locks" = warn; then
if test -f "$lockfile"; then
$echo "\
*** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null`
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$run $rm $removelist
exit 1
fi
$echo $srcfile > "$lockfile"
fi
if test -n "$fix_srcfile_path"; then
eval srcfile=\"$fix_srcfile_path\"
fi
$run $rm "$libobj" "${libobj}T"
# Create a libtool object file (analogous to a ".la" file),
# but don't create it if we're doing a dry run.
test -z "$run" && cat > ${libobj}T <<EOF
# $libobj - a libtool object file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# Name of the PIC object.
EOF
# Only build a PIC object if we are building libtool libraries.
if test "$build_libtool_libs" = yes; then
# Without this assignment, base_compile gets emptied.
fbsd_hideous_sh_bug=$base_compile
if test "$pic_mode" != no; then
command="$base_compile $srcfile $pic_flag"
else
# Don't build PIC code
command="$base_compile $srcfile"
fi
if test ! -d "${xdir}$objdir"; then
$show "$mkdir ${xdir}$objdir"
$run $mkdir ${xdir}$objdir
status=$?
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
exit $status
fi
fi
if test -z "$output_obj"; then
# Place PIC objects in $objdir
command="$command -o $lobj"
fi
$run $rm "$lobj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
test -n "$output_obj" && $run $rm $removelist
exit 1
fi
if test "$need_locks" = warn &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
$echo "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$run $rm $removelist
exit 1
fi
# Just move the object if needed, then go on to compile the next one
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
$show "$mv $output_obj $lobj"
if $run $mv $output_obj $lobj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
fi
# Append the name of the PIC object to the libtool object file.
test -z "$run" && cat >> ${libobj}T <<EOF
pic_object='$objdir/$objname'
EOF
# Allow error messages only from the first compilation.
suppress_output=' >/dev/null 2>&1'
else
# No PIC object so indicate it doesn't exist in the libtool
# object file.
test -z "$run" && cat >> ${libobj}T <<EOF
pic_object=none
EOF
fi
# Only build a position-dependent object if we build old libraries.
if test "$build_old_libs" = yes; then
if test "$pic_mode" != yes; then
# Don't build PIC code
command="$base_compile $srcfile"
else
command="$base_compile $srcfile $pic_flag"
fi
if test "$compiler_c_o" = yes; then
command="$command -o $obj"
fi
# Suppress compiler output if we already did a PIC compilation.
command="$command$suppress_output"
$run $rm "$obj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
$run $rm $removelist
exit 1
fi
if test "$need_locks" = warn &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
$echo "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
but it should contain:
$srcfile
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
your compiler does not support \`-c' and \`-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
$run $rm $removelist
exit 1
fi
# Just move the object if needed
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
$show "$mv $output_obj $obj"
if $run $mv $output_obj $obj; then :
else
error=$?
$run $rm $removelist
exit $error
fi
fi
# Append the name of the non-PIC object the libtool object file.
# Only append if the libtool object file exists.
test -z "$run" && cat >> ${libobj}T <<EOF
# Name of the non-PIC object.
non_pic_object='$objname'
EOF
else
# Append the name of the non-PIC object the libtool object file.
# Only append if the libtool object file exists.
test -z "$run" && cat >> ${libobj}T <<EOF
# Name of the non-PIC object.
non_pic_object=none
EOF
fi
$run $mv "${libobj}T" "${libobj}"
# Unlock the critical section if it was locked
if test "$need_locks" != no; then
$run $rm "$lockfile"
fi
exit 0
;;
# libtool link mode
link | relink)
modename="$modename: link"
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
# which system we are compiling for in order to pass an extra
# flag for every libtool invocation.
# allow_undefined=no
# FIXME: Unfortunately, there are problems with the above when trying
# to make a dll which has undefined symbols, in which case not
# even a static library is built. For now, we need to specify
# -no-undefined on the libtool link line when we can be certain
# that all symbols are satisfied, otherwise we get a static library.
allow_undefined=yes
;;
*)
allow_undefined=yes
;;
esac
libtool_args="$nonopt"
base_compile="$nonopt"
compile_command="$nonopt"
finalize_command="$nonopt"
compile_rpath=
finalize_rpath=
compile_shlibpath=
finalize_shlibpath=
convenience=
old_convenience=
deplibs=
old_deplibs=
add_flags=
compiler_flags=
linker_flags=
dllsearchpath=
lib_search_path=`pwd`
inst_prefix_dir=
avoid_version=no
dlfiles=
dlprefiles=
dlself=no
export_dynamic=no
export_symbols=
export_symbols_regex=
generated=
libobjs=
ltlibs=
module=no
no_install=no
objs=
non_pic_objects=
prefer_static_libs=no
preload=no
prev=
prevarg=
release=
rpath=
xrpath=
perm_rpath=
temp_rpath=
thread_safe=no
vinfo=
vinfo_number=no
# We need to know -static, to get the right output filenames.
for arg
do
case $arg in
-all-static | -static)
if test "X$arg" = "X-all-static"; then
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
fi
if test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
else
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
fi
build_libtool_libs=no
build_old_libs=yes
prefer_static_libs=yes
break
;;
esac
done
# See if our shared archives depend on static archives.
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
# Go through the arguments, transforming them on the way.
while test "$#" -gt 0; do
arg="$1"
base_compile="$base_compile $arg"
shift
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
;;
*) qarg=$arg ;;
esac
libtool_args="$libtool_args $qarg"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case $prev in
output)
compile_command="$compile_command @OUTPUT@"
finalize_command="$finalize_command @OUTPUT@"
;;
esac
case $prev in
dlfiles|dlprefiles)
if test "$preload" = no; then
# Add the symbol object into the linking commands.
compile_command="$compile_command @SYMFILE@"
finalize_command="$finalize_command @SYMFILE@"
preload=yes
fi
case $arg in
*.la | *.lo) ;; # We handle these cases below.
force)
if test "$dlself" = no; then
dlself=needless
export_dynamic=yes
fi
prev=
continue
;;
self)
if test "$prev" = dlprefiles; then
dlself=yes
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
dlself=yes
else
dlself=needless
export_dynamic=yes
fi
prev=
continue
;;
*)
if test "$prev" = dlfiles; then
dlfiles="$dlfiles $arg"
else
dlprefiles="$dlprefiles $arg"
fi
prev=
continue
;;
esac
;;
expsyms)
export_symbols="$arg"
if test ! -f "$arg"; then
$echo "$modename: symbol file \`$arg' does not exist"
exit 1
fi
prev=
continue
;;
expsyms_regex)
export_symbols_regex="$arg"
prev=
continue
;;
inst_prefix)
inst_prefix_dir="$arg"
prev=
continue
;;
release)
release="-$arg"
prev=
continue
;;
objectlist)
if test -f "$arg"; then
save_arg=$arg
moreargs=
for fil in `cat $save_arg`
do
# moreargs="$moreargs $fil"
arg=$fil
# A libtool-controlled object.
# Check to see that this really is a libtool object.
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
pic_object=
non_pic_object=
# Read the .lo file
# If there is no directory component, then add one.
case $arg in
*/* | *\\*) . $arg ;;
*) . ./$arg ;;
esac
if test -z "$pic_object" || \
test -z "$non_pic_object" ||
test "$pic_object" = none && \
test "$non_pic_object" = none; then
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
exit 1
fi
# Extract subdirectory from the argument.
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
xdir="$xdir/"
fi
if test "$pic_object" != none; then
# Prepend the subdirectory the object is found in.
pic_object="$xdir$pic_object"
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
dlfiles="$dlfiles $pic_object"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
dlprefiles="$dlprefiles $pic_object"
prev=
fi
# A PIC object.
libobjs="$libobjs $pic_object"
arg="$pic_object"
fi
# Non-PIC object.
if test "$non_pic_object" != none; then
# Prepend the subdirectory the object is found in.
non_pic_object="$xdir$non_pic_object"
# A standard non-PIC object
non_pic_objects="$non_pic_objects $non_pic_object"
if test -z "$pic_object" || test "$pic_object" = none ; then
arg="$non_pic_object"
fi
fi
else
# Only an error if not doing a dry-run.
if test -z "$run"; then
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
exit 1
else
# Dry-run case.
# Extract subdirectory from the argument.
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
xdir="$xdir/"
fi
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
libobjs="$libobjs $pic_object"
non_pic_objects="$non_pic_objects $non_pic_object"
fi
fi
done
else
$echo "$modename: link input file \`$save_arg' does not exist"
exit 1
fi
arg=$save_arg
prev=
continue
;;
rpath | xrpath)
# We need an absolute path.
case $arg in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
$echo "$modename: only absolute run-paths are allowed" 1>&2
exit 1
;;
esac
if test "$prev" = rpath; then
case "$rpath " in
*" $arg "*) ;;
*) rpath="$rpath $arg" ;;
esac
else
case "$xrpath " in
*" $arg "*) ;;
*) xrpath="$xrpath $arg" ;;
esac
fi
prev=
continue
;;
xcompiler)
compiler_flags="$compiler_flags $qarg"
prev=
compile_command="$compile_command $qarg"
finalize_command="$finalize_command $qarg"
continue
;;
xlinker)
linker_flags="$linker_flags $qarg"
compiler_flags="$compiler_flags $wl$qarg"
prev=
compile_command="$compile_command $wl$qarg"
finalize_command="$finalize_command $wl$qarg"
continue
;;
xcclinker)
linker_flags="$linker_flags $qarg"
compiler_flags="$compiler_flags $qarg"
prev=
compile_command="$compile_command $qarg"
finalize_command="$finalize_command $qarg"
continue
;;
*)
eval "$prev=\"\$arg\""
prev=
continue
;;
esac
fi # test -n "$prev"
prevarg="$arg"
case $arg in
-all-static)
if test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag"
fi
continue
;;
-allow-undefined)
# FIXME: remove this flag sometime in the future.
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
continue
;;
-avoid-version)
avoid_version=yes
continue
;;
-dlopen)
prev=dlfiles
continue
;;
-dlpreopen)
prev=dlprefiles
continue
;;
-export-dynamic)
export_dynamic=yes
continue
;;
-export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: more than one -exported-symbols argument is not allowed"
exit 1
fi
if test "X$arg" = "X-export-symbols"; then
prev=expsyms
else
prev=expsyms_regex
fi
continue
;;
-inst-prefix-dir)
prev=inst_prefix
continue
;;
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
# so, if we see these flags be careful not to treat them like -L
-L[A-Z][A-Z]*:*)
case $with_gcc/$host in
no/*-*-irix* | /*-*-irix*)
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
;;
esac
continue
;;
-L*)
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
exit 1
fi
dir="$absdir"
;;
esac
case "$deplibs " in
*" -L$dir "*) ;;
*)
deplibs="$deplibs -L$dir"
lib_search_path="$lib_search_path $dir"
;;
esac
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
case :$dllsearchpath: in
*":$dir:"*) ;;
*) dllsearchpath="$dllsearchpath:$dir";;
esac
;;
esac
continue
;;
-l*)
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
case $host in
*-*-cygwin* | *-*-pw32* | *-*-beos*)
# These systems don't actually have a C or math library (as such)
continue
;;
*-*-freebsd*-gnu*)
# prevent being parsed by the freebsd regexp below
;;
*-*-mingw* | *-*-os2*)
# These systems don't actually have a C library (as such)
test "X$arg" = "X-lc" && continue
;;
*-*-openbsd* | *-*-freebsd*)
# Do not include libc due to us having libc/libc_r.
test "X$arg" = "X-lc" && continue
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework
deplibs="$deplibs -framework System"
continue
esac
elif test "X$arg" = "X-lc_r"; then
case $host in
*-*-freebsd*-gnu*)
# prevent being parsed by the freebsd regexp below
;;
*-*-openbsd*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
esac
fi
deplibs="$deplibs $arg"
continue
;;
-module)
module=yes
continue
;;
# gcc -m* arguments should be passed to the linker via $compiler_flags
# in order to pass architecture information to the linker
# (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
# but this is not reliable with gcc because gcc may use -mfoo to
# select a different linker, different libraries, etc, while
# -Wl,-mfoo simply passes -mfoo to the linker.
-m*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
if test "$with_gcc" = "yes" ; then
compiler_flags="$compiler_flags $arg"
fi
continue
;;
-shrext)
prev=shrext
continue
;;
-no-fast-install)
fast_install=no
continue
;;
-no-install)
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
# The PATH hackery in wrapper scripts is required on Windows
# in order for the loader to find any dlls it needs.
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
fast_install=no
;;
*) no_install=yes ;;
esac
continue
;;
-no-undefined)
allow_undefined=no
continue
;;
-objectlist)
prev=objectlist
continue
;;
-o) prev=output ;;
-release)
prev=release
continue
;;
-rpath)
prev=rpath
continue
;;
-R)
prev=xrpath
continue
;;
-R*)
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
$echo "$modename: only absolute run-paths are allowed" 1>&2
exit 1
;;
esac
case "$xrpath " in
*" $dir "*) ;;
*) xrpath="$xrpath $dir" ;;
esac
continue
;;
-static)
# The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
# would be equivalent was wrong. It would break on at least
# Digital Unix and AIX.
continue
;;
-thread-safe)
thread_safe=yes
continue
;;
-version-info)
prev=vinfo
continue
;;
-version-number)
prev=vinfo
vinfo_number=yes
continue
;;
-Wc,*)
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
arg=
save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
case $flag in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
flag="\"$flag\""
;;
esac
arg="$arg $wl$flag"
compiler_flags="$compiler_flags $flag"
done
IFS="$save_ifs"
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
;;
-Wl,*)
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
arg=
save_ifs="$IFS"; IFS=','
for flag in $args; do
IFS="$save_ifs"
case $flag in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
flag="\"$flag\""
;;
esac
arg="$arg $wl$flag"
compiler_flags="$compiler_flags $wl$flag"
linker_flags="$linker_flags $flag"
done
IFS="$save_ifs"
arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
;;
-Xcompiler)
prev=xcompiler
continue
;;
-Xlinker)
prev=xlinker
continue
;;
-XCClinker)
prev=xcclinker
continue
;;
# Some other compiler flag.
-* | +*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
add_flags="$add_flags $arg"
;;
*.$objext)
# A standard object.
objs="$objs $arg"
;;
*.lo)
# A libtool-controlled object.
# Check to see that this really is a libtool object.
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
pic_object=
non_pic_object=
# Read the .lo file
# If there is no directory component, then add one.
case $arg in
*/* | *\\*) . $arg ;;
*) . ./$arg ;;
esac
if test -z "$pic_object" || \
test -z "$non_pic_object" ||
test "$pic_object" = none && \
test "$non_pic_object" = none; then
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
exit 1
fi
# Extract subdirectory from the argument.
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
xdir="$xdir/"
fi
if test "$pic_object" != none; then
# Prepend the subdirectory the object is found in.
pic_object="$xdir$pic_object"
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
dlfiles="$dlfiles $pic_object"
prev=
continue
else
# If libtool objects are unsupported, then we need to preload.
prev=dlprefiles
fi
fi
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
dlprefiles="$dlprefiles $pic_object"
prev=
fi
# A PIC object.
libobjs="$libobjs $pic_object"
arg="$pic_object"
fi
# Non-PIC object.
if test "$non_pic_object" != none; then
# Prepend the subdirectory the object is found in.
non_pic_object="$xdir$non_pic_object"
# A standard non-PIC object
non_pic_objects="$non_pic_objects $non_pic_object"
if test -z "$pic_object" || test "$pic_object" = none ; then
arg="$non_pic_object"
fi
fi
else
# Only an error if not doing a dry-run.
if test -z "$run"; then
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2
exit 1
else
# Dry-run case.
# Extract subdirectory from the argument.
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
if test "X$xdir" = "X$arg"; then
xdir=
else
xdir="$xdir/"
fi
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
libobjs="$libobjs $pic_object"
non_pic_objects="$non_pic_objects $non_pic_object"
fi
fi
;;
*.$libext)
# An archive.
deplibs="$deplibs $arg"
old_deplibs="$old_deplibs $arg"
continue
;;
*.la)
# A libtool-controlled library.
if test "$prev" = dlfiles; then
# This library was specified with -dlopen.
dlfiles="$dlfiles $arg"
prev=
elif test "$prev" = dlprefiles; then
# The library was specified with -dlpreopen.
dlprefiles="$dlprefiles $arg"
prev=
else
deplibs="$deplibs $arg"
fi
continue
;;
# Some other compiler argument.
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
add_flags="$add_flags $arg"
;;
esac # arg
# Now actually substitute the argument into the commands.
if test -n "$arg"; then
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
fi
done # argument parsing loop
if test -n "$prev"; then
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base link
# command doesn't match the default compiler.
if test -n "$available_tags" && test -z "$tagname"; then
case $base_compile in
# Blanks in the command may have been stripped by the calling shell,
# but not from the CC environment variable when configure was run.
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
# Blanks at the start of $base_compile will cause this to fail
# if we don't check for them as well.
*)
for z in $available_tags; do
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
case $base_compile in
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
# The compiler in $compile_command matches
# the one in the tagged configuration.
# Assume this is the tagged configuration we want.
tagname=$z
break
;;
esac
fi
done
# If $tagname still isn't set, then no tagged configuration
# was found and let the user know that the "--tag" command
# line option must be used.
if test -z "$tagname"; then
$echo "$modename: unable to infer tagged configuration"
$echo "$modename: specify a tag with \`--tag'" 1>&2
exit 1
# else
# $echo "$modename: using $tagname tagged configuration"
fi
;;
esac
fi
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
eval arg=\"$export_dynamic_flag_spec\"
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
fi
oldlibs=
# calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
libobjs_save="$libobjs"
if test -n "$shlibpath_var"; then
# get the directories listed in $shlibpath_var
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
else
shlib_search_path=
fi
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
if test "X$output_objdir" = "X$output"; then
output_objdir="$objdir"
else
output_objdir="$output_objdir/$objdir"
fi
# Create the object directory.
if test ! -d "$output_objdir"; then
$show "$mkdir $output_objdir"
$run $mkdir $output_objdir
status=$?
if test "$status" -ne 0 && test ! -d "$output_objdir"; then
exit $status
fi
fi
# Determine the type of output
case $output in
"")
$echo "$modename: you must specify an output file" 1>&2
$echo "$help" 1>&2
exit 1
;;
*.$libext) linkmode=oldlib ;;
*.lo | *.$objext) linkmode=obj ;;
*.la) linkmode=lib ;;
*) linkmode=prog ;; # Anything else should be a program.
esac
case $host in
*cygwin* | *mingw* | *pw32*)
# don't eliminate duplcations in $postdeps and $predeps
duplicate_compiler_generated_deps=yes
;;
*)
duplicate_compiler_generated_deps=$duplicate_deps
;;
esac
specialdeplibs=
libs=
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
if test "X$duplicate_deps" = "Xyes" ; then
case "$libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
libs="$libs $deplib"
done
if test "$linkmode" = lib; then
libs="$predeps $libs $compiler_lib_search_path $postdeps"
# Compute libraries that are listed more than once in $predeps
# $postdeps and mark them as special (i.e., whose duplicates are
# not to be eliminated).
pre_post_deps=
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
for pre_post_dep in $predeps $postdeps; do
case "$pre_post_deps " in
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
esac
pre_post_deps="$pre_post_deps $pre_post_dep"
done
fi
pre_post_deps=
fi
deplibs=
newdependency_libs=
newlib_search_path=
need_relink=no # whether we're linking any uninstalled libtool libraries
notinst_deplibs= # not-installed libtool libraries
notinst_path= # paths that contain not-installed libtool libraries
case $linkmode in
lib)
passes="conv link"
for file in $dlfiles $dlprefiles; do
case $file in
*.la) ;;
*)
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
exit 1
;;
esac
done
;;
prog)
compile_deplibs=
finalize_deplibs=
alldeplibs=no
newdlfiles=
newdlprefiles=
passes="conv scan dlopen dlpreopen link"
;;
*) passes="conv"
;;
esac
for pass in $passes; do
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan"; then
libs="$deplibs"
deplibs=
fi
if test "$linkmode" = prog; then
case $pass in
dlopen) libs="$dlfiles" ;;
dlpreopen) libs="$dlprefiles" ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
if test "$pass" = dlopen; then
# Collect dlpreopened libraries
save_deplibs="$deplibs"
deplibs=
fi
for deplib in $libs; do
lib=
found=no
case $deplib in
-l*)
if test "$linkmode" != lib && test "$linkmode" != prog; then
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
continue
fi
if test "$pass" = conv && test "$allow_undefined" = yes; then
deplibs="$deplib $deplibs"
continue
fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
for search_ext in .la $shrext .so .a; do
# Search the libtool library
lib="$searchdir/lib${name}${search_ext}"
if test -f "$lib"; then
if test "$search_ext" = ".la"; then
found=yes
else
found=no
fi
break 2
fi
done
done
if test "$found" != yes; then
# deplib doesn't seem to be a libtool library
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
fi
continue
else # deplib is a libtool library
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
# We need to do some special things here, and not later.
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $deplib "*)
if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
library_names=
old_library=
case $lib in
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
for l in $old_library $library_names; do
ll="$l"
done
if test "X$ll" = "X$old_library" ; then # only static version available
found=no
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
test "X$ladir" = "X$lib" && ladir="."
lib=$ladir/$old_library
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
fi
continue
fi
fi
;;
*) ;;
esac
fi
fi
;; # -l
-L*)
case $linkmode in
lib)
deplibs="$deplib $deplibs"
test "$pass" = conv && continue
newdependency_libs="$deplib $newdependency_libs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
;;
prog)
if test "$pass" = conv; then
deplibs="$deplib $deplibs"
continue
fi
if test "$pass" = scan; then
deplibs="$deplib $deplibs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
;;
*)
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
;;
esac # linkmode
continue
;; # -L
-R*)
if test "$pass" = link; then
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
*" $dir "*) ;;
*) xrpath="$xrpath $dir" ;;
esac
fi
deplibs="$deplib $deplibs"
continue
;;
*.la) lib="$deplib" ;;
*.$libext)
if test "$pass" = conv; then
deplibs="$deplib $deplibs"
continue
fi
case $linkmode in
lib)
if test "$deplibs_check_method" != pass_all; then
$echo
$echo "*** Warning: Trying to link with static lib archive $deplib."
$echo "*** I have the capability to make that library automatically link in when"
$echo "*** you link to this library. But I can only do this if you have a"
$echo "*** shared version of the library, which you do not appear to have"
$echo "*** because the file extensions .$libext of this argument makes me believe"
$echo "*** that it is just a static archive that I should not used here."
else
$echo
$echo "*** Warning: Linking the shared library $output against the"
$echo "*** static library $deplib is not portable!"
deplibs="$deplib $deplibs"
fi
continue
;;
prog)
if test "$pass" != link; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
fi
continue
;;
esac # linkmode
;; # *.$libext
*.lo | *.$objext)
if test "$pass" = conv; then
deplibs="$deplib $deplibs"
elif test "$linkmode" = prog; then
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
newdlprefiles="$newdlprefiles $deplib"
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
newdlfiles="$newdlfiles $deplib"
fi
fi
continue
;;
%DEPLIBS%)
alldeplibs=yes
continue
;;
esac # case $deplib
if test "$found" = yes || test -f "$lib"; then :
else
$echo "$modename: cannot find the library \`$lib'" 1>&2
exit 1
fi
# Check to see that this really is a libtool archive.
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
fi
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
test "X$ladir" = "X$lib" && ladir="."
dlname=
dlopen=
dlpreopen=
libdir=
library_names=
old_library=
# If the library was installed with an old release of libtool,
# it will not redefine variables installed, or shouldnotlink
installed=yes
shouldnotlink=no
# Read the .la file
case $lib in
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
fi
if test "$pass" = conv; then
# Only check for convenience libraries
deplibs="$lib $deplibs"
tmp_libs=
for deplib in $dependency_libs; do
#echo "Adding $deplib to \$deplibs"
deplibs="$deplib $deplibs"
if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
if test -z "$libdir"; then
if test -z "$old_library"; then
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
exit 1
fi
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $ladir/$objdir/$old_library"
old_convenience="$old_convenience $ladir/$objdir/$old_library"
elif test "$linkmode" != prog && test "$linkmode" != lib; then
$echo "$modename: \`$lib' is not a convenience library" 1>&2
exit 1
fi
continue
fi # $pass = conv
# Get the name of the library we link against.
linklib=
for l in $old_library $library_names; do
linklib="$l"
done
if test -z "$linklib"; then
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2
exit 1
fi
# This library was specified with -dlopen.
if test "$pass" = dlopen; then
if test -z "$libdir"; then
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
exit 1
fi
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlname, no dlopen support or we're linking
# statically, we need to preload. We also need to preload any
# dependent libraries so libltdl's deplib preloader doesn't
# bomb out in the load deplibs phase.
dlprefiles="$dlprefiles $lib $dependency_libs"
else
newdlfiles="$newdlfiles $lib"
fi
continue
fi # $pass = dlopen
# We need an absolute path.
case $ladir in
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
*)
abs_ladir=`cd "$ladir" && pwd`
if test -z "$abs_ladir"; then
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2
abs_ladir="$ladir"
fi
;;
esac
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
# Find the relevant object directory and library name.
if test "X$installed" = Xyes; then
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
$echo "$modename: warning: library \`$lib' was moved." 1>&2
dir="$ladir"
absdir="$abs_ladir"
libdir="$abs_ladir"
else
dir="$libdir"
absdir="$libdir"
fi
else
dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir"
# Remove this search path later
notinst_path="$notinst_path $abs_ladir"
fi # $installed = yes
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
# This library was specified with -dlpreopen.
if test "$pass" = dlpreopen; then
if test -z "$libdir"; then
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
exit 1
fi
# Prefer using a static library (so that no silly _DYNAMIC symbols
# are required to link).
if test -n "$old_library"; then
newdlprefiles="$newdlprefiles $dir/$old_library"
# Otherwise, use the dlname, so that lt_dlopen finds it.
elif test -n "$dlname"; then
newdlprefiles="$newdlprefiles $dir/$dlname"
else
newdlprefiles="$newdlprefiles $dir/$linklib"
fi
fi # $pass = dlpreopen
if test -z "$libdir"; then
# Link the convenience library
if test "$linkmode" = lib; then
deplibs="$dir/$old_library $deplibs"
elif test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$dir/$old_library $compile_deplibs"
finalize_deplibs="$dir/$old_library $finalize_deplibs"
else
deplibs="$lib $deplibs" # used for prog,scan pass
fi
continue
fi
if test "$linkmode" = prog && test "$pass" != link; then
newlib_search_path="$newlib_search_path $ladir"
deplibs="$lib $deplibs"
linkalldeplibs=no
if test "$link_all_deplibs" != no || test -z "$library_names" ||
test "$build_libtool_libs" = no; then
linkalldeplibs=yes
fi
tmp_libs=
for deplib in $dependency_libs; do
case $deplib in
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
esac
# Need to link against all dependency_libs?
if test "$linkalldeplibs" = yes; then
deplibs="$deplib $deplibs"
else
# Need to hardcode shared library paths
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done # for deplib
continue
fi # $linkmode = prog...
if test "$linkmode,$pass" = "prog,link"; then
if test -n "$library_names" &&
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
# We need to hardcode the library path
if test -n "$shlibpath_var"; then
# Make sure the rpath contains only unique directories.
case "$temp_rpath " in
*" $dir "*) ;;
*" $absdir "*) ;;
*) temp_rpath="$temp_rpath $dir" ;;
esac
fi
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
case "$compile_rpath " in
*" $absdir "*) ;;
*) compile_rpath="$compile_rpath $absdir"
esac
;;
esac
case " $sys_lib_dlsearch_path " in
*" $libdir "*) ;;
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir"
esac
;;
esac
fi # $linkmode,$pass = prog,link...
if test "$alldeplibs" = yes &&
{ test "$deplibs_check_method" = pass_all ||
{ test "$build_libtool_libs" = yes &&
test -n "$library_names"; }; }; then
# We only need to search for static libraries
continue
fi
fi
link_static=no # Whether the deplib will be linked statically
if test -n "$library_names" &&
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then
if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib"
need_relink=yes
fi
# This is a shared library
# Warn about portability, can't link against -module's on some systems (darwin)
if test "$shouldnotlink" = yes && test "$pass" = link ; then
$echo
if test "$linkmode" = prog; then
$echo "*** Warning: Linking the executable $output against the loadable module"
else
$echo "*** Warning: Linking the shared library $output against the loadable module"
fi
$echo "*** $linklib is not portable!"
fi
if test "$linkmode" = lib &&
test "$hardcode_into_libs" = yes; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
case " $sys_lib_dlsearch_path " in
*" $absdir "*) ;;
*)
case "$compile_rpath " in
*" $absdir "*) ;;
*) compile_rpath="$compile_rpath $absdir"
esac
;;
esac
case " $sys_lib_dlsearch_path " in
*" $libdir "*) ;;
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir"
esac
;;
esac
fi
if test -n "$old_archive_from_expsyms_cmds"; then
# figure out the soname
set dummy $library_names
realname="$2"
shift; shift
libname=`eval \\$echo \"$libname_spec\"`
# use dlname if we got it. it's perfectly good, no?
if test -n "$dlname"; then
soname="$dlname"
elif test -n "$soname_spec"; then
# bleh windows
case $host in
*cygwin* | mingw*)
major=`expr $current - $age`
versuffix="-$major"
;;
esac
eval soname=\"$soname_spec\"
else
soname="$realname"
fi
# Make a new name for the extract_expsyms_cmds to use
soroot="$soname"
soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
# If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then :
else
$show "extracting exported symbol list from \`$soname'"
save_ifs="$IFS"; IFS='~'
eval cmds=\"$extract_expsyms_cmds\"
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
# Create $newlib
if test -f "$output_objdir/$newlib"; then :; else
$show "generating import library for \`$soname'"
save_ifs="$IFS"; IFS='~'
eval cmds=\"$old_archive_from_expsyms_cmds\"
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
# make sure the library variables are pointing to the new library
dir=$output_objdir
linklib=$newlib
fi # test -n "$old_archive_from_expsyms_cmds"
if test "$linkmode" = prog || test "$mode" != relink; then
add_shlibpath=
add_dir=
add=
lib_linked=yes
case $hardcode_action in
immediate | unsupported)
if test "$hardcode_direct" = no; then
add="$dir/$linklib"
case $host in
*-*-sco3.2v5* ) add_dir="-L$dir" ;;
*-*-darwin* )
# if the lib is a module then we can not link against it, someone
# is ignoring the new warnings I added
if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
$echo "** Warning, lib $linklib is a module, not a shared library"
if test -z "$old_library" ; then
$echo
$echo "** And there doesn't seem to be a static archive available"
$echo "** The link will probably fail, sorry"
else
add="$dir/$old_library"
fi
fi
esac
elif test "$hardcode_minus_L" = no; then
case $host in
*-*-sunos*) add_shlibpath="$dir" ;;
esac
add_dir="-L$dir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = no; then
add_shlibpath="$dir"
add="-l$name"
else
lib_linked=no
fi
;;
relink)
if test "$hardcode_direct" = yes; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$dir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case "$libdir" in
[\\/]*)
add_dir="-L$inst_prefix_dir$libdir $add_dir"
;;
esac
fi
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
add_shlibpath="$dir"
add="-l$name"
else
lib_linked=no
fi
;;
*) lib_linked=no ;;
esac
if test "$lib_linked" != yes; then
$echo "$modename: configuration error: unsupported hardcode properties"
exit 1
fi
if test -n "$add_shlibpath"; then
case :$compile_shlibpath: in
*":$add_shlibpath:"*) ;;
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
esac
fi
if test "$linkmode" = prog; then
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
test -n "$add" && compile_deplibs="$add $compile_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
if test "$hardcode_direct" != yes && \
test "$hardcode_minus_L" != yes && \
test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
fi
fi
fi
if test "$linkmode" = prog || test "$mode" = relink; then
add_shlibpath=
add_dir=
add=
# Finalize command for both is simple: just hardcode it.
if test "$hardcode_direct" = yes; then
add="$libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$libdir"
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
add="-l$name"
elif test "$hardcode_automatic" = yes; then
if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
add="$inst_prefix_dir$libdir/$linklib"
else
add="$libdir/$linklib"
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
add_dir="-L$libdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case "$libdir" in
[\\/]*)
add_dir="-L$inst_prefix_dir$libdir $add_dir"
;;
esac
fi
add="-l$name"
fi
if test "$linkmode" = prog; then
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
fi
fi
elif test "$linkmode" = prog; then
# Here we assume that one of hardcode_direct or hardcode_minus_L
# is not unsupported. This is valid on all known static and
# shared platforms.
if test "$hardcode_direct" != unsupported; then
test -n "$old_library" && linklib="$old_library"
compile_deplibs="$dir/$linklib $compile_deplibs"
finalize_deplibs="$dir/$linklib $finalize_deplibs"
else
compile_deplibs="-l$name -L$dir $compile_deplibs"
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
fi
elif test "$build_libtool_libs" = yes; then
# Not a shared library
if test "$deplibs_check_method" != pass_all; then
# We're trying link a shared library against a static one
# but the system doesn't support it.
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
$echo
$echo "*** Warning: This system can not link to static lib archive $lib."
$echo "*** I have the capability to make that library automatically link in when"
$echo "*** you link to this library. But I can only do this if you have a"
$echo "*** shared version of the library, which you do not appear to have."
if test "$module" = yes; then
$echo "*** But as you try to build a module library, libtool will still create "
$echo "*** a static module, that should work as long as the dlopening application"
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
$echo
$echo "*** However, this would only work if libtool was able to extract symbol"
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
$echo "*** not find such a program. So, this module is probably useless."
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
fi
else
convenience="$convenience $dir/$old_library"
old_convenience="$old_convenience $dir/$old_library"
deplibs="$dir/$old_library $deplibs"
link_static=yes
fi
fi # link shared/static library?
if test "$linkmode" = lib; then
#if test -n "$dependency_libs" &&
# { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
# test "$link_static" = yes; }; then
# Extract -R from dependency_libs
temp_deplibs=
for libdir in $dependency_libs; do
case $libdir in
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
case " $xrpath " in
*" $temp_xrpath "*) ;;
*) xrpath="$xrpath $temp_xrpath";;
esac;;
*) temp_deplibs="$temp_deplibs $libdir";;
esac
done
dependency_libs="$temp_deplibs"
#fi
newlib_search_path="$newlib_search_path $absdir"
# Link against this library
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
# ... and its dependency_libs
tmp_libs=
for deplib in $dependency_libs; do
newdependency_libs="$deplib $newdependency_libs"
if test "X$duplicate_deps" = "Xyes" ; then
case "$tmp_libs " in
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
esac
fi
tmp_libs="$tmp_libs $deplib"
done
if test "$link_all_deplibs" != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
case $deplib in
-L*) path="$deplib" ;;
*.la)
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$deplib" && dir="."
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
absdir="$dir"
fi
;;
esac
if grep "^installed=no" $deplib > /dev/null; then
path="$absdir/$objdir"
else
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
fi
if test "$absdir" != "$libdir"; then
# Sure, some shells/systems don't implement the -ef.
# Those will have to live with the warning.
test "$absdir" -ef "$libdir" > /dev/null 2>&1 ||
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
fi
path="$absdir"
fi
depdepl=
case $host in
*-*-darwin*)
# we do not want to link against static libs, but need to link against shared
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do
depdepl=$tmp
done
if test -f "$path/$depdepl" ; then
depdepl="$path/$depdepl"
fi
# do not add paths which are already there
case " $newlib_search_path " in
*" $path "*) ;;
*) newlib_search_path="$newlib_search_path $path";;
esac
path=""
fi
;;
*)
path="-L$path"
;;
esac
;;
-l*)
case $host in
*-*-darwin*)
# Again, we only want to link against shared libraries
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
for tmp in $newlib_search_path ; do
if test -f "$tmp/lib$tmp_libs.dylib" ; then
eval depdepl="$tmp/lib$tmp_libs.dylib"
break
fi
done
path=""
;;
*) continue ;;
esac
;;
*) continue ;;
esac
case " $deplibs " in
*" $depdepl "*) ;;
*) deplibs="$deplibs $depdepl" ;;
esac
case " $deplibs " in
*" $path "*) ;;
*) deplibs="$deplibs $path" ;;
esac
done
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
dependency_libs="$newdependency_libs"
if test "$pass" = dlpreopen; then
# Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do
deplibs="$deplib $deplibs"
done
fi
if test "$pass" != dlopen; then
if test "$pass" != conv; then
# Make sure lib_search_path contains only unique directories.
lib_search_path=
for dir in $newlib_search_path; do
case "$lib_search_path " in
*" $dir "*) ;;
*) lib_search_path="$lib_search_path $dir" ;;
esac
done
newlib_search_path=
fi
if test "$linkmode,$pass" != "prog,link"; then
vars="deplibs"
else
vars="compile_deplibs finalize_deplibs"
fi
for var in $vars dependency_libs; do
# Add libraries to $var in reverse order
eval tmp_libs=\"\$$var\"
new_libs=
for deplib in $tmp_libs; do
# FIXME: Pedantically, this is the right thing to do, so
# that some nasty dependency loop isn't accidentally
# broken:
#new_libs="$deplib $new_libs"
# Pragmatically, this seems to cause very few problems in
# practice:
case $deplib in
-L*) new_libs="$deplib $new_libs" ;;
-R*) ;;
*)
# And here is the reason: when a library appears more
# than once as an explicit dependence of a library, or
# is implicitly linked in more than once by the
# compiler, it is considered special, and multiple
# occurrences thereof are not removed. Compare this
# with having the same library being listed as a
# dependency of multiple other libraries: in this case,
# we know (pedantically, we assume) the library does not
# need to be listed more than once, so we keep only the
# last copy. This is not always right, but it is rare
# enough that we require users that really mean to play
# such unportable linking tricks to link the library
# using -Wl,-lname, so that libtool does not consider it
# for duplicate removal.
case " $specialdeplibs " in
*" $deplib "*) new_libs="$deplib $new_libs" ;;
*)
case " $new_libs " in
*" $deplib "*) ;;
*) new_libs="$deplib $new_libs" ;;
esac
;;
esac
;;
esac
done
tmp_libs=
for deplib in $new_libs; do
case $deplib in
-L*)
case " $tmp_libs " in
*" $deplib "*) ;;
*) tmp_libs="$tmp_libs $deplib" ;;
esac
;;
*) tmp_libs="$tmp_libs $deplib" ;;
esac
done
eval $var=\"$tmp_libs\"
done # for var
fi
# Last step: remove runtime libs from dependency_libs (they stay in deplibs)
tmp_libs=
for i in $dependency_libs ; do
case " $predeps $postdeps $compiler_lib_search_path " in
*" $i "*)
i=""
;;
esac
if test -n "$i" ; then
tmp_libs="$tmp_libs $i"
fi
done
dependency_libs=$tmp_libs
done # for pass
if test "$linkmode" = prog; then
dlfiles="$newdlfiles"
dlprefiles="$newdlprefiles"
fi
case $linkmode in
oldlib)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
fi
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
fi
if test -n "$rpath"; then
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
fi
if test -n "$xrpath"; then
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
fi
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
fi
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
fi
# Now set the variables for building old libraries.
build_libtool_libs=no
oldlibs="$output"
objs="$objs$old_deplibs"
;;
lib)
# Make sure we only generate libraries of the form `libNAME.la'.
case $outputname in
lib*)
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
eval shared_ext=\"$shrext\"
eval libname=\"$libname_spec\"
;;
*)
if test "$module" = no; then
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test "$need_lib_prefix" != no; then
# Add the "lib" prefix for modules if required
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
eval shared_ext=\"$shrext\"
eval libname=\"$libname_spec\"
else
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
fi
;;
esac
if test -n "$objs"; then
if test "$deplibs_check_method" != pass_all; then
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
exit 1
else
$echo
$echo "*** Warning: Linking the shared library $output against the non-libtool"
$echo "*** objects $objs is not portable!"
libobjs="$libobjs $objs"
fi
fi
if test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
fi
set dummy $rpath
if test "$#" -gt 2; then
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
fi
install_libdir="$2"
oldlibs=
if test -z "$rpath"; then
if test "$build_libtool_libs" = yes; then
# Building a libtool convenience library.
# Some compilers have problems with a `.al' extension so
# convenience libraries should have the same extension an
# archive normally would.
oldlibs="$output_objdir/$libname.$libext $oldlibs"
build_libtool_libs=convenience
build_old_libs=yes
fi
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
fi
else
# Parse the version information argument.
save_ifs="$IFS"; IFS=':'
set dummy $vinfo 0 0 0
IFS="$save_ifs"
if test -n "$8"; then
$echo "$modename: too many parameters to \`-version-info'" 1>&2
$echo "$help" 1>&2
exit 1
fi
# convert absolute version numbers to libtool ages
# this retains compatibility with .la files and attempts
# to make the code below a bit more comprehensible
case $vinfo_number in
yes)
number_major="$2"
number_minor="$3"
number_revision="$4"
#
# There are really only two kinds -- those that
# use the current revision as the major version
# and those that subtract age and use age as
# a minor version. But, then there is irix
# which has an extra 1 added just for fun
#
case $version_type in
darwin|linux|osf|windows)
current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_revision"
;;
freebsd-aout|freebsd-elf|sunos)
current="$number_major"
revision="$number_minor"
age="0"
;;
irix|nonstopux)
current=`expr $number_major + $number_minor - 1`
age="$number_minor"
revision="$number_minor"
;;
esac
;;
no)
current="$2"
revision="$3"
age="$4"
;;
esac
# Check that each of the things are valid numbers.
case $current in
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
;;
esac
case $revision in
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
;;
esac
case $age in
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
*)
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
;;
esac
if test "$age" -gt "$current"; then
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
fi
# Calculate the version variables.
major=
versuffix=
verstring=
case $version_type in
none) ;;
darwin)
# Like Linux, but with the current version available in
# verstring for coding it into the library header
major=.`expr $current - $age`
versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options...
minor_current=`expr $current + 1`
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
;;
freebsd-aout)
major=".$current"
versuffix=".$current.$revision";
;;
freebsd-elf)
major=".$current"
versuffix=".$current";
;;
irix | nonstopux)
major=`expr $current - $age + 1`
case $version_type in
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
esac
verstring="$verstring_prefix$major.$revision"
# Add in all the interfaces that we are compatible with.
loop=$revision
while test "$loop" -ne 0; do
iface=`expr $revision - $loop`
loop=`expr $loop - 1`
verstring="$verstring_prefix$major.$iface:$verstring"
done
# Before this point, $major must not contain `.'.
major=.$major
versuffix="$major.$revision"
;;
linux)
major=.`expr $current - $age`
versuffix="$major.$age.$revision"
;;
osf)
major=.`expr $current - $age`
versuffix=".$current.$age.$revision"
verstring="$current.$age.$revision"
# Add in all the interfaces that we are compatible with.
loop=$age
while test "$loop" -ne 0; do
iface=`expr $current - $loop`
loop=`expr $loop - 1`
verstring="$verstring:${iface}.0"
done
# Make executables depend on our current version.
verstring="$verstring:${current}.0"
;;
sunos)
major=".$current"
versuffix=".$current.$revision"
;;
windows)
# Use '-' rather than '.', since we only want one
# extension on DOS 8.3 filesystems.
major=`expr $current - $age`
versuffix="-$major"
;;
*)
$echo "$modename: unknown library version type \`$version_type'" 1>&2
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1
;;
esac
# Clear the version info if we defaulted, and they specified a release.
if test -z "$vinfo" && test -n "$release"; then
major=
case $version_type in
darwin)
# we can't check for "0.0" in archive_cmds due to quoting
# problems, so we reset it completely
verstring=
;;
*)
verstring="0.0"
;;
esac
if test "$need_version" = no; then
versuffix=
else
versuffix=".0.0"
fi
fi
# Remove version info from name if versioning should be avoided
if test "$avoid_version" = yes && test "$need_version" = no; then
major=
versuffix=
verstring=""
fi
# Check to see if the archive will have undefined symbols.
if test "$allow_undefined" = yes; then
if test "$allow_undefined_flag" = unsupported; then
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
build_libtool_libs=no
build_old_libs=yes
fi
else
# Don't allow undefined symbols.
allow_undefined_flag="$no_undefined_flag"
fi
fi
if test "$mode" != relink; then
# Remove our outputs, but don't remove object files since they
# may have been created when compiling PIC objects.
removelist=
tempremovelist=`$echo "$output_objdir/*"`
for p in $tempremovelist; do
case $p in
*.$objext)
;;
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
removelist="$removelist $p"
;;
*) ;;
esac
done
if test -n "$removelist"; then
$show "${rm}r $removelist"
$run ${rm}r $removelist
fi
fi
# Now set the variables for building old libraries.
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
oldlibs="$oldlibs $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
fi
# Eliminate all temporary directories.
for path in $notinst_path; do
lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
temp_xrpath=
for libdir in $xrpath; do
temp_xrpath="$temp_xrpath -R$libdir"
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
dependency_libs="$temp_xrpath $dependency_libs"
fi
fi
# Make sure dlfiles contains only unique files that won't be dlpreopened
old_dlfiles="$dlfiles"
dlfiles=
for lib in $old_dlfiles; do
case " $dlprefiles $dlfiles " in
*" $lib "*) ;;
*) dlfiles="$dlfiles $lib" ;;
esac
done
# Make sure dlprefiles contains only unique files
old_dlprefiles="$dlprefiles"
dlprefiles=
for lib in $old_dlprefiles; do
case "$dlprefiles " in
*" $lib "*) ;;
*) dlprefiles="$dlprefiles $lib" ;;
esac
done
if test "$build_libtool_libs" = yes; then
if test -n "$rpath"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
# these systems don't actually have a c library (as such)!
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
deplibs="$deplibs -framework System"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
*-*-freebsd*-gnu*)
# Prevent $arg from being parsed by the freebsd regexp below.
if test "$build_libtool_need_lc" = "yes"; then
deplibs="$deplibs -lc"
fi
;;
*-*-openbsd* | *-*-freebsd*)
# Do not include libc due to us having libc/libc_r.
test "X$arg" = "X-lc" && continue
;;
*)
# Add libc to deplibs on all other systems if necessary.
if test "$build_libtool_need_lc" = "yes"; then
deplibs="$deplibs -lc"
fi
;;
esac
fi
# Transform deplibs into only deplibs that can be linked in shared.
name_save=$name
libname_save=$libname
release_save=$release
versuffix_save=$versuffix
major_save=$major
# I'm not sure if I'm treating the release correctly. I think
# release should show up in the -l (ie -lgmp5) so we don't want to
# add it in twice. Is that correct?
release=""
versuffix=""
major=""
newdeplibs=
droppeddeps=no
case $deplibs_check_method in
pass_all)
# Don't check for shared/static. Everything works.
# This might be a little naive. We might want to check
# whether the library exists or not. But this is on
# osf3 & osf4 and I'm not really sure... Just
# implementing what was already the behavior.
newdeplibs=$deplibs
;;
test_compile)
# This code stresses the "libraries are programs" paradigm to its
# limits. Maybe even breaks it. We compile a program, linking it
# against the deplibs as a proxy for the library. Then we can check
# whether they linked in statically or dynamically with ldd.
$rm conftest.c
cat > conftest.c <<EOF
int main() { return 0; }
EOF
$rm conftest
$LTCC -o conftest conftest.c $deplibs
if test "$?" -eq 0 ; then
ldd_output=`ldd conftest`
for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test "$name" != "" && test "$name" -ne "0"; then
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
newdeplibs="$newdeplibs $i"
i=""
;;
esac
fi
if test -n "$i" ; then
libname=`eval \\$echo \"$libname_spec\"`
deplib_matches=`eval \\$echo \"$library_names_spec\"`
set dummy $deplib_matches
deplib_match=$2
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
newdeplibs="$newdeplibs $i"
else
droppeddeps=yes
$echo
$echo "*** Warning: dynamic linker does not accept needed library $i."
$echo "*** I have the capability to make that library automatically link in when"
$echo "*** you link to this library. But I can only do this if you have a"
$echo "*** shared version of the library, which I believe you do not have"
$echo "*** because a test_compile did reveal that the linker did not use it for"
$echo "*** its dynamic dependency list that programs get resolved with at runtime."
fi
fi
else
newdeplibs="$newdeplibs $i"
fi
done
else
# Error occurred in the first compile. Let's try to salvage
# the situation: Compile a separate program for each library.
for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test "$name" != "" && test "$name" != "0"; then
$rm conftest
$LTCC -o conftest conftest.c $i
# Did it work?
if test "$?" -eq 0 ; then
ldd_output=`ldd conftest`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
newdeplibs="$newdeplibs $i"
i=""
;;
esac
fi
if test -n "$i" ; then
libname=`eval \\$echo \"$libname_spec\"`
deplib_matches=`eval \\$echo \"$library_names_spec\"`
set dummy $deplib_matches
deplib_match=$2
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
newdeplibs="$newdeplibs $i"
else
droppeddeps=yes
$echo
$echo "*** Warning: dynamic linker does not accept needed library $i."
$echo "*** I have the capability to make that library automatically link in when"
$echo "*** you link to this library. But I can only do this if you have a"
$echo "*** shared version of the library, which you do not appear to have"
$echo "*** because a test_compile did reveal that the linker did not use this one"
$echo "*** as a dynamic dependency that programs can get resolved with at runtime."
fi
fi
else
droppeddeps=yes
$echo
$echo "*** Warning! Library $i is needed by this library but I was not able to"
$echo "*** make it link in! You will probably need to install it or some"
$echo "*** library that it depends on before this library will be fully"
$echo "*** functional. Installing it before continuing would be even better."
fi
else
newdeplibs="$newdeplibs $i"
fi
done
fi
;;
file_magic*)
set dummy $deplibs_check_method
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
for a_deplib in $deplibs; do
name="`expr $a_deplib : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test "$name" != "" && test "$name" != "0"; then
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $a_deplib "*)
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
;;
esac
fi
if test -n "$a_deplib" ; then
libname=`eval \\$echo \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
# Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null \
| grep " -> " >/dev/null; then
continue
fi
# The statement above tries to avoid entering an
# endless loop below, in case of cyclic links.
# We might still enter an endless loop, since a link
# loop can be closed while we follow links,
# but so what?
potlib="$potent_lib"
while test -h "$potlib" 2>/dev/null; do
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
| ${SED} 10q \
| $EGREP "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
done
done
fi
if test -n "$a_deplib" ; then
droppeddeps=yes
$echo
$echo "*** Warning: linker path does not have real file for library $a_deplib."
$echo "*** I have the capability to make that library automatically link in when"
$echo "*** you link to this library. But I can only do this if you have a"
$echo "*** shared version of the library, which you do not appear to have"
$echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
$echo "*** with $libname but no candidates were found. (...for file magic test)"
else
$echo "*** with $libname and none of the candidates passed a file format test"
$echo "*** using a file magic. Last file checked: $potlib"
fi
fi
else
# Add a -L argument.
newdeplibs="$newdeplibs $a_deplib"
fi
done # Gone through all deplibs.
;;
match_pattern*)
set dummy $deplibs_check_method
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
for a_deplib in $deplibs; do
name="`expr $a_deplib : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $a_deplib "*)
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
;;
esac
fi
if test -n "$a_deplib" ; then
libname=`eval \\$echo \"$libname_spec\"`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
potlib="$potent_lib" # see symlink-check above in file_magic test
if eval $echo \"$potent_lib\" 2>/dev/null \
| ${SED} 10q \
| $EGREP "$match_pattern_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
done
done
fi
if test -n "$a_deplib" ; then
droppeddeps=yes
$echo
$echo "*** Warning: linker path does not have real file for library $a_deplib."
$echo "*** I have the capability to make that library automatically link in when"
$echo "*** you link to this library. But I can only do this if you have a"
$echo "*** shared version of the library, which you do not appear to have"
$echo "*** because I did check the linker path looking for a file starting"
if test -z "$potlib" ; then
$echo "*** with $libname but no candidates were found. (...for regex pattern test)"
else
$echo "*** with $libname and none of the candidates passed a file format test"
$echo "*** using a regex pattern. Last file checked: $potlib"
fi
fi
else
# Add a -L argument.
newdeplibs="$newdeplibs $a_deplib"
fi
done # Gone through all deplibs.
;;
none | unknown | *)
newdeplibs=""
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-e 's/ -[LR][^ ]*//g'`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
for i in $predeps $postdeps ; do
# can't use Xsed below, because $i might contain '/'
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
done
fi
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
| grep . >/dev/null; then
$echo
if test "X$deplibs_check_method" = "Xnone"; then
$echo "*** Warning: inter-library dependencies are not supported in this platform."
else
$echo "*** Warning: inter-library dependencies are not known to be supported."
fi
$echo "*** All declared inter-library dependencies are being dropped."
droppeddeps=yes
fi
;;
esac
versuffix=$versuffix_save
major=$major_save
release=$release_save
libname=$libname_save
name=$name_save
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library is the System framework
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
;;
esac
if test "$droppeddeps" = yes; then
if test "$module" = yes; then
$echo
$echo "*** Warning: libtool could not satisfy all declared inter-library"
$echo "*** dependencies of module $libname. Therefore, libtool will create"
$echo "*** a static module, that should work as long as the dlopening"
$echo "*** application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then
$echo
$echo "*** However, this would only work if libtool was able to extract symbol"
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
$echo "*** not find such a program. So, this module is probably useless."
$echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
else
$echo "*** The inter-library dependencies that have been dropped here will be"
$echo "*** automatically added whenever a program is linked with this library"
$echo "*** or is declared to -dlopen it."
if test "$allow_undefined" = no; then
$echo
$echo "*** Since this library must not contain undefined symbols,"
$echo "*** because either the platform does not support them or"
$echo "*** it was explicitly requested with -no-undefined,"
$echo "*** libtool will only create a static version of it."
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
build_old_libs=yes
else
build_libtool_libs=no
fi
fi
fi
fi
# Done checking deplibs!
deplibs=$newdeplibs
fi
# All the library-specific variables (install_libdir is set above).
library_names=
old_library=
dlname=
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
if test "$hardcode_into_libs" = yes; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
rpath="$finalize_rpath"
test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
dep_rpath="$dep_rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
if test -n "$hardcode_libdir_flag_spec_ld"; then
eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
else
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
fi
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
rpath="$rpath$dir:"
done
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
fi
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
fi
shlibpath="$finalize_shlibpath"
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
# Get the real and link names of the library.
eval shared_ext=\"$shrext\"
eval library_names=\"$library_names_spec\"
set dummy $library_names
realname="$2"
shift; shift
if test -n "$soname_spec"; then
eval soname=\"$soname_spec\"
else
soname="$realname"
fi
if test -z "$dlname"; then
dlname=$soname
fi
lib="$output_objdir/$realname"
for link
do
linknames="$linknames $link"
done
# Use standard objects if they are pic
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
$show "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
$run $rm $export_symbols
eval cmds=\"$export_symbols_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
if len=`expr "X$cmd" : ".*"` &&
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
$show "$cmd"
$run eval "$cmd" || exit $?
skipped_export=false
else
# The command line is too long to execute in one step.
$show "using reloadable object file for export list..."
skipped_export=:
fi
done
IFS="$save_ifs"
if test -n "$export_symbols_regex"; then
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
$run eval '$mv "${export_symbols}T" "$export_symbols"'
fi
fi
fi
if test -n "$export_symbols" && test -n "$include_expsyms"; then
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
fi
tmp_deplibs=
for test_deplib in $deplibs; do
case " $convenience " in
*" $test_deplib "*) ;;
*)
tmp_deplibs="$tmp_deplibs $test_deplib"
;;
esac
done
deplibs="$tmp_deplibs"
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
save_libobjs=$libobjs
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
else
gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "$mkdir $gentop"
$run $mkdir "$gentop"
status=$?
if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
for xlib in $convenience; do
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "$mkdir $xdir"
$run $mkdir "$xdir"
status=$?
if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
# We will extract separately just the conflicting names and we will no
# longer touch any unique names. It is faster to leave these extract
# automatically by $AR in one run.
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
:
else
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
$AR t "$xabs" | sort | uniq -cd | while read -r count name
do
i=1
while test "$i" -le "$count"
do
# Put our $i before any first dot (extension)
# Never overwrite any file
name_to="$name"
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
do
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
done
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
i=`expr $i + 1`
done
done
fi
libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
done
fi
fi
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
linker_flags="$linker_flags $flag"
fi
# Make a backup of the uninstalled library when relinking
if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
fi
# Add all flags from the command line. We here create a library,
# but those flags were only added to compile_command and
# finalize_command, which are only used when creating executables.
# So do it by hand here.
compiler_flags="$compiler_flags $add_flags"
# Only add it to commands which use CC, instead of LD, i.e.
# only to $compiler_flags
#linker_flags="$linker_flags $add_flags"
# Do each of the archive commands.
if test "$module" = yes && test -n "$module_cmds" ; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
eval cmds=\"$module_expsym_cmds\"
else
eval cmds=\"$module_cmds\"
fi
else
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval cmds=\"$archive_expsym_cmds\"
else
eval cmds=\"$archive_cmds\"
fi
fi
if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
:
else
# The command line is too long to link in one step, link piecewise.
$echo "creating reloadable object files..."
# Save the value of $output and $libobjs because we want to
# use them later. If we have whole_archive_flag_spec, we
# want to use save_libobjs as it was before
# whole_archive_flag_spec was expanded, because we can't
# assume the linker understands whole_archive_flag_spec.
# This may have to be revisited, in case too many
# convenience libraries get linked in and end up exceeding
# the spec.
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
save_libobjs=$libobjs
fi
save_output=$output
# Clear the reloadable object creation command queue and
# initialize k to one.
test_cmds=
concat_cmds=
objlist=
delfiles=
last_robj=
k=1
output=$output_objdir/$save_output-${k}.$objext
# Loop over the list of objects to be linked.
for obj in $save_libobjs
do
eval test_cmds=\"$reload_cmds $objlist $last_robj\"
if test "X$objlist" = X ||
{ len=`expr "X$test_cmds" : ".*"` &&
test "$len" -le "$max_cmd_len"; }; then
objlist="$objlist $obj"
else
# The command $test_cmds is almost too long, add a
# command to the queue.
if test "$k" -eq 1 ; then
# The first file doesn't have a previous command to add.
eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
else
# All subsequent reloadable object files will link in
# the last one created.
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
fi
last_robj=$output_objdir/$save_output-${k}.$objext
k=`expr $k + 1`
output=$output_objdir/$save_output-${k}.$objext
objlist=$obj
len=1
fi
done
# Handle the remaining objects by creating one last
# reloadable object file. All subsequent reloadable object
# files will link in the last one created.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
if ${skipped_export-false}; then
$show "generating symbol list for \`$libname.la'"
export_symbols="$output_objdir/$libname.exp"
$run $rm $export_symbols
libobjs=$output
# Append the command to create the export file.
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
fi
# Set up a command to remove the reloadale object files
# after they are used.
i=0
while test "$i" -lt "$k"
do
i=`expr $i + 1`
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
done
$echo "creating a temporary reloadable object file: $output"
# Loop through the commands generated above and execute them.
save_ifs="$IFS"; IFS='~'
for cmd in $concat_cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
libobjs=$output
# Restore the value of output.
output=$save_output
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
fi
# Expand the library linking commands again to reset the
# value of $libobjs for piecewise linking.
# Do each of the archive commands.
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval cmds=\"$archive_expsym_cmds\"
else
eval cmds=\"$archive_cmds\"
fi
# Append the command to remove the reloadable object files
# to the just-reset $cmds.
eval cmds=\"\$cmds~$rm $delfiles\"
fi
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
# Restore the uninstalled library and exit
if test "$mode" = relink; then
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
exit 0
fi
# Create links to the real library.
for linkname in $linknames; do
if test "$realname" != "$linkname"; then
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
fi
done
# If -module or -export-dynamic was specified, set the dlname.
if test "$module" = yes || test "$export_dynamic" = yes; then
# On all known operating systems, these are identical.
dlname="$soname"
fi
fi
;;
obj)
if test -n "$deplibs"; then
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
fi
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
fi
if test -n "$rpath"; then
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
fi
if test -n "$xrpath"; then
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
fi
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
fi
case $output in
*.lo)
if test -n "$objs$old_deplibs"; then
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
exit 1
fi
libobj="$output"
obj=`$echo "X$output" | $Xsed -e "$lo2o"`
;;
*)
libobj=
obj="$output"
;;
esac
# Delete the old objects.
$run $rm $obj $libobj
# Objects from convenience libraries. This assumes
# single-version convenience libraries. Whenever we create
# different ones for PIC/non-PIC, this we'll have to duplicate
# the extraction.
reload_conv_objs=
gentop=
# reload_cmds runs $LD directly, so let us get rid of
# -Wl from whole_archive_flag_spec
wl=
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
else
gentop="$output_objdir/${obj}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "$mkdir $gentop"
$run $mkdir "$gentop"
status=$?
if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
for xlib in $convenience; do
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "$mkdir $xdir"
$run $mkdir "$xdir"
status=$?
if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
# We will extract separately just the conflicting names and we will no
# longer touch any unique names. It is faster to leave these extract
# automatically by $AR in one run.
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
:
else
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
$AR t "$xabs" | sort | uniq -cd | while read -r count name
do
i=1
while test "$i" -le "$count"
do
# Put our $i before any first dot (extension)
# Never overwrite any file
name_to="$name"
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
do
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
done
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
i=`expr $i + 1`
done
done
fi
reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
done
fi
fi
# Create the old-style object.
reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
output="$obj"
eval cmds=\"$reload_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
# Exit if we aren't doing a library object file.
if test -z "$libobj"; then
if test -n "$gentop"; then
$show "${rm}r $gentop"
$run ${rm}r $gentop
fi
exit 0
fi
if test "$build_libtool_libs" != yes; then
if test -n "$gentop"; then
$show "${rm}r $gentop"
$run ${rm}r $gentop
fi
# Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program.
# $show "echo timestamp > $libobj"
# $run eval "echo timestamp > $libobj" || exit $?
exit 0
fi
if test -n "$pic_flag" || test "$pic_mode" != default; then
# Only do commands if we really have different PIC objects.
reload_objs="$libobjs $reload_conv_objs"
output="$libobj"
eval cmds=\"$reload_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
if test -n "$gentop"; then
$show "${rm}r $gentop"
$run ${rm}r $gentop
fi
exit 0
;;
prog)
case $host in
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
esac
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
fi
if test -n "$release"; then
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
fi
if test "$preload" = yes; then
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
test "$dlopen_self_static" = unknown; then
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
fi
fi
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
# On Rhapsody replace the C library is the System framework
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
;;
esac
case $host in
*darwin*)
# Don't allow lazy linking, it breaks C++ global constructors
if test "$tagname" = CXX ; then
compile_command="$compile_command ${wl}-bind_at_load"
finalize_command="$finalize_command ${wl}-bind_at_load"
fi
;;
esac
compile_command="$compile_command $compile_deplibs"
finalize_command="$finalize_command $finalize_deplibs"
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
for libdir in $rpath $xrpath; do
# This is the magic to use -rpath.
case "$finalize_rpath " in
*" $libdir "*) ;;
*) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
fi
# Now hardcode the library paths
rpath=
hardcode_libdirs=
for libdir in $compile_rpath $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
case :$dllsearchpath: in
*":$libdir:"*) ;;
*) dllsearchpath="$dllsearchpath:$libdir";;
esac
;;
esac
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
compile_rpath="$rpath"
rpath=
hardcode_libdirs=
for libdir in $finalize_rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
rpath="$rpath $flag"
fi
elif test -n "$runpath_var"; then
case "$finalize_perm_rpath " in
*" $libdir "*) ;;
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
esac
fi
done
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
finalize_rpath="$rpath"
if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
fi
dlsyms=
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
if test -n "$NM" && test -n "$global_symbol_pipe"; then
dlsyms="${outputname}S.c"
else
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
fi
fi
if test -n "$dlsyms"; then
case $dlsyms in
"") ;;
*.c)
# Discover the nlist of each of the dlfiles.
nlist="$output_objdir/${outputname}.nm"
$show "$rm $nlist ${nlist}S ${nlist}T"
$run $rm "$nlist" "${nlist}S" "${nlist}T"
# Parse the name list into a source file.
$show "creating $output_objdir/$dlsyms"
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
#ifdef __cplusplus
extern \"C\" {
#endif
/* Prevent the only kind of declaration conflicts we can make. */
#define lt_preloaded_symbols some_other_symbol
/* External symbol declarations for the compiler. */\
"
if test "$dlself" = yes; then
$show "generating symbol list for \`$output'"
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
# Add our own program objects to the symbol list.
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
for arg in $progfiles; do
$show "extracting global C symbols from \`$arg'"
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done
if test -n "$exclude_expsyms"; then
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
$run eval '$mv "$nlist"T "$nlist"'
fi
if test -n "$export_symbols_regex"; then
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
$run eval '$mv "$nlist"T "$nlist"'
fi
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
export_symbols="$output_objdir/$output.exp"
$run $rm $export_symbols
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
$run eval 'mv "$nlist"T "$nlist"'
fi
fi
for arg in $dlprefiles; do
$show "extracting global C symbols from \`$arg'"
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
$run eval '$echo ": $name " >> "$nlist"'
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done
if test -z "$run"; then
# Make sure we have at least an empty file.
test -f "$nlist" || : > "$nlist"
if test -n "$exclude_expsyms"; then
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
$mv "$nlist"T "$nlist"
fi
# Try sorting and uniquifying the output.
if grep -v "^: " < "$nlist" |
if sort -k 3 </dev/null >/dev/null 2>&1; then
sort -k 3
else
sort +2
fi |
uniq > "$nlist"S; then
:
else
grep -v "^: " < "$nlist" > "$nlist"S
fi
if test -f "$nlist"S; then
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
else
$echo '/* NONE */' >> "$output_objdir/$dlsyms"
fi
$echo >> "$output_objdir/$dlsyms" "\
#undef lt_preloaded_symbols
#if defined (__STDC__) && __STDC__
# define lt_ptr void *
#else
# define lt_ptr char *
# define const
#endif
/* The mapping between symbol names and symbols. */
const struct {
const char *name;
lt_ptr address;
}
lt_preloaded_symbols[] =
{\
"
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
$echo >> "$output_objdir/$dlsyms" "\
{0, (lt_ptr) 0}
};
/* This works around a problem in FreeBSD linker */
#ifdef FREEBSD_WORKAROUND
static const void *lt_preloaded_setup() {
return lt_preloaded_symbols;
}
#endif
#ifdef __cplusplus
}
#endif\
"
fi
pic_flag_for_symtable=
case $host in
# compiling the symbol table file with pic_flag works around
# a FreeBSD bug that causes programs to crash when -lm is
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
esac;;
*-*-hpux*)
case "$compile_command " in
*" -static "*) ;;
*) pic_flag_for_symtable=" $pic_flag";;
esac
esac
# Now compile the dynamic symbol file.
$show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
# Clean up the generated files.
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
# Transform the symbol file into the correct name.
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
;;
*)
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
exit 1
;;
esac
else
# We keep going just in case the user didn't refer to
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe
# really was required.
# Nullify the symbol file.
compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
# AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
# Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
# Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
# This does not apply on AIX for ia64, which uses a SysV linker.
case "$host" in
ia64-*-aix5*) ;;
*-*-aix4* | *-*-aix5*)
compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
esac
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
$show "$link_command"
$run eval "$link_command"
status=$?
# Delete the generated files.
if test -n "$dlsyms"; then
$show "$rm $output_objdir/${outputname}S.${objext}"
$run $rm "$output_objdir/${outputname}S.${objext}"
fi
exit $status
fi
if test -n "$shlibpath_var"; then
# We should set the shlibpath_var
rpath=
for dir in $temp_rpath; do
case $dir in
[\\/]* | [A-Za-z]:[\\/]*)
# Absolute path.
rpath="$rpath$dir:"
;;
*)
# Relative path: add a thisdir entry.
rpath="$rpath\$thisdir/$dir:"
;;
esac
done
temp_rpath="$rpath"
fi
if test -n "$compile_shlibpath$finalize_shlibpath"; then
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
fi
if test -n "$finalize_shlibpath"; then
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
fi
compile_var=
finalize_var=
if test -n "$runpath_var"; then
if test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
rpath="$rpath$dir:"
done
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
if test -n "$finalize_perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $finalize_perm_rpath; do
rpath="$rpath$dir:"
done
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
fi
if test "$no_install" = yes; then
# We don't need to create a wrapper script.
link_command="$compile_var$compile_command$compile_rpath"
# Replace the output file specification.
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
# Delete the old output file.
$run $rm $output
# Link the executable and exit
$show "$link_command"
$run eval "$link_command" || exit $?
exit 0
fi
if test "$hardcode_action" = relink; then
# Fast installation is not supported
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
$echo "$modename: \`$output' will be relinked during installation" 1>&2
else
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
else
# fast_install is set to needless
relink_command=
fi
else
link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath"
fi
fi
# Replace the output file specification.
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
# Delete the old output files.
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
$show "$link_command"
$run eval "$link_command" || exit $?
# Now create the wrapper script.
$show "creating $output"
# Quote the relink command for shipping.
if test -n "$relink_command"; then
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
relink_command="$var=\"$var_value\"; export $var; $relink_command"
fi
done
relink_command="(cd `pwd`; $relink_command)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
fi
# Quote $echo for shipping.
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
case $0 in
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
esac
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
else
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
fi
# Only actually do things if our run command is non-null.
if test -z "$run"; then
# win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here.
case $output in
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
esac
# test for cygwin because mv fails w/o .exe extensions
case $host in
*cygwin*)
exeext=.exe
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
*) exeext= ;;
esac
case $host in
*cygwin* | *mingw* )
cwrappersource=`$echo ${objdir}/lt-${output}.c`
cwrapper=`$echo ${output}.exe`
$rm $cwrappersource $cwrapper
trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
cat > $cwrappersource <<EOF
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
The $output program cannot be directly executed until all the libtool
libraries that it depends on are installed.
This wrapper executable should never be moved out of the build directory.
If it is, it will not operate correctly.
Currently, it simply execs the wrapper *script* "/bin/sh $output",
but could eventually absorb all of the scripts functionality and
exec $objdir/$outputname directly.
*/
EOF
cat >> $cwrappersource<<"EOF"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <malloc.h>
#include <stdarg.h>
#include <assert.h>
#if defined(PATH_MAX)
# define LT_PATHMAX PATH_MAX
#elif defined(MAXPATHLEN)
# define LT_PATHMAX MAXPATHLEN
#else
# define LT_PATHMAX 1024
#endif
#ifndef DIR_SEPARATOR
#define DIR_SEPARATOR '/'
#endif
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
defined (__OS2__)
#define HAVE_DOS_BASED_FILE_SYSTEM
#ifndef DIR_SEPARATOR_2
#define DIR_SEPARATOR_2 '\\'
#endif
#endif
#ifndef DIR_SEPARATOR_2
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
#else /* DIR_SEPARATOR_2 */
# define IS_DIR_SEPARATOR(ch) \
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
#endif /* DIR_SEPARATOR_2 */
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
#define XFREE(stale) do { \
if (stale) { free ((void *) stale); stale = 0; } \
} while (0)
const char *program_name = NULL;
void * xmalloc (size_t num);
char * xstrdup (const char *string);
char * basename (const char *name);
char * fnqualify(const char *path);
char * strendzap(char *str, const char *pat);
void lt_fatal (const char *message, ...);
int
main (int argc, char *argv[])
{
char **newargz;
int i;
program_name = (char *) xstrdup ((char *) basename (argv[0]));
newargz = XMALLOC(char *, argc+2);
EOF
cat >> $cwrappersource <<EOF
newargz[0] = "$SHELL";
EOF
cat >> $cwrappersource <<"EOF"
newargz[1] = fnqualify(argv[0]);
/* we know the script has the same name, without the .exe */
/* so make sure newargz[1] doesn't end in .exe */
strendzap(newargz[1],".exe");
for (i = 1; i < argc; i++)
newargz[i+1] = xstrdup(argv[i]);
newargz[argc+1] = NULL;
EOF
cat >> $cwrappersource <<EOF
execv("$SHELL",newargz);
EOF
cat >> $cwrappersource <<"EOF"
}
void *
xmalloc (size_t num)
{
void * p = (void *) malloc (num);
if (!p)
lt_fatal ("Memory exhausted");
return p;
}
char *
xstrdup (const char *string)
{
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
;
}
char *
basename (const char *name)
{
const char *base;
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
/* Skip over the disk name in MSDOS pathnames. */
if (isalpha (name[0]) && name[1] == ':')
name += 2;
#endif
for (base = name; *name; name++)
if (IS_DIR_SEPARATOR (*name))
base = name + 1;
return (char *) base;
}
char *
fnqualify(const char *path)
{
size_t size;
char *p;
char tmp[LT_PATHMAX + 1];
assert(path != NULL);
/* Is it qualified already? */
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
if (isalpha (path[0]) && path[1] == ':')
return xstrdup (path);
#endif
if (IS_DIR_SEPARATOR (path[0]))
return xstrdup (path);
/* prepend the current directory */
/* doesn't handle '~' */
if (getcwd (tmp, LT_PATHMAX) == NULL)
lt_fatal ("getcwd failed");
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
p = XMALLOC(char, size);
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
return p;
}
char *
strendzap(char *str, const char *pat)
{
size_t len, patlen;
assert(str != NULL);
assert(pat != NULL);
len = strlen(str);
patlen = strlen(pat);
if (patlen <= len)
{
str += len - patlen;
if (strcmp(str, pat) == 0)
*str = '\0';
}
return str;
}
static void
lt_error_core (int exit_status, const char * mode,
const char * message, va_list ap)
{
fprintf (stderr, "%s: %s: ", program_name, mode);
vfprintf (stderr, message, ap);
fprintf (stderr, ".\n");
if (exit_status >= 0)
exit (exit_status);
}
void
lt_fatal (const char *message, ...)
{
va_list ap;
va_start (ap, message);
lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
va_end (ap);
}
EOF
# we should really use a build-platform specific compiler
# here, but OTOH, the wrappers (shell script and this C one)
# are only useful if you want to execute the "real" binary.
# Since the "real" binary is built for $host, then this
# wrapper might as well be built for $host, too.
$run $LTCC -s -o $cwrapper $cwrappersource
;;
esac
$rm $output
trap "$rm $output; exit 1" 1 2 15
$echo > $output "\
#! $SHELL
# $output - temporary wrapper script for $objdir/$outputname
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
#
# The $output program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
#
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed='${SED} -e 1s/^X//'
sed_quote_subst='$sed_quote_subst'
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
relink_command=\"$relink_command\"
# This environment variable determines our operation mode.
if test \"\$libtool_install_magic\" = \"$magic\"; then
# install mode needs the following variable:
notinst_deplibs='$notinst_deplibs'
else
# When we are sourced in execute mode, \$file and \$echo are already set.
if test \"\$libtool_execute_magic\" != \"$magic\"; then
echo=\"$qecho\"
file=\"\$0\"
# Make sure echo works.
if test \"X\$1\" = X--no-reexec; then
# Discard the --no-reexec flag, and continue.
shift
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
# Yippee, \$echo works!
:
else
# Restart under the correct shell, and then maybe \$echo will work.
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
fi
fi\
"
$echo >> $output "\
# Find the directory that this script lives in.
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
while test -n \"\$file\"; do
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
# If there was a directory component, then change thisdir.
if test \"x\$destdir\" != \"x\$file\"; then
case \"\$destdir\" in
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
*) thisdir=\"\$thisdir/\$destdir\" ;;
esac
fi
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
done
# Try to get the absolute directory name.
absdir=\`cd \"\$thisdir\" && pwd\`
test -n \"\$absdir\" && thisdir=\"\$absdir\"
"
if test "$fast_install" = yes; then
$echo >> $output "\
program=lt-'$outputname'$exeext
progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" || \\
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
file=\"\$\$-\$program\"
if test ! -d \"\$progdir\"; then
$mkdir \"\$progdir\"
else
$rm \"\$progdir/\$file\"
fi"
$echo >> $output "\
# relink executable if necessary
if test -n \"\$relink_command\"; then
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
else
$echo \"\$relink_command_output\" >&2
$rm \"\$progdir/\$file\"
exit 1
fi
fi
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
{ $rm \"\$progdir/\$program\";
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
$rm \"\$progdir/\$file\"
fi"
else
$echo >> $output "\
program='$outputname'
progdir=\"\$thisdir/$objdir\"
"
fi
$echo >> $output "\
if test -f \"\$progdir/\$program\"; then"
# Export our shlibpath_var if we have one.
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$echo >> $output "\
# Add our own library path to $shlibpath_var
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
# Some systems cannot cope with colon-terminated $shlibpath_var
# The second colon is a workaround for a bug in BeOS R4 sed
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
export $shlibpath_var
"
fi
# fixup the dll searchpath if we need to.
if test -n "$dllsearchpath"; then
$echo >> $output "\
# Add the dll search path components to the executable PATH
PATH=$dllsearchpath:\$PATH
"
fi
$echo >> $output "\
if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Run the actual program with our arguments.
"
case $host in
# Backslashes separate directories on plain windows
*-*-mingw | *-*-os2*)
$echo >> $output "\
exec \$progdir\\\\\$program \${1+\"\$@\"}
"
;;
*)
$echo >> $output "\
exec \$progdir/\$program \${1+\"\$@\"}
"
;;
esac
$echo >> $output "\
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
exit 1
fi
else
# The program doesn't exist.
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
\$echo \"This script is just a wrapper for \$program.\" 1>&2
$echo \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1
fi
fi\
"
chmod +x $output
fi
exit 0
;;
esac
# See if we need to build an old-fashioned archive.
for oldlib in $oldlibs; do
if test "$build_libtool_libs" = convenience; then
oldobjs="$libobjs_save"
addlibs="$convenience"
build_libtool_libs=no
else
if test "$build_libtool_libs" = module; then
oldobjs="$libobjs_save"
build_libtool_libs=no
else
oldobjs="$old_deplibs $non_pic_objects"
fi
addlibs="$old_convenience"
fi
if test -n "$addlibs"; then
gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
$show "$mkdir $gentop"
$run $mkdir "$gentop"
status=$?
if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
# Add in members from convenience archives.
for xlib in $addlibs; do
# Extract the objects.
case $xlib in
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
*) xabs=`pwd`"/$xlib" ;;
esac
xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
xdir="$gentop/$xlib"
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
$show "$mkdir $xdir"
$run $mkdir "$xdir"
status=$?
if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
# We will extract separately just the conflicting names and we will no
# longer touch any unique names. It is faster to leave these extract
# automatically by $AR in one run.
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
:
else
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2
$AR t "$xabs" | sort | uniq -cd | while read -r count name
do
i=1
while test "$i" -le "$count"
do
# Put our $i before any first dot (extension)
# Never overwrite any file
name_to="$name"
while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
do
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
done
$show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
$run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
i=`expr $i + 1`
done
done
fi
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
done
fi
compiler_flags="$compiler_flags $add_flags"
# Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\"
else
eval cmds=\"$old_archive_cmds\"
if len=`expr "X$cmds" : ".*"` &&
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
:
else
# the command line is too long to link in one step, link in parts
$echo "using piecewise archive linking..."
save_RANLIB=$RANLIB
RANLIB=:
objlist=
concat_cmds=
save_oldobjs=$oldobjs
# GNU ar 2.10+ was changed to match POSIX; thus no paths are
# encoded into archives. This makes 'ar r' malfunction in
# this piecewise linking case whenever conflicting object
# names appear in distinct ar calls; check, warn and compensate.
if (for obj in $save_oldobjs
do
$echo "X$obj" | $Xsed -e 's%^.*/%%'
done | sort | sort -uc >/dev/null 2>&1); then
:
else
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
AR_FLAGS=cq
fi
# Is there a better way of finding the last object in the list?
for obj in $save_oldobjs
do
last_oldobj=$obj
done
for obj in $save_oldobjs
do
oldobjs="$objlist $obj"
objlist="$objlist $obj"
eval test_cmds=\"$old_archive_cmds\"
if len=`expr "X$test_cmds" : ".*"` &&
test "$len" -le "$max_cmd_len"; then
:
else
# the above command should be used before it gets too long
oldobjs=$objlist
if test "$obj" = "$last_oldobj" ; then
RANLIB=$save_RANLIB
fi
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
objlist=
fi
done
RANLIB=$save_RANLIB
oldobjs=$objlist
if test "X$oldobjs" = "X" ; then
eval cmds=\"\$concat_cmds\"
else
eval cmds=\"\$concat_cmds~$old_archive_cmds\"
fi
fi
fi
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
done
if test -n "$generated"; then
$show "${rm}r$generated"
$run ${rm}r$generated
fi
# Now create the libtool archive.
case $output in
*.la)
old_library=
test "$build_old_libs" = yes && old_library="$libname.$libext"
$show "creating $output"
# Preserve any variables that may affect compiler behavior
for var in $variables_saved_for_relink; do
if eval test -z \"\${$var+set}\"; then
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
relink_command="$var=\"$var_value\"; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
# Only create the output if not a dry run.
if test -z "$run"; then
for installed in no yes; do
if test "$installed" = yes; then
if test -z "$install_libdir"; then
break
fi
output="$output_objdir/$outputname"i
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
case $deplib in
*.la)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
fi
newdependency_libs="$newdependency_libs $libdir/$name"
;;
*) newdependency_libs="$newdependency_libs $deplib" ;;
esac
done
dependency_libs="$newdependency_libs"
newdlfiles=
for lib in $dlfiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
fi
newdlfiles="$newdlfiles $libdir/$name"
done
dlfiles="$newdlfiles"
newdlprefiles=
for lib in $dlprefiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
fi
newdlprefiles="$newdlprefiles $libdir/$name"
done
dlprefiles="$newdlprefiles"
fi
$rm $output
# place dlname in correct position for cygwin
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac
$echo > $output "\
# $outputname - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='$tdlname'
# Names of this library.
library_names='$library_names'
# The name of the static archive.
old_library='$old_library'
# Libraries that this one depends upon.
dependency_libs='$dependency_libs'
# Version information for $libname.
current=$current
age=$age
revision=$revision
# Is this an already installed library?
installed=$installed
# Should we warn about portability when linking against -modules?
shouldnotlink=$module
# Files to dlopen/dlpreopen
dlopen='$dlfiles'
dlpreopen='$dlprefiles'
# Directory that this library needs to be installed in:
libdir='$install_libdir'"
if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then
$echo >> $output "\
relink_command=\"$relink_command\""
fi
done
fi
# Do a symbolic link so that the libtool archive can be found in
# LD_LIBRARY_PATH before the program is installed.
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
;;
esac
exit 0
;;
# libtool install mode
install)
modename="$modename: install"
# There may be an optional sh(1) argument at the beginning of
# install_prog (especially on Windows NT).
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
# Allow the use of GNU shtool's install command.
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
# Aesthetically quote it.
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$arg "
arg="$1"
shift
else
install_prog=
arg="$nonopt"
fi
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$install_prog$arg"
# We need to accept at least all the BSD install flags.
dest=
files=
opts=
prev=
install_type=
isdir=no
stripme=
for arg
do
if test -n "$dest"; then
files="$files $dest"
dest="$arg"
continue
fi
case $arg in
-d) isdir=yes ;;
-f) prev="-f" ;;
-g) prev="-g" ;;
-m) prev="-m" ;;
-o) prev="-o" ;;
-s)
stripme=" -s"
continue
;;
-*) ;;
*)
# If the previous option needed an argument, then skip it.
if test -n "$prev"; then
prev=
else
dest="$arg"
continue
fi
;;
esac
# Aesthetically quote the argument.
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
arg="\"$arg\""
;;
esac
install_prog="$install_prog $arg"
done
if test -z "$install_prog"; then
$echo "$modename: you must specify an install program" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test -n "$prev"; then
$echo "$modename: the \`$prev' option requires an argument" 1>&2
$echo "$help" 1>&2
exit 1
fi
if test -z "$files"; then
if test -z "$dest"; then
$echo "$modename: no file or destination specified" 1>&2
else
$echo "$modename: you must specify a destination" 1>&2
fi
$echo "$help" 1>&2
exit 1
fi
# Strip any trailing slash from the destination.
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
# Check to see that the destination is a directory.
test -d "$dest" && isdir=yes
if test "$isdir" = yes; then
destdir="$dest"
destname=
else
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
test "X$destdir" = "X$dest" && destdir=.
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
# Not a directory, so check to see that there is only one file specified.
set dummy $files
if test "$#" -gt 2; then
$echo "$modename: \`$dest' is not a directory" 1>&2
$echo "$help" 1>&2
exit 1
fi
fi
case $destdir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
*)
for file in $files; do
case $file in
*.lo) ;;
*)
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
$echo "$help" 1>&2
exit 1
;;
esac
done
;;
esac
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
libtool_install_magic="$magic"
staticlibs=
future_libdirs=
current_libdirs=
for file in $files; do
# Do each installation.
case $file in
*.$libext)
# Do the static libraries later.
staticlibs="$staticlibs $file"
;;
*.la)
# Check to see that this really is a libtool archive.
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
exit 1
fi
library_names=
old_library=
relink_command=
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
# Add the libdir to current_libdirs if it is the destination.
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
*" $libdir "*) ;;
*) current_libdirs="$current_libdirs $libdir" ;;
esac
else
# Note the libdir as a future libdir.
case "$future_libdirs " in
*" $libdir "*) ;;
*) future_libdirs="$future_libdirs $libdir" ;;
esac
fi
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
test "X$dir" = "X$file/" && dir=
dir="$dir$objdir"
if test -n "$relink_command"; then
# Determine the prefix the user has applied to our future dir.
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
# Don't allow the user to place us outside of our expected
# location b/c this prevents finding dependent libraries that
# are installed to the same prefix.
# At present, this check doesn't affect windows .dll's that
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
if test "$inst_prefix_dir" = "$destdir"; then
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
exit 1
fi
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
else
relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
fi
$echo "$modename: warning: relinking \`$file'" 1>&2
$show "$relink_command"
if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
exit 1
fi
fi
# See the names of the shared library.
set dummy $library_names
if test -n "$2"; then
realname="$2"
shift
shift
srcname="$realname"
test -n "$relink_command" && srcname="$realname"T
# Install the shared library and build the symlinks.
$show "$install_prog $dir/$srcname $destdir/$realname"
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
if test -n "$stripme" && test -n "$striplib"; then
$show "$striplib $destdir/$realname"
$run eval "$striplib $destdir/$realname" || exit $?
fi
if test "$#" -gt 0; then
# Delete the old symlinks, and create new ones.
for linkname
do
if test "$linkname" != "$realname"; then
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
fi
done
fi
# Do each command in the postinstall commands.
lib="$destdir/$realname"
eval cmds=\"$postinstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
fi
# Install the pseudo-library for information purposes.
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
instname="$dir/$name"i
$show "$install_prog $instname $destdir/$name"
$run eval "$install_prog $instname $destdir/$name" || exit $?
# Maybe install the static library, too.
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
;;
*.lo)
# Install (i.e. copy) a libtool object.
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
destfile="$destdir/$destname"
else
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
destfile="$destdir/$destfile"
fi
# Deduce the name of the destination old-style object file.
case $destfile in
*.lo)
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
;;
*.$objext)
staticdest="$destfile"
destfile=
;;
*)
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
$echo "$help" 1>&2
exit 1
;;
esac
# Install the libtool object if requested.
if test -n "$destfile"; then
$show "$install_prog $file $destfile"
$run eval "$install_prog $file $destfile" || exit $?
fi
# Install the old object if enabled.
if test "$build_old_libs" = yes; then
# Deduce the name of the old-style object file.
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
$show "$install_prog $staticobj $staticdest"
$run eval "$install_prog \$staticobj \$staticdest" || exit $?
fi
exit 0
;;
*)
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
destfile="$destdir/$destname"
else
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
destfile="$destdir/$destfile"
fi
# If the file is missing, and there is a .exe on the end, strip it
# because it is most likely a libtool script we actually want to
# install
stripped_ext=""
case $file in
*.exe)
if test ! -f "$file"; then
file=`$echo $file|${SED} 's,.exe$,,'`
stripped_ext=".exe"
fi
;;
esac
# Do a test to see if this is really a libtool program.
case $host in
*cygwin*|*mingw*)
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
;;
*)
wrapper=$file
;;
esac
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
notinst_deplibs=
relink_command=
# To insure that "foo" is sourced, and not "foo.exe",
# finese the cygwin/MSYS system by explicitly sourcing "foo."
# which disallows the automatic-append-.exe behavior.
case $build in
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
*) wrapperdot=${wrapper} ;;
esac
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . ${wrapperdot} ;;
*) . ./${wrapperdot} ;;
esac
# Check the variables that should have been set.
if test -z "$notinst_deplibs"; then
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
exit 1
fi
finalize=yes
for lib in $notinst_deplibs; do
# Check to see that each library is installed.
libdir=
if test -f "$lib"; then
# If there is no directory component, then add one.
case $lib in
*/* | *\\*) . $lib ;;
*) . ./$lib ;;
esac
fi
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
if test -n "$libdir" && test ! -f "$libfile"; then
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
finalize=no
fi
done
relink_command=
# To insure that "foo" is sourced, and not "foo.exe",
# finese the cygwin/MSYS system by explicitly sourcing "foo."
# which disallows the automatic-append-.exe behavior.
case $build in
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
*) wrapperdot=${wrapper} ;;
esac
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . ${wrapperdot} ;;
*) . ./${wrapperdot} ;;
esac
outputname=
if test "$fast_install" = no && test -n "$relink_command"; then
if test "$finalize" = yes && test -z "$run"; then
tmpdir="/tmp"
test -n "$TMPDIR" && tmpdir="$TMPDIR"
tmpdir="$tmpdir/libtool-$$"
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
else
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
continue
fi
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
outputname="$tmpdir/$file"
# Replace the output file specification.
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
$show "$relink_command"
if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
${rm}r "$tmpdir"
continue
fi
file="$outputname"
else
$echo "$modename: warning: cannot relink \`$file'" 1>&2
fi
else
# Install the binary that we compiled earlier.
file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
fi
fi
# remove .exe since cygwin /usr/bin/install will append another
# one anyways
case $install_prog,$host in
*/usr/bin/install*,*cygwin*)
case $file:$destfile in
*.exe:*.exe)
# this is ok
;;
*.exe:*)
destfile=$destfile.exe
;;
*:*.exe)
destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
;;
esac
;;
esac
$show "$install_prog$stripme $file $destfile"
$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
test -n "$outputname" && ${rm}r "$tmpdir"
;;
esac
done
for file in $staticlibs; do
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
# Set up the ranlib parameters.
oldlib="$destdir/$name"
$show "$install_prog $file $oldlib"
$run eval "$install_prog \$file \$oldlib" || exit $?
if test -n "$stripme" && test -n "$striplib"; then
$show "$old_striplib $oldlib"
$run eval "$old_striplib $oldlib" || exit $?
fi
# Do each command in the postinstall commands.
eval cmds=\"$old_postinstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
done
if test -n "$future_libdirs"; then
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
fi
if test -n "$current_libdirs"; then
# Maybe just do a dry run.
test -n "$run" && current_libdirs=" -n$current_libdirs"
exec_cmd='$SHELL $0 --finish$current_libdirs'
else
exit 0
fi
;;
# libtool finish mode
finish)
modename="$modename: finish"
libdirs="$nonopt"
admincmds=
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
for dir
do
libdirs="$libdirs $dir"
done
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
eval cmds=\"$finish_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd" || admincmds="$admincmds
$cmd"
done
IFS="$save_ifs"
fi
if test -n "$finish_eval"; then
# Do the single finish_eval.
eval cmds=\"$finish_eval\"
$run eval "$cmds" || admincmds="$admincmds
$cmds"
fi
done
fi
# Exit here if they wanted silent mode.
exit 0
$echo "----------------------------------------------------------------------"
$echo "Libraries have been installed in:"
for libdir in $libdirs; do
$echo " $libdir"
done
$echo
$echo "If you ever happen to want to link against installed libraries"
$echo "in a given directory, LIBDIR, you must either use libtool, and"
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
$echo "flag during linking and do at least one of the following:"
if test -n "$shlibpath_var"; then
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
$echo " during execution"
fi
if test -n "$runpath_var"; then
$echo " - add LIBDIR to the \`$runpath_var' environment variable"
$echo " during linking"
fi
if test -n "$hardcode_libdir_flag_spec"; then
libdir=LIBDIR
eval flag=\"$hardcode_libdir_flag_spec\"
$echo " - use the \`$flag' linker flag"
fi
if test -n "$admincmds"; then
$echo " - have your system administrator run these commands:$admincmds"
fi
if test -f /etc/ld.so.conf; then
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
fi
$echo
$echo "See any operating system documentation about shared libraries for"
$echo "more information, such as the ld(1) and ld.so(8) manual pages."
$echo "----------------------------------------------------------------------"
exit 0
;;
# libtool execute mode
execute)
modename="$modename: execute"
# The first argument is the command name.
cmd="$nonopt"
if test -z "$cmd"; then
$echo "$modename: you must specify a COMMAND" 1>&2
$echo "$help"
exit 1
fi
# Handle -dlopen flags immediately.
for file in $execute_dlfiles; do
if test ! -f "$file"; then
$echo "$modename: \`$file' is not a file" 1>&2
$echo "$help" 1>&2
exit 1
fi
dir=
case $file in
*.la)
# Check to see that this really is a libtool archive.
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
exit 1
fi
# Read the libtool library.
dlname=
library_names=
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
# Skip this library if it cannot be dlopened.
if test -z "$dlname"; then
# Warn if it was a shared library.
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
continue
fi
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$file" && dir=.
if test -f "$dir/$objdir/$dlname"; then
dir="$dir/$objdir"
else
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
exit 1
fi
;;
*.lo)
# Just add the directory containing the .lo file.
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
test "X$dir" = "X$file" && dir=.
;;
*)
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
continue
;;
esac
# Get the absolute pathname.
absdir=`cd "$dir" && pwd`
test -n "$absdir" && dir="$absdir"
# Now add the directory to shlibpath_var.
if eval "test -z \"\$$shlibpath_var\""; then
eval "$shlibpath_var=\"\$dir\""
else
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
fi
done
# This variable tells wrapper scripts just to set shlibpath_var
# rather than running their programs.
libtool_execute_magic="$magic"
# Check if any of the arguments is a wrapper script.
args=
for file
do
case $file in
-*) ;;
*)
# Do a test to see if this is really a libtool program.
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $file ;;
*) . ./$file ;;
esac
# Transform arg to wrapped name.
file="$progdir/$program"
fi
;;
esac
# Quote arguments (to preserve shell metacharacters).
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
args="$args \"$file\""
done
if test -z "$run"; then
if test -n "$shlibpath_var"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
fi
# Restore saved environment variables
if test "${save_LC_ALL+set}" = set; then
LC_ALL="$save_LC_ALL"; export LC_ALL
fi
if test "${save_LANG+set}" = set; then
LANG="$save_LANG"; export LANG
fi
# Now prepare to actually exec the command.
exec_cmd="\$cmd$args"
else
# Display what would be done.
if test -n "$shlibpath_var"; then
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
$echo "export $shlibpath_var"
fi
$echo "$cmd$args"
exit 0
fi
;;
# libtool clean and uninstall mode
clean | uninstall)
modename="$modename: $mode"
rm="$nonopt"
files=
rmforce=
exit_status=0
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
libtool_install_magic="$magic"
for arg
do
case $arg in
-f) rm="$rm $arg"; rmforce=yes ;;
-*) rm="$rm $arg" ;;
*) files="$files $arg" ;;
esac
done
if test -z "$rm"; then
$echo "$modename: you must specify an RM program" 1>&2
$echo "$help" 1>&2
exit 1
fi
rmdirs=
origobjdir="$objdir"
for file in $files; do
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
if test "X$dir" = "X$file"; then
dir=.
objdir="$origobjdir"
else
objdir="$dir/$origobjdir"
fi
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
test "$mode" = uninstall && objdir="$dir"
# Remember objdir for removal later, being careful to avoid duplicates
if test "$mode" = clean; then
case " $rmdirs " in
*" $objdir "*) ;;
*) rmdirs="$rmdirs $objdir" ;;
esac
fi
# Don't error if the file doesn't exist and rm -f was used.
if (test -L "$file") >/dev/null 2>&1 \
|| (test -h "$file") >/dev/null 2>&1 \
|| test -f "$file"; then
:
elif test -d "$file"; then
exit_status=1
continue
elif test "$rmforce" = yes; then
continue
fi
rmfiles="$file"
case $name in
*.la)
# Possibly a libtool archive, so verify it.
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
. $dir/$name
# Delete the libtool libraries and symlinks.
for n in $library_names; do
rmfiles="$rmfiles $objdir/$n"
done
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
if test "$mode" = uninstall; then
if test -n "$library_names"; then
# Do each command in the postuninstall commands.
eval cmds=\"$postuninstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd"
if test "$?" -ne 0 && test "$rmforce" != yes; then
exit_status=1
fi
done
IFS="$save_ifs"
fi
if test -n "$old_library"; then
# Do each command in the old_postuninstall commands.
eval cmds=\"$old_postuninstall_cmds\"
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd"
if test "$?" -ne 0 && test "$rmforce" != yes; then
exit_status=1
fi
done
IFS="$save_ifs"
fi
# FIXME: should reinstall the best remaining shared library.
fi
fi
;;
*.lo)
# Possibly a libtool object, so verify it.
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
# Read the .lo file
. $dir/$name
# Add PIC object to the list of files to remove.
if test -n "$pic_object" \
&& test "$pic_object" != none; then
rmfiles="$rmfiles $dir/$pic_object"
fi
# Add non-PIC object to the list of files to remove.
if test -n "$non_pic_object" \
&& test "$non_pic_object" != none; then
rmfiles="$rmfiles $dir/$non_pic_object"
fi
fi
;;
*)
if test "$mode" = clean ; then
noexename=$name
case $file in
*.exe)
file=`$echo $file|${SED} 's,.exe$,,'`
noexename=`$echo $name|${SED} 's,.exe$,,'`
# $file with .exe has already been added to rmfiles,
# add $file without .exe
rmfiles="$rmfiles $file"
;;
esac
# Do a test to see if this is a libtool program.
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
relink_command=
. $dir/$noexename
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
if test "$fast_install" = yes && test -n "$relink_command"; then
rmfiles="$rmfiles $objdir/lt-$name"
fi
if test "X$noexename" != "X$name" ; then
rmfiles="$rmfiles $objdir/lt-${noexename}.c"
fi
fi
fi
;;
esac
$show "$rm $rmfiles"
$run $rm $rmfiles || exit_status=1
done
objdir="$origobjdir"
# Try to remove the ${objdir}s in the directories where we deleted files
for dir in $rmdirs; do
if test -d "$dir"; then
$show "rmdir $dir"
$run rmdir $dir >/dev/null 2>&1
fi
done
exit $exit_status
;;
"")
$echo "$modename: you must specify a MODE" 1>&2
$echo "$generic_help" 1>&2
exit 1
;;
esac
if test -z "$exec_cmd"; then
$echo "$modename: invalid operation mode \`$mode'" 1>&2
$echo "$generic_help" 1>&2
exit 1
fi
fi # test -z "$show_help"
if test -n "$exec_cmd"; then
eval exec $exec_cmd
exit 1
fi
# We need to display help for each of the modes.
case $mode in
"") $echo \
"Usage: $modename [OPTION]... [MODE-ARG]...
Provide generalized library-building support services.
--config show all configuration variables
--debug enable verbose shell tracing
-n, --dry-run display commands without modifying any files
--features display basic configuration information and exit
--finish same as \`--mode=finish'
--help display this help message and exit
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
--quiet same as \`--silent'
--silent don't print informational messages
--tag=TAG use configuration variables from tag TAG
--version print version information
MODE must be one of the following:
clean remove files from the build directory
compile compile a source file into a libtool object
execute automatically set library path, then run a program
finish complete the installation of libtool libraries
install install libraries or executables
link create a library or an executable
uninstall remove libraries from an installed directory
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
a more detailed description of MODE.
Report bugs to <bug-libtool@gnu.org>."
exit 0
;;
clean)
$echo \
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
Remove files from the build directory.
RM is the name of the program to use to delete files associated with each FILE
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
to RM.
If FILE is a libtool library, object or program, all the files associated
with it are deleted. Otherwise, only FILE itself is deleted using RM."
;;
compile)
$echo \
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
Compile a source file into a libtool library object.
This mode accepts the following additional options:
-o OUTPUT-FILE set the output file name to OUTPUT-FILE
-prefer-pic try to building PIC objects only
-prefer-non-pic try to building non-PIC objects only
-static always build a \`.o' file suitable for static linking
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
from the given SOURCEFILE.
The output file name is determined by removing the directory component from
SOURCEFILE, then substituting the C source code suffix \`.c' with the
library object suffix, \`.lo'."
;;
execute)
$echo \
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
Automatically set library path, then run a program.
This mode accepts the following additional options:
-dlopen FILE add the directory containing FILE to the library path
This mode sets the library path environment variable according to \`-dlopen'
flags.
If any of the ARGS are libtool executable wrappers, then they are translated
into their corresponding uninstalled binary, and any of their required library
directories are added to the library path.
Then, COMMAND is executed, with ARGS as arguments."
;;
finish)
$echo \
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
Complete the installation of libtool libraries.
Each LIBDIR is a directory that contains libtool libraries.
The commands that this mode executes may require superuser privileges. Use
the \`--dry-run' option if you just want to see what would be executed."
;;
install)
$echo \
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
Install executables or libraries.
INSTALL-COMMAND is the installation command. The first component should be
either the \`install' or \`cp' program.
The rest of the components are interpreted as arguments to that command (only
BSD-compatible install options are recognized)."
;;
link)
$echo \
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
Link object files or libraries together to form another library, or to
create an executable program.
LINK-COMMAND is a command using the C compiler that you would use to create
a program from several object files.
The following components of LINK-COMMAND are treated specially:
-all-static do not do any dynamic linking at all
-avoid-version do not add a version suffix if possible
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
try to export only the symbols listed in SYMFILE
-export-symbols-regex REGEX
try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened
-no-fast-install disable the fast-install mode
-no-install link a not-installable executable
-no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
-objectlist FILE Use a list of object files found in FILE to specify objects
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
-static do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]
specify library version info [each variable defaults to 0]
All other options (arguments beginning with \`-') are ignored.
Every other argument is treated as a filename. Files ending in \`.la' are
treated as uninstalled libtool libraries, other files are standard or library
object files.
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
only library objects (\`.lo' files) may be specified, and \`-rpath' is
required, except when creating a convenience library.
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
using \`ar' and \`ranlib', or on Windows using \`lib'.
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
is created, otherwise an executable program is created."
;;
uninstall)
$echo \
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
Remove libraries from an installation directory.
RM is the name of the program to use to delete files associated with each FILE
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
to RM.
If FILE is a libtool library, all the files associated with it are deleted.
Otherwise, only FILE itself is deleted using RM."
;;
*)
$echo "$modename: invalid operation mode \`$mode'" 1>&2
$echo "$help" 1>&2
exit 1
;;
esac
$echo
$echo "Try \`$modename --help' for more information about other modes."
exit 0
# The TAGs below are defined such that we never get into a situation
# in which we disable both kinds of libraries. Given conflicting
# choices, we go for a static library, that is the most portable,
# since we can't tell whether shared libraries were disabled because
# the user asked for that or because the platform doesn't support
# them. This is particularly important on AIX, because we don't
# support having both static and shared libraries enabled at the same
# time on that platform, so we default to a shared-only configuration.
# If a disable-shared tag is given, we'll fallback to a static-only
# configuration. But we'll never go from static-only to shared-only.
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
build_libtool_libs=no
build_old_libs=yes
# ### END LIBTOOL TAG CONFIG: disable-shared
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
# ### END LIBTOOL TAG CONFIG: disable-static
# Local Variables:
# mode:shell-script
# sh-indentation:2
# End:
|
orochi/ext4magic
|
ltmain.sh
|
Shell
|
mit
| 182,290 |
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 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, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# 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
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-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'
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]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing 0.4 - GNU automake"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. 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)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. 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)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. 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*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. 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)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them.
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
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' is missing on your system. 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 [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. 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 [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. 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 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
# We have makeinfo, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. 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."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# 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 you do not seem to have it handy on your
system. 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 prerequirements 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
|
orochi/ext4magic
|
missing
|
none
|
mit
| 10,200 |
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here
|
orochi/ext4magic
|
mkinstalldirs
|
none
|
mit
| 1,988 |
sbin_PROGRAMS = ext4magic
ext4magic_SOURCES = block.c dir_list.c ext4magic.c extent_db.c file_type.c \
hard_link_stack.c imap_search.c inode.c journal.c lookup_local.c magic_block_scan.c \
recover.c ring_buf.c util.c
# set the include path found by configure
INCLUDES= $(all_includes)
man_MANS = ext4magic.8
# the library search path.
ext4magic_CFLAGS = -O2 -g -D_FILE_OFFSET_BITS=64
ext4magic_LDFLAGS = -lext2fs -le2p -luuid -lblkid -lmagic -lz -lbz2
noinst_HEADERS = block.h dir_list.h ext2fsP.h ext4magic.8 ext4magic.h \
extent_db.h hard_link_stack.h inode.h jfs_compat.h jfs_user.h journal.h \
kernel-jbd.h kernel-list.h magic.h ring_buf.h util.h
|
orochi/ext4magic
|
src/Makefile.am
|
am
|
mit
| 658 |
# Makefile.in generated by automake 1.12.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 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@
am__make_dryrun = \
{ \
am__dry=no; \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
*) \
for am__flg in $$MAKEFLAGS; do \
case $$am__flg in \
*=*|--*) ;; \
*n*) am__dry=yes; break;; \
esac; \
done;; \
esac; \
test $$am__dry = yes; \
}
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
sbin_PROGRAMS = ext4magic$(EXEEXT)
subdir = src
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(top_srcdir)/depcomp \
$(top_srcdir)/mkinstalldirs
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 = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"
PROGRAMS = $(sbin_PROGRAMS)
am_ext4magic_OBJECTS = ext4magic-block.$(OBJEXT) \
ext4magic-dir_list.$(OBJEXT) ext4magic-ext4magic.$(OBJEXT) \
ext4magic-extent_db.$(OBJEXT) ext4magic-file_type.$(OBJEXT) \
ext4magic-hard_link_stack.$(OBJEXT) \
ext4magic-imap_search.$(OBJEXT) ext4magic-inode.$(OBJEXT) \
ext4magic-journal.$(OBJEXT) ext4magic-lookup_local.$(OBJEXT) \
ext4magic-magic_block_scan.$(OBJEXT) \
ext4magic-recover.$(OBJEXT) ext4magic-ring_buf.$(OBJEXT) \
ext4magic-util.$(OBJEXT)
ext4magic_OBJECTS = $(am_ext4magic_OBJECTS)
ext4magic_LDADD = $(LDADD)
ext4magic_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(ext4magic_CFLAGS) \
$(CFLAGS) $(ext4magic_LDFLAGS) $(LDFLAGS) -o $@
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(ext4magic_SOURCES)
DIST_SOURCES = $(ext4magic_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man8dir = $(mandir)/man8
NROFF = nroff
MANS = $(man_MANS)
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
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_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ext4magic_SOURCES = block.c dir_list.c ext4magic.c extent_db.c file_type.c \
hard_link_stack.c imap_search.c inode.c journal.c lookup_local.c magic_block_scan.c \
recover.c ring_buf.c util.c
# set the include path found by configure
INCLUDES = $(all_includes)
man_MANS = ext4magic.8
# the library search path.
ext4magic_CFLAGS = -O2 -g -D_FILE_OFFSET_BITS=64
ext4magic_LDFLAGS = -lext2fs -le2p -luuid -lblkid -lmagic -lz -lbz2
noinst_HEADERS = block.h dir_list.h ext2fsP.h ext4magic.8 ext4magic.h \
extent_db.h hard_link_stack.h inode.h jfs_compat.h jfs_user.h journal.h \
kernel-jbd.h kernel-list.h magic.h ring_buf.h util.h
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__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: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p || test -f $$p1; \
then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
} \
; done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(sbindir)" && rm -f $$files
clean-sbinPROGRAMS:
@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
ext4magic$(EXEEXT): $(ext4magic_OBJECTS) $(ext4magic_DEPENDENCIES) $(EXTRA_ext4magic_DEPENDENCIES)
@rm -f ext4magic$(EXEEXT)
$(ext4magic_LINK) $(ext4magic_OBJECTS) $(ext4magic_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-block.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-dir_list.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-ext4magic.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-extent_db.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-file_type.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-hard_link_stack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-imap_search.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-inode.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-journal.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-lookup_local.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-magic_block_scan.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-recover.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-ring_buf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ext4magic-util.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
ext4magic-block.o: block.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-block.o -MD -MP -MF $(DEPDIR)/ext4magic-block.Tpo -c -o ext4magic-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-block.Tpo $(DEPDIR)/ext4magic-block.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='block.c' object='ext4magic-block.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-block.o `test -f 'block.c' || echo '$(srcdir)/'`block.c
ext4magic-block.obj: block.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-block.obj -MD -MP -MF $(DEPDIR)/ext4magic-block.Tpo -c -o ext4magic-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-block.Tpo $(DEPDIR)/ext4magic-block.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='block.c' object='ext4magic-block.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-block.obj `if test -f 'block.c'; then $(CYGPATH_W) 'block.c'; else $(CYGPATH_W) '$(srcdir)/block.c'; fi`
ext4magic-dir_list.o: dir_list.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-dir_list.o -MD -MP -MF $(DEPDIR)/ext4magic-dir_list.Tpo -c -o ext4magic-dir_list.o `test -f 'dir_list.c' || echo '$(srcdir)/'`dir_list.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-dir_list.Tpo $(DEPDIR)/ext4magic-dir_list.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dir_list.c' object='ext4magic-dir_list.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-dir_list.o `test -f 'dir_list.c' || echo '$(srcdir)/'`dir_list.c
ext4magic-dir_list.obj: dir_list.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-dir_list.obj -MD -MP -MF $(DEPDIR)/ext4magic-dir_list.Tpo -c -o ext4magic-dir_list.obj `if test -f 'dir_list.c'; then $(CYGPATH_W) 'dir_list.c'; else $(CYGPATH_W) '$(srcdir)/dir_list.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-dir_list.Tpo $(DEPDIR)/ext4magic-dir_list.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dir_list.c' object='ext4magic-dir_list.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-dir_list.obj `if test -f 'dir_list.c'; then $(CYGPATH_W) 'dir_list.c'; else $(CYGPATH_W) '$(srcdir)/dir_list.c'; fi`
ext4magic-ext4magic.o: ext4magic.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-ext4magic.o -MD -MP -MF $(DEPDIR)/ext4magic-ext4magic.Tpo -c -o ext4magic-ext4magic.o `test -f 'ext4magic.c' || echo '$(srcdir)/'`ext4magic.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-ext4magic.Tpo $(DEPDIR)/ext4magic-ext4magic.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ext4magic.c' object='ext4magic-ext4magic.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-ext4magic.o `test -f 'ext4magic.c' || echo '$(srcdir)/'`ext4magic.c
ext4magic-ext4magic.obj: ext4magic.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-ext4magic.obj -MD -MP -MF $(DEPDIR)/ext4magic-ext4magic.Tpo -c -o ext4magic-ext4magic.obj `if test -f 'ext4magic.c'; then $(CYGPATH_W) 'ext4magic.c'; else $(CYGPATH_W) '$(srcdir)/ext4magic.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-ext4magic.Tpo $(DEPDIR)/ext4magic-ext4magic.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ext4magic.c' object='ext4magic-ext4magic.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-ext4magic.obj `if test -f 'ext4magic.c'; then $(CYGPATH_W) 'ext4magic.c'; else $(CYGPATH_W) '$(srcdir)/ext4magic.c'; fi`
ext4magic-extent_db.o: extent_db.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-extent_db.o -MD -MP -MF $(DEPDIR)/ext4magic-extent_db.Tpo -c -o ext4magic-extent_db.o `test -f 'extent_db.c' || echo '$(srcdir)/'`extent_db.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-extent_db.Tpo $(DEPDIR)/ext4magic-extent_db.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extent_db.c' object='ext4magic-extent_db.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-extent_db.o `test -f 'extent_db.c' || echo '$(srcdir)/'`extent_db.c
ext4magic-extent_db.obj: extent_db.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-extent_db.obj -MD -MP -MF $(DEPDIR)/ext4magic-extent_db.Tpo -c -o ext4magic-extent_db.obj `if test -f 'extent_db.c'; then $(CYGPATH_W) 'extent_db.c'; else $(CYGPATH_W) '$(srcdir)/extent_db.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-extent_db.Tpo $(DEPDIR)/ext4magic-extent_db.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='extent_db.c' object='ext4magic-extent_db.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-extent_db.obj `if test -f 'extent_db.c'; then $(CYGPATH_W) 'extent_db.c'; else $(CYGPATH_W) '$(srcdir)/extent_db.c'; fi`
ext4magic-file_type.o: file_type.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-file_type.o -MD -MP -MF $(DEPDIR)/ext4magic-file_type.Tpo -c -o ext4magic-file_type.o `test -f 'file_type.c' || echo '$(srcdir)/'`file_type.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-file_type.Tpo $(DEPDIR)/ext4magic-file_type.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file_type.c' object='ext4magic-file_type.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-file_type.o `test -f 'file_type.c' || echo '$(srcdir)/'`file_type.c
ext4magic-file_type.obj: file_type.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-file_type.obj -MD -MP -MF $(DEPDIR)/ext4magic-file_type.Tpo -c -o ext4magic-file_type.obj `if test -f 'file_type.c'; then $(CYGPATH_W) 'file_type.c'; else $(CYGPATH_W) '$(srcdir)/file_type.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-file_type.Tpo $(DEPDIR)/ext4magic-file_type.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file_type.c' object='ext4magic-file_type.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-file_type.obj `if test -f 'file_type.c'; then $(CYGPATH_W) 'file_type.c'; else $(CYGPATH_W) '$(srcdir)/file_type.c'; fi`
ext4magic-hard_link_stack.o: hard_link_stack.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-hard_link_stack.o -MD -MP -MF $(DEPDIR)/ext4magic-hard_link_stack.Tpo -c -o ext4magic-hard_link_stack.o `test -f 'hard_link_stack.c' || echo '$(srcdir)/'`hard_link_stack.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-hard_link_stack.Tpo $(DEPDIR)/ext4magic-hard_link_stack.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hard_link_stack.c' object='ext4magic-hard_link_stack.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-hard_link_stack.o `test -f 'hard_link_stack.c' || echo '$(srcdir)/'`hard_link_stack.c
ext4magic-hard_link_stack.obj: hard_link_stack.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-hard_link_stack.obj -MD -MP -MF $(DEPDIR)/ext4magic-hard_link_stack.Tpo -c -o ext4magic-hard_link_stack.obj `if test -f 'hard_link_stack.c'; then $(CYGPATH_W) 'hard_link_stack.c'; else $(CYGPATH_W) '$(srcdir)/hard_link_stack.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-hard_link_stack.Tpo $(DEPDIR)/ext4magic-hard_link_stack.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hard_link_stack.c' object='ext4magic-hard_link_stack.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-hard_link_stack.obj `if test -f 'hard_link_stack.c'; then $(CYGPATH_W) 'hard_link_stack.c'; else $(CYGPATH_W) '$(srcdir)/hard_link_stack.c'; fi`
ext4magic-imap_search.o: imap_search.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-imap_search.o -MD -MP -MF $(DEPDIR)/ext4magic-imap_search.Tpo -c -o ext4magic-imap_search.o `test -f 'imap_search.c' || echo '$(srcdir)/'`imap_search.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-imap_search.Tpo $(DEPDIR)/ext4magic-imap_search.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imap_search.c' object='ext4magic-imap_search.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-imap_search.o `test -f 'imap_search.c' || echo '$(srcdir)/'`imap_search.c
ext4magic-imap_search.obj: imap_search.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-imap_search.obj -MD -MP -MF $(DEPDIR)/ext4magic-imap_search.Tpo -c -o ext4magic-imap_search.obj `if test -f 'imap_search.c'; then $(CYGPATH_W) 'imap_search.c'; else $(CYGPATH_W) '$(srcdir)/imap_search.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-imap_search.Tpo $(DEPDIR)/ext4magic-imap_search.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='imap_search.c' object='ext4magic-imap_search.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-imap_search.obj `if test -f 'imap_search.c'; then $(CYGPATH_W) 'imap_search.c'; else $(CYGPATH_W) '$(srcdir)/imap_search.c'; fi`
ext4magic-inode.o: inode.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-inode.o -MD -MP -MF $(DEPDIR)/ext4magic-inode.Tpo -c -o ext4magic-inode.o `test -f 'inode.c' || echo '$(srcdir)/'`inode.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-inode.Tpo $(DEPDIR)/ext4magic-inode.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='inode.c' object='ext4magic-inode.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-inode.o `test -f 'inode.c' || echo '$(srcdir)/'`inode.c
ext4magic-inode.obj: inode.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-inode.obj -MD -MP -MF $(DEPDIR)/ext4magic-inode.Tpo -c -o ext4magic-inode.obj `if test -f 'inode.c'; then $(CYGPATH_W) 'inode.c'; else $(CYGPATH_W) '$(srcdir)/inode.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-inode.Tpo $(DEPDIR)/ext4magic-inode.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='inode.c' object='ext4magic-inode.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-inode.obj `if test -f 'inode.c'; then $(CYGPATH_W) 'inode.c'; else $(CYGPATH_W) '$(srcdir)/inode.c'; fi`
ext4magic-journal.o: journal.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-journal.o -MD -MP -MF $(DEPDIR)/ext4magic-journal.Tpo -c -o ext4magic-journal.o `test -f 'journal.c' || echo '$(srcdir)/'`journal.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-journal.Tpo $(DEPDIR)/ext4magic-journal.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='journal.c' object='ext4magic-journal.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-journal.o `test -f 'journal.c' || echo '$(srcdir)/'`journal.c
ext4magic-journal.obj: journal.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-journal.obj -MD -MP -MF $(DEPDIR)/ext4magic-journal.Tpo -c -o ext4magic-journal.obj `if test -f 'journal.c'; then $(CYGPATH_W) 'journal.c'; else $(CYGPATH_W) '$(srcdir)/journal.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-journal.Tpo $(DEPDIR)/ext4magic-journal.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='journal.c' object='ext4magic-journal.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-journal.obj `if test -f 'journal.c'; then $(CYGPATH_W) 'journal.c'; else $(CYGPATH_W) '$(srcdir)/journal.c'; fi`
ext4magic-lookup_local.o: lookup_local.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-lookup_local.o -MD -MP -MF $(DEPDIR)/ext4magic-lookup_local.Tpo -c -o ext4magic-lookup_local.o `test -f 'lookup_local.c' || echo '$(srcdir)/'`lookup_local.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-lookup_local.Tpo $(DEPDIR)/ext4magic-lookup_local.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lookup_local.c' object='ext4magic-lookup_local.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-lookup_local.o `test -f 'lookup_local.c' || echo '$(srcdir)/'`lookup_local.c
ext4magic-lookup_local.obj: lookup_local.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-lookup_local.obj -MD -MP -MF $(DEPDIR)/ext4magic-lookup_local.Tpo -c -o ext4magic-lookup_local.obj `if test -f 'lookup_local.c'; then $(CYGPATH_W) 'lookup_local.c'; else $(CYGPATH_W) '$(srcdir)/lookup_local.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-lookup_local.Tpo $(DEPDIR)/ext4magic-lookup_local.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lookup_local.c' object='ext4magic-lookup_local.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-lookup_local.obj `if test -f 'lookup_local.c'; then $(CYGPATH_W) 'lookup_local.c'; else $(CYGPATH_W) '$(srcdir)/lookup_local.c'; fi`
ext4magic-magic_block_scan.o: magic_block_scan.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-magic_block_scan.o -MD -MP -MF $(DEPDIR)/ext4magic-magic_block_scan.Tpo -c -o ext4magic-magic_block_scan.o `test -f 'magic_block_scan.c' || echo '$(srcdir)/'`magic_block_scan.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-magic_block_scan.Tpo $(DEPDIR)/ext4magic-magic_block_scan.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='magic_block_scan.c' object='ext4magic-magic_block_scan.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-magic_block_scan.o `test -f 'magic_block_scan.c' || echo '$(srcdir)/'`magic_block_scan.c
ext4magic-magic_block_scan.obj: magic_block_scan.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-magic_block_scan.obj -MD -MP -MF $(DEPDIR)/ext4magic-magic_block_scan.Tpo -c -o ext4magic-magic_block_scan.obj `if test -f 'magic_block_scan.c'; then $(CYGPATH_W) 'magic_block_scan.c'; else $(CYGPATH_W) '$(srcdir)/magic_block_scan.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-magic_block_scan.Tpo $(DEPDIR)/ext4magic-magic_block_scan.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='magic_block_scan.c' object='ext4magic-magic_block_scan.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-magic_block_scan.obj `if test -f 'magic_block_scan.c'; then $(CYGPATH_W) 'magic_block_scan.c'; else $(CYGPATH_W) '$(srcdir)/magic_block_scan.c'; fi`
ext4magic-recover.o: recover.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-recover.o -MD -MP -MF $(DEPDIR)/ext4magic-recover.Tpo -c -o ext4magic-recover.o `test -f 'recover.c' || echo '$(srcdir)/'`recover.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-recover.Tpo $(DEPDIR)/ext4magic-recover.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='recover.c' object='ext4magic-recover.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-recover.o `test -f 'recover.c' || echo '$(srcdir)/'`recover.c
ext4magic-recover.obj: recover.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-recover.obj -MD -MP -MF $(DEPDIR)/ext4magic-recover.Tpo -c -o ext4magic-recover.obj `if test -f 'recover.c'; then $(CYGPATH_W) 'recover.c'; else $(CYGPATH_W) '$(srcdir)/recover.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-recover.Tpo $(DEPDIR)/ext4magic-recover.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='recover.c' object='ext4magic-recover.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-recover.obj `if test -f 'recover.c'; then $(CYGPATH_W) 'recover.c'; else $(CYGPATH_W) '$(srcdir)/recover.c'; fi`
ext4magic-ring_buf.o: ring_buf.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-ring_buf.o -MD -MP -MF $(DEPDIR)/ext4magic-ring_buf.Tpo -c -o ext4magic-ring_buf.o `test -f 'ring_buf.c' || echo '$(srcdir)/'`ring_buf.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-ring_buf.Tpo $(DEPDIR)/ext4magic-ring_buf.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ring_buf.c' object='ext4magic-ring_buf.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-ring_buf.o `test -f 'ring_buf.c' || echo '$(srcdir)/'`ring_buf.c
ext4magic-ring_buf.obj: ring_buf.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-ring_buf.obj -MD -MP -MF $(DEPDIR)/ext4magic-ring_buf.Tpo -c -o ext4magic-ring_buf.obj `if test -f 'ring_buf.c'; then $(CYGPATH_W) 'ring_buf.c'; else $(CYGPATH_W) '$(srcdir)/ring_buf.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-ring_buf.Tpo $(DEPDIR)/ext4magic-ring_buf.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ring_buf.c' object='ext4magic-ring_buf.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-ring_buf.obj `if test -f 'ring_buf.c'; then $(CYGPATH_W) 'ring_buf.c'; else $(CYGPATH_W) '$(srcdir)/ring_buf.c'; fi`
ext4magic-util.o: util.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-util.o -MD -MP -MF $(DEPDIR)/ext4magic-util.Tpo -c -o ext4magic-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-util.Tpo $(DEPDIR)/ext4magic-util.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='ext4magic-util.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
ext4magic-util.obj: util.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -MT ext4magic-util.obj -MD -MP -MF $(DEPDIR)/ext4magic-util.Tpo -c -o ext4magic-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/ext4magic-util.Tpo $(DEPDIR)/ext4magic-util.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='ext4magic-util.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(ext4magic_CFLAGS) $(CFLAGS) -c -o ext4magic-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man8: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(man_MANS)'; \
test -n "$(man8dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.8[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
done; }
uninstall-man8:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man8dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.8[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
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; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
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; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
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)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
if test -n "$$list" && \
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
echo " typically 'make maintainer-clean' will remove them" >&2; \
exit 1; \
else :; fi; \
else :; fi
@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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$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: check-am
all-am: Makefile $(PROGRAMS) $(MANS) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man8dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: 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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-sbinPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man8
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
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 \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-man uninstall-sbinPROGRAMS
uninstall-man: uninstall-man8
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libtool clean-sbinPROGRAMS cscopelist ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir 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-man8 install-pdf install-pdf-am install-ps \
install-ps-am install-sbinPROGRAMS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-man uninstall-man8 \
uninstall-sbinPROGRAMS
# 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:
|
orochi/ext4magic
|
src/Makefile.in
|
in
|
mit
| 47,778 |
/*
* This file was modified from e2fsprogs 1.41.4
* Use this file when compiling against a newer version of ext2fs headers.
* block.c --- iterate over all blocks in an inode
* extent.c --- work with extents
*
* Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
*
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
*/
/*
This is a workaround to allow compilation, but the one line that uses
this constant will never run because we open the fs read-only.
*/
#define EXT4INO 0
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#ifndef EXT2_FLAT_INCLUDES
#define EXT2_FLAT_INCLUDES 0
#endif
#include "ext2fsP.h"
#include "block.h"
#include "journal.h"
#include "util.h"
extern ext2fs_block_bitmap bmap ;
struct block_context {
ext2_filsys fs;
int (*func)(ext2_filsys fs,
blk64_t *blocknr,
e2_blkcnt_t bcount,
blk64_t ref_blk,
int ref_offset,
void *priv_data);
e2_blkcnt_t bcount;
int bsize;
int flags;
errcode_t errcode;
char *ind_buf;
char *dind_buf;
char *tind_buf;
void *priv_data;
};
//#ifdef BLOCK_FLAG_READ_ONLY
//#include <ext2fs/ext3_extents.h>
struct extent_path {
char *buf;
int entries;
int max_entries;
int left;
int visit_num;
int flags;
blk64_t end_blk;
blk64_t blk;
void *curr;
};
struct ext2_extent_handle {
errcode_t magic;
ext2_filsys fs;
ext2_ino_t ino;
struct ext2_inode *inode;
#ifdef EXT2_FLAG_64BITS
struct ext2_inode inodebuf;
#endif
int type;
int level;
int max_depth;
int max_paths;
struct extent_path *path;
};
// Leave the inode intact
void local_ext2fs_extent_free(ext2_extent_handle_t handle)
{
int i;
if (!handle)
return;
if (handle->path) {
for (i = 1; i < handle->max_paths; i++) {
if (handle->path[i].buf)
ext2fs_free_mem(&handle->path[i].buf);
}
ext2fs_free_mem(&handle->path);
}
ext2fs_free_mem(&handle);
}
// ------------------------------------------------------------------------
// This function inserts the data from block blocknr[0] into the input buffer
// 'buf'. The data from the block is inserted into
// the input buffer beginning at location 'blockcnt'.
// NOTE: The output returned by this command should be corrected to the proper
// endianness for the host cpu when reading multi-byte structures from disk.
int read_block ( ext2_filsys fs, blk_t *blocknr, void *buf )
{
errcode_t retval = io_channel_read_blk ( fs->io, *blocknr, 1, buf );
if (retval)
fprintf(stderr,"Error %d while read block\n", (int)retval);
return retval;
}
#ifdef EXT2_FLAG_64BITS
int read_block64 ( ext2_filsys fs, blk64_t *blocknr, void *buf )
{
errcode_t retval = io_channel_read_blk64 ( fs->io, *blocknr, 1, buf );
if (retval)
fprintf(stderr,"Error %d while read block\n", (int)retval);
return retval;
}
#endif
errcode_t local_ext2fs_extent_open(ext2_filsys fs, struct ext2_inode inode,
ext2_extent_handle_t *ret_handle) {
struct ext2_extent_handle *handle;
struct ext3_extent_header *eh;
int i;
errcode_t retval;
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
retval = ext2fs_get_mem(sizeof(struct ext2_extent_handle), &handle);
if (retval)
return retval;
memset(handle, 0, sizeof(struct ext2_extent_handle));
handle->ino = EXT4INO;
handle->fs = fs;
handle->inode = &inode;
eh = (struct ext3_extent_header *) &handle->inode->i_block[0];
for (i=0; i < EXT2_N_BLOCKS; i++)
if (handle->inode->i_block[i])
break;
if (i >= EXT2_N_BLOCKS) {
eh->eh_magic = ext2fs_cpu_to_le16(EXT3_EXT_MAGIC);
eh->eh_depth = 0;
eh->eh_entries = 0;
i = (sizeof(handle->inode->i_block) - sizeof(*eh)) /
sizeof(struct ext3_extent);
eh->eh_max = ext2fs_cpu_to_le16(i);
handle->inode->i_flags |= EXT4_EXTENTS_FL;
}
if (!(handle->inode->i_flags & EXT4_EXTENTS_FL)) {
retval = EXT2_ET_INODE_NOT_EXTENT;
goto errout;
}
retval = ext2fs_extent_header_verify(eh, sizeof(handle->inode->i_block));
if (retval)
goto errout;
handle->max_depth = ext2fs_le16_to_cpu(eh->eh_depth);
handle->type = ext2fs_le16_to_cpu(eh->eh_magic);
handle->max_paths = handle->max_depth + 1;
retval = ext2fs_get_memzero(handle->max_paths *
sizeof(struct extent_path),
&handle->path);
handle->path[0].buf = (char *) handle->inode->i_block;
handle->path[0].left = handle->path[0].entries =
ext2fs_le16_to_cpu(eh->eh_entries);
handle->path[0].max_entries = ext2fs_le16_to_cpu(eh->eh_max);
handle->path[0].curr = 0;
handle->path[0].end_blk =
(EXT2_I_SIZE(handle->inode) + fs->blocksize - 1) >>
EXT2_BLOCK_SIZE_BITS(fs->super);
handle->path[0].blk = 0;
handle->path[0].visit_num = 1;
handle->level = 0;
handle->magic = EXT2_ET_MAGIC_EXTENT_HANDLE;
*ret_handle = handle;
return 0;
errout:
local_ext2fs_extent_free(handle);
return retval;
}
static int mark_extent_block(ext2_filsys fs, char *extent_block ){
struct ext3_extent_header *eh;
struct ext3_extent_idx *idx;
int i, ret = 0 ;
#ifdef EXT2_FLAG_64BITS
blk64_t index_bl;
#else
blk_t index_bl;
#endif
char *buf = NULL;
eh = (struct ext3_extent_header*) extent_block;
if (eh->eh_magic != ext2fs_cpu_to_le16(EXT3_EXT_MAGIC))
return 1;
if (ext2fs_le16_to_cpu(eh->eh_depth)) {
for (i = 1; ((i <= ext2fs_le16_to_cpu(eh->eh_entries)) && (i <= ext2fs_le16_to_cpu(eh->eh_max))); i++){
idx = (struct ext3_extent_idx*) &(extent_block[12 * i]);
#ifdef EXT2_FLAG_64BITS
index_bl = ext2fs_le32_to_cpu(idx->ei_leaf) +
((__u64) ext2fs_le16_to_cpu(idx->ei_leaf_hi) << 32);
#else
index_bl = ext2fs_le32_to_cpu(idx->ei_leaf);
#endif
if (index_bl && index_bl <= fs->super->s_blocks_count ){
if (bmap){
#ifdef EXT2_FLAG_64BITS
ext2fs_mark_generic_bmap(bmap, index_bl);
#else
ext2fs_mark_generic_bitmap(bmap, index_bl);
#endif
buf = malloc(fs->blocksize);
if (buf){
#ifdef EXT2_FLAG_64BITS
ret = read_block64 (fs, &index_bl, buf );
#else
ret = read_block (fs, &index_bl, buf );
#endif
if (!ret)
ret = mark_extent_block(fs,buf);
free(buf);
}
}
}
}
}
return ret;
}
#define check_for_ro_violation_return(ctx, ret) \
do { \
if (((ctx)->flags & BLOCK_FLAG_READ_ONLY) && \
((ret) & BLOCK_CHANGED)) { \
(ctx)->errcode = EXT2_ET_RO_BLOCK_ITERATE; \
ret |= BLOCK_ABORT | BLOCK_ERROR; \
return ret; \
} \
} while (0)
#define check_for_ro_violation_goto(ctx, ret, label) \
do { \
if (((ctx)->flags & BLOCK_FLAG_READ_ONLY) && \
((ret) & BLOCK_CHANGED)) { \
(ctx)->errcode = EXT2_ET_RO_BLOCK_ITERATE; \
ret |= BLOCK_ABORT | BLOCK_ERROR; \
goto label; \
} \
} while (0)
static int block_iterate_ind(blk_t *ind_block, blk_t ref_block,
int ref_offset, struct block_context *ctx)
{
int ret = 0, changed = 0;
int i, flags, limit, offset;
blk_t *block_nr;
blk64_t blk64;
limit = ctx->fs->blocksize >> 2;
if (!(ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE) &&
!(ctx->flags & BLOCK_FLAG_DATA_ONLY)) {
blk64 = *ind_block;
ret = (*ctx->func)(ctx->fs, &blk64,
BLOCK_COUNT_IND, ref_block,
ref_offset, ctx->priv_data);
*ind_block = blk64;
}
check_for_ro_violation_return(ctx, ret);
if (!*ind_block || (ret & BLOCK_ABORT)) {
ctx->bcount += limit;
return ret;
}
if (*ind_block >= ext2fs_blocks_count(ctx->fs->super) ||
*ind_block < ctx->fs->super->s_first_data_block) {
ctx->errcode = EXT2_ET_BAD_IND_BLOCK;
ret |= BLOCK_ERROR;
return ret;
}
ctx->errcode = ext2fs_read_ind_block(ctx->fs, *ind_block,
ctx->ind_buf);
if (ctx->errcode) {
ret |= BLOCK_ERROR;
return ret;
}
if (bmap)
ext2fs_mark_generic_bitmap(bmap, *ind_block);
block_nr = (blk_t *) ctx->ind_buf;
offset = 0;
if (ctx->flags & BLOCK_FLAG_APPEND) {
for (i = 0; i < limit; i++, ctx->bcount++, block_nr++) {
blk64 = *block_nr;
flags = (*ctx->func)(ctx->fs, &blk64, ctx->bcount,
*ind_block, offset,
ctx->priv_data);
*block_nr = blk64;
changed |= flags;
if (flags & BLOCK_ABORT) {
ret |= BLOCK_ABORT;
break;
}
offset += sizeof(blk_t);
}
} else {
for (i = 0; i < limit; i++, ctx->bcount++, block_nr++) {
if (*block_nr == 0)
goto skip_sparse;
blk64 = *block_nr;
flags = (*ctx->func)(ctx->fs, &blk64, ctx->bcount,
*ind_block, offset,
ctx->priv_data);
*block_nr = blk64;
changed |= flags;
if (flags & BLOCK_ABORT) {
ret |= BLOCK_ABORT;
break;
}
skip_sparse:
offset += sizeof(blk_t);
}
}
check_for_ro_violation_return(ctx, changed);
if (changed & BLOCK_CHANGED) {
ctx->errcode = ext2fs_write_ind_block(ctx->fs, *ind_block,
ctx->ind_buf);
if (ctx->errcode)
ret |= BLOCK_ERROR | BLOCK_ABORT;
}
if ((ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE) &&
!(ctx->flags & BLOCK_FLAG_DATA_ONLY) &&
!(ret & BLOCK_ABORT)) {
blk64 = *ind_block;
ret |= (*ctx->func)(ctx->fs, &blk64,
BLOCK_COUNT_IND, ref_block,
ref_offset, ctx->priv_data);
*ind_block = blk64;
}
check_for_ro_violation_return(ctx, ret);
return ret;
}
static int block_iterate_dind(blk_t *dind_block, blk_t ref_block,
int ref_offset, struct block_context *ctx)
{
int ret = 0, changed = 0;
int i, flags, limit, offset;
blk_t *block_nr;
blk64_t blk64;
limit = ctx->fs->blocksize >> 2;
if (!(ctx->flags & (BLOCK_FLAG_DEPTH_TRAVERSE |
BLOCK_FLAG_DATA_ONLY))) {
blk64 = *dind_block;
ret = (*ctx->func)(ctx->fs, &blk64,
BLOCK_COUNT_DIND, ref_block,
ref_offset, ctx->priv_data);
*dind_block = blk64;
}
check_for_ro_violation_return(ctx, ret);
if (!*dind_block || (ret & BLOCK_ABORT)) {
ctx->bcount += limit*limit;
return ret;
}
if (*dind_block >= ext2fs_blocks_count(ctx->fs->super) ||
*dind_block < ctx->fs->super->s_first_data_block) {
ctx->errcode = EXT2_ET_BAD_DIND_BLOCK;
ret |= BLOCK_ERROR;
return ret;
}
ctx->errcode = ext2fs_read_ind_block(ctx->fs, *dind_block,
ctx->dind_buf);
if (ctx->errcode) {
ret |= BLOCK_ERROR;
return ret;
}
if (bmap)
ext2fs_mark_generic_bitmap(bmap, *dind_block);
block_nr = (blk_t *) ctx->dind_buf;
offset = 0;
if (ctx->flags & BLOCK_FLAG_APPEND) {
for (i = 0; i < limit; i++, block_nr++) {
flags = block_iterate_ind(block_nr,
*dind_block, offset,
ctx);
changed |= flags;
if (flags & (BLOCK_ABORT | BLOCK_ERROR)) {
ret |= flags & (BLOCK_ABORT | BLOCK_ERROR);
break;
}
offset += sizeof(blk_t);
}
} else {
for (i = 0; i < limit; i++, block_nr++) {
if (*block_nr == 0) {
ctx->bcount += limit;
continue;
}
flags = block_iterate_ind(block_nr,
*dind_block, offset,
ctx);
changed |= flags;
if (flags & (BLOCK_ABORT | BLOCK_ERROR)) {
ret |= flags & (BLOCK_ABORT | BLOCK_ERROR);
break;
}
offset += sizeof(blk_t);
}
}
check_for_ro_violation_return(ctx, changed);
if (changed & BLOCK_CHANGED) {
ctx->errcode = ext2fs_write_ind_block(ctx->fs, *dind_block,
ctx->dind_buf);
if (ctx->errcode)
ret |= BLOCK_ERROR | BLOCK_ABORT;
}
if ((ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE) &&
!(ctx->flags & BLOCK_FLAG_DATA_ONLY) &&
!(ret & BLOCK_ABORT)) {
blk64 = *dind_block;
ret |= (*ctx->func)(ctx->fs, &blk64,
BLOCK_COUNT_DIND, ref_block,
ref_offset, ctx->priv_data);
*dind_block = blk64;
}
check_for_ro_violation_return(ctx, ret);
return ret;
}
static int block_iterate_tind(blk_t *tind_block, blk_t ref_block,
int ref_offset, struct block_context *ctx)
{
int ret = 0, changed = 0;
int i, flags, limit, offset;
blk_t *block_nr;
blk64_t blk64;
limit = ctx->fs->blocksize >> 2;
if (!(ctx->flags & (BLOCK_FLAG_DEPTH_TRAVERSE |
BLOCK_FLAG_DATA_ONLY))) {
blk64 = *tind_block;
ret = (*ctx->func)(ctx->fs, &blk64,
BLOCK_COUNT_TIND, ref_block,
ref_offset, ctx->priv_data);
*tind_block = blk64;
}
check_for_ro_violation_return(ctx, ret);
if (!*tind_block || (ret & BLOCK_ABORT)) {
ctx->bcount += ((unsigned long long) limit)*limit*limit;
return ret;
}
if (*tind_block >= ext2fs_blocks_count(ctx->fs->super) ||
*tind_block < ctx->fs->super->s_first_data_block) {
ctx->errcode = EXT2_ET_BAD_TIND_BLOCK;
ret |= BLOCK_ERROR;
return ret;
}
ctx->errcode = ext2fs_read_ind_block(ctx->fs, *tind_block,
ctx->tind_buf);
if (ctx->errcode) {
ret |= BLOCK_ERROR;
return ret;
}
if (bmap)
ext2fs_mark_generic_bitmap(bmap, *tind_block);
block_nr = (blk_t *) ctx->tind_buf;
offset = 0;
if (ctx->flags & BLOCK_FLAG_APPEND) {
for (i = 0; i < limit; i++, block_nr++) {
flags = block_iterate_dind(block_nr,
*tind_block,
offset, ctx);
changed |= flags;
if (flags & (BLOCK_ABORT | BLOCK_ERROR)) {
ret |= flags & (BLOCK_ABORT | BLOCK_ERROR);
break;
}
offset += sizeof(blk_t);
}
} else {
for (i = 0; i < limit; i++, block_nr++) {
if (*block_nr == 0) {
ctx->bcount += limit*limit;
continue;
}
flags = block_iterate_dind(block_nr,
*tind_block,
offset, ctx);
changed |= flags;
if (flags & (BLOCK_ABORT | BLOCK_ERROR)) {
ret |= flags & (BLOCK_ABORT | BLOCK_ERROR);
break;
}
offset += sizeof(blk_t);
}
}
check_for_ro_violation_return(ctx, changed);
if (changed & BLOCK_CHANGED) {
ctx->errcode = ext2fs_write_ind_block(ctx->fs, *tind_block,
ctx->tind_buf);
if (ctx->errcode)
ret |= BLOCK_ERROR | BLOCK_ABORT;
}
if ((ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE) &&
!(ctx->flags & BLOCK_FLAG_DATA_ONLY) &&
!(ret & BLOCK_ABORT)) {
blk64 = *tind_block;
ret |= (*ctx->func)(ctx->fs, &blk64,
BLOCK_COUNT_TIND, ref_block,
ref_offset, ctx->priv_data);
*tind_block = blk64;
}
check_for_ro_violation_return(ctx, ret);
return ret;
}
errcode_t local_block_iterate3(ext2_filsys fs,
struct ext2_inode inode,
int flags,
char *block_buf,
int (*func)(ext2_filsys fs,
blk64_t *blocknr,
e2_blkcnt_t blockcnt,
blk64_t ref_blk,
int ref_offset,
void *priv_data),
void *priv_data)
{
int i;
int r, ret = 0;
// struct ext2_inode inode;
errcode_t retval;
struct block_context ctx;
int limit;
blk64_t blk64;
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
ctx.errcode = 0;
/*
* An inode with inline data has no blocks over which to
* iterate, so return an error code indicating this fact.
*/
if (inode.i_flags & EXT4_INLINE_DATA_FL)
return EXT2_ET_INLINE_DATA_CANT_ITERATE;
/*
* Check to see if we need to limit large files
*/
if (flags & BLOCK_FLAG_NO_LARGE) {
if (!LINUX_S_ISDIR(inode.i_mode) &&
(inode.i_size_high != 0))
return EXT2_ET_FILE_TOO_BIG;
}
limit = fs->blocksize >> 2;
ctx.fs = fs;
ctx.func = func;
ctx.priv_data = priv_data;
ctx.flags = flags;
ctx.bcount = 0;
if (block_buf) {
ctx.ind_buf = block_buf;
} else {
retval = ext2fs_get_array(3, fs->blocksize, &ctx.ind_buf);
if (retval)
return retval;
}
ctx.dind_buf = ctx.ind_buf + fs->blocksize;
ctx.tind_buf = ctx.dind_buf + fs->blocksize;
/*
* Iterate over the HURD translator block (if present)
*/
if ((fs->super->s_creator_os == EXT2_OS_HURD) &&
!(flags & BLOCK_FLAG_DATA_ONLY)) {
if (inode.osd1.hurd1.h_i_translator) {
blk64 = inode.osd1.hurd1.h_i_translator;
ret |= (*ctx.func)(fs, &blk64,
BLOCK_COUNT_TRANSLATOR,
0, 0, priv_data);
inode.osd1.hurd1.h_i_translator = (blk_t) blk64;
if (ret & BLOCK_ABORT)
goto abort_exit;
check_for_ro_violation_goto(&ctx, ret, abort_exit);
}
}
if (inode.i_flags & EXT4_EXTENTS_FL) {
ext2_extent_handle_t handle;
struct ext2fs_extent extent, next;
e2_blkcnt_t blockcnt = 0;
blk64_t blk, new_blk;
int op = EXT2_EXTENT_ROOT;
int uninit;
unsigned int j;
ctx.errcode = local_ext2fs_extent_open(fs, inode, &handle);
if (ctx.errcode)
goto abort_exit;
while (1) {
if (op == EXT2_EXTENT_CURRENT)
ctx.errcode = 0;
else
ctx.errcode = ext2fs_extent_get(handle, op,
&extent);
if (ctx.errcode) {
if (ctx.errcode != EXT2_ET_EXTENT_NO_NEXT)
break;
ctx.errcode = 0;
if (!(flags & BLOCK_FLAG_APPEND))
break;
next_block_set:
blk = 0;
r = (*ctx.func)(fs, &blk, blockcnt,
0, 0, priv_data);
ret |= r;
check_for_ro_violation_goto(&ctx, ret,
extent_done);
if (r & BLOCK_CHANGED) {
ctx.errcode =
ext2fs_extent_set_bmap(handle,
(blk64_t) blockcnt++,
(blk64_t) blk, 0);
if (ctx.errcode || (ret & BLOCK_ABORT))
break;
if (blk)
goto next_block_set;
}
break;
}
op = EXT2_EXTENT_NEXT;
blk = extent.e_pblk;
if (!(extent.e_flags & EXT2_EXTENT_FLAGS_LEAF)) {
if (ctx.flags & BLOCK_FLAG_DATA_ONLY)
continue;
if ((!(extent.e_flags &
EXT2_EXTENT_FLAGS_SECOND_VISIT) &&
!(ctx.flags & BLOCK_FLAG_DEPTH_TRAVERSE)) ||
((extent.e_flags &
EXT2_EXTENT_FLAGS_SECOND_VISIT) &&
(ctx.flags & BLOCK_FLAG_DEPTH_TRAVERSE))) {
ret |= (*ctx.func)(fs, &blk,
-1, 0, 0, priv_data);
if (ret & BLOCK_CHANGED) {
extent.e_pblk = blk;
ctx.errcode =
ext2fs_extent_replace(handle, 0, &extent);
if (ctx.errcode)
break;
}
if (ret & BLOCK_ABORT)
break;
}
continue;
}
uninit = 0;
if (extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT)
uninit = EXT2_EXTENT_SET_BMAP_UNINIT;
/*
* Get the next extent before we start messing
* with the current extent
*/
retval = ext2fs_extent_get(handle, op, &next);
#if 0
printf("lblk %llu pblk %llu len %d blockcnt %llu\n",
extent.e_lblk, extent.e_pblk,
extent.e_len, blockcnt);
#endif
if (extent.e_lblk + extent.e_len <= (blk64_t) blockcnt)
continue;
if (extent.e_lblk > (blk64_t) blockcnt)
blockcnt = extent.e_lblk;
j = blockcnt - extent.e_lblk;
blk += j;
for (blockcnt = extent.e_lblk, j = 0;
j < extent.e_len;
blk++, blockcnt++, j++) {
new_blk = blk;
r = (*ctx.func)(fs, &new_blk, blockcnt,
0, 0, priv_data);
ret |= r;
check_for_ro_violation_goto(&ctx, ret,
extent_done);
if (r & BLOCK_CHANGED) {
ctx.errcode =
ext2fs_extent_set_bmap(handle,
(blk64_t) blockcnt,
new_blk, uninit);
if (ctx.errcode)
goto extent_done;
}
if (ret & BLOCK_ABORT)
goto extent_done;
}
if (retval == 0) {
extent = next;
op = EXT2_EXTENT_CURRENT;
}
}
extent_done:
ext2fs_extent_free(handle);
ret |= BLOCK_ERROR; /* ctx.errcode is always valid here */
goto errout;
}
/*
* Iterate over normal data blocks
*/
for (i = 0; i < EXT2_NDIR_BLOCKS ; i++, ctx.bcount++) {
if (inode.i_block[i] || (flags & BLOCK_FLAG_APPEND)) {
blk64 = inode.i_block[i];
ret |= (*ctx.func)(fs, &blk64, ctx.bcount, 0, i,
priv_data);
inode.i_block[i] = (blk_t) blk64;
if (ret & BLOCK_ABORT)
goto abort_exit;
}
}
check_for_ro_violation_goto(&ctx, ret, abort_exit);
if (inode.i_block[EXT2_IND_BLOCK] || (flags & BLOCK_FLAG_APPEND)) {
ret |= block_iterate_ind(&inode.i_block[EXT2_IND_BLOCK],
0, EXT2_IND_BLOCK, &ctx);
if (ret & BLOCK_ABORT)
goto abort_exit;
} else
ctx.bcount += limit;
if (inode.i_block[EXT2_DIND_BLOCK] || (flags & BLOCK_FLAG_APPEND)) {
ret |= block_iterate_dind(&inode.i_block[EXT2_DIND_BLOCK],
0, EXT2_DIND_BLOCK, &ctx);
if (ret & BLOCK_ABORT)
goto abort_exit;
} else
ctx.bcount += limit * limit;
if (inode.i_block[EXT2_TIND_BLOCK] || (flags & BLOCK_FLAG_APPEND)) {
ret |= block_iterate_tind(&inode.i_block[EXT2_TIND_BLOCK],
0, EXT2_TIND_BLOCK, &ctx);
if (ret & BLOCK_ABORT)
goto abort_exit;
}
abort_exit:
if (ret & BLOCK_CHANGED) {
retval = ext2fs_write_inode(fs, EXT4INO, &inode);
if (retval) {
ret |= BLOCK_ERROR;
ctx.errcode = retval;
}
}
errout:
if (!block_buf)
ext2fs_free_mem(&ctx.ind_buf);
return (ret & BLOCK_ERROR) ? ctx.errcode : 0;
}
//___________________________________________________________________________________________________
|
orochi/ext4magic
|
src/block.c
|
C++
|
mit
| 21,399 |
#ifndef BLOCK_H
#define BLOCK_H
#include <ext2fs/ext2fs.h>
errcode_t local_block_iterate3(ext2_filsys fs,
struct ext2_inode inode,
int flags,
char *block_buf,
int (*func)(ext2_filsys fs,
blk64_t *blocknr,
e2_blkcnt_t blockcnt,
blk64_t ref_blk,
int ref_offset,
void *priv_data),
void *priv_data);
int read_block ( ext2_filsys, blk_t*, void* ); //read filesystem block
#ifdef EXT2_FLAG_64BITS
int read_block64 ( ext2_filsys, blk64_t*, void* ); //read filesystem block64
#endif
errcode_t local_ext2fs_extent_open(ext2_filsys, struct ext2_inode, ext2_extent_handle_t*);
void local_ext2fs_extent_free(ext2_extent_handle_t);
#endif //BLOCK_H
|
orochi/ext4magic
|
src/block.h
|
C++
|
mit
| 714 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
// A special linked list for collect directory entry
// Used for manage old directory blocks in journal
#include <stdio.h>
#include <stdlib.h>
#include "dir_list.h"
// add new Dir-List item
struct dir_list_t* add_list_item (struct dir_list_head_t *head , ext2_ino_t nr, char* name ,char entry){
struct dir_list_t *this;
if( !nr || (! strcmp(name,"")))
return head->last;
this = malloc(sizeof(struct dir_list_t));
if (! this)
goto errout;
this->filename = malloc(strlen(name) + 1);
if (! this->filename)
goto errout;
head->last->next = this;
head->last = this;
this->next = (struct dir_list_t*) head;
head->count++;
this->entry = entry;
this->inode_nr = nr;
strcpy(this->filename,name);
return (this);
errout:
fprintf(stderr,"no free memory\n");
if (this->filename) free(this->filename);
if (this) free(this);
return NULL;
}
// destroy Dir-List
int clear_dir_list(struct dir_list_head_t *head)
{
struct dir_list_t *next;
struct dir_list_t *this;
next = head->next;
while (next != (struct dir_list_t*) head){
this = next;
if (next->filename)
free(next->filename);
next = this->next;
free(this);
}
free(head->pathname);
free(head);
return 0;
}
// create a new Dir-List
struct dir_list_head_t* new_dir_list (ext2_ino_t path_inode, ext2_ino_t dir_inode, char *path, char *name){
struct dir_list_head_t *this;
int len_n;
this = malloc(sizeof(struct dir_list_head_t));
if (! this) return NULL;
this->next = (struct dir_list_t*) this;
this->last = (struct dir_list_t*) this;
this->path_inode = path_inode;
this->dir_inode = dir_inode;
this->count = 0;
len_n = strlen(path) + strlen(name) +2;
this->pathname = malloc(len_n);
if (this->pathname) {
strcpy(this->pathname, path);
if ((strlen(path) > 0) && strcmp(path,"/"))
strcat(this->pathname,"/");
this->dirname = strchr(this->pathname,0);
strcat(this->pathname , name);
}
else
{
if (this->pathname) free(this->pathname);
free(this);
return NULL;
}
return(this);
}
//local helper func ;check for duplicate values
static char d_find_entry(struct dir_list_head_t* dir , ext2_ino_t ino , char *filename){
char ret = 0;
struct dir_list_t *pointer = dir->next;
while (pointer != (struct dir_list_t*) dir){
if (strcmp(pointer->filename,filename))
pointer = pointer->next;
else {
if (pointer->inode_nr == ino)
return 1;
pointer = pointer->next;
}
}
return ret;
}
// sort out invalid values by data copy
struct dir_list_head_t* clean_up_dir_list(struct dir_list_head_t* o_dir ){
struct dir_list_head_t* n_dir;
int i;
char *p;
struct dir_list_t *pointer;
n_dir = new_dir_list(o_dir->path_inode,o_dir->dir_inode," "," ");
if (!n_dir)
return o_dir;
//change the allocatet names
p = n_dir->pathname;
n_dir->pathname = o_dir->pathname;
o_dir->pathname = p;
p = n_dir->dirname;
n_dir->dirname = o_dir->dirname;
o_dir->dirname = p;
//copy all practicable values
pointer = o_dir->next;
for (i = o_dir->count ; i>0 ; i-- , pointer = pointer->next ){
if ( (!pointer->inode_nr) || (pointer->filename[0] == 0) )
continue;
switch (pointer->entry){
case DIRENT_DOT_FILE:
// break;
case DIRENT_DOT_DOT_FILE:
break;
case DIRENT_OTHER_FILE:
// if (d_find_entry(n_dir , pointer->inode_nr , pointer->filename))
// continue;
// break;
case DIRENT_DELETED_FILE:
if (d_find_entry(n_dir , pointer->inode_nr , pointer->filename)||
(pointer->inode_nr < EXT2_GOOD_OLD_FIRST_INO))
continue;
break;
default:
continue;
}
if(! add_list_item (n_dir, pointer->inode_nr , pointer->filename,0))
fprintf(stderr, "ERROR by copy of dirlist");
}
clear_dir_list(o_dir);
return n_dir;
}
|
orochi/ext4magic
|
src/dir_list.c
|
C++
|
mit
| 5,056 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
// A special linked list for collect directory entry
// Used for manage old directory blocks in journal
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef DIR_LIST_H
#define DIR_LIST_H
#include <ext2fs/ext2fs.h>
//Dir-List item
struct dir_list_t {
struct dir_list_t *next;
char *filename;
ext2_ino_t inode_nr;
char entry;
};
//Dir-List header
struct dir_list_head_t {
struct dir_list_t *next;
struct dir_list_t *last;
char *dirname;
char *pathname;
ext2_ino_t path_inode;
ext2_ino_t dir_inode;
int count;
};
//function
struct dir_list_t* add_list_item (struct dir_list_head_t*, ext2_ino_t, char* ,char);
int clear_dir_list(struct dir_list_head_t*);
struct dir_list_head_t* new_dir_list ( ext2_ino_t, ext2_ino_t, char*, char*);
struct dir_list_head_t* clean_up_dir_list(struct dir_list_head_t* );
#define GET_FIRST(h) ((h)->count) ? (h)->next : NULL
#define GET_NEXT(h,i) ((i)->next != (struct dir_list_t*) (h)) ? (i)->next : NULL
#endif
|
orochi/ext4magic
|
src/dir_list.h
|
C++
|
mit
| 2,295 |
/*
* ext2fsP.h --- private header file for ext2 library
*
* Copyright (C) 1997 Theodore Ts'o.
*
* %Begin-Header%
* This file may be redistributed under the terms of the GNU Public
* License.
* %End-Header%
*/
#include <ext2fs/ext2fs.h>
/*
* Badblocks list
*/
struct ext2_struct_u32_list {
int magic;
int num;
int size;
__u32 *list;
int badblocks_flags;
};
struct ext2_struct_u32_iterate {
int magic;
ext2_u32_list bb;
int ptr;
};
/*
* Directory block iterator definition
*/
struct ext2_struct_dblist {
int magic;
ext2_filsys fs;
ext2_ino_t size;
ext2_ino_t count;
int sorted;
struct ext2_db_entry * list;
};
/*
* For directory iterators
*/
struct dir_context {
ext2_ino_t dir;
int flags;
char *buf;
int (*func)(ext2_ino_t dir,
int entry,
struct ext2_dir_entry *dirent,
int offset,
int blocksize,
char *buf,
void *priv_data);
void *priv_data;
errcode_t errcode;
};
/*
* Inode cache structure
*/
struct ext2_inode_cache {
void * buffer;
blk_t buffer_blk;
int cache_last;
int cache_size;
int refcount;
struct ext2_inode_cache_ent *cache;
};
struct ext2_inode_cache_ent {
ext2_ino_t ino;
struct ext2_inode inode;
};
/* Function prototypes */
extern int ext2fs_process_dir_block(ext2_filsys fs,
blk_t *blocknr,
e2_blkcnt_t blockcnt,
blk_t ref_block,
int ref_offset,
void *priv_data);
|
orochi/ext4magic
|
src/ext2fsP.h
|
C++
|
mit
| 1,451 |
.TH ext4magic 8 "Oct 2014" "version 0.3.2" "Administrations Tool"
.SH NAME
ext4magic \- recover deleted files on ext3/4 filesystems
.SH SYNOPSIS
.B ext4magic {\-M|\-m}
[\-j <journal_file>] [\-d <target_dir>] <filesystem>
.B ext4magic
[\-S|\-J|\-H|\-V|\-T] [\-x] [\-j <journal_file>] [\-B n|\-I n|\-f <file_name>|\-i <input_list>] [\-t n|[[\-a n][\-b n]]] [\-d <target_dir>] [\-R|\-r|\-L|\-l] [\-Q] <filesystem>
.SH DESCRIPTION
The deletion of files in ext3/4 filesystems can not be easily reversed.
Zero out of the block references in the Inodes makes that impossible.
Experience with other programs have proved, it is often possible, to
restore sufficient information for a recover of many data files, directly from the
filesystem Journal. ext4magic can extract the information from the
Journal, and can restore files in entire directory trees, provided that
the information in the Journal are sufficient. This tool can recover
the most file types, can recover large and sparse files,
recovered files with orginal filename, with the orginal owner an
group, the orginal file mode bits, and also the old atime/mtime stamp.
The filesystem Journal has a very different purpose, and it will not
be possible to recover any file at any time. Many factors affects which data and how
long the data store in the Journal. Read the ext4magic documentation for more
extensive information about the filesytem Journal.
.SH OPTIONS
.B
Magic Options:
These options are for a mulit-stage recover especially for file restore after a recursiv deletion of parts or the whole file system.
(third step currently available for ext3 by versions 0.2.x ; a for ext4 is included in version 0.3.x )
Umount the file system directly after an accidentally destroy and use these options with the umount file system or with a copy of this file system.
The program automatically determines the correct time options if the deletion has only worked a short time (< 5 min) . For very large deletions, you must use the "
.B
after time
"
In the first and second step files restored by copies of inodes.
The third step is trying to restore the remaining files without inode copies. This may take a long time
.TP
.B
\-M
Try to recover all files. This option should be used if the entire Filessytem was deleted.
.TP
.B
\-m
Try to recover only all deleted files. Use this option with a partially deleted Filesystem.
.PP
.B
Information Options:
These options generate generic status information from the filesystem and the Journal.
.TP
.B
\-S
Print the filesystem superblock, the option.
.B
\-x
allows the additional display of content of the group descriptor table.
.TP
.B
\-J
Print the content of the Journal superblock.
This option also can used to force loading the Journal. This has a flow control effect in ext4magic with some other options.
.TP
.B
\-H
Output a histogram of time stamps from all filesystem Inodes. Allows you to determine the exact time of changes in the filesystem. In connection with a directory name or a directory Inode, only the time stamps of this directory tree will be displayed. There are not evaluated any changes, only one per Inode. either the last change or the deletion time per Inode arrives to display. If present (ext4), it also create a histogram
of create time stamps.
The optional option
.B
\-x
allows additional a better resolution of the time intervals.
.TP
.B
\-V
Print the version of ext4magic and libext2fs
.TP
.B
\-T
Display the entire transaction list of all copies of data blocks in the Journal. In conjunction with the
.B
\-B ; \-I
and
.B
\-f
, only display the corresponding data blocks for this data . The optional option
.B
\-x
allows an additional transmission time of the transactions, but only if the block is a Inode block. The print is in the same order as the data in journal. You can make conclusions from the data received in the Journal.
After the import of backups or after change of timestamps of files, the additional transmission time will display not always the real transmission time.
If here absolutely incorrect time entries, then check if you using a journal of a read-write open file system.
.TP
.B
\-x
controls optional the output format and the information content of certain commands. Affects the following options:
.B
\-S ; \-H ; \-T ; \-B ; \-I ; \-f ; \-L ; \-l
Detailed description see there.
.PP
.B
Selection Options:
These options specify the exact files, directories, and data blocks. One hand, they produce specific information, and on the other hand,
be used to address the data for the
.B
Action Options.
ext4magic will accept only one of these options at command.
.TP
.B
\-B n
.B
n
is the data block number of a filesystem datablock. Without further options it print a "one-byte" hex+ASCII dump from the data block on the filesystem, like the
.B
"hexdump \-C"
command. The optional option
.B
\-x
produced a "four byte" hex+ASCII output.
With the option
.B
\-t n
it print a copy of the filesystem data block with this transaction number from the Journal.
.B
# ext4magic /dir/filesytem.iso \-B 97 \-t 22
print a hexdump of the copy from filesystem block number 97, which has been writing to the Journal with the transaction number 22. All copies of a particular data block in the Journal and the associated transaction numbers you can find with the optional Option
.B
\-T
.B
# ext4magic /dir/filesystem.iso \-B 97 \-T
will print a list with all copies of filesystem block number 97 with the transaction numbers. If this data block is a Inode block, print out the exact time for the transaction with the optional option
.B
\-x
.TP
.B
\-I n
.B
n
is the Inode number. Without any other option, the output is the content of the real filesystem Inode. With a optional
.B
\-x
additional output of a list of all data blocks addressed by this Inode. If Inode is a directory Inode, the content of the directory entrys also printed.
Together with one of the following option
.B
\-T ; \-J
the output is not the content from the real filesystem Inode. The content of all differend Inode copies found in the Journal are printed.
with the option
.B
\-t n
only the content of the Inode from transaction "
.B
n
" are printed.
the option
.B
\-I n
can also be used in conjunction with the options
.B
\-L ; \-l ; \-r
or
.B
\-R
(show there)
.TP
.B
\-f <filename>
the function is the same as
.B
\-I n
only here is the
.B
<filename>
given instead the Inode number. ext4magic search the filesystem to find the Inode number.
The filename can be a directory or a filename and must be specified here from the root directory of this filesystem, and not from the root directory of the LINUX system.
An example:
the mount point for this filesystem is "
.B
/home
" an the filename for Linux is "
.B
/home/usr1/Document
" you can use now
.B
# ext4magic /dev/sda3 \-f usr1/Document
The root directory of the filesystem you can use
.B
\-f /
or
.B
\-f ""
for ext4magic this is the same.
you should specify no leading "/" for all other filename. And directory names you should specify without final "/" .
.PP
.B
Expert Options:
(new 0.2.1) The optional Expert-Mode must be enabled with the option
.B
"\-\-enable\-expert\-mode"
by configure. This makes it possible to open and recover front corrupted file systems.
In the current version it is possible to address backup superblocks
and the attempt to recover of the Journal address from the data of the super block, and recover all undamaged files
after the filesytem was partially damaged or overwritten.
.TP
.B
\-s blocksize \-n blocknumber
with this options you can select the backup superblock.
.B
blocksize
can be 1024, 2048 or 4096.
.B
blocknumber
is the block number of the backup superblock this depends on the block size. Use the same values as with "fsck" or "debugfs"
or use the output of
.B
"mkfs \-n .."
to determine the correct value.
Use the options necessarily in the order
.B
"\-s ... \-n ..."
.TP
.B
\-c
This will attempt to find the journal using the data of the superblock.
Can help if the first inode blocks of the file system are damaged.
.TP
.B
\-D
trying a restore of all files from a badly damaged file system. The combination of all these Expert Options try a file system restore if the superblock broken and the beginning of the file system is corrupted or overwritten.
This can only work if
.B
e2fsck
has not yet changed the faulty file system.
Example : the first few megabytes of the file system are overwritten. The following tries a copy of all undamaged files of the filesystem. Target directory is "/tmp/recoverdir"
.B
# ext4magic /dev/sda1 \-s 4096 \-n 32768 \-c \-D \-d /tmp/recoverdir
.TP
.B
\-Q
This is a optional high quality Option for recover and only impact with "
.B
\-r
" and "
.B
\-R
". Without this option, any valid file name restored from the directories and you can set the "
.B
before
" time stamp to a time in which all files are deleted. So you will find the maximum possible number of files.
It need not necessarily be found old directory data blocks in the Journal.
However, there are some files found too much. In this mode, re-used file name and reused Inode can not be noticed. As a result some file will be created with the extension "
.B
"#"
or some files created with wrong content. You have to check the files and find bad files and delete itself.
With option "
.B
\-Q
" works ext4magic more accurately, and can avoid such false and duplicate files. This requires old data blocks of the directories in the Journal. You will not find of all directories those old blocks in the Journal. Only directories in which files have been previously created or deleted, but not of directories in which no change has been a long time. You should set the time stamp "
.B
before
" immediately before destruction time of the files. Are not sufficient directory data available, may be, ext4magic can't found deleted files or entire directory content. This option should be used very carefully and will achieve good results only in a few directories.
.PP
.B
Time Options:
With this options you specify a time window at which the program searches for matching time stamps in the Journal data.
ext4magic required for most internaly functions two times. A time "after" and a time "before".
Found Inode only accepted, if not deleted and there time stamp less than "before". If the delete time is less then "after", the Inode are also not used. ext4magic is still trying to find for valid directory Inode also a time-matching directory data. For a recover action "before" set to a value at which the data deleted, and
"after" set to a value at which the data available. Inodes and directory data with other timestamps will be skipped and not used.
Default, without any time option, ext4magic will search with "now" for the internal time "before", and
"now \-24 hour" for the internal time "after". If you try to recover without any time option, so you search only over the last 24 hours. If you wait a couple of days before you try to recover deleted data, you must always use time options, or you find nothing
.TP
.B
\-a n
with this option you can set the "
.B
after
" time
.TP
.B
\-b n
with this option you can set the "
.B
before
" time
.B
n
is the number of seconds since 1970-01-01 00:00:00 UTC. This time information can you find in many prints of ext4magic, and you can it produce on the console with the command "date" and also insert directly in the ext4magic command line.
.B
\-a $(date \-d "\-3day" +%s) \-b $(date \-d "\-2day" +%s)
this example set "after=now-36h" and "before=now-24h"
.TP
.B
\-t n
is an indirect time option. you can use it with the options
.B
\-B ; \-I ; \-f
The value
.B
n
is the transaction number. With this option you can print, list, or recover the data from this transaction number.
you can find the transaction numbers with the option
.B
\-T
or in the print of the Inode content.
.PP
.B
File\-, IN\- and OUT\-Options:
With these options group, you select the filesystem, and other optional file input and output for control of ext4magic.
.TP
.B
\<filesystem>
selects the filesystem and must always be set.
.B
<filesystem>
can be a blockdevice with ext3/4 filesystem, it can also be a uncompressed file image of such a partition.
.TP
.B
\-j <journal_file>
optional you can select a external copy of the Journal file. Without this option, automatically the internal Journal or, if configured, the external Journal on a block device will used.
.TP
.B
\-d <target_dir>
select the output directory. There, the recovered files were written. If it does not exist, it is created. By default, created files are written to the subdirectory "
.B
RECOVERDIR
" in the workpath of the actual shell. This output directory can not be on the same filesystem to be tested filesytem, and should have sufficient space to write the recovered files. The filesystem on this directory should be also ext3/4, otherwise, not LINUX like filesytems generate some errors while writing the file properties.
Either you must first changed with the shell in such a suitable filesystem, or you must specify the
.B
\-d
with a target to such a directory
.TP
.B
\-i <input_list>
input_list is a input file. Must contain a list with double-quoted filenames. The files from the list will be restored with option
.B
\-r
or
.B
\-R
Blank lines, not cleanly double quoted filenames and all areas before and after
.B
"
will be ignored.
Such a double-quoted list of file names can create with options
.B
\-l \-x
or
.B
\-L \-x
by ext4magic and edited by script or by hand.
.PP
.B
Action Options:
This option group includes list and recover options. All functions together, they work recursiv controlled by the time options through directory trees. The starting point for search is determined by a directory name or a directory Inode number. Default is root of this Filesystem. Matching the time options, the filesystem data, inclusive directory data, taken from the Journal. If good data from the file system sections available in Journal, it is possible to see or recover the state of the filesystem at different times.
.TP
.B
\-L
Prints the list of all filenames and Inode number of the selected directory tree. Included here also are deleted files and deleted directory trees.
With the additional option.
.B
\-x
the file names are printed double-quoted. You can use it for a "Input list" with option
.B
\-i
.TP
.B
\-l
Prints a list of all filenames which have not allocated data blocks. At the beginning of the line are the percentage of unallocated data blocks.
After deletion you find here all the file names you can recover with the Journal data. If you use a very old value for the "before" time, it is possible there are files whose data blocks reused and these files in the interim also been deleted. Also included in the list all files without data blocks, symbolic links, empty and other special files.
Likewise double-quoted file names with optional
.B
\-x
.TP
.B
\-r
applied to directories, all files without conflicts with the occupied blocks will recovered. This are all you can sea with the option
.B
\-l
and be 100% unallocated. This options only recover deleted files and files without data blocks, in example: symbolic links or empty files.
The recovered files written to the
.B
RECOVERDIR/
This can also set to an alternate <target_dir> with the option
.B
\-d
All files become the old filename and if possible, also the old file properties. A subdirectory tree can set with
.B
"\-f dirname"
oder
.B
"\-I inodenumber"
If use with a given Inode number, the directory name is set to
.B
<inodenumber>
The Time options affect the search. If a file name already exists, or you recover again, it not overwrite files, and a new filename by added a final
.B
"#"
will created. The maximum ist the extension "
.B
#####
" for a filename.
single files also can recovered, possible search with time-stamps or transaction number.
.B
(new 0.2.1):
Starts this function from the root directory the first stage of the magic functions will follow.
This starts
.B
"lost directory search"
and
.B
"lost file search"
and recovers all the deleted inode that can not be assigned to a file name.
These files you can find in the directories MAGIC-1 and MAGIC-2
.TP
.B
\-R
recovers directory tree, is the same as
.B
\-r
But two very important differences:
Recover of all matched Inodes, even if the blocks allocated,
and recover if possible the old directory properties. Also empty dirctories will be restored.
This recovers all deleted and all undeleted files, and it's possible to recover older file versions or directory versions.
In completely deleted directories the behavior "
.B
\-R
" and "
.B
\-r
" is identical. The difference is there only the complete recover of all directories with option "
.B
\-R
".
You can also restore individual files with time options or a transaction number.
.PP
.B
For all recover cases
ACL, SEL and other extended attribute can not recovered in the current version.
The output starts at line with a string "--------" before the recovered file name. This is a sign of successful recover. Are not enough permissions to write the recovered files, then you will see there some "x" in the string.
At the end of the process, possibly an issue comes from the hardlink database. A positive number before a file name means : not found all hardlinks to this file. A negative number means : it created too many hardlinks to this file (possible are, reused filenames or reused Inodes, and so, too many or wrong old filenames for this hardlink. But also possible, all files for this hardlink are correct, the time options was not set correct and because of that, the selected inode for the recover was not up to date. You should check such reports.)
Re-used data blocks can't realize and so it's possible, it ends in some corrupted files.
Check in any case, all the recoverd files before you use them.
.SH EXAMPLES
.TP
Print the content of a Inode, there are some possibilities.
.B
# ext4magic /dev/sda3 \-f /
.B
# ext4magic /dev/sda3 \-I 2
the output is the actual filesystem root Inode. In first example input the pathname, second example Inode 2 is also the root directory
.B
# ext4magic /tmp/filesystem.iso \-f / \-T \-x
use filesystem image "/tmp/filesystem.iso", search and print all transactions of the Block which included the root Inode, and print all differend
Inode. Inclusiv the blocklist off the data blocks. If it's a directory, then print also for each individual Inode the content of the directory.
.B
# ext4magic /tmp/filesystem.iso \-j /tmp/journal.backup \-I 8195 \-t 182
Use filesystem image "/tmp/filesystem.iso" and read from external Journal in file "/tmp/journal.backup" and
print the content of the Inode number 8195 from the journal transaction number 182
.B
# ext4magic /dev/sda3 \-f user1/Documents \-a $(date \-d "\-3 day" +%s) \-b $(date \-d "\-2 day" +%s)
print a undeleded Inode for pathname "user1/Documents" two to three days back. If it's a directory, then also the content of this directory.
If can not found the old directory blocks in Journal, the directory content would be the actual from filesystem.
.TP
Examples of simple Recover
.B
# ext4magic /dev/sda3 \-r \-f user1/picture/cim01234.jpg \-d /tmp
Recover the file "/home/user1/picture/cim01234.jpg" which has just been deleted. The file system is mounted normally under "/home".
Note the file path is specified from the root directory of the file system and not from the root of the entire Linux system. Whenever possible, umount the file system for the recover. The file will be written as "/tmp/user1/picture/cim01234.jpg"
.B
# ext4magic /dev/sda3 \-r
try to restore all files deleted last 24 hours. Write to directory "./RECOVERDIR/"
.B
# ext4magic /dev/sda3 \-R \-a $(date \-d "\-5day" +%s)
Attempts to recover all files, even if they are already partially overwritten, recover also all not deleted files.
The erase time is 4 days ago.
.B
# ext4magic /dev/sda3 \-M \-d /home/recover
try multi-stage recover of all files after the filesystem is deleted with a "rm \-rf *" . Write the files to "/home/recover". (on ext4 : in this version skipped the last step.)
.B
# ext4magic /dev/sda3 \-RQ \-f user1/Dokuments \-a 1274210280 \-b 1274211280 \-d /mnt/testrecover
try to restore the directory tree "user1/Dokuments/". The "\-b" timestamp you must set just before deleting files, the "\-a" timestamp prevents found old file versions. This will only work well, if you've there created or deleted files bevor the "\-b" timestamp. Write to the directory "/mnt/testrecover/". If only a few files recovers, attempts the same without the option
.B
\-Q
.B
# ext4magic /home/filesystem.iso \-Lx \-f user1 | grep "jpg" > ./tmpfile
.B
# ext4magic /home/filesystem.iso \-i ./tmpfile \-r \-d /mnt/testrecover
try to restore only all deleted files from directory tree "user1/", and have "jpg" in filename. (last 24 hour) and write to "/mnt/testrecover" - use a temporary file "./tmpfile" for a list of filenames.
.SH BUGS
Direct use of the Journal of a currently read-write open filesystem produce reading of bad blocks. Such bad blocks provide program errors and false results. You shall therefore never use the Journal of such a read-write open file system directly.
Should it be necessary to use a mounted file system, create a copy of the file system journal and used the option
.B
\-j
.SH AUTHOR
Roberto Maar
.SH SEE ALSO
.B
debugfs
(8) ,
.B
e2fsck
(8)
|
orochi/ext4magic
|
src/ext4magic.8
|
8
|
mit
| 21,625 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#else
extern int optind;
extern char *optarg;
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
/* ext3/4 libraries */
#include <ext2fs/ext2fs.h>
#include <e2p/e2p.h>
//local header files
#include "util.h"
#include "ext4magic.h"
#include "journal.h"
#include "inode.h"
#include "hard_link_stack.h"
#include "block.h"
char* magicfile = NULL;
ext2_filsys current_fs = NULL;
ext2_ino_t root, cwd;
ext2fs_inode_bitmap imap = NULL ;
ext2fs_block_bitmap bmap = NULL ;
time_t now_time ;
//print Versions an CPU-endian-type
void print_version ( void )
{
printf("ext4magic version : %s\n",(char*) &VERSION);
const char *libver;
ext2fs_get_library_version ( &libver, NULL );
printf("libext2fs version : %s\n",libver);
int n = 1 ;
if ( * ( char * ) &n == 1 ) // True if the cpu is little endian.
printf("CPU is little endian.\n");
else
printf("CPU is big endian.\n");
#ifdef EXPERT_MODE
printf("Expert Mode is activ\n");
#endif
}
//subfunction for show_super_stats()
#ifdef EXT2_FLAG_64BITS
static void print_bg_opts(ext2_filsys fs, dgrp_t group, int mask,
const char *str, int *first, FILE *f)
{
if (ext2fs_bg_flags_test(fs, group, mask)) {
if (*first) {
fputs(" [", f);
*first = 0;
} else
fputs(", ", f);
fputs(str, f);
}
}
#else
static void print_bg_opts(struct ext2_group_desc *gdp, int mask,
const char *str, int *first, FILE *f)
{
if (gdp->bg_flags & mask) {
if (*first) {
fputs(" [", f);
*first = 0;
} else
fputs(", ", f);
fputs(str, f);
}
}
#endif
//print superblock
void show_super_stats(int header_only)
{
#ifdef EXT2_FLAG_64BITS
const char *units ="block";
#endif
dgrp_t i;
FILE *out;
struct ext2_group_desc *gdp;
int numdirs = 0, first, gdt_csum;
out=stdout;
list_super2(current_fs->super, out);
if (! header_only) {
return;
}
for (i=0; i < current_fs->group_desc_count; i++)
#ifdef EXT2_FLAG_64BITS
numdirs += ext2fs_bg_used_dirs_count(current_fs, i);
#else
numdirs += current_fs->group_desc[i].bg_used_dirs_count;
#endif
fprintf(out, "Directories: %d\n", numdirs);
gdt_csum = EXT2_HAS_RO_COMPAT_FEATURE(current_fs->super,
EXT4_FEATURE_RO_COMPAT_GDT_CSUM);
#ifdef EXT2_FLAG_64BITS
for (i = 0; i < current_fs->group_desc_count; i++) {
fprintf(out, " Group %2d: block bitmap at %llu, "
"inode bitmap at %llu, "
"inode table at %llu\n"
" %u free %s%s, "
"%u free %s, "
"%u used %s%s",
i, ext2fs_block_bitmap_loc(current_fs, i),
ext2fs_inode_bitmap_loc(current_fs, i),
ext2fs_inode_table_loc(current_fs, i),
ext2fs_bg_free_blocks_count(current_fs, i), units,
ext2fs_bg_free_blocks_count(current_fs, i) != 1 ?
"s" : "",
ext2fs_bg_free_inodes_count(current_fs, i),
ext2fs_bg_free_inodes_count(current_fs, i) != 1 ?
"inodes" : "inode",
ext2fs_bg_used_dirs_count(current_fs, i),
ext2fs_bg_used_dirs_count(current_fs, i) != 1 ? "directories"
: "directory", gdt_csum ? ", " : "\n");
if (gdt_csum)
fprintf(out, "%u unused %s\n",
ext2fs_bg_itable_unused(current_fs, i),
ext2fs_bg_itable_unused(current_fs, i) != 1 ?
"inodes" : "inode");
first = 1;
print_bg_opts(current_fs, i, EXT2_BG_INODE_UNINIT, "Inode not init",
&first, out);
print_bg_opts(current_fs, i, EXT2_BG_BLOCK_UNINIT, "Block not init",
&first, out);
if (gdt_csum) {
fprintf(out, "%sChecksum 0x%04x",
first ? " [":", ", ext2fs_bg_checksum(current_fs, i));
first = 0;
}
if (!first)
fputs("]\n", out);
}
#else
gdp = ¤t_fs->group_desc[0];
for (i = 0; i < current_fs->group_desc_count; i++, gdp++) {
fprintf(out, " Group %2d: block bitmap at %u, "
"inode bitmap at %u, "
"inode table at %u\n"
" %d free %s, "
"%d free %s, "
"%d used %s%s",
i, gdp->bg_block_bitmap,
gdp->bg_inode_bitmap, gdp->bg_inode_table,
gdp->bg_free_blocks_count,
gdp->bg_free_blocks_count != 1 ? "blocks" : "block",
gdp->bg_free_inodes_count,
gdp->bg_free_inodes_count != 1 ? "inodes" : "inode",
gdp->bg_used_dirs_count,
gdp->bg_used_dirs_count != 1 ? "directories"
: "directory", gdt_csum ? ", " : "\n");
if (gdt_csum)
fprintf(out, "%d unused %s\n",
gdp->bg_itable_unused,
gdp->bg_itable_unused != 1 ? "inodes":"inode");
first = 1;
print_bg_opts(gdp, EXT2_BG_INODE_UNINIT, "Inode not init",
&first, out);
print_bg_opts(gdp, EXT2_BG_BLOCK_UNINIT, "Block not init",
&first, out);
if (gdt_csum) {
fprintf(out, "%sChecksum 0x%04x",
first ? " [":", ", gdp->bg_checksum);
first = 0;
}
if (!first)
fputs("]\n", out);
}
#endif
return;
}
//open and init the Filesystem, use in main()
static void open_filesystem(char *device, int open_flags, blk_t superblock,
blk_t blocksize, int magicscan,
char *data_filename)
{
int retval;
io_channel data_io = 0;
if (superblock != 0 && blocksize == 0) {
fprintf(stderr,"if you specify the superblock, you must also specify the block size\n");
current_fs = NULL;
return;
}
if (data_filename) {
if ((open_flags & EXT2_FLAG_IMAGE_FILE) == 0) {
fprintf(stderr,"The -d option is only valid when reading an e2image file\n");
current_fs = NULL;
return;
}
retval = unix_io_manager->open(data_filename, 0, &data_io);
if (retval) {
fprintf(stderr,"%s while opening data source\n" ,data_filename);
current_fs = NULL;
return;
}
}
if (open_flags & EXT2_FLAG_RW) {
open_flags &= ~EXT2_FLAG_RW;
}
// open_flags |= EXT2_FLAG_64BITS;
retval = ext2fs_open(device, open_flags, superblock, blocksize,
unix_io_manager, ¤t_fs);
if (retval) {
fprintf(stderr,"%s Error %d while opening filesystem \n", device, retval);
current_fs = NULL;
return;
}
retval = ext2fs_read_inode_bitmap(current_fs);
if (retval) {
fprintf(stderr,"%s Error %d while reading inode bitmap\n", device, retval);
goto errout;
}
retval = ext2fs_read_block_bitmap(current_fs);
if (retval) {
fprintf(stderr,"%s Error %d while reading block bitmap\n",device, retval);
goto errout;
}
if (magicscan){
// switch on magic scan function
#ifdef EXT2_FLAG_64BITS
if( ext2fs_copy_generic_bmap(current_fs->inode_map, &imap) || ext2fs_copy_generic_bmap(current_fs->block_map, &bmap)){
#else
if( ext2fs_copy_bitmap(current_fs->inode_map, &imap) || ext2fs_copy_bitmap(current_fs->block_map, &bmap)){
#endif
fprintf(stderr,"%s Error while copy bitmap\n",device );
imap = NULL;
bmap = NULL;
}else{
int i;
#ifdef EXT2_FLAG_64BITS
ext2fs_clear_generic_bmap(imap);
for (i = 1; i < current_fs->super->s_first_ino; i++)//mark inode 1-8
ext2fs_mark_generic_bmap(imap,(blk64_t) i);
ext2fs_clear_generic_bmap(bmap);
#else
ext2fs_clear_inode_bitmap(imap);
for (i = 1; i < current_fs->super->s_first_ino; i++)//mark inode 1-8
ext2fs_mark_generic_bitmap(imap,i);
ext2fs_clear_block_bitmap(bmap);
#endif
}
}
if (data_io) {
retval = ext2fs_set_data_io(current_fs, data_io);
if (retval) {
fprintf(stderr,"%s Error %d while setting data source\n", device, retval);
goto errout;
}
}
root = cwd = EXT2_ROOT_INO;
return;
errout:
#ifdef DEBUG
printf("Errout : open ext2fs\n");
#endif
retval = ext2fs_close(current_fs);
if (retval)
fprintf(stderr, "%s Error %d while trying to close filesystem\n", device, retval);
current_fs = NULL;
}
//subfunction for main
void print_modus_error(){
char message0[] = "Invalide parameter : only input of one modus allowed [ -M | -m | -R | -r | -L | -l | -H | D ]\n";
fprintf(stderr,"%s",message0);
}
//-------------------------------------------------------------------------------------------------------------
// the main() function
int main(int argc, char *argv[]){
char* progname = argv[0];
int retval, exitval;
char defaultdir[] = "RECOVERDIR" ;
//FIXME : usage is not correct
const char *usage = "\next4magic -M [-j <journal_file>] [-d <target_dir>] <filesystem> \n\
ext4magic -m [-j <journal_file>] [-d <target_dir>] <filesystem> \n\
ext4magic [-S|-J|-H|-V|-T] [-x] [-j <journal_file>] [-B n|-I n|-f <file_name>|-i <input_list>] [-t n|[[-a n][-b n]]] [-d <target_dir>] [-R|-r|-L|-l] [-Q] <filesystem>";
int l,c ;
int open_flags = EXT2_FLAG_SOFTSUPP_FEATURES;
int recovermodus = 0 ;
int disaster = 0;
int recoverquality = DELETED_OPT; // default use also delete dir entry
char *j_file_name = NULL;
char *pathname = NULL;
char *des_dir = NULL;
char *input_filename = NULL;
blk_t superblock = 0;
blk_t blocksize = 0;
__u32 transaction_nr = 0;
int magicscan = 0;
char *data_filename = 0;
int mode = 0;
ext2_ino_t inode_nr = EXT2_ROOT_INO ;
blk_t block_nr = 0;
int format = 0;
int journal_flag = JOURNAL_CLOSE ;
int journal_backup = 0;
__u32 t_before = 0;
__u32 t_after = 0;
struct stat filestat;
// Sanity checks on the user.
if ((argc == 1) || ((argc == 2) && (!(strstr(argv[1],"-V"))))) // allow '-V' as single argument
{
printf("%s : Error: Missing device name and options.\n", progname);
printf("%s \n", usage);
return EXIT_FAILURE;
}
// set default Time from "now -1 day" to "now"
time( &now_time );
t_before = (__u32) now_time;
t_after = t_before - 86400 ;
// decode arguments
#ifdef EXPERT_MODE
while ((c = getopt (argc, argv, "TJRMLlmrQSxi:t:j:f:Vd:B:b:a:I:Hs:n:cD")) != EOF) {
#else
while ((c = getopt (argc, argv, "TJRMLlmrSxi:t:j:f:Vd:B:b:a:I:H")) != EOF) {
#endif
switch (c) {
case 'M':
//not active, still in development
if(mode & RECOVER_INODE){
print_modus_error();
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= RECOVER_INODE;
mode |= READ_JOURNAL;
recovermodus = RECOV_ALL ;
magicscan = 1;
break;
case 'm':
//not active, still in development
if(mode & RECOVER_INODE){
print_modus_error();
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= RECOVER_INODE;
mode |= READ_JOURNAL;
recovermodus = RECOV_DEL ;
magicscan = 1;
break;
case 'S':
mode |= PRINT_SUPERBLOCK ;
break;
case 'H':
if(mode & RECOVER_INODE){
print_modus_error();
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= RECOVER_INODE;
mode |= PRINT_HISTOGRAM ;
break;
case 'R':
if(mode & RECOVER_INODE){
print_modus_error();
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= RECOVER_INODE;
mode |= READ_JOURNAL;
recovermodus = RECOV_ALL ;
break;
case 'r':
if(mode & RECOVER_INODE){
print_modus_error();
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= RECOVER_INODE;
mode |= READ_JOURNAL;
recovermodus = RECOV_DEL ;
break;
case 'L':
if(mode & RECOVER_INODE){
print_modus_error();
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= RECOVER_INODE;
mode |= READ_JOURNAL;
recovermodus = LIST_ALL ;
break;
case 'l':
if(mode & RECOVER_INODE){
print_modus_error();
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= RECOVER_INODE;
mode |= READ_JOURNAL;
recovermodus = LIST_STATUS ;
break;
case 'd':
des_dir = optarg;
//we check later
break;
case 'i':
mode |= RECOVER_LIST;
mode |= READ_JOURNAL;
input_filename = optarg;
retval = stat (input_filename, &filestat);
if (retval){
fprintf(stderr,"Error: Invalid parameter: -i %s\n", optarg);
fprintf(stderr,"filestat %s returns error %d\n", input_filename, retval);
exitval = EXIT_FAILURE ;
goto errout;
}
else{
if (S_ISREG(filestat.st_mode) && (! access(input_filename,R_OK))){
printf("\"%s\" accept for inputfile \n",input_filename);
}
else {
fprintf(stderr,"ERROR: can not use \"%s\" for inputfile\n",input_filename);
exitval = EXIT_FAILURE ;
goto errout;
}
}
break;
case 'I':
if (mode & COMMAND_INODE){
fprintf(stderr,"Warning: only input of one inodeNR or filename allowed\n");
break;
}
mode |= COMMAND_INODE ;
errno = 0;
inode_nr = strtoul ( optarg, NULL, 10 );
if ( errno )
{
fprintf(stderr,"Error: Invalid parameter: -I %s \n", optarg );
exitval = EXIT_FAILURE ;
goto errout;
}
if ( inode_nr < 1 )
{
fprintf(stderr,"Error: %s -I: inodeNR \n", progname);
fprintf(stderr,"%lu is out of range\n", (long unsigned int)inode_nr);
exitval = EXIT_FAILURE ;
goto errout;
}
break;
case 'B':
mode |= COMMAND_BLOCK ;
errno = 0;
block_nr = strtoul ( optarg, NULL, 10 );
if ( errno )
{
fprintf(stderr,"Error: Invalid parameter: -B %s \n", optarg );
exitval = EXIT_FAILURE ;
goto errout;
}
if ( block_nr < 1 )
{
fprintf(stderr,"Error: %s -B: blockNR \n", progname);
fprintf(stderr,"%lu is out of range\n", (long unsigned int)block_nr);
exitval = EXIT_FAILURE ;
goto errout;
}
break;
case 't':
mode |= PRINT_TRANSACTION ;
mode |= READ_JOURNAL;
errno = 0;
transaction_nr = strtoul ( optarg, NULL, 10 );
if ( errno )
{
fprintf(stderr,"Error: Invalid parameter: -t %s \n", optarg );
exitval = EXIT_FAILURE ;
goto errout;
}
if ( transaction_nr < 1 )
{
fprintf(stderr,"Error: %s -t: transactionNR \n", progname);
fprintf(stderr,"%lu is out of range\n", (long unsigned int)transaction_nr);
exitval = EXIT_FAILURE ;
goto errout;
}
break;
case 'x':
format = 1;
break;
case 'j':
j_file_name = optarg;
retval = stat (j_file_name, &filestat);
if (retval){
fprintf(stderr,"Error: Invalid parameter: -j %s\n", optarg);
fprintf(stderr,"filestat %s returns error %d\n", j_file_name, retval);
exitval = EXIT_FAILURE ;
goto errout;
}
break;
case 'f':
if (mode & COMMAND_INODE){
fprintf(stderr,"Warning: only input of one inodeNR or filename allowed\n");
break;
}
mode |= COMMAND_INODE ;
mode |= COMMAND_PATHNAME ;
l = strlen(optarg);
pathname = malloc( l+1 );
strcpy(pathname,optarg);
break;
#ifdef EXPERT_MODE
case 'Q':
mode |= HIGH_QUALITY;
break;
case 'c': // use a backup journal inode
journal_backup=1;
break;
case 'D': // Disaster recovery
if(mode & RECOVER_INODE){
print_modus_error();
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= RECOVER_INODE;
mode |= READ_JOURNAL;
recovermodus = RECOV_ALL ;
disaster = 2;
break;
case 's':
blocksize = parse_ulong(optarg, argv[0],
"block size", 0);
if ((!blocksize) || (blocksize % 1024)){
fprintf(stderr,"Error: Invalid parameter: -s %d\n", blocksize);
fprintf(stderr,"ERROR: blocksize allowed only 1024 ; 2048 or 4096\n");
exitval = EXIT_FAILURE ;
goto errout;
}
break;
case 'n':
superblock = parse_ulong(optarg, argv[0],
"superblock number", 0);
if ((!superblock) || (!blocksize) || ((blocksize * 8) > superblock)){
fprintf(stderr,"Error: Invalid parameter: -s %d\n", superblock);
switch (blocksize){
case 1024:
fprintf(stderr, "blocksize 1024 possible 8193, 24577, 40961, 57345 ....\n");
break;
case 2048:
fprintf(stderr, "blocksize 2048 possible 16384, 49152, 81920, 114688 ....\n");
break;
case 4096:
fprintf(stderr, "blocksize 4096 possible 32768, 98304, 163840, 229376 ....\n");
break;
default:
fprintf(stderr, "blocksize unknown\n");
}
exitval = EXIT_FAILURE ;
goto errout;
}
break;
#endif
case 'T':
mode |= PRINT_BLOCKLIST;
mode |= READ_JOURNAL;
break;
case 'J':
mode |= PRINT_J_SUPERBLOCK;
mode |= READ_JOURNAL;
break;
case 'b':
errno = 0;
t_before = strtoul ( optarg, NULL, 10 );
if ( errno )
{
fprintf(stderr,"Error: Invalid parameter: -b %s \n", optarg );
exitval = EXIT_FAILURE ;
goto errout;
}
if ( t_before < 1 )
{
fprintf(stderr,"Error: %s -b: time \n", progname);
fprintf(stderr,"%lu is out of range\n", (long unsigned int)inode_nr);
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= INPUT_TIME;
break;
case 'a':
errno = 0;
t_after = strtoul ( optarg, NULL, 10 );
if ( errno )
{
fprintf(stderr,"Error: Invalid parameter: -a %s \n", optarg );
exitval = EXIT_FAILURE ;
goto errout;
}
if ( t_after < 1 )
{
fprintf(stderr,"Error: %s -a: time \n", progname);
fprintf(stderr,"%d is out of range\n", inode_nr);
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= INPUT_TIME;
break;
case 'z': //experimental not activ at default
data_filename = optarg;
break;
case 'y': //experimental not activ at default
open_flags |= EXT2_FLAG_IMAGE_FILE;
break;
case 'V':
print_version();
exit(0);
default:
fprintf(stderr,"Usage: %s %s\n",argv[0], usage);
exitval = EXIT_FAILURE ;
goto errout;
}
}
if (getuid()) mode = 0;
if (optind < argc)
open_filesystem(argv[optind], open_flags,superblock, blocksize, magicscan, data_filename);
if (! current_fs) mode = 0;
#ifdef DEBUG
printf("Operation-mode = %d\n", mode);
#endif
//--------------------------------------------------------------------------------------------
// check any parameter and options
// check time option
if ((mode && magicscan) || disaster){
printf("Warning: Activate magic-scan or disaster-recovery function, may be some command line options ignored\n");
inode_nr = EXT2_ROOT_INO;
t_before = (__u32) now_time;
if (disaster){
t_after = t_before - 60;
printf("Start ext4magic Disaster Recovery\n");
}
else{
mode &= MASK_MAGIC_SCAN;
if ((!(mode & INPUT_TIME)) || (t_after == t_before - 86400)){
t_after = get_last_delete_time(current_fs);
if (! (t_after + 1) ){
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= INPUT_TIME;
}
magicfile = malloc(64);
memset(magicfile,0,64);
strncpy (magicfile,"/usr/share/misc/ext4magic",25);
retval = stat (magicfile, &filestat);
if (retval){
strncpy (magicfile,"/usr/local/share/misc/ext4magic",31);
retval = stat (magicfile, &filestat);
}
if ((! retval) && (S_ISREG(filestat.st_mode) && (! access(magicfile,R_OK)))) {
printf("use magic-db on \"%s\"\n",magicfile);
}
else {
free(magicfile);
magicfile=NULL;
}
}
}
if (mode & INPUT_TIME){
if (! ((t_after > 315601200) && (t_after < t_before))) // 315601200 = "1980-01-01 20:00:00"
{
fprintf(stderr,"Invalide parameter: range \"AFTER <--> BEFORE\"\n");
fprintf(stderr,"the automatic default parameter AFTER=\"now -1 day\" ; BEFORE=\"now\"\n");
fprintf(stderr,"\"-b before-timestamp\" must greater then \"-a after-timestamp\"\n");
fprintf(stderr,"Example : %s -H -b $(date +%%s) -a $(date -d \"-1 day\" +%%s) %s\n",progname,current_fs->device_name);
exitval = EXIT_FAILURE ;
goto errout;
}
if (mode & PRINT_TRANSACTION){
fprintf(stderr,"Invalide parameter: use either Transaction-Nr or Timestamps for search in Journal\n");
exitval = EXIT_FAILURE ;
goto errout;
}
mode |= READ_JOURNAL;
}
//check for the recoverdir
if (((mode & RECOVER_INODE) && (recovermodus & REC_DIR_NEEDED)) || mode & RECOVER_LIST || magicscan) {
struct stat st_buf;
dev_t file_rdev=0;
if(!des_dir)
des_dir = defaultdir;
retval = stat (des_dir, &filestat);
if (retval){
retval = mkdir(des_dir , S_IRWXU);
if (retval && (errno != EEXIST)){
fprintf(stderr,"ERROR: can not create the recover directory: %s\n", des_dir);
exitval = EXIT_FAILURE ;
goto errout;
}
else
retval = stat (des_dir, &filestat);
}
if (!retval){
if (S_ISDIR(filestat.st_mode) && (filestat.st_mode & S_IRWXU) == S_IRWXU){
if (stat(argv[optind], &st_buf) == 0) {
if (S_ISBLK(st_buf.st_mode)) {
#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
file_rdev = st_buf.st_rdev;
#endif /* __GNU__ */
} else {
file_rdev = st_buf.st_dev;
}
}
if ((filestat.st_dev == file_rdev) && (S_ISBLK(st_buf.st_mode))){
fprintf(stderr,"ERROR: can not use \"%s\" for recover directory. It's the same filesystem : \"%s\"\n", des_dir, argv[optind]);
exitval = EXIT_FAILURE ;
#ifdef DEBUG
printf("recover_dir_dev : %d filesystem_dev : %d\n",(int)filestat.st_dev, (int)file_rdev);
#endif
goto errout;
}
printf("\"%s\" accept for recoverdir\n",des_dir);
}
else {
fprintf(stderr,"ERROR: can not use \"%s\" for recover directory\n", des_dir);
exitval = EXIT_FAILURE ;
goto errout;
}
}
else{
fprintf(stderr,"Error: Invalid parameter: -d %s \n", des_dir );
exitval = EXIT_FAILURE ;
goto errout;
}
// set quality
if (mode & HIGH_QUALITY)
recoverquality = 0 ; // not use of delete dir entry
}
//mark for douple quotes filename
if ((recovermodus & (LIST_ALL | LIST_STATUS)) && format)
recovermodus |= DOUPLE_QUOTES_LIST;
//................................................................................................
// begin Operation
if (current_fs) {
// printf( "Open mode: read-%s\n", current_fs->flags & EXT2_FLAG_RW ? "write" : "only");
printf("Filesystem in use: %s\n\n",current_fs ? current_fs->device_name : "--none--");
init_link_stack();
// print filesystem superblock
if ((mode & PRINT_SUPERBLOCK) && (! ( mode & READ_JOURNAL))) show_super_stats(format);
// print histogram over inodeblock
if (mode & PRINT_HISTOGRAM){
if (mode & COMMAND_INODE){
mode |= READ_JOURNAL;
recovermodus = HIST_DIR ;
}
else {
mode = 0 ;
read_all_inode_time(current_fs,t_after,t_before,format);
}
}
// no file or directory is given, use the default root-inode at now and set COMMAND_INODE flag
if((mode & RECOVER_INODE) && (! (mode & COMMAND_INODE)))
mode |= COMMAND_INODE ;
// print filesystem inode
if ((mode & COMMAND_INODE) && (! (mode & READ_JOURNAL)))
{
int allocated;
retval = 0;
struct ext2_inode *inode_buf;
// search for inode if the pathname is given
if (mode & COMMAND_PATHNAME){
if(! strcmp(pathname,"/") || ! strcmp(pathname,"")){
inode_nr = EXT2_ROOT_INO ;
*pathname = 0;
}
else{
int l=strlen(pathname) -1;
if (*(pathname + l) == '/')
*(pathname + l) = 0 ;
retval = ext2fs_namei(current_fs,EXT2_ROOT_INO ,EXT2_ROOT_INO , pathname, &inode_nr);
}
if (retval) {
fprintf(stderr,"Error: Filename \"%s\" not found in Filesystem\n", pathname);
fprintf(stderr,"if \"%s\" deleted, use InodeNr or try Journaling options\n",pathname);
exitval = EXIT_FAILURE ;
goto errout;
}
}
inode_buf = malloc(EXT2_INODE_SIZE(current_fs->super));
if (intern_read_inode_full(inode_nr, inode_buf,EXT2_INODE_SIZE(current_fs->super))){
fprintf(stderr,"Fatal Error: can not read InodeNr. %lu \n", (long unsigned int)inode_nr);
return EXIT_FAILURE;
}
allocated = ext2fs_test_inode_bitmap ( current_fs->inode_map, inode_nr );
fprintf(stdout,"\nDump internal Inode %d\nStatus : %s\n\n",inode_nr,(allocated) ? "Inode is Allocated" : "Inode is Unallocated");
dump_inode(stdout, "",inode_nr, inode_buf, format);
if (LINUX_S_ISDIR(inode_buf->i_mode)) list_dir(inode_nr);
free(inode_buf);
}
// print filesystem block
if ((mode & COMMAND_BLOCK) && (! (mode & READ_JOURNAL)))
{
void *block_buf;
int allocated;
block_buf = malloc(EXT2_BLOCK_SIZE(current_fs->super ));
if(!read_block ( current_fs , &block_nr , block_buf )){
allocated = ext2fs_test_block_bitmap ( current_fs->block_map, block_nr );
fprintf(stdout,"Dump Filesystemblock %10lu Status : %s\n",(long unsigned int)block_nr,
(allocated) ? "Block is Allocated" : "Block is Unallocated");
blockhex ( stdout , block_buf , format , EXT2_BLOCK_SIZE(current_fs->super ));
}
free(block_buf);
}
//-----------------------------------------------------
// loading Journal
if (mode & READ_JOURNAL){
if (journal_flag) journal_flag = journal_open( j_file_name , journal_backup );
if (journal_flag != JOURNAL_OPEN){
exitval = EXIT_FAILURE ;
goto errout;
}
//print the after and before Time
if (mode & INPUT_TIME){
printf("Activ Time after : %s", time_to_string(t_after));
printf("Activ Time before : %s", time_to_string(t_before));
}
//recover from inputlist
if(mode & RECOVER_LIST){
recover_list(des_dir, input_filename,t_after,t_before,(recovermodus & RECOV_ALL )? 0 : 1);
mode = 0;
}
// search inodeNr from pathName use journal
if (mode & COMMAND_PATHNAME){
if(! strcmp(pathname,"/") || ! strcmp(pathname,"")){
inode_nr = EXT2_ROOT_INO ;
*pathname = 0;
}
else{
int l=strlen(pathname) -1 ;
if (*(pathname + l) == '/')
*(pathname + l) = 0 ;
inode_nr = local_namei(NULL,pathname,t_after,t_before,DELETED_OPT);
}
if (inode_nr) {
printf("Inode found \"%s\" %lu \n", pathname, (long unsigned int)inode_nr);
}
else{
fprintf(stderr,"Error: Inode not found for \"%s\"\n",pathname);
fprintf(stderr,"Check the valid PATHNAME \"%s\" and the BEFORE option \"%s\"\n", pathname,time_to_string(t_before));
exitval = EXIT_FAILURE ;
goto journalout;
}
}
else{
if (mode & COMMAND_INODE){
if (!pathname) pathname = malloc(20);
if (!pathname) {
fprintf(stderr,"ERROR: can not allocate memory\n");
goto journalout;
}
if (inode_nr == EXT2_ROOT_INO)
*pathname = 0;
else
sprintf(pathname,"<%lu>",(long unsigned int)inode_nr);
}
}
// recover all mode if possible
// activate magic level 1 and 2 for recover from the root inode
if ((inode_nr == EXT2_ROOT_INO) && (mode & COMMAND_INODE) && (mode & RECOVER_INODE)
&& (recoverquality) && (recovermodus & REC_DIR_NEEDED) && (! magicscan)) {
if( ext2fs_copy_bitmap(current_fs->inode_map, &imap)){
fprintf(stderr,"%s Error while copy bitmap\n",argv[optind]);
imap = NULL;
}else{
int i;
#ifdef EXT2_FLAG_64BITS
ext2fs_clear_generic_bmap(imap);
for (i = 1; i < current_fs->super->s_first_ino; i++)
ext2fs_mark_generic_bmap(imap,(blk64_t) i); //mark inode 1-8
#else
ext2fs_clear_inode_bitmap(imap);
for (i = 1; i < current_fs->super->s_first_ino; i++)//mark inode 1-8
ext2fs_mark_generic_bitmap(imap,i);
#endif
}
}
// print journal transaction bocklist
if (mode & PRINT_BLOCKLIST){
if (mode & COMMAND_BLOCK)
print_block_transaction((blk64_t)block_nr,format);
if (mode & COMMAND_INODE){
struct inode_pos_struct pos;
block_nr = get_inode_pos(current_fs->super, &pos , inode_nr, 1);
print_block_transaction((blk64_t)block_nr,format);
}
if (!(mode & (COMMAND_INODE + COMMAND_BLOCK))) print_block_list( format );
}
// print journal superblock
if (mode & PRINT_J_SUPERBLOCK) dump_journal_superblock();
//print journal block
if ((mode & COMMAND_BLOCK) && (mode & PRINT_TRANSACTION )){
__u32 journal_block;
journal_block = get_journal_blocknr(block_nr, transaction_nr);
if ( journal_block ){
printf("dump Journalblock %lu : a copy of Filesystemblock %lu : Transaction %lu\n",
(long unsigned int)journal_block, (long unsigned int)block_nr, (long unsigned int)transaction_nr);
dump_journal_block( journal_block, format );
}
else
fprintf(stderr,"Error: Filesystemblock %lu not found in Journaltransaction %lu\n",
(long unsigned int)block_nr, (long unsigned int)transaction_nr);
}
//print or recover a single inode from transactionnumber
if ((mode & COMMAND_INODE) && (mode & PRINT_TRANSACTION )){
struct ext2_inode_large *inode;
inode = malloc( current_fs->blocksize );
if (inode){
if (! get_transaction_inode(inode_nr, transaction_nr, inode))
print_j_inode(inode , inode_nr , transaction_nr , format);
if ((mode & RECOVER_INODE) && (recovermodus & (RECOV_ALL | RECOV_DEL)) && (!(LINUX_S_ISDIR(inode->i_mode)))){
recover_file(des_dir,"", pathname,(struct ext2_inode*)inode, inode_nr ,(recovermodus & RECOV_ALL )? 0 : 1 );
mode = 0;
}
free(inode);
}
}
// start recursiv over the filesystem, used for recover, list and tree-history
if ((mode & COMMAND_INODE) && (mode & RECOVER_INODE))
{
struct ring_buf *i_list;
struct ext2_inode* r_inode;
r_item *item = NULL;
if (ext2fs_test_inode_bitmap ( current_fs->inode_map, inode_nr )) {
fprintf(stdout,"Inode %lu is allocated\n",(long unsigned int)inode_nr);
}
i_list = get_j_inode_list(current_fs->super, inode_nr);
if (mode & INPUT_TIME)
item = get_undel_inode(i_list,t_after,t_before);
else
item = get_last_undel_inode(i_list);
if (item) {
r_inode = (struct ext2_inode*)item->inode;
if (LINUX_S_ISDIR(r_inode->i_mode) )
{
struct dir_list_head_t * dir = NULL;
dir = get_dir3(NULL,0, inode_nr , "",pathname, t_after,t_before, recoverquality );
if (dir) {
lookup_local(des_dir, dir,t_after,t_before, recoverquality | recovermodus );
if (recovermodus & HIST_DIR )
print_coll_list(t_after, t_before, format);
//Magic step 1 + 2 +3
if (imap){
imap_search(des_dir, t_after, t_before, disaster );
// we use imap as a flag for the disaster mode
ext2fs_free_inode_bitmap(imap);
imap = NULL;
if (bmap){
if (!(current_fs->super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)){
printf("MAGIC function for ext3 not available, use ext4magic 0.2.4 instead\n");
// magic_block_scan3(des_dir, t_after);
}
else{
//if (bmap) printf("The MAGIC Function is currently only for ext3 filesystems available\n");
magic_block_scan4(des_dir,t_after);
}
}
}
clear_dir_list(dir);
}
else
printf("Inode %lu is a directory but not found after %lu and before %lu\n",
(long unsigned int)inode_nr, (long unsigned int)t_after, (long unsigned int)t_before);
}
else {
if (recovermodus & (RECOV_ALL | RECOV_DEL))
recover_file(des_dir,"", pathname, r_inode, inode_nr ,(recovermodus & RECOV_ALL )? 0 : 1 );
else
printf("Single file can only recovered with option -R or -r\n");
}
}
else
fprintf(stdout,"No undeled inode %u in journal found\n",inode_nr);
#ifdef EXPERT_MODE
if (disaster && imap){
// Nothing worked, trying to recover all undeleted files under catastrophic conditions
printf("Force a disaster recovery\n");
imap_search(des_dir, t_after, t_before, disaster );
ext2fs_free_inode_bitmap(imap);
imap = NULL;
}
#endif
if (i_list) ring_del(i_list);
}
//print all journal inode
if ((mode & COMMAND_INODE) && !(mode & RECOVER_INODE) && !(mode & PRINT_TRANSACTION))
{
struct ring_buf* i_list;
r_item *item = NULL;
__u32 time_stamp;
i_list = get_j_inode_list(current_fs->super, inode_nr);
if (i_list){
if (mode & INPUT_TIME){
item = get_undel_inode(i_list,t_after,t_before);
if(item){
dump_inode(stdout, "",inode_nr, (struct ext2_inode *)item->inode, format);
if ( LINUX_S_ISDIR(item->inode->i_mode)){
time_stamp = (item->transaction.start) ? get_trans_time(item->transaction.start) : 0 ;
#ifdef DEBUG
printf ("Transaction-time for search %ld : %s\n", time_stamp, time_to_string(time_stamp));
#endif
list_dir3(inode_nr, (struct ext2_inode*) item->inode, &(item->transaction) , time_stamp);
}
}
else
printf("No entry with this time found\n");
}
else{
dump_inode_list(i_list, format);
}
if (i_list) ring_del(i_list);
}
}
journalout:
if(!journal_flag) journal_flag = journal_close();
}// end open Journal
} // end Operation
exitval = EXIT_SUCCESS;
#ifdef DEBUG
printf("EXIT_SUCCESS : %d, close and clear\n",exitval);
#endif
errout:
if (current_fs) {
/*//FIXME in development
if (bmap){
struct ext2fs_struct_loc_generic_bitmap *d_bmap = bmap ;
blockhex(stdout,(void*)d_bmap->bitmap,0,current_fs->super->s_blocks_count >> 3);
}*/
if (imap) ext2fs_free_inode_bitmap(imap);
if (bmap) ext2fs_free_inode_bitmap(bmap);
imap = NULL;
bmap = NULL;
if (magicfile) free(magicfile);
magicfile = NULL;
retval = ext2fs_close(current_fs);
if (retval) {
fprintf(stderr, "ext2fs_close\n");
current_fs = NULL;
}
}
if (pathname) free(pathname);
clear_link_stack();
if (! exitval)
printf("ext4magic : EXIT_SUCCESS\n");
return exitval;
}
//-------------------------------------------------------------------------------------------------------------------------------
|
orochi/ext4magic
|
src/ext4magic.c
|
C++
|
mit
| 40,091 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef EXT4MAGIC_H
#define EXT4MAGIC_H
// ext4magic mode for navigation main()
#define PRINT_SUPERBLOCK 0x0001
#define PRINT_J_SUPERBLOCK 0x0002
#define COMMAND_INODE 0x0004
#define COMMAND_BLOCK 0x0008
#define COMMAND_PATHNAME 0x0010
#define PRINT_TRANSACTION 0x0020
#define PRINT_BLOCKLIST 0x0040
#define PRINT_HISTOGRAM 0x0080
#define INPUT_TIME 0x0100
#define HIGH_QUALITY 0x0200
#define READ_JOURNAL 0x1000
#define RECOVER_INODE 0x2000
#define RECOVER_LIST 0x4000
#define MASK_MAGIC_SCAN 0x3100
// journal status flags
#define JOURNAL_OPEN 0
#define JOURNAL_CLOSE 1
#define JOURNAL_ERROR 2
#endif
|
orochi/ext4magic
|
src/ext4magic.h
|
C++
|
mit
| 2,109 |
/***************************************************************************
* Copyright (C) 2011 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
// The Magic functions for ext4 need a small stack to the cache found extents
// The extent_db.c functions provide the interface for this.
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include "extent_db.h"
extern ext2_filsys current_fs;
static int mark_extent_len(struct extent_db_t*, blk_t, void*);
struct extent_area* new_extent_area(){
struct extent_area *ea;
ea = malloc(sizeof(struct extent_area));
if (ea)
memset(ea, 0, sizeof(struct extent_area));
return (ea) ? ea : NULL;
}
static struct extent_db_item* new_item(struct extent_db_item *last){
struct extent_db_item *this = NULL;
this = malloc(sizeof(struct extent_db_item));
if (this){
this->last = last;
this->entry = NULL;
this->next = NULL;
return this;
}
return NULL;
}
struct extent_db_t* extent_db_init(ext2fs_block_bitmap d_bmap){
struct extent_db_t* db = NULL;
db = malloc(sizeof(struct extent_db_t));
if (db){
db->count = 0;
db->max_depth = 0;
db->d_bmap = d_bmap;
db->next = new_item((struct extent_db_item*)db);
}
return db;
}
int extent_db_add (struct extent_db_t* db, struct extent_area *ea, int flag){
struct extent_db_item *pointer;
pointer = db->next;
while (pointer->entry)
pointer = pointer->next;
//FIXME
if ((pointer->last != (struct extent_db_item*)db) && (pointer->last->entry) && (pointer->last->entry->end_b == ea->start_b -1) && (ea->l_start)){
pointer->last->entry->len += ea->len;
pointer->last->entry->end_b += ea->len;
pointer->last->entry->size += (unsigned long long)ea->len * current_fs->blocksize;
free (ea);
return db->count;
}
pointer->next = new_item(pointer);
if (pointer->next){
pointer->entry = ea;
if (db->max_depth < ea->depth) db->max_depth = ea->depth;
(db->count)++;
if (flag) mark_extent_len(db, ea->blocknr, NULL );
else {
ea->end_b = ea->start_b + ea->len -1;
ea->size = (unsigned long long)ea->len * current_fs->blocksize;
}
return db->count;
}
return 0;
}
__u32 extentd_db_find( struct extent_db_t*db ,__u32 start, struct extent_area *ea) {
struct extent_db_item *pointer;
__u32 end = 0;
__u16 depth;
depth = db->max_depth+1;
while ((depth) && (!end)){
pointer = db->next;
while ((pointer->entry) && ((pointer->entry->depth != depth - 1) || (pointer->entry->l_start != start)))
pointer = pointer->next;
if (pointer->entry){
memcpy(ea,pointer->entry,sizeof(struct extent_area));
end = pointer->entry->l_end;
}
else{
if ((depth - 1) && (!start))
(db->max_depth)--;
depth--;
}
} //depth
return end;
}
int extent_db_del(struct extent_db_t* db,blk_t blk){
struct extent_db_item *pointer;
int ret = 0;
pointer = db->next;
while ((pointer->entry) && (pointer->entry->blocknr < blk))
pointer = pointer->next;
if ((pointer->entry) && (pointer->entry->blocknr == blk)){
(pointer->last)->next = pointer->next;
pointer->next->last = pointer->last;
if(pointer->entry) free(pointer->entry);
if (pointer) free(pointer);
(db->count)--;
// printf("Extend DB : entry %lu deleted\n",blk);
ret = 1;
}
return ret;
}
static void clear_entry(struct extent_db_item *p){
if (p->next)
clear_entry(p->next);
if (p->entry) {
// printf("EXT-DB : %10u %d %10lu %10lu %10lu\n",p->entry->blocknr, (p->entry->l_start)?1:0, p->entry->start_b, p->entry->end_b, p->entry->len);
free(p->entry);
}
if (p) free(p);
return;
}
void extent_db_clear(struct extent_db_t* db){
// printf("Extent DB has %lu Entries ; clean now\n",db->count);
clear_entry(db->next);
if(db) free(db);
return;
}
static int mark_extent_len(struct extent_db_t* db, blk_t blk, void * buf){
void *buf_tmp = NULL;
int bufset = 0;
int ret = 0;
struct ext3_extent_idx *idx;
struct ext3_extent *extent;
struct ext3_extent_header *header;
int entry,i;
if (!buf){
buf = malloc(current_fs->blocksize);
io_channel_read_blk (current_fs->io, blk, 1, buf );
bufset=1;
}
buf_tmp = malloc(current_fs->blocksize);
if ((!buf_tmp) || (!buf))
return 1;
header = buf;
ret = ext2fs_extent_header_verify((void*) header, current_fs->blocksize);
ext2fs_unmark_generic_bitmap(db->d_bmap, blk);
if(!ret){
for (entry =1; ((!ret) && (entry <= ext2fs_le16_to_cpu(header->eh_entries))) ; entry++){
if (ext2fs_le16_to_cpu(header->eh_depth)){
idx = (struct ext3_extent_idx*) (header + entry);
if(io_channel_read_blk ( current_fs->io,ext2fs_le32_to_cpu(idx->ei_leaf), 1, buf_tmp )){
fprintf(stderr,"Error read block %lu\n", (long unsigned int)ext2fs_le32_to_cpu(idx->ei_leaf));
ret = 2;
}
else{
//Recursion
if (! extent_db_del(db,ext2fs_le32_to_cpu(idx->ei_leaf)))
ret = mark_extent_len(db, ext2fs_le32_to_cpu(idx->ei_leaf),buf_tmp);
}
}
else{
extent = (struct ext3_extent*)(header + entry);
for (i = 0; i< ext2fs_le16_to_cpu(extent->ee_len); i++){
ext2fs_unmark_generic_bitmap(db->d_bmap, ext2fs_le32_to_cpu(extent->ee_start) + i );
}
}
}
}
if (buf_tmp) free(buf_tmp);
if (bufset && buf) free(buf);
return ret;
}
|
orochi/ext4magic
|
src/extent_db.c
|
C++
|
mit
| 6,318 |
/***************************************************************************
* Copyright (C) 2011 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
// The Magic functions for ext4 need a small stack to the cache found extents
// Extent_db.h contains the header for it.
#ifndef EXTENT_DB_H
#define EXTENT_DB_H
/* ext3/4 libraries */
#include <ext2fs/ext2fs.h>
struct extent_area {
blk_t blocknr;
__u16 depth;
blk_t l_start;
blk_t l_end;
blk_t start_b;
blk_t end_b;
__u16 len;
__u64 size;
__u32 b_count;
};
struct extent_db_item {
struct extent_db_item *next;
struct extent_area *entry;
struct extent_db_item *last;
};
struct extent_db_t {
struct extent_db_item *next;
__u32 count;
__u16 max_depth;
ext2fs_block_bitmap d_bmap;
};
struct extent_area* new_extent_area();
struct extent_db_t* extent_db_init(ext2fs_block_bitmap);
int extent_db_add (struct extent_db_t* db, struct extent_area*, int);
int extent_db_del(struct extent_db_t* ,blk_t);
void extent_db_clear(struct extent_db_t*);
__u32 extentd_db_find( struct extent_db_t*, __u32, struct extent_area*);
#endif
|
orochi/ext4magic
|
src/extent_db.h
|
C++
|
mit
| 2,215 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
//construct for global collect of hardlinks
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "hard_link_stack.h"
static struct link_stack_head head;
void init_link_stack(){
head.count = 0;
head.begin = NULL;
head.pointer = NULL;
}
void add_link_stack(ext2_ino_t inode_nr, __u32 link_count, char* name, __u32 generation){
struct link_entry* this;
this = malloc (sizeof(struct link_entry));
if (!this)
goto errout;
this->inode_nr = inode_nr;
this->link_count = link_count -1 ;
this->name = malloc(strlen(name) +1);
this->generation = generation;
if (!this->name)
goto errout;
strcpy(this->name,name);
this->next = head.begin;
head.begin = this;
head.count++;
return;
errout:
if(this->name)
free(this->name);
if(this)
free(this);
}
// subfunction for check_find_dir() use in stage 2 of magical recover
int rename_hardlink_path(char *old, char *neu){
char *newname;
char *endname;
int size = strlen(old);
head.pointer = head.begin;
while (head.pointer) {
if (! strcmp(old,head.pointer->name)){
newname=malloc(strlen(neu) + strlen(head.pointer->name) - size +1);
if (! newname)
return 1;
strcpy(newname,neu);
endname = head.pointer->name + size;
strcat(newname,endname);
free(head.pointer->name);
head.pointer->name = newname;
//#ifdef DEBUG
fprintf(stderr,"HL-DB change %s -> %s\n",old,neu);
//#endif
}
head.pointer = head.pointer->next;
}
return 0;
}
char* check_link_stack(ext2_ino_t inode_nr, __u32 generation){
head.pointer = head.begin;
while (head.pointer) {
if((head.pointer->inode_nr == inode_nr) && (head.pointer->generation == generation))
break;
head.pointer = head.pointer->next;
}
#ifdef DEBUG
if (head.pointer)
printf("HARD_LINK found -> %s\n",head.pointer->name);
#endif
return (head.pointer) ? head.pointer->name : NULL ;
}
// not used ; gcc warning okay
static void del_link_stack(struct link_entry* entry){
if(entry->name)
free(entry->name);
head.pointer = head.begin;
if (head.begin->next){
while ((head.pointer->next) && (head.pointer != entry) && (head.pointer->next != entry))
head.pointer = head.pointer->next;
if(head.begin == entry)
head.begin = entry->next;
else
head.pointer->next = entry->next;
}
else
head.begin = NULL;
free(entry);
head.count--;
}
int match_link_stack(ext2_ino_t inode_nr, __u32 generation){
int retval = 1;
if ((head.pointer->inode_nr == inode_nr) && (head.pointer->generation == generation)){
// if (! --(head.pointer->link_count))
// del_link_stack(head.pointer);
(head.pointer->link_count)-- ;
retval = 0;
}
return retval;
}
void clear_link_stack(){
int d_count = 0 ;
fflush(stdout);
if (head.count){
fprintf(stderr,"Hardlink Database : %lu entries\n", (long unsigned int)head.count);
head.pointer = head.begin;
while (head.pointer){
if(head.pointer->link_count){
fprintf(stderr,"%10d\t%s\n",head.pointer->link_count,head.pointer->name);
d_count++ ;
}
if(head.pointer->name)
free(head.pointer->name);
head.begin = head.pointer->next;
free(head.pointer);
head.pointer = head.begin;
}
if (! d_count)
fprintf(stderr,"all Hardlinks be resolved\n");
}
}
|
orochi/ext4magic
|
src/hard_link_stack.c
|
C++
|
mit
| 4,545 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
//construct for global collect of hardlinks
#ifndef HARD_LINKSTACK_H
#define HARD_LINKSTACK_H
#include <ext2fs/ext2fs.h>
struct link_entry{
ext2_ino_t inode_nr;
__u32 generation;
int link_count;
char* name;
struct link_entry* next;
};
struct link_stack_head{
__u32 count;
struct link_entry* begin;
struct link_entry* pointer;
};
void init_link_stack();
void add_link_stack(ext2_ino_t , __u32, char*, __u32 );
char* check_link_stack(ext2_ino_t, __u32);
int match_link_stack(ext2_ino_t, __u32 );
void clear_link_stack();
int rename_hardlink_path(char*, char*);
#endif
|
orochi/ext4magic
|
src/hard_link_stack.h
|
C++
|
mit
| 1,898 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
* *
* *
* C Implementation: imap_search *
***************************************************************************/
//header util.h
#include "util.h"
#include "inode.h"
#include <sys/stat.h>
#include <errno.h>
#include <time.h>
#include "magic.h"
#include "journal.h"
#include "block.h"
#include "hard_link_stack.h"
extern ext2_filsys current_fs;
extern time_t now_time ;
struct privat {
int count;
int error;
unsigned char* buf;
char flag;
};
//Subfunction for "local_block_iterate3()" for load the first blocks to identify filetype
int first_blocks ( ext2_filsys fs, blk64_t *blocknr, e2_blkcnt_t blockcnt,
blk64_t /*ref_blk*/x, int /*ref_offset*/y, void *priv )
{
char *charbuf = NULL;
errcode_t retval;
int blocksize = fs->blocksize;
if ((blockcnt >= 12) || ((struct privat*)priv)->count >=12)
return BLOCK_ABORT;
charbuf = (char*)((struct privat*)priv)->buf + (blocksize * blockcnt);
if (((struct privat*)priv)->flag){
int allocated = ext2fs_test_block_bitmap ( fs->block_map, *blocknr );
if ( allocated ){
((struct privat*)priv)->error = BLOCK_ABORT | BLOCK_ERROR ;
return (BLOCK_ABORT | BLOCK_ERROR);
}
}
retval = io_channel_read_blk ( fs->io, *blocknr, 1, charbuf );
((struct privat*)priv)->count = blockcnt;
if (retval){
((struct privat*)priv)->error = BLOCK_ERROR ;
return (BLOCK_ERROR);
}
return retval;
}
static char* get_pathname(blk_t inode_nr, char* i_pathname, char *magic_buf, unsigned char* buf){
struct found_data_t *help_data = NULL;
int str_len;
__u32 name_len;
char *c;
int def_len = 22;
char name_str[22];
__u32 scan = 0;
help_data = malloc(sizeof(struct found_data_t));
if (!help_data) return NULL;
memset (help_data,0, sizeof(struct found_data_t));
if ( ident_file(help_data,&scan,magic_buf,buf)){
help_data->type = scan;
str_len = strlen(magic_buf) + 1;
c = strpbrk(magic_buf,";:, ");
if (c){
*c = 0;
name_len = c - magic_buf + def_len;
}
else
name_len = str_len + def_len;
help_data->scan_result = malloc(str_len);
help_data->name = malloc(name_len);
if((!help_data->name) || (!help_data->scan_result)){
free_file_data( help_data );
fprintf(stderr,"ERROR: allocate memory\n");
}
else{
strcpy(help_data->scan_result,magic_buf);
strncpy(help_data->name, magic_buf , name_len - def_len+1);
sprintf(name_str,"/I_%010lu",(long unsigned int)inode_nr);
strcat(help_data->name,name_str);
get_file_property(help_data);
}
i_pathname = malloc(name_len);
if (i_pathname)
strncpy (i_pathname,help_data->name,name_len);
}
free_file_data(help_data);
return i_pathname;
}
static magic_t cookie = 0;
char* identify_filename(char* i_pathname, unsigned char *tmp_buf, struct ext2_inode* inode, blk_t inode_nr){
struct privat priv ;
char magic_buf[100];
int retval= 0;
priv.count = priv.error = priv.flag = 0;
priv.buf = tmp_buf;
memset(magic_buf,0,100);
if ((inode->i_mode & LINUX_S_IFMT) == LINUX_S_IFREG){
memset(tmp_buf,0,12 * current_fs->blocksize);
// iterate first 12 Data Blocks
retval = local_block_iterate3 ( current_fs, *inode, BLOCK_FLAG_DATA_ONLY, NULL, first_blocks, &priv );
if (priv.count <12){
strncpy(magic_buf, magic_buffer(cookie , tmp_buf,
((inode->i_size < 12 * current_fs->blocksize) ? inode->i_size : (12 * current_fs->blocksize))), 60);
i_pathname = get_pathname(inode_nr, i_pathname, magic_buf, tmp_buf);
}
}
return i_pathname;
}
// search inode by use imap (step1: flag 1 = only directory ; step2: flag 0 = only file)
static void search_imap_inode(char* des_dir, __u32 t_after, __u32 t_before, int flag)
{
struct ext2_group_desc *gdp;
struct ext2_inode_large *inode;
//struct dir_list_head_t *dir = NULL;
struct ring_buf* i_list = NULL;
r_item* item = NULL;
int zero_flag, retval, load, x ,i ;
char *pathname = NULL;
char *i_pathname = NULL;
char *buf= NULL;
unsigned char *tmp_buf = NULL;
__u32 blocksize, inodesize, inode_max, inode_per_group, block_count;
__u32 inode_per_block , inode_block_group, group;
blk_t block_nr;
__u32 c_time, d_time, mode;
ext2_ino_t first_block_inode_nr , inode_nr;
pathname = malloc(26);
blocksize = current_fs->blocksize;
inodesize = current_fs->super->s_inode_size;
inode_max = current_fs->super->s_inodes_count;
inode_per_group = current_fs->super->s_inodes_per_group;
buf = malloc(blocksize);
if (! (flag & 0x01) ){
tmp_buf = malloc (12 * blocksize);
if (!tmp_buf)
goto errout;
cookie = magic_open(MAGIC_MIME | MAGIC_NO_CHECK_COMPRESS | MAGIC_NO_CHECK_ELF | MAGIC_CONTINUE);
if ((! cookie) || magic_load(cookie, NULL)){
fprintf(stderr,"ERROR: can't find libmagic\n");
goto errout;
}
}
inode_per_block = blocksize / inodesize;
inode_block_group = inode_per_group / inode_per_block;
for (group = 0 ; group < current_fs->group_desc_count ; group++){
#ifdef EXT2_FLAG_64BITS
gdp = ext2fs_group_desc(current_fs, current_fs->group_desc, group);
#else
gdp = ¤t_fs->group_desc[group];
#endif
zero_flag = 0;
if (!(flag & 0x02)){ //skip this in disaster mode
// NEXT GROUP IF INODE NOT INIT
if (gdp->bg_flags & (EXT2_BG_INODE_UNINIT)) continue;
// SET ZERO-FLAG IF FREE INODES == INODE/GROUP for fast ext3
if (gdp->bg_free_inodes_count == inode_per_group) zero_flag = 1;
}
//FIXME for struct ext4_group_desc 48/64BIT
for (block_nr = gdp->bg_inode_table , block_count = 0 ;
block_nr < (gdp->bg_inode_table + inode_block_group); block_nr++, block_count++) {
if (!(flag & 0x02)){ //skip this in disaster mode
// break if the first block only zero inode
if ((block_count ==1) && (zero_flag == (inode_per_block + 1))) break;
}
//FIXME inode_max ????
first_block_inode_nr = (group * inode_per_group) + (block_count * inode_per_block) + 1;
load = 0;
for (i = 0; i<inode_per_block;i++){
if ( ! ext2fs_test_block_bitmap(imap,first_block_inode_nr + i)){
load++;
break;
}
}
if (load){
retval = read_block ( current_fs , &block_nr , buf);
if (retval) return;
for (inode_nr = first_block_inode_nr ,x = 0; x < inode_per_block ; inode_nr++ , x++){
if ( ! ext2fs_test_block_bitmap(imap,inode_nr)){
inode = (struct ext2_inode_large*) (buf + (x*inodesize));
c_time = ext2fs_le32_to_cpu(inode->i_ctime);
mode = ext2fs_le32_to_cpu(inode->i_mode);
if ( ! ( flag & 0x02)) {
//no check this inode in disaster mode
if ((! c_time ) && (!(inode->i_mode & LINUX_S_IFMT)) ) {
if(zero_flag) zero_flag++ ;
continue;
}
d_time = ext2fs_le32_to_cpu(inode->i_dtime);
if ( (! d_time) || d_time <= t_after){
ext2fs_mark_generic_bitmap(imap,inode_nr);
continue;
}
}
// 1. magical step
if (LINUX_S_ISDIR(mode) && ( flag & 0x01) && (pathname)){
sprintf(pathname,"<%lu>",(long unsigned int)inode_nr);
struct dir_list_head_t * dir = NULL;
if (flag & 0x02){
//disaster mode
//only search for undeleted entry
dir = get_dir3(NULL,0, inode_nr , "MAGIC-1",pathname, t_after,t_before, 0);
if (dir) {
lookup_local(des_dir, dir,t_after,t_before, RECOV_ALL | LOST_DIR_SEARCH );
clear_dir_list(dir);
}
}
else{ //search for all
dir = get_dir3(NULL,0, inode_nr , "MAGIC-1",pathname, t_after,t_before, DELETED_OPT);
if (dir) {
lookup_local(des_dir,dir,t_after,t_before,DELETED_OPT|RECOV_ALL|LOST_DIR_SEARCH);
clear_dir_list(dir);
}
}
}
// 2. magical step
if (! (flag & 0x01) ){
i_list = get_j_inode_list(current_fs->super, inode_nr);
item = get_undel_inode(i_list,t_after,t_before);
ext2fs_mark_generic_bitmap(imap,inode_nr);
if (item) {
if (! LINUX_S_ISDIR(item->inode->i_mode) ) {
i_pathname = identify_filename(i_pathname, tmp_buf,
(struct ext2_inode*)item->inode, inode_nr);
sprintf(pathname,"<%lu>",(long unsigned int)inode_nr);
recover_file(des_dir,"MAGIC-2", ((i_pathname)?i_pathname : pathname),
(struct ext2_inode*)item->inode, inode_nr, 0);
if(i_pathname){
free(i_pathname);
i_pathname = NULL;
}
}
}
if (i_list) ring_del(i_list);
}
}
}
}
}
}
errout:
if (pathname)
free(pathname);
if(buf) {
free(buf);
buf = NULL;
}
if (tmp_buf){
free(tmp_buf);
tmp_buf = NULL;
}
if (cookie){
magic_close(cookie);
cookie = 0;
}
return;
}
//check if the directory always recovert. if, then move to right place
//return 0 if directory is moved
//this function is called from lookup_local() during 1. magical step
int check_find_dir(char *des_dir,ext2_ino_t inode_nr,char *pathname,char *filename){
char *recovername = NULL;
char *dirname = NULL;
struct stat filestat;
int retval = 0;
recovername = malloc(strlen(des_dir) + strlen(pathname) + 30);
dirname = malloc(strlen(des_dir) + strlen(pathname) + strlen(filename) +10);
if (recovername && dirname){
sprintf(recovername,"%s/MAGIC-1/<%lu>",des_dir,(long unsigned int)inode_nr);
sprintf(dirname,"%s/%s/%s",des_dir,pathname,filename);
retval = stat (recovername, &filestat);
if ((!retval) && (S_ISDIR(filestat.st_mode))){
retval = stat (dirname, &filestat);
if (! retval){
printf("Warning :can't move %s to %s ;file exist; will recover it again\n",recovername,dirname);
retval = 1;
}
else{
if(check_dir(dirname)){
fprintf(stderr,"Unknown error at target directory by file: %s\ntrying to continue normal\n", dirname);
}else{
retval = rename(recovername, dirname);
rename_hardlink_path(recovername, dirname);
}
#ifdef DEBUG
printf("move return: %d : ernno %d : %s -> %s\n",retval, errno, recovername, dirname);
#endif
}
}
free(recovername);
free(dirname);
return retval;
}
return 0;
}
void search_journal_lost_inode(char* des_dir, __u32 t_after, __u32 t_before, int flag){
struct ext2_inode *p_inode;
struct ext2_inode inode;
int i;
char *pathname = NULL;
char *i_pathname = NULL;
char *buf= NULL;
unsigned char *tmp_buf = NULL;
__u32 blocksize, inodesize;
__u32 inode_per_block;
ext2_ino_t inode_max, inode_nr;
pathname = malloc(26);
blocksize = current_fs->blocksize;
inodesize = current_fs->super->s_inode_size;
inode_max = current_fs->super->s_inodes_count;
inode_per_block = blocksize / inodesize;
inode_nr = inode_max ;
buf = malloc(blocksize);
if (! (flag & 0x01) ){
tmp_buf = malloc (12 * blocksize);
if (!tmp_buf)
goto errout;
cookie = magic_open(MAGIC_MIME | MAGIC_NO_CHECK_COMPRESS | MAGIC_NO_CHECK_ELF | MAGIC_CONTINUE);
if ((! cookie) || magic_load(cookie, NULL)){
fprintf(stderr,"ERROR: can't find libmagic\n");
goto errout;
}
}
while ( get_pool_block(buf) ){
for (i=0 ;i < inode_per_block; i++){
inode_nr++;
p_inode = (struct ext2_inode*) (buf + (i * inodesize));
memset(&inode, 0, sizeof(struct ext2_inode));
#ifdef WORDS_BIGENDIAN
ext2fs_swap_inode(current_fs, &inode, p_inode, 0);
#else
memcpy(&inode, p_inode,128);
#endif
if((inode.i_dtime) || (!inode.i_size) || (!inode.i_blocks) || (!LINUX_S_ISREG(inode.i_mode)))
continue;
if (check_file_stat(&inode)){
i_pathname = identify_filename(i_pathname, tmp_buf, &inode, inode_nr);
sprintf(pathname,"<%lu>",(long unsigned int)inode_nr);
recover_file(des_dir,"MAGIC-2", ((i_pathname)?i_pathname : pathname), &inode, inode_nr, 1);
}
if(i_pathname){
free(i_pathname);
i_pathname = NULL;
}
}
}
errout:
if (pathname)
free(pathname);
if(buf) {
free(buf);
buf = NULL;
}
if (tmp_buf){
free(tmp_buf);
tmp_buf = NULL;
}
if (cookie){
magic_close(cookie);
cookie = 0;
}
return;
}
//2 step search for journalinode, will find some lost directory and files
void imap_search(char* des_dir, __u32 t_after, __u32 t_before , int disaster ){
printf("MAGIC-1 : start lost directory search\n");
search_imap_inode(des_dir, t_after, t_before, 1 | disaster ); //search for lost fragments of directorys
printf("MAGIC-2 : start lost file search\n");
search_imap_inode(des_dir, t_after, t_before, 0 | disaster ); //search for lost files
if ((!disaster) && (t_before == (__u32)now_time)){
printf("MAGIC-2 : start lost in journal search\n");
search_journal_lost_inode(des_dir, t_after, t_before, 0);
}
return;
}
|
orochi/ext4magic
|
src/imap_search.c
|
C++
|
mit
| 13,856 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include "inode.h"
#include "ring_buf.h"
#include "extent_db.h"
#include "block.h"
extern ext2_filsys current_fs;
extern time_t now_time ;
// read real fs inode 128++
int intern_read_inode_full(ext2_ino_t ino, struct ext2_inode * inode, int bufsize)
{
int retval;
retval = ext2fs_read_inode_full(current_fs, ino, inode, bufsize);
if (retval) {
fprintf(stderr,"Error %d while reading inode %u\n",retval, ino);
return 1;
}
return 0;
}
// read real fs inode 128
int intern_read_inode(ext2_ino_t ino, struct ext2_inode * inode)
{
int retval;
retval = ext2fs_read_inode(current_fs, ino, inode);
if (retval) {
fprintf(stderr,"Error %d while reading inode %u\n",retval, ino);
return 1;
}
return 0;
}
#ifdef WORDS_BIGENDIAN
// On my current version of libext2 the extra time fields ar not bigendian corrected
// We want this solved temporarily here with this function
static void le_to_cpu_swap_extra_time(struct ext2_inode_large *inode, char *inode_buf){
//inode->i_pad1 = ext2fs_le16_to_cpu(((struct ext2_inode_large *))inode_buf->i_pad1);
inode->i_ctime_extra = ext2fs_le32_to_cpu(((struct ext2_inode_large *)inode_buf)->i_ctime_extra);
inode->i_mtime_extra = ext2fs_le32_to_cpu(((struct ext2_inode_large *)inode_buf)->i_mtime_extra );
inode->i_atime_extra = ext2fs_le32_to_cpu(((struct ext2_inode_large *)inode_buf)->i_atime_extra );
inode->i_crtime = ext2fs_le32_to_cpu(((struct ext2_inode_large *)inode_buf)->i_crtime );
inode->i_crtime_extra = ext2fs_le32_to_cpu(((struct ext2_inode_large *)inode_buf)->i_crtime_extra );
//inode->i_version_hi = ext2fs_le32_to_cpu(((struct ext2_inode_large *)inode_buf)->i_version_hi );
}
#endif
//subfunction for dump_inode_extra
static void dump_xattr_string(FILE *out, const char *str, int len)
{
int printable = 0;
int i;
// check: is string "printable enough?"
for (i = 0; i < len; i++)
if (isprint(str[i]))
printable++;
if (printable <= len*7/8)
printable = 0;
for (i = 0; i < len; i++)
if (printable)
fprintf(out, isprint(str[i]) ? "%c" : "\\%03o",
(unsigned char)str[i]);
else
fprintf(out, "%02x ", (unsigned char)str[i]);
}
//print Blocks of inode (ext4)
static void local_dump_extents(FILE *f, const char *prefix, struct ext2_inode * inode,
int flags, int logical_width, int physical_width)
{
ext2_extent_handle_t handle;
struct ext2fs_extent extent;
struct ext2_extent_info info;
int op = EXT2_EXTENT_ROOT;
unsigned int printed = 0;
errcode_t errcode;
errcode = local_ext2fs_extent_open(current_fs, *inode, &handle);
if (errcode)
return;
if (flags & DUMP_EXTENT_TABLE)
fprintf(f, "Level Entries %*s %*s Length Flags\n",
(logical_width*2)+3, "Logical",
(physical_width*2)+3, "Physical");
else
fprintf(f, "%sEXTENTS:\n%s", prefix, prefix);
while (1) {
errcode = ext2fs_extent_get(handle, op, &extent);
if (errcode)
break;
op = EXT2_EXTENT_NEXT;
if (extent.e_flags & EXT2_EXTENT_FLAGS_SECOND_VISIT)
continue;
if (extent.e_flags & EXT2_EXTENT_FLAGS_LEAF) {
if ((flags & DUMP_LEAF_EXTENTS) == 0)
continue;
}
errcode = ext2fs_extent_get_info(handle, &info);
if (errcode)
continue;
if (!(extent.e_flags & EXT2_EXTENT_FLAGS_LEAF)) {
if (extent.e_flags & EXT2_EXTENT_FLAGS_SECOND_VISIT)
continue;
if (flags & DUMP_EXTENT_TABLE) {
fprintf(f, "%2d/%2d %3d/%3d %11llu - %11llu "
"%11llu%14s %6u\n",
info.curr_level, info.max_depth,
info.curr_entry, info.num_entries,
extent.e_lblk,
extent.e_lblk + (extent.e_len - 1),
extent.e_pblk,
"", extent.e_len);
continue;
}
fprintf(f, "%s(NODE #%d, %lld-%lld, blk %lld)",
printed ? ", " : "",
info.curr_entry,
extent.e_lblk,
extent.e_lblk + (extent.e_len - 1),
extent.e_pblk);
printed = 1;
continue;
}
if (flags & DUMP_EXTENT_TABLE) {
fprintf(f, "%2d/%2d %3d/%3d %11llu - %11llu %11llu - %11llu %6u %s\n",
info.curr_level, info.max_depth,
info.curr_entry, info.num_entries,
extent.e_lblk,
extent.e_lblk + (extent.e_len - 1),
extent.e_pblk,
extent.e_pblk + (extent.e_len - 1),
extent.e_len,
extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT ?
"Uninit" : "");
continue;
}
if (extent.e_len == 0)
continue;
else if (extent.e_len == 1)
fprintf(f,
"%s(%lld%s): %lld",
printed ? ", " : "",
extent.e_lblk,
extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT ?
" [uninit]" : "",
extent.e_pblk);
else
fprintf(f,
"%s(%lld-%lld%s): %lld-%lld",
printed ? ", " : "",
extent.e_lblk,
extent.e_lblk + (extent.e_len - 1),
extent.e_flags & EXT2_EXTENT_FLAGS_UNINIT ?
" [uninit]" : "",
extent.e_pblk,
extent.e_pblk + (extent.e_len - 1));
printed = 1;
}
if (printed)
fprintf(f, "\n\n");
local_ext2fs_extent_free(handle);
}
//print extended attribute of Inode
static void dump_inode_extra(FILE *out,
const char *prefix EXT2FS_ATTR((unused)),
ext2_ino_t inode_num EXT2FS_ATTR((unused)),
struct ext2_inode_large *inode)
{
struct ext2_ext_attr_entry *entry;
__u32 *magic;
char *start, *end;
unsigned int storage_size;
fprintf(out, "Size of extra inode fields: %u\n", inode->i_extra_isize);
if (inode->i_extra_isize > EXT2_INODE_SIZE(current_fs->super) -
EXT2_GOOD_OLD_INODE_SIZE) {
fprintf(stderr, "invalid inode->i_extra_isize (%u)\n",
inode->i_extra_isize);
return;
}
storage_size = EXT2_INODE_SIZE(current_fs->super) -
EXT2_GOOD_OLD_INODE_SIZE -
inode->i_extra_isize;
magic = (__u32 *)((char *)inode + EXT2_GOOD_OLD_INODE_SIZE +
inode->i_extra_isize);
if (*magic == EXT2_EXT_ATTR_MAGIC) {
fprintf(out, "Extended attributes stored in inode body: \n");
end = (char *) inode + EXT2_INODE_SIZE(current_fs->super);
start = (char *) magic + sizeof(__u32);
entry = (struct ext2_ext_attr_entry *) start;
while (!EXT2_EXT_IS_LAST_ENTRY(entry)) {
struct ext2_ext_attr_entry *next =
EXT2_EXT_ATTR_NEXT(entry);
if (entry->e_value_size > storage_size ||
(char *) next >= end) {
fprintf(out, "invalid EA entry in inode\n");
return;
}
fprintf(out, " ");
dump_xattr_string(out, EXT2_EXT_ATTR_NAME(entry),
entry->e_name_len);
fprintf(out, " = \"");
dump_xattr_string(out, start + entry->e_value_offs,
entry->e_value_size);
fprintf(out, "\" (%u)\n", entry->e_value_size);
entry = next;
}
}
}
//subfunction for dump_blocks
static void finish_range(struct list_blocks_struct *lb)
{
if (lb->first_block == 0)
return;
if (lb->first)
lb->first = 0;
else
fprintf(lb->f, ", ");
if (lb->first_block == lb->last_block)
fprintf(lb->f, "(%lld):%u",
(long long)lb->first_bcnt, lb->first_block);
else
fprintf(lb->f, "(%lld-%lld):%u-%u",
(long long)lb->first_bcnt, (long long)lb->last_bcnt,
lb->first_block, lb->last_block);
lb->first_block = 0;
}
//subfunction for dump_blocks
static int list_blocks_proc(ext2_filsys fs EXT2FS_ATTR((unused)),
blk64_t *block64nr, e2_blkcnt_t blockcnt,
blk64_t ref_block EXT2FS_ATTR((unused)),
int ref_offset EXT2FS_ATTR((unused)),
void *private)
{
blk_t blocknr = (blk_t) *block64nr;
struct list_blocks_struct *lb = (struct list_blocks_struct *) private;
lb->total++;
if (blockcnt >= 0) {
//* See if we can add on to the existing range (if it exists)
if (lb->first_block &&
(lb->last_block+1 == blocknr) &&
(lb->last_bcnt+1 == blockcnt)) {
lb->last_block = blocknr;
lb->last_bcnt = blockcnt;
return 0;
}
//* Start a new range.
finish_range(lb);
lb->first_block = lb->last_block = blocknr;
lb->first_bcnt = lb->last_bcnt = blockcnt;
return 0;
}
//* Not a normal block. Always force a new range.
finish_range(lb);
if (lb->first)
lb->first = 0;
else
fprintf(lb->f, ", ");
if (blockcnt == -1)
fprintf(lb->f, "(IND):%u", blocknr);
else if (blockcnt == -2)
fprintf(lb->f, "(DIND):%u", blocknr);
else if (blockcnt == -3)
fprintf(lb->f, "(TIND):%u", blocknr);
return 0;
}
// print the Datablocks from Inode (ext3)
static void dump_blocks(FILE *f, const char *prefix, struct ext2_inode *inode)
{
struct list_blocks_struct lb;
fprintf(f, "%sBLOCKS:\n%s", prefix, prefix);
lb.total = 0;
lb.first_block = 0;
lb.f = f;
lb.first = 1;
// ext2fs_block_iterate2(current_fs, inode, BLOCK_FLAG_READ_ONLY, NULL,
local_block_iterate3(current_fs, *inode, BLOCK_FLAG_READ_ONLY, NULL,
list_blocks_proc, (void *)&lb);
finish_range(&lb);
if (lb.total)
fprintf(f, "\n%sTOTAL: %lld\n", prefix, (long long)lb.total);
fprintf(f,"\n");
}
//print the contents of inode
void dump_inode(FILE *out, const char *prefix,
ext2_ino_t inode_num, struct ext2_inode *inode,
int do_dump_blocks)
{
const char *i_type;
char frag, fsize;
int os = current_fs->super->s_creator_os;
struct ext2_inode_large *large_inode;
int is_large_inode = 0;
if (EXT2_INODE_SIZE(current_fs->super) > EXT2_GOOD_OLD_INODE_SIZE)
is_large_inode = 1;
large_inode = (struct ext2_inode_large *) inode;
// blockhex(stdout,large_inode,0,256);
if (LINUX_S_ISDIR(inode->i_mode)) i_type = "directory";
else if (LINUX_S_ISREG(inode->i_mode)) i_type = "regular";
else if (LINUX_S_ISLNK(inode->i_mode)) i_type = "symlink";
else if (LINUX_S_ISBLK(inode->i_mode)) i_type = "block special";
else if (LINUX_S_ISCHR(inode->i_mode)) i_type = "character special";
else if (LINUX_S_ISFIFO(inode->i_mode)) i_type = "FIFO";
else if (LINUX_S_ISSOCK(inode->i_mode)) i_type = "socket";
else i_type = "bad type";
fprintf(out, "%sInode: %u Type: %s ", prefix, inode_num, i_type);
fprintf(out, "%sMode: %04o Flags: 0x%x ",
prefix, inode->i_mode & 0777, inode->i_flags);
#ifdef FILE_ATTR
#include <e2p/e2p.h>
if (do_dump_blocks && inode->i_flags) {
fprintf(out,"[");
print_flags(out, inode->i_flags, 0);
fprintf(out,"]\n");
}
else
#endif
fprintf(out,"\n");
if (is_large_inode && large_inode->i_extra_isize >= 24) {
fprintf(out, "%sGeneration: %u Version: 0x%08x:%08x\n",
prefix, inode->i_generation, large_inode->i_version_hi,
inode->osd1.linux1.l_i_version);
} else {
fprintf(out, "%sGeneration: %u Version: 0x%08x\n", prefix,
inode->i_generation, inode->osd1.linux1.l_i_version);
}
fprintf(out, "%sUser: %5d Group: %5d Size: ",
prefix, inode_uid(*inode), inode_gid(*inode));
if (LINUX_S_ISREG(inode->i_mode)) {
unsigned long long i_size = (inode->i_size |
((unsigned long long)inode->i_size_high << 32));
fprintf(out, "%llu\n", i_size);
} else
fprintf(out, "%d\n", inode->i_size);
if (os == EXT2_OS_HURD)
fprintf(out,
"%sFile ACL: %d Directory ACL: %d Translator: %d\n",
prefix,
inode->i_file_acl, LINUX_S_ISDIR(inode->i_mode) ? inode->i_size_high : 0,
inode->osd1.hurd1.h_i_translator);
else
fprintf(out, "%sFile ACL: %llu Directory ACL: %d\n",
prefix,
inode->i_file_acl | ((long long)
(inode->osd2.linux2.l_i_file_acl_high) << 32),
LINUX_S_ISDIR(inode->i_mode) ? inode->i_size_high : 0);
if (os == EXT2_OS_LINUX)
fprintf(out, "%sLinks: %d Blockcount: %llu\n",
prefix, inode->i_links_count,
(((unsigned long long)
inode->osd2.linux2.l_i_blocks_hi << 32)) +
inode->i_blocks);
else
fprintf(out, "%sLinks: %d Blockcount: %u\n",
prefix, inode->i_links_count, inode->i_blocks);
switch (os) {
case EXT2_OS_HURD:
frag = inode->osd2.hurd2.h_i_frag;
fsize = inode->osd2.hurd2.h_i_fsize;
break;
default:
frag = fsize = 0;
}
fprintf(out, "%sFragment: Address: %d Number: %d Size: %d\n",
prefix, inode->i_faddr, frag, fsize);
if (is_large_inode && large_inode->i_extra_isize >= 24) {
fprintf(out, "%s ctime: %10lu:%010lu -- %s", prefix,
(long unsigned int)inode->i_ctime, (long unsigned int)large_inode->i_ctime_extra,
time_to_string(inode->i_ctime));
fprintf(out, "%s atime: %10lu:%010lu -- %s", prefix,
(long unsigned int)inode->i_atime, (long unsigned int)large_inode->i_atime_extra,
time_to_string(inode->i_atime));
fprintf(out, "%s mtime: %10lu:%010lu -- %s", prefix,
(long unsigned int)inode->i_mtime, (long unsigned int)large_inode->i_mtime_extra,
time_to_string(inode->i_mtime));
fprintf(out, "%scrtime: %10lu:%010lu -- %s", prefix,
(long unsigned int)large_inode->i_crtime, (long unsigned int)large_inode->i_crtime_extra,
time_to_string(large_inode->i_crtime));
} else {
fprintf(out, "%sctime: %10lu -- %s", prefix, (long unsigned int)inode->i_ctime,
time_to_string(inode->i_ctime));
fprintf(out, "%satime: %10lu -- %s", prefix, (long unsigned int)inode->i_atime,
time_to_string(inode->i_atime));
fprintf(out, "%smtime: %10lu -- %s", prefix, (long unsigned int)inode->i_mtime,
time_to_string(inode->i_mtime));
}
if (inode->i_dtime)
fprintf(out, "%sdtime: %10lu -- %s", prefix, (long unsigned int)inode->i_dtime,
time_to_string(inode->i_dtime));
if (EXT2_INODE_SIZE(current_fs->super) > EXT2_GOOD_OLD_INODE_SIZE)
dump_inode_extra(out, prefix, inode_num,
(struct ext2_inode_large *) inode);
if (LINUX_S_ISLNK(inode->i_mode) && ext2fs_inode_data_blocks(current_fs,inode) == 0)
fprintf(out, "%sFast_link_dest: %.*s\n\n", prefix,
(int) inode->i_size, (char *)inode->i_block);
else if (LINUX_S_ISBLK(inode->i_mode) || LINUX_S_ISCHR(inode->i_mode)) {
int major, minor;
const char *devnote;
if (inode->i_block[0]) {
major = (inode->i_block[0] >> 8) & 255;
minor = inode->i_block[0] & 255;
devnote = "";
} else {
major = (inode->i_block[1] & 0xfff00) >> 8;
minor = ((inode->i_block[1] & 0xff) |
((inode->i_block[1] >> 12) & 0xfff00));
devnote = "(New-style) ";
}
fprintf(out, "%sDevice major/minor number: %02d:%02d (hex %02x:%02x)\n\n",
devnote, major, minor, major, minor);
} else if (do_dump_blocks && !(inode->i_dtime)) {
if (inode->i_flags & EXT4_EXTENTS_FL)
local_dump_extents(out, prefix, inode,
DUMP_LEAF_EXTENTS | DUMP_EXTENT_TABLE, 11, 11);
else
dump_blocks(out, prefix, inode);
}
}
//calculate the position of inode in FS
blk_t get_inode_pos(struct ext2_super_block *es ,struct inode_pos_struct *pos, ext2_ino_t inode_nr,int flag){
//FIXME blk64_t
__u32 inode_group, group_offset, inodes_per_block, inode_offset;
blk_t inode_block;
pos->size = EXT2_INODE_SIZE(current_fs->super);
inode_group = ((inode_nr - 1) / es->s_inodes_per_group);
group_offset = ((inode_nr - 1) % es->s_inodes_per_group);
inodes_per_block = (current_fs->blocksize / pos->size );
#ifdef EXT2_FLAG_64BITS
inode_block = (blk_t) ext2fs_inode_table_loc(current_fs,inode_group) + (group_offset / inodes_per_block);
#else
inode_block = current_fs->group_desc[inode_group].bg_inode_table + (group_offset / inodes_per_block);
#endif
inode_offset = ((group_offset % inodes_per_block) * pos->size );
if (flag)
printf("Inode %u is at group %u, block %u, offset %u\n", inode_nr, inode_group, inode_block, inode_offset);
pos->block = inode_block;
pos->offset = inode_offset;
return inode_block;
};
// get journalinode from transactionnumber
int get_transaction_inode(ext2_ino_t inode_nr, __u32 transaction_nr, struct ext2_inode_large *inode){
struct inode_pos_struct pos;
__u32 journal_block;
blk_t block_nr;
struct ext2_inode_large *inode_buf;
char *buf = NULL;
int retval = 0;
unsigned int got;
int blocksize = current_fs->blocksize;
block_nr = get_inode_pos(current_fs->super, &pos , inode_nr, 0);
journal_block = get_journal_blocknr(block_nr, transaction_nr);
if (! journal_block){
fprintf(stdout,"No journalblock found for inode %lu by transaction %lu\n",
(long unsigned int)inode_nr,(long unsigned int)transaction_nr);
retval = -1;
}
else {
buf =(char*) malloc(blocksize);
if(buf){
retval = read_journal_block(journal_block * blocksize ,buf,blocksize,&got);
if ((! retval) && (got == blocksize)){
inode_buf = (struct ext2_inode_large *)(buf + pos.offset);
#ifdef WORDS_BIGENDIAN
memset(inode, 0, pos.size);
ext2fs_swap_inode_full(current_fs, inode, inode_buf, 0, pos.size);
if ((pos.size > EXT2_GOOD_OLD_INODE_SIZE) && (inode->i_extra_isize >= 24)
&& (ext2fs_le32_to_cpu(inode_buf->i_crtime ) != inode->i_crtime)){
//FIXME: On my current version of libext2 the extra time fields ar not bigendian corrected
// We solved this temporarily here with this function
le_to_cpu_swap_extra_time(inode,(char*)inode_buf);
}
#else
memcpy(inode, inode_buf, pos.size);
#endif
}
free(buf);
}
}
return retval;
}
//function for dump_inode_list
void print_j_inode(struct ext2_inode_large *inode , ext2_ino_t inode_nr , __u32 transaction , int flag){
fprintf(stdout,"\nDump Inode %d from journal transaction %d\n",inode_nr,transaction);
dump_inode(stdout, "",inode_nr, (struct ext2_inode *)inode, flag);
return ;
}
//print the contents of all copy of inode in the journal
void dump_inode_list(struct ring_buf* buf, int flag){
r_item* item;
int i, count;
__u32 time_stamp;
if (!buf ) return;
item = r_first(buf);
count = r_get_count(buf);
for (i = 0; i < count ; i++){
print_j_inode(item->inode , buf->nr , item->transaction.start, flag);
if ( LINUX_S_ISDIR(item->inode->i_mode)){
time_stamp = (item->transaction.start) ? get_trans_time(item->transaction.start) : 0 ;
#ifdef DEBUG
printf ("Transaction-time for search %ld : %s\n", time_stamp, time_to_string(time_stamp));
#endif
list_dir3(buf->nr, (struct ext2_inode*)item->inode, &(item->transaction),time_stamp);
}
item = r_next(item);
}
return;
}
// return the last undeleted inode in journal
r_item* get_last_undel_inode(struct ring_buf* buf){
r_item* item;
int i, count;
// __u32 generation;
if (!buf ) return NULL;
item = r_last(buf);
count = r_get_count(buf);
for (i = 0; i< count; i++){
// if ( !i ) generation = item->inode->i_generation;
if (item->inode->i_dtime) {
// buf->del_flag = 1;
item = r_prev(item);
}
else {
// if (item->inode->i_generation != generation)
// buf->reuse_flag = 1;
#ifdef DEBUG
printf("UD-Inode %d\n",item->transaction.start);
#endif
if((! item->inode->i_links_count)&&(item->inode->i_ctime)
&&(item->inode->i_mode))
item->inode->i_links_count = 1 ;
return item;
}
}
return NULL;
}
// return the last undelete inode in journal after -> <-before
r_item* get_undel_inode(struct ring_buf* buf, __u32 after, __u32 before){
r_item* item;
int i, count;
// __u32 generation;
if (!buf) return NULL;
item = r_last(buf);
count = r_get_count(buf);
for (i = 0; i< count; i++){
// if ( !i ) generation = item->inode->i_generation;
if ((item->inode->i_dtime) && (item->inode->i_dtime < after) )
return NULL;
if ((item->inode->i_ctime >= before ) || (item->inode->i_dtime)) {
// if (item->inode->i_dtime)
// buf->del_flag = 1 ;
item = r_prev(item);
continue;
}
// if (item->inode->i_generation != generation)
// buf->reuse_flag = 1;
if((! item->inode->i_links_count)&&(item->inode->i_ctime)&&(item->inode->i_mode))
item->inode->i_links_count = 1 ;
#ifdef DEBUG
printf("UTD-Inode %d\n",item->transaction.start);
#endif
return item;
}
return NULL;
}
//fill all inode found in the Journal in the inode-ringbuffer
struct ring_buf* get_j_inode_list(struct ext2_super_block *es, ext2_ino_t inode_nr){
struct inode_pos_struct pos;
blk_t block;
char *inode_buf = NULL ;
struct ext2_inode *inode_pointer;
struct ring_buf *buf = NULL;
r_item *item = NULL;
// struct ext2_inode_large *inode = NULL;
int count, retval = 0;
unsigned int got;
off_t offset;
char *journal_tag_buf = NULL;
journal_descriptor_tag_t *block_list;
__u32 ctime = 1;
__u32 same_size = 1;
__u32 same_block_count = 0;
__u16 same_link_count = 0;
if ((inode_nr > es->s_inodes_count) || (inode_nr == 0))
{
printf(" unknown ERROR: bad inode number found %d \n", inode_nr );
return NULL;
}
block = get_inode_pos(es , &pos , inode_nr, 0);
inode_buf = malloc(pos.size);
if (!inode_buf) {
fprintf(stderr,"Error: can not allocate memory for buffer\n");
goto errout;
}
count = get_block_list_count(block) ;
#ifdef DEBUG
fprintf(stdout,"\n\nINODE_RING : %ld/%ld/%ld : ",inode_nr, pos.block, pos.offset);
#endif
if(! count) {
// no inode block found
// then we will load the oginal inode from the filesystem
// we will hope, the file has not change for a long time
buf = ring_new(pos.size,inode_nr);
if (buf)
item = r_item_add(buf);
if ( ! item)
{
fprintf(stderr,"Error: can not allocate memory for inode\n");
goto errout;
}
if ( ext2fs_read_inode_full(current_fs, inode_nr, (struct ext2_inode*) item->inode, pos.size))
goto errout;
item->transaction.start = item->transaction.end = 0;
#ifdef DEBUG
fprintf(stdout,"*;");
#endif
}
else {
// read and fill the journal inode
journal_tag_buf = (void *)malloc((sizeof(journal_descriptor_tag_t) * count));
if (!journal_tag_buf) {
fprintf(stderr,"Error: while allocate Memory for blocklist\n");
goto errout;
}
block_list = (journal_descriptor_tag_t *) journal_tag_buf;
count = get_block_list(block_list, block, count);
buf = ring_new(pos.size,inode_nr);
if ((! buf) || (! count)) goto errout;
for (;count > 0;count-- , block_list++ ){
offset = (block_list->j_blocknr * current_fs->blocksize) + pos.offset ;
retval = read_journal_block( offset , inode_buf , pos.size , &got);
if (retval) {
fprintf(stderr,"Error: while read Inode %d from journal transaction %d\n", inode_nr, block_list->transaction);
goto errout;
}
inode_pointer = (struct ext2_inode*) inode_buf ;
//FIXME: check more bad Inode
if (get_inode_mode_type(ext2fs_le16_to_cpu(inode_pointer->i_mode)) == ' '){
#ifdef DEBUG
fprintf(stdout,"!%ld;",block_list->transaction);
#endif
continue;
}
//Correct d_time anomalies if directory delete process not completed BUG: #18730
if ((LINUX_S_ISDIR(ext2fs_le16_to_cpu(inode_pointer->i_mode))) &&
ext2fs_le32_to_cpu(inode_pointer->i_dtime) && ext2fs_le32_to_cpu(inode_pointer->i_blocks) &&
ext2fs_le32_to_cpu(inode_pointer->i_size) && (!ext2fs_le16_to_cpu(inode_pointer->i_links_count)) &&
ext2fs_le32_to_cpu(inode_pointer->i_ctime) != ext2fs_le32_to_cpu(inode_pointer->i_dtime)){
if ( buf->count && LINUX_S_ISDIR(item->inode->i_mode) && item->inode->i_blocks){
continue;
}
else{
inode_pointer->i_dtime = 0;
}
}
//inode with the same ctime + the same size and links and <= block_count, skipped
if (ext2fs_le32_to_cpu(inode_pointer->i_ctime) == ctime){
if (item) {
if ((ext2fs_le32_to_cpu(inode_pointer->i_size) == same_size) &&
(ext2fs_le16_to_cpu(inode_pointer->i_links_count) == same_link_count) &&
(ext2fs_le32_to_cpu(inode_pointer->i_blocks) <= same_block_count)){
item->transaction.end = block_list->transaction;
#ifdef DEBUG
fprintf(stdout,"-;");
#endif
continue;
}
}
}
item = r_item_add(buf);
if ( ! item)
{
fprintf(stderr,"Error: can not allocate memory for inode\n");
goto errout;
}
#ifdef WORDS_BIGENDIAN
memset(item->inode, 0, pos.size);
ext2fs_swap_inode_full(current_fs,
(struct ext2_inode_large *) item->inode,
(struct ext2_inode_large *) inode_buf,
0, pos.size);
if ((pos.size > EXT2_GOOD_OLD_INODE_SIZE) && (item->inode->i_extra_isize >= 24)
&& (ext2fs_le32_to_cpu(((struct ext2_inode_large *)inode_buf)->i_crtime) != item->inode->i_crtime)){
//FIXME: On my current version of libext2 the extra time fields ar not bigendian corrected
// We solved this temporarily here with this function
le_to_cpu_swap_extra_time(item->inode,(char*)inode_buf);
}
#else
memcpy(item->inode, inode_buf, pos.size);
#endif
#ifdef DEBUG
fprintf(stdout,"%ld;",block_list->transaction);
#endif
item->transaction.start = block_list->transaction;
item->transaction.end = block_list->transaction;
ctime = item->inode->i_ctime;
same_size = item->inode->i_size;
same_block_count = item->inode->i_blocks;
same_link_count = item->inode->i_links_count;
}
// check for the real filesystem inode
// if not delete or newer than the last journal copy, we add also this inode
if ( ext2fs_read_inode_full(current_fs, inode_nr, (struct ext2_inode*)inode_buf, pos.size))
goto errout;
inode_pointer = (struct ext2_inode*) inode_buf ;
if((((! inode_pointer->i_dtime) && inode_pointer->i_ctime) || (inode_pointer->i_ctime > ctime)) &&
(inode_pointer->i_ctime < (__u32) now_time)){
item = r_item_add(buf);
if ( ! item){
fprintf(stderr,"Error: can not allocate memory for inode\n");
goto errout;
}
memcpy(item->inode, inode_buf, pos.size);
item->transaction.start = item->transaction.end = 0;
#ifdef DEBUG
fprintf(stdout,"*;");
#endif
}
} // else-tree ? count==0
if (buf->count == 0)
goto errout;
if ( inode_buf ) {
free(inode_buf);
inode_buf = NULL;
}
if ( journal_tag_buf ) {
free(journal_tag_buf);
journal_tag_buf = NULL;
}
r_begin(buf);
#ifdef DEBUG
fprintf(stdout,"<OK> %ld\n",buf->count);
#endif
return buf;
errout:
if ( inode_buf ) {
free(inode_buf);
inode_buf = NULL;
}
if ( journal_tag_buf ) {
free(journal_tag_buf);
journal_tag_buf = NULL;
}
if ( buf ) {
ring_del(buf);
buf = NULL;
}
#ifdef DEBUG
fprintf(stdout,"<NULL>\n");
#endif
return NULL;
}
// get the first Journal Inode by time_stamp
int read_time_match_inode( ext2_ino_t inode_nr, struct ext2_inode* inode_buf, __u32 time_stamp){
struct ring_buf* i_ring;
r_item* item;
int retval = 1;
i_ring = get_j_inode_list(current_fs->super, inode_nr);
if (i_ring) {
item = r_last(i_ring);
while ((item->inode->i_ctime > time_stamp) && ( item != r_first(i_ring)))
item = r_prev(item);
//FIXME
memcpy(inode_buf,item->inode,EXT2_GOOD_OLD_INODE_SIZE);
ring_del(i_ring);
retval= 0;
}
return retval;
}
// get the first Journal Inode by transaction
int read_journal_inode( ext2_ino_t inode_nr, struct ext2_inode* inode_buf, __u32 transaction){
struct ring_buf* i_ring;
r_item* item;
int retval = 1;
i_ring = get_j_inode_list(current_fs->super, inode_nr);
if (i_ring) {
item = r_first(i_ring);
while ((item->transaction.start < transaction) && ( item != r_last(i_ring)))
item = r_next(item);
memcpy(inode_buf,item->inode,EXT2_GOOD_OLD_INODE_SIZE);
ring_del(i_ring);
retval= 0;
}
return retval;
}
//create a new inode
struct ext2_inode_large* new_inode(){
struct ext2_inode_large *inode;
__u32 a_time;
time_t help_time;
struct ext3_extent_header *p_extent_header;
time( &help_time );
a_time = (__u32) help_time;
inode = malloc(EXT2_INODE_SIZE(current_fs->super));
if (! inode )
return NULL;
memset(inode, 0 , EXT2_INODE_SIZE(current_fs->super));
inode->i_mode = LINUX_S_IFREG | LINUX_S_IRUSR | LINUX_S_IWUSR | LINUX_S_IRGRP | LINUX_S_IROTH ;
inode->i_ctime = inode->i_mtime = inode->i_atime = a_time;
inode->i_links_count = 1 ;
if (current_fs->super->s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS) {
inode->i_flags = EXT4_EXTENTS_FL ;
p_extent_header = (struct ext3_extent_header*) inode->i_block;
p_extent_header->eh_magic = ext2fs_cpu_to_le16(EXT3_EXT_MAGIC) ;
p_extent_header->eh_max = ext2fs_cpu_to_le16(4);
}
return inode;
}
//add extent to inode
int inode_add_extent(struct ext2_inode_large* inode , struct extent_area* ea, __u32* last, int flag ){
int ret = 0;
struct ext3_extent_idx *idx;
struct ext3_extent_header *header;
struct ext3_extent *extent;
struct ext3_extent *extent_new;
__u64 i_size;
if ((!ea ) || (!ea->blocknr))
return 0;
header = (struct ext3_extent_header*) inode->i_block;
if (flag){
// flag == 1 ; add extent index
if (ext2fs_le16_to_cpu(header->eh_entries) >= ext2fs_le16_to_cpu(header->eh_max)){
fprintf(stderr," Error: can not add a extent to inode\n");
return 0;
}
idx = (struct ext3_extent_idx*) (header + (ext2fs_le16_to_cpu(header->eh_entries) + 1));
if (! header->eh_entries)
header->eh_depth = ext2fs_cpu_to_le16(ea->depth) +1;
idx->ei_leaf = ext2fs_cpu_to_le32(ea->blocknr);
idx->ei_leaf_hi = 0;
idx->ei_unused = 0;
idx->ei_block = ext2fs_cpu_to_le32(ea-> l_start);
header->eh_entries = ext2fs_cpu_to_le16(ext2fs_le16_to_cpu(header->eh_entries) + 1 );
ret = 1;
}
else{
// flag == 0 : add or attach a extent entry
if (! ext2fs_le16_to_cpu(header->eh_entries))
header->eh_entries = ext2fs_cpu_to_le16(1);
extent = (struct ext3_extent*) (header + (ext2fs_le16_to_cpu(header->eh_entries)+1));
// new
if(!(ext2fs_le32_to_cpu(extent->ee_start))){
extent->ee_start = ext2fs_cpu_to_le32(ea->start_b);
extent->ee_len = ext2fs_cpu_to_le16(ea->len);
ret = 1 ;
}
else{
// attach
if (ea->start_b == (ext2fs_le32_to_cpu(extent->ee_start) + ext2fs_le16_to_cpu(extent->ee_len))){
extent->ee_len = ext2fs_cpu_to_le16(ext2fs_le16_to_cpu(extent->ee_len)+ ea->len);
ret = 1;
}
}
if ((! ret) && (ext2fs_le16_to_cpu(header->eh_entries) < ext2fs_le16_to_cpu(header->eh_max))){
// new entry
header->eh_entries = ext2fs_cpu_to_le16(ext2fs_le16_to_cpu(header->eh_entries) + 1 );
extent_new = (struct ext3_extent*) (header + (ext2fs_le16_to_cpu(header->eh_entries)+1));
// extent->ee_start_hi
extent_new->ee_start = ext2fs_cpu_to_le32(ea->start_b);
extent_new->ee_len = ext2fs_cpu_to_le16(ea->len);
extent_new->ee_block = ext2fs_cpu_to_le32(ext2fs_le32_to_cpu(extent->ee_block)+ext2fs_le16_to_cpu(extent->ee_len));
ret = 1 ;
}
}
if (ret){
i_size = (unsigned long long)(inode->i_size | ((unsigned long long)inode->i_size_high << 32));
i_size += ea->size;
inode->i_size = i_size & 0xffffffff ;
inode->i_size_high = i_size >> 32 ;
inode->i_blocks += (ea->b_count * (current_fs->blocksize / 512)) ;
*last = (ea->end_b) ? ea->end_b : 0 ;
// blockhex (stdout, (void*) inode, 0, 128);
}
else
fprintf(stderr," Error: can not add a extent to inode\n");
return ret;
}
//add a block to inode, (ext3 only the first 12 blocks)
int inode_add_block(struct ext2_inode_large* inode , blk_t blk ){
int i = 0 ;
unsigned long long i_size;
struct ext3_extent *extent;
struct ext3_extent_header *header;
if (! (inode->i_flags & EXT4_EXTENTS_FL)){
//ext3
while ((i < EXT2_N_BLOCKS) && inode->i_block[i] )
i++;
if ( i >= EXT2_NDIR_BLOCKS){
// printf("faulty Block %u as i_block %d \n", i,blk);
//indirect blocks
return 0;
}
inode->i_block[i] = blk;
}
else{
//ext4
header = (struct ext3_extent_header*) inode->i_block;
if (! ext2fs_le16_to_cpu(header->eh_entries)) {
header->eh_entries = ext2fs_cpu_to_le16(1);
extent = (struct ext3_extent*) (header + (ext2fs_le16_to_cpu(header->eh_entries)));
extent->ee_start = ext2fs_cpu_to_le32(blk);
}
else
extent = (struct ext3_extent*) (header + (ext2fs_le16_to_cpu(header->eh_entries)));
extent->ee_len = ext2fs_cpu_to_le16(ext2fs_le16_to_cpu(extent->ee_len) +1);
}
i_size = (unsigned long long)(inode->i_size | ((unsigned long long)inode->i_size_high << 32));
i_size += current_fs->blocksize;
inode->i_size = i_size & 0xffffffff ;
inode->i_size_high = i_size >> 32 ;
inode->i_blocks += (current_fs->blocksize / 512);
return 1;
}
//add the ext3 indirect Blocks to the inode
int inode_add_meta_block(struct ext2_inode_large* inode , blk_t blk, blk_t *last, blk_t *next, char *buf ){
blk_t block_count = 0;
int i = 0;
__u64 i_size = 0;
int ret = 0;
if (! (inode->i_flags & EXT4_EXTENTS_FL)){
while ((i < EXT2_N_BLOCKS) && inode->i_block[i] )
i++;
switch (i){
case EXT2_IND_BLOCK :
ret = get_ind_block_len(buf, &block_count, last, next, &i_size);
break;
case EXT2_DIND_BLOCK :
ret = get_dind_block_len(buf, &block_count, last, next, &i_size);
break;
case EXT2_TIND_BLOCK :
ret = get_tind_block_len(buf, &block_count, last, next, &i_size);
break;
default:
// printf("faulty Block %u as indirekter_block %d \n", i,blk);
return 0;
break;
}
if (ret && i_size){
i_size += (((__u64)inode->i_size_high << 32)| inode->i_size);
inode->i_size = i_size & 0xffffffff ;
inode->i_size_high = i_size >> 32 ;
inode->i_blocks += (block_count * (current_fs->blocksize / 512));
inode->i_block[ i ] = blk;
}
else
*next = 0;
return ret;
}
else{
// printf("ERROR: ext3 indirect block %u ; but is a ext4_inode\n", blk);
//FIXME ext4
}
return 0;
}
|
orochi/ext4magic
|
src/inode.c
|
C++
|
mit
| 39,480 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef INODE_H
#define INODE_H
#include <ext2fs/ext2fs.h>
#include "util.h"
#include "ext4magic.h"
#include "journal.h"
#include "ring_buf.h"
#include "extent_db.h"
#define DUMP_LEAF_EXTENTS 0x01
#define DUMP_NODE_EXTENTS 0x02
#define DUMP_EXTENT_TABLE 0x04
//buffersize für magic_block_scan3
#define MAX_RANGE 16
//help struct for list inode data blocks
struct list_blocks_struct {
FILE *f;
e2_blkcnt_t total;
blk_t first_block, last_block;
e2_blkcnt_t first_bcnt, last_bcnt;
e2_blkcnt_t first;
};
/*
struct extent_area {
blk_t blocknr;
__u16 depth;
blk_t l_start;
blk_t l_end;
blk_t start_b;
blk_t end_b;
};
*/
//functions for external use
int intern_read_inode_full(ext2_ino_t, struct ext2_inode*, int);// read real fs inode 128++
int intern_read_inode(ext2_ino_t, struct ext2_inode*);// read real fs inode 128
r_item* get_undel_inode(struct ring_buf*, __u32, __u32);// return the last undelete inode in journal after -> <-before
r_item* get_last_undel_inode(struct ring_buf* );// return the last undeleted inode in journal
blk_t get_inode_pos(struct ext2_super_block* , struct inode_pos_struct*, ext2_ino_t, int);//calculate the position of inode in FS
void print_j_inode(struct ext2_inode_large* , ext2_ino_t , __u32, int );//function for dump_inode_list
int get_transaction_inode(ext2_ino_t, __u32, struct ext2_inode_large*);// get journalinode from transactionnumber
void dump_inode_list(struct ring_buf* , int);//print the contents of all copy of inode in the journal
void dump_inode(FILE*, const char*, ext2_ino_t, struct ext2_inode*,int);//print the contents of inode
int read_journal_inode( ext2_ino_t, struct ext2_inode*, __u32);// get the first Journal Inode by transaction
int read_time_match_inode( ext2_ino_t, struct ext2_inode*, __u32);// get the first Journal Inode by time_stamp
struct ring_buf* get_j_inode_list(struct ext2_super_block*, ext2_ino_t);//fill all inode found in the Journal in the inode-ringbuffer
//functions for the magic scanner
struct ext2_inode_large* new_inode(); //create a new inode
int inode_add_block(struct ext2_inode_large* , blk_t); //add a block to inode
int inode_add_meta_block(struct ext2_inode_large*, blk_t, blk_t*, blk_t*,char* ); //add the ext3 indirect Blocks to the inode
//functions in develop
int inode_add_extent(struct ext2_inode_large*, struct extent_area*, __u32*, int );
//blk_t get_last_block_ext4(struct ext2_inode_large*); //search the last data block ext4-inode
#endif
|
orochi/ext4magic
|
src/inode.h
|
C++
|
mit
| 3,872 |
#ifndef _JFS_COMPAT_H
#define _JFS_COMPAT_H
/* ext3/4 libraries */
#include <ext2fs/ext2fs.h>
/*#include "kernel-list.h"
#include <errno.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#define printk printf
#define KERN_ERR ""
#define KERN_DEBUG ""
#define READ 0
#define WRITE 1*/
//#define cpu_to_be32(n) htonl(n)
//#define be32_to_cpu(n) ntohl(n)
typedef unsigned int tid_t;
typedef struct journal_s journal_t;
struct buffer_head;
struct inode;
struct journal_s
{
unsigned long j_flags;
int j_errno;
struct buffer_head * j_sb_buffer;
struct journal_superblock_s *j_superblock;
int j_format_version;
unsigned long j_head;
unsigned long j_tail;
unsigned long j_free;
unsigned long j_first, j_last;
kdev_t j_dev;
kdev_t j_fs_dev;
int j_blocksize;
unsigned int j_blk_offset;
unsigned int j_maxlen;
struct inode * j_inode;
tid_t j_tail_sequence;
tid_t j_transaction_sequence;
__u8 j_uuid[16];
struct jbd_revoke_table_s *j_revoke;
tid_t j_failed_commit;
};
/*#define J_ASSERT(assert) \
do { if (!(assert)) { \
printf ("Assertion failure in %s() at %s line %d: " \
"\"%s\"\n", \
__FUNCTION__, __FILE__, __LINE__, # assert); \
fatal_error(e2fsck_global_ctx, 0); \
} } while (0)
#define is_journal_abort(x) 0
#define BUFFER_TRACE(bh, info) do {} while (0)
// Need this so we can compile with configure --enable-gcc-wall
#ifdef NO_INLINE_FUNCS
#define inline
#endif*/
#endif /* _JFS_COMPAT_H */
|
orochi/ext4magic
|
src/jfs_compat.h
|
C++
|
mit
| 1,487 |
#ifndef _JFS_USER_H
#define _JFS_USER_H
typedef unsigned short kdev_t;
#include "kernel-jbd.h"
#endif /* _JFS_USER_H */
|
orochi/ext4magic
|
src/jfs_user.h
|
C++
|
mit
| 123 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
#ifndef HAVE_ERRNO_H
#include <errno.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <utime.h>
#include <blkid/blkid.h>
#include <ext2fs/ext2fs.h>
#include "jfs_user.h"
#include <uuid/uuid.h>
#include "ext4magic.h"
#include "util.h"
#include "journal.h"
#include "inode.h"
enum journal_location {JOURNAL_IS_INTERNAL, JOURNAL_IS_EXTERNAL, JOURNAL_IS_DUMMY};
//flags for journaldescriptor control
#define ANY_BLOCK ((blk_t) -1)
#define WRAP_UNDEF 0
#define WRAP_ON 1
#define WRAP_OFF 2
#define WRAP_READY 3
struct journal_source
{
enum journal_location where;
int fd;
ext2_file_t file;
char* j_dummy;
};
//static variable for work with journal
struct journal_source journal_source;
extern ext2_filsys current_fs ;
extern time_t now_time ;
struct ext2_super_block *jsb_pointer; //pointer for find & open journal
char jsb_buffer[1024]; //buffer for journal-superblock (be_to_CPU)
void* pt_buff; /*pointer of the privat descriptor Table */
journal_descriptor_tag_t *pt; /*pointer for descriptor Table*/
__u32 *ptl; /*reverse pointer for lost inodeblocks*/
__u32 pt_count; /*counter for privat descriptor Table */
__u32 ptl_count; /*counter for lost inodeblocks*/
struct j_bitmap_list_t jbbm ; /* for Block Bitmaps of Journal */
//print journal superblock
void dump_journal_superblock( void)
{
int i;
__u32 nr_users;
char buffer[40];
uuid_t *uu;
journal_superblock_t *jsb = (journal_superblock_t*)jsb_buffer;
fprintf(stdout,"\nJournal Super Block:\n");
fprintf(stdout," Signature: 0x%08x \n",jsb->s_header.h_magic);
fprintf(stdout," Blocktype : %s \n",type_to_name(jsb->s_header.h_blocktype));
fprintf(stdout," Journal block size: %lu \n",(long unsigned int)jsb->s_blocksize);
fprintf(stdout," Number of journal blocks: %lu \n",(long unsigned int)jsb->s_maxlen);
fprintf(stdout," Journal block where the journal actually starts: %lu\n",(long unsigned int)jsb->s_first);
fprintf(stdout," Sequence number of first transaction: %lu\n", (long unsigned int)jsb->s_sequence);
fprintf(stdout," Journal block of first transaction: %lu\n", (long unsigned int)jsb->s_start);
fprintf(stdout," Error number: %ld\n",(long int)jsb->s_errno);
if ((jsb->s_header.h_blocktype) != JFS_SUPERBLOCK_V2)
return ;
// Remaining fields are only valid in a version-2 superblock
//FIXME: Strings of Features
fprintf(stdout," Compatible Features: %lu\n",(long unsigned int)jsb->s_feature_compat);
fprintf(stdout," Incompatible features: %lu\n",(long unsigned int)jsb->s_feature_incompat);
fprintf(stdout," Read only compatible features: %lu\n",(long unsigned int)jsb->s_feature_ro_compat);
uuid_unparse(jsb->s_uuid, buffer);
fprintf(stdout," Journal UUID: %s \n",buffer);
nr_users = jsb->s_nr_users;
fprintf(stdout," Number of file systems using journal: %lu\n", (long unsigned int)jsb->s_nr_users);
fprintf(stdout," Location of superblock copy: %lu\n",(long unsigned int)jsb->s_dynsuper);
fprintf(stdout," Max journal blocks per transaction: %lu\n",(long unsigned int)jsb->s_max_transaction);
fprintf(stdout," Max file system blocks per transaction: %lu\n",(long unsigned int)jsb->s_max_trans_data);
if (nr_users && (nr_users < 48)) {
fprintf(stdout," IDs of all file systems using the journal:\n");
for (i = 0; i < nr_users; i++){
uu=(void*) &jsb->s_users[i*16];
uuid_unparse(*uu, buffer);
fprintf(stdout,"%02d. : %s\n",i+1,buffer);
}
}
fprintf(stdout," \n\n");
return;
}
// local subfunction
static void journal_superblock_to_cpu ( __u32 *jsb )
{
int i;
for (i=0;i<12;i++)
*(jsb+i) = ext2fs_be32_to_cpu(*(jsb+i));
// UUIDs are endian-independent, so don't swap those bytes
for (i=16;i<20;i++)
*(jsb+i) = ext2fs_be32_to_cpu(*(jsb+i));
// User IDs are endian-independent
}
// open an extract the blocklist from journal
extern int journal_open( char *journal_file_name, int journal_backup_flag )
{
char *journal_dev_name = NULL;
int journal_fd = 0;
ext2_ino_t journal_inum;
struct ext2_inode journal_inode;
int retval;
ext2_file_t journal_file;
#ifdef EXPERT_MODE
char *dummy_journal = NULL;
#endif
pt_buff = NULL;
ptl = NULL;
if (current_fs) jsb_pointer = current_fs->super;
else {
fprintf(stderr,"No filesystem open, this must be a bug\n");
return(JOURNAL_ERROR);
}
if (journal_file_name) {
/* Set up to read journal from a regular file somewhere */
journal_fd = open(journal_file_name, O_RDONLY, 0);
if (journal_fd < 0) {
fprintf(stderr,"Error %d while opening %s for read external journal\n",errno,journal_file_name);
goto errout;
}
journal_source.where = JOURNAL_IS_EXTERNAL;
journal_source.fd = journal_fd;
journal_source.file = NULL;
journal_source.j_dummy = NULL;
printf("Using external Journal at File %s \n",journal_file_name);
} else if ((journal_inum = jsb_pointer->s_journal_inum)) {
if (journal_backup_flag) {
if (jsb_pointer->s_jnl_backup_type != EXT3_JNL_BACKUP_BLOCKS) {
fprintf(stderr,"no journal backup in super block\n");
goto errout;
}
memset(&journal_inode, 0, sizeof(struct ext2_inode));
memcpy(&journal_inode.i_block[0], jsb_pointer->s_jnl_blocks, EXT2_N_BLOCKS*4);
journal_inode.i_size = jsb_pointer->s_jnl_blocks[16];
journal_inode.i_links_count = 1;
journal_inode.i_mode = LINUX_S_IFREG | 0600;
if (jsb_pointer->s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)
journal_inode.i_flags |= EXT4_EXTENTS_FL;
} else {
if (intern_read_inode(journal_inum, &journal_inode))
goto errout;
}
retval = ext2fs_file_open2(current_fs, journal_inum,
&journal_inode, 0, &journal_file);
#ifdef EXPERT_MODE
if (journal_backup_flag){
//check the Journal Magic Number
char* jsb_buffer = NULL;
unsigned int got;
journal_superblock_t* jsb;
jsb_buffer = malloc(1024);
journal_source.where = JOURNAL_IS_INTERNAL;
journal_source.file = journal_file;
if ((jsb_buffer) && (! read_journal_block(0,jsb_buffer, 1024, &got))){
jsb = (journal_superblock_t *) jsb_buffer;
if ((ext2fs_be32_to_cpu(jsb->s_header.h_magic) != JFS_MAGIC_NUMBER) ||
(current_fs->blocksize != ext2fs_be32_to_cpu(jsb->s_blocksize))) {
retval = 1;
}
free(jsb_buffer);
}
else return JOURNAL_ERROR ;
}
#endif
if (retval) {
fprintf(stderr," Error %d while opening journal\n",retval);
#ifdef EXPERT_MODE
if (journal_backup_flag) {
journal_superblock_t *jsb;
//the journal is defect, create a insubstantial blank journal
dummy_journal = (char*) malloc(current_fs->blocksize * 2);
if (dummy_journal){
memset (dummy_journal,0,current_fs->blocksize *2);
jsb = (journal_superblock_t*) dummy_journal;
jsb->s_header.h_magic = ext2fs_cpu_to_be32(JFS_MAGIC_NUMBER);
jsb->s_header.h_blocktype = ext2fs_cpu_to_be32(JFS_SUPERBLOCK_V2);
jsb->s_blocksize = ext2fs_cpu_to_be32(current_fs->blocksize);
jsb->s_maxlen = ext2fs_cpu_to_be32(2);
jsb->s_nr_users = ext2fs_cpu_to_be32(1);
jsb->s_first = ext2fs_cpu_to_be32(1);
jsb->s_sequence = ext2fs_cpu_to_be32(1);
memcpy(jsb->s_uuid, current_fs->super->s_uuid, sizeof(current_fs->super->s_uuid));
journal_source.where = JOURNAL_IS_DUMMY;
journal_source.file = NULL;
journal_source.fd = -1 ;
journal_source.j_dummy = dummy_journal;
printf("Journal defect, using a dummy Journal\n");
}else
goto errout;
}
else
#endif
goto errout;
}
else {
journal_source.where = JOURNAL_IS_INTERNAL;
journal_source.file = journal_file;
journal_source.fd = -1 ;
journal_source.j_dummy = NULL;
printf("Using %s internal Journal at Inode %d\n",(journal_backup_flag)?"a recovered":"",journal_inum);
}
} else {
char uuid[37];
uuid_unparse(jsb_pointer->s_journal_uuid, uuid);
journal_dev_name = blkid_get_devname(NULL, "UUID", uuid);
if (!journal_dev_name)
journal_dev_name = blkid_devno_to_devname(jsb_pointer->s_journal_dev);
if (!journal_dev_name) {
fprintf(stderr,"filesystem has no journal\n");
goto errout;
}
journal_fd = open(journal_dev_name, O_RDONLY, 0);
if (journal_fd < 0) {
fprintf(stderr,"%d while opening %s for external journal\n",errno,journal_dev_name);
free(journal_dev_name);
goto errout;
}
printf("Using external journal found at %s\n", journal_dev_name);
free(journal_dev_name);
journal_source.where = JOURNAL_IS_EXTERNAL;
journal_source.fd = journal_fd;
journal_source.file = NULL;
}
return init_journal();
errout:
fprintf(stderr,"Error: while open journal\n" );
jsb_pointer = NULL;
return (JOURNAL_CLOSE);
}
// close the journal (last function in main() if the journal open)
extern int journal_close(void)
{
jsb_pointer = NULL;
pt_count = 0;
if ( pt_buff ) {
free(pt_buff);
pt_buff = NULL;
}
switch (journal_source.where){
case JOURNAL_IS_DUMMY :
if (journal_source.j_dummy){
free(journal_source.j_dummy);
journal_source.j_dummy = NULL;
}
break;
case JOURNAL_IS_INTERNAL :
if (journal_source.file){
ext2fs_file_close(journal_source.file);
journal_source.file = NULL;
}
break;
case JOURNAL_IS_EXTERNAL :
if (journal_source.fd > 0) {
close(journal_source.fd);
journal_source.fd = -1;
}
}
return (JOURNAL_CLOSE);
}
//print hexdump of a journalblock
int dump_journal_block( __u32 block_nr , int flag){
char *buf = NULL;
unsigned int got;
int retval = 0;
int blocksize = current_fs->blocksize;
buf = (char*) malloc(blocksize);
if(! buf) return 1 ;
retval = read_journal_block(block_nr * blocksize ,buf,blocksize,&got);
if (retval || got != blocksize)
return retval;
blockhex (stdout, buf, flag, blocksize);
if (buf)
free(buf);
return 0;
}
//read a journal block
int read_journal_block(off_t offset, char *buf, int size, unsigned int *got)
{
int retval = 1;
switch (journal_source.where) {
case JOURNAL_IS_EXTERNAL :
if (lseek(journal_source.fd, offset, SEEK_SET) < 0) {
retval = errno;
fprintf(stderr,"Error %d while seeking in reading journal",retval);
return retval;
}
retval = read(journal_source.fd, buf, size);
if (retval >= 0) {
*got = retval;
retval = 0;
} else retval = errno;
break;
case JOURNAL_IS_INTERNAL :
retval = ext2fs_file_lseek(journal_source.file, offset, EXT2_SEEK_SET, NULL);
if (retval) {
fprintf(stderr,"Error %d while seeking in reading journal",retval);
return retval;
}
retval = ext2fs_file_read(journal_source.file, buf, size, got);
break;
case JOURNAL_IS_DUMMY :
if((offset + size) > (2 *current_fs->blocksize)) retval = -1 ;
memcpy(buf,journal_source.j_dummy + offset,size);
*got = (unsigned int) size;
retval = 0;
break;
}
if (retval)
fprintf(stderr,"Error %d while reading journal",retval);
else if (*got != (unsigned int) size) {
fprintf(stderr,"short read (read %d, expected %d) while reading journal", *got, size);
retval = -1;
}
return retval;
}
const char *type_to_name(int btype)
{
switch (btype) {
case JFS_DESCRIPTOR_BLOCK:
return "descriptor block";
case JFS_COMMIT_BLOCK:
return "commit block";
case JFS_SUPERBLOCK_V1:
return "V1 superblock";
case JFS_SUPERBLOCK_V2:
return "V2 superblock";
case JFS_REVOKE_BLOCK:
return "revoke table";
}
return "unrecognised type";
}
//check if journal block is a lost inodeblock local function
static int jb_is_inodetable(char *buf){
struct ext2_inode *inode;
__u16 mode;
__u32 atime;
__u32 ctime;
__u32 mtime;
__u32 dtime;
int i;
__u32 min = 315601200; // 315601200 = "1980-01-01 20:00:00"
__u32 max = (__u32) now_time;
int i_size = EXT2_INODE_SIZE(current_fs->super);
int inodes_per_block = (current_fs->blocksize / i_size );
int flag = 0;
for (i=0; i<inodes_per_block;i++){
inode = (struct ext2_inode*) (buf + (i_size * i));
mode = ext2fs_le16_to_cpu(inode->i_mode);
atime = ext2fs_le32_to_cpu(inode->i_atime);
ctime = ext2fs_le32_to_cpu(inode->i_ctime);
mtime = ext2fs_le32_to_cpu(inode->i_mtime);
dtime = ext2fs_le32_to_cpu(inode->i_dtime);
if ((!mode) && (!atime) && (!ctime) && (!mtime) && (!dtime) && (!i))
return 0;
if ((!dtime) && (ctime > min) && (ctime < max) && (atime > min) && (atime < max)
&& (mtime > min) && (mtime < max) && inode->i_size && inode->i_blocks
&& LINUX_S_ISREG(mode) && inode->i_block[0] )
flag++;
if (ctime > max)
return 0;
}
return flag;
}
//check if block is a inodeblock local function
static int block_is_inodetable(blk64_t block){
int group;
struct ext2_group_desc *gdp;
blk64_t last;
last = current_fs->super->s_inodes_count / (current_fs->blocksize / current_fs->super->s_inode_size ) ;
last -= ((current_fs->group_desc_count - 1) * current_fs->inode_blocks_per_group );
//FIXME for struct ext4_group_desc 48/64BIT
for (group = 0; group < current_fs->group_desc_count; group++){
#ifdef EXT2_FLAG_64BITS
gdp = ext2fs_group_desc(current_fs, current_fs->group_desc, group);
#else
gdp = ¤t_fs->group_desc[group];
#endif
if (block >= (gdp->bg_inode_table + current_fs->inode_blocks_per_group))
continue;
if (block >= gdp->bg_inode_table){
if ( group == (current_fs->group_desc_count - 1 )){
if (block >= gdp->bg_inode_table + last)
break;
}
return 1;
}
else
break;
}
return 0;
}
// get last timestamp of all inode in this journalblock
static __u32 get_transaction_time( __u32 j_block){
char *buf;
struct ext2_inode *inode;
__u32 t_time = 0;
int ino, retval = 0;
unsigned int got;
int inode_size = EXT2_INODE_SIZE(current_fs->super);
int blocksize = current_fs->blocksize;
buf = (char*) malloc(blocksize);
if(! buf) return 0 ;
retval = read_journal_block(j_block * blocksize ,buf,blocksize,&got);
if (retval || got != blocksize){
fprintf(stderr,"Error while read journal block %u\n",(unsigned int)j_block);
t_time = 0;
goto errout;
}
for (ino = 0; ino < EXT2_INODES_PER_BLOCK(current_fs->super);ino++){
inode = (struct ext2_inode*) (buf + (inode_size * ino));
if (t_time < ext2fs_le32_to_cpu(inode->i_ctime))
t_time = ext2fs_le32_to_cpu(inode->i_ctime);
if (t_time < ext2fs_le32_to_cpu(inode->i_atime))
t_time = ext2fs_le32_to_cpu(inode->i_atime);
}
errout:
if (buf) free(buf);
return t_time;
}
//get the transactiontime of a transactionnumber
__u32 get_trans_time( __u32 transaction){
journal_descriptor_tag_t *pointer;
__u32 counter;
pointer = pt_buff;
for (counter=0 ; counter<pt_count ; counter++, pointer++) {
if (pointer->transaction != transaction) continue;
if (block_is_inodetable(pointer->f_blocknr)) {
return get_transaction_time(pointer->j_blocknr);
}
else continue;
}
return 0;
}
//print all usable copy of filesystem blocks are found in journal
void print_block_list(int flag){
journal_descriptor_tag_t *pointer;
__u32 counter;
__u32 transaction_time = 0;
pointer = pt_buff;
printf("\nFound %d copy of Filesystemblock in Journal\n",pt_count);
printf("FS-Block Journal Transact %s\n",(flag) ? "Time in sec Time of Transaction" :"" );
for (counter=0 ; counter<pt_count ; counter++) {
if (flag){
if (block_is_inodetable (pointer->f_blocknr)){
transaction_time = get_transaction_time(pointer->j_blocknr);
}
else transaction_time = 0;
}
if (transaction_time)
fprintf(stdout,"%12llu %8lu %8lu %8lu %s",(__u64) pointer->f_blocknr , (long unsigned int)pointer->j_blocknr ,
(long unsigned int)pointer->transaction, (long unsigned int)transaction_time, time_to_string(transaction_time) );
else
fprintf(stdout,"%12llu %8lu %8lu\n",(__u64) pointer->f_blocknr , (long unsigned int)pointer->j_blocknr ,
(long unsigned int)pointer->transaction);
pointer++ ;
}
}
//print all transactions for a fs-block
void print_block_transaction(blk64_t block_nr, int flag){
journal_descriptor_tag_t *pointer;
__u32 counter;
int is_inode_block = 0;
__u32 transaction_time = 0;
if (flag) is_inode_block = block_is_inodetable(block_nr);
pointer = pt_buff;
printf("\nTransactions of Filesystemblock %llu in Journal\n",block_nr);
printf("FS-Block Journal Transact %s\n",(is_inode_block) ? "Time in sec Time of Transaction" :"");
for (counter=0 ; counter<pt_count ; counter++) {
if (pointer->f_blocknr == block_nr){
if (is_inode_block){
transaction_time = get_transaction_time(pointer->j_blocknr);
fprintf(stdout,"%12llu %8lu %8lu %8lu %s",(__u64) pointer->f_blocknr ,
(long unsigned int)pointer->j_blocknr, (long unsigned int)pointer->transaction,
(long unsigned int)transaction_time, time_to_string(transaction_time));
}else
fprintf(stdout,"%12llu %8lu %8lu\n",(__u64) pointer->f_blocknr ,
(long unsigned int)pointer->j_blocknr , (long unsigned int)pointer->transaction);
}
pointer++ ;
}
}
//get the journalblocknumber for a transactionnumber
__u32 get_journal_blocknr(blk64_t block_nr, __u32 trans_nr){
__u32 journal_nr = 0;
journal_descriptor_tag_t *pointer;
int i;
pointer = pt_buff;
for (i=0; i<pt_count;i++ , pointer++){
if ( pointer->transaction != trans_nr) continue;
if ( pointer->f_blocknr == block_nr ) journal_nr = pointer->j_blocknr ;
}
return journal_nr;
}
// get the last dir-block for transaction from journal or if not, found the real block
//FIXME: blk64_t ????
int get_last_block(char *buf, blk64_t *block, __u32 t_start, __u32 t_end){
int retval = 0;
int i , count ;
unsigned int got;
char *journal_tag_buf = NULL;
journal_descriptor_tag_t *block_list;
blk_t j_block = 0;
int blksize = current_fs->blocksize;
if ((!t_start) && (!t_end)){
//there is no transaction, it is not from a journal Inode
#ifdef DEBUG
printf("DIR_BLOCK (F) %lld\n", (blk64_t)*block);
#endif
return io_channel_read_blk(current_fs->io, *block, 1, buf);
}
count = get_block_list_count((blk64_t)*block) ;
journal_tag_buf = (void *)malloc((sizeof(journal_descriptor_tag_t) * count));
if (!journal_tag_buf) {
// fprintf(stderr,"Error: while allocate Memory for blocklist\n");
retval = BLOCK_ABORT;
goto errout;
}
block_list = (journal_descriptor_tag_t *) journal_tag_buf;
count = get_block_list(block_list, *block, count);
for (i = 0 ; i < count ; i++ , block_list++ ) {
if (block_list->transaction < t_start )
continue;
if (block_list->transaction <= t_end){
j_block = block_list->j_blocknr;
if (i != (count -1))
continue;
}
retval = read_journal_block((j_block) ? (j_block * blksize) : (block_list->j_blocknr * blksize),
buf , current_fs->blocksize , &got);
#ifdef DEBUG
printf("DIR_BLOCK (J) %lld (%ld <-> %ld) JB=%ld : %d\n", (blk64_t)*block,t_start,t_end, j_block, retval );
#endif
if (retval) {
retval = BLOCK_ERROR ;
}
goto errout;
}
// if not in journal found, use real block
#ifdef DEBUG
printf("DIR_BLOCK (N) %lld\n", (blk64_t)*block);
#endif
retval = io_channel_read_blk(current_fs->io, *block, 1, buf);
errout:
if (journal_tag_buf) free(journal_tag_buf);
return retval;
}
//get count of journal blocklist
int get_block_list_count(blk64_t block){
int counter = 0;
int i;
journal_descriptor_tag_t *list_pointer = pt_buff ;
for (i=0;i<pt_count;i++,list_pointer++)
if (list_pointer->f_blocknr == block) counter++ ;
return counter;
}
//local sortfunction for journalblocks
static int sort_block_list(journal_descriptor_tag_t *pointer, int counter ){
journal_descriptor_tag_t p1;
int c1,c2,flag=1;
c1 = 0;
//FIXME : for faster sort
while (flag) {
flag = 0;
for (c2 = 0;c2 < (counter -c1 -1);c2++){
if ((pointer+c2)->transaction > (pointer+c2+1)->transaction ){
p1=*(pointer+c2);
*(pointer+c2)=*(pointer+c2+1);
*(pointer+c2+1)=p1;
flag = 1 ;
}
}
c1++ ;
}
return counter;
}
//get a sorted list of all copys of a filesystemblock
int get_block_list(journal_descriptor_tag_t *pointer, blk64_t block , int counter ){
int i,j = 0;
journal_descriptor_tag_t *list_pointer = pt_buff ;
journal_descriptor_tag_t *fill_pointer = pointer ;
if (counter) {
for (i=0,j=0;(i<pt_count && j<counter);i++,list_pointer++)
if (list_pointer->f_blocknr == block) {
fill_pointer->f_blocknr = block;
fill_pointer->j_blocknr = list_pointer->j_blocknr;
fill_pointer->transaction = list_pointer->transaction;
fill_pointer++ ;
j++;
}
sort_block_list(pointer,counter);
}
return j;
}
//extract the journal in the local intern blocklist
static void extract_descriptor_block(char *buf, journal_superblock_t *jsb,
unsigned int *blockp, int blocksize,
tid_t transaction, unsigned int *wrapflag )
{
int offset, tag_size = JBD_TAG_SIZE32;
char *tagp;
journal_block_tag_t *tag;
unsigned int blocknr;
__u32 tag_block;
__u32 tag_flags;
if (jsb->s_feature_incompat & JFS_FEATURE_INCOMPAT_64BIT)
tag_size = JBD_TAG_SIZE64;
offset = sizeof(journal_header_t);
blocknr = *blockp;
#ifdef DEBUG
fprintf(stdout, "D-Block %u & %u: ", transaction, blocknr);
#endif
++blocknr;
if (blocknr >= jsb->s_maxlen) {
if (*wrapflag == WRAP_ON) {
blocknr -= (jsb->s_maxlen - jsb->s_first);
*wrapflag = WRAP_READY;
}
else {
*blockp = blocknr;
return;
}
}
do {
/* Work out the location of the current tag, and skip to
* the next one... */
tagp = &buf[offset];
tag = (journal_block_tag_t *) tagp;
offset += tag_size;
/* ... and if we have gone too far, then we've reached the
end of this block. */
if (offset > blocksize) break;
tag_block = ext2fs_be32_to_cpu(tag->t_blocknr) ;
tag_flags = ext2fs_be32_to_cpu(tag->t_flags);
if (!(tag_flags & JFS_FLAG_SAME_UUID))
offset += 16;
#ifdef DEBUG
// fprintf(stderr, " FS block %12lu logged at ", tag_block);
// fprintf(stderr, "sequence %u, ", transaction);
// fprintf(stderr, "journal block %u (flags 0x%x)\n", blocknr,tag_flags);
fprintf(stdout,"*");
#endif
pt->f_blocknr = tag_block ;
if (tag_size > JBD_TAG_SIZE32) pt->f_blocknr |= (__u64)ext2fs_be32_to_cpu(tag->t_blocknr_high) << 32;
pt->j_blocknr = blocknr;
pt->transaction = transaction;
pt++;
pt_count++;
++blocknr;
if (blocknr >= jsb->s_maxlen) {
if (*wrapflag == WRAP_ON) {
blocknr -= (jsb->s_maxlen - jsb->s_first);
*wrapflag = WRAP_READY;
}
else {
*blockp = blocknr;
return;
}
}
} while (!(tag_flags & JFS_FLAG_LAST_TAG));
*blockp = (*wrapflag == WRAP_READY) ? jsb->s_maxlen : blocknr ;
}
// init and extract the journal in the local private data
int init_journal(void)
{
struct ext2_super_block *sb;
char buf[8192];
journal_superblock_t *jsb;
unsigned int blocksize = 1024;
unsigned int got;
int retval;
__u32 magic, sequence, blocktype;
journal_header_t *header;
tid_t transaction;
unsigned int blocknr = 0;
unsigned int maxlen = 0;
unsigned int wrapflag;
/* First, check to see if there's an ext2 superblock header */
retval = read_journal_block( 0, buf, 2048, &got);
if (retval) goto errout;
jsb = (journal_superblock_t *) buf;
sb = (struct ext2_super_block *) (buf+1024);
#ifdef WORDS_BIGENDIAN
if (sb->s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC)) ext2fs_swap_super(sb);
#endif
if ((ext2fs_be32_to_cpu(jsb->s_header.h_magic) != JFS_MAGIC_NUMBER) &&
(sb->s_magic == EXT2_SUPER_MAGIC) &&
(sb->s_feature_incompat & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)) {
blocksize = EXT2_BLOCK_SIZE(sb);
blocknr = (blocksize == 1024) ? 2 : 1;
uuid_unparse(sb->s_uuid, jsb_buffer);
#ifdef DEBUG
fprintf(stdout, "Ext2 superblock header found.");
fprintf(stdout, "\tuuid=%s", jsb_buffer);
fprintf(stdout, "\tblocksize=%d", blocksize);
fprintf(stdout, "\tjournal data size %lu\n",(unsigned long) sb->s_blocks_count);
#endif
}
/* Next, read the journal superblock */
retval = read_journal_block(blocknr*blocksize,jsb_buffer, 1024, &got);
if (retval) goto errout;
jsb = (journal_superblock_t *) jsb_buffer;
if (ext2fs_be32_to_cpu(jsb->s_header.h_magic) != JFS_MAGIC_NUMBER) {
fprintf(stderr, "Journal superblock magic number invalid!\n");
return JOURNAL_ERROR ;
}
journal_superblock_to_cpu((__u32*)jsb_buffer);
blocksize = jsb->s_blocksize;
transaction = jsb->s_sequence;
maxlen = jsb->s_maxlen;
blocknr = jsb->s_first;
wrapflag = WRAP_UNDEF ;
pt_buff = malloc(maxlen * sizeof(journal_descriptor_tag_t));
pt = pt_buff ;
pt_count = 0;
if (pt_buff == NULL) {
fprintf(stderr,"Error: can't allocate %u Memory\n",maxlen * sizeof(journal_descriptor_tag_t));
goto errout;
}
ptl = (__u32*)(pt_buff + (maxlen * sizeof(journal_descriptor_tag_t)));
ptl_count = 0;
#ifdef DEBUG
fprintf(stdout, "Journal starts at block %u, transaction %u\n", blocknr, transaction);
#endif
while ( blocknr < maxlen ){
retval = read_journal_block(blocknr*blocksize, buf, blocksize, &got);
if (retval || got != blocksize)
//return JOURNAL_OPEN;
goto errout;
header = (journal_header_t *) buf;
magic = ext2fs_be32_to_cpu(header->h_magic);
sequence = ext2fs_be32_to_cpu(header->h_sequence);
blocktype = ext2fs_be32_to_cpu(header->h_blocktype);
if (magic != JFS_MAGIC_NUMBER) {
#ifdef DEBUG
// fprintf (stdout, "No magic number at block %u: skip this block\n", blocknr);
fprintf(stdout,"-");
#endif
if (jb_is_inodetable(buf)){
// printf("lost %d\n", blocknr);
ptl--;
*ptl = blocknr;
ptl_count ++;
}
if ( ! wrapflag ) wrapflag = WRAP_ON ;
blocknr++ ;
continue;
}
#ifdef DEBUG
fprintf (stdout, "\n%u (%s) T=%u JB=%u\n", blocktype, type_to_name(blocktype), sequence, blocknr);
#endif
if ( ! wrapflag ) wrapflag = WRAP_OFF ;
switch (blocktype) {
case JFS_DESCRIPTOR_BLOCK:
extract_descriptor_block(buf, jsb, &blocknr, blocksize, sequence, &wrapflag);
continue;
case JFS_COMMIT_BLOCK:
blocknr++;
continue;
case JFS_REVOKE_BLOCK:
blocknr++;
continue;
default:
fprintf (stderr, "Unexpected block type %u at block %u.\n", blocktype, blocknr);
return JOURNAL_OPEN;
}
}
#ifdef DEBUG
fprintf(stdout,"\nJournal init complete: %ld block copy\n",pt_count);
#endif
return JOURNAL_OPEN ;
errout:
fprintf(stderr,"Error: can't read journal\n");
if ( pt_buff ) {
free(pt_buff);
pt_buff = NULL;
}
return JOURNAL_ERROR ;
}
//get a list of all copy of blockbitmap from journal
int get_block_bitmap_list( journal_bitmap_tag_t **bitmap_list){
int count, sum, i, j;
char* tag_buf = NULL;
journal_bitmap_tag_t *fill_pointer ;
journal_descriptor_tag_t *list_pointer = pt_buff ;
count = sum = 0;
for (i = 0; i < pt_count ; i++, list_pointer++ )
for (j = 0 ; j < current_fs->group_desc_count; j++ )
#ifdef EXT2_FLAG_64BITS
if( list_pointer->f_blocknr == (blk64_t) ext2fs_block_bitmap_loc(current_fs, j))
#else
if (list_pointer->f_blocknr == (blk64_t) current_fs->group_desc[j].bg_block_bitmap)
#endif
count++ ;
if (count && (tag_buf = malloc((sizeof(journal_bitmap_tag_t) * count)))){
fill_pointer = (journal_bitmap_tag_t*)tag_buf ;
list_pointer = pt_buff ;
for ( i = 0 ; (i < pt_count && sum < count); i++ , list_pointer++ )
for ( j = 0; j < current_fs->group_desc_count; j++ )
#ifdef EXT2_FLAG_64BITS
if( list_pointer->f_blocknr == (blk64_t) ext2fs_block_bitmap_loc(current_fs, j)){
#else
if (list_pointer->f_blocknr == (blk64_t) current_fs->group_desc[j].bg_block_bitmap){
#endif
fill_pointer->blockgroup = (blk64_t) j;
fill_pointer->j_blocknr = list_pointer->j_blocknr;
fill_pointer->transaction = list_pointer->transaction;
fill_pointer++ ;
sum++;
}
list_pointer = (journal_descriptor_tag_t*) tag_buf;
sort_block_list( list_pointer,sum );
*bitmap_list = (journal_bitmap_tag_t*) tag_buf;
}
return sum;
}
//create and init the journal block bitmap
//return the count of all blockbitmap copies or 0
int init_block_bitmap_list(ext2fs_block_bitmap *d_bmap, __u32 t_after){
__u32 t;
jbbm.list = NULL;
jbbm.block_buf = NULL;
if (ext2fs_copy_bitmap(current_fs->block_map, d_bmap)){
fprintf(stderr,"Error: while duplicate bitmap\n");
return 0;
}
ext2fs_clear_block_bitmap(*d_bmap);
jbbm.count = get_block_bitmap_list( &jbbm.list);
jbbm.block_buf = malloc(current_fs->blocksize * 2);
if (! jbbm.block_buf){
fprintf(stderr,"Error: can't allocate Memory\n");
return 0;
}
if (jbbm.count){
jbbm.pointer = jbbm.list + jbbm.count - 1;
// jbbm.last_trans = jbbm.pointer->transaction;
jbbm.last_trans = 0;
jbbm.groups = current_fs->group_desc_count;
while ((jbbm.pointer > jbbm.list) && (get_trans_time(jbbm.pointer->transaction) >= t_after)) {
t = jbbm.pointer->transaction;
while (jbbm.pointer->transaction == t)
jbbm.pointer-- ;
}
jbbm.pointer++;
jbbm.first_trans = jbbm.pointer->transaction ;
jbbm.pointer = jbbm.list + jbbm.count - 1;
jbbm.blocksize = current_fs->blocksize;
jbbm.blocklen = current_fs->super->s_blocks_per_group >> 3 ;
jbbm.last_blocklen = (current_fs->super->s_blocks_count >> 3) % jbbm.blocklen;
if (!jbbm.last_blocklen)
jbbm.last_blocklen = jbbm.blocklen;
else
jbbm.last_blocklen += (current_fs->super->s_blocks_count % 8) ? 1 : 0 ;
}
return jbbm.count;
}
//destroy the journal block bitmap
void clear_block_bitmap_list(ext2fs_block_bitmap d_bmap){
if (jbbm.list)
free (jbbm.list);
if (jbbm.block_buf)
free (jbbm.block_buf);
jbbm.list = NULL;
jbbm.block_buf = NULL;
ext2fs_free_block_bitmap(d_bmap);
}
//produces a differential block bitmap for a transaction from the Journal
//return 1 if bitmap is differenzial ; an 2 if bitmap is empty
int next_block_bitmap(ext2fs_block_bitmap d_bmap){
struct ext2fs_struct_loc_generic_bitmap *fs_bitmap, *df_bitmap;
journal_bitmap_tag_t *p1;
journal_bitmap_tag_t *p2;
__u32 blockg, skip,i,len;
unsigned int got;
int retval;
char *diff_buf;
if ((jbbm.pointer->transaction < jbbm.first_trans)||(jbbm.pointer < jbbm.list))
return 0;
fs_bitmap = (struct ext2fs_struct_loc_generic_bitmap*) current_fs->block_map;
df_bitmap = (struct ext2fs_struct_loc_generic_bitmap*) d_bmap;
ext2fs_clear_block_bitmap(d_bmap);
if (jbbm.last_trans == 0 ){
// last transaction compared with fs blockbitmap
jbbm.last_trans = jbbm.pointer->transaction;
p2 = jbbm.pointer;
while ((p2 >= jbbm.list) && (p2->transaction == jbbm.pointer->transaction)){
blockg = (__u32)p2->blockgroup;
skip = (jbbm.blocklen * blockg);
len = ((blockg + 1) == jbbm.groups) ? jbbm.last_blocklen : jbbm.blocklen;
retval = read_journal_block((__u32)p2->j_blocknr * jbbm.blocksize, jbbm.block_buf, jbbm.blocksize, &got);
if (retval || got != jbbm.blocksize){
fprintf(stderr,"Error: while reading journal\n");
goto errout;
}
for (i = 0 ; i < len ; i++){
*((df_bitmap->bitmap)+skip+i) = *(jbbm.block_buf + i) ^ *((fs_bitmap->bitmap)+skip+i) ;
}
p2--;
}
}
else{
//all other transactions compared with previous block copy
p1 = jbbm.pointer;
diff_buf = jbbm.block_buf + jbbm.blocksize ;
while ((p1->transaction >= jbbm.first_trans) && (p1->transaction == jbbm.pointer->transaction) && (p1 >= jbbm.list)){
p2 = p1 -1;
blockg = (__u32)p1->blockgroup;
skip = (jbbm.blocklen * blockg);
len = ((blockg + 1) == jbbm.groups) ? jbbm.last_blocklen : jbbm.blocklen;
while ((p2 > jbbm.list) && ((__u32)p2->blockgroup != blockg))
p2-- ;
retval = read_journal_block((__u32)p1->j_blocknr * jbbm.blocksize, jbbm.block_buf, jbbm.blocksize, &got);
if (retval || got != jbbm.blocksize){
fprintf(stderr,"Error: while reading journal\n");
goto errout;
}
if ((p2 < jbbm.list) || ((p2 == jbbm.list) && ((__u32)p2->blockgroup != blockg))){
//no previous block copy found, create difference to the entire block group
for (i = 0 ; i < len ; i++){
*((df_bitmap->bitmap)+skip+i) = *(jbbm.block_buf + i) ^ 0xFF ;
}
}
else{
retval = read_journal_block((__u32)p2->j_blocknr * jbbm.blocksize, diff_buf, jbbm.blocksize, &got);
if (retval || got != jbbm.blocksize){
fprintf(stderr,"Error: while reading journal\n");
goto errout;
}
//previous block copy is found, create difference to this copy
for (i = 0 ; i < len ; i++){
*((df_bitmap->bitmap)+skip+i) = *(jbbm.block_buf + i) ^ *(diff_buf + i ) ;
}
}
p1--;
}
jbbm.pointer = p1;
}
i = 0;
len = (fs_bitmap->end +1) >> 3;
while ((i < len) && (!(*(df_bitmap->bitmap +i))))
i++;
return ( i == len) ? 2 : 1 ;
errout:
return 0;
}
//read the next journal-lost inode block
int get_pool_block(char *buf){
int retval = 0;
int ret = 0;
unsigned int got ;
int blocksize = current_fs->blocksize;
if (ptl_count){
retval = read_journal_block(*ptl * blocksize ,(char*)buf,blocksize,&got);
if ((! retval) && (got == blocksize)){
ret = 1;
}
ptl_count--;
ptl++;
}
return ret;
}
|
orochi/ext4magic
|
src/journal.c
|
C++
|
mit
| 34,479 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef JOURNAL_H
#define JOURNAL_H
//struct for cache the descriptor data
typedef struct journal_descriptor_tag_s
{
blk64_t f_blocknr; /* The on-disk block number */
__u32 j_blocknr; /* The on-journal block number */
__u32 transaction; /* Transaction Sequence*/
} journal_descriptor_tag_t;
//struct for cache the block bitmap data
typedef struct journal_bitmap_tag_s
{
blk64_t blockgroup; /* The blockgroup of bitmap */
__u32 j_blocknr; /* The on-journal block number */
__u32 transaction; /* Transaction Sequence*/
} journal_bitmap_tag_t;
//head struct for collect the Block Bitmaps of Journal
struct j_bitmap_list_t
{
int count;
journal_bitmap_tag_t *list;
__u32 groups;
__u32 first_trans;
__u32 last_trans;
journal_bitmap_tag_t *pointer;
unsigned int blocksize ;
unsigned int blocklen ;
unsigned int last_blocklen ;
char* block_buf;
};
void dump_journal_superblock( void); //print journal superblock
extern int journal_open(char* , int );// open an extract the blocklist from journal
extern int journal_close(void); // close the journal (last function in main() if the journal open)
int init_journal(void); // main for extract the journal to the local private data
const char *type_to_name(int);
int get_block_list_count(blk64_t);//get count of journal blocklist
__u32 get_trans_time( __u32); //get the transactiontime of a transactionnumber
int get_block_list(journal_descriptor_tag_t*, blk64_t, int);//get a sortet list of all copys of a filesystemblock
int read_journal_block(off_t, char*, int, unsigned int*);
void print_block_list(int);
int dump_journal_block( __u32 , int );
void print_block_transaction(blk64_t,int);//print all transactions for a fs-block
__u32 get_journal_blocknr(blk64_t, __u32);// get the last dir-block for transaction from journal or if not found the real block
int get_last_block(char*, blk64_t*, __u32, __u32);// get the last dir-block for transaction from journal or if not, found the real block
int get_block_bitmap_list( journal_bitmap_tag_t**);//get a list of all copies of blockbitmap from journal
int init_block_bitmap_list(ext2fs_block_bitmap* , __u32); //create and init the the journal block bitmap
void clear_block_bitmap_list(ext2fs_block_bitmap); //destroy the journal block bitmap
int next_block_bitmap(ext2fs_block_bitmap); //produces a differential block bitmap for a transaction from the Journal
int get_pool_block(char*);
#endif
|
orochi/ext4magic
|
src/journal.h
|
C++
|
mit
| 3,751 |
/*
* linux/include/linux/jbd.h
*
* Written by Stephen C. Tweedie <sct@redhat.com>
*
* 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 <linux/journal-head.h>
#include <linux/stddef.h>
#include <asm/semaphore.h>
#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;
/*
* Checksum types.
*/
#define JBD2_CRC32_CHKSUM 1
#define JBD2_MD5_CHKSUM 2
#define JBD2_SHA1_CHKSUM 3
#define JBD2_CRC32_CHKSUM_SIZE 4
#define JBD2_CHECKSUM_BYTES (32 / sizeof(__u32))
/*
* Commit block header for storing transactional checksums:
*/
struct commit_header {
__u32 h_magic;
__u32 h_blocktype;
__u32 h_sequence;
unsigned char h_chksum_type;
unsigned char h_chksum_size;
unsigned char h_padding[2];
__u32 h_chksum[JBD2_CHECKSUM_BYTES];
__u64 h_commit_sec;
__u32 h_commit_nsec;
};
/*
* 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 */
__u32 t_blocknr_high; /* most-significant high 32bits. */
} journal_block_tag_t;
#define JBD_TAG_SIZE64 (sizeof(journal_block_tag_t))
#define JBD_TAG_SIZE32 (8)
/*
* 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;
int 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_COMPAT_CHECKSUM 0x00000001
#define JFS_FEATURE_INCOMPAT_REVOKE 0x00000001
#define JFS_FEATURE_INCOMPAT_REVOKE 0x00000001
#define JFS_FEATURE_INCOMPAT_64BIT 0x00000002
#define JFS_FEATURE_INCOMPAT_ASYNC_COMMIT 0x00000004
/* 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|\
JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)
#ifdef __KERNEL__
#include <linux/fs.h>
#include <linux/sched.h>
#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;
/* Failed journal commit ID */
unsigned int j_failed_commit;
};
/*
* 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 */
|
orochi/ext4magic
|
src/kernel-jbd.h
|
C++
|
mit
| 29,263 |
#ifndef _LINUX_LIST_H
#define _LINUX_LIST_H
/*
* Simple doubly linked list implementation.
*
* Some of the internal functions ("__xxx") are useful when
* manipulating whole lists rather than single entries, as
* sometimes we already know the next/prev entries and we can
* generate better code by using them directly rather than
* using the generic single-entry routines.
*/
struct list_head {
struct list_head *next, *prev;
};
#define LIST_HEAD_INIT(name) { &(name), &(name) }
#define LIST_HEAD(name) \
struct list_head name = { &name, &name }
#define INIT_LIST_HEAD(ptr) do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
#if (!defined(__GNUC__) && !defined(__WATCOMC__))
#define __inline__
#endif
/*
* Insert a new entry between two known consecutive entries.
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
static __inline__ void __list_add(struct list_head * new,
struct list_head * prev,
struct list_head * next)
{
next->prev = new;
new->next = next;
new->prev = prev;
prev->next = new;
}
/*
* Insert a new entry after the specified head..
*/
static __inline__ void list_add(struct list_head *new, struct list_head *head)
{
__list_add(new, head, head->next);
}
/*
* Insert a new entry at the tail
*/
static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
{
__list_add(new, head->prev, head);
}
/*
* Delete a list entry by making the prev/next entries
* point to each other.
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
*/
static __inline__ void __list_del(struct list_head * prev,
struct list_head * next)
{
next->prev = prev;
prev->next = next;
}
static __inline__ void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
}
static __inline__ int list_empty(struct list_head *head)
{
return head->next == head;
}
/*
* Splice in "list" into "head"
*/
static __inline__ void list_splice(struct list_head *list, struct list_head *head)
{
struct list_head *first = list->next;
if (first != list) {
struct list_head *last = list->prev;
struct list_head *at = head->next;
first->prev = head;
head->next = first;
last->next = at;
at->prev = last;
}
}
#define list_entry(ptr, type, member) \
((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
#define list_for_each(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
#endif
|
orochi/ext4magic
|
src/kernel-list.h
|
C++
|
mit
| 2,505 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
//header util.h
#include <stdio.h>
#include <string.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <ext2fs/ext2fs.h>
//#include <ext2fs/ext2_io.h>
#include "ext2fsP.h"
#include <ctype.h>
#include <time.h>
#include "dir_list.h"
#include "util.h"
#include "inode.h"
#include "block.h"
#define DIRENT_MIN_LENGTH 12
extern ext2_filsys current_fs ;
static const char *monstr[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
// local sub function for printing the dir entry
static int list_dir_proc(ext2_ino_t dir EXT2FS_ATTR((unused)),
int entry,
struct ext2_dir_entry *dirent,
int offset EXT2FS_ATTR((unused)),
int blocksize EXT2FS_ATTR((unused)),
char *buf EXT2FS_ATTR((unused)),
void *private)
{
struct ext2_inode inode;
ext2_ino_t ino;
struct tm *tm_p;
time_t modtime;
char name[EXT2_NAME_LEN + 1];
char tmp[EXT2_NAME_LEN + 16];
char datestr[80];
char lbr, rbr;
int thislen,retval = 0;
int col = 0;
struct priv_dir_iterate_struct *ls = (struct priv_dir_iterate_struct *) private;
thislen = ((dirent->name_len & 0xFF) < EXT2_NAME_LEN) ?
(dirent->name_len & 0xFF) : EXT2_NAME_LEN;
strncpy(name, dirent->name, thislen);
name[thislen] = '\0';
ino = dirent->inode;
//FIXME:
// if ((entry == DIRENT_DELETED_FILE) || (ls->options & DELETED_DIR)) {
if (entry == DIRENT_DELETED_FILE) {
lbr = '<';
rbr = '>';
} else {
lbr = rbr = ' ';
}
if (ls->options & PARSE_OPT) {
if (ino && intern_read_inode(ino, &inode)) return 0;
fprintf(stdout,"/%u/%06o/%d/%d/%s/",ino,inode.i_mode,inode.i_uid, inode.i_gid,name);
if (LINUX_S_ISDIR(inode.i_mode))
fprintf(stdout, "/");
else
fprintf(stdout, "%12lld/", inode.i_size | ((__u64)inode.i_size_high << 32));
fprintf(stdout, "\n");
}
else if (ls->options & LONG_OPT) {
if ((ino && (ino <= current_fs->super->s_inodes_count))) {
if (ls->options & ONLY_JOURNAL)
// retval = read_journal_inode( ino, &inode, ls->transaction->start);
retval = read_time_match_inode( ino, &inode, ls->time_stamp);
if (retval || !(ls->options & ONLY_JOURNAL))
if (intern_read_inode(ino, &inode))
return 0;
modtime = inode.i_mtime;
tm_p = localtime(&modtime);
sprintf(datestr, "%2d-%s-%4d %02d:%02d",
tm_p->tm_mday, monstr[tm_p->tm_mon],
1900 + tm_p->tm_year, tm_p->tm_hour,
tm_p->tm_min);
} else {
strcpy(datestr, " ");
memset(&inode, 0, sizeof(struct ext2_inode));
}
fprintf(stdout, "%c%8u%c %c %4o (%d) %5d %5d ", lbr, ino, rbr, get_inode_mode_type(inode.i_mode),inode.i_mode & 07777 , dirent->name_len >> 8, inode_uid(inode), inode_gid(inode));
if (LINUX_S_ISDIR(inode.i_mode))
fprintf(stdout, "%12d", inode.i_size);
else
fprintf(stdout, "%12llu", inode.i_size |
((unsigned long long) inode.i_size_high << 32));
fprintf (stdout, " %s %s\n", datestr, name);
} else {
sprintf(tmp, "%c%u%c (%d) %s ", lbr, dirent->inode, rbr,
dirent->rec_len, name);
thislen = strlen(tmp);
if (col + thislen > 80) {
fprintf(stdout, "\n");
col = 0;
}
fprintf(stdout, "%s", tmp);
col += thislen;
}
return 0;
}
// list dir by using real fs inode and real fs dir blocks an real dir-entry-inodes
void list_dir(ext2_ino_t inode)
{
int retval;
int flags;
struct priv_dir_iterate_struct ls;
ls.options = 0;
if (!inode) return;
ls.options |= LONG_OPT;
ls.options |= DELETED_OPT;
flags = DIRENT_FLAG_INCLUDE_EMPTY;
if (ls.options & DELETED_OPT) flags |= DIRENT_FLAG_INCLUDE_REMOVED;
retval = ext2fs_dir_iterate2(current_fs, inode, flags,0, list_dir_proc, &ls);
fprintf(stdout, "\n");
if (retval)
fprintf(stderr,"Error: %d directory data error\n", retval);
return;
}
//---------------------------------------------------------------
/*
* This function checks to see whether or not a potential deleted
* directory entry looks valid. What we do is check the deleted entry
* and each successive entry to make sure that they all look valid and
* that the last deleted entry ends at the beginning of the next
* undeleted entry. Returns 1 if the deleted entry looks valid, zero
* if not valid.
*
* copy of a not public function from e2fsprogs ext2fs_validate_entry()
* use only from local_process_dir_block()
*/
static int local_validate_entry(ext2_filsys fs, char *buf,
unsigned int offset,
unsigned int final_offset)
{
struct ext2_dir_entry *dirent;
unsigned int rec_len = 0;
while ((offset < final_offset) &&
(offset <= fs->blocksize - DIRENT_MIN_LENGTH)) {
dirent = (struct ext2_dir_entry *)(buf + offset);
if (ext2fs_get_rec_len(fs, dirent, &rec_len))
return 0;
offset += rec_len;
if ((rec_len < 8) ||
((rec_len % 4) != 0) ||
((((unsigned) dirent->name_len & 0xFF)+8) > rec_len))
return 0;
}
return (offset == final_offset);
}
#ifdef WORDS_BIGENDIAN
//---------------------------------------------------------------
/*
* This function checks to see whether or not a potential deleted
* directory entry looks valid. Returns 1 if the deleted entry looks valid,
* zero if not valid.
*
* only from convert_dir_block() on bigendian
*/
static int local_validate_entry2(char *p , char *end, unsigned int offset, unsigned int final_offset)
{
struct ext2_dir_entry_2 *dirent;
__u16 rec_len = 0;
while ((offset < final_offset) &&
(offset <= (unsigned int) (end - p - DIRENT_MIN_LENGTH))) {
dirent = (struct ext2_dir_entry_2 *)(p + offset);
rec_len = ext2fs_swab16(dirent->rec_len);
if ((rec_len == 0 ) || (rec_len == 65535 ))
rec_len = current_fs->blocksize ;
offset += rec_len;
if ((rec_len < 8) || ((rec_len % 4) != 0) || (((unsigned) dirent->name_len +8) > rec_len))
return 0;
}
return (offset == final_offset);
}
// convert dir_block for bigendian inclusive deleted entry
static int convert_dir_block(char *buf, int flags){
errcode_t retval;
char *p, *end;
char real_len;
struct ext2_dir_entry *dirent;
unsigned int name_len, rec_len;
p = (char *) buf;
end = (char *) buf + current_fs->blocksize;
while (p < end-8) {
dirent = (struct ext2_dir_entry *) p;
dirent->inode = ext2fs_swab32(dirent->inode);
dirent->rec_len = ext2fs_swab16(dirent->rec_len);
dirent->name_len = ext2fs_swab16(dirent->name_len);
name_len = dirent->name_len;
if (flags & EXT2_DIRBLOCK_V2_STRUCT)
dirent->name_len = ext2fs_swab16(dirent->name_len);
if ((retval = ext2fs_get_rec_len(current_fs, dirent, &rec_len)) != 0)
return retval;
if ((rec_len < 8) || (rec_len % 4)) {
rec_len = 8;
retval = EXT2_ET_DIR_CORRUPTED;
} else if (((name_len & 0xFF) + 8) > rec_len)
retval = EXT2_ET_DIR_CORRUPTED;
real_len = ((name_len & 0xFF) + 11) & ~3;
if ((rec_len > real_len) && ((real_len + DIRENT_MIN_LENGTH) <= rec_len)){
// p += ((name_len & 0xFF) + 11) & ~3;
//FIXME
unsigned int offset = real_len;
while (offset < rec_len && !local_validate_entry2(p , end , offset, rec_len))
offset += 4;
p += offset;
}
else
p += rec_len;
}
return retval;
}
#endif
/*
* Helper function which is private to this module. Used by
* local_dir_iterate3() (modi of ext2fs_process_dir_block
*/
static int local_process_dir_block(ext2_filsys fs,
blk64_t *blocknr,
e2_blkcnt_t blockcnt,
blk64_t ref_block EXT2FS_ATTR((unused)),
int ref_offset EXT2FS_ATTR((unused)),
void *priv_data)
{
struct dir_context *ctx = (struct dir_context *) priv_data;
unsigned int offset = 0;
unsigned int next_real_entry = 0;
int ret = 0;
int changed = 0;
int do_abort = 0;
unsigned int rec_len, size;
int entry, i;
struct ext2_dir_entry *dirent;
trans_range_t *transaction = NULL;
if (blockcnt < 0)
return 0;
entry = blockcnt ? DIRENT_OTHER_FILE : DIRENT_DOT_FILE;
transaction = (trans_range_t*) ((struct priv_dir_iterate_struct*)ctx->priv_data)->transaction;
if (get_last_block(ctx->buf, blocknr, transaction->start, transaction->end)){
if (ctx->flags & ONLY_JOURNAL ) return BLOCK_ABORT;
//FIXME: if not found dir-block in journal, read from real filesystem and hope is ok ??????
ctx->errcode = io_channel_read_blk(fs->io, *blocknr, 1, ctx->buf);
}
#ifdef WORDS_BIGENDIAN
if(!ctx->errcode)
ctx->errcode = convert_dir_block(ctx->buf,0);
#endif
if (ctx->errcode)
return BLOCK_ABORT;
if (bmap)
ext2fs_mark_generic_bitmap(bmap, *blocknr);
i=0;
while ((!(ctx->buf[i++])) && (i<8)) ;
if (i==8)
return 0; //Interior nodes of an htree which the full length of a data block
while (offset < fs->blocksize) {
dirent = (struct ext2_dir_entry *) (ctx->buf + offset);
if (ext2fs_get_rec_len(fs, dirent, &rec_len))
return BLOCK_ABORT;
if (((offset + rec_len) > fs->blocksize) ||
(rec_len < 8) ||
((rec_len % 4) != 0) ||
((((unsigned) dirent->name_len & 0xFF)+8) > rec_len)) {
ctx->errcode = EXT2_ET_DIR_CORRUPTED;
return BLOCK_ABORT;
}
if (!dirent->inode &&
!(ctx->flags & DIRENT_FLAG_INCLUDE_EMPTY))
goto next;
ret = (ctx->func)(ctx->dir,
(next_real_entry > offset) ?
DIRENT_DELETED_FILE : entry,
dirent, offset,
fs->blocksize, ctx->buf,
ctx->priv_data);
if (entry < DIRENT_OTHER_FILE)
entry++;
if (ret & DIRENT_CHANGED) {
if (ext2fs_get_rec_len(fs, dirent, &rec_len))
return BLOCK_ABORT;
changed++;
}
if (ret & DIRENT_ABORT) {
do_abort++;
break;
}
next:
if (next_real_entry == offset)
next_real_entry += rec_len;
if (ctx->flags & DIRENT_FLAG_INCLUDE_REMOVED) {
size = ((dirent->name_len & 0xFF) + 11) & ~3;
if (ctx->flags & SKIP_HTREE){
if ((! *(__u32*)(ctx->buf + (offset+size))) &&
(*(ctx->buf + (offset+size+5)) == 0x08) && ( !(*(ctx->buf + (offset+size+7))))){
ctx->flags &= ~SKIP_HTREE;
break;
}
}
if (rec_len != size) {
unsigned int final_offset = 0;
final_offset = offset + rec_len;
offset += size;
while (offset < final_offset &&
!local_validate_entry(fs, ctx->buf,
offset,
final_offset))
offset += 4;
continue;
}
}
offset += rec_len;
}
if (changed) {
ctx->errcode = ext2fs_write_dir_block(fs, *blocknr, ctx->buf);
if (ctx->errcode)
return BLOCK_ABORT;
}
if (do_abort)
return BLOCK_ABORT;
return 0;
}
//------------------------------------------------------
// Sub function for search the path, use from get_dir3()
static int find_dir_proc(ext2_ino_t dir EXT2FS_ATTR((unused)),
int entry,
struct ext2_dir_entry *dirent,
int offset EXT2FS_ATTR((unused)),
int blocksize EXT2FS_ATTR((unused)),
char *buf EXT2FS_ATTR((unused)),
void *private)
{
ext2_ino_t ino;
char name[EXT2_NAME_LEN + 1];
int thislen;
struct priv_dir_iterate_struct *fl = (struct priv_dir_iterate_struct *) private;
thislen = ((dirent->name_len & 0xFF) < EXT2_NAME_LEN) ?
(dirent->name_len & 0xFF) : EXT2_NAME_LEN;
if (thislen){
strncpy(name, dirent->name, thislen);
name[thislen] = '\0';
ino = dirent->inode;
if ((ino) && (ino <= current_fs->super->s_inodes_count))
add_list_item(fl->dir_list,ino,name,(char) entry);
}
return 0;
}
//-------------------------------------------------------
// local directory iterate for use inode
static errcode_t local_dir_iterate3(ext2_filsys fs,
ext2_ino_t dir,
struct ext2_inode *inode,
int flags,
char *block_buf,
int (*func)(ext2_ino_t dir,
int entry,
struct ext2_dir_entry *dirent,
int offset,
int blocksize,
char *buf,
void *priv_data),
void *priv_data)
{
struct dir_context ctx;
errcode_t retval;
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
ctx.dir = dir;
ctx.flags = flags;
if (block_buf)
ctx.buf = block_buf;
else {
retval = ext2fs_get_mem(fs->blocksize, &ctx.buf);
if (retval)
return retval;
}
ctx.func = func;
ctx.priv_data = priv_data;
ctx.errcode = 0;
retval = local_block_iterate3(fs, *inode, BLOCK_FLAG_READ_ONLY, 0,
local_process_dir_block, &ctx);
if (!block_buf)
ext2fs_free_mem(&ctx.buf);
if (retval)
return retval;
return ctx.errcode;
}
// list dir over journal inode use real fs dir blocks an real dir-entry-inodes
// function current not used
void list_dir2(ext2_ino_t ino, struct ext2_inode *inode)
{
int retval;
int flags;
struct priv_dir_iterate_struct ls;
ls.options = 0;
if (!ino || (! LINUX_S_ISDIR(inode->i_mode))) return;
ls.options |= LONG_OPT;
ls.options |= DELETED_OPT;
if (! ext2fs_test_inode_bitmap ( current_fs->inode_map, ino )) ls.options |= DELETED_DIR ;
flags = DIRENT_FLAG_INCLUDE_EMPTY;
if (ls.options & DELETED_OPT) flags |= DIRENT_FLAG_INCLUDE_REMOVED;
// not testet flags = (inode->i_flags & EXT2_INDEX_FL) ? SKIP_HTREE : 0 ;
retval = local_dir_iterate3(current_fs,ino, inode, flags,0, list_dir_proc, &ls);
fprintf(stdout, "\n");
if (retval)
fprintf(stderr,"Error: %d inode or directory data error\n", retval);
return;
}
//--------------------------------------------------
// local sub function
// load dir-index in a dir_list
struct dir_list_head_t* get_dir3(struct ext2_inode* d_inode,ext2_ino_t path_ino, ext2_ino_t ino,
char* path, char* name,
__u32 t_after , __u32 t_before,
int options )
{
int retval;
int flags;
struct ext2_inode* inode;
struct ring_buf *i_list = NULL;
r_item *item = NULL;
struct priv_dir_iterate_struct fl;
struct dir_list_head_t * l_dir = NULL;
if(d_inode) memset(d_inode, 0 , current_fs->super->s_inode_size);
i_list = (struct ring_buf*) get_j_inode_list(current_fs->super, ino);
if (! i_list) return NULL;
//FIXME
if (imap){
ext2fs_mark_generic_bitmap(imap,ino);
// printf("mark inode %10u\n",ino);
}
item = get_undel_inode(i_list , t_after , t_before);
if ( item && item->inode ) {
inode = (struct ext2_inode*)item->inode;
if(d_inode)
memcpy(d_inode,inode,current_fs->super->s_inode_size);
if (!ino || (! LINUX_S_ISDIR(inode->i_mode)))
goto errout;
//get dir
l_dir = new_dir_list ( path_ino,ino, path, name);
if (l_dir)
{
fl.options = options;
fl.dir_list = l_dir;
fl.transaction = &item->transaction;
// flags = DIRENT_FLAG_INCLUDE_EMPTY;
flags = 0;
flags = (inode->i_flags & EXT2_INDEX_FL) ? SKIP_HTREE : 0 ;
if (options & DELETED_OPT ) flags |= DIRENT_FLAG_INCLUDE_REMOVED;
retval = local_dir_iterate3(current_fs,ino, inode, flags,0, find_dir_proc, &fl);
if (retval )
fprintf(stderr,"Warning: error-NR %d can not found file: %s/%s\n", retval, path, name);
}
}
errout:
if (i_list)
ring_del(i_list);
return (l_dir) ? clean_up_dir_list(l_dir) : NULL ;
}
// main worker function for recover and list
// lookup_local() : search recursiv through the filesystem
// use inode and dirblocks from journal
// flag = 0 only undelete, flag = 2 process all
void lookup_local(char* des_dir, struct dir_list_head_t * dir, __u32 t_after , __u32 t_before, int flag){
struct dir_list_head_t *d_list = NULL;
struct dir_list_t *lp;
struct ext2_inode* inode = NULL;
struct ring_buf *i_list = NULL;
r_item *item = NULL;
char c = ' ';
int allocated;
int recursion = 0;
if (! dir) {
d_list = get_dir3(NULL, EXT2_ROOT_INO , EXT2_ROOT_INO , "","", t_after,t_before, flag);
if (!d_list) return;
//recursion
lookup_local(des_dir,d_list, t_after, t_before, flag);
}
else {
#ifdef DEBUG
printf(">>%s>>\n",dir->pathname);
#endif
if (flag & DOUPLE_QUOTES_LIST)
c = '"';
lp = GET_FIRST(dir);
inode = malloc(current_fs->super->s_inode_size);
while (lp){
if (! strcmp(lp->filename,"..")) {
if ((dir->path_inode != lp->inode_nr) && (dir->path_inode != 0)) break;
lp = GET_NEXT(dir,lp);
continue;
}
if (! strcmp(lp->filename,"."))
{
// prefunction for directory
switch (flag & REC_FILTER){
case LIST_ALL :
if (dir->dir_inode != lp->inode_nr) break;
printf("DIR %lu %c%s%c\n",(long unsigned int)lp->inode_nr,c,dir->pathname,c);
break;
case LIST_STATUS :
break;
case RECOV_DEL :
break;
case RECOV_ALL :
//create_all_dir(des_dir,dir->pathname, lp->inode_nr);
break;
case HIST_DIR :
add_coll_list(lp->inode_nr);
break;
}
}
else{
d_list = get_dir3(inode, dir->dir_inode,lp->inode_nr,
dir->pathname,lp->filename,t_after,t_before, flag);
if (d_list){
//FIXME search for lost dir
recursion = 1;
if (flag & LOST_DIR_SEARCH)
recursion = check_find_dir(des_dir,lp->inode_nr,dir->pathname,lp->filename);
//recursion for directory
if(recursion) {
lookup_local(des_dir, d_list, t_after, t_before, flag);
#ifdef DEBUG
printf("<<%s<<\n",dir->pathname);
#endif
}
}
else{
//function for all files apart from dir
switch (flag & REC_FILTER){
case LIST_ALL :
printf("--- %lu %c%s%s%s%c\n",(long unsigned int)lp->inode_nr,c,dir->pathname,
((strlen(dir->pathname) > 0) && strcmp(dir->pathname,"/")) ? "/" : "",
lp->filename,c);
break;
case LIST_STATUS :
allocated = check_file_recover(inode);
if (allocated)
printf("%5u%% %c%s%s%s%c\n",allocated,c,dir->pathname,
((strlen(dir->pathname) > 0) && strcmp(dir->pathname,"/")) ? "/" : "",
lp->filename,c);
break;
case RECOV_DEL :
if (inode->i_links_count)
recover_file(des_dir,dir->pathname, lp->filename, inode, lp->inode_nr,1);
break;
case RECOV_ALL :
if (inode->i_links_count)
recover_file(des_dir,dir->pathname, lp->filename, inode, lp->inode_nr,0);
break;
case HIST_DIR :
add_coll_list(lp->inode_nr);
break;
}
}
if (d_list) clear_dir_list(d_list);
d_list = NULL;
}
lp = GET_NEXT(dir,lp);
}
//if (inode)
free(inode);
// postfunction for directory
switch (flag & REC_FILTER){
case LIST_ALL :
break;
case LIST_STATUS :
break;
case RECOV_DEL :
break;
case RECOV_ALL :
i_list = get_j_inode_list(current_fs->super, dir->dir_inode);
if (! i_list) break;
item = get_undel_inode(i_list , t_after , t_before);
if (item)
set_dir_attributes(des_dir, dir->pathname,(struct ext2_inode*)item->inode);
if (i_list) ring_del(i_list);
break;
case HIST_DIR :
break;
}
}
if(d_list)
clear_dir_list(d_list);
}
// list dir over journal inode and journal dir blocks an journal dir-entry-inodes
void list_dir3(ext2_ino_t ino, struct ext2_inode *inode, trans_range_t* transaction ,__u32 time_stamp)
{
int retval;
int flags;
struct priv_dir_iterate_struct ls;
ls.options = 0;
if (!ino || (! LINUX_S_ISDIR(inode->i_mode))) return;
ls.options |= LONG_OPT;
ls.options |= DELETED_OPT;
ls.options |= ONLY_JOURNAL;
ls.time_stamp = time_stamp;
if (! ext2fs_test_inode_bitmap ( current_fs->inode_map, ino )) ls.options |= DELETED_DIR ;
ls.transaction = transaction;
flags = DIRENT_FLAG_INCLUDE_EMPTY + ONLY_JOURNAL;
if (ls.options & DELETED_OPT) flags |= DIRENT_FLAG_INCLUDE_REMOVED;
flags |= (inode->i_flags & EXT2_INDEX_FL) ? SKIP_HTREE : 0 ;
retval = local_dir_iterate3(current_fs,ino, inode, flags,0, list_dir_proc, &ls);
fprintf(stdout, "\n");
if (retval)
fprintf(stderr,"Error %d inode or journal directory data error\n", retval);
return;
}
// search the Inode for an pathname (recursiv function)
ext2_ino_t local_namei(struct dir_list_head_t * dir, char *path, __u32 t_after , __u32 t_before, int flag){
struct dir_list_head_t *d_list = NULL;
struct dir_list_t *lp;
ext2_ino_t ret_inode = 0;
char *p_path = NULL;
char *p1;
char c;
char *p2;
if (! dir) {
d_list = get_dir3(NULL,EXT2_ROOT_INO , EXT2_ROOT_INO , "","", t_after,t_before, flag);
if (!d_list) {
fprintf(stderr,"no rootdir at filesystem found\n");
return 0;
}
ret_inode = local_namei(d_list, path, t_after, t_before, flag);
}
else {
// Check end recursion
if (!(strlen(path))) {
ret_inode = dir->dir_inode;
goto out;
}
p_path = (char*) malloc(strlen(path)+1);
p2 = p_path;
p1 = path + strspn(path,"/");
c = *p1;
while ( c != '/' ){
*p2++ = c;
if (c == 0) break;
p1++;
c = *p1;
}
if ( c ) *p2 = 0;
lp = GET_FIRST(dir);
while (lp){
if (! strcmp(lp->filename,"..")) {
if (dir->path_inode != lp->inode_nr) {
break;
}
}
if (! strcmp(lp->filename,"."))
{
if (dir->dir_inode != lp->inode_nr) {
break;
}
}
else{
if (strcmp( p_path , lp->filename)) {
lp = GET_NEXT(dir,lp);
continue;
}
d_list = get_dir3(NULL,dir->dir_inode,lp->inode_nr,dir->pathname,lp->filename,t_after,t_before, flag);
if (d_list){
ret_inode = local_namei(d_list, p1, t_after, t_before, flag);
// break if found
if (ret_inode) goto out;
}
else{
// recursions end (file find)
ret_inode = lp->inode_nr;
goto out;
}
}
lp = GET_NEXT(dir,lp);
}
}
out:
if(p_path)
free(p_path);
if(d_list)
clear_dir_list(d_list);
return ret_inode;
}
|
orochi/ext4magic
|
src/lookup_local.c
|
C++
|
mit
| 27,046 |
/*
* Copyright (c) Christos Zoulas 2003.
* All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice immediately at the beginning of the file, without modification,
* this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
// this is a copie from file-5.03. (Please do not change here.)
// We need this because not all Distibution have a DEVEL packages for libmagic.
#ifndef _MAGIC_H
#define _MAGIC_H
#include <sys/types.h>
#define MAGIC_NONE 0x000000 /* No flags */
#define MAGIC_DEBUG 0x000001 /* Turn on debugging */
#define MAGIC_SYMLINK 0x000002 /* Follow symlinks */
#define MAGIC_COMPRESS 0x000004 /* Check inside compressed files */
#define MAGIC_DEVICES 0x000008 /* Look at the contents of devices */
#define MAGIC_MIME_TYPE 0x000010 /* Return the MIME type */
#define MAGIC_CONTINUE 0x000020 /* Return all matches */
#define MAGIC_CHECK 0x000040 /* Print warnings to stderr */
#define MAGIC_PRESERVE_ATIME 0x000080 /* Restore access time on exit */
#define MAGIC_RAW 0x000100 /* Don't translate unprintable chars */
#define MAGIC_ERROR 0x000200 /* Handle ENOENT etc as real errors */
#define MAGIC_MIME_ENCODING 0x000400 /* Return the MIME encoding */
#define MAGIC_MIME (MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
#define MAGIC_APPLE 0x000800 /* Return the Apple creator and type */
#define MAGIC_NO_CHECK_COMPRESS 0x001000 /* Don't check for compressed files */
#define MAGIC_NO_CHECK_TAR 0x002000 /* Don't check for tar files */
#define MAGIC_NO_CHECK_SOFT 0x004000 /* Don't check magic entries */
#define MAGIC_NO_CHECK_APPTYPE 0x008000 /* Don't check application type */
#define MAGIC_NO_CHECK_ELF 0x010000 /* Don't check for elf details */
#define MAGIC_NO_CHECK_TEXT 0x020000 /* Don't check for text files */
#define MAGIC_NO_CHECK_CDF 0x040000 /* Don't check for cdf files */
#define MAGIC_NO_CHECK_TOKENS 0x100000 /* Don't check tokens */
#define MAGIC_NO_CHECK_ENCODING 0x200000 /* Don't check text encodings */
/* Defined for backwards compatibility (renamed) */
#define MAGIC_NO_CHECK_ASCII MAGIC_NO_CHECK_TEXT
/* Defined for backwards compatibility; do nothing */
#define MAGIC_NO_CHECK_FORTRAN 0x000000 /* Don't check ascii/fortran */
#define MAGIC_NO_CHECK_TROFF 0x000000 /* Don't check ascii/troff */
#ifdef __cplusplus
extern "C" {
#endif
typedef struct magic_set *magic_t;
magic_t magic_open(int);
void magic_close(magic_t);
const char *magic_file(magic_t, const char *);
const char *magic_descriptor(magic_t, int);
const char *magic_buffer(magic_t, const void *, size_t);
const char *magic_error(magic_t);
int magic_setflags(magic_t, int);
int magic_load(magic_t, const char *);
int magic_compile(magic_t, const char *);
int magic_check(magic_t, const char *);
int magic_errno(magic_t);
#ifdef __cplusplus
};
#endif
#endif /* _MAGIC_H */
|
orochi/ext4magic
|
src/magic.h
|
C++
|
mit
| 3,990 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
* *
* *
* C Implementation: magic_block_scan *
***************************************************************************/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "util.h"
#include "inode.h"
#include "magic.h"
#include "extent_db.h"
//#define DEBUG_MAGIC_SCAN
extern ext2_filsys current_fs ;
extern char* magicfile;
ext2fs_block_bitmap d_bmap = NULL ;
static __u32 get_block_len(char *buf){
int len = current_fs->blocksize -1;
while ((len >= 0) && (!(*(buf + len))))
len--;
return ++len;
}
struct found_data_t* free_file_data(struct found_data_t* old){
int tmp;
if(old->inode) free(old->inode);
if(old->scan_result) free(old->scan_result);
if(old->name) free(old->name);
if(old->priv){
old->func(NULL,&tmp,0,4,old);
old->priv = NULL;
}
free(old);
return NULL;
}
static struct found_data_t* copy_file_data(struct found_data_t* old){
static struct found_data_t* new = NULL;
int str_len = strlen(old->scan_result)+1;
int name_len = strlen(old->name)+1;
//FIXME private
new = malloc(sizeof(struct found_data_t));
if (!new) return NULL;
memcpy(new,old,sizeof(struct found_data_t));
new->scan_result = malloc(str_len);
new->name = malloc(name_len);
new->inode = new_inode();
if(old->priv){
new->priv = malloc(old->priv_len);
if (new->priv)
memcpy(new->priv,old->priv,old->priv_len);
else
new->priv_len = 0;
}
if((!new->scan_result) || (!new->name) || (!new->inode)){
if (new->priv){
free (new->priv);
new->priv = NULL;
}
new = free_file_data(new);
fprintf(stderr,"ERROR; while allocate memory for found copy file struct\n");
}
else{
memcpy(new->scan_result,old->scan_result,str_len);
memcpy(new->name,old->name,name_len);
memcpy(new->inode,old->inode,128);
}
return new;
}
static struct found_data_t* new_file_data(blk_t blk,__u32 scan,char *magic_buf, unsigned char* buf, __u32 *f, __u32 buf_length){
struct found_data_t *new;
int str_len;
int name_len;
char *c;
int def_len = 20;
char name_str[20];
new = malloc(sizeof(struct found_data_t));
if (!new) return NULL;
new->first = blk;
new->last = blk;
new->buf_length = buf_length;
new->next_offset = 0;
new->last_match_blk = 0;
new->scantype = H_F_Carving;
new->scan = scan;
new->size = 0;
new->h_size = 0;
new->priv_len = 0;
new->func = NULL;
new->priv = NULL;
if ( ident_file(new,&scan,magic_buf,buf)){
new->type = scan;
str_len = strlen(magic_buf) + 1;
c = strpbrk(magic_buf,";:, ");
if (c){
*c = 0;
name_len = c - magic_buf + def_len;
}
else
name_len = str_len + def_len;
new->scan_result = malloc(str_len);
new->name = malloc(name_len);
new->inode = new_inode();
if((!new->scan_result) || (!new->name) || (!new->inode)){
new = free_file_data(new);
fprintf(stderr,"ERROR; while allocate memory for found file struct\n");
}
else{
strcpy(new->scan_result,magic_buf);
strncpy(new->name, magic_buf , name_len - def_len+1);
sprintf(name_str,"/%010lu",(long unsigned int)blk);
strcat(new->name,name_str);
get_file_property(new);
new->func(buf,&name_len,scan,2,new);
}
if ((!new->func) || (!new->first)) {
*f = 0;
return free_file_data(new);
}
}
*f++; //"gcc warning: value computed is not used" warning is okay
return new;
}
static struct found_data_t* recover_file_data(char *des_dir, struct found_data_t* this, __u32 *follow){
recover_file(des_dir,"MAGIC-3",this->name,(struct ext2_inode*)this->inode, 0 , 1);
*follow = 0;
return free_file_data(this);
}
static struct found_data_t* forget_file_data(struct found_data_t* this, __u32 *p_follow){
#ifdef DEBUG_MAGIC_SCAN
printf("TRASH : %s : leng %lu : begin %lu\n", this->name, this->inode->i_size , this->first);
// dump_inode(stdout, "",0, (struct ext2_inode *)this->inode, 1);
#endif
free_file_data(this);
*p_follow = 0;
return NULL;
}
static __u32 add_file_data(struct found_data_t* this, blk_t blk, __u32 scan ,__u32 *f){
if (inode_add_block(this->inode , blk )){
this->last = blk;
(*f)++ ;
}
return *f ;
}
static int file_data_correct_size(struct found_data_t* this, int size){
unsigned long long i_size;
int flag=0;
int i,ref;
if (size <= current_fs->blocksize){
flag = 1;
i_size = (((unsigned long long)this->inode->i_size_high) << 32) + this->inode->i_size;
i_size -= (current_fs->blocksize - size);
this->inode->i_size = i_size & 0xffffffff ;
this->inode->i_size_high = i_size >> 32 ;
if ((i_size <= (12 * current_fs->blocksize))&&(!(this->inode->i_flags & EXT4_EXTENTS_FL))) {
//correcting small ext3 inodes
if(this->inode->i_block[EXT2_IND_BLOCK]){
this->inode->i_block[EXT2_IND_BLOCK] = 0;
this->inode->i_block[EXT2_DIND_BLOCK] = 0;
this->inode->i_block[EXT2_TIND_BLOCK] = 0;
}
for (i = current_fs->blocksize,ref=1; i<i_size; i+=current_fs->blocksize,ref++);
while (ref < EXT2_IND_BLOCK){
this->inode->i_block[ref] = 0;
ref++;
}
}
}
return flag;
}
static int check_file_data_end(struct found_data_t* this,unsigned char *buf, __u32 mask){
int size;
int ret = 0;
size = get_block_len((char*)buf);
ret = (this->func(buf, &size ,this->scan ,0 , this) & mask) ;
if (ret)
ret = file_data_correct_size(this,size);
return (mask & FORCE_RECOVER) ? 1 : ret ;
}
static int check_file_data_possible(struct found_data_t* this, __u32 scan ,unsigned char *buf){
int size ;
size = (scan & M_SIZE );
return this->func(buf, &size ,scan ,1 , this);
}
static int check_meta3_block(char *block_buf, blk_t blk, __u32 size, int flag){
blk_t block, *pb_block;
int i,j ;
size = (size + 3) & 0xFFFFFC ;
if (! size ) return 0;
for (i = size-4 ; i>=0 ; i -= 4){
pb_block = (blk_t*)(block_buf+i);
block = ext2fs_le32_to_cpu(*pb_block);
if( block && (block < current_fs->super->s_blocks_count) &&
(ext2fs_test_block_bitmap( d_bmap, block)) && ( ((!flag) && (!ext2fs_test_block_bitmap(bmap,block))) ||
(((flag == 1) && (i == (size -4)) && (i>4))||(!ext2fs_test_block_bitmap(bmap,block))) ||
(flag == 2) ) ){
if (i) { //work not by sparse file
for (j = i - 4 ; j >= 0 ;j -= 4){
if (block == ext2fs_le32_to_cpu(*((blk_t*)(block_buf+j))))
return 0;
}
}
else {
if (block == blk+1)
return 1;
}
}
else
return 0;
}
return 0; //never used
}
static int check_indirect_meta3(char *block_buf){
blk_t *pb_block;
blk_t last;
int i = current_fs->blocksize/sizeof(blk_t) -1;
int count=0;
int next =0;
pb_block = (blk_t*)block_buf;
last = ext2fs_le32_to_cpu(*pb_block);
while (i && last ) {
pb_block++;
i--;
count++;
if ((ext2fs_le32_to_cpu(*pb_block) -1) == last)
next++;
if (ext2fs_le32_to_cpu(*pb_block))
last = ext2fs_le32_to_cpu(*pb_block);
else
break;
}
return (next >= (count>>1)) ? 1 : 0;
}
static int check_dindirect_meta3(char * block_buf){
__u32 *p_blk;
__u32 block;
char *buf = NULL;
int ret = 0;
buf = malloc(current_fs->blocksize);
if (buf) {
p_blk = (__u32*) block_buf;
block = ext2fs_le32_to_cpu(*p_blk);
io_channel_read_blk ( current_fs->io, block, 1, buf );
if (check_meta3_block(buf, block, get_block_len(buf),2)){
ret = check_indirect_meta3(buf);
}
free (buf);
}
return ret;
}
static int check_tindirect_meta3(char * block_buf){
__u32 *p_blk;
__u32 block;
char *buf = NULL;
int ret = 0;
buf = malloc(current_fs->blocksize);
if (buf) {
p_blk = (__u32*) block_buf;
block = ext2fs_le32_to_cpu(*p_blk);
io_channel_read_blk ( current_fs->io, block, 1, buf );
if (check_meta3_block(buf, block, get_block_len(buf),2)){
ret = check_dindirect_meta3(buf);
}
free (buf);
}
return ret;
}
static int check_meta4_block(unsigned char *block_buf, blk_t blk, __u32 size){
return (ext2fs_extent_header_verify((void*)block_buf, current_fs->blocksize)) ? 0 : 1;
/*
__u16 *p_h16;
__u16 h16;
if(!((block_buf[0] == 0x0a) && (block_buf[1] == (unsigned char)0xf3)))
return 0;
p_h16 = (__u16*)(block_buf+2);
h16 = ext2fs_le16_to_cpu(*p_h16);
p_h16 = (__u16*)(block_buf+4);
if (ext2fs_le16_to_cpu(*p_h16) != (__u16)((current_fs->blocksize -12)/ 12))
return 0;
if ((!h16) || (h16 > ext2fs_le16_to_cpu(*p_h16)))
return 0;
return 1 ;*/
}
static int check_dir_block(unsigned char *block_buf, blk_t blk, __u32 size){
struct ext2_dir_entry_2 *dir_entry;
ext2_ino_t inode_nr;
__u16 len;
__u16 p_len;
int i;
dir_entry = (struct ext2_dir_entry_2*)block_buf;
inode_nr = ext2fs_le32_to_cpu(dir_entry->inode);
if ((inode_nr && (inode_nr < EXT2_GOOD_OLD_FIRST_INO)) || (inode_nr > current_fs->super->s_inodes_count))
return 0;
len = ext2fs_le16_to_cpu(dir_entry->rec_len);
if ((len < 8) || (len % 4) || (len> current_fs->blocksize) ||(len < (((unsigned)dir_entry->name_len + 11) & ~3 ))||(!dir_entry->name_len) || (! dir_entry->file_type) || (dir_entry->file_type & 0xf8))
return 0;
for (i=0; i<dir_entry->name_len;i++)
if(!dir_entry->name[i])
return 0;
if((dir_entry->name_len == 1) && ((dir_entry->name[0] < 33) || (dir_entry->name[0] > 126)))
return 0;
loop:
p_len =len;
if (len < current_fs->blocksize - 12){
dir_entry = (struct ext2_dir_entry_2*) (((void*)dir_entry) + len);
len = ext2fs_le16_to_cpu(dir_entry->rec_len);
if ((len < 8) || (len % 4) || ((len+p_len) > current_fs->blocksize) ||(len < (((unsigned)dir_entry->name_len + 11) & ~3 ))||(!dir_entry->name_len) || (! dir_entry->file_type) || (dir_entry->file_type & 0xf8) )
return 0;
if ((dir_entry->name_len & 0x01) && dir_entry->name[(unsigned)dir_entry->name_len])
goto loop;
}else
if (block_buf[current_fs->blocksize -1])
return 0;
return 1;
}
static int check_acl_block(unsigned char *block_buf, blk_t blk, __u32 size){
__u32 *p32;
int i;
p32 = (__u32*)block_buf;
if ((!(*p32)) || (ext2fs_le32_to_cpu(*p32) & (~ 0xEA030000)))
return 0;
p32 += 2;
if ((!(*p32)) || (ext2fs_le32_to_cpu(*p32) > 0xff))
return 0;
p32++;
if (! (*p32))
return 0;
p32++;
for (i = 0; i<4; i++){
if (*p32)
return 0;
p32++;
}
return (size > (current_fs->blocksize-32)) ? 1 : 0;
}
static int add_ext4_extent_idx_data(struct found_data_t* this, struct extent_area* ea){
return inode_add_extent(this->inode ,ea, &(this->last), 1);
}
//for future use ; gcc warning is okay
static int add_ext4_extent_data(struct found_data_t* this, struct extent_area* ea){
return inode_add_extent(this->inode ,ea, &(this->last), 0);
}
static int add_ext3_file_meta_data(struct found_data_t* this, char *buf, blk_t blk){
blk_t next_meta = 0;
blk_t meta = 0;
blk_t last_data = 0;
int ret = 0;
if (check_indirect_meta3(buf)){
ret = inode_add_meta_block(this->inode , blk, &last_data, &next_meta, buf );
this->last = last_data;
this->scantype |= DATA_METABLOCK;
}
if (ret && (next_meta > 10 && (ext2fs_test_block_bitmap ( d_bmap, next_meta) && (! ext2fs_test_block_bitmap( bmap, next_meta))))){
meta = next_meta;
next_meta = 0;
io_channel_read_blk ( current_fs->io, meta, 1, buf );
if (check_meta3_block(buf, meta, get_block_len(buf),1) && check_dindirect_meta3(buf)){
ret = inode_add_meta_block(this->inode , meta, &last_data, &next_meta, buf );
this->last = last_data;
if (ret && (next_meta > 10 && (ext2fs_test_block_bitmap ( d_bmap, next_meta) && (! ext2fs_test_block_bitmap( bmap, next_meta))))){
meta = next_meta;
next_meta = 0;
io_channel_read_blk ( current_fs->io, meta, 1, buf );
if (check_meta3_block(buf, meta, get_block_len(buf),1) && check_tindirect_meta3(buf)){
ret = inode_add_meta_block(this->inode , meta, &last_data, &next_meta, buf );
this->last = last_data;
}
}
}
}
return ret ;
}
// skip not of interest blocks : return 1 if skiped
static int skip_block(blk_t *p_blk ,struct ext2fs_struct_loc_generic_bitmap *ds_bmap ){
struct ext2fs_struct_loc_generic_bitmap *p_bmap;
blk_t o_blk;
int flag = 0;
int diff = (current_fs->blocksize == 1024)?1:0;
o_blk = (*p_blk) >> 3;
p_bmap = (struct ext2fs_struct_loc_generic_bitmap *) bmap;
while (((! *(ds_bmap->bitmap + o_blk)) || (*(p_bmap->bitmap + o_blk) == (unsigned char)0xff) ||
(*(ds_bmap->bitmap + o_blk) == *(p_bmap->bitmap + o_blk))) && (o_blk < (ds_bmap->end >> 3))){
o_blk ++;
flag = 1;
}
*p_blk = (o_blk << 3) + diff ;
return flag;
}
static int is_ecryptfs(unsigned char* buf){
int ret = 0;
if ((!buf[0]) && (!buf[20]) && (!buf[21]) && (buf[22]) && (!buf[23]) && (!buf[24]) &&
((buf[8] ^ buf[12]) == 0x3c) && ((buf[9] ^ buf[13]) == 0x81) && ((buf[10] ^ buf[14]) == 0xb7) && ((buf[11] ^ buf[15]) == 0xf5))
ret =1;
return ret;
}
inline const char *safe_magic_buffer(magic_t cookie, const void *buffer, size_t length){
const char *ret = magic_buffer(cookie, buffer, length);
if (ret==NULL){
return "";
}
return ret;
}
//magic scanner
//FIXME
static int magic_check_block(unsigned char* buf,magic_t cookie , magic_t cookie_f, char *magic_buf, __u32 size, blk_t blk, int deep){
int count = current_fs->blocksize -1 ;
int len;
char text[100] = "";
char *p_search;
__u32 retval = 0;
char token[20];
memset(magic_buf,0,100); //FIXME
memset(text,0,100);
while ((count >= 0) && (*(buf+count) == 0)) count-- ;
if (ext2fs_le32_to_cpu(*(blk_t*)buf) == blk +1){
if (check_meta3_block((char*)buf, blk, count+1, 0)){
retval = M_EXT3_META ;
goto out;
}
}
if (size > current_fs->blocksize){
strncpy(text,safe_magic_buffer(cookie_f, buf, 512),60);
if ((!strncmp(text,"data",4))|| (!strncmp((char*)buf,"ID3",3))){
strncpy(text,safe_magic_buffer(cookie_f,buf , size),60);
strncpy(magic_buf, safe_magic_buffer(cookie , buf , size),60);
}
else{
strncpy(magic_buf, safe_magic_buffer(cookie , buf , 512),60);
}
}
else{
strncpy(text,safe_magic_buffer(cookie_f,buf , size),60);
strncpy(magic_buf, safe_magic_buffer(cookie , buf , size),60);
}
if (!strncmp(text,"data",4)){
if (count == -1) {
retval |= M_BLANK;
goto out;
}
}
if((strstr(magic_buf,"text/")) || (strstr(magic_buf,"application/") && (strstr(text,"text")))){
retval |= M_TXT ;
if (deep && count && (count > 60))// current_fs->blocksize))
strncpy(magic_buf, safe_magic_buffer(cookie , buf , count-1),60);
}
//loop:
if ((strstr(magic_buf,"text/plain"))||(strstr(magic_buf,"text/html"))){
char *type;
char searchstr[] = "bin/perl python PEM SGML OpenSSH libtool M3U Tcl=script Perl=POD module=source PPD make=config bin/make awk bin/ruby bin/sed bin/expect bash ";
char searchtype[] = "text/x-perl text/x-python text/PEM text/SGML text/ssh text/libtool text/M3U text/tcl text/POD text/x-perl text/PPD text/configure text/x-makefile text/x-awk text/ruby text/sed text/expect text/x-shellscript ";
if (deep && (count > 250) && (!strncmp((char*)buf,"From ",5))){
p_search = (char*)buf + 6;
for (len = 0; (len < (count -7)) ; len++){
if( *(p_search++) == 0x40)
break;
}
for (;len<(count -7); len++){
if( *(p_search++) == 0x0a)
break;
}
if ((len < (count - 180)) && ((!strncmp(p_search,"From:",5))||(!strncmp(p_search,"Return-Path:",12)))){
strncpy(magic_buf,"message/rfc822",15);
retval = M_TXT | M_MESSAGE | M_CLASS_1 ;
goto out;
}
}
if(!(strstr(magic_buf,"text/html"))){
if (deep){
//FIXME
p_search = searchstr;
type = searchtype;
while (*p_search){
len=0;
while((*p_search) != 0x20){
token[len] = ((*p_search)==0x3d)? 0x20 : (*p_search);
p_search++;
len++;
}
token[len] = 0;
if (strstr(text,token)){
len = 0;
while (type[len] != 0x20){
magic_buf[len] = type[len];
len++;
}
magic_buf[len] = 0;
retval = (M_TXT | M_CLASS_1);
goto out;
}
p_search++;
while (type[0] != 0x20)
type++;
if (*type)
type++;
}
if((count < (current_fs->blocksize -2)) || (!buf[-1])){
p_search = (char*)buf + 6;
for (len = 0; len < 20 ; len++){
if((*p_search ==0x0a) || (*(p_search++) == 0x20))
break;
}
if (len < 20){
for (len = 6; len < 80 ; len++)
if( buf[len] == 0x0a)
break;
if (len <80){
retval = M_TXT | M_CLASS_2 ;
goto out;
}
}
}
}
retval |= (M_DATA | M_TXT) ;
goto out;
}
}
if (strstr(magic_buf,"application/vnd.oasis.opendocument")){
retval |= (M_APPLI | M_BINARY | M_CLASS_1);
goto out;
}
if (strstr(magic_buf,"charset=binary")){
retval |= M_BINARY ;
}
//FIXME test: catch of properties from file-5.04
if ((retval & M_TXT) &&
((retval & M_BINARY) ||// (strstr(magic_buf,"charset=unknown-8bit") && (count > 8)) ||
(strstr(text,"very long lines, with no")))){
retval |= M_DATA;
}
else{
if ((strstr(magic_buf,"application/octet-stream")) && (!(strncmp(text,"data",4)))){
if (is_ecryptfs (buf))
strncpy(text,"ecryptfs ",9);
else
retval |= M_DATA;
}
}
if ((retval & M_DATA) || (*(buf+7) < EXT2_FT_MAX) || (count < 32) ) {
if (check_meta4_block(buf, blk, count+1)){
retval = M_EXT4_META ;
goto out;
}
if (check_dir_block(buf, blk, count+1)){
retval = M_DIR ;
goto out;
}
if (check_acl_block(buf, blk, count+1)){
retval = M_ACL ;
goto out ;
}
}
if (retval & M_DATA)
goto out;
if (deep && (retval & M_TXT)){
char searchstr[] = "html PGP rtf texmacs vnd.graphviz x-awk x-gawk x-info x-msdos-batch x-nawk x-perl x-php x-shellscript x-texinfo x-tex x-vcard x-xmcd xml ";
p_search = searchstr;
while (*p_search){
len=0;
while((*p_search) != 0x20){
token[len] = *p_search;
p_search++;
len++;
}
token[len] = 0;
if (strstr(magic_buf,token)){
//strncpy(magic_buf,text,60);
retval |= M_CLASS_1;
break;
}
p_search++;
}
if (! (retval & M_CLASS_1))
retval |= M_CLASS_2 ;
goto out;
}
if (strstr(magic_buf,"application/octet-stream")){
char searchstr[] = "7-zip cpio CD-ROM MPEG 9660 Targa Kernel boot SQLite OpenOffice.org VMWare3 VMware4 JPEG ART PCX IFF DIF RIFF ATSC ScreamTracker matroska LZMA Audio=Visual Sample=Vision ISO=Media ext2 ext3 ext4 LUKS python ESRI=Shape ecryptfs Matlab=v5 ";
p_search = searchstr;
while (*p_search){
len=0;
while((*p_search) != 0x20){
token[len] = ((*p_search)==0x3d)? 0x20 : (*p_search);
p_search++;
len++;
}
token[len] = 0;
if (strstr(text,token)){
strncpy(magic_buf,text,60);
retval |= ( M_APPLI | M_ARCHIV | M_CLASS_1 );
break;
}
p_search++;
}
if (! (retval & M_APPLI))
retval |= M_DATA ;
goto out;
}
else {
if (strstr(magic_buf,"application/")){
if (strstr(magic_buf,"x-tar"))
retval |= ( M_APPLI | M_TAR | M_CLASS_1) ;
else{
if((!strstr(magic_buf,"x-archive")) &&((strstr(magic_buf,"x-elc") || strstr(magic_buf,"keyring") || strstr(magic_buf,"x-arc")||strstr(magic_buf,"keystore")||strstr(magic_buf,"x-123")||
strstr(magic_buf,"fontobject")))){ //FIXME fontobject
//conflict x-123 <-> Targa on many file-versions
if (strstr(magic_buf,"x-123") && (strstr(text,"Targa"))){
strncpy(magic_buf,text,60);
retval |= ( M_APPLI | M_ARCHIV | M_CLASS_1 );
}else
retval = M_DATA;
}
else {
if (strstr(magic_buf,"encrypted") || strstr(magic_buf,"x-tex-tfm") || strstr(magic_buf,"x-compress"))
retval |= ( M_APPLI | M_CLASS_2 );
else
retval |= ( M_APPLI | M_CLASS_1 );
}
}
goto out;
}
else {
if (strstr(magic_buf,"image/")){
if (strstr(magic_buf,"x-portable-") && (! isspace( *(buf+2)))){
retval = M_DATA;
}
else
retval |= ( M_IMAGE | M_CLASS_1 );
goto out;
}
else {
if (strstr(magic_buf,"audio/")){
if (strstr(magic_buf,"x-mp4a-latm") || strstr(magic_buf,"x-hx-aac-adts"))
retval = M_DATA;
else {
if(strstr(magic_buf,"mpeg"))
retval |= ( M_AUDIO | M_CLASS_2 );
else
retval |= ( M_AUDIO | M_CLASS_1 );
}
goto out;
}
else{
if (strstr(magic_buf,"video/")){
retval |= ( M_VIDEO | M_CLASS_1 );
goto out;
}
else {
if (strstr(magic_buf,"message/")){
retval |= ( M_MESSAGE | M_CLASS_1);
goto out;
}
else{
if (strstr(magic_buf,"model/")){
retval |= ( M_MODEL | M_CLASS_2);
goto out;
}
else{
if (strstr(magic_buf," V2 Document")){
retval |= (M_APPLI | M_ARCHIV | M_CLASS_1 );
goto out;
}
}
}
}
}
}
}
}
out:
#ifdef DEBUG_MAGIC_SCAN
printf("BLOCK_SCAN : Block = %010u ; 0x%08x\n",blk, retval & 0xffffe000);
blockhex(stdout,buf,0,(count < (64)) ? count : 64 );
#endif
retval |= (count+1);
return retval;
}
static struct found_data_t* soft_border(char *des_dir, unsigned char *buf, struct found_data_t* file_data, __u32* follow, blk_t blk ,blk_t* last_rec, __u32 mask){
if ( check_file_data_end(file_data, buf ,mask )){
file_data = recover_file_data(des_dir, file_data, follow);
*last_rec = blk;
}
else{
file_data = forget_file_data(file_data, follow);
}
return file_data;
}
static __u32 check_next_border(struct ext2fs_struct_loc_generic_bitmap *ds_bmap, blk_t blk, __u32 count){
__u32 ret = 0;
__u32 i = 0;
while ((i < count) && (! ret) && ((blk + i) < ds_bmap->end)){
ret = (ext2fs_test_block_bitmap(d_bmap, blk + i) && (! ext2fs_test_block_bitmap(bmap, blk +i)))? 0 :1 ;
i++;
}
return (ret) ? i-1 : 0 ;
}
static int get_range(blk_t* p_blk ,struct ext2fs_struct_loc_generic_bitmap *ds_bmap, unsigned char* buf, int *flag){
blk_t begin;
blk_t end;
int count=1;
int diff = (current_fs->blocksize == 1024)?1:0;
for (begin = *p_blk; begin <= ds_bmap->end ; begin++){
if((!((begin-diff) & 0x7)) && skip_block(&begin, ds_bmap)){
#ifdef DEBUG_MAGIC_SCAN
printf("jump to %lu \n",begin);
#endif
}
*p_blk = begin;
if (begin > ds_bmap->end)
return 0;
if (ext2fs_test_block_bitmap ( d_bmap, begin) && (! ext2fs_test_block_bitmap( bmap, begin)))
break;
}
if (begin > ds_bmap->end)
return 0;
for (end = begin,count=1 ; ((count < MAX_RANGE) && (end < ds_bmap->end-1)); ){
if (ext2fs_test_block_bitmap(d_bmap, end+1) && (! ext2fs_test_block_bitmap( bmap, end+1))){
end++;
count++;
}
else break;
}
*(p_blk+1) = end;
//add the previous block to the end of the buffer
if (io_channel_read_blk ( current_fs->io,(*p_blk)-1,1,buf - current_fs->blocksize) ||
(io_channel_read_blk ( current_fs->io, begin , count, buf ))){
fprintf(stderr,"ERROR: while read block %10u + %d\n",begin,count);
return 0;
}
if (count && count < MAX_RANGE){
memset(buf+(count * current_fs->blocksize), 255, current_fs->blocksize);
*flag = 1;
}else
*flag = (ext2fs_test_block_bitmap(d_bmap, end+1) && (! ext2fs_test_block_bitmap( bmap, end+1)))? 0 :1 ;
return count;
}
static int get_full_range(blk_t* p_blk ,struct ext2fs_struct_loc_generic_bitmap *ds_bmap, unsigned char* buf, blk_t* p_flag){
blk_t begin;
blk_t end;
int count=0;
int i;
int diff = (current_fs->blocksize == 1024)?1:0;
for (begin = *p_blk; begin <= ds_bmap->end ; begin++){
if((!((begin - diff) & 0x7)) && skip_block(&begin, ds_bmap)){
#ifdef DEBUG_MAGIC_SCAN
printf("jump to %lu \n",begin);
#endif
}
*p_blk = begin;
if (begin > ds_bmap->end)
return 0;
if (ext2fs_test_block_bitmap ( d_bmap, begin) && (! ext2fs_test_block_bitmap( bmap, begin)))
break;
}
i = 0;
//add the previous block to the end of the buffer
if(io_channel_read_blk ( current_fs->io,begin-1,1,buf - current_fs->blocksize)){
fprintf(stderr,"ERROR: while read block %10lu + %d %d\n",(long unsigned int)begin,i,count-1);
return 0;
}
for (end = begin,count=1 ; ((count <= MAX_RANGE) && (end < ds_bmap->end)); ){
if (ext2fs_test_block_bitmap(d_bmap, end) && (! ext2fs_test_block_bitmap( bmap, end))){
count++;
if (!begin)
begin = end;
*p_flag = end++;
p_flag++;
i++;
}
else {
if (i){
if (io_channel_read_blk ( current_fs->io, begin , i, buf )){
fprintf(stderr,"ERROR: while read block %10lu + %d\n",(long unsigned int)begin,i);
return 0;
}
buf += (current_fs->blocksize *i);
begin = 0;
i = 0;
}
end++;
}
}
*(p_blk+1) = end;
if (i){
if (io_channel_read_blk ( current_fs->io, begin , i, buf )){
fprintf(stderr,"ERROR: while read block %10lu + %d %d\n",(long unsigned int)begin,i,count-1);
return 0;
}
}
return count-1;
}
//FIXME
//Attention : Changes have a very strong effect of the magic-fuction result
static int check_plain_passing(unsigned char * buf){
int ret = 0;
unsigned char *last = buf-1;
unsigned char *next = buf;
int i,j, count1,count2;
if ((!(*last)) || (!(buf[current_fs->blocksize-1])))
return 0; //NULL at end
last = buf -32;
count1 = count2 = 0;
for (i = 0; i< 32; i++){
for (j = 0; j<32; j++){
if (last[i] == next[j]){
count1++;
break;
}
}
for (j = 0; j<32; j++){
if (next[i] == last[j]){
count2++;
break;
}
}
}
if ((count1 > 7 ) && (count2 > 7 ))
ret = 1; //many duplicate
count1 = count2 = 0;
for (i = 0; i< 31; i++){
if( last[i] == last[i+1]) count1++;
if( next[i] == next[i+1]) count2++;
}
if ((count1 > 10) && (count2 > 10))
ret += 2; //many repetitions
count1 = count2 = 0;
for (i = 0; i< 31; i++){
for (j = i+1; j<32; j++){
if (last[i] == last[j]) count1++;
if (next[i] == next[j]) count2++;
}
}
if ((count1 < 5) && (count2 < 5))
ret += 4; //very different
return ret;
}
static blk_t block_backward(blk_t blk , int count){
int i=count;
while (i && blk){
if (ext2fs_test_block_bitmap(d_bmap, blk) && (! ext2fs_test_block_bitmap( bmap, blk)))
i--;
blk--;
}
return (!i) ? blk+1 : 0;
}
//main of the magic_scan_engine for ext3
//FIXME Disabled (not tested and can't work by version)
int magic_block_scan3(char* des_dir, __u32 t_after){
magic_t cookie = 0;
magic_t cookie_f = 0;
struct ext2fs_struct_loc_generic_bitmap *ds_bmap;
struct found_data_t *file_data = NULL;
blk_t blk[2] ;
blk_t j;
blk_t flag[MAX_RANGE];
blk_t fragment_flag;
blk_t last_rec;
unsigned char *v_buf = NULL;
unsigned char *buf ;
char *magic_buf = NULL;
unsigned char *tmp_buf = NULL;
int blocksize, ds_retval,count,i,ret,dummy, size;
__u32 scan,follow;
printf("MAGIC-3 : start ext3-magic-scan search. Please wait, this may take a long time\n");
blocksize = current_fs->blocksize ;
count = 0;
blk[0] = 0;
cookie = magic_open(MAGIC_MIME | MAGIC_NO_CHECK_COMPRESS | MAGIC_NO_CHECK_ELF );
cookie_f = magic_open(MAGIC_NO_CHECK_COMPRESS | MAGIC_NO_CHECK_ELF | MAGIC_RAW );
if ((! cookie) || magic_load(cookie, NULL) || (! cookie_f) || magic_load(cookie_f, NULL)){
fprintf(stderr,"ERROR: can't find libmagic\n");
goto errout;
}
v_buf = malloc(blocksize * (MAX_RANGE+1));
buf = v_buf + blocksize ;
tmp_buf = malloc(blocksize);
magic_buf = malloc(100);
if ((! v_buf) || (! magic_buf) || (! tmp_buf)){
fprintf(stderr,"ERROR: can't allocate memory\n");
goto errout;
}
memset(magic_buf,0,100);
ds_retval = init_block_bitmap_list(&d_bmap, t_after);
while (ds_retval){
ds_retval = next_block_bitmap(d_bmap);
if (ds_retval == 2 )
continue;
if (d_bmap && ds_retval ){
ds_bmap = (struct ext2fs_struct_loc_generic_bitmap *) d_bmap;
count = 0;
blk[0] = 1;
count = get_range(blk ,ds_bmap, buf, &dummy);
while (count){
#ifdef DEBUG_MAGIC_SCAN
printf(" %lu %lu %d\n", blk[0],blk[1],count);
#endif
for (i = 0; i< ((count>12) ? MAX_RANGE - 12 : count) ;i++){
scan = magic_check_block(buf+(i*blocksize), cookie, cookie_f , magic_buf , blocksize * (((count-i) >=9) ? 9 : 1) ,blk[0]+i , 0);
if(scan & (M_DATA | M_BLANK | M_IS_META | M_TXT)){
if (scan & (M_ACL | M_EXT4_META | M_DIR))
ext2fs_mark_generic_bitmap(bmap, blk[0]+i);
continue;
}
#ifdef DEBUG_MAGIC_SCAN
printf("SCAN %lu : %09x : %s\n",blk[0]+i,scan,magic_buf);
#endif
if (((count -i) > 12) && (ext2fs_le32_to_cpu(*(__u32*)(buf +((i+12)*blocksize))) == blk[0] + i +1 + 12)){
follow = 0;
file_data = new_file_data(blk[0]+i,scan,magic_buf,buf+(i*blocksize),&follow, count - i);
for(j=blk[0]+i; j<(blk[0]+i+12);j++)
add_file_data(file_data, j, scan ,&follow);
scan = magic_check_block(buf+((i+12)*blocksize), cookie, cookie_f , magic_buf , blocksize ,blk[0]+i+12, 0);
if ((scan & M_EXT3_META) && (check_indirect_meta3((char*)buf+((i+12)*blocksize)))){
if (add_ext3_file_meta_data(file_data, (char*)buf+((i+12)*blocksize), j)){
io_channel_read_blk (current_fs->io, file_data->last, 1, tmp_buf);
file_data = soft_border(des_dir, tmp_buf, file_data, &follow, 0 ,&last_rec, 0x7);
i++ ;
break;
}
else
file_data = forget_file_data(file_data, &follow);
}
else
file_data = forget_file_data(file_data, &follow);
}
else{
// no matches
// In the first step we are taking nothing
}
}
blk[0] += (i)?i:1;
count = get_range(blk ,ds_bmap,buf, &dummy);
}
count = 0;
blk[0] = 1;
last_rec = 0;
fragment_flag = 0;
count = get_full_range(blk ,ds_bmap, buf,flag);
while (count){
#ifdef DEBUG_MAGIC_SCAN
printf("%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu,%lu - %d\n",flag[0],flag[1],flag[2],flag[3],flag[4],flag[5],flag[6],flag[7],flag[8],flag[9],flag[10],flag[11],flag[12],flag[13],flag[14],flag[15],count);
#endif
for (i = 0; i< ((count>12) ? MAX_RANGE - 12 : count) ;i++){
follow = 0;
scan = magic_check_block(buf+(i*blocksize), cookie, cookie_f , magic_buf , blocksize ,flag[i], 1);
if(scan & (M_DATA | M_BLANK | M_IS_META)){
if ((!fragment_flag) && (scan & M_EXT3_META) && (check_indirect_meta3((char*)buf+(i*blocksize)))){
blk[1] = block_backward(flag[i] , 13);
if (blk[1] && (blk[1] < last_rec) && (blk[1] < (flag[i]-12))){
blk[0] = blk[1];
fragment_flag = flag[i];
#ifdef DEBUG_MAGIC_SCAN
printf("Try a fragment recover for metablock: %lu at blk: %lu\n",flag[i],blk[1] );
#endif
goto load_new;
}
}
else
continue;
}
#ifdef DEBUG_MAGIC_SCAN
printf("SCAN %lu : %09x : %s\n",flag[i],scan,magic_buf);
#endif
if (((count -i) > 12) && (ext2fs_le32_to_cpu(*(__u32*)(buf +((i+12)*blocksize))) == flag[12+i]+1)){
file_data = new_file_data(flag[i],scan,magic_buf,buf+(i*blocksize),&follow,count - i);
for(j=i; j<(12+i);j++)
add_file_data(file_data, flag[j], scan ,&follow);
scan = magic_check_block(buf+((i+12)*blocksize), cookie, cookie_f , magic_buf , blocksize ,flag[i+12],0);
if (scan & M_EXT3_META){
if (add_ext3_file_meta_data(file_data, (char*)buf+((i+12)*blocksize), flag[j])){
io_channel_read_blk (current_fs->io, file_data->last, 1, tmp_buf);
file_data = soft_border(des_dir, tmp_buf, file_data, &follow, flag[i], &last_rec, 0x7);
i++;
break;
}
else
file_data = forget_file_data(file_data, &follow);
}
else
file_data = forget_file_data(file_data, &follow);
}
else{
if (scan & M_IS_FILE){
for (j=i; j< 12+i; j++){
if (!follow){
file_data = new_file_data(flag[i],scan,magic_buf,buf+(i*blocksize),&follow,count - i);
add_file_data(file_data, flag[i], scan ,&follow);
}
else{
scan = magic_check_block(buf+(j*blocksize), cookie, cookie_f , magic_buf , blocksize ,flag[j] , 0);
if ( check_file_data_possible(file_data, scan ,buf+(j*blocksize))){
add_file_data(file_data, flag[j], scan ,&follow);
}
else{
j--;
file_data = soft_border(des_dir,buf+(j*blocksize), file_data, &follow, flag[j], &last_rec,0x7);
if ((!fragment_flag) && (scan & M_EXT3_META) && (check_indirect_meta3((char*)buf+((j+1)*blocksize)))){
blk[1] = block_backward(flag[j] , 12);
if (blk[1] && (blk[1] < last_rec) && (blk[1] < flag[j]-12)){
blk[0] = blk[1];
fragment_flag = flag[j+1];
#ifdef DEBUG_MAGIC_SCAN
printf("Try fragment recover for metablock: %lu at blk: %lu\n",flag[j+1], blk[0]);
#endif
goto load_new;
}
}
break;
}
}
size = (scan & M_SIZE ); //get_block_len(buf+(i*blocksize));
ret = file_data->func(buf+(j*blocksize), &size ,scan ,0 , file_data);
if (ret == 1){
if (file_data_correct_size(file_data,size)){
file_data = recover_file_data(des_dir, file_data, &follow);
last_rec = flag[i];
}
else{
file_data = forget_file_data(file_data, &follow);
#ifdef DEBUG_MAGIC_SCAN
printf("Don't recover this file, current block %lu \n",flag[i]);
#endif
}
break;
}
}
if (follow){
#ifdef DEBUG_MAGIC_SCAN
printf("stop no file-end\n");
#endif
file_data = soft_border(des_dir,buf+((j-1)*blocksize), file_data, &follow, flag[i], &last_rec, 0x3);
i = j - 12;
}
else
i = j;
}
}
}
blk[0]+=(i)?i:1;
if (fragment_flag && (blk[0] > fragment_flag))
fragment_flag = 0;
load_new :
count = get_full_range(blk ,ds_bmap, buf,flag);
}
}//operation
} //while transactions
errout:
clear_block_bitmap_list(d_bmap);
if (file_data) free_file_data(file_data);
if (v_buf) free(v_buf);
if (tmp_buf) free(tmp_buf);
if (magic_buf) free(magic_buf);
if (cookie) magic_close(cookie);
if (cookie_f) magic_close(cookie_f);
return 0;
} //end
static int check_extent_len(struct ext3_extent_header *header, struct extent_area* ea, blk_t blocknr ){
void *buf = NULL;
int ret = 0;
struct ext3_extent_idx *idx;
struct ext3_extent *extent;
int entry,i;
ret = ext2fs_extent_header_verify((void*) header, current_fs->blocksize);
if(!ret){
ea->b_count++;
for (entry =1; ((!ret) && (entry <= ext2fs_le16_to_cpu(header->eh_entries))) ; entry++){
if (ext2fs_le16_to_cpu(header->eh_depth)){
idx = (struct ext3_extent_idx*) (header + entry);
buf=malloc(current_fs->blocksize);
if (!buf)
return 1;
if(io_channel_read_blk ( current_fs->io,ext2fs_le32_to_cpu(idx->ei_leaf), 1, buf )){
fprintf(stderr,"Error read block %lu\n",(long unsigned int)ext2fs_le32_to_cpu(idx->ei_leaf));
ret = 2;
}
else{
//Recursion
ret = check_extent_len((struct ext3_extent_header*)buf, ea , 0);
}
if (buf){ free(buf); buf = NULL ;}
}
else{
extent = (struct ext3_extent*)(header + entry);
if ((ext2fs_le16_to_cpu(extent->ee_len)) & 0x8000){
continue;
}
for (i = 0; ((! ret) && (i< ext2fs_le16_to_cpu(extent->ee_len))); i++){
if (ext2fs_test_block_bitmap(bmap,ext2fs_le32_to_cpu(extent->ee_start)+i) &&
(!ext2fs_test_block_bitmap(d_bmap,ext2fs_le32_to_cpu(extent->ee_start)+i)))
ret = 4;
}
if (!ret){
if ((entry == 1) && (!ea->start_b)){
ea->start_b = ext2fs_le32_to_cpu(extent->ee_start);
ea->l_start = ext2fs_le32_to_cpu(extent->ee_block);
}
// if (entry == ext2fs_le16_to_cpu(header->eh_entries)){
ea->end_b = ext2fs_le32_to_cpu(extent->ee_start) + ext2fs_le16_to_cpu(extent->ee_len)-1;
ea->l_end = ext2fs_le32_to_cpu(extent->ee_block) + ext2fs_le16_to_cpu(extent->ee_len)-1;
// }
ea->b_count += ext2fs_le16_to_cpu(extent->ee_len);
ea->size = ((unsigned long long) ((ext2fs_le32_to_cpu(extent->ee_block)) +
(ext2fs_le16_to_cpu(extent->ee_len)))) * current_fs->blocksize;
}
}
}
if ((blocknr) && (!ret)){
ea->blocknr = blocknr;
ea->depth = ext2fs_le16_to_cpu(header->eh_depth);
}
}
return ret;
}
int recover_db(struct extent_db_t *db , struct extent_area *ea_group){
int flag = 0;
int count = 0;
__u32 start;
struct extent_area *ea = ea_group ;
memset (ea_group, 0 ,sizeof(struct extent_area) *4);
start = 0;
while ((!flag) && (count < 4)) {
start = extentd_db_find(db, (start) ? start+1 : start , ea);
if (start){
count++;
// printf(" --> %d ; start: %lu end: %lu depth: %lu \n",count, ea->l_start, ea->l_end, ea->depth);
ea++;
}
else flag++;
}
return count;
}
//FIXME NEW ---------------------------------------------------------------------------------------------------------
//main of the magic_scan_engine for ext4
int magic_block_scan4(char* des_dir, __u32 t_after){
magic_t cookie = 0;
magic_t cookie_f = 0;
struct ext2fs_struct_loc_generic_bitmap *ds_bmap = NULL;
ext2fs_block_bitmap c_bmap = NULL;
struct extent_db_t *db = NULL;
struct found_data_t *file_data = NULL;
struct found_data_t *tmp_file_data = NULL;
struct extent_area *ea = NULL;
struct extent_area ea_group[4];
blk_t blk[2] ;
blk_t first_b;
blk_t last_rec;
unsigned char *v_buf = NULL;
unsigned char *buf ;
char *magic_buf = NULL;
unsigned char *tmp_buf = NULL;
int blocksize, size, ds_retval,count,i,j,ret,dummy, border;
__u32 scan,follow;
int tes ; //typical extent size
//only for test
//int zahler = 0;
//int zahler1 =0;
printf("MAGIC-3 : start ext4-magic-scan search\n");
blocksize = current_fs->blocksize ;
tes = 1048576 / blocksize;
if (ext2fs_copy_bitmap(current_fs->block_map, &c_bmap)){
fprintf(stderr,"Error: while duplicate bitmap\n");
return 0;
}
ext2fs_clear_block_bitmap(c_bmap);
scan = 0;
count = 0;
blk[0] = 1;
cookie = magic_open(MAGIC_MIME | MAGIC_NO_CHECK_COMPRESS | MAGIC_NO_CHECK_ELF | MAGIC_CONTINUE);
cookie_f = magic_open(MAGIC_NO_CHECK_COMPRESS | MAGIC_NO_CHECK_ELF | MAGIC_RAW );
if ((! cookie) || magic_load(cookie, magicfile) || (! cookie_f) || magic_load(cookie_f, magicfile)){
fprintf(stderr,"ERROR: can't find libmagic\n");
goto errout;
}
v_buf = malloc(blocksize * (MAX_RANGE+1));
buf = v_buf + blocksize ;
tmp_buf = malloc(blocksize * 9);
magic_buf = malloc(100);
if ((! v_buf) || (! magic_buf) || (! tmp_buf)){
fprintf(stderr,"ERROR: can't allocate memory\n");
goto errout;
}
ds_retval = init_block_bitmap_list(&d_bmap, t_after);
while (ds_retval){
ds_retval = next_block_bitmap(d_bmap);
if (ds_retval == 2 )
continue;
db = extent_db_init(d_bmap);
if (d_bmap && ds_retval && db ){
ds_bmap = (struct ext2fs_struct_loc_generic_bitmap *) d_bmap;
last_rec = 0;
count = 0;
blk[0] = 1;
follow = 0;
count = get_range(blk ,ds_bmap, buf, &dummy);
while (count){
#ifdef DEBUG_MAGIC_SCAN
printf(" %lu %lu %d\n", blk[0],blk[1],count);
#endif
for (i=0 ; i< count; i++){
// printf(">>>>> %lu \n",blk[0]+i);
if ((check_dir_block(buf +(i*blocksize), blk[0]+i,1)) ||
(check_acl_block(buf+(i*blocksize), blk[0]+i,1))){
ext2fs_mark_generic_bitmap(bmap, blk[0]+i);
// printf ("<<> %lu DIR-BLOCK \n",blk[0]+i);
continue;
}
if (check_plain_passing((buf +(i*blocksize))) && ((blk[0]+i-((blocksize==1024)?1:0)) % tes ) )
ext2fs_mark_generic_bitmap(c_bmap, blk[0]+i);
//zahler++;
if (check_meta4_block(buf+(i*blocksize), blk[0]+i,1)){
// printf ("<<> %lu IDX \n",blk[0]+i);
ea = new_extent_area();
if ( ea ){
if (check_extent_len((struct ext3_extent_header*) (buf+(i*blocksize)) , ea, blk[0]+i)){
printf("extent %lu range allocated or damage\n",(long unsigned int)blk[0]+i);
}
else{
// printf(" --> start: %lu end: %lu depth: %lu \n",ea->l_start, ea->l_end, ea->depth);
if (!ea->l_start){
first_b = ea->start_b;
if(( ext2fs_test_block_bitmap( bmap,first_b)) ||
(io_channel_read_blk (current_fs->io,first_b - 1,9,tmp_buf ))){
fprintf(stderr,"Warning: block %10lu can not read or is allocated\n",(long unsigned int)first_b);
//FIXME ERROR goto ?
}
else{
scan = magic_check_block(tmp_buf+blocksize, cookie, cookie_f , magic_buf , blocksize*8 ,first_b, 1);
file_data = new_file_data(first_b,scan,magic_buf,tmp_buf+blocksize,&follow, 8);
if ((file_data) &&
(add_ext4_extent_idx_data(file_data, ea))){
file_data->scantype |= DATA_METABLOCK;
io_channel_read_blk (current_fs->io, file_data->last, 1, tmp_buf);
file_data = soft_border(des_dir, tmp_buf, file_data, &follow, ea->blocknr ,&last_rec, 0x7);
if(last_rec == blk[0]+i){
extent_db_add (db, ea,1);
extent_db_del(db,blk[0]+i);
ea=NULL;
}
else{
extent_db_add (db, ea,1);
ea = NULL;
}
}
}
}
else{
extent_db_add (db, ea,1);
ea = NULL;
}
}
blk[0] = blk[0] - count + i;
i = count;
if(ea) {free(ea); ea=NULL;}
}
} //ext4meta
} //for i
blk[0] += (i)?i:1;
count = get_range(blk ,ds_bmap,buf, &dummy);
} //count
// } //ds_bmap
while(1){
count = recover_db(db, ea_group);
if(count){
ea = ea_group;
if (( ea->blocknr) &&(! ea->l_start)){
first_b = ea->start_b;
if(( ext2fs_test_block_bitmap( bmap,first_b)) ||
(io_channel_read_blk (current_fs->io,first_b-1 ,9,tmp_buf ))){
fprintf(stderr,"Warning: block %10lu can not read or is allocated\n",(long unsigned int)first_b);
//FIXME ERROR goto ?
}
else{
scan = magic_check_block(tmp_buf+blocksize, cookie, cookie_f , magic_buf , blocksize*8,first_b, 1);
file_data = new_file_data(first_b,scan,magic_buf,tmp_buf+blocksize,&follow,8);
if ((file_data) && (add_ext4_extent_idx_data(file_data, ea))){
for (i = 1; i<count; i++){
ea++;
add_ext4_extent_idx_data(file_data, ea);
}
io_channel_read_blk (current_fs->io, file_data->last, 1, tmp_buf);
file_data = soft_border(des_dir, tmp_buf, file_data, &follow, ea_group[0].blocknr,
&last_rec, 0x7 | FORCE_RECOVER);
if(last_rec != ea_group[0].blocknr)
printf("error: block %lu -> file not written\n",(long unsigned int)ea_group[0].blocknr);
for (i=0; i<count; i++){
extent_db_del(db,ea_group[i].blocknr);
}
}
else{
printf("error : while create new file_data\n");
// goto errout;
}
}
}
else{
printf("error : no first blocknumber or not begin of a file\n");
// goto errout;
}
ea = NULL;
}
else{
// printf("ExtentDB ready for now\n");
break;
}
} //while
//--------------------------
last_rec = 0;
count = 0;
blk[0] = 1;
follow = 0;
count = get_range(blk ,ds_bmap, buf, &border);
ea = NULL;
while (count){
newloop:
for (i = 0; i< count ;i++){
if ((follow % tes) && (ext2fs_test_block_bitmap(c_bmap,blk[0]+i))){
if (ea)
(ea->len)++;
if (file_data)
add_file_data(file_data, blk[0]+i, scan ,&follow);
else
follow++;
continue;
}
if (!follow){
scan = magic_check_block(buf+(i*blocksize), cookie, cookie_f , magic_buf , (count-i)*blocksize ,blk[0]+i, 1);
//printf("SCAN %lu : %09x : %s\n",blk[0]+i,scan,magic_buf);
ea = new_extent_area();
if ( ea ){
ea->start_b = blk[0]+i;
(ea->len)++;
if ((scan & M_IS_FILE) && (!(scan & M_DATA))){
file_data = new_file_data(blk[0]+i,scan,magic_buf,buf+(i*blocksize),&follow,count - i);
if (file_data){
//----------------------<<<
//File can recover by follow the datastream
if (file_data->scantype & DATA_CARVING){
(ea->len)--;
for (j=0;j<file_data->buf_length;j++){
add_file_data(file_data, blk[0]+i+j, scan ,&follow);
(ea->len)++;
}
blk[0] += i+j;
count = get_range(blk ,ds_bmap,buf, &border);
ret = 1;
while (ret && (!(file_data->scantype & (DATA_READY | DATA_BREAK)))){
file_data->buf_length = (!follow) ? (count+1) : count;
ret = file_data->func(buf, &size ,scan ,3 , file_data);
if (ret){
if (((!file_data->buf_length)&& (!(file_data->scantype & (DATA_READY))))|| ((ret == 3) && (file_data->scantype & H_F_Carving))){
// break follow > scan now
goto newloop;
}
if (file_data->buf_length > count){
i = check_next_border(ds_bmap, blk[0],file_data->buf_length);
if (i){
ea->len = file_data->last_match_blk;
// printf("%lu : BREAK-1 : %s after %ld blocks\n",blk[0]+i,file_data->name, ea->len);
blk[0] = ea->start_b + ((ea->len)?ea->len:1);
extent_db_add (db, ea, 0);
ea = NULL;
file_data = forget_file_data(file_data, &follow);
count = get_range(blk ,ds_bmap,buf, &border);
goto newloop;
}
}
for (j=0;j<file_data->buf_length;j++){
add_file_data(file_data, blk[0]+j, scan ,&follow);
(ea->len)++;
}
if ((border && (file_data->last == blk[1]))&& (!(file_data->scantype & (DATA_READY)))){
if ((!file_data->next_offset)&&(file_data->scantype & DATA_NO_FOOT)){
file_data->scantype |= DATA_READY;
// printf("possible EOF, recover this\n");
}
else {
// printf("%lu : BREAK-2 : %s after %ld blocks\n",blk[0]+i,file_data->name, file_data->last - file_data->first);
extent_db_add (db, ea, 0);
ea = NULL;
blk[0] = file_data->last + 1;
file_data = forget_file_data(file_data, &follow);
count = get_range(blk ,ds_bmap,buf, &border);
goto newloop;
}
}
blk[0] += j;
count = get_range(blk ,ds_bmap,buf, &border);
}
else{
// printf("%lu : BREAK-3 : %s after %ld blocks\n",blk[0]+file_data->buf_length,file_data->name, file_data->last - file_data->first);
if (!file_data->last_match_blk)
(file_data->last_match_blk)++;
ea->len = file_data->last_match_blk;
extent_db_add (db, ea, 0);
ea = NULL;
blk[0] = file_data->first + file_data->last_match_blk ;
file_data = forget_file_data(file_data, &follow);
count = get_range(blk ,ds_bmap,buf, &border);
goto newloop;
}
}
if (file_data->scantype & (DATA_READY)){
io_channel_read_blk (current_fs->io, file_data->last, 1, tmp_buf);
file_data = soft_border(des_dir, tmp_buf, file_data, &follow, ea->start_b ,&last_rec, 0x7);
if (ea->start_b != last_rec){
// printf("%lu force recover, but not written\n",ea->blocknr);
extent_db_add (db, ea, 0);
ea = NULL;
}
}
else{
// printf("%lu : BREAK put into extent-cache\n", blk[0]);
if (!file_data->last_match_blk)
(file_data->last_match_blk)++;
ea->len = file_data->last_match_blk;
extent_db_add (db, ea, 0);
ea = NULL;
blk[0] = file_data->first + file_data->last_match_blk;
file_data = forget_file_data(file_data, &follow);
count = get_range(blk ,ds_bmap,buf, &border);
}
if (ea){free(ea);ea = NULL;}
follow = 0;
goto newloop;
}
//End follow datastream
else{
add_file_data(file_data, blk[0]+i, scan ,&follow); //add the first block
}
if (file_data->scantype & DATA_LENGTH){
//Start of size carving
j = check_next_border(ds_bmap, blk[0]+i,((file_data->size-1)/blocksize)+1);
if ((!j) && (! io_channel_read_blk (current_fs->io, blk[0]+ i + ((file_data->size-1)/blocksize), 1, tmp_buf))){
size = get_block_len((char*)tmp_buf);
if ((!(file_data->scantype & DATA_MINIMUM)) && (size <= ((file_data->size % blocksize)?(file_data->size % blocksize):blocksize))){
tmp_file_data = copy_file_data(file_data);
if (tmp_file_data){
for (j = 1; j< (((file_data->size-1)/blocksize)+1); j++){
add_file_data(tmp_file_data, blk[0]+i+j, scan ,&follow);
}
tmp_file_data = soft_border(des_dir, tmp_buf, tmp_file_data, &follow, blk[0]+i ,&last_rec, 0x3);
if (blk[0]+i == last_rec){
file_data = forget_file_data(file_data, &follow);
if (ea){free(ea);ea = NULL;}
blk[0]+= j + i;
count = get_range(blk ,ds_bmap,buf, &border);
goto newloop;
}
}
}
}
//and only MIN_SIZE
if ((!j) && (file_data->scantype & DATA_MINIMUM)){
for (j = 1; j< (((file_data->size-1)/blocksize)+1); j++){
add_file_data(file_data, blk[0]+i+j, scan ,&follow);
(ea->len)++;
}
file_data->scantype = H_F_Carving;
blk[0]+=(i+j-2);
count = get_range(blk ,ds_bmap,buf, &border);
i = 1;
// size = get_block_len(buf+(i*blocksize));
goto followloop;
}
else{
file_data->scantype = H_F_Carving;
follow = ea->len;
}
}
//End size carving
//------------------------------>>>
}else { // no file_data
// printf("%lu : no file_data\n",blk[0]+i);
if(ea){
(ea->l_start)--;
if(!ea->len)
(ea->len)++;
extent_db_add (db, ea, 0);
ea = NULL;
}
}
}else {
// printf("%lu : no file begin\n",blk[0]+i);
(ea->l_start)--;
follow++;
}
}else
printf("fail malloc ea\n");
}
else{
scan = magic_check_block(buf+(i*blocksize), cookie, cookie_f , magic_buf , blocksize ,blk[0]+i, 0);
// zahler1++;
// printf("SCAN %lu : %09x : %s\n",blk[0]+i,scan,magic_buf);
if (file_data){
if ( check_file_data_possible(file_data, scan ,buf+(i*blocksize))){
add_file_data(file_data, blk[0]+i, scan ,&follow);
(ea->len)++;
}
else{
file_data = soft_border(des_dir,buf+((i-1)*blocksize), file_data, &follow, blk[0]+i-1, &last_rec,0x3);
if (last_rec != blk[0]+i-1){
// printf("%lu : clear, put into extent-cache\n", blk[0]+i-1 );
extent_db_add (db, ea, 0);
ea = NULL;
}
if (ea){free(ea);ea = NULL;}
i--;
}
}
else{
if ((scan & M_IS_FILE) && (!(scan & M_DATA))){
// printf("%lu : end of fragment, put into extent-cache\n",blk[0]+i);
extent_db_add (db, ea, 0);
ea = NULL;
follow = 0;
i--;
}
else {
(ea->len)++;
follow++;
if ((scan & M_SIZE) < (blocksize - 32)){
// printf("%lu : possible end of fragment, add extent-cache\n",blk[0]+i);
extent_db_add (db, ea, 0);
ea = NULL;
follow = 0;
}
}
}
}
size = (scan & M_SIZE ); //get_block_len(buf+(i*blocksize));
followloop:
if (follow && file_data){
ret = file_data->func(buf+(i*blocksize), &size ,scan ,0 , file_data);
if (ret == 1){
if (file_data_correct_size(file_data,size)){
file_data = recover_file_data(des_dir, file_data, &follow);
last_rec = blk[0]+i;
}
else{
file_data = forget_file_data(file_data, &follow);
extent_db_add (db, ea, 0);
ea = NULL;
// printf("%lu : Don't recover this file\n",blk[0]+i);
}
if (ea){free(ea);ea = NULL;}
}
else
if(ea && (file_data->func == file_none))
(ea->l_start)--;
}
}
if(border){
// printf("%lu : border warning\n", blk[0]+i);
if (file_data) {
file_data = soft_border(des_dir,buf+((i-1)*blocksize), file_data, &follow, blk[0]+i-1, &last_rec,0x3);
if (last_rec != blk[0]+i-1){
// printf("%lu : clear and put into extent-cache\n", blk[0]+i-1 );
extent_db_add (db, ea, 0);
ea = NULL;
}
else {
free(ea);ea = NULL;
}
}
if (follow){
// printf("%lu : end of fragment\n", blk[0]+i);
follow = 0;
}
if (ea){
extent_db_add (db, ea, 0);
ea = NULL;
}
}
blk[0] += (i)?i:1;
count = get_range(blk ,ds_bmap,buf, &border);
}
}
// printf("ExtentDB : %lu entries\n",db->count);
if (db){ extent_db_clear(db) ; db=NULL;}
}//ds_retval
errout:
clear_block_bitmap_list(d_bmap);
ext2fs_free_block_bitmap(c_bmap);
if (ea) free (ea);
if (db) extent_db_clear(db);
if (v_buf) free(v_buf);
if (tmp_buf) free(tmp_buf);
if (magic_buf) free(magic_buf);
if (cookie) magic_close(cookie);
if (cookie_f) magic_close(cookie_f);
//printf("Count-1 = %lu Count-2 = %lu \n",zahler, zahler1);
return 0;
}//funcion
//--------END----------
|
orochi/ext4magic
|
src/magic_block_scan.c
|
C++
|
mit
| 53,394 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
//header util.h
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#include <utime.h>
#include <sys/sysmacros.h>
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#endif
#include <ext2fs/ext2fs.h>
#include "util.h"
#include "hard_link_stack.h"
#include "inode.h"
#include "block.h"
//defines for error in recover_file
#define CREATE_ERROR 0x80
#define SEEK_ERROR 0x40
#define MOVE_ERROR 0x20
#define CHOWN_ERROR 0x10
#define CHMOD_ERROR 0x08
#define UTIME_ERROR 0x04
#define ATTRI_ERROR 0x02
//in this version unused
#define ACL_ERROR 0x01
#ifdef FILE_ATTR
#include <e2p/e2p.h>
//#FLAGS_MODIFIABLE = EXT2_NOATIME_FL | EXT2_SYNC_FL | EXT2_DIRSYNC_FL | EXT2_APPEND_FL | EXT2_COMPR_FL | EXT2_NODUMP_FL |
// EXT2_IMMUTABLE_FL | EXT3_JOURNAL_DATA_FL | EXT2_SECRM_FL | EXT2_UNRM_FL | EXT2_NOTAIL_FL | EXT2_TOPDIR_FL
#define FLAGS_MODIFIABLE 0x0001E0FF
#endif
extern ext2_filsys current_fs;
struct privat {
int fd;
char* buf;
char flag;
int error;};
struct alloc_stat{
__u32 allocated;
__u32 not_allocated;};
struct alloc_recover_stat{
__u32 allocated;
__u32 recovered;};
// recover files from a "double quotes" listfile
void recover_list(char *des_dir, char *input_file,__u32 t_after, __u32 t_before, int flag){
FILE *f;
char *lineptr = NULL ;
char *filename = NULL ;
char *p1 , *p2;
size_t maxlen;
size_t got;
ext2_ino_t inode_nr;
struct ring_buf *i_list;
struct ext2_inode* r_inode;
r_item *item = NULL;
f = fopen(input_file,"r");
if (f) {
rewind(f);
maxlen = 512;
lineptr = malloc(maxlen);
filename = malloc(maxlen);
if ((!lineptr) || (!filename))
goto errout;
while (! (feof(f))){
got = getline (&lineptr, &maxlen, f);
if (got != -1){
p1 = strchr(lineptr,'"');
p2 = strrchr(lineptr,'"');
if ((p1) && (p2) && (p1 != p2)){
p1++;
*p2 = 0;
strcpy(filename,p1);
if (*filename == 0)
continue;
inode_nr = local_namei(NULL,filename,t_after,t_before,DELETED_OPT);
if(! inode_nr){
#ifdef DEBUG
printf("Filename %s not found\n",filename);
#endif
continue;
}
i_list = get_j_inode_list(current_fs->super, inode_nr);
item = get_undel_inode(i_list,t_after,t_before);
if (item) {
r_inode = (struct ext2_inode*)item->inode;
if (! LINUX_S_ISDIR(r_inode->i_mode) )
recover_file(des_dir,"", filename, r_inode, inode_nr ,flag);
}
#ifdef DEBUG
else
printf("no Inode found for %s\n",filename);
#endif
if (i_list) ring_del(i_list);
}
#ifdef DEBUG
else
printf("Filename not found in : \"%s\"",lineptr);
#endif
}
}
}
errout:
if (f) fclose(f);
if (lineptr)
free(lineptr);
if (filename)
free(filename);
return ;
}
// Subfunction for "local_block_iterate3()" for check if blocks not allocated and not recovered
static int check_block_stat(ext2_filsys fs, blk64_t *blocknr, e2_blkcnt_t blockcnt,
blk64_t /*ref_blk*/x, int /*ref_offset*/y, void *priv )
{
//FIXME:
if (*blocknr >= fs->super->s_blocks_count)
return BLOCK_ERROR;
struct alloc_recover_stat *stat = priv;
if ( ext2fs_test_block_bitmap (fs->block_map, *blocknr ))
(stat->allocated)++ ;
if ((bmap) && ( ext2fs_test_block_bitmap (bmap, *blocknr )))
(stat->recovered)++ ;
return 0;
}
// Subfunction for "local_block_iterate3()" for check if the blocks allocated
static int check_block(ext2_filsys fs, blk64_t *blocknr, e2_blkcnt_t blockcnt,
blk64_t /*ref_blk*/x, int /*ref_offset*/y, void *priv )
{
//FIXME:
if (*blocknr >= fs->super->s_blocks_count)
return BLOCK_ERROR;
struct alloc_stat *stat = priv;
if ( ext2fs_test_block_bitmap ( fs->block_map, *blocknr ))
(stat->allocated)++ ;
else
(stat->not_allocated)++ ;
if (bmap)
ext2fs_mark_generic_bitmap(bmap, *blocknr);
return 0;
}
//Subfunction for "local_block_iterate3()" read a blocks of a long symlink
static int read_syslink_block ( ext2_filsys fs, blk64_t *blocknr, e2_blkcnt_t blockcnt,
blk64_t /*ref_blk*/x, int /*ref_offset*/y, void *priv )
{
char *charbuf =((struct privat*)priv)->buf;
// __u32 nbytes;
errcode_t retval;
// int blocksize = fs->blocksize;
if (*blocknr >= fs->super->s_blocks_count)
return BLOCK_ERROR;
if (((struct privat*)priv)->flag){
int allocated = ext2fs_test_block_bitmap ( fs->block_map, *blocknr );
if ( allocated ){
((struct privat*)priv)->error = 1;
// fprintf(stderr,"Block %10lu is allocated.\n",*blocknr);
return (BLOCK_ABORT | BLOCK_ERROR);
}
}
retval = io_channel_read_blk ( fs->io, *blocknr, 1, charbuf );
if (retval){
((struct privat*)priv)->error = retval;
return (BLOCK_ERROR);
}
if (bmap)
ext2fs_mark_generic_bitmap(bmap, *blocknr);
return 0;
}
//Subfunction for "local_block_iterate3()" for recover the blocks of a real file
static int write_block ( ext2_filsys fs, blk64_t *blocknr, e2_blkcnt_t blockcnt,
blk64_t /*ref_blk*/x, int /*ref_offset*/y, void *priv )
{
int fd = ((struct privat*)priv)->fd;
char *charbuf =((struct privat*)priv)->buf;
__u32 nbytes;
errcode_t retval;
int blocksize = fs->blocksize;
if (*blocknr >= fs->super->s_blocks_count)
return BLOCK_ERROR;
#ifdef DEBUG
printf("%c",(ext2fs_test_block_bitmap ( fs->block_map, *blocknr ))? 'X' : 'O');
#endif
if (((struct privat*)priv)->flag){
int allocated = ext2fs_test_block_bitmap ( fs->block_map, *blocknr );
if ( allocated ){
// fprintf(stderr,"Block %10lu is allocated.\n",*blocknr);
((struct privat*)priv)->error = BLOCK_ABORT | BLOCK_ERROR ;
return (BLOCK_ABORT | BLOCK_ERROR);
}
}
retval = io_channel_read_blk ( fs->io, *blocknr, 1, charbuf );
if (retval){
((struct privat*)priv)->error = BLOCK_ERROR ;
return (BLOCK_ERROR);
}
if (bmap)
ext2fs_mark_generic_bitmap(bmap, *blocknr);
lseek(fd,(unsigned long long )blocksize * blockcnt, SEEK_SET);
nbytes = write(fd, charbuf, blocksize);
if ((unsigned) nbytes != blocksize){
fprintf(stderr, "Error while writing file\n");
((struct privat*)priv)->error = BLOCK_ERROR ;
return 8;
}
return retval;
}
//check if the target directory existent, (recursive function)
int check_dir(char* pathname){
char *buffer;
struct stat filestat;
char *p1;
int retval = 1;
if(! strlen(pathname))
return 1;
buffer = malloc(strlen(pathname) +3);
strcpy(buffer,pathname);
p1 = strrchr(buffer,'/');
if (p1)
*p1 = 0;
if (stat(buffer, &filestat) || (! S_ISDIR(filestat.st_mode)) ){ //&& (filestat.st_mode & S_IRWXU) == S_IRWXU))
if (! check_dir(buffer)) {
retval = mkdir(buffer,S_IRWXU);
}
}
else
retval = 0;
if(buffer) free(buffer);
return retval;
}
//subfunction for recover_file
static char* get_error_string(char* buf, int error){
int mask = 0x80;
int i;
for (i = 0; i< 8 ; i++){
*(buf+i) = (error & mask) ? '-' : 'X' ;
mask /= 2 ;
}
*(buf+i) = 0;
return buf;
}
// recover Datafile
int recover_file( char* des_dir,char* pathname, char* filename, struct ext2_inode *inode, ext2_ino_t inode_nr, int flag){
int rec_error = 255;
char err_string[9];
int retval =-1;
int hardlink = 0;
char i = 0;
char *buf=NULL;
struct privat priv;
struct stat filestat;
char *helpname = NULL;
char *recovername = NULL;
char *linkname = NULL;
char *p1;
unsigned long long i_size;
struct utimbuf touchtime;
mode_t i_mode;
int major, minor, type;
#ifdef DEBUG
printf("RECOVER : INODE=%ld FILENAME=%s/%s\n",inode_nr, pathname,filename);
dump_inode(stdout, "",inode_nr, (struct ext2_inode *)inode, 0);
#endif
if (!(inode->i_mode & LINUX_S_IFMT)) //no type flag - no recover
return 1;
p1 = pathname;
while (*p1 == '/') p1++;
helpname = malloc(strlen(des_dir) + 15);
recovername = malloc(strlen(des_dir) + strlen(pathname) + strlen(filename) +10);
if (helpname && recovername){
strcpy(helpname,des_dir);
strcat(helpname,"/");
strcpy(recovername,helpname);
strcat(recovername,p1);
if (strlen(p1))
strcat(recovername,"/");
strcat(recovername,filename);
while (!(stat(recovername, &filestat)) && (i<5)){
strcat(recovername,"#");
i++;
}
p1 = strchr(helpname,0);
sprintf(p1,"#%u#",inode_nr);
unlink (helpname);
priv.flag = flag;
//FIXME: hardlink
if (inode->i_links_count > 1){
p1 = check_link_stack(inode_nr, inode->i_generation);
if (p1) {
//hardlink found
if (! stat(p1, &filestat)){
retval = check_dir(recovername);
if (retval)
fprintf(stderr,"Unknown error at target directory by file: %s\ntrying to continue normal\n", recovername);
else {
if (! link(p1,recovername)){
if (match_link_stack(inode_nr, inode->i_generation))
rec_error -= CREATE_ERROR ;
goto out;
}
else{
rec_error -= CREATE_ERROR ;
}
}
}
}
else{
//flag as hardlink
hardlink = 1;
}
}
switch (inode->i_mode & LINUX_S_IFMT){
//regular File;
case LINUX_S_IFREG :
priv.fd = open(helpname, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, S_IRWXU);
if (! priv.fd ){
fprintf(stderr,"Error: open File %s for writing\n",helpname);
retval = errno;
goto errout;
}
buf=malloc(current_fs->blocksize);
if (buf) {
priv.buf = buf;
priv.error = 0;
// iterate Data Blocks and if not allocated, write to file
retval = local_block_iterate3 ( current_fs, *inode, BLOCK_FLAG_DATA_ONLY, NULL, write_block, &priv );
#ifdef DEBUG
printf("\n");
#endif
if (retval || priv.error){
// error or blocks allocated , we delete the tempfile and goto out
close(priv.fd);
unlink(helpname);
retval = -1;
goto errout;
}
else{
i_size = (unsigned long long)(inode->i_size | ((unsigned long long)inode->i_size_high << 32));
retval = ftruncate(priv.fd,i_size);
if (retval){
rec_error -= SEEK_ERROR ;
}
}
}
else {
fprintf(stderr,"ERROR: can no allocate memory\n");
retval = -1;
close(priv.fd);
goto errout;
}
close(priv.fd);
break;
//symbolic link
case LINUX_S_IFLNK :
if (ext2fs_inode_data_blocks(current_fs,inode)){
buf = malloc(current_fs->blocksize + 1);
if (buf) {
memset(buf,0,current_fs->blocksize + 1);
priv.buf = buf;
priv.error = 0;
retval = local_block_iterate3 ( current_fs, *inode, BLOCK_FLAG_DATA_ONLY, NULL, read_syslink_block, &priv );
if (retval || priv.error)
goto errout;
}
else {
fprintf(stderr,"ERROR: can no allocate memory\n");
retval = -1;
goto errout;
}
}
else {
int i;
if((! inode->i_size) || (inode->i_size >= 60))
goto errout;
buf = malloc(inode->i_size + 1);
linkname = (char*) &(inode->i_block[0]);
for (i = 0; i < inode->i_size ; i++){
*(buf+i) = (char) *linkname;
linkname++;
}
*(buf+i) = 0;
}
linkname = buf;
retval = symlink(linkname, helpname);
if (retval){
rec_error -= (CREATE_ERROR + SEEK_ERROR);
}
break;
//block or char device
case LINUX_S_IFBLK :
case LINUX_S_IFCHR :
type = (LINUX_S_ISBLK(inode->i_mode)) ? S_IFBLK : S_IFCHR ;
if (inode->i_block[0]) {
major = (inode->i_block[0] >> 8) & 255;
minor = inode->i_block[0] & 255;
} else {
major = (inode->i_block[1] & 0xfff00) >> 8;
minor = ((inode->i_block[1] & 0xff) |
((inode->i_block[1] >> 12) & 0xfff00));
}
retval = mknod(helpname, type ,makedev(major, minor));
if (retval){
rec_error -= (CREATE_ERROR + SEEK_ERROR);
}
break;
//fifo
case LINUX_S_IFIFO:
retval = mkfifo(helpname, S_IRWXU);
if (retval){
rec_error -= (CREATE_ERROR + SEEK_ERROR);
}
break;
//socket and not define
default:
retval = -1;
goto errout;
break;
} //end switch
retval = check_dir(recovername);
if (retval)
fprintf(stderr,"Unknown error at target directory by file: %s \ntrying to continue normal\n", recovername);
else {
retval = rename(helpname,recovername);
if (retval && (errno != EEXIST)){
rec_error -= MOVE_ERROR ;
}
if (! LINUX_S_ISLNK(inode->i_mode)){
retval = chown(recovername,inode_uid(*inode), inode_gid(*inode));
if (retval){
rec_error -= CHOWN_ERROR ;
}
i_mode = inode->i_mode & 07777;
retval = chmod(recovername,i_mode);
if (retval){
rec_error -= CHMOD_ERROR ;
}
touchtime.actime = inode->i_atime;
touchtime.modtime = inode->i_mtime;
retval = utime(recovername,&touchtime);
if (retval){
rec_error -= UTIME_ERROR ;
}
#ifdef FILE_ATTR
if( LINUX_S_ISREG(inode->i_mode)){
unsigned long flags = 0;
if (fgetflags(recovername, &flags) == -1) {
rec_error -= ATTRI_ERROR;
}
else {
if (fsetflags(recovername, flags | (inode->i_flags & FLAGS_MODIFIABLE )) == -1 ){
rec_error -= ATTRI_ERROR;
}
}
}
#endif
}
else {
retval = lchown (recovername, inode_uid(*inode), inode_gid(*inode));
if (retval){
rec_error -= CHOWN_ERROR ;
}
}
}
if ((hardlink) && (rec_error & SEEK_ERROR ))
add_link_stack(inode_nr, inode->i_links_count, recovername,inode->i_generation );
out:
printf("%s %s\n",get_error_string(err_string,rec_error),recovername);
errout:
if(buf) free(buf);
if (helpname) free(helpname);
if (recovername) free(recovername);
} //helpname
return retval;
}
// check inode; return true if blocks not allocated and not recovered
int check_file_stat(struct ext2_inode *inode){
int retval =-1;
struct alloc_recover_stat stat;
if (!(inode->i_mode & LINUX_S_IFMT)) // no type flag
return 0;
stat.allocated = 0;
stat.recovered = 0;
if ((! inode->i_blocks) || (LINUX_S_ISLNK(inode->i_mode) && (inode->i_size < EXT2_N_BLOCKS*4)) ||
! (ext2fs_inode_data_blocks(current_fs,inode)))
retval = 1;
else{
retval = local_block_iterate3 ( current_fs, *inode, BLOCK_FLAG_DATA_ONLY, NULL, check_block_stat, &stat );
if ( retval ) return 0;
retval = ((! stat.allocated) && (! stat.recovered)) ? 1 : 0 ;
}
return retval;
}
// check Datafile return the percentage of not allocated blocks
int check_file_recover(struct ext2_inode *inode){
int retval =-1;
struct alloc_stat stat;
if (!(inode->i_mode & LINUX_S_IFMT)) // no type flag
return 0;
stat.allocated = 0;
stat.not_allocated = 0;
if ((! inode->i_blocks) || (LINUX_S_ISLNK(inode->i_mode) && (inode->i_size < EXT2_N_BLOCKS*4)) ||
! (ext2fs_inode_data_blocks(current_fs,inode)))
retval = 100;
else{
retval = local_block_iterate3 ( current_fs, *inode, BLOCK_FLAG_DATA_ONLY, NULL, check_block, &stat );
if ( retval ) return 0;
if (stat.not_allocated)
retval = ((stat.not_allocated * 100) / (stat.allocated + stat.not_allocated));
}
return retval;
}
//set all attributes for directory
void set_dir_attributes(char* des_dir,char* pathname,struct ext2_inode *inode){
char *fullname;
char *p1;
char err_string[9];
int retval, rec_error = 255;
mode_t i_mode;
struct stat filestat;
struct utimbuf touchtime;
#ifdef FILE_ATTR
unsigned long flags = 0 ;
#endif
fullname = malloc(strlen(des_dir) + strlen(pathname) + 3);
if (fullname){
p1 = pathname;
while (*p1 == '/') p1++;
strcpy(fullname,des_dir);
strcat(fullname,"/");
strcat(fullname,p1);
retval = check_dir(fullname);
if ( stat(fullname, &filestat)){
retval = mkdir(fullname,S_IRWXU);
if (retval)
rec_error -= (CREATE_ERROR + SEEK_ERROR);
}
retval = chown(fullname,inode_uid(*inode), inode_gid(*inode));
if (retval){
rec_error -= CHOWN_ERROR ;
}
i_mode = inode->i_mode & 07777;
retval = chmod(fullname,i_mode);
if (retval){
rec_error -= CHMOD_ERROR ;
}
touchtime.actime = inode->i_atime;
touchtime.modtime = inode->i_mtime;
retval = utime(fullname,&touchtime);
if (retval){
rec_error -= UTIME_ERROR ;
}
#ifdef FILE_ATTR
if (fgetflags(fullname, &flags) == -1) {
rec_error -= ATTRI_ERROR;
}
else {
if (fsetflags(fullname, flags | (inode->i_flags & FLAGS_MODIFIABLE )) == -1 ){
rec_error -= ATTRI_ERROR;
}
}
#endif
printf("%s %s\n",get_error_string(err_string,rec_error),fullname);
free(fullname);
}
}
|
orochi/ext4magic
|
src/recover.c
|
C++
|
mit
| 17,720 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
// A special doubly linked ringbuffer for manage journalinode
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include "ring_buf.h"
r_item* r_item_new(int i_size){
r_item* this = NULL;
this = (r_item*) malloc(sizeof(r_item)) ;
if (! this) return NULL;
this->prev = this;
this->next = this;
this->transaction.start = 0;
this->transaction.end = 0;
this->inode = (struct ext2_inode_large*) malloc(i_size);
if (! this->inode ) {
free(this);
return NULL;
}
return this;
};
struct ring_buf* ring_new(int i_size, __u32 nr){
struct ring_buf *head;
head = (struct ring_buf*) malloc(sizeof(struct ring_buf));
if (! head ) return NULL;
head->count = 0;
head->del_flag = 0;
head->reuse_flag = 0;
head->i_size = i_size;
head->nr = nr;
return head;
};
r_item* r_item_add(struct ring_buf *head){
r_item* item = r_item_new(head->i_size);
if (item) {
if (! head->count) { head->begin = item;}
else {
item->next = head->begin;
item->prev = head->begin->prev;
head->begin->prev->next = item;
head->begin->prev = item;
}
head->count++;
// item->transaction = *trans;
}
return item;
};
void ring_del(struct ring_buf *head){
r_item* item;
r_item* old;
old = NULL;
if (head->count){
item = head->begin->next;
head->begin->next = NULL;
while (item){
if (item->inode) free(item->inode);
old = item;
item = item->next;
free(old);
}
}
free(head);
head = NULL;
};
r_item* r_begin(struct ring_buf *head){
if (head->count > 1)
while (head->begin->inode->i_ctime > head->begin->prev->inode->i_ctime)
head->begin = head->begin->prev ;
return head->begin;
}
|
orochi/ext4magic
|
src/ring_buf.c
|
C++
|
mit
| 2,969 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
// A special doubly linked ringbuffer for manage journalinode
#ifndef RING_BUF_H
#define RING_BUF_H
/* ext3/4 libraries */
#include <ext2fs/ext2fs.h>
typedef struct transaction_range{
__u32 start;
__u32 end;
} trans_range_t;
struct ring_buf_item {
struct ring_buf_item *prev;
struct ring_buf_item *next;
struct ext2_inode_large *inode;
trans_range_t transaction;
};
struct ring_buf {
struct ring_buf_item * begin;
int count;
int i_size;
__u32 nr;
char del_flag;
char reuse_flag;
};
typedef struct ring_buf_item r_item;
static inline r_item* r_first(struct ring_buf *head){
return (head->count) ? head->begin : NULL ;}
static inline r_item* r_last(struct ring_buf *head){
return (head->count) ? head->begin->prev : NULL ; }
static inline r_item* r_next(r_item *item){
return item->next;}
static inline r_item* r_prev(r_item *item){
return item->prev;}
static inline int r_get_count(struct ring_buf *head){
return head->count;}
r_item* r_item_new( int );
struct ring_buf* ring_new( int , __u32);
r_item* r_item_add(struct ring_buf*);
void ring_del(struct ring_buf*);
r_item* r_begin(struct ring_buf*);
#endif
|
orochi/ext4magic
|
src/ring_buf.h
|
C++
|
mit
| 2,450 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <time.h>
/* ext3/4 libraries */
#include <ext2fs/ext2fs.h>
#include <e2p/e2p.h>
#include "util.h"
#include "ext2fsP.h"
#include "block.h"
#include "inode.h"
// default maxcount for histrogram
#define HIST_COUNT 10
extern ext2_filsys current_fs;
static struct inode_nr_collect *collect ;
// privat struct for histogram
struct time_counter{
__u32 time;
__u32 c_count;
__u32 d_count;
__u32 cr_count;
};
//Sub function for print header for histogram
static void dump_hist_header(char* type, __u32 after){
fprintf(stdout,"|-----------%s----------------- after -------------------- %s",type,time_to_string(after));
return;
}
//Sub function for print the histogram
static void dump_hist(struct time_counter* p_hist, int cm, __u32 after, __u32 befor , __u16 crt_found ){
int i,j ;
float x, step = 10.1 ;
// FIXME: this function can optimize
// c_time
dump_hist_header("c_time Histogram",after);
for (i=1;i <= cm ;i++) if (step < (p_hist+i)->c_count) step = (p_hist+i)->c_count;
step = step / 50;
for (i=1;i <= cm ;i++){
fprintf(stdout,"%10lu : %8lu |", (long unsigned int)(p_hist+i)->time , (long unsigned int)(p_hist+i)->c_count);
for (j = 0,x = (p_hist+i)->c_count/50 ; j < 50 ; j++, x+=step )
fprintf(stdout,"%c",(x<(p_hist+i)->c_count) ? '*' : ' ');
fprintf(stdout,"| %s", time_to_string((__u32)(p_hist+i)->time));
}
// d_time
fprintf(stdout,"\n\n");
dump_hist_header("d_time Histogram",after);
step = 10.1 ;
for (i=1;i <= cm ;i++) if (step < (p_hist+i)->d_count) step = (p_hist+i)->d_count;
step = step / 50;
for (i=1;i <= cm ;i++){
fprintf(stdout,"%10lu : %8lu |", (long unsigned int)(p_hist+i)->time , (long unsigned int)(p_hist+i)->d_count);
for (j = 0,x = (p_hist+i)->d_count/50 ; j < 50 ; j++, x+=step )
fprintf(stdout,"%c",(x<(p_hist+i)->d_count) ? '*' : ' ');
fprintf(stdout,"| %s", time_to_string((__u32)(p_hist+i)->time));
}
// cr_time
if (crt_found){
fprintf(stdout,"\n\n");
dump_hist_header("cr_time Histogram",after);
step = 10.1 ;
for (i=1;i <= cm ;i++) if (step < (p_hist+i)->cr_count) step = (p_hist+i)->cr_count;
step = step / 50;
for (i=1;i <= cm ;i++){
fprintf(stdout,"%10lu : %8lu |", (long unsigned int)(p_hist+i)->time , (long unsigned int)(p_hist+i)->cr_count);
for (j = 0,x = (p_hist+i)->cr_count/50 ; j < 50 ; j++, x+=step )
fprintf(stdout,"%c",(x<(p_hist+i)->cr_count) ? '*' : ' ');
fprintf(stdout,"| %s", time_to_string((__u32)(p_hist+i)->time));
}
}
return;
}
// analyse and print time stamp of all fs inode (histogram function)
void read_all_inode_time(ext2_filsys fs, __u32 t_after, __u32 t_before, int flag)
{
struct ext2_group_desc *gdp;
char *buf= NULL;
int x, j, cm, zero_flag, retval;
__u32 blocksize , inodesize , inode_max , inode_per_group, block_count;
__u32 inode_per_block , inode_block_group, group;
blk_t block_nr;
__u32 i, c_time, d_time, cr_time;
struct ext2_inode_large *inode;
__u16 crt_found = 0;
cm = (flag) ? 2*HIST_COUNT : HIST_COUNT ;
struct time_counter hist[(HIST_COUNT * 2)+1];
for (i = 0 ; i<= cm; i++){
hist[i].c_count = 0;
hist[i].d_count = 0;
hist[i].cr_count = 0;
hist[i].time = ((t_before - t_after)/ cm * i) + t_after;
}
blocksize = fs->blocksize;
inodesize = fs->super->s_inode_size;
inode_max = fs->super->s_inodes_count;
inode_per_group = fs->super->s_inodes_per_group;
buf = malloc(blocksize);
inode_per_block = blocksize / inodesize;
inode_block_group = inode_per_group / inode_per_block;
for (group = 0 ; group < fs->group_desc_count ; group++){
#ifdef EXT2_FLAG_64BITS
gdp = ext2fs_group_desc(current_fs, current_fs->group_desc, group);
#else
gdp = ¤t_fs->group_desc[group];
#endif
zero_flag = 0;
// NEXT GROUP IF INODE NOT INIT
if (gdp->bg_flags & (EXT2_BG_INODE_UNINIT)) continue;
// SET ZERO-FLAG IF FREE INODES == INODE/GROUP for fast ext3
if (gdp->bg_free_inodes_count == inode_per_group) zero_flag = 1;
//FIXME for struct ext4_group_desc 48/64BIT
for (block_nr = gdp->bg_inode_table , block_count = 0 ;
block_nr < (gdp->bg_inode_table + inode_block_group); block_nr++, block_count++) {
// break if the first block only zero inode
if ((block_count ==1) && (zero_flag == (inode_per_block + 1))) break;
retval = read_block ( fs , &block_nr , buf);
if (retval) return;
for (i = (group * inode_per_group)+(block_count * inode_per_block) + 1 ,x = 0;
x < inode_per_block ; i++ , x++){
if (i >= inode_max) break;
inode = (struct ext2_inode_large*) (buf + (x*inodesize));
c_time = ext2fs_le32_to_cpu(inode->i_ctime);
if (! c_time) {
if(zero_flag) zero_flag++ ;
continue;
}
d_time = ext2fs_le32_to_cpu(inode->i_dtime);
//FIXME for bigendian
cr_time = ((inodesize > EXT2_GOOD_OLD_INODE_SIZE) && (ext2fs_le16_to_cpu(inode->i_extra_isize) >= 24)) ?
ext2fs_le32_to_cpu(inode->i_crtime) : 0 ;
for (j=1;j <= cm ; j++){
if ((d_time <= hist[j].time) && (d_time > hist[j-1].time)){
hist[j].d_count++;
break;
}
if (cr_time){
if ((cr_time <= hist[j].time) && (cr_time > hist[j-1].time)){
hist[j].cr_count++;
crt_found = 1;
cr_time = 0 ;
}
}
if ((c_time <= hist[j].time) && (c_time > hist[j-1].time)){
hist[j].c_count++;
break;
}
}
}
}
}
dump_hist(hist, cm, t_after, t_before, crt_found);
if(buf) {
free(buf);
buf = NULL;
}
return;
}
// print the history of collectlist
void print_coll_list(__u32 t_after, __u32 t_before, int flag){
int j, cm;
__u32 c_time, d_time, cr_time;
ext2_ino_t i;
ext2_ino_t *pointer;
char inode_buf[256];
struct ext2_inode_large *inode = (struct ext2_inode_large *)inode_buf;
__u16 crt_found = 0;
int inode_size = EXT2_INODE_SIZE(current_fs->super);
if (collect && collect->count){
cm = (flag) ? 2*HIST_COUNT : HIST_COUNT ;
struct time_counter hist[(HIST_COUNT * 2)+1];
for (i = 0 ; i<= cm; i++){
hist[i].c_count = 0;
hist[i].d_count = 0;
hist[i].cr_count = 0;
hist[i].time = ((t_before - t_after)/ cm * i) + t_after;
}
pointer = collect->list;
for (i = 0; i < collect->count; i++ ,pointer++){
intern_read_inode_full(*pointer, (struct ext2_inode*)inode_buf , (inode_size > 256) ? 256 : inode_size );
c_time = inode->i_ctime;
d_time = inode->i_dtime;
cr_time = ((inode_size > EXT2_GOOD_OLD_INODE_SIZE) && (inode->i_extra_isize >= 24)) ? inode->i_crtime : 0 ;
for (j=1;j <= cm ; j++){
if ((d_time < hist[j].time) && (d_time > hist[j-1].time)){
hist[j].d_count++;
break;
}
if (cr_time){
if ((cr_time < hist[j].time) && (cr_time > hist[j-1].time)){
hist[j].cr_count++;
crt_found = 1;
cr_time = 0 ;
}
}
if ((c_time < hist[j].time) && (c_time > hist[j-1].time)){
hist[j].c_count++;
break;
}
}
}
dump_hist(hist, cm, t_after, t_before, crt_found);
if (collect->list) free(collect->list);
if (collect){
free(collect);
collect = NULL;
}
}
return;
}
// search for a time before the last big delete job
__u32 get_last_delete_time(ext2_filsys fs)
{
struct ext2_group_desc *gdp;
char *buf= NULL;
int zero_flag, x;
__u32 blocksize , inodesize , inode_max , inode_per_group, block_count;
__u32 inode_per_block , inode_block_group, group;
blk_t block_nr;
__u32 i, c_time, d_time;
__u32 last = 0;
__u32 first = 0;
int flag;
struct ext2_inode_large *inode;
blocksize = fs->blocksize;
inodesize = fs->super->s_inode_size;
inode_max = fs->super->s_inodes_count;
inode_per_group = fs->super->s_inodes_per_group;
buf = malloc(blocksize);
inode_per_block = blocksize / inodesize;
inode_block_group = inode_per_group / inode_per_block;
for (flag=0;flag<2;flag++){
for (group = 0 ; group < fs->group_desc_count ; group++){
#ifdef EXT2_FLAG_64BITS
gdp = ext2fs_group_desc(current_fs, current_fs->group_desc, group);
#else
gdp = ¤t_fs->group_desc[group];
#endif
zero_flag = 0;
// NEXT GROUP IF INODE NOT INIT
if (gdp->bg_flags & (EXT2_BG_INODE_UNINIT)) continue;
// SET ZERO-FLAG IF FREE INODES == INODE/GROUP for fast ext3
if (gdp->bg_free_inodes_count == inode_per_group) zero_flag = 1;
for (block_nr = gdp->bg_inode_table , block_count = 0 ;
block_nr < (gdp->bg_inode_table + inode_block_group); block_nr++, block_count++) {
// break if the first block only zero inode
if ((block_count ==1) && (zero_flag == (inode_per_block + 1))) break;
if ( read_block ( fs , &block_nr , buf))
return 0;
for (i = (group * inode_per_group)+(block_count * inode_per_block) + 1 ,x = 0;
x < inode_per_block ; i++ , x++){
if (i >= inode_max) break;
inode = (struct ext2_inode_large*) (buf + (x*inodesize));
c_time = ext2fs_le32_to_cpu(inode->i_ctime);
if (! c_time) {
if(zero_flag) zero_flag++ ;
continue;
}
d_time = ext2fs_le32_to_cpu(inode->i_dtime);
if (flag){
if ((d_time > (last-300)) && (d_time < first))
first = d_time;
}
else{
if (d_time > last){
last = d_time;
}
}
}
}
}
if(!flag) first = last;
}
if(buf) {
free(buf);
buf = NULL;
}
if (! first) fprintf(stderr,"Warning: No time window found, because no found a deleted inode\n");
return first - 1 ;
}
// add inodenumber in a collectlist
void add_coll_list(ext2_ino_t ino_nr ){
ext2_ino_t *pointer;
ext2_ino_t i;
if (!collect){
collect = malloc(sizeof(struct inode_nr_collect));
collect->list = malloc(ALLOC_SIZE * sizeof(ext2_ino_t));
if (!collect->list){
free(collect);
fprintf(stderr,"ERROR : can not allocate memory\n");
return ;
}
collect->count = 0;
}
pointer = collect->list;
for ( i = 0 ; i < collect->count; i++, pointer++ ){
if (*pointer == ino_nr)
return ;
}
if ( i && (! (i % ALLOC_SIZE ))) {
// we must allocate more memory now
pointer = malloc((collect->count + ALLOC_SIZE +1) *sizeof(ext2_ino_t));
if (!pointer){
fprintf(stderr,"ERROR : can not allocate memory\n");
return;
}
memcpy(pointer,collect->list,(collect->count *sizeof(ext2_ino_t)));
free(collect->list);
collect->list = pointer;
}
*((collect->list) + i) = ino_nr;
collect->count++ ;
return;
}
//hexdump of block or data
void blockhex (FILE *out_file, void *buf, int flag, int blocksize)
{
int i,j;
int *intp;
char *charp_0 , *charp_1 ;
unsigned char c;
intp = (int *) buf;
charp_0 = (char *) buf;
charp_1 = (char *) buf;
for (i=0; i<blocksize; i+=16) {
fprintf(out_file, " %04x: ", i);
if (flag) for (j=0; j<16; j+=4) fprintf(out_file, "%08x ", *intp++);
else
for (j=0; j<16; j++) fprintf(out_file, "%02x ", 0xff & *charp_0++);
fprintf(out_file, " ");
for (j=0; j<16; j++) {
c = *charp_1++;
if (c < ' ' || c >= 127)
c = '.';
fprintf(out_file, "%c", c);
}
fprintf(out_file, "\n");
}
}
//get inode type
char get_inode_mode_type( __u16 i_mode)
{
char type;
if (LINUX_S_ISDIR(i_mode)) type = 'd';
else if (LINUX_S_ISREG(i_mode)) type = '_';
else if (LINUX_S_ISLNK(i_mode)) type = 'l';
else if (LINUX_S_ISBLK(i_mode)) type = 'b';
else if (LINUX_S_ISCHR(i_mode)) type = 'c';
else if (LINUX_S_ISFIFO(i_mode)) type = 'f';
else if (LINUX_S_ISSOCK(i_mode)) type = 's';
else type = ' ';
return type;
}
/*
* This function takes a __u32 time value and converts it to a string,
* using ctime
*/
char *time_to_string(__u32 cl)
{
static int do_gmt = -1;
time_t t = (time_t) cl;
const char *tz;
if (do_gmt == -1) {
/* The diet libc doesn't respect the TZ environemnt variable */
tz = getenv("TZ");
if (!tz)
tz = "";
do_gmt = !strcmp(tz, "GMT");
}
return asctime((do_gmt) ? gmtime(&t) : localtime(&t));
}
/*
* This routine returns 1 if the filesystem is not open, and prints an
* error message to that effect.
*/
int check_fs_open(char *name)
{
if (!current_fs) {
fprintf(stderr, "Filesystem not open\n");
return 1;
}
return 0;
}
/*
* This function resets the libc getopt() function, which keeps
* internal state. Bad design! Stupid libc API designers! No
* biscuit!
*
* BSD-derived getopt() functions require that optind be reset to 1 in
* order to reset getopt() state. This used to be generally accepted
* way of resetting getopt(). However, glibc's getopt()
* has additional getopt() state beyond optind, and requires that
* optind be set zero to reset its state. So the unfortunate state of
* affairs is that BSD-derived versions of getopt() misbehave if
* optind is set to 0 in order to reset getopt(), and glibc's getopt()
* will core dump if optind is set 1 in order to reset getopt().
*
* More modern versions of BSD require that optreset be set to 1 in
* order to reset getopt(). Sigh. Standards, anyone?
*
* We hide the hair here.
*/
void reset_getopt(void)
{
#if defined(__GLIBC__) || defined(__linux__)
optind = 0;
#else
optind = 1;
#endif
#ifdef HAVE_OPTRESET
optreset = 1; /* Makes BSD getopt happy */
#endif
}
//function for check argument by optarg
unsigned long parse_ulong(const char *str, const char *cmd,
const char *descr, int *err)
{
char *tmp;
unsigned long ret;
ret = strtoul(str, &tmp, 0);
if (*tmp == 0) {
if (err)
*err = 0;
return ret;
}
fprintf(stderr, "Bad %s - %s\n", descr, str);
if (err)
*err = 1;
else
exit(1);
return 0;
}
extern ext2fs_block_bitmap d_bmap;
void get_nblock_len(char *buf, blk_t *blk, __u64 *p_len){
(*blk)++;
*p_len += current_fs->blocksize ;
return;
}
int get_ind_block_len(char *buf, blk_t *blk, blk_t *last ,blk_t *next, __u64 *p_len){
int i = (current_fs->blocksize >> 2)- 1;
char *priv_buf = NULL;
blk_t block = 0;
blk_t *p_block;
int flag = 0;
priv_buf = malloc(current_fs->blocksize);
if (! priv_buf){
fprintf(stderr,"can not allocate memory\n");
return 0;
}
p_block = (blk_t*)buf;
p_block += i;
while ( i >=0 ){
block = ext2fs_le32_to_cpu(*p_block);
if (! block){
i--;
p_block-- ;
flag++;
}
else break;
}
if ((block >= current_fs->super->s_blocks_count) ||
(!ext2fs_test_block_bitmap(d_bmap,block)) || (io_channel_read_blk ( current_fs->io, block, 1, priv_buf ))){
// fprintf(stderr,"ERROR: while read block %10u\n",block);
return 0;
}
*next = (flag) ? 0 : block+1 ;
*last = block;
get_nblock_len(priv_buf, blk, p_len);
*p_len += (i * (current_fs->blocksize)) ;
*blk += (i + 1) ;
free(priv_buf);
return 1;
}
int get_dind_block_len(char *buf, blk_t *blk, blk_t *last, blk_t *next, __u64 *p_len){
int ret = 0;
int i = (current_fs->blocksize >> 2)- 1;
char *priv_buf = NULL;
blk_t block = 0;
blk_t *p_block;
priv_buf = malloc(current_fs->blocksize);
if (! priv_buf){
fprintf(stderr,"can not allocate memory\n");
return 0;
}
p_block = (blk_t*)buf;
p_block += i;
while ( i >=0 ){
block = ext2fs_le32_to_cpu(*p_block);
if (! block){
i--;
p_block-- ;
}
else break;
}
if ((block >= current_fs->super->s_blocks_count) ||
(!ext2fs_test_block_bitmap(d_bmap,block)) || (io_channel_read_blk ( current_fs->io, block, 1, priv_buf ))){
// fprintf(stderr,"ERROR: while read ind-block %10u\n",block);
return 0;
}
ret = get_ind_block_len(priv_buf, blk, last, next, p_len);
if (ret){
*p_len += (i * current_fs->blocksize * (current_fs->blocksize >>2) ) ;
*next = ( i == ((current_fs->blocksize >> 2)- 1)) ? *next : 0 ;
*blk += ((i * ((current_fs->blocksize >>2) + 1)) + 1) ;
}
free(priv_buf);
return ret ;
}
int get_tind_block_len(char *buf, blk_t *blk, blk_t *last, blk_t *next, __u64 *p_len){
int ret = 0;
int i = (current_fs->blocksize >> 2)- 1;
char *priv_buf = NULL;
blk_t block = 0;
blk_t *p_block;
priv_buf = malloc(current_fs->blocksize);
if (! priv_buf){
fprintf(stderr,"can not allocate memory\n");
return 0 ;
}
p_block = (blk_t*)buf;
p_block += i;
while ( i >=0 ){
block = ext2fs_le32_to_cpu(*p_block);
if (! block){
i--;
p_block-- ;
}
else break;
}
if ((block >= current_fs->super->s_blocks_count) ||
(ext2fs_test_block_bitmap(bmap,block)) ||(io_channel_read_blk ( current_fs->io, block, 1, priv_buf ))){
// fprintf(stderr,"ERROR: while read dind-block %10u\n",block);
return 0;
}
ret = get_dind_block_len(priv_buf, blk, last, next,p_len);
if (ret){
*p_len += (i * current_fs->blocksize * (current_fs->blocksize >>2) * (current_fs->blocksize >>2) ) ;
*blk += ((i * ((current_fs->blocksize >>2) + 1) * (current_fs->blocksize >>2)) + 1) ;
*next = 0;
}
free(priv_buf);
return ret;
}
int zero_space(unsigned char *buf, __u32 offset){
__u32 i=offset;// +1;
__u32 end = (i)?((i + (current_fs->blocksize-1)) & ~(current_fs->blocksize-1)) : (i+current_fs->blocksize) ;
while ((i<end) && (!buf[i]))
i++;
return (i == end ) ? 1 : 0 ;
}
int is_unicode( unsigned char* buf){
int ret = 0;
unsigned char *p = buf;
unsigned char *p1 = buf +1;
if ((*p > 0xc1) && (*p < 0xf5) && (*p1 > 0x7f) && (*p1 < 0xc0)){
if (!(*p & 0x20))
ret = 2;
else{
p1++;
if ((!(*p & 0x10)) && (*p1 > 0x7f) && (*p1 < 0xc0))
ret = 3 ;
else{
p1++;
if ((!(*p & 0x08)) && (*p1 > 0x7f) && (*p1 < 0xc0))
ret = 4 ;
}
}
}
return ret;
}
|
orochi/ext4magic
|
src/util.c
|
C++
|
mit
| 19,268 |
/***************************************************************************
* Copyright (C) 2010 by Roberto Maar *
* robi6@users.sf.net *
* *
* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef UTIL_H
#define UTIL_H
//status for control flag list-functions
#define LONG_OPT 0x0001
#define DELETED_OPT 0x0002
#define PARSE_OPT 0x0004
#define ONLY_JOURNAL 0x0008
#define DELETED_DIR 0x0010
#define SKIP_HTREE 0x0020
// control flags for recover- and listmodus
#define DOUPLE_QUOTES_LIST 0x0100
#define LOST_DIR_SEARCH 0x0400
#define LIST_ALL 0x1000
#define LIST_STATUS 0x2000
#define RECOV_DEL 0x4000
#define RECOV_ALL 0x8000
#define HIST_DIR 0x0800
#define REC_FILTER 0xF800
#define REC_DIR_NEEDED (RECOV_ALL | RECOV_DEL)
//Definitions to magic scan functions
#define M_SIZE 0x00003FFF
#define M_BLANK 0x00010000
#define M_DATA 0x00020000
#define M_TXT 0x00040000
#define M_IMAGE 0x00080000
#define M_AUDIO 0x00100000
#define M_VIDEO 0x00200000
#define M_APPLI 0x00400000
#define M_MESSAGE 0x00800000
#define M_MODEL 0x00004000
#define M_TAR 0x00008000
#define M_IS_FILE 0x00FC4000
#define M_IS_DATA 0x00030000
#define M_BINARY 0x01000000
#define M_CLASS_1 0x02000000
#define M_CLASS_2 0x04000000
#define M_IS_CLASS 0x06000000
#define M_ARCHIV 0x08000000
#define M_ACL 0x80000000
#define M_EXT4_META 0x40000000
#define M_EXT3_META 0x20000000
#define M_DIR 0x10000000
#define M_IS_META 0xF0000000
#define FORCE_RECOVER 0x1000
#define DATA_X64 0x8000
#define DATA_BIG_END 0x4000
#define DATA_FLAG 0x2000
#define H_F_Carving 0x1000
#define DATA_CARVING 0x0100
#define DATA_LENGTH 0x0200
#define DATA_MIN_LENGTH 0x0204
#define DATA_NO_FOOT 0x0020
#define DATA_METABLOCK 0x0010
#define DATA_ELEMENT 0x0008
#define DATA_MINIMUM 0x0004
#define DATA_BREAK 0x0002
#define DATA_READY 0x0001
//#define RESERVE_FILETYPE 0xF0000000
#include "ring_buf.h"
#include "dir_list.h"
//struct for iterate directory
struct priv_dir_iterate_struct {
// char *name;
// char *path;
__u32 time_stamp;
// ext2_ino_t *found_inode;
// int col;
int options;
struct dir_list_head_t *dir_list;
//FIXME;
trans_range_t *transaction;
};
//struct for inode position
struct inode_pos_struct {
blk_t block;
int offset;
int size;
};
//struct for a simple inodenumberlist
struct inode_nr_collect{
ext2_ino_t count;
ext2_ino_t *list;
};
//struct for generic bitmap
/*
struct ext2fs_struct_loc64_generic_bitmap {
errcode_t magic;
ext2_filsys fs;
struct ext2_bitmap_ops *bitmap_ops;
int flags;
__u64 start, end;
__u64 real_end;
int cluster_bits;
char *description;
void *private;
errcode_t base_error_code;
};*/
struct ext2fs_struct_loc_generic_bitmap {
errcode_t magic;
ext2_filsys fs;
__u32 start, end;
__u32 real_end;
char * description;
unsigned char *bitmap;
errcode_t base_error_code;
__u32 reserved[7];
};
//struct for collect data for magic_scan recover
struct found_data_t{
blk_t first;
blk_t last;
__u32 buf_length;
__u32 next_offset;
__u32 last_match_blk;
int scantype;
__u32 size;
__u32 h_size;
__u16 priv_len;
int (*func)(unsigned char*, int*, __u32, int, struct found_data_t*);
__u32 scan;
__u32 type;
char *scan_result;
char *name;
struct ext2_inode_large *inode;
void *priv;
};
#define ALLOC_SIZE 1024
extern ext2fs_inode_bitmap imap ;
extern ext2fs_block_bitmap bmap ;
// public functions util.c
void read_all_inode_time(ext2_filsys , __u32 , __u32 , int ); //analyse an print histogram
void print_coll_list(__u32, __u32, int); //print the history of collectlist
void add_coll_list(ext2_ino_t );// add inodenumber in a collectlist
void blockhex (FILE* , void*, int , int); //hexdump
char get_inode_mode_type( __u16); //get filetype of inode
int get_ind_block_len(char*, blk_t*, blk_t*,blk_t*, __u64*);
int get_dind_block_len(char*, blk_t*, blk_t*, blk_t*, __u64*);
int get_tind_block_len(char*, blk_t*, blk_t*, blk_t*, __u64*);
//public helper functions util.c
char *time_to_string(__u32);
__u32 get_last_delete_time(ext2_filsys);
int check_fs_open(char*);
void reset_getopt(void);
unsigned long parse_ulong(const char* , const char* , const char* , int* );
int zero_space(unsigned char*, __u32 );
int is_unicode( unsigned char* );
// public functions lookup_local.c
void list_dir(ext2_ino_t inode); //list dir (using normal functions from ext2fs)
void list_dir2(ext2_ino_t, struct ext2_inode*); //list dir (search in journal ; not automatical use the real inode from fs)
void list_dir3(ext2_ino_t, struct ext2_inode*, trans_range_t* ,__u32 ); //list (search over journal; both inode as well journaldirblocks)
struct dir_list_head_t* get_dir3(struct ext2_inode*,ext2_ino_t, ext2_ino_t,char*, char*,__u32,__u32,int ); //directory finder
void lookup_local(char*, struct dir_list_head_t*, __u32 , __u32 , int ); // main worker function for recover and list
ext2_ino_t local_namei(struct dir_list_head_t*, char* , __u32, __u32, int);// search the Inode for an pathname (use journal data)
//public functions recover.c
void recover_list(char*, char*,__u32, __u32, int); // recover files from a "double quotes" listfile
int recover_file( char* ,char* , char* , struct ext2_inode* , ext2_ino_t, int); //recover all filetypes
int check_file_stat(struct ext2_inode*); //check inode; return true if blocks not allocated and not recovered
int check_file_recover(struct ext2_inode*); // return percentage of not allocated blocks
void set_dir_attributes(char* ,char* ,struct ext2_inode*); //set owner,file mode bits an timestamps for directory
int check_dir(char*);//check if the target directory existent
//public functions imap_search.c
void imap_search(char* , __u32, __u32 ,int ); // search inode by imap (step1 + step2)
int check_find_dir(char*, ext2_ino_t, char*, char*); //check if the directory always recovert; then move
//public function file_type.c
//none #do not recover this
int file_none(unsigned char*, int*, __u32, int, struct found_data_t*); //do not recover this
int ident_file(struct found_data_t*, __u32*, char*, void*); // index of the files corresponding magic result strings
void get_file_property(struct found_data_t*); //set the file properties and the extension
//public functions magic_block_scan.c
struct found_data_t* free_file_data(struct found_data_t*); //clear + free found_data
int magic_block_scan3(char*, __u32);//main of the magic_scan_engine for ext3
//functions in develop
int magic_block_scan4(char*, __u32);//main of the magic_scan_engine for ext4
#endif
|
orochi/ext4magic
|
src/util.h
|
C++
|
mit
| 8,039 |
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
|
Mewtopian/rjw
|
.gitattributes
|
Git
|
mit
| 2,518 |
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
project.fragment.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
#*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
/Archived
/MyTo-Do.txt
/LL_post.txt
/creditsnew.txt
/Assemblies/UnityEngine.UI.dll
/Assemblies/UnityEngine.dll
/Assemblies/TextMeshPro-1.0.55.56.0b11.dll
/Assemblies/NVorbis.dll
/Assemblies/NAudio.dll
/Assemblies/HugsLib.dll
/Assemblies/Assembly-CSharp.dll
/Assemblies/Assembly-CSharp-firstpass.dll
/Assemblies/0Harmony.dll
/RimJobWorld.Main.sln
*.csproj
/.gitignore
|
Mewtopian/rjw
|
.gitignore
|
Git
|
mit
| 4,673 |
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>RimJobWorld</name>
<author>Ed86</author>
<url>https://gitgud.io/Ed86/rjw</url>
<supportedVersions>
<li>1.0</li>
</supportedVersions>
<description>
M for Mature
Load mod at bottom of mod list:
Core
HugsLib
++Mods
RimJobWorld
RJW_Ex
Support dev: https://www.patreon.com/Ed86
Forum: https://www.loverslab.com/files/file/7257-rimjobworld/
Discord: https://discord.gg/CXwHhv8
</description>
</ModMetaData>
|
Mewtopian/rjw
|
About/About.xml
|
XML
|
mit
| 477 |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
<identifier>RimJobWorld</identifier>
<version>2.7.2</version>
<dependencies>
<li>HugsLib</li>
</dependencies>
<incompatibleWith />
<loadAfter>
<li>HugsLib</li>
</loadAfter>
<suggests>
</suggests>
<manifestUri>https://gitgud.io/Ed86/rjw/raw/master/About/Manifest.xml</manifestUri>
<downloadUri>https://gitgud.io/Ed86/rjw</downloadUri>
</Manifest>
|
Mewtopian/rjw
|
About/Manifest.xml
|
XML
|
mit
| 427 |
<?xml version="1.0" encoding="utf-8"?>
<ModSyncNinjaData>
<ID>090d467a-1532-4867-b0c0-55585c5f5148</ID>
<ModName>RimJobWorld</ModName>
<Version>2.7.2</Version>
<SaveBreaking>False</SaveBreaking>
<Host name="Direct">
<AboutUri>https://gitgud.io/Ed86/rjw/raw/master/About/About.xml</AboutUri>
<ModSyncUri>https://gitgud.io/Ed86/rjw/raw/master/About/ModSync.xml</ModSyncUri>
<DownloadUri>https://gitgud.io/Ed86/rjw</DownloadUri>
</Host>
</ModSyncNinjaData>
|
Mewtopian/rjw
|
About/ModSync.xml
|
XML
|
mit
| 480 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<BodyPartDef>
<defName>Genitals</defName>
<label>genitals</label>
<hitPoints>12</hitPoints>
<frostbiteVulnerability>0.01</frostbiteVulnerability>
<skinCovered>true</skinCovered>
<solid>false</solid>
<canSuggestAmputation>false</canSuggestAmputation>
<bleedRate>1.0</bleedRate>
<tags>
<li>RJW_FertilitySource</li>
</tags>
</BodyPartDef>
<BodyPartDef>
<defName>Chest</defName>
<label>chest</label>
<hitPoints>24</hitPoints>
<frostbiteVulnerability>0.01</frostbiteVulnerability>
<skinCovered>true</skinCovered>
<solid>false</solid>
<canSuggestAmputation>false</canSuggestAmputation>
<bleedRate>1.0</bleedRate>
</BodyPartDef>
<BodyPartDef>
<defName>Anus</defName>
<label>anus</label>
<hitPoints>8</hitPoints>
<frostbiteVulnerability>0.01</frostbiteVulnerability>
<skinCovered>true</skinCovered>
<solid>false</solid>
<canSuggestAmputation>false</canSuggestAmputation>
<bleedRate>1.0</bleedRate>
</BodyPartDef>
</Defs>
|
Mewtopian/rjw
|
Defs/BodyPartDefs/BodyParts_Humanlike.xml
|
XML
|
mit
| 1,023 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<BodyPartDef>
<defName>MechGenitals</defName>
<label>mechGenitals</label>
<hitPoints>20</hitPoints>
<skinCovered>true</skinCovered>
<solid>true</solid>
<canSuggestAmputation>false</canSuggestAmputation>
<bleedRate>0</bleedRate>
<frostbiteVulnerability>0.0</frostbiteVulnerability>
<tags>
<li>RJW_FertilitySource</li>
</tags>
</BodyPartDef>
</Defs>
|
Mewtopian/rjw
|
Defs/BodyPartDefs/BodyParts_Mech.xml
|
XML
|
mit
| 423 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<BodyPartTagDef>
<defName>RJW_FertilitySource</defName>
<label>fertility_source</label>
<description>Neccessary for reproduction</description>
<vital>false</vital>
</BodyPartTagDef>
</Defs>
|
Mewtopian/rjw
|
Defs/BodyPartTagDefs/BodyPartTags_FertilitySource.xml
|
XML
|
mit
| 248 |
<?xml version="1.0" encoding="utf-8"?>
<!--===================== Concepts taught through the learning readout, when opportunities arise ===================-->
<Defs>
<ConceptDef>
<defName>WhoreBeds</defName>
<label>Whore beds</label>
<priority>50</priority>
<needsOpportunity>True</needsOpportunity>
<helpText>Whores prefer to work in beds.\n\nThere are specific whore beds you can build for them.</helpText>
<highlightTags>
<li>MainTab-Architect-Closed</li>
<li>DesignationCategoryButton-Furniture-Closed</li>
<li>Designator-Build-WhoreBed</li>
</highlightTags>
</ConceptDef>
</Defs>
|
Mewtopian/rjw
|
Defs/ConceptDefs/Concepts_WhoreBeds.xml
|
XML
|
mit
| 613 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<DamageDef>
<defName>ViralDamage</defName>
<workerClass>DamageWorker_AddInjury</workerClass>
<label>viral damage</label>
<externalViolence>false</externalViolence>
<deathMessage>{0} has died of disease.</deathMessage>
<hediff>VirusPerma</hediff>
<hediffSkin>VirusPerma</hediffSkin>
<hediffSolid>VirusPerma</hediffSolid>
<makesBlood>false</makesBlood>
<harmAllLayersUntilOutside>false</harmAllLayersUntilOutside>
</DamageDef>
</Defs>
|
Mewtopian/rjw
|
Defs/DamageDefs/Damage_Viral.xml
|
XML
|
mit
| 501 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<ThingDef ParentName="MakeableDrugBase">
<defName>Aphrodisiac</defName>
<label>Aphrodisiac drug</label>
<description>A smokable drug made from humpshroom.</description>
<graphicData>
<texPath>Things/Item/Drug/Penoxycyline</texPath>
<graphicClass>Graphic_StackCount</graphicClass>
</graphicData>
<rotatable>false</rotatable>
<statBases>
<WorkToMake>450</WorkToMake>
<MarketValue>50</MarketValue>
<Mass>0.05</Mass>
<DeteriorationRate>6</DeteriorationRate>
<Flammability>1.3</Flammability>
</statBases>
<techLevel>Medieval</techLevel>
<ingestible>
<foodType>Plant, Processed</foodType>
<joyKind>Chemical</joyKind>
<joy>0.80</joy>
<baseIngestTicks>720</baseIngestTicks>
<nurseable>true</nurseable>
<drugCategory>Social</drugCategory>
<ingestSound>Ingest_Smoke</ingestSound>
<ingestEffect>Smoke_Joint</ingestEffect>
<ingestEffectEat>EatVegetarian</ingestEffectEat>
<ingestHoldOffsetStanding>
<northDefault>
<offset>(0.27,0,0.08)</offset>
<behind>true</behind>
</northDefault>
<east>
<offset>(0.45,0,0.08)</offset>
</east>
<south>
<offset>(0.27,0,0.08)</offset>
</south>
<west>
<offset>(-0.50,0,0.08)</offset>
<flip>true</flip>
</west>
</ingestHoldOffsetStanding>
<ingestHoldUsesTable>false</ingestHoldUsesTable>
<ingestCommandString>Smoke {0}</ingestCommandString>
<ingestReportString>Smoking {0}.</ingestReportString>
<ingestReportStringEat>Consuming {0}.</ingestReportStringEat>
<useEatingSpeedStat>false</useEatingSpeedStat>
<outcomeDoers>
<li Class="IngestionOutcomeDoer_GiveHediff">
<hediffDef>HumpShroomEffect</hediffDef>
<severity>0.6</severity>
<toleranceChemical>HumpShroom</toleranceChemical>
</li>
<li Class="IngestionOutcomeDoer_GiveHediff">
<hediffDef>HumpShroomTolerance</hediffDef>
<severity>0.042</severity>
<divideByBodySize>true</divideByBodySize>
</li>
<li Class="IngestionOutcomeDoer_OffsetNeed">
<need>Sex</need>
<offset>-0.5</offset>
</li>
</outcomeDoers>
</ingestible>
<recipeMaker>
<recipeUsers>
<li>CraftingSpot</li>
<li>DrugLab</li>
</recipeUsers>
<workSpeedStat>DrugCookingSpeed</workSpeedStat>
<workSkill>Cooking</workSkill>
</recipeMaker>
<costList>
<HumpShroom>4</HumpShroom>
</costList>
<comps>
<li Class="CompProperties_Drug">
<chemical>HumpShroom</chemical>
<addictiveness>0.030</addictiveness>
<minToleranceToAddict>0.15</minToleranceToAddict>
<existingAddictionSeverityOffset>0.1</existingAddictionSeverityOffset>
<needLevelOffset>1</needLevelOffset>
<listOrder>30</listOrder>
</li>
</comps>
</ThingDef>
</Defs>
|
Mewtopian/rjw
|
Defs/Drugs/Aphrodisiac.xml
|
XML
|
mit
| 2,782 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!--As usual stolen from CnP-->
<ThingDef ParentName="MakeableDrugPillBase">
<defName>RJW_Contraceptive</defName>
<label>Contraception pills</label>
<description>Deliver severe hit to fertility for one quadrum.</description>
<graphicData>
<texPath>Things/Item/Contraceptive</texPath>
<graphicClass>Graphic_StackCount</graphicClass>
</graphicData>
<rotatable>false</rotatable>
<statBases>
<WorkToMake>120</WorkToMake>
<MarketValue>15</MarketValue>
<Mass>0.05</Mass>
</statBases>
<techLevel>Industrial</techLevel>
<ingestible>
<drugCategory>Medical</drugCategory>
<outcomeDoers>
<li Class="IngestionOutcomeDoer_GiveHediff">
<hediffDef>RJW_Contraceptive</hediffDef>
<severity>1.0</severity>
</li>
</outcomeDoers>
</ingestible>
<recipeMaker>
<researchPrerequisite>DrugProduction</researchPrerequisite>
<recipeUsers>
<li>DrugLab</li>
</recipeUsers>
</recipeMaker>
<costList>
<MedicineHerbal>1</MedicineHerbal>
</costList>
<comps>
<li Class="CompProperties_Drug">
<addictiveness>0</addictiveness>
<listOrder>1000</listOrder>
<overdoseSeverityOffset>
<min>0.08</min>
<max>0.14</max>
</overdoseSeverityOffset>
</li>
</comps>
</ThingDef>
<HediffDef>
<defName>RJW_Contraceptive</defName>
<hediffClass>HediffWithComps</hediffClass>
<label>contraceptive</label>
<defaultLabelColor>(0.75, 0.75, 1.0)</defaultLabelColor>
<isBad>false</isBad>
<comps>
<!-- Disappears after a season's time -->
<li Class="HediffCompProperties_Disappears">
<disappearsAfterTicks>
<min>900000</min>
<max>900000</max>
</disappearsAfterTicks>
</li>
</comps>
<stages>
<li>
<label>Contracepted</label>
<capMods>
<li>
<capacity>Reproduction</capacity>
<setMax>0.1</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/Drugs/Contraceptive.xml
|
XML
|
mit
| 1,951 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Plant -->
<ThingDef ParentName="CavePlantBase">
<defName>PlantHumpShroom</defName>
<label>humpshroom shroom</label>
<description>Thick shroom with tough flesh, thick juice and smooth soft skin. Exhibits aphrodisiac effects when consumed.</description>
<statBases>
<MaxHitPoints>85</MaxHitPoints>
<Beauty>2</Beauty>
<Nutrition>0.15</Nutrition>
</statBases>
<graphicData>
<texPath>Things/Item/Humpshroom/Humpshroom</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphicData>
<selectable>true</selectable>
<pathCost>10</pathCost>
<plant>
<fertilityMin>0.01</fertilityMin>
<fertilitySensitivity>0.25</fertilitySensitivity>
<growDays>15.00</growDays>
<harvestTag>Standard</harvestTag>
<harvestedThingDef>HumpShroom</harvestedThingDef>
<harvestYield>2</harvestYield>
<sowMinSkill>4</sowMinSkill>
<sowTags>
<li>Hydroponic</li>
</sowTags>
<topWindExposure>0.1</topWindExposure>
<visualSizeRange>
<min>0.3</min>
<max>1.0</max>
</visualSizeRange>
</plant>
<comps>
<li Class="CompProperties_Glower">
<glowRadius>1</glowRadius>
<glowColor>(255,105,180,0)</glowColor>
</li>
</comps>
</ThingDef>
<!--Consumable item-->
<ThingDef ParentName="DrugBase">
<defName>HumpShroom</defName>
<label>Hump shroom</label>
<description>A shroom with tough flesh, thick juice and smooth soft skin. Exhibits aphrodisiac effects when consumed.</description>
<tradeability>Sellable</tradeability>
<socialPropernessMatters>true</socialPropernessMatters>
<tickerType>Rare</tickerType>
<graphicData>
<texPath>Things/Item/Humpshroom/HumpshroomCollected</texPath>
<graphicClass>Graphic_Single</graphicClass>
</graphicData>
<thingCategories>
<li>PlantFoodRaw</li>
</thingCategories>
<statBases>
<MarketValue>10</MarketValue>
<Mass>0.1</Mass>
<DeteriorationRate>4</DeteriorationRate>
<Nutrition>0.40</Nutrition>
</statBases>
<techLevel>Neolithic</techLevel>
<ingestible>
<baseIngestTicks>100</baseIngestTicks>
<chairSearchRadius>4</chairSearchRadius>
<preferability>RawTasty</preferability>
<tasteThought></tasteThought>
<foodType>VegetableOrFruit</foodType>
<maxNumToIngestAtOnce>1</maxNumToIngestAtOnce>
<optimalityOffsetHumanlikes>-6</optimalityOffsetHumanlikes>
<optimalityOffsetFeedingAnimals>-11</optimalityOffsetFeedingAnimals>
<ingestEffect>EatVegetarian</ingestEffect>
<ingestSound>RawVegetable_Eat</ingestSound>
<joy>0.5</joy>
<joyKind>Social</joyKind>
<nurseable>true</nurseable>
<drugCategory>Social</drugCategory>
<outcomeDoers>
<li Class="IngestionOutcomeDoer_GiveHediff">
<hediffDef>HumpShroomEffect</hediffDef>
<severity>0.50</severity>
<toleranceChemical>HumpShroom</toleranceChemical>
</li>
<li Class="IngestionOutcomeDoer_GiveHediff">
<hediffDef>HumpShroomTolerance</hediffDef>
<severity>0.032</severity>
<divideByBodySize>true</divideByBodySize>
</li>
<li Class="IngestionOutcomeDoer_OffsetNeed">
<need>Sex</need>
<offset>-0.5</offset>
</li>
</outcomeDoers>
</ingestible>
<comps>
<li Class="CompProperties_Forbiddable" />
<li Class="CompProperties_Ingredients" />
<li Class="CompProperties_Rottable">
<daysToRotStart>30</daysToRotStart>
<rotDestroys>true</rotDestroys>
</li>
<li Class="CompProperties_Drug">
<chemical>HumpShroom</chemical>
<addictiveness>0.050</addictiveness>
<minToleranceToAddict>0.15</minToleranceToAddict>
<existingAddictionSeverityOffset>0.1</existingAddictionSeverityOffset>
<needLevelOffset>1</needLevelOffset>
<listOrder>30</listOrder>
</li>
</comps>
</ThingDef>
<HediffDef>
<defName>HumpShroomEffect</defName>
<hediffClass>HediffWithComps</hediffClass>
<label>Induced libido</label>
<defaultLabelColor>(1,0,0.5)</defaultLabelColor>
<scenarioCanAdd>true</scenarioCanAdd>
<maxSeverity>1.0</maxSeverity>
<comps>
<li Class="HediffCompProperties_SeverityPerDay">
<severityPerDay>-0.9</severityPerDay>
</li>
</comps>
<stages>
<li>
<restFallFactor>1.33</restFallFactor>
</li>
</stages>
</HediffDef>
<ThoughtDef>
<defName>HumpShroomEffect</defName>
<workerClass>ThoughtWorker_Hediff</workerClass>
<hediff>HumpShroomEffect</hediff>
<validWhileDespawned>true</validWhileDespawned>
<stages>
<li>
<label>Humpshroom aftertaste</label>
<description>Tastes funny.</description>
<baseMoodEffect>1</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
<!-- Ambrosia addiction -->
<ChemicalDef>
<defName>HumpShroom</defName>
<label>humpshroom</label>
<addictionHediff>HumpShroomAddiction</addictionHediff>
<toleranceHediff>HumpShroomTolerance</toleranceHediff>
<onGeneratedAddictedToleranceChance>0.8</onGeneratedAddictedToleranceChance>
</ChemicalDef>
<NeedDef ParentName="DrugAddictionNeedBase">
<defName>Chemical_HumpShroom</defName>
<needClass>Need_Chemical</needClass>
<label>humpshroom</label>
<description>Person is now hooked on shrooms. Without them, their bedroom performance may fall.</description>
<listPriority>10</listPriority>
</NeedDef>
<HediffDef ParentName="DrugToleranceBase">
<defName>HumpShroomTolerance</defName>
<label>humpshroom tolerance</label>
<isBad>false</isBad>
<comps>
<li Class="HediffCompProperties_SeverityPerDay">
<severityPerDay>-0.020</severityPerDay>
</li>
<li Class="HediffCompProperties_DrugEffectFactor">
<chemical>HumpShroom</chemical>
</li>
</comps>
</HediffDef>
<HediffDef ParentName="AddictionBase">
<defName>HumpShroomAddiction</defName>
<hediffClass>Hediff_Addiction</hediffClass>
<label>humpshroom addiction</label>
<causesNeed>Chemical_HumpShroom</causesNeed>
<comps>
<li Class="HediffCompProperties_SeverityPerDay">
<severityPerDay>-0.1</severityPerDay>
</li>
</comps>
<stages>
<li>
</li>
<li>
<label>withdrawal</label>
</li>
</stages>
</HediffDef>
<ThoughtDef>
<defName>HumpShroomWithdrawal</defName>
<workerClass>ThoughtWorker_Hediff</workerClass>
<hediff>HumpShroomAddiction</hediff>
<validWhileDespawned>true</validWhileDespawned>
<stages>
<li>
<visible>false</visible>
</li>
<li>
<label>humpshroom withdrawal</label>
<description>I just feel nothing down there.</description>
<baseMoodEffect>-5</baseMoodEffect>
</li>
</stages>
</ThoughtDef>
</Defs>
|
Mewtopian/rjw
|
Defs/Drugs/Humpshroom.xml
|
XML
|
mit
| 6,511 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef Name="BondageBase" Abstract="True">
<hediffClass>Hediff</hediffClass>
<defaultLabelColor>(0.5, 0.5, 0.9)</defaultLabelColor>
<makesSickThought>false</makesSickThought>
<isBad>false</isBad>
<tendable>false</tendable>
<scenarioCanAdd>false</scenarioCanAdd>
</HediffDef>
<HediffDef ParentName="BondageBase">
<defName>Armbinder</defName>
<label>armbinder</label>
<stages>
<li>
<capMods>
<li>
<capacity>Manipulation</capacity>
<setMax>0.00</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="BondageBase">
<defName>Chains</defName>
<label>chains</label>
<stages>
<li>
<capMods>
<li>
<capacity>Manipulation</capacity>
<setMax>0.35</setMax>
</li>
<li>
<capacity>Moving</capacity>
<setMax>0.35</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="BondageBase">
<defName>Yoke</defName>
<label>yoke</label>
<stages>
<li>
<capMods>
<li>
<capacity>Manipulation</capacity>
<setMax>0.00</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="BondageBase">
<defName>BoundHands</defName>
<label>bound hands</label>
<stages>
<li>
<capMods>
<li>
<capacity>Manipulation</capacity>
<setMax>0.00</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="BondageBase">
<defName>BoundLegs</defName>
<label>bound legs</label>
<stages>
<li>
<capMods>
<li>
<capacity>Moving</capacity>
<setMax>0.00</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="BondageBase">
<defName>Gag</defName>
<label>gag</label>
<stages>
<li>
<capMods>
<li>
<capacity>Talking</capacity>
<setMax>0.00</setMax>
</li>
<li>
<capacity>Eating</capacity>
<setMax>0.00</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="BondageBase">
<defName>OpenGag</defName>
<label>open gag</label>
<stages>
<li>
<capMods>
<li>
<capacity>Talking</capacity>
<setMax>0.00</setMax>
</li>
<li>
<capacity>Eating</capacity>
<offset>-0.25</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="BondageBase">
<defName>RJW_Restraints</defName>
<label>Restraints</label>
<stages>
<li>
<capMods>
<li>
<capacity>Manipulation</capacity>
<setMax>0.00</setMax>
</li>
<li>
<capacity>Moving</capacity>
<setMax>0.00</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<!-- insect restraints -->
<HediffDef ParentName="BondageBase">
<defName>RJW_Cocoon</defName>
<hediffClass>rjw.Cocoon</hediffClass>
<label>Cocoon</label>
<stages>
<li>
<capMods>
<li>
<capacity>Manipulation</capacity>
<setMax>0.00</setMax>
</li>
<li>
<capacity>Moving</capacity>
<setMax>0.00</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_Bondage.xml
|
XML
|
mit
| 3,222 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!--master hediff adding up the smaller semen splatches-->
<HediffDef>
<defName>Hediff_Bukkake</defName>
<hediffClass>rjw.Hediff_Bukkake</hediffClass>
<label>Bukkake</label>
<makesSickThought>false</makesSickThought>
<initialSeverity>0.01</initialSeverity>
<maxSeverity>1</maxSeverity>
<!--<injuryProps>-->
<!--<canMerge>true</canMerge>--><!-- this might not even be required-->
<!--</injuryProps>-->
<!--<scenarioCanAdd>true</scenarioCanAdd>-->
<isBad>false</isBad>
<tendable>false</tendable>
<stages>
<li>
<label>minor</label>
<becomeVisible>false</becomeVisible>
</li>
<li>
<minSeverity>0.3</minSeverity>
<label>little</label>
<statOffsets>
<Vulnerability>0.2</Vulnerability>
<SocialImpact>-0.1</SocialImpact>
</statOffsets>
</li>
<li>
<minSeverity>0.6</minSeverity>
<label>extensive</label>
<statOffsets>
<Vulnerability>0.3</Vulnerability>
<SocialImpact>-0.3</SocialImpact>
</statOffsets>
</li>
<li>
<minSeverity>0.8</minSeverity>
<label>full</label>
<statOffsets>
<Vulnerability>-0.1</Vulnerability><!--pawns prefer victims not being completely drenched-->
<SocialImpact>-0.5</SocialImpact>
</statOffsets>
</li>
</stages>
</HediffDef>
<HediffDef Name="Hediff_Semen">
<hediffClass>rjw.Hediff_Semen</hediffClass>
<defName>Hediff_Semen</defName>
<label>semen</label>
<labelNoun>semen</labelNoun>
<labelNounPretty>semen on {1}</labelNounPretty>
<defaultLabelColor>(0.95,0.95,0.95)</defaultLabelColor>
<isBad>false</isBad>
<tendable>false</tendable>
<makesSickThought>false</makesSickThought>
<makesAlert>false</makesAlert>
<maxSeverity>1</maxSeverity>
<initialSeverity>0.001</initialSeverity>
<injuryProps>
<canMerge>true</canMerge>
</injuryProps>
<stages>
<li>
<label>little</label>
</li>
<li>
<minSeverity>0.25</minSeverity>
<label>some</label>
</li>
<li>
<minSeverity>0.5</minSeverity>
<label>dripping</label>
</li>
<li>
<minSeverity>0.8</minSeverity>
<label>drenched</label>
</li>
</stages>
<comps>
<li Class="HediffCompProperties_SelfHeal">
<!--0.01*100*1800/60.0000-->
<healIntervalTicksStanding>1800</healIntervalTicksStanding><!-- 1 day = 60.000 ticks -->
<healAmount>0.01</healAmount><!--dries by itself, completely drying from 1.0 to 0.0 takes ~72h-->
</li>
</comps>
</HediffDef>
<HediffDef ParentName="Hediff_Semen">
<defName>Hediff_InsectSpunk</defName>
<label>insect spunk</label>
<labelNoun>insect spunk</labelNoun>
<labelNounPretty>insect spunk on {1}</labelNounPretty>
<defaultLabelColor>(0.6,0.83,0.35)</defaultLabelColor>
</HediffDef>
<HediffDef ParentName="Hediff_Semen">
<defName>Hediff_MechaFluids</defName>
<label>mechanoid fluids</label>
<labelNoun>mechanoid fluids</labelNoun>
<labelNounPretty>mecha fluids on {1}</labelNounPretty>
<defaultLabelColor>(0.37,0.71,0.82)</defaultLabelColor>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_Bukkake.xml
|
XML
|
mit
| 3,077 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!--Pawns with ovi's plant egg.-->
<rjw.HediffDef_InsectEgg Name="RJW_ImplantEgg" Abstract="True">
<defName>RJW_InsectEgg</defName>
<label>Egg</label>
<hediffClass>rjw.Hediff_InsectEgg</hediffClass>
<defaultLabelColor>(0.8, 0.8, 0.35)</defaultLabelColor>
<initialSeverity>0.1</initialSeverity>
<isBad>false</isBad>
<tendable>false</tendable>
<eggsize>1</eggsize> <!--eggsize 1 = 100%, 0 - can hold unlimited eggs, up to 100 eggs per sex-->
<selffertilized>false</selffertilized> <!--egg will be implanted fertilized-->
<stages>
<li>
<minSeverity>0.01</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.01</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.02</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.02</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.05</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.05</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.10</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.10</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.15</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.15</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.20</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.20</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.25</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.25</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.30</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.30</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.40</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.40</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.50</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.50</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.75</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.75</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.9</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-1.0</offset>
</li>
</capMods>
</li>
</stages>
</rjw.HediffDef_InsectEgg>
<!--Placeholder egg/unsupported/any races-->
<rjw.HediffDef_InsectEgg ParentName="RJW_ImplantEgg">
<defName>RJW_UnknownEgg</defName>
<parentDef>Unknown</parentDef> <!-- exact match-->
</rjw.HediffDef_InsectEgg>
<!--vanilla insects, can fertilize each other -->
<rjw.HediffDef_InsectEgg ParentName="RJW_ImplantEgg">
<defName>RJW_InsectHiveEgg</defName>
<parentDefs> <!-- partial match of pawn.kindDef.defName-->
<li>Megascarab</li>
<li>Spelopede</li>
<li>Megaspider</li>
<li>Queen</li> <!-- Better infestations-->
</parentDefs>
</rjw.HediffDef_InsectEgg>
<!--Used for JobDriver_RapeEnemyByMech. Mechs implant things when success rape.-->
<rjw.HediffDef_MechImplants Name="RJW_ImplantMech" Abstract="True">
<hediffClass>rjw.Hediff_MechImplants</hediffClass>
<defaultLabelColor>(0.8, 0.8, 0.35)</defaultLabelColor>
<initialSeverity>0.1</initialSeverity>
<parentDefs>
<li>Mech_Lancer</li>
<li>Mech_Scyther</li>
<li>Mech_Centipede</li>
</parentDefs>
<tendable>false</tendable>
</rjw.HediffDef_MechImplants>
<rjw.HediffDef_MechImplants ParentName="RJW_ImplantMech">
<hediffClass>rjw.Hediff_MicroComputer</hediffClass>
<defName>RJW_MicroComputer</defName>
<tendable>false</tendable>
<isBad>true</isBad>
<label>MicroComputer</label>
<minEventInterval>30000</minEventInterval>
<maxEventInterval>90000</maxEventInterval>
<randomHediffDefs>
<li>RJW_Orgasm</li>
<li>TransportCums</li>
<li>TransportEggs</li>
</randomHediffDefs>
</rjw.HediffDef_MechImplants>
<rjw.HediffDef_EnemyImplants>
<defName>Parasite</defName>
<hediffClass>rjw.Hediff_Parasite</hediffClass>
<defaultLabelColor>(0.7, 1.0, 0.7)</defaultLabelColor>
<initialSeverity>0.1</initialSeverity>
<isBad>true</isBad>
<label>pregnant</label>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>true</sendLetterWhenDiscovered>
<discoverLetterLabel>{0} Parasited</discoverLetterLabel>
<discoverLetterText>{0} is parasited!</discoverLetterText>
</li>
</comps>
<stages>
<li>
<label>early-stage-hidden</label>
<becomeVisible>false</becomeVisible>
<vomitMtbDays>2.5</vomitMtbDays>
</li>
<li>
<label>middle-stage</label>
<minSeverity>0.333</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.15</offset>
</li>
</capMods>
</li>
<li>
<label>late-stage</label>
<minSeverity>0.666</minSeverity>
<vomitMtbDays>2</vomitMtbDays>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.30</offset>
</li>
</capMods>
</li>
</stages>
</rjw.HediffDef_EnemyImplants>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_EnemyImplants.xml
|
XML
|
mit
| 5,340 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef>
<defName>FeelingBroken</defName>
<hediffClass>rjw.AdvancedHediffWithComps</hediffClass>
<label>Stages to broken body</label>
<defaultLabelColor>(0.5, 0.7, 0.45)</defaultLabelColor>
<makesSickThought>false</makesSickThought>
<initialSeverity>0.025</initialSeverity>
<maxSeverity>1</maxSeverity>
<scenarioCanAdd>true</scenarioCanAdd>
<tendable>false</tendable>
<isBad>false</isBad>
<comps>
<li Class="rjw.HediffCompProperties_SeverityPerDayIfRest">
<severityPerDayByRestDays>
<points>
<li>(1,0)</li>
<li>(10,-0.025)</li>
</points>
</severityPerDayByRestDays>
</li>
<li Class="rjw.HediffCompProperties_WhenRapid">
<severityRateByRestDays>
<points>
<li>(0,0.1)</li>
<li>(1,1)</li>
</points>
</severityRateByRestDays>
</li>
</comps>
<stages>
<li>
<label>early-stage</label>
<becomeVisible>false</becomeVisible>
</li>
<li>
<label>in a trance</label>
<minSeverity>0.1</minSeverity>
<painOffset>0.1</painOffset>
<capMods>
<li>
<capacity>Consciousness</capacity>
<postFactor>0.8</postFactor>
</li>
</capMods>
</li>
<li>
<label>broken body</label>
<minSeverity>0.3</minSeverity>
<painOffset>0.05</painOffset>
<capMods>
<li>
<capacity>Consciousness</capacity>
<postFactor>0.7</postFactor>
</li>
</capMods>
<statOffsets>
<Vulnerability>0.25</Vulnerability>
</statOffsets>
</li>
<li>
<label>Extremely broken body</label>
<minSeverity>0.5</minSeverity>
<painOffset>-0.1</painOffset>
<capMods>
<li>
<capacity>Consciousness</capacity>
<postFactor>0.6</postFactor>
</li>
</capMods>
<statOffsets>
<Vulnerability>0.5</Vulnerability>
</statOffsets>
</li>
</stages>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_FeelingBroken.xml
|
XML
|
mit
| 1,913 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef>
<defName>RJW_IUD</defName>
<label>IUD</label>
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(0.8, 0.8, 0.35)</defaultLabelColor>
<isBad>false</isBad>
<scenarioCanAdd>true</scenarioCanAdd>
<stages>
<li>
<capMods>
<li>
<capacity>Reproduction</capacity>
<setMax>0</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef>
<defName>IncreasedFertility</defName>
<label>Increased fertility</label>
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(0.7, 1.0, 0.7)</defaultLabelColor>
<isBad>false</isBad>
<scenarioCanAdd>false</scenarioCanAdd>
<stages>
<li>
<becomeVisible>false</becomeVisible>
<capMods>
<li>
<capacity>Reproduction</capacity>
<offset>0.25</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef>
<defName>DecreasedFertility</defName>
<label>Low fertility</label>
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(1, 0.2, 0.2)</defaultLabelColor>
<isBad>false</isBad>
<scenarioCanAdd>false</scenarioCanAdd>
<stages>
<li>
<becomeVisible>false</becomeVisible>
<capMods>
<li>
<capacity>Reproduction</capacity>
<offset>-0.5</offset>
<setMax>0.25</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef>
<defName>ImpregnationBlocker</defName>
<label>Archotech pregnancy blocker</label>
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(0.7, 1.0, 0.7)</defaultLabelColor>
<isBad>false</isBad>
<scenarioCanAdd>false</scenarioCanAdd>
<stages>
<li>
<becomeVisible>true</becomeVisible>
<capMods>
<li>
<capacity>Reproduction</capacity>
<setMax>0</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef>
<defName>FertilityEnhancer</defName>
<label>Archotech fertility enhancer</label>
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(0.7, 1.0, 0.7)</defaultLabelColor>
<isBad>false</isBad>
<scenarioCanAdd>false</scenarioCanAdd>
<stages>
<li>
<becomeVisible>true</becomeVisible>
<capMods>
<li>
<capacity>Reproduction</capacity>
<offset>0.25</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_Fertility.xml
|
XML
|
mit
| 2,366 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!--
<HediffDef>
<defName>RJW_lactating</defName>
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(1, 0.41, 0.81)</defaultLabelColor>
<isBad>false</isBad>
<label>lactating</label>
<comps>
<li Class="HediffCompProperties_Disappears">
<disappearsAfterTicks>
<min>2750000</min>
<max>3000000</max>
</disappearsAfterTicks>
</li>
</comps>
</HediffDef>
-->
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_Lactating.xml
|
XML
|
mit
| 460 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef>
<defName>RJW_Orgasm</defName>
<hediffClass>rjw.Hediff_Orgasm</hediffClass>
<label>Orgasm</label>
<defaultLabelColor>(0.5, 0.7, 0.45)</defaultLabelColor>
<makesSickThought>false</makesSickThought>
<initialSeverity>0.1</initialSeverity>
<maxSeverity>1</maxSeverity>
<scenarioCanAdd>false</scenarioCanAdd>
<tendable>false</tendable>
<comps>
<li Class="HediffCompProperties_SeverityPerDay">
<severityPerDay>-1</severityPerDay>
</li>
</comps>
<stages>
<li>
<label>Slightly</label>
<capMods>
<li>
<capacity>Consciousness</capacity>
<postFactor>0.9</postFactor>
</li>
<li>
<capacity>Manipulation</capacity>
<postFactor>0.9</postFactor>
</li>
<li>
<capacity>Moving</capacity>
<postFactor>0.9</postFactor>
</li>
<li>
<capacity>Talking</capacity>
<postFactor>0.9</postFactor>
</li>
</capMods>
<statOffsets>
<Vulnerability>0.2</Vulnerability>
</statOffsets>
</li>
<li>
<label>Heavy</label>
<minSeverity>0.2</minSeverity>
<capMods>
<li>
<capacity>Consciousness</capacity>
<postFactor>0.65</postFactor>
</li>
<li>
<capacity>Manipulation</capacity>
<postFactor>0.65</postFactor>
</li>
<li>
<capacity>Moving</capacity>
<postFactor>0.65</postFactor>
</li>
<li>
<capacity>Talking</capacity>
<postFactor>0.65</postFactor>
</li>
</capMods>
<statOffsets>
<Vulnerability>0.3</Vulnerability>
</statOffsets>
</li>
<li>
<label>Extremely</label>
<minSeverity>0.501</minSeverity>
<capMods>
<li>
<capacity>Consciousness</capacity>
<postFactor>0.3</postFactor>
</li>
<li>
<capacity>Manipulation</capacity>
<postFactor>0.65</postFactor>
</li>
<li>
<capacity>Moving</capacity>
<postFactor>0.2</postFactor>
</li>
<li>
<capacity>Talking</capacity>
<postFactor>0.5</postFactor>
</li>
</capMods>
<statOffsets>
<Vulnerability>0.6</Vulnerability>
</statOffsets>
</li>
</stages>
</HediffDef>
<HediffDef>
<defName>TransportCums</defName>
<hediffClass>rjw.Hediff_TransportCums</hediffClass>
<isBad>false</isBad>
</HediffDef>
<HediffDef>
<defName>TransportEggs</defName>
<hediffClass>rjw.Hediff_TransportEggs</hediffClass>
<isBad>false</isBad>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_MCEvents.xml
|
XML
|
mit
| 2,508 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Severity will be set to equal (1.0 - blood_filtration) in xxx.update_std_effects -->
<HediffDef>
<defName>Immunodeficiency</defName>
<hediffClass>rjw.Hediff_ID</hediffClass>
<defaultLabelColor>(1.0, 0.0, 0.0)</defaultLabelColor>
<label>Immunodeficiency</label>
<makesSickThought>false</makesSickThought>
<minSeverity>0.600</minSeverity>
<initialSeverity>0.601</initialSeverity>
<tendable>false</tendable>
<stages>
<li>
<minSeverity>0.60</minSeverity>
<label>minor</label>
<restFallFactor>1.10</restFallFactor>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.05</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.75</minSeverity>
<label>major</label>
<restFallFactor>1.30</restFallFactor>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.10</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.15</offset>
</li>
<li>
<capacity>Moving</capacity>
<offset>-0.15</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.90</minSeverity>
<label>extreme</label>
<restFallFactor>1.50</restFallFactor>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.15</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.30</offset>
</li>
<li>
<capacity>Moving</capacity>
<offset>-0.30</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef>
<defName>VirusPerma</defName>
<hediffClass>Hediff_Injury</hediffClass>
<tendable>false</tendable>
<displayWound>true</displayWound>
<chanceToCauseNoPain>1.0</chanceToCauseNoPain>
<label>viral damage</label>
<comps>
<li Class="HediffCompProperties_GetsPermanent">
<permanentLabel>permanent viral damage</permanentLabel>
<instantlyPermanentLabel>permanent viral damage</instantlyPermanentLabel>
</li>
</comps>
<injuryProps>
<painPerSeverity>0.0</painPerSeverity>
<averagePainPerSeverityPermanent>0.0</averagePainPerSeverityPermanent>
<destroyedLabel>Destroyed by disease</destroyedLabel>
<destroyedOutLabel>Destroyed by disease</destroyedOutLabel>
</injuryProps>
</HediffDef>
<HediffDef ParentName="AddedBodyPartBase">
<defName>PegArm</defName>
<label>peg arm</label>
<labelNoun>a peg arm</labelNoun>
<addedPartProps>
<solid>true</solid>
<partEfficiency>0.00</partEfficiency>
<betterThanNatural>false</betterThanNatural>
</addedPartProps>
<spawnThingOnRemoved>WoodLog</spawnThingOnRemoved>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_Other.xml
|
XML
|
mit
| 2,676 |
<?xml version="1.0" encoding="utf-8" ?>
<!--all pregnancies-->
<Defs>
<HediffDef Name="RJW_pregnancy_template" Abstract="True">
<label>Pregnant</label>
<defaultLabelColor>(1, 0.41, 0.81)</defaultLabelColor>
<initialSeverity>0.001</initialSeverity>
<isBad>false</isBad>
<stages>
<li>
<label>early-stage</label>
<vomitMtbDays>2.5</vomitMtbDays>
</li>
<li>
<label>middle-stage</label>
<minSeverity>0.333</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.15</offset>
</li>
</capMods>
</li>
<li>
<label>late-stage</label>
<minSeverity>0.666</minSeverity>
<vomitMtbDays>2</vomitMtbDays>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.30</offset>
</li>
</capMods>
</li>
<li>
<label>having contractions</label>
<minSeverity>0.98</minSeverity>
<painOffset>0.3</painOffset>
<capMods>
<li>
<capacity>Moving</capacity>
<setMax>0.0</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="RJW_pregnancy_template">
<defName>RJW_pregnancy</defName>
<hediffClass>rjw.Hediff_HumanlikePregnancy</hediffClass>
</HediffDef>
<HediffDef ParentName="RJW_pregnancy_template">
<defName>RJW_pregnancy_beast</defName>
<hediffClass>rjw.Hediff_BestialPregnancy</hediffClass>
</HediffDef>
<HediffDef ParentName="RJW_pregnancy_template">
<defName>RJW_pregnancy_mech</defName>
<hediffClass>rjw.Hediff_MechanoidPregnancy</hediffClass>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_Pregnancy.xml
|
XML
|
mit
| 1,564 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef Name="RJW_PrivatePartBase" Abstract="True">
<hediffClass>rjw.HediffDef_PartBase</hediffClass>
<!-- <everVisible>true</everVisible> -->
<isBad>false</isBad>
</HediffDef>
<HediffDef ParentName="RJW_PrivatePartBase" Name="NaturalPrivatePartBase" Abstract="True">
<defaultLabelColor>(0.5, 0.8, 0.5)</defaultLabelColor>
</HediffDef>
<HediffDef ParentName="RJW_PrivatePartBase" Name="ArtificialPrivatePartBase" Abstract="True">
<defaultLabelColor>(0.5, 0.5, 0.9)</defaultLabelColor>
<addedPartProps>
<solid>true</solid>
<partEfficiency>1.0</partEfficiency>
</addedPartProps>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartBase" Name="ArtificialPrivatePartLotech" Abstract="True">
<addedPartProps>
<betterThanNatural>false</betterThanNatural>
</addedPartProps>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartBase" Name="ArtificialPrivatePartHitech" Abstract="True">
<addedPartProps>
<betterThanNatural>true</betterThanNatural>
</addedPartProps>
</HediffDef>
<!-- Placeholder hediffs for unsupported pawns? -->
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>GenericPenis</defName>
<label>generic penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>1.0</SexAbility>
</statOffsets>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>GenericVagina</defName>
<label>generic vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>1.0</SexAbility>
<Vulnerability>0.10</Vulnerability>
</statOffsets>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>GenericBreasts</defName>
<label>generic breasts</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.5</SexAbility>
<Vulnerability>0.08</Vulnerability>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.025</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.025</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>GenericAnus</defName>
<label>generic anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>1.0</SexAbility>
<Vulnerability>0.12</Vulnerability>
</statOffsets>
</li>
</stages>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_PrivateParts/Hediffs_PrivateParts.xml
|
XML
|
mit
| 2,436 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>HorsePenis</defName>
<label>equine penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>1.6</SexAbility>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.1</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>HorsePenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>HorseVagina</defName>
<label>equine vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.02</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>HorseVagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>CatPenis</defName>
<label>feline penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.6</SexAbility>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>CatPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>CatVagina</defName>
<label>feline vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.75</SexAbility>
<Vulnerability>0.14</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>CatVagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>DogPenis</defName>
<label>canine penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.6</SexAbility>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>DogPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>DogVagina</defName>
<label>canine vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.5</SexAbility>
<Vulnerability>0.06</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>DogVagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>DragonPenis</defName>
<label>dragon penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.9</SexAbility>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.1</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>DragonPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>DragonVagina</defName>
<label>dragon vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.02</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>DragonVagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>RaccoonPenis</defName>
<label>procyonine penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.4</SexAbility>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>RaccoonPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>Hemipenis</defName>
<label>hemipenis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.6</SexAbility>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>Hemipenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>CrocodilianPenis</defName>
<label>crocodilian penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.6</SexAbility>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>CrocodilianPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>Udder</defName>
<label>udder</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.12</Vulnerability>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.05</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>Udder</spawnThingOnRemoved>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_PrivateParts/Hediffs_PrivateParts_Animal.xml
|
XML
|
mit
| 4,118 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Demon privates -->
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>DemonTentaclePenis</defName>
<label>demon tentacles</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.75</SexAbility>
</statOffsets>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>DemonPenis</defName>
<label>demon penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.75</SexAbility>
</statOffsets>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>DemonVagina</defName>
<label>demon vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.75</SexAbility>
<Vulnerability>0.2</Vulnerability>
</statOffsets>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>DemonAnus</defName>
<label>demon anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.75</SexAbility>
<Vulnerability>0.2</Vulnerability>
</statOffsets>
</li>
</stages>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_PrivateParts/Hediffs_PrivateParts_Demon.xml
|
XML
|
mit
| 1,119 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Regular privates -->
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>Penis</defName>
<label>average penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.5</SexAbility>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>Penis</spawnThingOnRemoved>
</HediffDef>
<!-- Additional dick sizes -->
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>MicroPenis</defName>
<label>micro penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.1</SexAbility>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>MicroPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>SmallPenis</defName>
<label>small penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.4</SexAbility>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>SmallPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>BigPenis</defName>
<label>Big Penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.6</SexAbility>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.03</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>BigPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>HugePenis</defName>
<label>Huge penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.8</SexAbility>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.06</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>HugePenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>Vagina</defName>
<label>average vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.5</SexAbility>
<Vulnerability>0.10</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>Vagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>MicroVagina</defName>
<label>micro vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.02</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>MicroVagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>TightVagina</defName>
<label>tight vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.45</SexAbility>
<Vulnerability>0.14</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>TightVagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>LooseVagina</defName>
<label>loose vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.25</SexAbility>
<Vulnerability>0.06</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>LooseVagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>GapingVagina</defName>
<label>gaping vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.02</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>GapingVagina</spawnThingOnRemoved>
</HediffDef>
<!-- Natural Breasts -->
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>Breasts</defName>
<label>average breasts</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.5</SexAbility>
<Vulnerability>0.08</Vulnerability>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.025</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.025</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>Breasts</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>FlatBreasts</defName>
<label>flat breasts</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.02</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>FlatBreasts</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>SmallBreasts</defName>
<label>small breasts</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.3</SexAbility>
<Vulnerability>0.04</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>SmallBreasts</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>LargeBreasts</defName>
<label>large breasts</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.7</SexAbility>
<Vulnerability>0.12</Vulnerability>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.05</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.05</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>LargeBreasts</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>HugeBreasts</defName>
<label>huge breasts</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.9</SexAbility>
<Vulnerability>0.16</Vulnerability>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.1</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.1</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>HugeBreasts</spawnThingOnRemoved>
</HediffDef>
<!-- Natural anuses -->
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>Anus</defName>
<label>average anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.5</SexAbility>
<Vulnerability>0.12</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>Anus</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>MicroAnus</defName>
<label>micro anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.02</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>MicroAnus</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>TightAnus</defName>
<label>tight anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.45</SexAbility>
<Vulnerability>0.16</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>TightAnus</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>LooseAnus</defName>
<label>loose anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.25</SexAbility>
<Vulnerability>0.08</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>LooseAnus</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>GapingAnus</defName>
<label>gaping anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.04</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>GapingAnus</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>FeaturelessChest</defName>
<label>featureless chest</label>
<stages>
<li>
<statOffsets>
<Vulnerability>-0.05</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>FeaturelessChest</spawnThingOnRemoved>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_PrivateParts/Hediffs_PrivateParts_Human.xml
|
XML
|
mit
| 7,766 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Simple prosthetic privates -->
<HediffDef ParentName="ArtificialPrivatePartLotech">
<hediffClass>Hediff_Implant</hediffClass> <!-- do not count it as Hediff_AddedPart for transhumanist/prostophobe -->
<defName>PegDick</defName>
<label>peg dick</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.15</SexAbility>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.1</offset>
</li>
<li>
<capacity>Reproduction</capacity>
<offset>-1</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>PegDick</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartLotech">
<defName>HydraulicPenis</defName>
<label>hydraulic penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.25</SexAbility>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.1</offset>
</li>
<li>
<capacity>Reproduction</capacity>
<offset>-0.1</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>HydraulicPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartLotech">
<defName>HydraulicVagina</defName>
<label>hydraulic vagina</label>
<stages>
<li>
<capMods>
<li>
<capacity>Reproduction</capacity>
<offset>-0.1</offset>
</li>
</capMods>
<statOffsets>
<SexAbility>0.25</SexAbility>
<Vulnerability>0.04</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>HydraulicVagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartLotech">
<defName>HydraulicBreasts</defName>
<label>hydraulic breasts</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.03</Vulnerability>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>-0.1</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.1</offset>
</li>
</capMods>
</li>
</stages>
<spawnThingOnRemoved>HydraulicBreasts</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartLotech">
<defName>HydraulicAnus</defName>
<label>hydraulic anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.25</SexAbility>
<Vulnerability>0.04</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>HydraulicAnus</spawnThingOnRemoved>
</HediffDef>
<!-- Bionic privates -->
<HediffDef ParentName="ArtificialPrivatePartHitech">
<defName>BionicPenis</defName>
<label>bionic penis</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.8</SexAbility>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>BionicPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartHitech">
<defName>BionicVagina</defName>
<label>bionic vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.8</SexAbility>
<Vulnerability>0.2</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>BionicVagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartHitech">
<defName>BionicBreasts</defName>
<label>bionic breasts</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.6</SexAbility>
<Vulnerability>0.18</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>BionicBreasts</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartHitech">
<defName>BionicAnus</defName>
<label>bionic anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.8</SexAbility>
<Vulnerability>0.2</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>BionicAnus</spawnThingOnRemoved>
</HediffDef>
<!-- Archotech -->
<HediffDef ParentName="ArtificialPrivatePartHitech">
<defName>ArchotechPenis</defName>
<label>archotech penis</label>
<stages>
<li>
<capMods>
<li>
<capacity>Reproduction</capacity>
<offset>0.25</offset>
</li>
<li>
<capacity>BloodPumping</capacity>
<offset>0.05</offset>
</li>
</capMods>
<statOffsets>
<SexAbility>0.6</SexAbility>
<ImmunityGainSpeed>0.05</ImmunityGainSpeed>
<ToxicSensitivity>-0.05</ToxicSensitivity>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>ArchotechPenis</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartHitech">
<defName>ArchotechVagina</defName>
<label>archotech vagina</label>
<stages>
<li>
<capMods>
<li>
<capacity>Reproduction</capacity>
<offset>0.25</offset>
</li>
<li>
<capacity>BloodPumping</capacity>
<offset>0.05</offset>
</li>
</capMods>
<statOffsets>
<SexAbility>0.6</SexAbility>
<ImmunityGainSpeed>0.05</ImmunityGainSpeed>
<ToxicSensitivity>-0.05</ToxicSensitivity>
<Vulnerability>-0.25</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>ArchotechVagina</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartHitech">
<defName>ArchotechAnus</defName>
<label>archotech anus</label>
<stages>
<li>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>0.25</offset>
</li>
<li>
<capacity>Metabolism</capacity>
<offset>0.5</offset>
</li>
</capMods>
<statOffsets>
<SexAbility>0.6</SexAbility>
<Vulnerability>-0.2</Vulnerability>
<HungerRateMultiplier>-0.3</HungerRateMultiplier>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>ArchotechAnus</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="ArtificialPrivatePartHitech">
<defName>ArchotechBreasts</defName>
<label>archotech breasts</label>
<stages>
<li>
<capMods>
<li>
<capacity>BloodPumping</capacity>
<offset>0.2</offset>
</li>
</capMods>
<statOffsets>
<SexAbility>0.6</SexAbility>
<Vulnerability>-0.1</Vulnerability>
<ComfyTemperatureMin>-10</ComfyTemperatureMin>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>ArchotechBreasts</spawnThingOnRemoved>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_PrivateParts/Hediffs_PrivateParts_Implants.xml
|
XML
|
mit
| 6,363 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Insect privates -->
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>OvipositorF</defName>
<label>ovipositor (Female)</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.25</SexAbility>
<Vulnerability>0.1</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>OvipositorF</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>OvipositorM</defName>
<label>ovipositor (Male)</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.25</SexAbility>
<Vulnerability>0.1</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>OvipositorM</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>InsectAnus</defName>
<label>insect anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>0.25</SexAbility>
<Vulnerability>0.1</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>InsectAnus</spawnThingOnRemoved>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_PrivateParts/Hediffs_PrivateParts_Insect.xml
|
XML
|
mit
| 1,097 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!-- Slime privates -->
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>SlimeTentacles</defName>
<label>slime tentacles</label>
<stages>
<li>
<statOffsets>
<SexAbility>2.0</SexAbility>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>SlimeGlob</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>SlimeVagina</defName>
<label>slime vagina</label>
<stages>
<li>
<statOffsets>
<SexAbility>2.0</SexAbility>
<Vulnerability>0.2</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>SlimeGlob</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>SlimeBreasts</defName>
<label>slime breasts</label>
<stages>
<li>
<statOffsets>
<SexAbility>2.0</SexAbility>
<Vulnerability>0.18</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>SlimeGlob</spawnThingOnRemoved>
</HediffDef>
<HediffDef ParentName="NaturalPrivatePartBase">
<defName>SlimeAnus</defName>
<label>slime anus</label>
<stages>
<li>
<statOffsets>
<SexAbility>2.0</SexAbility>
<Vulnerability>0.2</Vulnerability>
</statOffsets>
</li>
</stages>
<spawnThingOnRemoved>SlimeGlob</spawnThingOnRemoved>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_PrivateParts/Hediffs_PrivateParts_Slime.xml
|
XML
|
mit
| 1,375 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef Name="STDBase" Abstract="True">
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(0.8, 0.8, 0.35)</defaultLabelColor>
<initialSeverity>0.010</initialSeverity>
</HediffDef>
<HediffDef Abstract="True" ParentName="STDBase" Name="HIVBase">
<hediffClass>HediffWithComps</hediffClass>
<tendable>true</tendable>
<stages>
<li>
<minSeverity>0.000</minSeverity>
<label>detectable</label>
</li>
<li>
<minSeverity>0.100</minSeverity>
<label>minor</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.05</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.200</minSeverity>
<label>minor</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.10</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.300</minSeverity>
<label>minor</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.15</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.400</minSeverity>
<label>moderate</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.20</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.500</minSeverity>
<label>major</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.30</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.600</minSeverity>
<label>major</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.40</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.700</minSeverity>
<label>major</label>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.50</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.800</minSeverity>
<label>extreme</label>
<lifeThreatening>true</lifeThreatening>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.70</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.900</minSeverity>
<label>extreme</label>
<lifeThreatening>true</lifeThreatening>
<capMods>
<li>
<capacity>BloodFiltration</capacity>
<offset>-0.95</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="HIVBase">
<defName>AcuteHIV</defName>
<label>HIV - Acute</label>
<makesSickThought>true</makesSickThought>
<maxSeverity>1</maxSeverity>
<tendable>true</tendable>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>false</sendLetterWhenDiscovered>
</li>
<li Class="HediffCompProperties_TendDuration">
<baseTendDurationHours>24</baseTendDurationHours>
<!-- Daily -->
<severityPerDayTended>-0.022</severityPerDayTended>
</li>
<li Class="HediffCompProperties_Immunizable">
<immunityPerDayNotSick>-0.060</immunityPerDayNotSick>
<immunityPerDaySick>0.280</immunityPerDaySick>
<severityPerDayNotImmune>0.130</severityPerDayNotImmune>
<severityPerDayImmune>-0.600</severityPerDayImmune>
</li>
</comps>
</HediffDef>
<HediffDef ParentName="HIVBase">
<defName>ChronicHIV</defName>
<label>HIV - Chronic</label>
<makesSickThought>false</makesSickThought>
<minSeverity>0.001</minSeverity>
<maxSeverity>1.000</maxSeverity>
<tendable>true</tendable>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>false</sendLetterWhenDiscovered>
</li>
<li Class="HediffCompProperties_TendDuration">
<baseTendDurationHours>240</baseTendDurationHours>
<!-- Every 10 days -->
<severityPerDayTended>-0.0013</severityPerDayTended>
</li>
<li Class="HediffCompProperties_Immunizable">
<severityPerDayNotImmune>0.0048</severityPerDayNotImmune>
</li>
</comps>
</HediffDef>
<HediffDef ParentName="STDBase">
<defName>Herpes</defName>
<label>Herpes</label>
<makesSickThought>false</makesSickThought>
<minSeverity>0.001</minSeverity>
<maxSeverity>0.650</maxSeverity>
<tendable>true</tendable>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>false</sendLetterWhenDiscovered>
</li>
<li Class="HediffCompProperties_TendDuration">
<baseTendDurationHours>240</baseTendDurationHours>
<!-- Every 10 days -->
<severityPerDayTended>-0.050</severityPerDayTended>
</li>
<li Class="HediffCompProperties_Immunizable">
<severityPerDayNotImmune>0.035</severityPerDayNotImmune>
</li>
</comps>
<stages>
<li>
<minSeverity>0.000</minSeverity>
<label>minor</label>
<painOffset>0.05</painOffset>
</li>
<li>
<minSeverity>0.250</minSeverity>
<label>moderate</label>
<painOffset>0.10</painOffset>
</li>
<li>
<minSeverity>0.500</minSeverity>
<label>major</label>
<painOffset>0.15</painOffset>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="STDBase">
<defName>Warts</defName>
<label>Warts</label>
<makesSickThought>false</makesSickThought>
<minSeverity>0.000</minSeverity>
<maxSeverity>0.650</maxSeverity>
<tendable>true</tendable>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>false</sendLetterWhenDiscovered>
</li>
<li Class="HediffCompProperties_TendDuration">
<baseTendDurationHours>24</baseTendDurationHours>
<!-- Everyday -->
<severityPerDayTended>-0.138</severityPerDayTended>
</li>
<li Class="HediffCompProperties_Immunizable">
<immunityPerDayNotSick>-0.090</immunityPerDayNotSick>
<immunityPerDaySick>0.165</immunityPerDaySick>
<severityPerDayNotImmune>0.225</severityPerDayNotImmune>
<severityPerDayImmune>-0.400</severityPerDayImmune>
</li>
</comps>
<stages>
<li>
<minSeverity>0.000</minSeverity>
<label>minor</label>
</li>
<li>
<minSeverity>0.400</minSeverity>
<label>major</label>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="STDBase">
<defName>Syphilis</defName>
<label>Syphilis</label>
<makesSickThought>true</makesSickThought>
<initialSeverity>0.200</initialSeverity>
<minSeverity>0.000</minSeverity>
<lethalSeverity>1.000</lethalSeverity>
<tendable>true</tendable>
<comps>
<li Class="HediffCompProperties_Discoverable">
<sendLetterWhenDiscovered>false</sendLetterWhenDiscovered>
</li>
<li Class="HediffCompProperties_TendDuration">
<baseTendDurationHours>36</baseTendDurationHours>
<!-- 2 times every 3 days -->
<severityPerDayTended>-0.160</severityPerDayTended>
</li>
<li Class="HediffCompProperties_Immunizable">
<immunityPerDayNotSick>-0.045</immunityPerDayNotSick>
<immunityPerDaySick>0.060</immunityPerDaySick>
<severityPerDayNotImmune>0.080</severityPerDayNotImmune>
<severityPerDayImmune>-0.240</severityPerDayImmune>
</li>
</comps>
<stages>
<li>
<minSeverity>0.000</minSeverity>
<label>minor</label>
</li>
<li>
<minSeverity>0.360</minSeverity>
<label>moderate</label>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.05</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.600</minSeverity>
<label>major</label>
<painOffset>0.05</painOffset>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.15</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.10</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.840</minSeverity>
<label>extreme</label>
<painOffset>0.15</painOffset>
<lifeThreatening>true</lifeThreatening>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>-0.30</offset>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.20</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.888</minSeverity>
<label>extreme</label>
<painOffset>0.18</painOffset>
<lifeThreatening>true</lifeThreatening>
<capMods>
<li>
<capacity>Consciousness</capacity>
<setMax>0.50</setMax>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.30</offset>
</li>
</capMods>
</li>
<li>
<minSeverity>0.936</minSeverity>
<label>extreme</label>
<painOffset>0.22</painOffset>
<lifeThreatening>true</lifeThreatening>
<capMods>
<li>
<capacity>Consciousness</capacity>
<setMax>0.10</setMax>
</li>
<li>
<capacity>Manipulation</capacity>
<offset>-0.40</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="MechanitesBase">
<defName>Boobitis</defName>
<label>boobitis</label>
<description>Boobitis is a highly contagious mechanite plague that causes permanent breast growth if left untreated. It was initialy created as a harmless glittertech "party drug" but has since mutated and spread to virtually every human colony.</description>
<stages>
<li>
<painOffset>0.1</painOffset>
<label>subtle swelling</label>
<statOffsets>
<SexAbility>0.1</SexAbility>
<Vulnerability>0.1</Vulnerability>
</statOffsets>
</li>
<li>
<minSeverity>0.5</minSeverity>
<label>noticable swelling</label>
<painOffset>0.2</painOffset>
<statOffsets>
<SexAbility>0.2</SexAbility>
<Vulnerability>0.3</Vulnerability>
</statOffsets>
</li>
<li>
<minSeverity>0.9</minSeverity>
<label>spectacular swelling</label>
<painOffset>0.3</painOffset>
<statOffsets>
<SexAbility>0.3</SexAbility>
<Vulnerability>0.5</Vulnerability>
</statOffsets>
</li>
</stages>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_STDs.xml
|
XML
|
mit
| 9,794 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef>
<defName>RJW_BabyState</defName>
<hediffClass>rjw.Hediff_SimpleBaby</hediffClass>
<label>child is growing</label>
<initialSeverity>0.1</initialSeverity>
<stages>
<li>
<label>baby</label>
<minSeverity>0.1</minSeverity>
<capMods>
<li>
<capacity>Moving</capacity>
<setMax>0</setMax>
</li>
<li>
<capacity>Talking</capacity>
<setMax>0</setMax>
</li>
</capMods>
</li>
<li>
<label>toddler</label>
<minSeverity>0.5</minSeverity>
<capMods>
<li>
<capacity>Manipulation</capacity>
<offset>-1.0</offset>
</li>
<li>
<capacity>Talking</capacity>
<offset>-0.5</offset>
</li>
<li>
<capacity>Moving</capacity>
<offset>-0.35</offset>
</li>
</capMods>
</li>
<li>
<label>child</label>
<minSeverity>0.75</minSeverity>
</li>
</stages>
</HediffDef>
<!-- This only exists separately from BabyState to get around a bug making children drop their weapons on savegame load.-->
<HediffDef>
<defName>RJW_NoManipulationFlag</defName>
<hediffClass>HediffWithComps</hediffClass>
<label>Too young to work</label>
<initialSeverity>0.001</initialSeverity>
<stages>
<li>
<!--<everVisible>false</everVisible>-->
<capMods>
<li>
<capacity>Manipulation</capacity>
<setMax>0.0</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
<!-- Use CnP's UnhappyBaby instead
<HediffDef>
<defName>RJW_UnhappyBaby</defName>
<hediffClass>rjw.Hediff_SimpleUnhappyBaby</hediffClass>
<label>unhappy baby</label>
</HediffDef>
-->
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_SimpleBaby.xml
|
XML
|
mit
| 1,689 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef>
<defName>Sterilized</defName>
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(0.8, 0.8, 0.35)</defaultLabelColor>
<label>sterilized</label>
<stages>
<li>
<capMods>
<li>
<capacity>Reproduction</capacity>
<setMax>0</setMax>
</li>
</capMods>
</li>
</stages>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_Sterilized.xml
|
XML
|
mit
| 402 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef>
<defName>Hediff_Submitting</defName>
<label>Prostrating self</label>
<hediffClass>rjw.Hediff_Submitting</hediffClass>
<defaultLabelColor>(1, 0.41, 0.81)</defaultLabelColor>
<initialSeverity>1.0</initialSeverity>
<minSeverity>1.0</minSeverity>
<maxSeverity>1.0</maxSeverity>
<comps>
<li Class="HediffCompProperties_Disappears">
<disappearsAfterTicks>
<!--1 hour-->
<min>2500</min>
<!--2 hours-->
<max>5000</max>
</disappearsAfterTicks>
</li>
</comps>
<stages>
<li>
<becomeVisible>true</becomeVisible>
<capMods>
<li>
<capacity>Moving</capacity>
<postFactor>0.0</postFactor>
</li>
</capMods>
<statOffsets>
<Vulnerability>0.95</Vulnerability>
</statOffsets>
</li>
</stages>
</HediffDef>
<!-- prevents 10 job stacks error-->
<HediffDef>
<defName>Hediff_RapeEnemyCD</defName>
<label>rape enemy cooldown</label>
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(1, 0.41, 0.81)</defaultLabelColor>
<initialSeverity>1.0</initialSeverity>
<minSeverity>1.0</minSeverity>
<maxSeverity>1.0</maxSeverity>
<comps>
<li Class="HediffCompProperties_Disappears">
<disappearsAfterTicks>
<!--1 hour-->
<min>2500</min>
<max>2500</max>
</disappearsAfterTicks>
</li>
</comps>
<stages>
<li>
<becomeVisible>false</becomeVisible>
</li>
</stages>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_Submitting.xml
|
XML
|
mit
| 1,483 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef Name="Sex_Change_Thoughts_Syndrome" Abstract="True">
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(1, 0.41, 0.71)</defaultLabelColor>
<!--This will start from top severity and go down gradually, the code will change initial severity if needed for particular pawn-->
<initialSeverity>1.0</initialSeverity>
<minSeverity>0.001</minSeverity>
<maxSeverity>1.0</maxSeverity>
<isBad>false</isBad>
<tendable>false</tendable>
<scenarioCanAdd>false</scenarioCanAdd>
<comps>
<li Class="HediffCompProperties_SeverityPerDay">
<severityPerDay>-0.01</severityPerDay>
</li>
<li Class="HediffCompProperties_Disappears">
<!--These are long but lowest stage is actually bonus mood.-->
<!--The code will modify the severity so that some pawns are happy right away and others only get used to it before effect vanishes-->
<disappearsAfterTicks>
<!--60 days (1 year)-->
<min>3600000</min>
<!--1.5 years-->
<max>4800000</max>
</disappearsAfterTicks>
</li>
</comps>
<stages>
<li>
<label>ignorance</label>
<becomeVisible>false</becomeVisible>
</li>
<li>
<label>acceptance</label>
<minSeverity>0.01</minSeverity>
<becomeVisible>false</becomeVisible>
</li>
<li>
<label>saddness</label>
<minSeverity>0.25</minSeverity>
<becomeVisible>false</becomeVisible>
</li>
<li>
<label>anger</label>
<becomeVisible>false</becomeVisible>
<minSeverity>0.4</minSeverity>
</li>
<li>
<label>rejection</label>
<minSeverity>0.7</minSeverity>
<becomeVisible>false</becomeVisible>
</li>
</stages>
</HediffDef>
<!--THese are all the same, the flavor text is different-->
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_male2trap</defName>
<label>male2trap</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_male2female</defName>
<label>male2female</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_male2futa</defName>
<label>male2futa</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_female2trap</defName>
<label>female2trap</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_female2male</defName>
<label>female2male</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_female2futa</defName>
<label>female2futa</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_futa2trap</defName>
<label>futa2trap</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_futa2male</defName>
<label>futa2male</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_futa2female</defName>
<label>futa2female</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_trap2futa</defName>
<label>trap2futa</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_trap2male</defName>
<label>trap2male</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Thoughts_Syndrome">
<defName>hediff_trap2female</defName>
<label>trap2female</label>
</HediffDef>
<!--hidden hediffs to track original sex-->
<HediffDef Name="Sex_Change_Original_Sex" Abstract="True">
<hediffClass>HediffWithComps</hediffClass>
<defaultLabelColor>(1, 0.41, 0.71)</defaultLabelColor>
<maxSeverity>1.0</maxSeverity>
<isBad>false</isBad>
<tendable>false</tendable>
<scenarioCanAdd>false</scenarioCanAdd>
<stages>
<li>
<becomeVisible>false</becomeVisible>
</li>
</stages>
</HediffDef>
<HediffDef ParentName="Sex_Change_Original_Sex">
<defName>hediff_was_boy</defName>
<label>was_boy</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Original_Sex">
<defName>hediff_was_girl</defName>
<label>was_girl</label>
</HediffDef>
<!--whatever this may mean:-->
<HediffDef ParentName="Sex_Change_Original_Sex">
<defName>hediff_was_futa</defName>
<label>was_futa</label>
</HediffDef>
<HediffDef ParentName="Sex_Change_Original_Sex">
<defName>hediff_was_trap</defName>
<label>was_trap</label>
</HediffDef>
</Defs>
|
Mewtopian/rjw
|
Defs/HediffDefs/Hediffs_Transgender.xml
|
XML
|
mit
| 4,403 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<IncidentDef>
<defName>NymphJoins</defName>
<label>nymph joins</label>
<category>Misc</category>
<targetTags>
<li>Map_PlayerHome</li>
</targetTags>
<workerClass>rjw.IncidentWorker_NymphJoins</workerClass>
<baseChance>0.67</baseChance>
<minRefireDays>6</minRefireDays>
</IncidentDef>
<IncidentDef>
<defName>NymphVisitorGroup</defName>
<label>nymph visitor group</label>
<targetTags>
<li>Map_PlayerHome</li>
</targetTags>
<workerClass>rjw.IncidentWorker_NymphVisitorGroup</workerClass>
<category>Misc</category>
<!-- broken, nymph leaves map-->
<baseChance>0</baseChance>
<pointsScaleable>true</pointsScaleable>
</IncidentDef>
</Defs>
|
Mewtopian/rjw
|
Defs/IncidentDef/Incidents_Nymph.xml
|
XML
|
mit
| 726 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<IncidentDef ParentName="DiseaseIncident">
<defName>Disease_Boobitis</defName>
<label>boobitis mechanites</label>
<diseaseIncident>Boobitis</diseaseIncident>
<diseasePartsToAffect>
<li>Chest</li>
</diseasePartsToAffect>
<letterLabel>Disease (boobitis mechanites)</letterLabel>
</IncidentDef>
</Defs>
|
Mewtopian/rjw
|
Defs/IncidentDef/Incidents_STD.xml
|
XML
|
mit
| 368 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<IncidentDef>
<defName>TestInc</defName>
<label>test inc</label>
<category>Misc</category>
<targetTags>
<li>Map_PlayerHome</li>
</targetTags>
<workerClass>rjw.IncidentWorker_TestInc</workerClass>
<letterLabel>Something Happened</letterLabel>
<letterText>Something Happened</letterText>
<letterDef>ThreatSmall</letterDef>
<baseChance>0.0</baseChance>
<minRefireDays>9999</minRefireDays>
</IncidentDef>
<IncidentDef>
<defName>TestInc2</defName>
<label>test inc2</label>
<category>Misc</category>
<targetTags>
<li>Map_PlayerHome</li>
</targetTags>
<workerClass>rjw.IncidentWorker_TestInc2</workerClass>
<letterLabel>Something Happened2</letterLabel>
<letterText>Something Happened2</letterText>
<letterDef>ThreatSmall</letterDef>
<baseChance>0.0</baseChance>
<minRefireDays>9999</minRefireDays>
</IncidentDef>
</Defs>
|
Mewtopian/rjw
|
Defs/IncidentDef/Incidents_Testing.xml
|
XML
|
mit
| 917 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<InteractionDef>
<defName>AnalBreeding</defName>
<label>anal breeding</label>
<workerClass>rjw.InteractionWorker_AnalSexAttempt</workerClass>
<symbol>UI/Commands/Breeding_Animal_off</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Mounted [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was anally mounted by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>VaginalBreeding</defName>
<label>vaginal breeding</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Commands/Breeding_Animal_off</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Mounted [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was mounted by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>OralBreeding</defName>
<label>oral breeding</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Commands/Breeding_Animal_off</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Licked [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was licked by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>ForcedFellatioBreeding</defName>
<label>oral breeding</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Commands/Breeding_Animal_off</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Face fucked [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was face fucked.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<!-- This can only happen if the player disables the other types, which makes things go weird... -->
<InteractionDef>
<defName>ForcedOralBreeding</defName>
<label>oral breeding</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Commands/Breeding_Animal_off</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Forced oral sex from [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was forced into giving oral.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<!-- Another rare one, but needed to get the icons working right. -->
<InteractionDef>
<defName>FingeringBreeding</defName>
<label>fingering</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Commands/Breeding_Animal_off</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Fingered [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was fingered by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>RequestBreeding</defName>
<label>request breeding</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Commands/Breeding_Animal_off</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->[RECIPIENT_nameDef] presented to [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Presented to [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>RequestAnalBreeding</defName>
<label>request breeding</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Commands/Breeding_Animal_off</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->[RECIPIENT_nameDef] presented to [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Presented to [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
</Defs>
|
Mewtopian/rjw
|
Defs/InteractionDef/Interactions_Breed.xml
|
XML
|
mit
| 4,754 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<InteractionDef>
<defName>Rimming</defName>
<label>rimming</label>
<workerClass>rjw.InteractionWorker_AnalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Rimmed [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was rimmed.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>Cunnilingus</defName>
<label>cunnilingus</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings> <!-- these are only the first part the log, need to keep it short.-->
<li>r_logentry->Gave cunnilingus.</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Received cunnilingus.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>Fellatio</defName>
<label>Fellatio</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Fellated [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was fellated.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
</Defs>
|
Mewtopian/rjw
|
Defs/InteractionDef/Interactions_Oral.xml
|
XML
|
mit
| 1,859 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<InteractionDef>
<defName>AnalRape</defName>
<label>anal rape</label>
<workerClass>rjw.InteractionWorker_AnalSexAttempt</workerClass>
<symbol>UI/Icons/noheart</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>StoleSomeLovin</recipientThought>
<initiatorXpGainSkill>Melee</initiatorXpGainSkill>
<initiatorXpGainAmount>30</initiatorXpGainAmount>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Raped [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was raped by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>VaginalRape</defName>
<label>vaginal rape</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Icons/noheart</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>StoleSomeLovin</recipientThought>
<initiatorXpGainSkill>Melee</initiatorXpGainSkill>
<initiatorXpGainAmount>30</initiatorXpGainAmount>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Raped [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was raped by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>HandjobRape</defName>
<label>forced handjob</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Icons/noheart</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>StoleSomeLovin</recipientThought>
<initiatorXpGainSkill>Melee</initiatorXpGainSkill>
<initiatorXpGainAmount>30</initiatorXpGainAmount>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Forcibly jerked off [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was jerked off by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>FingeringRape</defName>
<label>forced fingering</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Icons/noheart</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>StoleSomeLovin</recipientThought>
<initiatorXpGainSkill>Melee</initiatorXpGainSkill>
<initiatorXpGainAmount>30</initiatorXpGainAmount>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Forcibly fingered [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was finger-raped by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>ViolateCorpse</defName>
<label>necrophilia</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Icons/noheart</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>StoleSomeLovin</recipientThought>
<initiatorXpGainSkill>Melee</initiatorXpGainSkill>
<initiatorXpGainAmount>30</initiatorXpGainAmount>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Violated [RECIPIENT_nameDef]'s corpse.</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was violated by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>MechImplant</defName>
<label>mechanoid implanting</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Icons/noheart</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<!--<recipientThought>StoleSomeLovin</recipientThought>-->
<!--<initiatorXpGainSkill>Melee</initiatorXpGainSkill>-->
<!--<initiatorXpGainAmount>30</initiatorXpGainAmount>-->
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Assaulted [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was assaulted by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>OtherRape</defName>
<label>rape</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>UI/Icons/noheart</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>StoleSomeLovin</recipientThought>
<initiatorXpGainSkill>Melee</initiatorXpGainSkill>
<initiatorXpGainAmount>30</initiatorXpGainAmount>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Raped [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was raped by [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
</Defs>
|
Mewtopian/rjw
|
Defs/InteractionDef/Interactions_Rape.xml
|
XML
|
mit
| 4,986 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<InteractionDef>
<defName>AnalSex</defName>
<label>anal sex</label>
<workerClass>rjw.InteractionWorker_AnalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Had anal sex with [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Had anal sex with [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>VaginalSex</defName>
<label>vaginal sex</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Had sex with [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Had sex with [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>DoublePenetration</defName>
<label>double-penetration</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Double-penetrated [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was double-penetrated.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>Breastjob</defName>
<label>breastjob</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Gave a breastjob to [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Received a breastjob.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>Handjob</defName>
<label>handjob</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Gave a Handjob.</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Received a Handjob.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>Footjob</defName>
<label>footjob</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Gave a footjob.</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Received a footjob.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>Beakjob</defName>
<label>beakjob</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Gave a beakjob.</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Received a beakjob.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>Fingering</defName>
<label>fingering</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Fingered [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was fingered.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>Scissoring</defName>
<label>scissoring</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Scissored with [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Scissored with [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>MutualMasturbation</defName>
<label>mutual masturbation</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Engaged in mutual masturbation.</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Engaged in mutual masturbation.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>Fisting</defName>
<label>fisting</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->Fisted [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->Was fisted.</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<InteractionDef>
<defName>Sixtynine</defName>
<label>69ing</label>
<workerClass>rjw.InteractionWorker_VaginalSexAttempt</workerClass>
<symbol>Things/Mote/SpeechSymbols/Romance</symbol>
<socialFightBaseChance>0.0</socialFightBaseChance>
<recipientThought>MadeSomeLovin</recipientThought>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry->69'd with [RECIPIENT_nameDef].</li>
</rulesStrings>
</logRulesInitiator>
<logRulesRecipient>
<rulesStrings>
<li>r_logentry->69'd with [INITIATOR_nameDef].</li>
</rulesStrings>
</logRulesRecipient>
</InteractionDef>
<!-- Experimenting with sex dialogue. This was easiest to add, but the same method could be used to add pillow talk, etc.-->
<InteractionDef>
<defName>AnimalSexChat</defName>
<label>animal chat</label>
<symbol>Things/Mote/SpeechSymbols/AnimalChat</symbol>
<initiatorXpGainSkill>Animals</initiatorXpGainSkill>
<initiatorXpGainAmount>40</initiatorXpGainAmount>
<logRulesInitiator>
<rulesStrings>
<li>r_logentry(p=20)->[INITIATOR_nameDef] [zooact] [RECIPIENT_nameDef].</li>
<li>r_logentry->[INITIATOR_nameDef] sat near [RECIPIENT_nameDef] and talked to [INITIATOR_objective]self about [TalkTopicSex].</li>
<li>r_logentry->[INITIATOR_nameDef] sat near [RECIPIENT_nameDef] and talked to [INITIATOR_objective]self about [TalkTopicAny].</li>
<li>r_logentry->[INITIATOR_nameDef] approached [RECIPIENT_nameDef] while whispering to [INITIATOR_objective]self about [TalkTopicSex].</li>
<li>r_logentry->[INITIATOR_nameDef] approached [RECIPIENT_nameDef] while whispering to [INITIATOR_objective]self about [TalkTopicAny].</li>
<li>r_logentry(p=2)->[INITIATOR_nameDef] came near [RECIPIENT_nameDef] while talking to [INITIATOR_objective]self about [TalkTopicSex].</li>
<li>r_logentry->[INITIATOR_nameDef] came near [RECIPIENT_nameDef] while talking to [INITIATOR_objective]self about [TalkTopicAny].</li>
<li>r_logentry->[INITIATOR_nameDef] tried to make [RECIPIENT_nameDef] sit still.</li>
<li>r_logentry->[INITIATOR_nameDef] attempted to hold [RECIPIENT_nameDef] still.</li>
<li>r_logentry->[INITIATOR_nameDef] slapped [RECIPIENT_nameDef] in a show of dominance.</li>
<li>r_logentry->[INITIATOR_nameDef] gently stroked [RECIPIENT_nameDef]'s genitals.</li>
<li>r_logentry->[INITIATOR_nameDef] grasped a vulnerable body part of [RECIPIENT_nameDef], demanding obedience.</li>
<li>zooact->demanded obedience from</li>
<li>zooact->made calming noises towards</li>
<li>zooact->offered slow, friendly gestures to</li>
<li>zooact->made shushing noises at</li>
<li>zooact->made happy clicking noises at</li>
<li>zooact->gestured gently and approached</li>
<li>zooact->slowly approached</li>
<li>zooact->gently touched</li>
<li>zooact->gently caressed</li>
<li>zooact->firmly stroked</li>
<li>zooact->calmed and encouraged</li>
<li>zooact->matched breathing with</li>
<li>zooact->took a low stance while approaching</li>
<li>zooact->showed no fear or anger to</li>
<li>zooact->firmly yet softly touched</li>
<li>zooact->showed a relaxed attitude towards</li>
<li>zooact->showed [INITIATOR_possessive] genitals to</li>
<li>zooact->presented [INITIATOR_possessive] genitals to</li>
<li>zooact->whispered a story about [TalkTopicAny] to</li>
<li>zooact->whispered a story about [TalkTopicSex] to</li>
</rulesStrings>
</logRulesInitiator>
</InteractionDef>
</Defs>
|
Mewtopian/rjw
|
Defs/InteractionDef/Interactions_Sex.xml
|
XML
|
mit
| 10,077 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<JobDef>
<defName>Breed</defName>
<driverClass>rjw.JobDriver_Breeding</driverClass>
<reportString>breeding</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>Bestiality</defName>
<driverClass>rjw.JobDriver_BestialityForMale</driverClass>
<reportString>lovin' animal</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>BestialityForFemale</defName>
<driverClass>rjw.JobDriver_BestialityForFemale</driverClass>
<reportString>lovin' animal</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
</Defs>
|
Mewtopian/rjw
|
Defs/JobDefs/Jobs_Bestiality.xml
|
XML
|
mit
| 679 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<JobDef>
<defName>StruggleInBondageGear</defName>
<driverClass>rjw.JobDriver_StruggleInBondageGear</driverClass>
<reportString>struggling</reportString>
</JobDef>
<JobDef>
<defName>UnlockBondageGear</defName>
<driverClass>rjw.JobDriver_UseItemOn</driverClass>
<reportString>unlocking</reportString>
</JobDef>
<JobDef>
<defName>GiveBondageGear</defName>
<driverClass>rjw.JobDriver_UseItemOn</driverClass>
<reportString>equipping</reportString>
</JobDef>
</Defs>
|
Mewtopian/rjw
|
Defs/JobDefs/Jobs_Bondage.xml
|
XML
|
mit
| 534 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<JobDef>
<defName>CleanSelf</defName>
<driverClass>rjw.JobDriver_CleanSelf</driverClass>
<reportString>cleaning self</reportString>
<casualInterruptible>true</casualInterruptible>
</JobDef>
</Defs>
|
Mewtopian/rjw
|
Defs/JobDefs/Jobs_Bukkake.xml
|
XML
|
mit
| 255 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<JobDef>
<defName>JoinInBed</defName>
<driverClass>rjw.JobDriver_JoinInBed</driverClass>
<reportString>joining someone in bed.</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
</Defs>
|
Mewtopian/rjw
|
Defs/JobDefs/Jobs_CasualSex.xml
|
XML
|
mit
| 266 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!--
<JobDef>
<defName>MilkHuman</defName>
<driverClass>rjw.JobDriver_MilkHuman</driverClass>
<reportString>milking TargetA.</reportString>
<allowOpportunisticPrefix>true</allowOpportunisticPrefix>
</JobDef>
-->
</Defs>
|
Mewtopian/rjw
|
Defs/JobDefs/Jobs_Milk.xml
|
XML
|
mit
| 280 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<JobDef>
<defName>Fappin</defName>
<driverClass>rjw.JobDriver_Fappin</driverClass>
<reportString>masturbatin'.</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>QuickFap</defName>
<driverClass>rjw.JobDriver_QuickFap</driverClass>
<reportString>masturbatin'.</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>GettinLoved</defName>
<driverClass>rjw.JobDriver_GettinLoved</driverClass>
<reportString>lovin'.</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>GettinRaped</defName>
<driverClass>rjw.JobDriver_GettinRaped</driverClass>
<reportString>gettin' raped.</reportString>
<checkOverrideOnDamage>Never</checkOverrideOnDamage>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>GettinBred</defName>
<driverClass>rjw.JobDriver_GettinRaped</driverClass>
<reportString>gettin' bred.</reportString>
<checkOverrideOnDamage>Never</checkOverrideOnDamage>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>GettinLicked</defName>
<driverClass>rjw.JobDriver_GettinLoved</driverClass>
<reportString>gettin' licked.</reportString>
<checkOverrideOnDamage>Never</checkOverrideOnDamage>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>GettinSucked</defName>
<driverClass>rjw.JobDriver_GettinLoved</driverClass>
<reportString>gettin' sucked.</reportString>
<checkOverrideOnDamage>Never</checkOverrideOnDamage>
<casualInterruptible>false</casualInterruptible>
</JobDef>
</Defs>
|
Mewtopian/rjw
|
Defs/JobDefs/Jobs_Misc.xml
|
XML
|
mit
| 1,700 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<JobDef>
<defName>ViolateCorpse</defName>
<driverClass>rjw.JobDriver_ViolateCorpse</driverClass>
<reportString>violating corpse</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
</Defs>
|
Mewtopian/rjw
|
Defs/JobDefs/Jobs_Necrophile.xml
|
XML
|
mit
| 267 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<JobDef>
<defName>ComfortPrisonerRapin</defName>
<driverClass>rjw.JobDriver_PrisonerComfortRapin</driverClass>
<reportString>rapin' CP</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>RandomRape</defName>
<driverClass>rjw.JobDriver_RandomRape</driverClass>
<reportString>randomly raping</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef Class="rjw.JobDef_RapeEnemy">
<defName>RapeEnemy</defName>
<driverClass>rjw.JobDriver_RapeEnemy</driverClass>
<reportString>Rapin' Enemy</reportString>
<priority>100</priority>
<!-- High value is high priority. -->
<!-- Add defNames to do this type of rape-->
<TargetDefNames>
</TargetDefNames>
</JobDef>
<JobDef Class="rjw.JobDef_RapeEnemy">
<defName>RapeEnemyByInsect</defName>
<!-- Rape to plant egg. see Hediffs_EnemyImplants.xml more detail-->
<driverClass>rjw.JobDriver_RapeEnemyByInsect</driverClass>
<reportString>Rapin' Enemy</reportString>
<priority>1000</priority>
<TargetDefNames>
</TargetDefNames>
</JobDef>
<JobDef Class="rjw.JobDef_RapeEnemy">
<defName>RapeEnemyByAnimal</defName>
<!-- Mainly do nothing. -->
<driverClass>rjw.JobDriver_RapeEnemyByAnimal</driverClass>
<reportString>Rapin' Enemy</reportString>
<priority>1000</priority>
<TargetDefNames>
</TargetDefNames>
</JobDef>
<JobDef Class="rjw.JobDef_RapeEnemy">
<defName>RapeEnemyByMech</defName>
<!-- Rape to Implant something. see Hediffs_EnemyImplants.xml more detail-->
<driverClass>rjw.JobDriver_RapeEnemyByMech</driverClass>
<reportString>Rapin' Enemy</reportString>
<priority>1000</priority>
<TargetDefNames>
</TargetDefNames>
</JobDef>
<JobDef Class="rjw.JobDef_RapeEnemy">
<defName>RapeEnemyToParasite</defName>
<!-- Rape to pregnant same kind of male.-->
<driverClass>rjw.JobDriver_RapeEnemyToParasite</driverClass>
<reportString>Rapin' Enemy</reportString>
<priority>2000</priority>
<TargetDefNames>
</TargetDefNames>
</JobDef>
</Defs>
|
Mewtopian/rjw
|
Defs/JobDefs/Jobs_Rapist.xml
|
XML
|
mit
| 2,087 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<JobDef>
<defName>WhoreIsServingVisitors</defName>
<driverClass>rjw.JobDriver_WhoreIsServingVisitors</driverClass>
<reportString>serving visitors</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
<JobDef>
<defName>WhoreInvitingVisitors</defName>
<driverClass>rjw.JobDriver_WhoreInvitingVisitors</driverClass>
<reportString>attempting hookup</reportString>
<casualInterruptible>false</casualInterruptible>
</JobDef>
</Defs>
|
Mewtopian/rjw
|
Defs/JobDefs/Jobs_Whore.xml
|
XML
|
mit
| 515 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<MainButtonDef>
<defName>Brothel</defName>
<label>Brothel</label>
<description>List whores in the area.</description>
<tabWindowClass>rjw.MainTab.MainTabWindow_Brothel</tabWindowClass>
<order>53</order>
</MainButtonDef>
</Defs>
|
Mewtopian/rjw
|
Defs/MainTab/MainButtons.xml
|
XML
|
mit
| 290 |
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<PawnColumnDef>
<defName>IsWhore</defName>
<headerTip>indicates whether pawn is whore</headerTip>
<headerIcon>UI/Tab/Service_off</headerIcon>
<workerClass>rjw.MainTab.PawnColumnWorker_IsWhore</workerClass>
<width>80</width>
</PawnColumnDef>
<PawnColumnDef>
<defName>IsComfortPrisoner</defName>
<headerTip>indicates whether pawn is comfort prisoner</headerTip>
<headerIcon>UI/Tab/ComfortPrisoner_off</headerIcon>
<workerClass>rjw.MainTab.PawnColumnWorker_IsComfortPrisoner</workerClass>
<width>80</width>
</PawnColumnDef>
<PawnColumnDef>
<defName>RoomAdjustmentOfWhore</defName>
<headerTip>room adjustment value of whore</headerTip>
<label>Room</label>
<workerClass>rjw.MainTab.PawnColumnWorker_RoomAdjustmentOfWhore</workerClass>
<sortable>true</sortable>
<width>100</width>
</PawnColumnDef>
<PawnColumnDef>
<defName>PriceRangeOfWhore</defName>
<headerTip>price range for whore</headerTip>
<label>Price</label>
<workerClass>rjw.MainTab.PawnColumnWorker_PriceRangeOfWhore</workerClass>
<sortable>true</sortable>
<width>100</width>
</PawnColumnDef>
<PawnColumnDef>
<defName>EarnedMoneyByWhore</defName>
<headerTip>money earned by whore</headerTip>
<label>Earned</label>
<workerClass>rjw.MainTab.PawnColumnWorker_EarnedMoneyByWhore</workerClass>
<sortable>true</sortable>
<width>100</width>
</PawnColumnDef>
<PawnColumnDef>
<defName>CountOfWhore</defName>
<headerTip>clients served</headerTip>
<label>Clients</label>
<workerClass>rjw.MainTab.PawnColumnWorker_CountOfWhore</workerClass>
<sortable>true</sortable>
<width>100</width>
</PawnColumnDef>
<PawnColumnDef>
<defName>AverageMoneyByWhore</defName>
<headerTip>average money earned by whore</headerTip>
<label>Average</label>
<workerClass>rjw.MainTab.PawnColumnWorker_AverageMoneyByWhore</workerClass>
<sortable>true</sortable>
<width>100</width>
</PawnColumnDef>
<PawnColumnDef>
<defName>Mood</defName>
<headerTip>mood of pawn</headerTip>
<label>Mood</label>
<workerClass>rjw.MainTab.PawnColumnWorker_Mood</workerClass>
<sortable>true</sortable>
<width>100</width>
</PawnColumnDef>
</Defs>
|
Mewtopian/rjw
|
Defs/MainTab/PawnColumnDefs/PawnColumns.xml
|
XML
|
mit
| 2,198 |
<?xml version="1.0" encoding="utf-8"?>
<Defs>
<PawnTableDef>
<defName>Brothel</defName>
<workerClass>rjw.MainTab.PawnTable_Whores</workerClass>
<columns>
<li>Label</li>
<li>IsWhore</li>
<li>IsComfortPrisoner</li>
<li>Mood</li>
<li>GapTiny</li>
<li>CountOfWhore</li>
<li>EarnedMoneyByWhore</li>
<li>AverageMoneyByWhore</li>
<li>GapTiny</li>
<li>PriceRangeOfWhore</li>
<li>RoomAdjustmentOfWhore</li>
<li>RemainingSpace</li>
</columns>
</PawnTableDef>
</Defs>
|
Mewtopian/rjw
|
Defs/MainTab/PawnTableDefs.xml
|
XML
|
mit
| 508 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<rjw.SexualMentalStateDef Abstract="True" Name="RJW_BaseMentalState" ParentName="BaseMentalState">
<stateClass>rjw.SexualMentalState</stateClass>
<workerClass>rjw.SexualMentalStateWorker</workerClass>
<requireCanFuck>true</requireCanFuck>
<requireCanBeFuck>true</requireCanBeFuck>
<requireCanRape>true</requireCanRape>
<requireCanGetRaped>true</requireCanGetRaped>
</rjw.SexualMentalStateDef>
<rjw.SexualMentalBreakDef Abstract="True" Name="BaseSexualMentalBreak">
<commonalityMultiplierBySexNeed>
<points>
<li>(0, 2)</li>
<li>(50, 0)</li>
</points>
</commonalityMultiplierBySexNeed>
</rjw.SexualMentalBreakDef>
<rjw.SexualMentalBreakDef ParentName="BaseSexualMentalBreak">
<defName>RandomRape</defName>
<mentalState>RandomRape</mentalState>
<baseCommonality>1.5</baseCommonality>
<intensity>Extreme</intensity>
<commonalityMultiplierBySexNeed>
<points>
<li>(0, 2)</li>
<li>(50, 0)</li>
</points>
</commonalityMultiplierBySexNeed>
</rjw.SexualMentalBreakDef>
<rjw.SexualMentalStateDef ParentName="RJW_BaseMentalState">
<defName>RandomRape</defName>
<stateClass>rjw.MentalState_RandomRape</stateClass>
<label>random rape</label>
<category>Malicious</category>
<prisonersCanDo>false</prisonersCanDo>
<colonistsOnly>true</colonistsOnly>
<minTicksBeforeRecovery>30000</minTicksBeforeRecovery>
<recoveryMtbDays>0.8</recoveryMtbDays>
<maxTicksBeforeRecovery>80000</maxTicksBeforeRecovery>
<nameColor>(0.5, 0.9, 0.5)</nameColor>
<beginLetterLabel>random rape</beginLetterLabel>
<beginLetter>{0} is sexually frustrated and is looking for a rape target.</beginLetter>
<beginLetterDef>ThreatSmall</beginLetterDef>
<recoveryMessage>{0} is sexually satisfied and no longer raping randomly.</recoveryMessage>
<baseInspectLine>Mental state: Random Rape</baseInspectLine>
<recoverFromSleep>true</recoverFromSleep>
<!--<recoverFromDowned>true</recoverFromDowned>-->
<unspawnedCanDo>true</unspawnedCanDo>
</rjw.SexualMentalStateDef>
</Defs>
|
Mewtopian/rjw
|
Defs/MentalStateDefs/MentalStates.xml
|
XML
|
mit
| 2,077 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!--<rjw.MiscTranslationDef>
<defName>DesignatorComfortPrisoner</defName>
<targetClass>rjw.Designator_ComfortPrisoner</targetClass>
<label>comfort prisoner</label>
<description>Designate the prisoner as a tool to satisfy everyone's sexual need.</description>
</rjw.MiscTranslationDef>-->
<rjw.MiscTranslationDef>
<defName>rjw_vatgrown_sex_slave</defName>
<targetClass>rjw.nymph_backstories</targetClass>
<label>Vat-Grown Sex Slave</label>
<description>[PAWN_nameDef] is made as a sex machine, rather than a human. During [PAWN_possessive] growing period in the factory, [PAWN_pronoun] was taught plenty of social skills and sex skills, just to satisfy various sex demands.</description>
<stringA>SexSlave</stringA>
</rjw.MiscTranslationDef>
<rjw.MiscTranslationDef>
<defName>rjw_feisty</defName>
<targetClass>rjw.nymph_backstories</targetClass>
<label>Feisty Nymph</label>
<description>[PAWN_nameDef] struts around the colony like a conqueror examining a newly annexed territory. You try to focus on your work but [PAWN_pronoun] won't let you.\n
"I heard what you said about me!" [PAWN_pronoun] accuses. You didn't say anything about [PAWN_objective]. [PAWN_pronoun] knows that. "Wanna fight?" [PAWN_pronoun] challenges. You already know what [PAWN_pronoun] means: a few minutes of play wrestling and then you take [PAWN_objective], or, if you hesitate, [PAWN_pronoun] takes you.\n
Though [PAWN_nameDef] can be hard to get along with you've come to appreciate how [PAWN_pronoun]'s more practical than the others.\n
You explain to [PAWN_objective], "See these things here? They need to be over there" and "Those people are trying to kill us, so let's kill them first." [PAWN_pronoun] listens, and does what is necessary.</description>
<stringA>Nymph</stringA>
</rjw.MiscTranslationDef>
<rjw.MiscTranslationDef>
<defName>rjw_curious</defName>
<targetClass>rjw.nymph_backstories</targetClass>
<label>Curious Nymph</label>
<description>Hold the covering plate back and place the actuator in slot C. Line the rod up. No, that won't do, it needs to be perfect. Now pop the JC-444 chip in place.\n
Solder the orange wire to pin #16 and the striped wire to pin #5.\n
Suddenly, there [PAWN_pronoun] is. You aren't surprised to see [PAWN_nameDef], you just didn't hear [PAWN_objective] approach. By now you're used to it.\n
You continue your work in silence as [PAWN_pronoun] hovers over you, her large eyes fixated on the rapid, rythmic, deliberate motions of your hands.</description>
<stringA>Nymph</stringA>
</rjw.MiscTranslationDef>
<rjw.MiscTranslationDef>
<defName>rjw_tender</defName>
<targetClass>rjw.nymph_backstories</targetClass>
<label>Tender Nymph</label>
<description>[PAWN_nameDef] has a pair of charming eyes, and [PAWN_possessive] voice is soft and sweet. Due to [PAWN_possessive] previous nurse job, [PAWN_pronoun] tends people quite well.\n
[PAWN_pronoun]'s crouched in the corner, hands over [PAWN_possessive] ears and tears in [PAWN_possessive] eyes. You don't understand, then you notice it: the distant sound of the pained squeals of pigs being slaughtered.</description>
<stringA>Nymph</stringA>
</rjw.MiscTranslationDef>
<rjw.MiscTranslationDef>
<defName>rjw_chatty</defName>
<targetClass>rjw.nymph_backstories</targetClass>
<label>Chatty Nymph</label>
<description>No one can be more loquacious than [PAWN_nameDef]. [PAWN_pronoun] has a flexible tongue, a sharp mind, and hot lips.</description>
<stringA>Nymph</stringA>
</rjw.MiscTranslationDef>
<rjw.MiscTranslationDef>
<defName>rjw_broken</defName>
<targetClass>rjw.nymph_backstories</targetClass>
<label>Broken Nymph</label>
<description>Maybe [PAWN_nameDef] suffered some terrible things, [PAWN_pronoun] looks rather emaciated, and no one wants to speak with [PAWN_objective].\n
[PAWN_pronoun] only behaves a bit vivaciously while staring at some rod-like stuffs.</description>
<stringA>Nymph</stringA>
</rjw.MiscTranslationDef>
</Defs>
|
Mewtopian/rjw
|
Defs/MiscTranslationDef/MiscTranslationDefs.xml
|
XML
|
mit
| 4,044 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<!--Custom races support override-->
<!--pawn.kindDef.race.defName-->
<!--1 part type per race-->
<rjw.StringListDef>
<defName>NoBreasts_filter</defName>
<strings>
<!--<li>Hare</li>-->
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>NoPenis_filter</defName>
<strings>
<!--<li>Hare</li>-->
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>NoVagina_filter</defName>
<strings>
<!--<li>Hare</li>-->
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>NoAnus_filter</defName>
<strings>
<!--<li>Hare</li>-->
<li></li>
</strings>
</rjw.StringListDef>
<!--race can implant eggs, you need to add apropriate egg to Hediffs_EnemyImplants-->
<!--you probably also need to set filter for ovis-->
<rjw.StringListDef>
<defName>EggRace_filter</defName>
<strings>
<li>Alien_NiHal</li>
</strings>
</rjw.StringListDef>
<!-- -->
<rjw.StringListDef>
<defName>Penis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>CatPenis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>DogPenis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>HorsePenis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>DragonPenis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>RaccoonPenis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>Hemipenis_filter</defName>
<strings>
<li>Alien_NiHal</li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>CrocodilianPenis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>DemonTentaclePenis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>DemonPenis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>SlimeTentacles_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>HydraulicPenis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>BionicPenis_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>OvipositorM_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>Vagina_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>CatVagina_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>DogVagina_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>HorseVagina_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>DragonVagina_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>DemonVagina_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>SlimeVagina_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>HydraulicVagina_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>BionicVagina_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>OvipositorF_filter</defName>
<strings>
<li>Alien_NiHal</li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>Breasts_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>HydraulicBreasts_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>BionicBreasts_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>Udder_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>FeaturelessBreasts_filter</defName>
<strings>
<li>Alien_NiHal</li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>SlimeBreasts_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>Anus_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>HydraulicAnus_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>BionicAnus_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>InsectAnus_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>DemonAnus_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
<rjw.StringListDef>
<defName>SlimeAnus_filter</defName>
<strings>
<li></li>
</strings>
</rjw.StringListDef>
</Defs>
|
Mewtopian/rjw
|
Defs/ModRacesParts.xml
|
XML
|
mit
| 5,518 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<NeedDef>
<defName>Sex</defName>
<needClass>rjw.Need_Sex</needClass>
<label>sex</label>
<description>Represents fulfillment of sexual need, which is gained by doing sexual related activities and declined by time & turn-ons. Sleeping pauses the need.</description>
<baseLevel>0.60</baseLevel>
<fallPerDay>0.00</fallPerDay>
<showOnNeedList>true</showOnNeedList>
<listPriority>49</listPriority>
<major>false</major>
<freezeWhileSleeping>true</freezeWhileSleeping>
<minIntelligence>Humanlike</minIntelligence>
<colonistsOnly>false</colonistsOnly>
<showForCaravanMembers>true</showForCaravanMembers>
</NeedDef>
</Defs>
|
Mewtopian/rjw
|
Defs/NeedDefs/Needs_Sex.xml
|
XML
|
mit
| 693 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<rjw.StringListDef>
<defName>NonInheritedTraits</defName>
<!--This list holds defNames of traits that should not be passed from parents to children-->
<!--Actually, it contains most traits I've seen around, but those that should be inherited are commented out-->
<!--If you wish to add other traits, find their<defName> in xml files inside "Defs" folder of the mod that adds them-->
<strings>
<!--Rimworld of Magic-->
<!--<li>Gifted</li>-->
<!--<li>PhysicalProdigy</li>-->
<!--<li>Gladiator</li>-->
<!--<li>InnerFire</li>-->
<!--<li>HeartOfFrost</li>-->
<!--<li>StormBorn</li>-->
<!--<li>Arcanist</li>-->
<!--<li>Druid</li>-->
<!--<li>Paladin</li>-->
<!--<li>Summoner</li>-->
<!--<li>TM_Sniper</li>-->
<!--<li>Bladedancer</li>-->
<!--<li>Necromancer</li>-->
<!--<li>Undead</li>-->
<!--Star Wars-->
<!--<li>PJ_ForceSensitive</li>-->
<!--<li>PJ_JediTrait</li>-->
<!--<li>PJ_SithTrait</li>-->
<!--<li>PJ_GrayTrait</li>-->
<!--Combat Extended?-->
<li>Bravery</li>
<!--Rimworld of apes-->
<!--<li>Orangutan</li>-->
<!--Humanoid alien races-->
<li>Xenophobia</li>
<!--Cthulhu-->
<li>Cults_OathtakerHastur</li>
<li>Cults_OathtakerHastur2</li>
<!--MoreRobots-->
<!--<li>AIRobot_BaseTrait</li>-->
<!--Core-->
<!--<li>SpeedOffset</li>-->
<!--<li>DrugDesire</li>-->
<li>NaturalMood</li>
<!--<li>Nerves</li>-->
<!--<li>Neurotic</li>-->
<li>Industriousness</li>
<!--<li>PsychicSensitivity</li>-->
<li>ShootingAccuracy</li>
<!--<li>Beauty</li>-->
<li>Nudist</li>
<li>Bloodlust</li>
<li>Kind</li>
<li>Psychopath</li>
<li>Cannibal</li>
<li>Abrasive</li>
<!--<li>TooSmart</li>-->
<!--<li>Brawler</li>-->
<li>Masochist</li>
<li>BodyPurist</li>
<li>Transhumanist</li>
<li>GreenThumb</li>
<li>NightOwl</li>
<li>Greedy</li>
<li>Jealous</li>
<li>Ascetic</li>
<!--<li>Gay</li>--><!--CnP does this too!-->
<li>DislikesMen</li>
<li>DislikesWomen</li>
<li>AnnoyingVoice</li>
<li>CreepyBreathing</li>
<li>Pyromaniac</li>
<!--<li>Wimp</li>-->
<!--<li>Nimble</li>-->
<!--<li>FastLearner</li>-->
<!--<li>SuperImmune</li>-->
<!--RJW-->
<li>Nymphomaniac</li>
<li>Rapist</li>
<li>Necrophiliac</li>
<li>Zoophile</li>
<!--Romance diversified-->
<li>Straight</li>
<li>Bisexual</li>
<li>Asexual</li>
<li>Faithful</li>
<li>Philanderer</li>
<li>Polyamorous</li>
<!--Psychology-->
<li>Prude</li>
<!--<li>Insomniac</li>-->
<li>BleedingHeart</li>
<li>Gourmet</li>
<li>Lecher</li>
<li>Codependent</li>
<li>Outdoorsy</li>
<li>Pluviophile</li>
<!--<li>Photosensitive</li>-->
<li>Socialite</li>
<li>Desensitized</li>
<!--<li>HeavySleeper</li>-->
<!--<li>Unstable</li>-->
<li>Polygamous</li>
<li>OpenMinded</li>
<li>Chatty</li>
<li>Sedentary</li>
<!--Consolidated Traits-->
<li>RCT_Aesthete</li>
<li>RCT_AnimalLover</li>
<li>RCT_AnimalHater</li>
<li>RCT_Builder</li>
<li>RCT_Butcher</li>
<li>RCT_Claustrophobic</li>
<!--<li>RCT_ColdLover</li>-->
<!--<li>RCT_DeepSleeper</li>-->
<!--<li>RCT_Dunce</li>-->
<li>RCT_Gourmet</li>
<!--<li>RCT_HeatLover</li>-->
<!--<li>RCT_Aptitude</li>-->
<!--<li>RCT_PainThreshold</li>-->
<li>RCT_Inventor</li>
<!--<li>RCT_Eyesight</li>-->
<li>RCT_NeatFreak</li>
<li>RCT_EatingSpeed</li>
<li>RCT_Nyctophobe</li>
<li>RCT_Perfectionist</li>
<li>RCT_Medic</li>
<li>RCT_Rockhound</li>
<!--<li>RCT_Savant</li>-->
<li>RCT_Trader</li>
<li>RCT_ShootingAccuracy</li>
<li>RCT_Diplomat</li>
<li>RCT_BrownThumb</li>
<li>RCT_GreenThumb</li>
<!--[SYR] Individuality-->
<li>SYR_GreenThumb</li>
<li>SYR_Digger</li>
<li>SYR_Chef</li>
<li>SYR_Tinkerer</li>
<li>SYR_Scientist</li> <!-- should maybe be inheritable? -->
<li>SYR_Architect</li>
<!--<li>SYR_Peculiar</li>-->
<!--<li>SYR_GoodFortune</li>-->
<li>SYR_Haggler</li>
<!--<li>SYR_AnimalAffinity</li>-->
<li>SYR_MedicalTraining</li>
<!--<li>SYR_Hotblooded</li>-->
<!--Westerado-->
<li>Frontiersman_Westerado</li>
<!--<li>DeadEyeTraits_Westerado</li>-->
<!--<li>DollarTrilogyTraits_Westerado</li>-->
</strings>
</rjw.StringListDef>
</Defs>
<!--Now should we do that filtering I wonder.
After all, even many behavioral quirks are to certain extent determined by internal makeup of organism.
Which in turn is determined by genes. And they are also determined by communication with parents, which we do not simulate
but could make up for that by copying traits.-->
|
Mewtopian/rjw
|
Defs/NonInheritedTraits.xml
|
XML
|
mit
| 4,726 |
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<PawnCapacityDef>
<defName>Reproduction</defName>
<workerClass>rjw.PawnCapacityWorker_Fertility</workerClass>
<label>fertility</label>
<listOrder>200</listOrder>
<lethalFlesh>false</lethalFlesh>
<showOnMechanoids>false</showOnMechanoids>
</PawnCapacityDef>
</Defs>
|
Mewtopian/rjw
|
Defs/PawnCapacityDefs/PawnCapacity_Fertility.xml
|
XML
|
mit
| 329 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.